From 56fd62660fdd17c2998e97de38d37085ab6bb200 Mon Sep 17 00:00:00 2001 From: Elena Makarova Date: Mon, 4 Aug 2025 10:48:43 +0300 Subject: [PATCH 1/2] feat(ObjectSummary): remove Acl --- src/containers/Tenant/Acl/Acl.tsx | 32 ------------------- src/containers/Tenant/Acl/i18n/en.json | 4 --- src/containers/Tenant/Acl/i18n/index.ts | 7 ---- .../Tenant/ObjectSummary/ObjectSummary.tsx | 4 --- src/containers/Tenant/TenantPages.tsx | 4 --- src/store/reducers/tenant/constants.ts | 1 - 6 files changed, 52 deletions(-) delete mode 100644 src/containers/Tenant/Acl/Acl.tsx delete mode 100644 src/containers/Tenant/Acl/i18n/en.json delete mode 100644 src/containers/Tenant/Acl/i18n/index.ts diff --git a/src/containers/Tenant/Acl/Acl.tsx b/src/containers/Tenant/Acl/Acl.tsx deleted file mode 100644 index c341b2401c..0000000000 --- a/src/containers/Tenant/Acl/Acl.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import {Button, Flex, Icon, Text} from '@gravity-ui/uikit'; - -import { - TENANT_DIAGNOSTICS_TABS_IDS, - TENANT_PAGES_IDS, -} from '../../../store/reducers/tenant/constants'; -import {setDiagnosticsTab, setTenantPage} from '../../../store/reducers/tenant/tenant'; -import {useTypedDispatch} from '../../../utils/hooks'; - -import i18n from './i18n'; - -import ArrowRightFromSquareIcon from '@gravity-ui/icons/svgs/arrow-right-from-square.svg'; - -export const Acl = () => { - const dispatch = useTypedDispatch(); - - return ( - - {i18n('description_section-moved')} - - - ); -}; diff --git a/src/containers/Tenant/Acl/i18n/en.json b/src/containers/Tenant/Acl/i18n/en.json deleted file mode 100644 index 32948988d0..0000000000 --- a/src/containers/Tenant/Acl/i18n/en.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "description_section-moved": "Section was moved to Diagnostics", - "action-open-in-diagnostics": "Open in Diagnostics" -} diff --git a/src/containers/Tenant/Acl/i18n/index.ts b/src/containers/Tenant/Acl/i18n/index.ts deleted file mode 100644 index f1b71323f2..0000000000 --- a/src/containers/Tenant/Acl/i18n/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {registerKeysets} from '../../../../utils/i18n'; - -import en from './en.json'; - -const COMPONENT = 'ydb-acl'; - -export default registerKeysets(COMPONENT, {en}); diff --git a/src/containers/Tenant/ObjectSummary/ObjectSummary.tsx b/src/containers/Tenant/ObjectSummary/ObjectSummary.tsx index 63f721d3b0..b903754de4 100644 --- a/src/containers/Tenant/ObjectSummary/ObjectSummary.tsx +++ b/src/containers/Tenant/ObjectSummary/ObjectSummary.tsx @@ -33,7 +33,6 @@ import { formatSecondsToHours, } from '../../../utils/dataFormatters/dataFormatters'; import {useTypedDispatch, useTypedSelector} from '../../../utils/hooks'; -import {Acl} from '../Acl/Acl'; import {EntityTitle} from '../EntityTitle/EntityTitle'; import {SchemaViewer} from '../Schema/SchemaViewer/SchemaViewer'; import {useCurrentSchema} from '../TenantContext'; @@ -366,9 +365,6 @@ export function ObjectSummary({ const renderTabContent = () => { switch (summaryTab) { - case TENANT_SUMMARY_TABS_IDS.acl: { - return ; - } case TENANT_SUMMARY_TABS_IDS.schema: { return ; } diff --git a/src/containers/Tenant/TenantPages.tsx b/src/containers/Tenant/TenantPages.tsx index 7b08a77390..181ae0240b 100644 --- a/src/containers/Tenant/TenantPages.tsx +++ b/src/containers/Tenant/TenantPages.tsx @@ -33,10 +33,6 @@ export const TENANT_INFO_TABS = [ id: TENANT_SUMMARY_TABS_IDS.overview, title: 'Overview', }, - { - id: TENANT_SUMMARY_TABS_IDS.acl, - title: 'ACL', - }, ]; export const TENANT_SCHEMA_TAB = [ diff --git a/src/store/reducers/tenant/constants.ts b/src/store/reducers/tenant/constants.ts index c54a78a147..9b3ae84100 100644 --- a/src/store/reducers/tenant/constants.ts +++ b/src/store/reducers/tenant/constants.ts @@ -34,7 +34,6 @@ export const TENANT_DIAGNOSTICS_TABS_IDS = { export const TENANT_SUMMARY_TABS_IDS = { overview: 'overview', - acl: 'acl', schema: 'schema', } as const; From a87cb93e9ee0c5c4494df1c4e53c1c216476afd6 Mon Sep 17 00:00:00 2001 From: Elena Makarova Date: Mon, 4 Aug 2025 10:52:37 +0300 Subject: [PATCH 2/2] fix: tests --- .../tenant/diagnostics/tabs/access.test.ts | 2 - tests/suites/tenant/summary/ObjectSummary.ts | 32 ----------- .../tenant/summary/objectSummary.test.ts | 53 ------------------- 3 files changed, 87 deletions(-) diff --git a/tests/suites/tenant/diagnostics/tabs/access.test.ts b/tests/suites/tenant/diagnostics/tabs/access.test.ts index d64d4f315d..f18481c6ee 100644 --- a/tests/suites/tenant/diagnostics/tabs/access.test.ts +++ b/tests/suites/tenant/diagnostics/tabs/access.test.ts @@ -72,7 +72,6 @@ test.describe('Diagnostics Access tab', async () => { database: '/local', tenantPage: 'diagnostics', diagnosticsTab: 'access', - summaryTab: 'acl', }; const tenantPage = new TenantPage(page); await tenantPage.goto(pageQueryParams); @@ -91,7 +90,6 @@ test.describe('Diagnostics Access tab', async () => { database: '/local', tenantPage: 'diagnostics', diagnosticsTab: 'access', - summaryTab: 'acl', }; const tenantPage = new TenantPage(page); await tenantPage.goto(pageQueryParams); diff --git a/tests/suites/tenant/summary/ObjectSummary.ts b/tests/suites/tenant/summary/ObjectSummary.ts index 3cea95ad76..11c3d35b4a 100644 --- a/tests/suites/tenant/summary/ObjectSummary.ts +++ b/tests/suites/tenant/summary/ObjectSummary.ts @@ -8,7 +8,6 @@ import type {RowTableAction} from './types'; export enum ObjectSummaryTab { Overview = 'Overview', - ACL = 'ACL', Schema = 'Schema', } export class ObjectSummary { @@ -113,37 +112,6 @@ export class ObjectSummary { await this.createDirectoryModal.waitFor({state: 'hidden', timeout: VISIBILITY_TIMEOUT}); } - async waitForAclVisible() { - // In the new UI, the ACL tab shows a redirect message instead of the actual ACL content - const redirectMessage = this.page.locator('text=Section was moved to Diagnostics'); - await redirectMessage.waitFor({state: 'visible', timeout: VISIBILITY_TIMEOUT}); - return true; - } - - async getRedirectMessage(): Promise { - const redirectMessage = this.page.locator('text=Section was moved to Diagnostics'); - if (await redirectMessage.isVisible()) { - return redirectMessage.textContent(); - } - return null; - } - - async hasOpenInDiagnosticsButton(): Promise { - try { - const diagnosticsButton = this.page.getByRole('button', {name: 'Open in Diagnostics'}); - await diagnosticsButton.waitFor({state: 'visible', timeout: VISIBILITY_TIMEOUT}); - return true; - } catch (error) { - console.error('Open in Diagnostics button not visible:', error); - return false; - } - } - - async clickOpenInDiagnosticsButton(): Promise { - const diagnosticsButton = this.page.getByRole('button', {name: 'Open in Diagnostics'}); - await diagnosticsButton.click(); - } - async isTreeVisible() { await this.tree.waitFor({state: 'visible', timeout: VISIBILITY_TIMEOUT}); return true; diff --git a/tests/suites/tenant/summary/objectSummary.test.ts b/tests/suites/tenant/summary/objectSummary.test.ts index 10f642ca2c..ca828c0d7a 100644 --- a/tests/suites/tenant/summary/objectSummary.test.ts +++ b/tests/suites/tenant/summary/objectSummary.test.ts @@ -269,57 +269,4 @@ test.describe('Object Summary', async () => { await objectSummary.expandSummary(); await expect(objectSummary.isSummaryCollapsed()).resolves.toBe(false); }); - - test('ACL tab shows redirect message and link to Diagnostics', async ({page}) => { - // Define the URL parameters - const pageQueryParams = { - schema: '/local', - database: '/local', - summaryTab: 'acl', - tenantPage: 'query', - }; - - // Navigate to the page - const tenantPage = new TenantPage(page); - await tenantPage.goto(pageQueryParams); - - // Get the ObjectSummary instance - const objectSummary = new ObjectSummary(page); - - // Verify the ACL tab is selected - await objectSummary.clickTab(ObjectSummaryTab.ACL); - - // Wait for the ACL content to be visible - await objectSummary.waitForAclVisible(); - - // Check for the redirect message - const redirectMessage = await objectSummary.getRedirectMessage(); - expect(redirectMessage).toContain('Section was moved to Diagnostics'); - - // Check for the "Open in Diagnostics" button - const hasButton = await objectSummary.hasOpenInDiagnosticsButton(); - expect(hasButton).toBe(true); - - // Click the button and verify the URL - await objectSummary.clickOpenInDiagnosticsButton(); - - // Verify the URL contains the expected parameters - const expectedUrlParams = new URLSearchParams({ - tenantPage: 'diagnostics', - diagnosticsTab: 'access', - summaryTab: 'acl', - schema: '/local', - database: '/local', - }); - - // Get the current URL and parse its parameters - const currentUrl = page.url(); - const currentUrlObj = new URL(currentUrl); - const currentParams = currentUrlObj.searchParams; - - // Verify each expected parameter is in the URL - for (const [key, value] of expectedUrlParams.entries()) { - expect(currentParams.get(key)).toBe(value); - } - }); });