diff --git a/openmetadata-ui/src/main/resources/ui/playwright/constant/settings.ts b/openmetadata-ui/src/main/resources/ui/playwright/constant/settings.ts index 33b31e87e7d..037403f28ce 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/constant/settings.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/constant/settings.ts @@ -147,10 +147,7 @@ export const SETTINGS_OPTIONS_PATH = { GlobalSettingsMenuCategory.MEMBERS, `${GlobalSettingsMenuCategory.MEMBERS}.${GlobalSettingOptions.ADMINS}`, ], - [GlobalSettingOptions.PERSONA]: [ - GlobalSettingsMenuCategory.MEMBERS, - `${GlobalSettingsMenuCategory.MEMBERS}.${GlobalSettingOptions.PERSONA}`, - ], + [GlobalSettingOptions.PERSONA]: [GlobalSettingOptions.PERSONA], // Access Control @@ -165,10 +162,6 @@ export const SETTINGS_OPTIONS_PATH = { // Open-metadata - [GlobalSettingOptions.CUSTOMIZE_LANDING_PAGE]: [ - GlobalSettingsMenuCategory.PREFERENCES, - `${GlobalSettingsMenuCategory.PREFERENCES}.${GlobalSettingOptions.CUSTOMIZE_LANDING_PAGE}`, - ], [GlobalSettingOptions.EMAIL]: [ GlobalSettingsMenuCategory.PREFERENCES, `${GlobalSettingsMenuCategory.PREFERENCES}.${GlobalSettingOptions.EMAIL}`, diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/PersonaFlow.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/PersonaFlow.spec.ts index 720a33b3b16..50aec87f6ab 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/PersonaFlow.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/PersonaFlow.spec.ts @@ -102,15 +102,7 @@ test.describe.serial('Persona operations', () => { // Verify created persona details await expect( - page - .getByTestId('persona-details-card') - .getByText(PERSONA_DETAILS.displayName) - ).toBeVisible(); - - await expect( - page - .getByTestId('persona-details-card') - .getByText(PERSONA_DETAILS.description) + page.getByTestId(`persona-details-card-${PERSONA_DETAILS.name}`) ).toBeVisible(); const personaResponse = page.waitForResponse( @@ -120,8 +112,7 @@ test.describe.serial('Persona operations', () => { ); await page - .locator('[data-testid="persona-details-card"]') - .getByText(PERSONA_DETAILS.displayName) + .getByTestId(`persona-details-card-${PERSONA_DETAILS.name}`) .click(); await personaResponse; @@ -153,8 +144,7 @@ test.describe.serial('Persona operations', () => { page, }) => { await page - .locator('[data-testid="persona-details-card"]') - .getByText(PERSONA_DETAILS.displayName) + .getByTestId(`persona-details-card-${PERSONA_DETAILS.name}`) .click(); await page.getByTestId('edit-description').click(); @@ -180,9 +170,7 @@ test.describe.serial('Persona operations', () => { test('Persona rename flow should work properly', async ({ page }) => { await page - .locator('[data-testid="persona-details-card"]') - .getByText(PERSONA_DETAILS.displayName) - + .getByTestId(`persona-details-card-${PERSONA_DETAILS.name}`) .click(); await updatePersonaDisplayName({ page, displayName: 'Test Persona' }); @@ -203,8 +191,7 @@ test.describe.serial('Persona operations', () => { test('Remove users in persona should work properly', async ({ page }) => { await page - .locator('[data-testid="persona-details-card"]') - .getByText(PERSONA_DETAILS.displayName) + .getByTestId(`persona-details-card-${PERSONA_DETAILS.name}`) .click(); await page @@ -231,8 +218,7 @@ test.describe.serial('Persona operations', () => { test('Delete persona should work properly', async ({ page }) => { await page - .locator('[data-testid="persona-details-card"]') - .getByText(PERSONA_DETAILS.displayName) + .getByTestId(`persona-details-card-${PERSONA_DETAILS.name}`) .click(); await page.click('[data-testid="manage-button"]'); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/customizeLandingPage.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/customizeLandingPage.ts index a73082ed969..cd1090fde05 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/customizeLandingPage.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/customizeLandingPage.ts @@ -21,7 +21,7 @@ export const navigateToCustomizeLandingPage = async ( ) => { const getPersonas = page.waitForResponse('/api/v1/personas*'); - await settingClick(page, GlobalSettingOptions.CUSTOMIZE_LANDING_PAGE); + await settingClick(page, GlobalSettingOptions.PERSONA); await getPersonas; @@ -32,9 +32,11 @@ export const navigateToCustomizeLandingPage = async ( ); // Navigate to the customize landing page - await page.click( - `[data-testid="persona-details-card-${personaName}"] [data-testid="customize-page-button"]` - ); + await page.getByTestId(`persona-details-card-${personaName}`).click(); + + await page.getByRole('tab', { name: 'Customize UI' }).click(); + + await page.getByTestId('LandingPage').click(); expect((await getCustomPageDataResponse).status()).toBe( customPageDataResponse diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AppRouter/SettingsRouter.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AppRouter/SettingsRouter.test.tsx index 7071e335ffa..a95c7733767 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AppRouter/SettingsRouter.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AppRouter/SettingsRouter.test.tsx @@ -412,7 +412,7 @@ describe('SettingsRouter', () => { it('should render PersonaPage component for persona list route', async () => { render( - + ); @@ -422,7 +422,7 @@ describe('SettingsRouter', () => { it('should render PersonaDetailsPage component for persona details route', async () => { render( - + ); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AppRouter/SettingsRouter.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AppRouter/SettingsRouter.tsx index c41c19f6e9f..86548c1f67a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AppRouter/SettingsRouter.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AppRouter/SettingsRouter.tsx @@ -160,6 +160,12 @@ const SettingsRouter = () => { {/* Setting Page Routes with categories */} + + { )}> - {/* Roles route start * Do not change the order of these route diff --git a/openmetadata-ui/src/main/resources/ui/src/components/MyData/Persona/PersonaDetailsCard/PersonaDetailsCard.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/MyData/Persona/PersonaDetailsCard/PersonaDetailsCard.test.tsx index dae6a291992..d298dcaca2c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/MyData/Persona/PersonaDetailsCard/PersonaDetailsCard.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/MyData/Persona/PersonaDetailsCard/PersonaDetailsCard.test.tsx @@ -48,7 +48,9 @@ describe('PersonaDetailsCard Component', () => { }); expect( - await screen.findByTestId('persona-details-card') + await screen.findByTestId( + `persona-details-card-${personaWithDescription.name}` + ) ).toBeInTheDocument(); }); @@ -81,7 +83,7 @@ describe('PersonaDetailsCard Component', () => { userEvent.click(personaCardTitle); }); - expect(mockPush).toHaveBeenCalledWith('/settings/members/persona/john-doe'); + expect(mockPush).toHaveBeenCalledWith('/settings/persona/john-doe'); }); it('should not navigate when persona.fullyQualifiedName is missing', async () => { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/MyData/Persona/PersonaDetailsCard/PersonaDetailsCard.tsx b/openmetadata-ui/src/main/resources/ui/src/components/MyData/Persona/PersonaDetailsCard/PersonaDetailsCard.tsx index adaa39a25b7..e6153d7f14d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/MyData/Persona/PersonaDetailsCard/PersonaDetailsCard.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/MyData/Persona/PersonaDetailsCard/PersonaDetailsCard.tsx @@ -37,7 +37,7 @@ export const PersonaDetailsCard = ({ persona }: PersonaDetailsCardProps) => { { ); }; + const handleCustomizeItemClick = (category: string) => { + history.push( + getCustomizePagePath( + personaDetails?.fullyQualifiedName as string, + category as PageType + ) + ); + }; + if (isLoading) { return ; } @@ -232,7 +245,7 @@ export const PersonaDetailsPage = () => { defaultActiveKey="users" items={[ { - label: 'Users', + label: t('label.user-plural'), key: 'users', children: ( { /> ), }, + { + label: t('label.customize-ui'), + key: 'customize-ui', + children: ( + + + + + + ), + }, ]} tabBarExtraContent={ { } = usePaging(); const breadcrumbs: TitleBreadcrumbProps['titleLinks'] = useMemo( - () => - getSettingPageEntityBreadCrumb( - GlobalSettingsMenuCategory.MEMBERS, - t('label.persona-plural') - ), + () => getSettingPageEntityBreadCrumb(GlobalSettingsMenuCategory.PERSONA), [] ); diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/GlobalSettingsClassBase.ts b/openmetadata-ui/src/main/resources/ui/src/utils/GlobalSettingsClassBase.ts index 8160f392b0d..3153f2814f7 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/GlobalSettingsClassBase.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/GlobalSettingsClassBase.ts @@ -17,7 +17,6 @@ import { ReactComponent as AdminIcon } from '../assets/svg/admin-colored.svg'; import { ReactComponent as ApplicationIcon } from '../assets/svg/application-colored.svg'; import { ReactComponent as BotIcon } from '../assets/svg/bot-colored.svg'; import { ReactComponent as AppearanceIcon } from '../assets/svg/custom-logo-colored.svg'; -import { ReactComponent as CustomDashboardLogoIcon } from '../assets/svg/customize-landing-page-colored.svg'; import { ReactComponent as DashboardIcon } from '../assets/svg/dashboard-colored.svg'; import { ReactComponent as DatabaseIcon } from '../assets/svg/database-colored.svg'; import { ReactComponent as EmailIcon } from '../assets/svg/email-colored.svg'; @@ -95,6 +94,10 @@ class GlobalSettingsClassBase { name: t('label.application-plural'), url: GlobalSettingsMenuCategory.APPLICATIONS, }, + [GlobalSettingsMenuCategory.PERSONA]: { + name: t('label.persona'), + url: GlobalSettingsMenuCategory.PERSONA, + }, }; protected updateSettingCategories( @@ -266,14 +269,6 @@ class GlobalSettingsClassBase { key: `${GlobalSettingsMenuCategory.MEMBERS}.${GlobalSettingOptions.ADMINS}`, icon: AdminIcon, }, - - { - label: t('label.persona-plural'), - description: t('message.page-sub-header-for-persona'), - isProtected: Boolean(isAdminUser), - key: `${GlobalSettingsMenuCategory.MEMBERS}.${GlobalSettingOptions.PERSONA}`, - icon: PersonasIcon, - }, ], }, { @@ -311,17 +306,6 @@ class GlobalSettingsClassBase { key: `${GlobalSettingsMenuCategory.PREFERENCES}.${GlobalSettingOptions.APPEARANCE}`, icon: AppearanceIcon, }, - { - label: t('label.customize-entity', { - entity: t('label.landing-page'), - }), - description: t( - 'message.page-sub-header-for-customize-landing-page' - ), - isProtected: Boolean(isAdminUser), - key: `${GlobalSettingsMenuCategory.PREFERENCES}.${GlobalSettingOptions.CUSTOMIZE_LANDING_PAGE}`, - icon: CustomDashboardLogoIcon, - }, { label: t('label.email'), description: t('message.email-configuration-message'), @@ -515,6 +499,13 @@ class GlobalSettingsClassBase { key: GlobalSettingOptions.BOTS, icon: BotIcon, }, + { + category: t('label.persona-plural'), + description: t('message.page-sub-header-for-persona'), + isProtected: Boolean(isAdminUser), + key: GlobalSettingOptions.PERSONA, + icon: PersonasIcon, + }, ]; } } diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/RouterUtils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/RouterUtils.ts index 90e5a2846d9..e5587912b27 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/RouterUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/RouterUtils.ts @@ -569,11 +569,10 @@ export const getClassificationVersionsPath = ( }; export const getPersonaDetailsPath = (fqn: string) => { - let path = ROUTES.SETTINGS_WITH_TAB_FQN; + let path = ROUTES.SETTINGS_WITH_CATEGORY_FQN; path = path - .replace(PLACEHOLDER_SETTING_CATEGORY, GlobalSettingsMenuCategory.MEMBERS) - .replace(PLACEHOLDER_ROUTE_TAB, GlobalSettingOptions.PERSONA) + .replace(PLACEHOLDER_SETTING_CATEGORY, GlobalSettingOptions.PERSONA) .replace(PLACEHOLDER_ROUTE_FQN, getEncodedFqn(fqn)); return path;