Skip to content

chore: remove unused code #16815

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 1 commit into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion site/.storybook/preview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
} from "@mui/material/styles";
import { DecoratorHelpers } from "@storybook/addon-themes";
import isChromatic from "chromatic/isChromatic";
import React, { StrictMode } from "react";
import { StrictMode } from "react";
import { HelmetProvider } from "react-helmet-async";
import { QueryClient, QueryClientProvider, parseQueryArgs } from "react-query";
import { withRouter } from "storybook-addon-remix-react-router";
Expand Down
2 changes: 1 addition & 1 deletion site/e2e/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ export const waitUntilUrlIsNotResponding = async (url: string) => {
while (retries < maxRetries) {
try {
await axiosInstance.get(url);
} catch (error) {
} catch {
return;
}

Expand Down
1 change: 0 additions & 1 deletion site/src/@types/storybook.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as _storybook_types from "@storybook/react";
import type {
DeploymentValues,
Experiments,
Expand Down
2 changes: 1 addition & 1 deletion site/src/api/queries/insights.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { API, type InsightsParams, type InsightsTemplateParams } from "api/api";
import type { GetUserStatusCountsResponse } from "api/typesGenerated";
import { type UseQueryOptions, UseQueryResult } from "react-query";
import type { UseQueryOptions } from "react-query";

export const insightsTemplate = (params: InsightsTemplateParams) => {
return {
Expand Down
1 change: 0 additions & 1 deletion site/src/api/queries/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { API, type GetTemplatesOptions, type GetTemplatesQuery } from "api/api";
import type {
CreateTemplateRequest,
CreateTemplateVersionRequest,
Preset,
ProvisionerJob,
ProvisionerJobStatus,
Template,
Expand Down
4 changes: 1 addition & 3 deletions site/src/components/DropdownMenu/DropdownMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
*/

import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
import { Button } from "components/Button/Button";
import { Check, ChevronDownIcon, ChevronRight, Circle } from "lucide-react";
import { Check, ChevronRight, Circle } from "lucide-react";
import {
type ComponentPropsWithoutRef,
type ElementRef,
type FC,
type HTMLAttributes,
forwardRef,
} from "react";
Expand Down
10 changes: 0 additions & 10 deletions site/src/components/ErrorBoundary/GlobalErrorBoundary.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
/**
* @file A global error boundary designed to work with React Router.
*
* This is not documented well, but because of React Router works, it will
* automatically intercept any render errors produced in routes, and will
* "swallow" them, preventing the errors from bubbling up to any error
* boundaries above the router. The global error boundary must be explicitly
* bound to a route to work as expected.
*/
Comment on lines -1 to -9
Copy link
Member

@Parkreiner Parkreiner Mar 6, 2025

Choose a reason for hiding this comment

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

@aslilac @brettkolodny Why was this comment deleted?
Up until 2 months ago, we had a broken error boundary for over a year, because the setup doesn't follow standard React and isn't as obvious as it could be

Copy link
Contributor

Choose a reason for hiding this comment

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

@aslilac will have to give a definitive answer on this. I mistakenly assumed that the comment was related to the import below it that was deleted which is my bad for not reading it fully.

import type { Interpolation } from "@emotion/react";
import Link from "@mui/material/Link";
import { Button } from "components/Button/Button";
import { CoderIcon } from "components/Icons/CoderIcon";
Expand Down
7 changes: 1 addition & 6 deletions site/src/components/IconField/EmojiPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import data from "@emoji-mart/data/sets/15/apple.json";
import EmojiMart from "@emoji-mart/react";
import {
type ComponentProps,
type FC,
useEffect,
useLayoutEffect,
} from "react";
import { type ComponentProps, type FC, useEffect } from "react";
import icons from "theme/icons.json";

const custom = [
Expand Down
4 changes: 2 additions & 2 deletions site/src/components/Paywall/PopoverPaywall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ const FeatureIcon: FC = () => {
};

const styles = {
root: (theme) => ({
root: {
display: "flex",
flexDirection: "row",
alignItems: "center",
maxWidth: 770,
padding: "24px 36px",
borderRadius: 8,
gap: 18,
}),
},
title: {
fontWeight: 600,
fontFamily: "inherit",
Expand Down
1 change: 0 additions & 1 deletion site/src/components/Select/Select.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import { userEvent } from "@storybook/test";
import {
Select,
SelectContent,
Expand Down
1 change: 0 additions & 1 deletion site/src/components/SettingsHeader/SettingsHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useTheme } from "@emotion/react";
import LaunchOutlined from "@mui/icons-material/LaunchOutlined";
import { Button } from "components/Button/Button";
import { Stack } from "components/Stack/Stack";
import { SquareArrowOutUpRightIcon } from "lucide-react";
Expand Down
1 change: 0 additions & 1 deletion site/src/modules/dashboard/Navbar/DeploymentDropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { type Interpolation, type Theme, css, useTheme } from "@emotion/react";
import MenuItem from "@mui/material/MenuItem";
import { Button } from "components/Button/Button";
import { FeatureStageBadge } from "components/FeatureStageBadge/FeatureStageBadge";
import {
Popover,
PopoverContent,
Expand Down
1 change: 0 additions & 1 deletion site/src/modules/dashboard/Navbar/MobileMenu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { Meta, StoryObj } from "@storybook/react";
import { fn, userEvent, within } from "@storybook/test";
import { PointerEventsCheckLevel } from "@testing-library/user-event";
import type { FC } from "react";
import { chromaticWithTablet } from "testHelpers/chromatic";
import {
MockPrimaryWorkspaceProxy,
MockProxyLatencies,
Expand Down
1 change: 0 additions & 1 deletion site/src/modules/dashboard/Navbar/MobileMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "components/DropdownMenu/DropdownMenu";
import { FeatureStageBadge } from "components/FeatureStageBadge/FeatureStageBadge";
import { displayError } from "components/GlobalSnackbar/utils";
import { Latency } from "components/Latency/Latency";
import type { ProxyContextValue } from "contexts/ProxyContext";
Expand Down
1 change: 0 additions & 1 deletion site/src/modules/provisioners/ProvisionerAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { Theme } from "@emotion/react";
import AlertTitle from "@mui/material/AlertTitle";
import { Alert, type AlertColor } from "components/Alert/Alert";
import { AlertDetail } from "components/Alert/Alert";
import { Stack } from "components/Stack/Stack";
import { ProvisionerTag } from "modules/provisioners/ProvisionerTag";
import type { FC } from "react";

Expand Down
1 change: 0 additions & 1 deletion site/src/modules/provisioners/ProvisionerTagsField.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import TextField from "@mui/material/TextField";
import type { ProvisionerDaemon } from "api/typesGenerated";
import { Button } from "components/Button/Button";
import { Input } from "components/Input/Input";
import { PlusIcon } from "lucide-react";
import { ProvisionerTag } from "modules/provisioners/ProvisionerTag";
import { type FC, useRef, useState } from "react";
Expand Down
1 change: 0 additions & 1 deletion site/src/modules/resources/TerminalLink/TerminalLink.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Link from "@mui/material/Link";
import type * as TypesGen from "api/typesGenerated";
import { TerminalIcon } from "components/Icons/TerminalIcon";
import type { FC, MouseEvent } from "react";
import { generateRandomString } from "utils/random";
Expand Down
3 changes: 1 addition & 2 deletions site/src/pages/CreateUserPage/CreateUserPage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { authMethods, createUser } from "api/queries/users";
import { displaySuccess } from "components/GlobalSnackbar/utils";
import { Margins } from "components/Margins/Margins";
import { useDebouncedFunction } from "hooks/debounce";
import { type FC, useState } from "react";
import type { FC } from "react";
import { Helmet } from "react-helmet-async";
import { useMutation, useQuery, useQueryClient } from "react-query";
import { useNavigate } from "react-router-dom";
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/CreateWorkspacePage/CreateWorkspacePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const CreateWorkspacePage: FC = () => {
});

onCreateWorkspace(newWorkspace);
} catch (err) {
} catch {
setMode("form");
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Loader } from "components/Loader/Loader";
import { useDeploymentSettings } from "modules/management/DeploymentSettingsProvider";
import type { FC } from "react";
import { Helmet } from "react-helmet-async";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { deploymentDAUs } from "api/queries/deployment";
import { entitlements } from "api/queries/entitlements";
import { availableExperiments, experiments } from "api/queries/experiments";
import { useEmbeddedMetadata } from "hooks/useEmbeddedMetadata";
import { useDeploymentSettings } from "modules/management/DeploymentSettingsProvider";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import AlertTitle from "@mui/material/AlertTitle";
import type {
DAUsResponse,
Entitlements,
Experiments,
SerpentOption,
} from "api/typesGenerated";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Loader } from "components/Loader/Loader";
import { useDeploymentSettings } from "modules/management/DeploymentSettingsProvider";
import type { FC } from "react";
import { Helmet } from "react-helmet-async";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { TabLink, Tabs, TabsList } from "components/Tabs/Tabs";
import { useSearchParamsKey } from "hooks/useSearchParamsKey";
import { useDeploymentSettings } from "modules/management/DeploymentSettingsProvider";
import { castNotificationMethod } from "modules/notifications/utils";
import { Section } from "pages/UserSettingsPage/Section";
import type { FC } from "react";
import { Helmet } from "react-helmet-async";
import { useQueries } from "react-query";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const CreateOAuth2AppPage: FC = () => {
`Successfully added the OAuth2 application "${app.name}".`,
);
navigate(`/deployment/oauth2-provider/apps/${app.id}?created=true`);
} catch (ignore) {
} catch {
displayError("Failed to create OAuth2 application");
}
}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import KeyboardArrowLeft from "@mui/icons-material/KeyboardArrowLeft";
import type * as TypesGen from "api/typesGenerated";
import { ErrorAlert } from "components/Alert/ErrorAlert";
import { Button } from "components/Button/Button";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const EditOAuth2AppPage: FC = () => {
`Successfully updated the OAuth2 application "${req.name}".`,
);
navigate("/deployment/oauth2-provider/apps?updated=true");
} catch (ignore) {
} catch {
displayError("Failed to update OAuth2 application");
}
}}
Expand All @@ -73,7 +73,7 @@ const EditOAuth2AppPage: FC = () => {
`You have successfully deleted the OAuth2 application "${name}"`,
);
navigate("/deployment/oauth2-provider/apps?deleted=true");
} catch (error) {
} catch {
displayError("Failed to delete OAuth2 application");
}
}}
Expand All @@ -82,7 +82,7 @@ const EditOAuth2AppPage: FC = () => {
const secret = await postSecretMutation.mutateAsync(appId);
displaySuccess("Successfully generated OAuth2 client secret");
setFullNewSecret(secret);
} catch (ignore) {
} catch {
displayError("Failed to generate OAuth2 client secret");
}
}}
Expand All @@ -93,7 +93,7 @@ const EditOAuth2AppPage: FC = () => {
if (fullNewSecret?.id === secretId) {
setFullNewSecret(undefined);
}
} catch (ignore) {
} catch {
displayError("Failed to delete OAuth2 client secret");
}
}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Loader } from "components/Loader/Loader";
import { useDashboard } from "modules/dashboard/useDashboard";
import { useDeploymentSettings } from "modules/management/DeploymentSettingsProvider";
import type { FC } from "react";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Loader } from "components/Loader/Loader";
import { useDeploymentSettings } from "modules/management/DeploymentSettingsProvider";
import type { FC } from "react";
import { Helmet } from "react-helmet-async";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Interpolation, type Theme, useTheme } from "@emotion/react";
import type { Interpolation, Theme } from "@emotion/react";
import AddIcon from "@mui/icons-material/AddOutlined";
import AddOutlined from "@mui/icons-material/AddOutlined";
import Button from "@mui/material/Button";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
roleIdpSyncSettings,
} from "api/queries/organizations";
import { organizationRoles } from "api/queries/roles";
import type { GroupSyncSettings, RoleSyncSettings } from "api/typesGenerated";
import { ChooseOne, Cond } from "components/Conditionals/ChooseOne";
import { EmptyState } from "components/EmptyState/EmptyState";
import { displayError } from "components/GlobalSnackbar/utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { screen, within } from "@testing-library/react";
import { screen } from "@testing-library/react";
import { http, HttpResponse } from "msw";
import {
MockDefaultOrganization,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { Interpolation, Theme } from "@emotion/react";
import TextField from "@mui/material/TextField";
import { isApiValidationError } from "api/errors";
import type {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { provisionerDaemons } from "api/queries/organizations";
import type { Organization, ProvisionerDaemon } from "api/typesGenerated";
import type { ProvisionerDaemon } from "api/typesGenerated";
import { Avatar } from "components/Avatar/Avatar";
import { Button } from "components/Button/Button";
import { EmptyState } from "components/EmptyState/EmptyState";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { provisionerJobs } from "api/queries/organizations";
import type { Organization, ProvisionerJob } from "api/typesGenerated";
import type { ProvisionerJob } from "api/typesGenerated";
import { Avatar } from "components/Avatar/Avatar";
import { Badge } from "components/Badge/Badge";
import { Button } from "components/Button/Button";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ import {
PopoverContent,
PopoverTrigger,
} from "components/deprecated/Popover/Popover";
import { ChevronDownIcon, ChevronRightIcon } from "lucide-react";
import { type FC, useEffect, useState } from "react";
import { cn } from "utils/cn";

const roleDescriptions: Record<string, string> = {
owner:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from "@storybook/react";
import { expect, spyOn, userEvent, within } from "@storybook/test";
import { spyOn, userEvent, within } from "@storybook/test";
import { API } from "api/api";
import { mockApiError } from "testHelpers/entities";
import { withGlobalSnackbar } from "testHelpers/storybook";
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/ResetPasswordPage/ChangePasswordPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Interpolation, Theme } from "@emotion/react";
import LoadingButton from "@mui/lab/LoadingButton";
import Button from "@mui/material/Button";
import TextField from "@mui/material/TextField";
import { isApiError, isApiValidationError } from "api/errors";
import { isApiValidationError } from "api/errors";
import { changePasswordWithOTP } from "api/queries/users";
import { ErrorAlert } from "components/Alert/ErrorAlert";
import { CustomLogo } from "components/CustomLogo/CustomLogo";
Expand Down
2 changes: 0 additions & 2 deletions site/src/pages/ResetPasswordPage/RequestOTPPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ import { type Interpolation, type Theme, useTheme } from "@emotion/react";
import LoadingButton from "@mui/lab/LoadingButton";
import Button from "@mui/material/Button";
import TextField from "@mui/material/TextField";
import { getErrorMessage } from "api/errors";
import { requestOneTimePassword } from "api/queries/users";
import { ErrorAlert } from "components/Alert/ErrorAlert";
import { CustomLogo } from "components/CustomLogo/CustomLogo";
import { displayError } from "components/GlobalSnackbar/utils";
import { Stack } from "components/Stack/Stack";
import type { FC } from "react";
import { Helmet } from "react-helmet-async";
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/SetupPage/SetupPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { authMethods, createFirstUser } from "api/queries/users";
import { Loader } from "components/Loader/Loader";
import { useAuthContext } from "contexts/auth/AuthProvider";
import { useEmbeddedMetadata } from "hooks/useEmbeddedMetadata";
import { type FC, useEffect, useState } from "react";
import { type FC, useEffect } from "react";
import { Helmet } from "react-helmet-async";
import { useMutation, useQuery } from "react-query";
import { Navigate, useNavigate } from "react-router-dom";
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/SetupPage/SetupPageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { PasswordField } from "components/PasswordField/PasswordField";
import { SignInLayout } from "components/SignInLayout/SignInLayout";
import { Stack } from "components/Stack/Stack";
import { type FormikContextType, useFormik } from "formik";
import { type ChangeEvent, type FC, useCallback } from "react";
import type { ChangeEvent, FC } from "react";
import { docs } from "utils/docs";
import {
getFormHelpers,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Meta, StoryObj } from "@storybook/react";
import { chromatic } from "testHelpers/chromatic";
import { MockEntitlementsWithUserLimit } from "testHelpers/entities";
import { TemplateInsightsPageView } from "./TemplateInsightsPage";

const meta: Meta<typeof TemplateInsightsPageView> = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { API, withDefaultFeatures } from "api/api";
import type { Template, UpdateTemplateMeta } from "api/typesGenerated";
import type { UpdateTemplateMeta } from "api/typesGenerated";
import { http, HttpResponse } from "msw";
import {
MockEntitlements,
Expand Down
1 change: 0 additions & 1 deletion site/src/pages/TemplatesPage/CreateTemplateButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Inventory2 from "@mui/icons-material/Inventory2";
import NoteAddOutlined from "@mui/icons-material/NoteAddOutlined";
import UploadOutlined from "@mui/icons-material/UploadOutlined";
import { Button } from "components/Button/Button";
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import type {
} from "api/typesGenerated";
import { ErrorAlert } from "components/Alert/ErrorAlert";
import { Avatar } from "components/Avatar/Avatar";
import { AvatarData } from "components/Avatar/AvatarData";
import { Loader } from "components/Loader/Loader";
import {
MoreMenu,
Expand Down
Loading
Loading