From d21ee58f027dc1e8decd4c44fe654a5d4eee40c3 Mon Sep 17 00:00:00 2001 From: Sachin Chaurasiya Date: Thu, 10 Oct 2024 12:21:56 +0530 Subject: [PATCH] GEN-1727: Pluralize owner label everywhere (#18117) * GEN-1727: Pluralize owner label everywhere * fix: unit tests * fix: playwright test * adress comments * fix playwright test --- .../e2e/Features/EntitySummaryPanel.spec.ts | 4 ++-- .../e2e/Features/ExploreQuickFilters.spec.ts | 2 +- .../ui/playwright/e2e/Flow/Metric.spec.ts | 2 +- .../playwright/e2e/Pages/ExploreTree.spec.ts | 4 ++-- .../ui/playwright/utils/advancedSearch.ts | 2 +- .../TestSuiteList/TestSuites.component.tsx | 2 +- .../TestSuiteList/TestSuites.test.tsx | 2 +- .../TableQueryRightPanel.component.tsx | 4 ++-- .../AddDomainForm/AddDomainForm.component.tsx | 2 +- .../AddDomainForm/AddDomainForm.test.tsx | 2 +- .../DocumentationTab.component.tsx | 4 ++-- .../SubDomainsTable.component.tsx | 2 +- .../CommonEntitySummaryInfo.test.tsx | 2 +- .../CommonEntitySummaryInfo.tsx | 2 +- .../DataProductSummary.component.tsx | 2 +- .../mocks/CommonEntitySummaryInfo.mock.ts | 2 +- .../AddGlossary/AddGlossary.component.tsx | 2 +- .../AddGlossaryTermForm.component.tsx | 2 +- .../GlossaryDetailsRightPanel.component.tsx | 4 ++-- .../GlossaryDetailsRightPanel.test.tsx | 2 +- .../GlossaryTermTab.component.tsx | 2 +- .../PipelineDetails.component.tsx | 2 +- .../Settings/Services/Services.test.tsx | 2 +- .../components/Settings/Services/Services.tsx | 2 +- .../EntitySummaryDetails.tsx | 2 +- .../OwnerLabel/OwnerLabel.component.tsx | 4 ++-- .../UserTeamSelectableList.component.tsx | 4 ++-- .../src/constants/AdvancedSearch.constants.ts | 12 +++++----- .../ui/src/locale/languages/de-de.json | 1 + .../ui/src/locale/languages/en-us.json | 1 + .../ui/src/locale/languages/es-es.json | 1 + .../ui/src/locale/languages/fr-fr.json | 1 + .../ui/src/locale/languages/he-he.json | 1 + .../ui/src/locale/languages/ja-jp.json | 1 + .../ui/src/locale/languages/nl-nl.json | 1 + .../ui/src/locale/languages/pr-pr.json | 1 + .../ui/src/locale/languages/pt-br.json | 1 + .../ui/src/locale/languages/ru-ru.json | 1 + .../ui/src/locale/languages/zh-cn.json | 1 + .../MetricListPage/MetricListPage.tsx | 2 +- .../ServiceDetailsPage/ServiceDetailsPage.tsx | 2 +- .../ui/src/utils/AdvancedSearchClassBase.ts | 2 +- .../ui/src/utils/Alerts/AlertsUtil.test.tsx | 4 +++- .../ui/src/utils/Alerts/AlertsUtil.tsx | 6 ++--- .../src/utils/Database/Database.util.test.tsx | 2 +- .../ui/src/utils/Database/Database.util.tsx | 2 +- .../ui/src/utils/EntityUtils.test.tsx | 4 ++-- .../resources/ui/src/utils/EntityUtils.tsx | 22 +++++++++---------- .../main/resources/ui/src/utils/FeedUtils.tsx | 2 +- .../src/utils/ServiceMainTabContentUtils.tsx | 2 +- 50 files changed, 77 insertions(+), 64 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/EntitySummaryPanel.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/EntitySummaryPanel.spec.ts index 4ff9e53375d..9606d49f9a8 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/EntitySummaryPanel.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/EntitySummaryPanel.spec.ts @@ -43,7 +43,7 @@ test.describe('Entity Summary Panel', () => { await expect( page.locator('.ant-drawer-title > [data-testid="entity-link"]') ).toBeVisible(); - await expect(page.getByTestId('Owner-value')).toBeVisible(); + await expect(page.getByTestId('Owners-value')).toBeVisible(); await expect(page.getByTestId('Tier-label')).toBeVisible(); await expect(page.getByTestId('Service-label')).toBeVisible(); await expect(page.getByTestId('Usage-label')).toBeVisible(); @@ -58,7 +58,7 @@ test.describe('Entity Summary Panel', () => { await expect( page.locator('.ant-drawer-title > [data-testid="entity-link"]') ).toBeVisible(); - await expect(page.getByTestId('Owner-value')).toBeVisible(); + await expect(page.getByTestId('Owners-value')).toBeVisible(); await expect(page.getByTestId('Tier-label')).toBeVisible(); await expect(page.getByTestId('Service-label')).toBeVisible(); await expect(page.getByTestId('Database-label')).toBeVisible(); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ExploreQuickFilters.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ExploreQuickFilters.spec.ts index c0a0968e49c..3c941f8d775 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ExploreQuickFilters.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ExploreQuickFilters.spec.ts @@ -80,7 +80,7 @@ test('search dropdown should work properly for quick filters', async ({ test('should search for empty or null filters', async ({ page }) => { const items = [ - { label: 'Owner', key: 'owners.displayName.keyword' }, + { label: 'Owners', key: 'owners.displayName.keyword' }, { label: 'Tag', key: 'tags.tagFQN' }, { label: 'Domain', key: 'domain.displayName.keyword' }, { label: 'Tier', key: 'tier.tagFQN' }, diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/Metric.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/Metric.spec.ts index 3e8647d613b..e7638410261 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/Metric.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/Metric.spec.ts @@ -149,7 +149,7 @@ test.describe('Listing page and add Metric flow should work', () => { page.getByRole('cell', { name: 'Glossary Terms', exact: true }) ).toBeVisible(); await expect( - page.getByRole('cell', { name: 'Owner', exact: true }) + page.getByRole('cell', { name: 'Owners', exact: true }) ).toBeVisible(); // check for metric entities in table diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/ExploreTree.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/ExploreTree.spec.ts index 9f0ba1bacd5..9db6cfb2d1c 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/ExploreTree.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/ExploreTree.spec.ts @@ -66,8 +66,8 @@ test.describe('Explore Tree scenarios ', () => { await expect( page.getByTestId('search-dropdown-Domain').locator('span') ).toContainText('Domain'); - await expect(page.getByTestId('search-dropdown-Owner')).toContainText( - 'Owner' + await expect(page.getByTestId('search-dropdown-Owners')).toContainText( + 'Owners' ); await expect( page.getByTestId('search-dropdown-Tag').locator('span') diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/advancedSearch.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/advancedSearch.ts index f2b4e53d41c..783bc7d1dbb 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/advancedSearch.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/advancedSearch.ts @@ -23,7 +23,7 @@ type EntityFields = { export const FIELDS: EntityFields[] = [ { - id: 'Owner', + id: 'Owners', name: 'owners.displayName.keyword', localSearch: false, }, diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuiteList/TestSuites.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuiteList/TestSuites.component.tsx index 18800dd105b..20a328fc28c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuiteList/TestSuites.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuiteList/TestSuites.component.tsx @@ -182,7 +182,7 @@ export const TestSuites = ({ summaryPanel }: { summaryPanel: ReactNode }) => { }, }, { - title: t('label.owner'), + title: t('label.owner-plural'), dataIndex: 'owners', key: 'owners', render: (owners: EntityReference[]) => , diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuiteList/TestSuites.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuiteList/TestSuites.test.tsx index b049a6be7f6..babbd838659 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuiteList/TestSuites.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuiteList/TestSuites.test.tsx @@ -129,7 +129,7 @@ describe('TestSuites component', () => { 'label.name', 'label.test-plural', 'label.success %', - 'label.owner', + 'label.owner-plural', ]); expect(await screen.findByTestId('test-suite-table')).toBeInTheDocument(); expect( diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Database/TableQueries/TableQueryRightPanel/TableQueryRightPanel.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Database/TableQueries/TableQueryRightPanel/TableQueryRightPanel.component.tsx index 209f82e9ec5..d9b58e21778 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Database/TableQueries/TableQueryRightPanel/TableQueryRightPanel.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Database/TableQueries/TableQueryRightPanel/TableQueryRightPanel.component.tsx @@ -86,7 +86,7 @@ const TableQueryRightPanel = ({ - {t('label.owner')} + {t('label.owner-plural')} {(EditAll || EditOwners) && ( @@ -99,7 +99,7 @@ const TableQueryRightPanel = ({ }>