diff --git a/cypress/e2e/awx/notifiers/notifiersSharedFunctions.ts b/cypress/e2e/awx/notifiers/notifiersSharedFunctions.ts index 3ef5269611..91ab886424 100644 --- a/cypress/e2e/awx/notifiers/notifiersSharedFunctions.ts +++ b/cypress/e2e/awx/notifiers/notifiersSharedFunctions.ts @@ -12,7 +12,7 @@ export function testNotification( const orgName = randomE2Ename(); cy.createAwxOrganization({ name: orgName }).then(() => { cy.navigateTo('awx', 'notification-templates'); - cy.get(`[data-cy="create-notifier"]`).click(); + cy.getByDataCy('create-notifier').click(); cy.verifyPageTitle('Create notifier'); fillBasicData(notificationName, type); diff --git a/frontend/awx/administration/notifiers/NotifierForm.tsx b/frontend/awx/administration/notifiers/NotifierForm.tsx index 84a8be20de..ed4894d178 100644 --- a/frontend/awx/administration/notifiers/NotifierForm.tsx +++ b/frontend/awx/administration/notifiers/NotifierForm.tsx @@ -72,11 +72,6 @@ function NotifierForm(props: { mode: 'add' | 'edit' }) { const optionsRequest = useOptions(awxAPI`/notification_templates/`); - const breadcrumbs: ICatalogBreadcrumb[] = [ - { label: t('Notifications'), to: getPageUrl(AwxRoute.NotificationTemplates) }, - { label: mode === 'add' ? t('Add') : t('Edit') }, - ]; - if (notifierRequest.error) { return ; } @@ -106,6 +101,18 @@ function NotifierForm(props: { mode: 'add' | 'edit' }) { (defaultValue as CustomizeMessageType).customize_messages = false; } + const breadcrumbs: ICatalogBreadcrumb[] = [ + { label: t('Notifiers'), to: getPageUrl(AwxRoute.NotificationTemplates) }, + { + label: + mode === 'add' + ? t('Create notifier') + : notifierRequest?.data?.name + ? t(`Edit ${notifierRequest.data.name}`) + : t('Edit notifier'), + }, + ]; + if (defaultValue && !messagesEmpty) { (defaultValue as CustomizeMessageType).customize_messages = true; } @@ -191,8 +198,14 @@ function NotifierForm(props: { mode: 'add' | 'edit' }) { return ( submitText={t('Save notifier')}