Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1e2abbf

Browse files
committed
chore: remove unused exports
1 parent cf48a1b commit 1e2abbf

File tree

9 files changed

+5
-82
lines changed

9 files changed

+5
-82
lines changed

site/src/testHelpers/entities.ts

-6
Original file line numberDiff line numberDiff line change
@@ -4335,9 +4335,3 @@ export const MockWorkspaceAgentContainer: TypesGen.WorkspaceAgentContainer = {
43354335
"/mnt/volume1": "/volume1",
43364336
},
43374337
};
4338-
4339-
export const MockWorkspaceAgentListContainersResponse: TypesGen.WorkspaceAgentListContainersResponse =
4340-
{
4341-
containers: [MockWorkspaceAgentContainer],
4342-
warnings: ["This is a warning"],
4343-
};

site/src/testHelpers/localStorage.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const localStorageMock = (): Storage => {
1+
const localStorageMock = (): Storage => {
22
const store = new Map<string, string>();
33

44
return {

site/src/testHelpers/storybook.tsx

-25
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { StoryContext } from "@storybook/react";
22
import { withDefaultFeatures } from "api/api";
33
import { getAuthorizationKey } from "api/queries/authCheck";
4-
import { getProvisionerDaemonsKey } from "api/queries/organizations";
54
import { hasFirstUserKey, meKey } from "api/queries/users";
65
import type { Entitlements } from "api/typesGenerated";
76
import { GlobalSnackbar } from "components/GlobalSnackbar/GlobalSnackbar";
@@ -125,30 +124,6 @@ export const withAuthProvider = (Story: FC, { parameters }: StoryContext) => {
125124
);
126125
};
127126

128-
export const withProvisioners = (Story: FC, { parameters }: StoryContext) => {
129-
if (!parameters.organization_id) {
130-
throw new Error(
131-
"You forgot to add `parameters.organization_id` to your story",
132-
);
133-
}
134-
if (!parameters.provisioners) {
135-
throw new Error(
136-
"You forgot to add `parameters.provisioners` to your story",
137-
);
138-
}
139-
if (!parameters.tags) {
140-
throw new Error("You forgot to add `parameters.tags` to your story");
141-
}
142-
143-
const queryClient = useQueryClient();
144-
queryClient.setQueryData(
145-
getProvisionerDaemonsKey(parameters.organization_id, parameters.tags),
146-
parameters.provisioners,
147-
);
148-
149-
return <Story />;
150-
};
151-
152127
export const withGlobalSnackbar = (Story: FC) => (
153128
<>
154129
<Story />

site/src/theme/dark/branding.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Branding } from "../branding";
22
import colors from "../tailwindColors";
33

4-
export const branding: Branding = {
4+
const branding: Branding = {
55
enterprise: {
66
background: colors.blue[950],
77
divider: colors.blue[900],

site/src/theme/light/branding.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Branding } from "../branding";
22
import colors from "../tailwindColors";
33

4-
export const branding: Branding = {
4+
const branding: Branding = {
55
enterprise: {
66
background: colors.blue[100],
77
divider: colors.blue[300],

site/src/utils/appearance.ts

-15
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,3 @@ export const getLogoURL = (): string => {
1414
?.getAttribute("content");
1515
return c && !c.startsWith("{{ .") ? c : "";
1616
};
17-
18-
/**
19-
* Exposes an easy way to determine if a given URL is for an emoji hosted on
20-
* the Coder deployment.
21-
*
22-
* Helps when you need to style emojis differently (i.e., not adding rounding to
23-
* the container so that the emoji doesn't get cut off).
24-
*/
25-
export function isEmojiUrl(url: string | undefined): boolean {
26-
if (!url) {
27-
return false;
28-
}
29-
30-
return url.startsWith("/emojis/");
31-
}

site/src/utils/colors.ts

-24
Original file line numberDiff line numberDiff line change
@@ -62,30 +62,6 @@ export function isHslColor(input: string): boolean {
6262
return true;
6363
}
6464

65-
// Used to convert our theme colors to Hex since monaco theme only support hex colors
66-
// From https://www.jameslmilner.com/posts/converting-rgb-hex-hsl-colors/
67-
export function hslToHex(hsl: string): string {
68-
const [h, s, l] = hsl
69-
.replace("hsl(", "")
70-
.replace(")", "")
71-
.replaceAll("%", "")
72-
.split(",")
73-
.map(Number);
74-
75-
const hDecimal = l / 100;
76-
const a = (s * Math.min(hDecimal, 1 - hDecimal)) / 100;
77-
const f = (n: number) => {
78-
const k = (n + h / 30) % 12;
79-
const color = hDecimal - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
80-
81-
// Convert to Hex and prefix with "0" if required
82-
return Math.round(255 * color)
83-
.toString(16)
84-
.padStart(2, "0");
85-
};
86-
return `#${f(0)}${f(8)}${f(4)}`;
87-
}
88-
8965
export const readableForegroundColor = (backgroundColor: string): string => {
9066
const rgb = hex.rgb(backgroundColor);
9167

site/src/utils/schedule.tsx

+2-5
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const extractTimezone = (
5555
};
5656

5757
/** Language used in the schedule components */
58-
export const Language = {
58+
const Language = {
5959
manual: "Manual",
6060
workspaceShuttingDownLabel: "Workspace is shutting down",
6161
afterStart: "after start",
@@ -77,10 +77,7 @@ export const autostartDisplay = (schedule: string | undefined): string => {
7777
return Language.manual;
7878
};
7979

80-
export const isShuttingDown = (
81-
workspace: Workspace,
82-
deadline?: Dayjs,
83-
): boolean => {
80+
const isShuttingDown = (workspace: Workspace, deadline?: Dayjs): boolean => {
8481
if (!deadline) {
8582
if (!workspace.latest_build.deadline) {
8683
return false;

site/src/utils/workspace.tsx

-4
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,6 @@ export const getDisplayWorkspaceStatus = (
256256
}
257257
};
258258

259-
export const hasJobError = (workspace: TypesGen.Workspace) => {
260-
return workspace.latest_build.job.error !== undefined;
261-
};
262-
263259
export const paramsUsedToCreateWorkspace = (
264260
param: TypesGen.TemplateVersionParameter,
265261
) => !param.ephemeral;

0 commit comments

Comments
 (0)