8000 chore: apply design changes to the admin settings menu dropdown by jaaydenh · Pull Request #15947 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

chore: apply design changes to the admin settings menu dropdown #15947

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

Merged
merged 6 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
chore: design changes for admin settings menu dropdown
  • Loading branch information
jaaydenh committed Dec 20, 2024
commit 67b8927d2cca80138960def5c666b005f0277f2a
38 changes: 21 additions & 17 deletions site/src/components/FeatureStageBadge/FeatureStageBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ type FeatureStageBadgeProps = Readonly<
Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
contentType: keyof typeof featureStageBadgeTypes;
size?: "sm" | "md" | "lg";
showTooltip?: boolean;
}
>;

export const FeatureStageBadge: FC<FeatureStageBadgeProps> = ({
contentType,
size = "md",
showTooltip = true, // This is a temporary until the deprecated popover is removed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
showTooltip = true, // This is a temporary until the deprecated popover is removed
showTooltip = true, // This is temporary until the deprecated popover is removed

also, how can we track that this actually gets cleaned up later?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could create an issue but im not sure its worth the trouble. This will get resolved automatically either when the beta badge is removed or this component moves to the new popover. The issue is that the current popover does not work well when it appears too close to the right edge of the screen.

...delegatedProps
}) => {
return (
Expand All @@ -49,24 +51,26 @@ export const FeatureStageBadge: FC<FeatureStageBadgeProps> = ({
)}
</PopoverTrigger>

<HelpTooltipContent
anchorOrigin={{ vertical: "bottom", horizontal: "center" }}
transformOrigin={{ vertical: "top", horizontal: "center" }}
>
<p css={styles.tooltipDescription}>
This feature has not yet reached general availability (GA).
</p>

<Link
href={docs("/contributing/feature-stages")}
target="_blank"
rel="noreferrer"
css={styles.tooltipLink}
{showTooltip && (
<HelpTooltipContent
anchorOrigin={{ vertical: "bottom", horizontal: "center" }}
transformOrigin={{ vertical: "top", horizontal: "center" }}
>
Learn about feature stages
<span style={visuallyHidden}> (link opens in new tab)</span>
</Link>
</HelpTooltipContent>
<p css={styles.tooltipDescription}>
This feature has not yet reached general availability (GA).
</p>

<Link
href={docs("/contributing/feature-stages")}
target="_blank"
rel="noreferrer"
css={styles.tooltipLink}
>
Learn about feature stages
<span style={visuallyHidden}> (link opens in new tab)</span>
</Link>
</HelpTooltipContent>
)}
</Popover>
);
};
Expand Down
19 changes: 5 additions & 14 deletions site/src/modules/dashboard/Navbar/DeploymentDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -52,7 +53,7 @@ export const DeploymentDropdown: FC<DeploymentDropdownProps> = ({
/>
}
>
Administration
Admin settings
</Button>
</PopoverTrigger>

Expand Down Expand Up @@ -81,7 +82,6 @@ export const DeploymentDropdown: FC<DeploymentDropdownProps> = ({
const DeploymentDropdownContent: FC<DeploymentDropdownProps> = ({
canViewDeployment,
canViewOrganizations,
canViewAllUsers,
canViewAuditLog,
canViewHealth,
}) => {
Expand All @@ -98,7 +98,7 @@ const DeploymentDropdownContent: FC<DeploymentDropdownProps> = ({
css={styles.menuItem}
onClick={onPopoverClose}
>
Settings
Deployment
</MenuItem>
)}
{canViewOrganizations && (
Expand All @@ -109,16 +109,7 @@ const DeploymentDropdownContent: FC<DeploymentDropdownProps> = ({
onClick={onPopoverClose}
>
Organizations
</MenuItem>
)}
{canViewAllUsers && (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worry that this is going to be one of those things that customers with lots of screenshots will really dislike. Can we loop @bpmct in on this so we can communicate this change clearly and hopefully mitigate frustrations?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, the figma designs would already have been reviewed to validate this type of change. Almost everything about this PR would change existing screenshots. We should converge on a process after the holidays so we don't have to worry about these types of changes during PR review.

Copy link
Member
@aslilac aslilac Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah but changing things stylistically is very different from removing a path that users are accustomed to and have documented. I doubt customers care nearly as much when things look slightly different but have the same structure as they do when we remove the button they put a screenshot of in their documentation entirely.

<MenuItem
component={NavLink}
to={linkToUsers}
css={styles.menuItem}
onClick={onPopoverClose}
>
Users
<FeatureStageBadge contentType="beta" size="sm" showTooltip={false} />
</MenuItem>
)}
{canViewAuditLog && (
Expand Down
562F
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -81,8 +82,12 @@ const OrganizationSettingsLayout: FC = () => {
</BreadcrumbItem>
<BreadcrumbSeparator />
<BreadcrumbItem>
<BreadcrumbLink href="/organizations">
<BreadcrumbLink
href="/organizations"
className="flex items-center gap-2"
>
Organizations
<FeatureStageBadge contentType="beta" size="sm" />
</BreadcrumbLink>
</BreadcrumbItem>
{organization && (
Expand Down
Loading
0