diff --git a/site/e2e/tests/organizationGroups.spec.ts b/site/e2e/tests/organizationGroups.spec.ts index c4ef61a3eddeb..2f419dd7ee4ac 100644 --- a/site/e2e/tests/organizationGroups.spec.ts +++ b/site/e2e/tests/organizationGroups.spec.ts @@ -84,7 +84,7 @@ test("change quota settings", async ({ page }) => { // Go to settings await page.goto(`/organizations/${org.name}/groups/${group.name}`); - await page.getByRole("button", { name: "Settings" }).click(); + await page.getByRole("button", { name: "Settings", exact: true }).click(); expectUrl(page).toHavePathName( `/organizations/${org.name}/groups/${group.name}/settings`, ); @@ -99,6 +99,6 @@ test("change quota settings", async ({ page }) => { ); // ...and that setting should persist if we go back - await page.getByRole("button", { name: "Settings" }).click(); + await page.getByRole("button", { name: "Settings", exact: true }).click(); await expect(page.getByLabel("Quota Allowance")).toHaveValue("100"); }); diff --git a/site/src/components/FeatureStageBadge/FeatureStageBadge.tsx b/site/src/components/FeatureStageBadge/FeatureStageBadge.tsx index c73d60e0ee56e..d463af2de43aa 100644 --- a/site/src/components/FeatureStageBadge/FeatureStageBadge.tsx +++ b/site/src/components/FeatureStageBadge/FeatureStageBadge.tsx @@ -19,12 +19,14 @@ type FeatureStageBadgeProps = Readonly< Omit, "children"> & { contentType: keyof typeof featureStageBadgeTypes; size?: "sm" | "md" | "lg"; + showTooltip?: boolean; } >; export const FeatureStageBadge: FC = ({ contentType, size = "md", + showTooltip = true, // This is a temporary until the deprecated popover is removed ...delegatedProps }) => { return ( @@ -49,24 +51,26 @@ export const FeatureStageBadge: FC = ({ )} - -

- This feature has not yet reached general availability (GA). -

- - - Learn about feature stages - (link opens in new tab) - -
+

+ This feature has not yet reached general availability (GA). +

+ + + Learn about feature stages + (link opens in new tab) + + + )} ); }; diff --git a/site/src/modules/dashboard/Navbar/DeploymentDropdown.tsx b/site/src/modules/dashboard/Navbar/DeploymentDropdown.tsx index 9a3f5f577fcb5..dc4b1b4d92fde 100644 --- a/site/src/modules/dashboard/Navbar/DeploymentDropdown.tsx +++ b/site/src/modules/dashboard/Navbar/DeploymentDropdown.tsx @@ -2,13 +2,14 @@ import { type Interpolation, type Theme, css, useTheme } from "@emotion/react"; import Button from "@mui/material/Button"; import MenuItem from "@mui/material/MenuItem"; import { DropdownArrow } from "components/DropdownArrow/DropdownArrow"; +import { FeatureStageBadge } from "components/FeatureStageBadge/FeatureStageBadge"; import { Popover, PopoverContent, PopoverTrigger, usePopover, } from "components/deprecated/Popover/Popover"; -import { linkToAuditing, linkToUsers } from "modules/navigation"; +import { linkToAuditing } from "modules/navigation"; import type { FC } from "react"; import { NavLink } from "react-router-dom"; @@ -52,7 +53,7 @@ export const DeploymentDropdown: FC = ({ /> } > - Administration + Admin settings @@ -81,7 +82,6 @@ export const DeploymentDropdown: FC = ({ const DeploymentDropdownContent: FC = ({ canViewDeployment, canViewOrganizations, - canViewAllUsers, canViewAuditLog, canViewHealth, }) => { @@ -98,7 +98,7 @@ const DeploymentDropdownContent: FC = ({ css={styles.menuItem} onClick={onPopoverClose} > - Settings + Deployment )} {canViewOrganizations && ( @@ -109,16 +109,7 @@ const DeploymentDropdownContent: FC = ({ onClick={onPopoverClose} > Organizations - - )} - {canViewAllUsers && ( - - Users + )} {canViewAuditLog && ( diff --git a/site/src/modules/dashboard/Navbar/Navbar.test.tsx b/site/src/modules/dashboard/Navbar/Navbar.test.tsx index adb7ba45b74e8..e01a1506f4c9c 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("Administration"); + const deploymentMenu = await screen.findByText("Admin settings"); 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("Administration"); + const deploymentMenu = await screen.findByText("Admin settings"); await userEvent.click(deploymentMenu); await waitFor( () => { diff --git a/site/src/modules/dashboard/Navbar/NavbarView.stories.tsx b/site/src/modules/dashboard/Navbar/NavbarView.stories.tsx index a92866e422b54..6ac0e51087dfa 100644 --- a/site/src/modules/dashboard/Navbar/NavbarView.stories.tsx +++ b/site/src/modules/dashboard/Navbar/NavbarView.stories.tsx @@ -27,7 +27,7 @@ export const ForAdmin: Story = { play: async ({ canvasElement }) => { const canvas = within(canvasElement); await userEvent.click( - canvas.getByRole("button", { name: "Administration" }), + canvas.getByRole("button", { name: "Admin settings" }), ); }, }; @@ -44,7 +44,7 @@ export const ForAuditor: Story = { play: async ({ canvasElement }) => { const canvas = within(canvasElement); await userEvent.click( - canvas.getByRole("button", { name: "Administration" }), + canvas.getByRole("button", { name: "Admin settings" }), ); }, }; @@ -61,7 +61,7 @@ export const ForOrgAdmin: Story = { play: async ({ canvasElement }) => { const canvas = within(canvasElement); await userEvent.click( - canvas.getByRole("button", { name: "Administration" }), + canvas.getByRole("button", { name: "Admin settings" }), ); }, }; diff --git a/site/src/modules/dashboard/Navbar/NavbarView.test.tsx b/site/src/modules/dashboard/Navbar/NavbarView.test.tsx index 6d63a6147762b..3dd4251385e20 100644 --- a/site/src/modules/dashboard/Navbar/NavbarView.test.tsx +++ b/site/src/modules/dashboard/Navbar/NavbarView.test.tsx @@ -56,25 +56,6 @@ describe("NavbarView", () => { expect((templatesLink as HTMLAnchorElement).href).toContain("/templates"); }); - it("users nav link has the correct href", async () => { - renderWithAuth( - , - ); - const deploymentMenu = await screen.findByText("Administration"); - await userEvent.click(deploymentMenu); - const userLink = await screen.findByText(navLanguage.users); - expect((userLink as HTMLAnchorElement).href).toContain("/users"); - }); - it("audit nav link has the correct href", async () => { renderWithAuth( { canViewAuditLog />, ); - const deploymentMenu = await screen.findByText("Administration"); + const deploymentMenu = await screen.findByText("Admin settings"); await userEvent.click(deploymentMenu); const auditLink = await screen.findByText(navLanguage.audit); expect((auditLink as HTMLAnchorElement).href).toContain("/audit"); @@ -107,7 +88,7 @@ describe("NavbarView", () => { canViewAuditLog />, ); - const deploymentMenu = await screen.findByText("Administration"); + const deploymentMenu = await screen.findByText("Admin settings"); 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 16cbec990ccc0..662e39ca9d02c 100644 --- a/site/src/modules/dashboard/Navbar/NavbarView.tsx +++ b/site/src/modules/dashboard/Navbar/NavbarView.tsx @@ -32,7 +32,7 @@ export const Language = { templates: "Templates", users: "Users", audit: "Audit Logs", - deployment: "Settings", + deployment: "Deployment", }; interface NavItemsProps { diff --git a/site/src/modules/management/OrganizationSettingsLayout.tsx b/site/src/modules/management/OrganizationSettingsLayout.tsx index bd74247d2567c..484a6dd8a65e8 100644 --- a/site/src/modules/management/OrganizationSettingsLayout.tsx +++ b/site/src/modules/management/OrganizationSettingsLayout.tsx @@ -8,6 +8,7 @@ import { BreadcrumbPage, BreadcrumbSeparator, } from "components/Breadcrumb/Breadcrumb"; +import { FeatureStageBadge } from "components/FeatureStageBadge/FeatureStageBadge"; import { Loader } from "components/Loader/Loader"; import { useAuthenticated } from "contexts/auth/RequireAuth"; import { RequirePermission } from "contexts/auth/RequirePermission"; @@ -81,8 +82,12 @@ const OrganizationSettingsLayout: FC = () => { - + Organizations + {organization && (