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

Skip to content

Commit ea1b03f

Browse files
chore: Remove FE dead code (#5760)
1 parent a13614e commit ea1b03f

39 files changed

+62
-616
lines changed

site/e2e/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ export const basePort = 3000
55
// Credentials for the default user when running in dev mode.
66
export const username = "developer"
77
export const password = "password"
8-
export const organization = "acme-corp"
98
export const email = "[email protected]"

site/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"test": "jest --selectProjects test",
2424
"test:coverage": "jest --selectProjects test --collectCoverage",
2525
"test:watch": "jest --selectProjects test --watch",
26-
"typegen": "xstate typegen 'src/**/*.ts'"
26+
"typegen": "xstate typegen 'src/**/*.ts'",
27+
"deadcode": "ts-prune | grep -v \".stories\\|.typegen\\|.config\\|e2e\\|__mocks__\\|used in module\\|testHelpers\\|typesGenerated\" || echo \"No deadcode found.\""
2728
},
2829
"dependencies": {
2930
"@emoji-mart/data": "1.0.5",
@@ -68,6 +69,7 @@
6869
"react-syntax-highlighter": "15.5.0",
6970
"remark-gfm": "3.0.1",
7071
"sourcemapped-stacktrace": "1.1.11",
72+
"ts-prune": "0.10.3",
7173
"tzdata": "1.0.30",
7274
"ua-parser-js": "1.0.2",
7375
"uuid": "9.0.0",

site/src/api/errors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import axios, { AxiosError, AxiosResponse } from "axios"
22

3-
export const Language = {
3+
const Language = {
44
errorsByCode: {
55
defaultErrorCode: "Invalid value",
66
},

site/src/components/AppLink/AppLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { generateRandomString } from "../../util/random"
1010
import { BaseIcon } from "./BaseIcon"
1111
import { ShareIcon } from "./ShareIcon"
1212

13-
export const Language = {
13+
const Language = {
1414
appTitle: (appName: string, identifier: string): string =>
1515
`${appName} - ${identifier}`,
1616
}

site/src/components/AppLink/AppLinkSkeleton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const AppLinkSkeleton: FC<{ width: number }> = ({ width }) => {
1515
)
1616
}
1717

18-
export const useStyles = makeStyles(() => ({
18+
const useStyles = makeStyles(() => ({
1919
skeleton: {
2020
borderRadius: borderRadiusSm,
2121
},

site/src/components/AppLink/AppPreviewLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as TypesGen from "api/typesGenerated"
55
import { BaseIcon } from "./BaseIcon"
66
import { ShareIcon } from "./ShareIcon"
77

8-
export interface AppPreviewProps {
8+
interface AppPreviewProps {
99
app: TypesGen.WorkspaceApp
1010
}
1111

site/src/components/DeploySettingsLayout/Badges.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,6 @@ export const EnterpriseBadge: FC = () => {
4040
)
4141
}
4242

43-
export const VersionBadge: FC<{
44-
version: string
45-
}> = ({ version }) => {
46-
const styles = useStyles()
47-
return (
48-
<span className={combineClasses([styles.badge, styles.versionBadge])}>
49-
Version: {version}
50-
</span>
51-
)
52-
}
53-
5443
export const Badges: FC<PropsWithChildren> = ({ children }) => {
5544
const styles = useStyles()
5645
return (

site/src/components/Dialogs/Dialog.tsx

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import MuiDialog, {
22
DialogProps as MuiDialogProps,
33
} from "@material-ui/core/Dialog"
4-
import MuiDialogTitle from "@material-ui/core/DialogTitle"
54
import { alpha, darken, lighten, makeStyles } from "@material-ui/core/styles"
6-
import SvgIcon from "@material-ui/core/SvgIcon"
75
import * as React from "react"
86
import { combineClasses } from "../../util/combineClasses"
97
import {
@@ -12,66 +10,6 @@ import {
1210
} from "../LoadingButton/LoadingButton"
1311
import { ConfirmDialogType } from "./types"
1412

15-
export interface DialogTitleProps {
16-
/** Title for display */
17-
title: React.ReactNode
18-
/** Optional icon to display faded to the right of the title */
19-
icon?: typeof SvgIcon
20-
/** Smaller text to display above the title */
21-
superTitle?: React.ReactNode
22-
}
23-
24-
/**
25-
* Override of Material UI's DialogTitle that allows for a supertitle and background icon
26-
*/
27-
export const DialogTitle: React.FC<DialogTitleProps> = ({
28-
title,
29-
icon: Icon,
30-
superTitle,
31-
}) => {
32-
const styles = useTitleStyles()
33-
return (
34-
<MuiDialogTitle disableTypography>
35-
<div className={styles.titleWrapper}>
36-
{superTitle && <div className={styles.superTitle}>{superTitle}</div>}
37-
<div className={styles.title}>{title}</div>
38-
</div>
39-
{Icon && <Icon className={styles.icon} />}
40-
</MuiDialogTitle>
41-
)
42-
}
43-
44-
const useTitleStyles = makeStyles(
45-
(theme) => ({
46-
title: {
47-
position: "relative",
48-
zIndex: 2,
49-
fontSize: theme.typography.h3.fontSize,
50-
fontWeight: theme.typography.h3.fontWeight,
51-
lineHeight: "40px",
52-
display: "flex",
53-
alignItems: "center",
54-
},
55-
superTitle: {
56-
position: "relative",
57-
zIndex: 2,
58-
fontSize: theme.typography.body2.fontSize,
59-
fontWeight: 500,
60-
letterSpacing: 1.5,
61-
textTransform: "uppercase",
62-
},
63-
titleWrapper: {
64-
padding: `${theme.spacing(2)}px 0`,
65-
},
66-
icon: {
67-
height: 84,
68-
width: 84,
69-
color: alpha(theme.palette.action.disabled, 0.4),
70-
},
71-
}),
72-
{ name: "CdrDialogTitle" },
73-
)
74-
7513
export interface DialogActionButtonsProps {
7614
/** Text to display in the cancel button */
7715
cancelText?: string

site/src/components/FormDropdownField/FormDropdownField.tsx

Lines changed: 0 additions & 52 deletions
This file was deleted.

site/src/components/FormSection/FormSection.tsx

Lines changed: 0 additions & 68 deletions
This file was deleted.

site/src/components/FormTextField/FormTextField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { PasswordField } from "../PasswordField/PasswordField"
66
/**
77
* FormFieldProps are required props for creating form fields using a factory.
88
*/
9-
export interface FormFieldProps<T> {
9+
interface FormFieldProps<T> {
1010
/**
1111
* form is a reference to a form or subform and is used to compute common
1212
* states such as error and helper text

site/src/components/FormTitle/FormTitle.tsx

Lines changed: 0 additions & 33 deletions
This file was deleted.

site/src/components/Icons/DocsIcon.tsx

Lines changed: 0 additions & 12 deletions
This file was deleted.

site/src/components/Icons/Logo.tsx

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)