Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/ui: emphasize "cluster virtualization" in human-visible surfaces #106118

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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