From b4731bc8acd91d536e75434a1915a10a6844e5e7 Mon Sep 17 00:00:00 2001 From: Raphael 'kena' Poss Date: Tue, 4 Jul 2023 18:01:50 +0200 Subject: [PATCH] pkg/ui: emphasize "cluster virtualization" in human-visible surfaces At this stage, we are focusing on strings and comments that are read by humans. A separate pass will take care of the method and variable names later. Release note: None --- .../src/statementsPage/statementsPage.tsx | 2 +- .../src/transactionsPage/transactionsPage.tsx | 2 +- .../tenantDropdown/tenantDropdown.spec.tsx | 16 ++++++++++------ .../tenantDropdown/tenantDropdown.styl | 2 +- .../components/tenantDropdown/tenantDropdown.tsx | 6 ++++-- .../src/views/reports/containers/debug/index.tsx | 4 ++-- 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx index 0eb21e59ad97..e9546bc4e97b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx @@ -551,7 +551,7 @@ export class StatementsPage extends React.Component< // Creates a list of all possible columns, // hiding nodeRegions if is not multi-region and - // hiding columns that won't be displayed for tenants. + // hiding columns that won't be displayed for virtual clusters. const columns = makeStatementsColumns( statements, filters.app?.split(","), diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.tsx index 60bb2731beaf..bbaa86c4a658 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.tsx @@ -508,7 +508,7 @@ export class TransactionsPage extends React.Component< // Creates a list of all possible columns, // hiding nodeRegions if is not multi-region and - // hiding columns that won't be displayed for tenants. + // hiding columns that won't be displayed for virtual clusters. const columns = makeTransactionsColumns( transactionsToDisplay, statements, diff --git a/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.spec.tsx b/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.spec.tsx index 154fb530314c..7dbc752efc09 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.spec.tsx @@ -21,7 +21,7 @@ jest.mock("src/redux/cookies", () => ({ })); describe("TenantDropdown", () => { - it("returns null if there's no current tenant", () => { + it("returns null if there's no current virtual cluster", () => { ( selectTenantsFromMultitenantSessionCookie as jest.MockedFn< typeof selectTenantsFromMultitenantSessionCookie @@ -34,7 +34,7 @@ describe("TenantDropdown", () => { expect(wrapper.isEmptyRender()); }); // Mutli-tenant scenarios - it("returns null if there are no tenants or less than 2 tenants in the session cookie", () => { + it("returns null if there are no virtual clusters or less than 2 in the session cookie", () => { ( selectTenantsFromMultitenantSessionCookie as jest.MockedFn< typeof selectTenantsFromMultitenantSessionCookie @@ -46,7 +46,7 @@ describe("TenantDropdown", () => { const wrapper = shallow(); expect(wrapper.isEmptyRender()); }); - it("returns a dropdown list of tenant options if there are multiple tenant in the session cookie", () => { + it("returns a dropdown list of tenant options if there are multiple virtual clusters in the session cookie", () => { ( selectTenantsFromMultitenantSessionCookie as jest.MockedFn< typeof selectTenantsFromMultitenantSessionCookie @@ -56,9 +56,11 @@ describe("TenantDropdown", () => { getCookieValue as jest.MockedFn ).mockReturnValueOnce("system"); const wrapper = shallow(); - expect(wrapper.find({ children: "Tenant: system" }).length).toEqual(1); + expect( + wrapper.find({ children: "Virtual cluster: system" }).length, + ).toEqual(1); }); - it("returns a dropdown if the there is a single tenant option but isn't system tenant", () => { + it("returns a dropdown if the there is a single virtual cluster option but isn't system", () => { ( selectTenantsFromMultitenantSessionCookie as jest.MockedFn< typeof selectTenantsFromMultitenantSessionCookie @@ -68,6 +70,8 @@ describe("TenantDropdown", () => { getCookieValue as jest.MockedFn ).mockReturnValueOnce("app"); const wrapper = shallow(); - expect(wrapper.find({ children: "Tenant: app" }).length).toEqual(1); + expect(wrapper.find({ children: "Virtual cluster: app" }).length).toEqual( + 1, + ); }); }); diff --git a/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.styl b/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.styl index 9244a2458a84..4a31daf78ddc 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.styl +++ b/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.styl @@ -10,7 +10,7 @@ @require '~src/components/core/index.styl' -.tenant-selected +.virtual-cluster-selected color $colors--neutral-7 padding-right 6px font-weight 600 diff --git a/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.tsx b/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.tsx index bfe021443b4d..0afb2def643c 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.tsx @@ -27,7 +27,7 @@ const TenantDropdown = () => { const createDropdownItems = () => { return ( tenants?.map(tenantID => { - return { name: "Tenant: " + tenantID, value: tenantID }; + return { name: "Virtual cluster: " + tenantID, value: tenantID }; }) || [] ); }; @@ -49,7 +49,9 @@ const TenantDropdown = () => { items={createDropdownItems()} onChange={(tenantID: string) => onTenantChange(tenantID)} > -
{"Tenant: " + currentTenant}
+
+ {"Virtual cluster: " + currentTenant} +
); diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/debug/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/debug/index.tsx index 79f76f170d5f..28cb02bab0f0 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/debug/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/debug/index.tsx @@ -264,12 +264,12 @@ export default function Debug() { {disable_kv_level_advanced_debug && (
To access additional advanced debug options, please login using - system tenant credentials. + the system cluster. } />