Skip to content

Commit

Permalink
Revert persona (#18681)
Browse files Browse the repository at this point in the history
* Revert "feat: persona based customisation for glossary and glossary term pages (#18454)"

This reverts commit 6fa76ec.

* Revert "chore(ui): move persona as top level settings (#18171)"

This reverts commit 737c076.

* fix tests

* fix playwright
  • Loading branch information
chirag-madlani authored and ulixius9 committed Dec 10, 2024
1 parent 6c080a3 commit 15e519e
Show file tree
Hide file tree
Showing 127 changed files with 1,723 additions and 6,574 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ void post_validKnowledgePanels_as_admin_200_OK(TestInfo test) throws IOException

page =
new Page()
.withPageType(PageType.GLOSSARY_TERM)
.withPageType(PageType.GLOSSARY_TERM_LANDING_PAGE)
.withKnowledgePanels(
List.of(activityFeed.getEntityReference(), myData.getEntityReference()));
fqn =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@
"description": "Link to the resource corresponding to this entity.",
"$ref": "../../type/basic.json#/definitions/href"
},
"uiCustomization": {
"description": "Reference to the UI customization configuration.",
"$ref": "../../type/entityReference.json"
},
"users": {
"description": "Users that are assigned a persona.",
"$ref": "../../type/entityReferenceList.json",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
"type": "string",
"enum": [
"LandingPage",
"Table",
"StoredProcedure",
"Database",
"DatabaseSchema",
"Topic",
"Pipeline",
"Dashboard",
"DashboardDataModel",
"Container",
"SearchIndex",
"Glossary",
"GlossaryTerm",
"Domain"
"TableLandingPage",
"StoredProcedureLandingPage",
"DatabaseLandingPage",
"DatabaseSchemaLandingPage",
"TopicLandingPage",
"PipelineLandingPage",
"DashboardLandingPage",
"DashboardDataModelLandingPage",
"ContainerLandingPage",
"SearchIndexLandingPage",
"GlossaryLandingPage",
"GlossaryTermLandingPage",
"DomainLandingPage"
]
}
},
Expand All @@ -41,12 +41,6 @@
"description": "Configuration for the Knowledge Panel.",
"type": "object"
},
"tabs": {
"description": "Tabs included in this page.",
"type": "array",
"items": { "$ref": "tab.json" },
"default": []
},
"persona": {
"description": "Persona this page belongs to.",
"$ref": "../../type/entityReference.json"
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ export const SETTINGS_OPTIONS_PATH = {
GlobalSettingsMenuCategory.MEMBERS,
`${GlobalSettingsMenuCategory.MEMBERS}.${GlobalSettingOptions.ADMINS}`,
],
[GlobalSettingOptions.PERSONA]: [GlobalSettingOptions.PERSONA],
[GlobalSettingOptions.PERSONA]: [
GlobalSettingsMenuCategory.MEMBERS,
`${GlobalSettingsMenuCategory.MEMBERS}.${GlobalSettingOptions.PERSONA}`,
],

// Access Control

Expand All @@ -164,6 +167,10 @@ 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}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { expect, Page, test as base } from '@playwright/test';
import { PersonaClass } from '../../support/persona/PersonaClass';
import { UserClass } from '../../support/user/UserClass';
import { performAdminLogin } from '../../utils/admin';
import { redirectToHomePage, toastNotification } from '../../utils/common';
import { redirectToHomePage } from '../../utils/common';
import {
checkAllDefaultWidgets,
navigateToCustomizeLandingPage,
Expand Down Expand Up @@ -239,7 +239,11 @@ test.describe('Customize Landing Page Flow', () => {
.click();

// Verify the toast notification
await toastNotification(adminPage, 'Page layout updated successfully.');
const toastNotification = adminPage.locator('.Toastify__toast-body');

await expect(toastNotification).toContainText(
'Page layout updated successfully.'
);

// Check if all widgets are present after resetting the layout
await checkAllDefaultWidgets(adminPage, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,15 @@ test.describe.serial('Persona operations', () => {
// Verify created persona details

await expect(
page.getByTestId(`persona-details-card-${PERSONA_DETAILS.name}`)
page
.getByTestId('persona-details-card')
.getByText(PERSONA_DETAILS.displayName)
).toBeVisible();

await expect(
page
.getByTestId('persona-details-card')
.getByText(PERSONA_DETAILS.description)
).toBeVisible();

const personaResponse = page.waitForResponse(
Expand All @@ -112,7 +120,8 @@ test.describe.serial('Persona operations', () => {
);

await page
.getByTestId(`persona-details-card-${PERSONA_DETAILS.name}`)
.locator('[data-testid="persona-details-card"]')
.getByText(PERSONA_DETAILS.displayName)
.click();

await personaResponse;
Expand Down Expand Up @@ -144,7 +153,8 @@ test.describe.serial('Persona operations', () => {
page,
}) => {
await page
.getByTestId(`persona-details-card-${PERSONA_DETAILS.name}`)
.locator('[data-testid="persona-details-card"]')
.getByText(PERSONA_DETAILS.displayName)
.click();

await page.getByTestId('edit-description').click();
Expand All @@ -170,7 +180,9 @@ test.describe.serial('Persona operations', () => {

test('Persona rename flow should work properly', async ({ page }) => {
await page
.getByTestId(`persona-details-card-${PERSONA_DETAILS.name}`)
.locator('[data-testid="persona-details-card"]')
.getByText(PERSONA_DETAILS.displayName)

.click();

await updatePersonaDisplayName({ page, displayName: 'Test Persona' });
Expand All @@ -191,7 +203,8 @@ test.describe.serial('Persona operations', () => {

test('Remove users in persona should work properly', async ({ page }) => {
await page
.getByTestId(`persona-details-card-${PERSONA_DETAILS.name}`)
.locator('[data-testid="persona-details-card"]')
.getByText(PERSONA_DETAILS.displayName)
.click();

await page
Expand All @@ -218,7 +231,8 @@ test.describe.serial('Persona operations', () => {

test('Delete persona should work properly', async ({ page }) => {
await page
.getByTestId(`persona-details-card-${PERSONA_DETAILS.name}`)
.locator('[data-testid="persona-details-card"]')
.getByText(PERSONA_DETAILS.displayName)
.click();

await page.click('[data-testid="manage-button"]');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ test.describe('Glossary tests', () => {
type: 'Users',
});

await assignTag(page, 'PersonalData.Personal', 'Add', 'tabs');
await assignTag(page, 'PersonalData.Personal');
});

await test.step('Update Glossary Term', async () => {
Expand Down Expand Up @@ -288,7 +288,7 @@ test.describe('Glossary tests', () => {
page,
'PersonalData.Personal',
'Add',
'glossary-term'
'panel-container'
);
});
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ export const navigateToCustomizeLandingPage = async (
) => {
const getPersonas = page.waitForResponse('/api/v1/personas*');

await settingClick(page, GlobalSettingOptions.PERSONA);
await settingClick(page, GlobalSettingOptions.CUSTOMIZE_LANDING_PAGE);

await getPersonas;

const getCustomPageDataResponse = page.waitForResponse(
`/api/v1/docStore/name/persona.${encodeURIComponent(personaName)}`
`/api/v1/docStore/name/persona.${encodeURIComponent(
personaName
)}.Page.LandingPage`
);

// Navigate to the customize landing page
await page.getByTestId(`persona-details-card-${personaName}`).click();

await page.getByRole('tab', { name: 'Customize UI' }).click();

await page.getByTestId('LandingPage').click();
await page.click(
`[data-testid="persona-details-card-${personaName}"] [data-testid="customize-page-button"]`
);

expect((await getCustomPageDataResponse).status()).toBe(
customPageDataResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,10 @@ export const updateDescription = async (
export const assignTag = async (
page: Page,
tag: string,
action: 'Add' | 'Edit' = 'Add',
parentId = 'entity-right-panel'
action: 'Add' | 'Edit' = 'Add'
) => {
await page
.getByTestId(parentId)
.getByTestId('entity-right-panel')
.getByTestId('tags-container')
.getByTestId(action === 'Add' ? 'add-tag' : 'edit-button')
.click();
Expand All @@ -380,7 +379,7 @@ export const assignTag = async (

await expect(
page
.getByTestId(parentId)
.getByTestId('entity-right-panel')
.getByTestId('tags-container')
.getByTestId(`tag-${tag}`)
).toBeVisible();
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 15e519e

Please sign in to comment.