From 5df6508912c9e9ee002cd5f70f44c37708c12ca2 Mon Sep 17 00:00:00 2001 From: Steven Masley Date: Mon, 12 Aug 2024 09:34:27 -0500 Subject: [PATCH 1/5] chore: rename deployment --> manage Manage makes more sense for this UI button --- site/src/modules/dashboard/Navbar/DeploymentDropdown.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/modules/dashboard/Navbar/DeploymentDropdown.tsx b/site/src/modules/dashboard/Navbar/DeploymentDropdown.tsx index f06160e71e7b6..8670057ab671b 100644 --- a/site/src/modules/dashboard/Navbar/DeploymentDropdown.tsx +++ b/site/src/modules/dashboard/Navbar/DeploymentDropdown.tsx @@ -52,7 +52,7 @@ export const DeploymentDropdown: FC = ({ /> } > - Deployment + Manage From 0f152a78802cf89bba2b397aa5f8e49b61ad9a51 Mon Sep 17 00:00:00 2001 From: Steven Masley Date: Mon, 12 Aug 2024 11:06:55 -0500 Subject: [PATCH 2/5] fix testS --- site/src/modules/dashboard/Navbar/Navbar.test.tsx | 4 ++-- site/src/modules/dashboard/Navbar/NavbarView.test.tsx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/site/src/modules/dashboard/Navbar/Navbar.test.tsx b/site/src/modules/dashboard/Navbar/Navbar.test.tsx index 93953530c2357..81bf47bd0f1bf 100644 --- a/site/src/modules/dashboard/Navbar/Navbar.test.tsx +++ b/site/src/modules/dashboard/Navbar/Navbar.test.tsx @@ -22,7 +22,7 @@ describe("Navbar", () => { }), ); render(); - const deploymentMenu = await screen.findByText("Deployment"); + const deploymentMenu = await screen.findByText("Manage"); await userEvent.click(deploymentMenu); await waitFor( () => { @@ -37,7 +37,7 @@ describe("Navbar", () => { // by default, user is an Admin with permission to see the audit log, // but is unlicensed so not entitled to see the audit log render(); - const deploymentMenu = await screen.findByText("Deployment"); + const deploymentMenu = await screen.findByText("Manage"); await userEvent.click(deploymentMenu); await waitFor( () => { diff --git a/site/src/modules/dashboard/Navbar/NavbarView.test.tsx b/site/src/modules/dashboard/Navbar/NavbarView.test.tsx index 02b40065905dc..2de460dc1de63 100644 --- a/site/src/modules/dashboard/Navbar/NavbarView.test.tsx +++ b/site/src/modules/dashboard/Navbar/NavbarView.test.tsx @@ -69,7 +69,7 @@ describe("NavbarView", () => { canViewAuditLog />, ); - const deploymentMenu = await screen.findByText("Deployment"); + const deploymentMenu = await screen.findByText("Manage"); await userEvent.click(deploymentMenu); const userLink = await screen.findByText(navLanguage.users); expect((userLink as HTMLAnchorElement).href).toContain("/users"); @@ -88,7 +88,7 @@ describe("NavbarView", () => { canViewAuditLog />, ); - const deploymentMenu = await screen.findByText("Deployment"); + const deploymentMenu = await screen.findByText("Manage"); await userEvent.click(deploymentMenu); const auditLink = await screen.findByText(navLanguage.audit); expect((auditLink as HTMLAnchorElement).href).toContain("/audit"); @@ -107,7 +107,7 @@ describe("NavbarView", () => { canViewAuditLog />, ); - const deploymentMenu = await screen.findByText("Deployment"); + const deploymentMenu = await screen.findByText("Manage"); await userEvent.click(deploymentMenu); const deploymentSettingsLink = await screen.findByText( navLanguage.deployment, From 1d74ba7c5d883ed099e405115160c83fed521a6d Mon Sep 17 00:00:00 2001 From: Steven Masley Date: Mon, 12 Aug 2024 14:08:18 -0500 Subject: [PATCH 3/5] fixup stories --- site/src/modules/dashboard/Navbar/NavbarView.stories.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/site/src/modules/dashboard/Navbar/NavbarView.stories.tsx b/site/src/modules/dashboard/Navbar/NavbarView.stories.tsx index 684594b66c464..02958c2b05942 100644 --- a/site/src/modules/dashboard/Navbar/NavbarView.stories.tsx +++ b/site/src/modules/dashboard/Navbar/NavbarView.stories.tsx @@ -26,7 +26,7 @@ type Story = StoryObj; export const ForAdmin: Story = { play: async ({ canvasElement }) => { const canvas = within(canvasElement); - await userEvent.click(canvas.getByRole("button", { name: "Deployment" })); + await userEvent.click(canvas.getByRole("button", { name: "Manage" })); }, }; @@ -41,7 +41,7 @@ export const ForAuditor: Story = { }, play: async ({ canvasElement }) => { const canvas = within(canvasElement); - await userEvent.click(canvas.getByRole("button", { name: "Deployment" })); + await userEvent.click(canvas.getByRole("button", { name: "Manage" })); }, }; @@ -56,7 +56,7 @@ export const ForOrgAdmin: Story = { }, play: async ({ canvasElement }) => { const canvas = within(canvasElement); - await userEvent.click(canvas.getByRole("button", { name: "Deployment" })); + await userEvent.click(canvas.getByRole("button", { name: "Manage" })); }, }; From 7ea3c85d41aef6276963236096c7dd6797d4fb68 Mon Sep 17 00:00:00 2001 From: Steven Masley Date: Tue, 13 Aug 2024 09:35:59 -0500 Subject: [PATCH 4/5] chore: reword to "Administration" Reword "Auditing" to a noun like the rest of the dropdowns --- site/src/modules/dashboard/Navbar/DeploymentDropdown.tsx | 4 ++-- site/src/modules/dashboard/Navbar/Navbar.test.tsx | 4 ++-- site/src/modules/dashboard/Navbar/NavbarView.test.tsx | 6 +++--- site/src/modules/dashboard/Navbar/NavbarView.tsx | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/site/src/modules/dashboard/Navbar/DeploymentDropdown.tsx b/site/src/modules/dashboard/Navbar/DeploymentDropdown.tsx index 8670057ab671b..f9c5d8c7f3daf 100644 --- a/site/src/modules/dashboard/Navbar/DeploymentDropdown.tsx +++ b/site/src/modules/dashboard/Navbar/DeploymentDropdown.tsx @@ -52,7 +52,7 @@ export const DeploymentDropdown: FC = ({ /> } > - Manage + Administration @@ -128,7 +128,7 @@ const DeploymentDropdownContent: FC = ({ css={styles.menuItem} onClick={onPopoverClose} > - Auditing + Audit Logs )} {canViewHealth && ( diff --git a/site/src/modules/dashboard/Navbar/Navbar.test.tsx b/site/src/modules/dashboard/Navbar/Navbar.test.tsx index 81bf47bd0f1bf..a61ba7178d428 100644 --- a/site/src/modules/dashboard/Navbar/Navbar.test.tsx +++ b/site/src/modules/dashboard/Navbar/Navbar.test.tsx @@ -22,7 +22,7 @@ describe("Navbar", () => { }), ); render(); - const deploymentMenu = await screen.findByText("Manage"); + const deploymentMenu = await screen.findByText("Administration"); await userEvent.click(deploymentMenu); await waitFor( () => { @@ -37,7 +37,7 @@ describe("Navbar", () => { // by default, user is an Admin with permission to see the audit log, // but is unlicensed so not entitled to see the audit log render(); - const deploymentMenu = await screen.findByText("Manage"); + const deploymentMenu = await screen.findByText("Administration"); await userEvent.click(deploymentMenu); await waitFor( () => { diff --git a/site/src/modules/dashboard/Navbar/NavbarView.test.tsx b/site/src/modules/dashboard/Navbar/NavbarView.test.tsx index 2de460dc1de63..93d5fc4aa7d7e 100644 --- a/site/src/modules/dashboard/Navbar/NavbarView.test.tsx +++ b/site/src/modules/dashboard/Navbar/NavbarView.test.tsx @@ -69,7 +69,7 @@ describe("NavbarView", () => { canViewAuditLog />, ); - const deploymentMenu = await screen.findByText("Manage"); + const deploymentMenu = await screen.findByText("Administration"); await userEvent.click(deploymentMenu); const userLink = await screen.findByText(navLanguage.users); expect((userLink as HTMLAnchorElement).href).toContain("/users"); @@ -88,7 +88,7 @@ describe("NavbarView", () => { canViewAuditLog />, ); - const deploymentMenu = await screen.findByText("Manage"); + const deploymentMenu = await screen.findByText("Administration"); await userEvent.click(deploymentMenu); const auditLink = await screen.findByText(navLanguage.audit); expect((auditLink as HTMLAnchorElement).href).toContain("/audit"); @@ -107,7 +107,7 @@ describe("NavbarView", () => { canViewAuditLog />, ); - const deploymentMenu = await screen.findByText("Manage"); + const deploymentMenu = await screen.findByText("Administration"); await userEvent.click(deploymentMenu); const deploymentSettingsLink = await screen.findByText( navLanguage.deployment, diff --git a/site/src/modules/dashboard/Navbar/NavbarView.tsx b/site/src/modules/dashboard/Navbar/NavbarView.tsx index 77733bc63e920..337ecd321fc70 100644 --- a/site/src/modules/dashboard/Navbar/NavbarView.tsx +++ b/site/src/modules/dashboard/Navbar/NavbarView.tsx @@ -31,7 +31,7 @@ export const Language = { workspaces: "Workspaces", templates: "Templates", users: "Users", - audit: "Auditing", + audit: "Audit Logs", deployment: "Settings", }; From c15266efba7ff6b78780046fe49a5cac25622f40 Mon Sep 17 00:00:00 2001 From: Steven Masley Date: Tue, 13 Aug 2024 09:51:25 -0500 Subject: [PATCH 5/5] fix tests --- .../modules/dashboard/Navbar/NavbarView.stories.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/site/src/modules/dashboard/Navbar/NavbarView.stories.tsx b/site/src/modules/dashboard/Navbar/NavbarView.stories.tsx index 02958c2b05942..e61d3c84b1dab 100644 --- a/site/src/modules/dashboard/Navbar/NavbarView.stories.tsx +++ b/site/src/modules/dashboard/Navbar/NavbarView.stories.tsx @@ -26,7 +26,9 @@ type Story = StoryObj; export const ForAdmin: Story = { play: async ({ canvasElement }) => { const canvas = within(canvasElement); - await userEvent.click(canvas.getByRole("button", { name: "Manage" })); + await userEvent.click( + canvas.getByRole("button", { name: "Administration" }), + ); }, }; @@ -41,7 +43,9 @@ export const ForAuditor: Story = { }, play: async ({ canvasElement }) => { const canvas = within(canvasElement); - await userEvent.click(canvas.getByRole("button", { name: "Manage" })); + await userEvent.click( + canvas.getByRole("button", { name: "Administration" }), + ); }, }; @@ -56,7 +60,9 @@ export const ForOrgAdmin: Story = { }, play: async ({ canvasElement }) => { const canvas = within(canvasElement); - await userEvent.click(canvas.getByRole("button", { name: "Manage" })); + await userEvent.click( + canvas.getByRole("button", { name: "Administration" }), + ); }, };