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

Skip to content

chore: Remove FE dead code #5760

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 3 commits into from
Jan 17, 2023
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
1 change: 0 additions & 1 deletion site/e2e/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ export const basePort = 3000
// Credentials for the default user when running in dev mode.
export const username = "developer"
export const password = "password"
export const organization = "acme-corp"
export const email = "[email protected]"
4 changes: 3 additions & 1 deletion site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"test": "jest --selectProjects test",
"test:coverage": "jest --selectProjects test --collectCoverage",
"test:watch": "jest --selectProjects test --watch",
"typegen": "xstate typegen 'src/**/*.ts'"
"typegen": "xstate typegen 'src/**/*.ts'",
"deadcode": "ts-prune | grep -v \".stories\\|.typegen\\|.config\\|e2e\\|__mocks__\\|used in module\\|testHelpers\\|typesGenerated\" || echo \"No deadcode found.\""
},
"dependencies": {
"@emoji-mart/data": "1.0.5",
Expand Down Expand Up @@ -68,6 +69,7 @@
"react-syntax-highlighter": "15.5.0",
"remark-gfm": "3.0.1",
"sourcemapped-stacktrace": "1.1.11",
"ts-prune": "0.10.3",
"tzdata": "1.0.30",
"ua-parser-js": "1.0.2",
"uuid": "9.0.0",
Expand Down
2 changes: 1 addition & 1 deletion site/src/api/errors.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios, { AxiosError, AxiosResponse } from "axios"

export const Language = {
const Language = {
errorsByCode: {
defaultErrorCode: "Invalid value",
},
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/AppLink/AppLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { generateRandomString } from "../../util/random"
import { BaseIcon } from "./BaseIcon"
import { ShareIcon } from "./ShareIcon"

export const Language = {
const Language = {
appTitle: (appName: string, identifier: string): string =>
`${appName} - ${identifier}`,
}
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/AppLink/AppLinkSkeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const AppLinkSkeleton: FC<{ width: number }> = ({ width }) => {
)
}

export const useStyles = makeStyles(() => ({
const useStyles = makeStyles(() => ({
skeleton: {
borderRadius: borderRadiusSm,
},
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/AppLink/AppPreviewLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as TypesGen from "api/typesGenerated"
import { BaseIcon } from "./BaseIcon"
import { ShareIcon } from "./ShareIcon"

export interface AppPreviewProps {
interface AppPreviewProps {
app: TypesGen.WorkspaceApp
}

Expand Down
11 changes: 0 additions & 11 deletions site/src/components/DeploySettingsLayout/Badges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,6 @@ export const EnterpriseBadge: FC = () => {
)
}

export const VersionBadge: FC<{
version: string
}> = ({ version }) => {
const styles = useStyles()
return (
<span className={combineClasses([styles.badge, styles.versionBadge])}>
Version: {version}
</span>
)
}

export const Badges: FC<PropsWithChildren> = ({ children }) => {
const styles = useStyles()
return (
Expand Down
62 changes: 0 additions & 62 deletions site/src/components/Dialogs/Dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import MuiDialog, {
DialogProps as MuiDialogProps,
} from "@material-ui/core/Dialog"
import MuiDialogTitle from "@material-ui/core/DialogTitle"
import { alpha, darken, lighten, makeStyles } from "@material-ui/core/styles"
import SvgIcon from "@material-ui/core/SvgIcon"
import * as React from "react"
import { combineClasses } from "../../util/combineClasses"
import {
Expand All @@ -12,66 +10,6 @@ import {
} from "../LoadingButton/LoadingButton"
import { ConfirmDialogType } from "./types"

export interface DialogTitleProps {
/** Title for display */
title: React.ReactNode
/** Optional icon to display faded to the right of the title */
icon?: typeof SvgIcon
/** Smaller text to display above the title */
superTitle?: React.ReactNode
}

/**
* Override of Material UI's DialogTitle that allows for a supertitle and background icon
*/
export const DialogTitle: React.FC<DialogTitleProps> = ({
title,
icon: Icon,
superTitle,
}) => {
const styles = useTitleStyles()
return (
<MuiDialogTitle disableTypography>
<div className={styles.titleWrapper}>
{superTitle && <div className={styles.superTitle}>{superTitle}</div>}
<div className={styles.title}>{title}</div>
</div>
{Icon && <Icon className={styles.icon} />}
</MuiDialogTitle>
)
}

const useTitleStyles = makeStyles(
(theme) => ({
title: {
position: "relative",
zIndex: 2,
fontSize: theme.typography.h3.fontSize,
fontWeight: theme.typography.h3.fontWeight,
lineHeight: "40px",
display: "flex",
alignItems: "center",
},
superTitle: {
position: "relative",
zIndex: 2,
fontSize: theme.typography.body2.fontSize,
fontWeight: 500,
letterSpacing: 1.5,
textTransform: "uppercase",
},
titleWrapper: {
padding: `${theme.spacing(2)}px 0`,
},
icon: {
height: 84,
width: 84,
color: alpha(theme.palette.action.disabled, 0.4),
},
}),
{ name: "CdrDialogTitle" },
)

export interface DialogActionButtonsProps {
/** Text to display in the cancel button */
cancelText?: string
Expand Down
52 changes: 0 additions & 52 deletions site/src/components/FormDropdownField/FormDropdownField.tsx

This file was deleted.

68 changes: 0 additions & 68 deletions site/src/components/FormSection/FormSection.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion site/src/components/FormTextField/FormTextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { PasswordField } from "../PasswordField/PasswordField"
/**
* FormFieldProps are required props for creating form fields using a factory.
*/
export interface FormFieldProps<T> {
interface FormFieldProps<T> {
/**
* form is a reference to a form or subform and is used to compute common
* states such as error and helper text
Expand Down
33 changes: 0 additions & 33 deletions site/src/components/FormTitle/FormTitle.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions site/src/components/Icons/DocsIcon.tsx

This file was deleted.

26 changes: 0 additions & 26 deletions site/src/components/Icons/Logo.tsx

This file was deleted.

Loading