From 05cc52c23d0d0ebda2447a931c0e01d9ece2f087 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Tue, 9 Jan 2024 23:29:13 +0000 Subject: [PATCH] chore: move some components into pages/ --- site/src/AppRouter.tsx | 6 +- .../components/LastSeen/LastSeen.stories.tsx | 54 ++++++++++++ site/src/components/LastSeen/LastSeen.tsx | 21 +++-- .../AppearanceSettingsPageView.tsx | 4 +- .../DeploySettingsLayout.tsx | 0 .../ExternalAuthSettingsPage.tsx | 4 +- .../ExternalAuthSettingsPageView.tsx | 9 +- .../DeploySettingsPage}/Fieldset.tsx | 0 .../GeneralSettingsPage.tsx | 2 +- .../GeneralSettingsPageView.tsx | 4 +- .../DeploySettingsPage}/Header.tsx | 0 .../AddNewLicensePageView.tsx | 6 +- .../LicensesSettingsPageView.tsx | 14 ++-- .../NetworkSettingsPage.tsx | 4 +- .../NetworkSettingsPageView.tsx | 9 +- .../CreateOAuth2AppPageView.tsx | 2 +- .../EditOAuth2AppPageView.tsx | 2 +- .../OAuth2AppsSettingsPageView.tsx | 2 +- .../ObservabilitySettingsPage.tsx | 6 +- .../ObservabilitySettingsPageView.tsx | 17 ++-- .../DeploySettingsPage}/Option.tsx | 2 +- .../DeploySettingsPage}/OptionsTable.tsx | 2 +- .../SecuritySettingsPage.tsx | 6 +- .../SecuritySettingsPageView.tsx | 82 +++++++++---------- .../DeploySettingsPage}/Sidebar.tsx | 0 .../UserAuthSettingsPage.tsx | 4 +- .../UserAuthSettingsPageView.tsx | 4 +- .../DeploySettingsPage}/optionValue.test.ts | 0 .../DeploySettingsPage}/optionValue.ts | 0 .../ExternalAuthPage/ExternalAuthPageView.tsx | 2 +- site/src/pages/GroupsPage/GroupPage.tsx | 2 +- .../UsersPage}/UsersLayout.tsx | 0 .../UsersPage/UsersTable/UsersTableBody.tsx | 2 +- 33 files changed, 167 insertions(+), 105 deletions(-) create mode 100644 site/src/components/LastSeen/LastSeen.stories.tsx rename site/src/{components/DeploySettingsLayout => pages/DeploySettingsPage}/DeploySettingsLayout.tsx (100%) rename site/src/{components/DeploySettingsLayout => pages/DeploySettingsPage}/Fieldset.tsx (100%) rename site/src/{components/DeploySettingsLayout => pages/DeploySettingsPage}/Header.tsx (100%) rename site/src/{components/DeploySettingsLayout => pages/DeploySettingsPage}/Option.tsx (98%) rename site/src/{components/DeploySettingsLayout => pages/DeploySettingsPage}/OptionsTable.tsx (98%) rename site/src/{components/DeploySettingsLayout => pages/DeploySettingsPage}/Sidebar.tsx (100%) rename site/src/{components/DeploySettingsLayout => pages/DeploySettingsPage}/optionValue.test.ts (100%) rename site/src/{components/DeploySettingsLayout => pages/DeploySettingsPage}/optionValue.ts (100%) rename site/src/{components/UsersLayout => pages/UsersPage}/UsersLayout.tsx (100%) diff --git a/site/src/AppRouter.tsx b/site/src/AppRouter.tsx index d06068100b268..5ee5f9a654436 100644 --- a/site/src/AppRouter.tsx +++ b/site/src/AppRouter.tsx @@ -1,4 +1,4 @@ -import { FC, lazy, Suspense } from "react"; +import { type FC, lazy, Suspense } from "react"; import { Route, Routes, @@ -6,10 +6,10 @@ import { Navigate, } from "react-router-dom"; import { DashboardLayout } from "./components/Dashboard/DashboardLayout"; -import { DeploySettingsLayout } from "./components/DeploySettingsLayout/DeploySettingsLayout"; +import { DeploySettingsLayout } from "./pages/DeploySettingsPage/DeploySettingsLayout"; import { FullScreenLoader } from "./components/Loader/FullScreenLoader"; import { RequireAuth } from "./components/RequireAuth/RequireAuth"; -import { UsersLayout } from "./components/UsersLayout/UsersLayout"; +import { UsersLayout } from "./pages/UsersPage/UsersLayout"; import AuditPage from "./pages/AuditPage/AuditPage"; import LoginPage from "./pages/LoginPage/LoginPage"; import { SetupPage } from "./pages/SetupPage/SetupPage"; diff --git a/site/src/components/LastSeen/LastSeen.stories.tsx b/site/src/components/LastSeen/LastSeen.stories.tsx new file mode 100644 index 0000000000000..6e2b9da7b197e --- /dev/null +++ b/site/src/components/LastSeen/LastSeen.stories.tsx @@ -0,0 +1,54 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import dayjs from "dayjs"; +import { LastSeen } from "./LastSeen"; + +const meta: Meta = { + title: "components/LastSeen", + component: LastSeen, + args: { + // We typically want this component to be excluded from Chromatic's snapshots, + // because it creates a lot of noise when a static dates roles over from eg. + // "2 months ago" to "3 months ago", but these stories use relative dates, + // and test specific cases that we want to be validated. + "data-chromatic": "", + }, +}; + +export default meta; +type Story = StoryObj; + +export const Now: Story = { + args: { + at: dayjs(), + }, +}; + +export const OneDayAgo: Story = { + args: { + at: dayjs().subtract(1, "day"), + }, +}; + +export const OneWeekAgo: Story = { + args: { + at: dayjs().subtract(1, "week"), + }, +}; + +export const OneMonthAgo: Story = { + args: { + at: dayjs().subtract(1, "month"), + }, +}; + +export const OneYearAgo: Story = { + args: { + at: dayjs().subtract(1, "year"), + }, +}; + +export const Never: Story = { + args: { + at: dayjs().subtract(101, "year"), + }, +}; diff --git a/site/src/components/LastSeen/LastSeen.tsx b/site/src/components/LastSeen/LastSeen.tsx index d7510c5f763e1..bc954c38aea98 100644 --- a/site/src/components/LastSeen/LastSeen.tsx +++ b/site/src/components/LastSeen/LastSeen.tsx @@ -1,30 +1,35 @@ import { useTheme } from "@emotion/react"; import dayjs from "dayjs"; +import relativeTime from "dayjs/plugin/relativeTime"; import { type FC, type HTMLAttributes } from "react"; -interface LastSeenProps extends HTMLAttributes { - value: string; +dayjs.extend(relativeTime); + +interface LastSeenProps + extends Omit, "children"> { + at: dayjs.ConfigType; + "data-chromatic"?: string; // prevents a type error in the stories } -export const LastSeen: FC = ({ value, ...attrs }) => { +export const LastSeen: FC = ({ at, ...attrs }) => { const theme = useTheme(); - const t = dayjs(value); + const t = dayjs(at); const now = dayjs(); let message = t.fromNow(); let color = theme.palette.text.secondary; if (t.isAfter(now.subtract(1, "hour"))) { - color = theme.palette.success.light; // Since the agent reports on a 10m interval, // the last_used_at can be inaccurate when recent. message = "Now"; + color = theme.experimental.roles.success.fill; } else if (t.isAfter(now.subtract(3, "day"))) { - color = theme.palette.text.secondary; + color = theme.experimental.l2.text; } else if (t.isAfter(now.subtract(1, "month"))) { - color = theme.palette.warning.light; + color = theme.experimental.roles.warning.fill; } else if (t.isAfter(now.subtract(100, "year"))) { - color = theme.palette.error.light; + color = theme.experimental.roles.error.fill; } else { message = "Never"; } diff --git a/site/src/pages/DeploySettingsPage/AppearanceSettingsPage/AppearanceSettingsPageView.tsx b/site/src/pages/DeploySettingsPage/AppearanceSettingsPage/AppearanceSettingsPageView.tsx index df4c4b5d75d53..66ff0cdec6dd9 100644 --- a/site/src/pages/DeploySettingsPage/AppearanceSettingsPage/AppearanceSettingsPageView.tsx +++ b/site/src/pages/DeploySettingsPage/AppearanceSettingsPage/AppearanceSettingsPageView.tsx @@ -9,17 +9,17 @@ import { type FC, useState } from "react"; import { BlockPicker } from "react-color"; import { useFormik } from "formik"; import type { UpdateAppearanceConfig } from "api/typesGenerated"; -import { Header } from "components/DeploySettingsLayout/Header"; import { Badges, DisabledBadge, EnterpriseBadge, EntitledBadge, } from "components/Badges/Badges"; -import { Fieldset } from "components/DeploySettingsLayout/Fieldset"; import { Stack } from "components/Stack/Stack"; import { getFormHelpers } from "utils/formUtils"; import colors from "theme/tailwindColors"; +import { Header } from "../Header"; +import { Fieldset } from "../Fieldset"; export type AppearanceSettingsPageViewProps = { appearance: UpdateAppearanceConfig; diff --git a/site/src/components/DeploySettingsLayout/DeploySettingsLayout.tsx b/site/src/pages/DeploySettingsPage/DeploySettingsLayout.tsx similarity index 100% rename from site/src/components/DeploySettingsLayout/DeploySettingsLayout.tsx rename to site/src/pages/DeploySettingsPage/DeploySettingsLayout.tsx diff --git a/site/src/pages/DeploySettingsPage/ExternalAuthSettingsPage/ExternalAuthSettingsPage.tsx b/site/src/pages/DeploySettingsPage/ExternalAuthSettingsPage/ExternalAuthSettingsPage.tsx index 0fc166a1a30ab..2c214875a9a77 100644 --- a/site/src/pages/DeploySettingsPage/ExternalAuthSettingsPage/ExternalAuthSettingsPage.tsx +++ b/site/src/pages/DeploySettingsPage/ExternalAuthSettingsPage/ExternalAuthSettingsPage.tsx @@ -1,7 +1,7 @@ -import { useDeploySettings } from "components/DeploySettingsLayout/DeploySettingsLayout"; -import { FC } from "react"; +import { type FC } from "react"; import { Helmet } from "react-helmet-async"; import { pageTitle } from "utils/page"; +import { useDeploySettings } from "../DeploySettingsLayout"; import { ExternalAuthSettingsPageView } from "./ExternalAuthSettingsPageView"; const ExternalAuthSettingsPage: FC = () => { diff --git a/site/src/pages/DeploySettingsPage/ExternalAuthSettingsPage/ExternalAuthSettingsPageView.tsx b/site/src/pages/DeploySettingsPage/ExternalAuthSettingsPage/ExternalAuthSettingsPageView.tsx index 7b3a018c4c0ee..6e93f0002dfbf 100644 --- a/site/src/pages/DeploySettingsPage/ExternalAuthSettingsPage/ExternalAuthSettingsPageView.tsx +++ b/site/src/pages/DeploySettingsPage/ExternalAuthSettingsPage/ExternalAuthSettingsPageView.tsx @@ -1,4 +1,5 @@ import { css } from "@emotion/react"; +import { type FC } from "react"; import Table from "@mui/material/Table"; import TableBody from "@mui/material/TableBody"; import TableCell from "@mui/material/TableCell"; @@ -8,16 +9,16 @@ import TableRow from "@mui/material/TableRow"; import type { DeploymentValues, ExternalAuthConfig } from "api/typesGenerated"; import { Alert } from "components/Alert/Alert"; import { EnterpriseBadge } from "components/Badges/Badges"; -import { Header } from "components/DeploySettingsLayout/Header"; +import { Header } from "../Header"; import { docs } from "utils/docs"; export type ExternalAuthSettingsPageViewProps = { config: DeploymentValues; }; -export const ExternalAuthSettingsPageView = ({ - config, -}: ExternalAuthSettingsPageViewProps): JSX.Element => { +export const ExternalAuthSettingsPageView: FC< + ExternalAuthSettingsPageViewProps +> = ({ config }) => { return ( <>
{ diff --git a/site/src/pages/DeploySettingsPage/GeneralSettingsPage/GeneralSettingsPageView.tsx b/site/src/pages/DeploySettingsPage/GeneralSettingsPage/GeneralSettingsPageView.tsx index ea36d4c0393e3..9fab366a2a2b7 100644 --- a/site/src/pages/DeploySettingsPage/GeneralSettingsPage/GeneralSettingsPageView.tsx +++ b/site/src/pages/DeploySettingsPage/GeneralSettingsPage/GeneralSettingsPageView.tsx @@ -10,9 +10,9 @@ import { ActiveUserChart, ActiveUsersTitle, } from "components/ActiveUserChart/ActiveUserChart"; -import { Header } from "components/DeploySettingsLayout/Header"; -import OptionsTable from "components/DeploySettingsLayout/OptionsTable"; import { Stack } from "components/Stack/Stack"; +import { Header } from "../Header"; +import OptionsTable from "../OptionsTable"; import { ChartSection } from "./ChartSection"; import { useDeploymentOptions } from "utils/deployOptions"; import { docs } from "utils/docs"; diff --git a/site/src/components/DeploySettingsLayout/Header.tsx b/site/src/pages/DeploySettingsPage/Header.tsx similarity index 100% rename from site/src/components/DeploySettingsLayout/Header.tsx rename to site/src/pages/DeploySettingsPage/Header.tsx diff --git a/site/src/pages/DeploySettingsPage/LicensesSettingsPage/AddNewLicensePageView.tsx b/site/src/pages/DeploySettingsPage/LicensesSettingsPage/AddNewLicensePageView.tsx index fe067c42e6e71..051d47162d130 100644 --- a/site/src/pages/DeploySettingsPage/LicensesSettingsPage/AddNewLicensePageView.tsx +++ b/site/src/pages/DeploySettingsPage/LicensesSettingsPage/AddNewLicensePageView.tsx @@ -3,13 +3,13 @@ import TextField from "@mui/material/TextField"; import KeyboardArrowLeft from "@mui/icons-material/KeyboardArrowLeft"; import { type FC } from "react"; import { Link as RouterLink } from "react-router-dom"; -import { Fieldset } from "components/DeploySettingsLayout/Fieldset"; -import { Header } from "components/DeploySettingsLayout/Header"; import { FileUpload } from "components/FileUpload/FileUpload"; import { displayError } from "components/GlobalSnackbar/utils"; import { Stack } from "components/Stack/Stack"; import { ErrorAlert } from "components/Alert/ErrorAlert"; -import { DividerWithText } from "pages/DeploySettingsPage/LicensesSettingsPage/DividerWithText"; +import { DividerWithText } from "./DividerWithText"; +import { Fieldset } from "../Fieldset"; +import { Header } from "../Header"; type AddNewLicenseProps = { onSaveLicenseKey: (license: string) => void; diff --git a/site/src/pages/DeploySettingsPage/LicensesSettingsPage/LicensesSettingsPageView.tsx b/site/src/pages/DeploySettingsPage/LicensesSettingsPage/LicensesSettingsPageView.tsx index 3952e4e2d6cf7..896417f9034c6 100644 --- a/site/src/pages/DeploySettingsPage/LicensesSettingsPage/LicensesSettingsPageView.tsx +++ b/site/src/pages/DeploySettingsPage/LicensesSettingsPage/LicensesSettingsPageView.tsx @@ -3,17 +3,17 @@ import Button from "@mui/material/Button"; import Skeleton from "@mui/material/Skeleton"; import AddIcon from "@mui/icons-material/AddOutlined"; import RefreshIcon from "@mui/icons-material/Refresh"; -import type { GetLicensesResponse } from "api/api"; -import { Header } from "components/DeploySettingsLayout/Header"; -import { LicenseCard } from "./LicenseCard"; -import { Stack } from "components/Stack/Stack"; +import MuiLink from "@mui/material/Link"; +import Tooltip from "@mui/material/Tooltip"; +import LoadingButton from "@mui/lab/LoadingButton"; import { type FC } from "react"; import Confetti from "react-confetti"; import { Link } from "react-router-dom"; import useWindowSize from "react-use/lib/useWindowSize"; -import MuiLink from "@mui/material/Link"; -import Tooltip from "@mui/material/Tooltip"; -import LoadingButton from "@mui/lab/LoadingButton"; +import type { GetLicensesResponse } from "api/api"; +import { Stack } from "components/Stack/Stack"; +import { LicenseCard } from "./LicenseCard"; +import { Header } from "../Header"; type Props = { showConfetti: boolean; diff --git a/site/src/pages/DeploySettingsPage/NetworkSettingsPage/NetworkSettingsPage.tsx b/site/src/pages/DeploySettingsPage/NetworkSettingsPage/NetworkSettingsPage.tsx index c1ae478352bc7..cf53427f2d58a 100644 --- a/site/src/pages/DeploySettingsPage/NetworkSettingsPage/NetworkSettingsPage.tsx +++ b/site/src/pages/DeploySettingsPage/NetworkSettingsPage/NetworkSettingsPage.tsx @@ -1,7 +1,7 @@ -import { useDeploySettings } from "components/DeploySettingsLayout/DeploySettingsLayout"; -import { FC } from "react"; +import { type FC } from "react"; import { Helmet } from "react-helmet-async"; import { pageTitle } from "utils/page"; +import { useDeploySettings } from "../DeploySettingsLayout"; import { NetworkSettingsPageView } from "./NetworkSettingsPageView"; const NetworkSettingsPage: FC = () => { diff --git a/site/src/pages/DeploySettingsPage/NetworkSettingsPage/NetworkSettingsPageView.tsx b/site/src/pages/DeploySettingsPage/NetworkSettingsPage/NetworkSettingsPageView.tsx index 716c9d2bc3a14..bc849f5c1dbbb 100644 --- a/site/src/pages/DeploySettingsPage/NetworkSettingsPage/NetworkSettingsPageView.tsx +++ b/site/src/pages/DeploySettingsPage/NetworkSettingsPage/NetworkSettingsPageView.tsx @@ -1,21 +1,22 @@ +import { type FC } from "react"; import type { ClibaseOption } from "api/typesGenerated"; import { Badges, EnabledBadge, DisabledBadge } from "components/Badges/Badges"; -import { Header } from "components/DeploySettingsLayout/Header"; -import OptionsTable from "components/DeploySettingsLayout/OptionsTable"; import { Stack } from "components/Stack/Stack"; import { deploymentGroupHasParent, useDeploymentOptions, } from "utils/deployOptions"; import { docs } from "utils/docs"; +import { Header } from "../Header"; +import OptionsTable from "../OptionsTable"; export type NetworkSettingsPageViewProps = { options: ClibaseOption[]; }; -export const NetworkSettingsPageView = ({ +export const NetworkSettingsPageView: FC = ({ options: options, -}: NetworkSettingsPageViewProps): JSX.Element => ( +}) => (
{ diff --git a/site/src/pages/DeploySettingsPage/ObservabilitySettingsPage/ObservabilitySettingsPageView.tsx b/site/src/pages/DeploySettingsPage/ObservabilitySettingsPage/ObservabilitySettingsPageView.tsx index 4bf5d57c15c41..bd067fd9e74d4 100644 --- a/site/src/pages/DeploySettingsPage/ObservabilitySettingsPage/ObservabilitySettingsPageView.tsx +++ b/site/src/pages/DeploySettingsPage/ObservabilitySettingsPage/ObservabilitySettingsPageView.tsx @@ -1,24 +1,25 @@ +import { type FC } from "react"; import type { ClibaseOption } from "api/typesGenerated"; +import { deploymentGroupHasParent } from "utils/deployOptions"; +import { docs } from "utils/docs"; import { Badges, DisabledBadge, EnabledBadge, EnterpriseBadge, } from "components/Badges/Badges"; -import { Header } from "components/DeploySettingsLayout/Header"; -import OptionsTable from "components/DeploySettingsLayout/OptionsTable"; import { Stack } from "components/Stack/Stack"; -import { deploymentGroupHasParent } from "utils/deployOptions"; -import { docs } from "utils/docs"; +import { Header } from "../Header"; +import OptionsTable from "../OptionsTable"; export type ObservabilitySettingsPageViewProps = { options: ClibaseOption[]; featureAuditLogEnabled: boolean; }; -export const ObservabilitySettingsPageView = ({ - options: options, - featureAuditLogEnabled, -}: ObservabilitySettingsPageViewProps): JSX.Element => { + +export const ObservabilitySettingsPageView: FC< + ObservabilitySettingsPageViewProps +> = ({ options: options, featureAuditLogEnabled }) => { return ( <> diff --git a/site/src/components/DeploySettingsLayout/Option.tsx b/site/src/pages/DeploySettingsPage/Option.tsx similarity index 98% rename from site/src/components/DeploySettingsLayout/Option.tsx rename to site/src/pages/DeploySettingsPage/Option.tsx index 38c6bc7b7b89f..518bc71aadc24 100644 --- a/site/src/components/DeploySettingsLayout/Option.tsx +++ b/site/src/pages/DeploySettingsPage/Option.tsx @@ -2,7 +2,7 @@ import CheckCircleOutlined from "@mui/icons-material/CheckCircleOutlined"; import { css, useTheme } from "@emotion/react"; import { type HTMLAttributes, type PropsWithChildren, type FC } from "react"; import { MONOSPACE_FONT_FAMILY } from "theme/constants"; -import { DisabledBadge, EnabledBadge } from "../Badges/Badges"; +import { DisabledBadge, EnabledBadge } from "components/Badges/Badges"; export const OptionName: FC = ({ children }) => { return {children}; diff --git a/site/src/components/DeploySettingsLayout/OptionsTable.tsx b/site/src/pages/DeploySettingsPage/OptionsTable.tsx similarity index 98% rename from site/src/components/DeploySettingsLayout/OptionsTable.tsx rename to site/src/pages/DeploySettingsPage/OptionsTable.tsx index 3f66d27309eda..d027d27367af5 100644 --- a/site/src/components/DeploySettingsLayout/OptionsTable.tsx +++ b/site/src/pages/DeploySettingsPage/OptionsTable.tsx @@ -13,7 +13,7 @@ import { OptionDescription, OptionName, OptionValue, -} from "components/DeploySettingsLayout/Option"; +} from "./Option"; import { optionValue } from "./optionValue"; interface OptionsTableProps { diff --git a/site/src/pages/DeploySettingsPage/SecuritySettingsPage/SecuritySettingsPage.tsx b/site/src/pages/DeploySettingsPage/SecuritySettingsPage/SecuritySettingsPage.tsx index 420f42f2d14ce..020af05f45a4f 100644 --- a/site/src/pages/DeploySettingsPage/SecuritySettingsPage/SecuritySettingsPage.tsx +++ b/site/src/pages/DeploySettingsPage/SecuritySettingsPage/SecuritySettingsPage.tsx @@ -1,9 +1,9 @@ -import { useDashboard } from "components/Dashboard/DashboardProvider"; -import { useDeploySettings } from "components/DeploySettingsLayout/DeploySettingsLayout"; -import { FC } from "react"; +import { type FC } from "react"; import { Helmet } from "react-helmet-async"; import { pageTitle } from "utils/page"; +import { useDashboard } from "components/Dashboard/DashboardProvider"; import { SecuritySettingsPageView } from "./SecuritySettingsPageView"; +import { useDeploySettings } from "../DeploySettingsLayout"; const SecuritySettingsPage: FC = () => { const { deploymentValues: deploymentValues } = useDeploySettings(); diff --git a/site/src/pages/DeploySettingsPage/SecuritySettingsPage/SecuritySettingsPageView.tsx b/site/src/pages/DeploySettingsPage/SecuritySettingsPage/SecuritySettingsPageView.tsx index 59e472d2643f8..032f404970692 100644 --- a/site/src/pages/DeploySettingsPage/SecuritySettingsPage/SecuritySettingsPageView.tsx +++ b/site/src/pages/DeploySettingsPage/SecuritySettingsPage/SecuritySettingsPageView.tsx @@ -1,3 +1,4 @@ +import { type FC } from "react"; import type { ClibaseOption } from "api/typesGenerated"; import { Badges, @@ -5,72 +6,71 @@ import { EnabledBadge, EnterpriseBadge, } from "components/Badges/Badges"; -import { Header } from "components/DeploySettingsLayout/Header"; -import OptionsTable from "components/DeploySettingsLayout/OptionsTable"; import { Stack } from "components/Stack/Stack"; import { deploymentGroupHasParent, useDeploymentOptions, } from "utils/deployOptions"; import { docs } from "utils/docs"; +import { Header } from "../Header"; +import OptionsTable from "../OptionsTable"; export type SecuritySettingsPageViewProps = { options: ClibaseOption[]; featureBrowserOnlyEnabled: boolean; }; -export const SecuritySettingsPageView = ({ + +export const SecuritySettingsPageView: FC = ({ options: options, featureBrowserOnlyEnabled, -}: SecuritySettingsPageViewProps): JSX.Element => { +}) => { const tlsOptions = options.filter((o) => deploymentGroupHasParent(o.group, "TLS"), ); return ( - <> - -
-
+ +
+
- -
+ +
+ +
+
+ + + {featureBrowserOnlyEnabled ? : } + + +
+ {tlsOptions.length > 0 && (
- - {featureBrowserOnlyEnabled ? : } - - +
- - {tlsOptions.length > 0 && ( -
-
- - -
- )} -
- + )} +
); }; diff --git a/site/src/components/DeploySettingsLayout/Sidebar.tsx b/site/src/pages/DeploySettingsPage/Sidebar.tsx similarity index 100% rename from site/src/components/DeploySettingsLayout/Sidebar.tsx rename to site/src/pages/DeploySettingsPage/Sidebar.tsx diff --git a/site/src/pages/DeploySettingsPage/UserAuthSettingsPage/UserAuthSettingsPage.tsx b/site/src/pages/DeploySettingsPage/UserAuthSettingsPage/UserAuthSettingsPage.tsx index d8d83edc406cb..044ccf344c551 100644 --- a/site/src/pages/DeploySettingsPage/UserAuthSettingsPage/UserAuthSettingsPage.tsx +++ b/site/src/pages/DeploySettingsPage/UserAuthSettingsPage/UserAuthSettingsPage.tsx @@ -1,7 +1,7 @@ -import { useDeploySettings } from "components/DeploySettingsLayout/DeploySettingsLayout"; -import { FC } from "react"; +import { type FC } from "react"; import { Helmet } from "react-helmet-async"; import { pageTitle } from "utils/page"; +import { useDeploySettings } from "../DeploySettingsLayout"; import { UserAuthSettingsPageView } from "./UserAuthSettingsPageView"; const UserAuthSettingsPage: FC = () => { diff --git a/site/src/pages/DeploySettingsPage/UserAuthSettingsPage/UserAuthSettingsPageView.tsx b/site/src/pages/DeploySettingsPage/UserAuthSettingsPage/UserAuthSettingsPageView.tsx index 89cdd524d32cc..5e4349c75ce58 100644 --- a/site/src/pages/DeploySettingsPage/UserAuthSettingsPage/UserAuthSettingsPageView.tsx +++ b/site/src/pages/DeploySettingsPage/UserAuthSettingsPage/UserAuthSettingsPageView.tsx @@ -1,8 +1,8 @@ import type { ClibaseOption } from "api/typesGenerated"; import { Badges, DisabledBadge, EnabledBadge } from "components/Badges/Badges"; -import { Header } from "components/DeploySettingsLayout/Header"; -import OptionsTable from "components/DeploySettingsLayout/OptionsTable"; import { Stack } from "components/Stack/Stack"; +import { Header } from "../Header"; +import OptionsTable from "../OptionsTable"; import { deploymentGroupHasParent, useDeploymentOptions, diff --git a/site/src/components/DeploySettingsLayout/optionValue.test.ts b/site/src/pages/DeploySettingsPage/optionValue.test.ts similarity index 100% rename from site/src/components/DeploySettingsLayout/optionValue.test.ts rename to site/src/pages/DeploySettingsPage/optionValue.test.ts diff --git a/site/src/components/DeploySettingsLayout/optionValue.ts b/site/src/pages/DeploySettingsPage/optionValue.ts similarity index 100% rename from site/src/components/DeploySettingsLayout/optionValue.ts rename to site/src/pages/DeploySettingsPage/optionValue.ts diff --git a/site/src/pages/ExternalAuthPage/ExternalAuthPageView.tsx b/site/src/pages/ExternalAuthPage/ExternalAuthPageView.tsx index 893cf8fb69321..5185b316ffe81 100644 --- a/site/src/pages/ExternalAuthPage/ExternalAuthPageView.tsx +++ b/site/src/pages/ExternalAuthPage/ExternalAuthPageView.tsx @@ -68,7 +68,7 @@ const ExternalAuthPageView: FC = ({

- {externalAuth.user?.login && `Hey @${externalAuth.user?.login}! 👋 `} + {externalAuth.user?.login && `Hey @${externalAuth.user?.login}! 👋`} {(!externalAuth.app_installable || externalAuth.installations.length > 0) && "You are now authenticated. Feel free to close this window!"} diff --git a/site/src/pages/GroupsPage/GroupPage.tsx b/site/src/pages/GroupsPage/GroupPage.tsx index 8d919dba44995..6fe81b09e4cd4 100644 --- a/site/src/pages/GroupsPage/GroupPage.tsx +++ b/site/src/pages/GroupsPage/GroupPage.tsx @@ -289,7 +289,7 @@ const GroupMemberRow: FC = ({ css={[styles.status, member.status === "suspended" && styles.suspended]} >

{member.status}
- + {canUpdate && ( diff --git a/site/src/components/UsersLayout/UsersLayout.tsx b/site/src/pages/UsersPage/UsersLayout.tsx similarity index 100% rename from site/src/components/UsersLayout/UsersLayout.tsx rename to site/src/pages/UsersPage/UsersLayout.tsx diff --git a/site/src/pages/UsersPage/UsersTable/UsersTableBody.tsx b/site/src/pages/UsersPage/UsersTable/UsersTableBody.tsx index af7e0ea3cc4f2..fe906c4b1cebd 100644 --- a/site/src/pages/UsersPage/UsersTable/UsersTableBody.tsx +++ b/site/src/pages/UsersPage/UsersTable/UsersTableBody.tsx @@ -177,7 +177,7 @@ export const UsersTableBody: FC< ]} >
{user.status}
- +
{canEditUsers && (