Skip to content

Commit

Permalink
pkg/ui: emphasize "cluster virtualization" in human-visible surfaces
Browse files Browse the repository at this point in the history
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
  • Loading branch information
knz committed Oct 2, 2023
1 parent d500002 commit 69b9cac
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,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(","),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -46,7 +46,7 @@ describe("TenantDropdown", () => {
const wrapper = shallow(<TenantDropdown />);
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
Expand All @@ -56,9 +56,11 @@ describe("TenantDropdown", () => {
getCookieValue as jest.MockedFn<typeof getCookieValue>
).mockReturnValueOnce("system");
const wrapper = shallow(<TenantDropdown />);
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
Expand All @@ -68,6 +70,8 @@ describe("TenantDropdown", () => {
getCookieValue as jest.MockedFn<typeof getCookieValue>
).mockReturnValueOnce("app");
const wrapper = shallow(<TenantDropdown />);
expect(wrapper.find({ children: "Tenant: app" }).length).toEqual(1);
expect(wrapper.find({ children: "Virtual cluster: app" }).length).toEqual(
1,
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
}) || []
);
};
Expand All @@ -49,7 +49,9 @@ const TenantDropdown = () => {
items={createDropdownItems()}
onChange={(tenantID: string) => onTenantChange(tenantID)}
>
<div className="tenant-selected">{"Tenant: " + currentTenant}</div>
<div className="virtual-cluster-selected">
{"Virtual cluster: " + currentTenant}
</div>
</Dropdown>
</ErrorBoundary>
);
Expand Down

0 comments on commit 69b9cac

Please sign in to comment.