Skip to content

chore: remove notifications experiment #14869

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 8 commits into from
Oct 1, 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
Prev Previous commit
Next Next commit
Remove experiment reference & show beta badge in frontend
Signed-off-by: Danny Kopping <danny@coder.com>
  • Loading branch information
dannykopping committed Oct 1, 2024
commit 0107ad16dc7c6501e186f2f427fe427a5ef587aa
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { docs } from "utils/docs";
* All types of feature that we are currently supporting. Defined as record to
* ensure that we can't accidentally make typos when writing the badge text.
*/
const featureStageBadgeTypes = {
export const featureStageBadgeTypes = {
beta: "beta",
experimental: "experimental",
} as const satisfies Record<string, ReactNode>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const NotificationsPage: FC = () => {
title="Notifications"
description="Control delivery methods for notifications on this deployment."
layout="fluid"
featureStage={"beta"}
>
<Tabs active={tab}>
<TabsList>
Expand Down
9 changes: 4 additions & 5 deletions site/src/pages/DeploySettingsPage/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
} from "components/Sidebar/Sidebar";
import { useDashboard } from "modules/dashboard/useDashboard";
import type { FC } from "react";
import { FeatureStageBadge } from "components/FeatureStageBadge/FeatureStageBadge";

export const Sidebar: FC = () => {
const { experiments } = useDashboard();
Expand Down Expand Up @@ -51,11 +52,9 @@ export const Sidebar: FC = () => {
<SidebarNavItem href="observability" icon={InsertChartIcon}>
Observability
</SidebarNavItem>
{experiments.includes("notifications") && (
<SidebarNavItem href="notifications" icon={NotificationsIcon}>
Notifications
</SidebarNavItem>
)}
<SidebarNavItem href="notifications" icon={NotificationsIcon}>
Notifications <FeatureStageBadge contentType="beta" size="sm" />
</SidebarNavItem>
</BaseSidebar>
);
};
5 changes: 3 additions & 2 deletions site/src/pages/ManagementSettingsPage/SidebarView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,12 @@ const DeploymentSettingsNavigation: FC<DeploymentSettingsNavigationProps> = ({
Users
</SidebarNavSubItem>
)}
{experiments.includes("notifications") && (
<Stack direction={"row"} alignItems={"center"} css={{ gap: 0 }}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: When passing string values directly you can pass the value directly without the brackets:

direction="row"

<SidebarNavSubItem href="notifications">
Notifications
</SidebarNavSubItem>
)}
<FeatureStageBadge contentType="beta" size="sm" />
</Stack>
</Stack>
)}
</div>
Expand Down
36 changes: 26 additions & 10 deletions site/src/pages/UserSettingsPage/Section.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import type { Interpolation, Theme } from "@emotion/react";
import {
FeatureStageBadge,
type featureStageBadgeTypes,
} from "components/FeatureStageBadge/FeatureStageBadge";
import { Stack } from "components/Stack/Stack";
import type { FC, ReactNode } from "react";

type SectionLayout = "fixed" | "fluid";
Expand All @@ -13,6 +18,7 @@ export interface SectionProps {
layout?: SectionLayout;
className?: string;
children?: ReactNode;
featureStage?: keyof typeof featureStageBadgeTypes;
}

export const Section: FC<SectionProps> = ({
Expand All @@ -24,6 +30,7 @@ export const Section: FC<SectionProps> = ({
className = "",
children,
layout = "fixed",
featureStage,
}) => {
return (
<section className={className} id={id} data-testid={id}>
Expand All @@ -32,16 +39,25 @@ export const Section: FC<SectionProps> = ({
<div css={styles.header}>
<div>
{title && (
<h4
css={{
fontSize: 24,
fontWeight: 500,
margin: 0,
marginBottom: 8,
}}
>
{title}
</h4>
<Stack direction={"row"} alignItems="center">
<h4
css={{
fontSize: 24,
fontWeight: 500,
margin: 0,
marginBottom: 8,
}}
>
{title}
</h4>
{featureStage && (
<FeatureStageBadge
contentType={featureStage}
size="lg"
css={{ marginBottom: "5px" }}
/>
)}
</Stack>
)}
{description && typeof description === "string" && (
<p css={styles.description}>{description}</p>
Expand Down
8 changes: 3 additions & 5 deletions site/src/pages/UserSettingsPage/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,9 @@ export const Sidebar: FC<SidebarProps> = ({ user }) => {
<SidebarNavItem href="tokens" icon={VpnKeyOutlined}>
Tokens
</SidebarNavItem>
{experiments.includes("notifications") && (
<SidebarNavItem href="notifications" icon={NotificationsIcon}>
Notifications
</SidebarNavItem>
)}
<SidebarNavItem href="notifications" icon={NotificationsIcon}>
Notifications
</SidebarNavItem>
</BaseSidebar>
);
};
Loading