mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: Remove FE dead code (#5760)
This commit is contained in:
@@ -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 = "admin@coder.com"
|
||||
|
||||
+3
-1
@@ -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",
|
||||
@@ -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",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import axios, { AxiosError, AxiosResponse } from "axios"
|
||||
|
||||
export const Language = {
|
||||
const Language = {
|
||||
errorsByCode: {
|
||||
defaultErrorCode: "Invalid value",
|
||||
},
|
||||
|
||||
@@ -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}`,
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ export const AppLinkSkeleton: FC<{ width: number }> = ({ width }) => {
|
||||
)
|
||||
}
|
||||
|
||||
export const useStyles = makeStyles(() => ({
|
||||
const useStyles = makeStyles(() => ({
|
||||
skeleton: {
|
||||
borderRadius: borderRadiusSm,
|
||||
},
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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 {
|
||||
@@ -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
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
import Box from "@material-ui/core/Box"
|
||||
import MenuItem from "@material-ui/core/MenuItem"
|
||||
import { makeStyles } from "@material-ui/core/styles"
|
||||
import Typography from "@material-ui/core/Typography"
|
||||
import { ReactElement } from "react"
|
||||
import {
|
||||
FormTextField,
|
||||
FormTextFieldProps,
|
||||
} from "../FormTextField/FormTextField"
|
||||
|
||||
export interface FormDropdownItem {
|
||||
value: string
|
||||
name: string
|
||||
description?: string
|
||||
}
|
||||
|
||||
export interface FormDropdownFieldProps<T> extends FormTextFieldProps<T> {
|
||||
items: FormDropdownItem[]
|
||||
}
|
||||
|
||||
export const FormDropdownField = <T,>({
|
||||
items,
|
||||
...props
|
||||
}: FormDropdownFieldProps<T>): ReactElement => {
|
||||
const styles = useStyles()
|
||||
return (
|
||||
<FormTextField select {...props}>
|
||||
{items.map((item: FormDropdownItem) => (
|
||||
<MenuItem key={item.value} value={item.value}>
|
||||
<Box alignItems="center" display="flex">
|
||||
<Box ml={1}>
|
||||
<Typography>{item.name}</Typography>
|
||||
</Box>
|
||||
{item.description && (
|
||||
<Box ml={1}>
|
||||
<Typography className={styles.hintText} variant="caption">
|
||||
{item.description}
|
||||
</Typography>
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
</MenuItem>
|
||||
))}
|
||||
</FormTextField>
|
||||
)
|
||||
}
|
||||
|
||||
const useStyles = makeStyles({
|
||||
hintText: {
|
||||
opacity: 0.75,
|
||||
},
|
||||
})
|
||||
@@ -1,68 +0,0 @@
|
||||
import { makeStyles } from "@material-ui/core/styles"
|
||||
import Typography from "@material-ui/core/Typography"
|
||||
import { FC } from "react"
|
||||
|
||||
export interface FormSectionProps {
|
||||
title: string
|
||||
description?: string
|
||||
}
|
||||
|
||||
export const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
display: "flex",
|
||||
flexDirection: "row",
|
||||
// Borrowed from PaperForm styles
|
||||
maxWidth: "852px",
|
||||
width: "100%",
|
||||
borderBottom: `1px solid ${theme.palette.divider}`,
|
||||
},
|
||||
descriptionContainer: {
|
||||
maxWidth: "200px",
|
||||
flex: "0 0 200px",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
justifyContent: "flex-start",
|
||||
alignItems: "flex-start",
|
||||
marginTop: theme.spacing(5),
|
||||
marginBottom: theme.spacing(2),
|
||||
},
|
||||
descriptionText: {
|
||||
fontSize: "0.9em",
|
||||
lineHeight: "1em",
|
||||
color: theme.palette.text.secondary,
|
||||
marginTop: theme.spacing(1),
|
||||
},
|
||||
contents: {
|
||||
flex: 1,
|
||||
marginTop: theme.spacing(4),
|
||||
marginBottom: theme.spacing(4),
|
||||
},
|
||||
}))
|
||||
|
||||
export const FormSection: FC<React.PropsWithChildren<FormSectionProps>> = ({
|
||||
title,
|
||||
description,
|
||||
children,
|
||||
}) => {
|
||||
const styles = useStyles()
|
||||
|
||||
return (
|
||||
<div className={styles.root}>
|
||||
<div className={styles.descriptionContainer}>
|
||||
<Typography variant="h5" color="textPrimary">
|
||||
{title}
|
||||
</Typography>
|
||||
{description && (
|
||||
<Typography
|
||||
className={styles.descriptionText}
|
||||
variant="body2"
|
||||
color="textSecondary"
|
||||
>
|
||||
{description}
|
||||
</Typography>
|
||||
)}
|
||||
</div>
|
||||
<div className={styles.contents}>{children}</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
import { makeStyles } from "@material-ui/core/styles"
|
||||
import Typography from "@material-ui/core/Typography"
|
||||
import { FC, ReactNode } from "react"
|
||||
|
||||
export interface FormTitleProps {
|
||||
title: string
|
||||
detail?: ReactNode
|
||||
}
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
title: {
|
||||
marginTop: theme.spacing(6),
|
||||
marginBottom: theme.spacing(4),
|
||||
|
||||
"& h3": {
|
||||
marginBottom: theme.spacing(1),
|
||||
},
|
||||
},
|
||||
}))
|
||||
|
||||
export const FormTitle: FC<React.PropsWithChildren<FormTitleProps>> = ({
|
||||
title,
|
||||
detail,
|
||||
}) => {
|
||||
const styles = useStyles()
|
||||
|
||||
return (
|
||||
<div className={styles.title}>
|
||||
<Typography variant="h3">{title}</Typography>
|
||||
{detail && <Typography variant="caption">{detail}</Typography>}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import SvgIcon, { SvgIconProps } from "@material-ui/core/SvgIcon"
|
||||
|
||||
export const DocsIcon = (props: SvgIconProps): JSX.Element => (
|
||||
<SvgIcon {...props} viewBox="0 0 24 24">
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M6.53846 3.75C4.67698 3.75 2.86058 4.50721 2.86058 4.50721L2.5 4.66947V16.4423H9.00841C9.20898 16.7871 9.57407 17.0192 10 17.0192C10.4259 17.0192 10.791 16.7871 10.9916 16.4423H17.5V4.66947L17.1394 4.50721C17.1394 4.50721 15.323 3.75 13.4615 3.75C11.7781 3.75 10.2997 4.31566 10 4.4351C9.70027 4.31566 8.22191 3.75 6.53846 3.75ZM6.53846 4.90385C7.654 4.90385 8.84615 5.26442 9.42308 5.46274V14.7656C8.7808 14.5538 7.72611 14.2608 6.53846 14.2608C5.32602 14.2608 4.33894 14.5403 3.65385 14.7656V5.46274C4.09781 5.30273 5.26968 4.90385 6.53846 4.90385ZM13.4615 4.90385C14.7303 4.90385 15.9022 5.30273 16.3462 5.46274V14.7656C15.6611 14.5403 14.674 14.2608 13.4615 14.2608C12.2739 14.2608 11.2192 14.5538 10.5769 14.7656V5.46274C11.1538 5.26442 12.346 4.90385 13.4615 4.90385Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</SvgIcon>
|
||||
)
|
||||
@@ -1,26 +0,0 @@
|
||||
import * as React from "react"
|
||||
|
||||
export const Logo = (props: React.SVGProps<SVGSVGElement>): JSX.Element => (
|
||||
<svg
|
||||
aria-labelledby="title"
|
||||
viewBox="0 0 341 75"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
{...props}
|
||||
>
|
||||
<title id="title" lang="en">
|
||||
Coder logo
|
||||
</title>
|
||||
<path d="M176.753 32.7584H165.554C165.35 31.3095 164.932 30.0226 164.301 28.8976C163.671 27.7555 162.861 26.7839 161.872 25.9828C160.884 25.1817 159.742 24.568 158.446 24.1419C157.168 23.7158 155.779 23.5027 154.279 23.5027C151.568 23.5027 149.208 24.176 147.196 25.5226C145.185 26.8521 143.625 28.7953 142.517 31.3521C141.409 33.8919 140.855 36.9771 140.855 40.6078C140.855 44.3408 141.409 47.4771 142.517 50.0169C143.642 52.5567 145.21 54.4743 147.222 55.7697C149.233 57.0652 151.56 57.7129 154.202 57.7129C155.685 57.7129 157.057 57.5169 158.318 57.1249C159.597 56.7328 160.73 56.1618 161.719 55.4118C162.708 54.6447 163.526 53.7158 164.173 52.6249C164.838 51.534 165.298 50.2896 165.554 48.8919L176.753 48.943C176.463 51.3464 175.739 53.6646 174.58 55.8976C173.438 58.1135 171.895 60.0993 169.952 61.855C168.026 63.5936 165.725 64.9743 163.048 65.997C160.389 67.0027 157.381 67.5055 154.023 67.5055C149.352 67.5055 145.176 66.4487 141.494 64.3351C137.83 62.2214 134.932 59.1618 132.801 55.1561C130.688 51.1504 129.631 46.301 129.631 40.6078C129.631 34.8976 130.705 30.0396 132.852 26.0339C135 22.0283 137.915 18.9771 141.597 16.8805C145.279 14.7669 149.421 13.7101 154.023 13.7101C157.057 13.7101 159.869 14.1362 162.46 14.9885C165.068 15.8408 167.378 17.0851 169.389 18.7214C171.401 20.3408 173.037 22.3266 174.298 24.6788C175.577 27.0311 176.395 29.7243 176.753 32.7584Z" />
|
||||
<path d="M202.032 67.5567C198.06 67.5567 194.625 66.7129 191.728 65.0254C188.847 63.3209 186.623 60.9516 185.054 57.9175C183.486 54.8663 182.702 51.3294 182.702 47.3067C182.702 43.2499 183.486 39.7044 185.054 36.6703C186.623 33.6192 188.847 31.2499 191.728 29.5624C194.625 27.8578 198.06 27.0055 202.032 27.0055C206.003 27.0055 209.429 27.8578 212.31 29.5624C215.208 31.2499 217.441 33.6192 219.009 36.6703C220.577 39.7044 221.361 43.2499 221.361 47.3067C221.361 51.3294 220.577 54.8663 219.009 57.9175C217.441 60.9516 215.208 63.3209 212.31 65.0254C209.429 66.7129 206.003 67.5567 202.032 67.5567ZM202.083 59.1192C203.89 59.1192 205.398 58.6078 206.608 57.5851C207.819 56.5453 208.731 55.1305 209.344 53.3408C209.975 51.551 210.29 49.5141 210.29 47.23C210.29 44.9459 209.975 42.9089 209.344 41.1192C208.731 39.3294 207.819 37.9146 206.608 36.8749C205.398 35.8351 203.89 35.3152 202.083 35.3152C200.259 35.3152 198.725 35.8351 197.481 36.8749C196.253 37.9146 195.324 39.3294 194.694 41.1192C194.08 42.9089 193.773 44.9459 193.773 47.23C193.773 49.5141 194.08 51.551 194.694 53.3408C195.324 55.1305 196.253 56.5453 197.481 57.5851C198.725 58.6078 200.259 59.1192 202.083 59.1192Z" />
|
||||
<path d="M242.715 67.4288C239.732 67.4288 237.031 66.6618 234.61 65.1277C232.207 63.5766 230.298 61.301 228.883 58.301C227.485 55.284 226.786 51.5851 226.786 47.2044C226.786 42.7044 227.511 38.9629 228.96 35.98C230.408 32.98 232.335 30.7385 234.738 29.2555C237.158 27.7555 239.809 27.0055 242.69 27.0055C244.889 27.0055 246.721 27.3805 248.187 28.1305C249.67 28.8635 250.863 29.7839 251.766 30.8919C252.687 31.9828 253.386 33.0567 253.863 34.1135H254.195V14.426H265.062V66.7896H254.323V60.4999H253.863C253.352 61.5908 252.627 62.6732 251.69 63.747C250.769 64.8038 249.568 65.6817 248.085 66.3805C246.619 67.0794 244.829 67.4288 242.715 67.4288ZM246.167 58.7612C247.923 58.7612 249.406 58.2839 250.616 57.3294C251.843 56.3578 252.781 55.0027 253.428 53.2641C254.093 51.5254 254.425 49.4885 254.425 47.1533C254.425 44.818 254.102 42.7896 253.454 41.068C252.806 39.3464 251.869 38.0169 250.641 37.0794C249.414 36.1419 247.923 35.6732 246.167 35.6732C244.377 35.6732 242.869 36.1589 241.641 37.1305C240.414 38.1021 239.485 39.4487 238.854 41.1703C238.224 42.8919 237.908 44.8862 237.908 47.1533C237.908 49.4374 238.224 51.4572 238.854 53.2129C239.502 54.9516 240.431 56.3152 241.641 57.3038C242.869 58.2754 244.377 58.7612 246.167 58.7612Z" />
|
||||
<path d="M291.715 67.5567C287.675 67.5567 284.198 66.7385 281.283 65.1021C278.385 63.4487 276.152 61.1135 274.584 58.0964C273.016 55.0624 272.232 51.4743 272.232 47.3322C272.232 43.2925 273.016 39.747 274.584 36.6959C276.152 33.6447 278.36 31.2669 281.206 29.5624C284.07 27.8578 287.428 27.0055 291.28 27.0055C293.871 27.0055 296.283 27.4232 298.516 28.2584C300.766 29.0766 302.726 30.3124 304.397 31.9658C306.084 33.6192 307.397 35.6987 308.334 38.2044C309.272 40.693 309.74 43.6078 309.74 46.9487V49.9402H276.578V43.1902H299.488C299.488 41.622 299.147 40.2328 298.465 39.0226C297.783 37.8124 296.837 36.8663 295.627 36.1845C294.434 35.4857 293.044 35.1362 291.459 35.1362C289.806 35.1362 288.34 35.5197 287.061 36.2868C285.8 37.0368 284.811 38.051 284.095 39.3294C283.38 40.5908 283.013 41.997 282.996 43.5482V49.9658C282.996 51.9089 283.354 53.5879 284.07 55.0027C284.803 56.4175 285.834 57.5084 287.164 58.2754C288.493 59.0425 290.07 59.426 291.894 59.426C293.104 59.426 294.212 59.2555 295.218 58.9146C296.223 58.5737 297.084 58.0624 297.8 57.3805C298.516 56.6987 299.061 55.8635 299.436 54.8749L309.51 55.5396C308.999 57.9601 307.951 60.0737 306.365 61.8805C304.797 63.6703 302.769 65.068 300.28 66.0737C297.809 67.0624 294.953 67.5567 291.715 67.5567Z" />
|
||||
<path d="M316.648 66.7896V27.5169H327.208V34.3692H327.617C328.333 31.9317 329.535 30.0908 331.222 28.8464C332.91 27.5851 334.853 26.9544 337.052 26.9544C337.597 26.9544 338.185 26.9885 338.816 27.0567C339.447 27.1249 340.001 27.2186 340.478 27.3379V37.0027C339.967 36.8493 339.259 36.7129 338.356 36.5936C337.452 36.4743 336.626 36.4146 335.876 36.4146C334.273 36.4146 332.842 36.7641 331.58 37.4629C330.336 38.1447 329.347 39.0993 328.614 40.3266C327.898 41.5538 327.54 42.9686 327.54 44.5709V66.7896H316.648Z" />
|
||||
<path d="M102.464 32.5472C100.371 32.5472 98.9767 31.3202 98.9767 28.8017V14.3362C98.9767 5.10163 95.1722 0 85.3443 0H80.779V9.75122H82.1741C86.0417 9.75122 87.8805 11.8823 87.8805 15.6924V28.4788C87.8805 34.0324 89.529 36.2927 93.1432 37.4551C89.529 38.553 87.8805 40.8777 87.8805 46.4313C87.8805 49.5957 87.8805 52.7599 87.8805 55.9244C87.8805 58.572 87.8805 61.1551 87.1831 63.8027C86.4856 66.2568 85.3443 68.5815 83.7592 70.5833C82.8715 71.7459 81.857 72.7145 80.7158 73.6187V74.9101H85.2808C95.1088 74.9101 98.9132 69.8085 98.9132 60.5738V46.1084C98.9132 43.5253 100.245 42.3629 102.401 42.3629H105V32.6116H102.464V32.5472Z" />
|
||||
<path d="M71.3947 14.7257H57.3186C57.0015 14.7257 56.748 14.4674 56.748 14.1445V13.0467C56.748 12.7238 57.0015 12.4655 57.3186 12.4655H71.4581C71.775 12.4655 72.0287 12.7238 72.0287 13.0467V14.1445C72.0287 14.4674 71.7116 14.7257 71.3947 14.7257Z" />
|
||||
<path d="M73.8044 28.6738H63.5327C63.2156 28.6738 62.9619 28.4154 62.9619 28.0925V26.9948C62.9619 26.672 63.2156 26.4135 63.5327 26.4135H73.8044C74.1215 26.4135 74.375 26.672 74.375 26.9948V28.0925C74.375 28.3509 74.1215 28.6738 73.8044 28.6738Z" />
|
||||
<path d="M77.862 21.6998H57.3186C57.0015 21.6998 56.748 21.4415 56.748 21.1186V20.0208C56.748 19.6979 57.0015 19.4396 57.3186 19.4396H77.7985C78.1157 19.4396 78.3694 19.6979 78.3694 20.0208V21.1186C78.3694 21.3769 78.1791 21.6998 77.862 21.6998Z" />
|
||||
<path d="M41.0235 17.888C42.4183 17.888 43.8134 18.0172 45.1448 18.3401V15.6924C45.1448 11.9469 47.047 9.75122 50.8514 9.75122H52.2462V0H47.681C37.853 0 34.0488 5.10163 34.0488 14.3362V19.115C36.2679 18.3401 38.6141 17.888 41.0235 17.888Z" />
|
||||
<path d="M82.1739 53.0168C81.1594 44.8154 74.9456 37.9701 66.9564 36.4202C64.7373 35.9683 62.518 35.9036 60.3623 36.2911C60.2989 36.2911 60.2989 36.2264 60.2355 36.2264C56.7482 28.8001 49.2664 23.8922 41.1504 23.8922C33.0344 23.8922 25.616 28.671 22.0652 36.0974C22.0018 36.0974 22.0018 36.162 21.9384 36.162C19.6558 35.9036 17.3732 36.0327 15.0906 36.614C7.22825 38.5512 1.26813 45.2674 0.190222 53.4041C0.0633989 54.2436 0 55.0831 0 55.8581C0 58.3119 1.64855 60.5722 4.05796 60.8951C7.03803 61.3473 9.63766 59.0223 9.57426 56.0519C9.57426 55.5997 9.57426 55.0831 9.63766 54.6311C10.1449 50.4981 13.2518 47.011 17.3098 46.0422C18.5779 45.7193 19.846 45.6549 21.0507 45.8487C24.9185 46.3653 28.7228 44.3632 30.3713 40.8761C31.5761 38.293 33.4783 36.0327 36.0145 34.8057C38.8042 33.4495 41.9746 33.256 44.8914 34.2893C47.9347 35.387 50.2172 37.7117 51.6123 40.6177C53.0706 43.4593 53.768 45.4611 56.875 45.8487C58.143 46.0422 61.6937 45.9777 63.0254 45.9131C65.625 45.9131 68.2246 46.8172 70.0634 48.69C71.268 49.9814 72.1557 51.596 72.5362 53.4041C73.1068 56.3101 72.4094 59.2161 70.6974 61.4117C69.4926 62.9616 67.8441 64.124 66.0053 64.6406C65.1176 64.899 64.2299 64.9635 63.3422 64.9635C62.8351 64.9635 62.1377 64.9635 61.3134 64.9635C58.7772 64.9635 53.3877 64.9635 49.3296 64.9635C46.5399 64.9635 44.3206 62.7034 44.3206 59.8618V50.3043V40.9405C44.3206 40.1657 43.6866 39.52 42.9257 39.52H40.9601C37.0922 39.5844 33.9855 43.9759 33.9855 48.6253C33.9855 53.275 33.9855 65.6094 33.9855 65.6094C33.9855 70.6464 37.9799 74.7148 42.9257 74.7148C42.9257 74.7148 64.9276 74.6501 65.2445 74.6501C70.3169 74.1335 75.009 71.4859 78.1792 67.4175C81.3496 63.4782 82.8079 58.3119 82.1739 53.0168Z" />
|
||||
</svg>
|
||||
)
|
||||
@@ -1,30 +0,0 @@
|
||||
import SvgIcon, { SvgIconProps } from "@material-ui/core/SvgIcon"
|
||||
|
||||
export const LogoutIcon = (props: SvgIconProps): JSX.Element => (
|
||||
<SvgIcon {...props} viewBox="0 0 20 20">
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M3.92523 18.5071H11.2169C11.8878 18.5063 12.4314 17.9626 12.4322 17.2918V15.4689H11.2169V17.2918H3.92523V2.70844H11.2169V4.53136H12.4322V2.70844V2.70845C12.4314 2.03759 11.8878 1.49394 11.2169 1.49316H3.92524C3.25438 1.49393 2.71073 2.03758 2.70996 2.70844V17.2918V17.2918C2.71073 17.9626 3.25438 18.5063 3.92523 18.5071Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M12.6751 17.292C12.6742 18.0968 12.022 18.7491 11.2171 18.75H3.92513V18.507L11.2168 18.5072C11.8877 18.5064 12.4313 17.9625 12.4321 17.2917V15.4688H11.2168V17.2917H3.92513V2.70834H11.2168V4.53125H12.4321V2.70848C12.4313 2.03762 11.8877 1.49383 11.2168 1.49306H3.92513V1.25H11.2168C12.0217 1.25093 12.6742 1.90319 12.6751 2.70806V4.77431H10.9737V2.95139H4.16818V17.0486H10.9737V15.2257H12.6751V17.292ZM2.70985 2.70833C2.71062 2.03747 3.25427 1.49383 3.92513 1.49306V1.25C3.12025 1.25092 2.46772 1.90318 2.4668 2.70805V17.2917C2.46772 18.0965 3.12025 18.7491 3.92513 18.75V18.507C3.25427 18.5062 2.71062 17.9624 2.70985 17.2915V2.70833Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M12.7879 12.7867L14.9669 10.6077H6.35547V9.39244H14.9669L12.7879 7.21345L13.6471 6.35425L17.293 10.0001L13.6471 13.6459L12.7879 12.7867Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M12.4446 12.7867L14.3805 10.8508H6.11279V9.14937H14.3805L12.4446 7.21343L13.6475 6.0105L17.6371 10.0001L13.6475 13.9896L12.4446 12.7867ZM14.9673 9.39243H6.35585V10.6077H14.9673L12.7883 12.7867L13.6475 13.6459L17.2934 10.0001L13.6475 6.35423L12.7883 7.21343L14.9673 9.39243Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</SvgIcon>
|
||||
)
|
||||
@@ -1,7 +0,0 @@
|
||||
import SvgIcon, { SvgIconProps } from "@material-ui/core/SvgIcon"
|
||||
|
||||
export const SearchIcon: typeof SvgIcon = (props: SvgIconProps) => (
|
||||
<SvgIcon {...props} viewBox="0 0 16 16">
|
||||
<path d="M15.707 13.293L13 10.586C13.63 9.536 14 8.311 14 7C14 3.14 10.859 0 7 0C3.141 0 0 3.14 0 7C0 10.86 3.141 14 7 14C8.312 14 9.536 13.631 10.586 13L13.293 15.707C13.488 15.902 13.744 16 14 16C14.256 16 14.512 15.902 14.707 15.707L15.707 14.707C16.098 14.316 16.098 13.684 15.707 13.293ZM7 12C4.239 12 2 9.761 2 7C2 4.239 4.239 2 7 2C9.761 2 12 4.239 12 7C12 9.761 9.761 12 7 12Z" />
|
||||
</SvgIcon>
|
||||
)
|
||||
@@ -1,11 +0,0 @@
|
||||
import SvgIcon, { SvgIconProps } from "@material-ui/core/SvgIcon"
|
||||
|
||||
export const WorkspacesIcon: typeof SvgIcon = (props: SvgIconProps) => (
|
||||
<SvgIcon {...props} viewBox="0 0 16 16">
|
||||
<path d="M6 14H2V2H12V5.5L14 7V1C14 0.734784 13.8946 0.48043 13.7071 0.292893C13.5196 0.105357 13.2652 0 13 0L1 0C0.734784 0 0.48043 0.105357 0.292893 0.292893C0.105357 0.48043 0 0.734784 0 1L0 15C0 15.2652 0.105357 15.5196 0.292893 15.7071C0.48043 15.8946 0.734784 16 1 16H6V14Z" />
|
||||
<path d="M12 8L8 11V16H11V13H13.035V16H16V11L12 8Z" />
|
||||
<path d="M10 4H4V5H10V4Z" />
|
||||
<path d="M10 7H4V8H10V7Z" />
|
||||
<path d="M7 10H4V11H7V10Z" />
|
||||
</SvgIcon>
|
||||
)
|
||||
@@ -1,126 +0,0 @@
|
||||
import IconButton from "@material-ui/core/IconButton"
|
||||
import { makeStyles } from "@material-ui/core/styles"
|
||||
import Tooltip from "@material-ui/core/Tooltip"
|
||||
import VisibilityOffOutlined from "@material-ui/icons/VisibilityOffOutlined"
|
||||
import VisibilityOutlined from "@material-ui/icons/VisibilityOutlined"
|
||||
import { WorkspaceResource } from "api/typesGenerated"
|
||||
import { FC, useState } from "react"
|
||||
import {
|
||||
TableCellData,
|
||||
TableCellDataPrimary,
|
||||
} from "../TableCellData/TableCellData"
|
||||
import { ResourceAvatar } from "./ResourceAvatar"
|
||||
|
||||
const Language = {
|
||||
showLabel: "Show value",
|
||||
hideLabel: "Hide value",
|
||||
}
|
||||
|
||||
const SensitiveValue: React.FC<{ value: string }> = ({ value }) => {
|
||||
const [shouldDisplay, setShouldDisplay] = useState(false)
|
||||
const styles = useStyles()
|
||||
const displayValue = shouldDisplay ? value : "••••••••"
|
||||
const buttonLabel = shouldDisplay ? Language.hideLabel : Language.showLabel
|
||||
const icon = shouldDisplay ? (
|
||||
<VisibilityOffOutlined />
|
||||
) : (
|
||||
<VisibilityOutlined />
|
||||
)
|
||||
|
||||
return (
|
||||
<div className={styles.sensitiveValue}>
|
||||
{displayValue}
|
||||
<Tooltip title={buttonLabel}>
|
||||
<IconButton
|
||||
className={styles.button}
|
||||
onClick={() => {
|
||||
setShouldDisplay((value) => !value)
|
||||
}}
|
||||
size="small"
|
||||
aria-label={buttonLabel}
|
||||
>
|
||||
{icon}
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export interface ResourceAvatarDataProps {
|
||||
resource: WorkspaceResource
|
||||
}
|
||||
|
||||
export const ResourceAvatarData: FC<ResourceAvatarDataProps> = ({
|
||||
resource,
|
||||
}) => {
|
||||
const styles = useStyles()
|
||||
|
||||
return (
|
||||
<div className={styles.root}>
|
||||
<div className={styles.avatarWrapper}>
|
||||
<ResourceAvatar resource={resource} />
|
||||
</div>
|
||||
|
||||
<TableCellData>
|
||||
<TableCellDataPrimary highlight>{resource.name}</TableCellDataPrimary>
|
||||
<div className={styles.data}>
|
||||
{resource.metadata?.map((metadata) => (
|
||||
<div key={metadata.key} className={styles.dataRow}>
|
||||
<strong>{metadata.key}:</strong>
|
||||
{metadata.sensitive ? (
|
||||
<SensitiveValue value={metadata.value} />
|
||||
) : (
|
||||
<div>{metadata.value}</div>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</TableCellData>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
display: "flex",
|
||||
},
|
||||
|
||||
avatarWrapper: {
|
||||
marginRight: theme.spacing(3),
|
||||
paddingTop: theme.spacing(0.5),
|
||||
},
|
||||
|
||||
data: {
|
||||
color: theme.palette.text.secondary,
|
||||
fontSize: 14,
|
||||
marginTop: theme.spacing(0.75),
|
||||
display: "grid",
|
||||
gridAutoFlow: "row",
|
||||
whiteSpace: "nowrap",
|
||||
gap: theme.spacing(0.75),
|
||||
},
|
||||
|
||||
dataRow: {
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
|
||||
"& strong": {
|
||||
marginRight: theme.spacing(1),
|
||||
},
|
||||
},
|
||||
|
||||
sensitiveValue: {
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
},
|
||||
|
||||
button: {
|
||||
marginLeft: theme.spacing(0.5),
|
||||
color: "inherit",
|
||||
|
||||
"& .MuiSvgIcon-root": {
|
||||
width: 16,
|
||||
height: 16,
|
||||
},
|
||||
},
|
||||
}))
|
||||
@@ -3,8 +3,6 @@ import { alpha } from "@material-ui/core/styles/colorManipulator"
|
||||
import { FC } from "react"
|
||||
import { TabSidebar, TabSidebarItem } from "../TabSidebar/TabSidebar"
|
||||
|
||||
export type AdminMenuItemCallback = (menuItem: string) => void
|
||||
|
||||
export interface TabPanelProps {
|
||||
title: string
|
||||
menuItems: TabSidebarItem[]
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
import TableRow from "@material-ui/core/TableRow"
|
||||
import { FC, ReactNode } from "react"
|
||||
|
||||
export const TableHeaderRow: FC<{ children: ReactNode }> = ({ children }) => {
|
||||
return <TableRow>{children}</TableRow>
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
import {
|
||||
HelpTooltip,
|
||||
HelpTooltipText,
|
||||
HelpTooltipTitle,
|
||||
} from "./HelpTooltip/HelpTooltip"
|
||||
|
||||
export const Language = {
|
||||
agentTooltipTitle: "What is an agent?",
|
||||
agentTooltipText:
|
||||
"The Coder agent runs inside your resource and gives you direct access to the shell via the UI or CLI.",
|
||||
}
|
||||
|
||||
export const AgentHelpTooltip: React.FC = () => {
|
||||
return (
|
||||
<HelpTooltip size="small">
|
||||
<HelpTooltipTitle>{Language.agentTooltipTitle}</HelpTooltipTitle>
|
||||
<HelpTooltipText>{Language.agentTooltipText}</HelpTooltipText>
|
||||
</HelpTooltip>
|
||||
)
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
import { FC } from "react"
|
||||
import { HelpTooltip, HelpTooltipText, HelpTooltipTitle } from "./HelpTooltip"
|
||||
|
||||
export const Language = {
|
||||
label: "Agent Outdated",
|
||||
text: "This agent is an older version than the Coder server. This can happen after you update Coder with running workspaces. To fix this, you can stop and start the workspace.",
|
||||
}
|
||||
|
||||
interface TooltipProps {
|
||||
outdated: boolean
|
||||
}
|
||||
|
||||
export const AgentOutdatedTooltip: FC<
|
||||
React.PropsWithChildren<TooltipProps>
|
||||
> = ({ outdated }) => {
|
||||
if (!outdated) {
|
||||
return null
|
||||
}
|
||||
return (
|
||||
<HelpTooltip size="small">
|
||||
<HelpTooltipTitle>{Language.label}</HelpTooltipTitle>
|
||||
<HelpTooltipText>{Language.text}</HelpTooltipText>
|
||||
</HelpTooltip>
|
||||
)
|
||||
}
|
||||
@@ -17,7 +17,7 @@ import { Stack } from "../../Stack/Stack"
|
||||
type Icon = typeof HelpIcon
|
||||
|
||||
type Size = "small" | "medium"
|
||||
export interface HelpTooltipProps {
|
||||
interface HelpTooltipProps {
|
||||
// Useful to test on storybook
|
||||
open?: boolean
|
||||
size?: Size
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
import {
|
||||
HelpTooltip,
|
||||
HelpTooltipLink,
|
||||
HelpTooltipLinksGroup,
|
||||
HelpTooltipText,
|
||||
HelpTooltipTitle,
|
||||
} from "./HelpTooltip/HelpTooltip"
|
||||
|
||||
export const Language = {
|
||||
resourceTooltipTitle: "What is a resource?",
|
||||
resourceTooltipText:
|
||||
"A resource is an infrastructure object that is created when the workspace is provisioned.",
|
||||
resourceTooltipLink: "Persistent vs. ephemeral resources",
|
||||
}
|
||||
|
||||
export const ResourcesHelpTooltip: React.FC = () => {
|
||||
return (
|
||||
<HelpTooltip size="small">
|
||||
<HelpTooltipTitle>{Language.resourceTooltipTitle}</HelpTooltipTitle>
|
||||
<HelpTooltipText>{Language.resourceTooltipText}</HelpTooltipText>
|
||||
<HelpTooltipLinksGroup>
|
||||
<HelpTooltipLink href="https://coder.com/docs/coder-oss/latest/templates#persistent-vs-ephemeral-resources">
|
||||
{Language.resourceTooltipLink}
|
||||
</HelpTooltipLink>
|
||||
</HelpTooltipLinksGroup>
|
||||
</HelpTooltip>
|
||||
)
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
export { AgentHelpTooltip } from "./AgentHelpTooltip"
|
||||
export { AuditHelpTooltip } from "./AuditHelpTooltip"
|
||||
export { OutdatedHelpTooltip } from "./OutdatedHelpTooltip"
|
||||
export { ResourcesHelpTooltip } from "./ResourcesHelpTooltip"
|
||||
export { UserRoleHelpTooltip } from "./UserRoleHelpTooltip"
|
||||
export { WorkspaceHelpTooltip } from "./WorkspaceHelpTooltip"
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
import { useSelector } from "@xstate/react"
|
||||
import { Entitlements } from "api/typesGenerated"
|
||||
import { useContext } from "react"
|
||||
import { XServiceContext } from "xServices/StateContext"
|
||||
|
||||
export const useEntitlements = (): Entitlements => {
|
||||
const xServices = useContext(XServiceContext)
|
||||
const entitlements = useSelector(
|
||||
xServices.entitlementsXService,
|
||||
(state) => state.context.entitlements,
|
||||
)
|
||||
|
||||
return entitlements
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { FC } from "react"
|
||||
import { Navigate } from "react-router-dom"
|
||||
|
||||
export const IndexPage: FC = () => {
|
||||
const IndexPage: FC = () => {
|
||||
return <Navigate to="/workspaces" replace />
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
export const spacing = 8
|
||||
export const borderRadius = 8
|
||||
export const borderRadiusSm = 6
|
||||
export const buttonBorderWidth = 2
|
||||
export const MONOSPACE_FONT_FAMILY =
|
||||
"'IBM Plex Mono', 'Lucida Console', 'Lucida Sans Typewriter', 'Liberation Mono', 'Monaco', 'Courier New', Courier, monospace"
|
||||
export const BODY_FONT_FAMILY = `"Inter", sans-serif`
|
||||
export const lightButtonShadow = "0 2px 2px rgba(0, 23, 121, 0.08)"
|
||||
export const emptyBoxShadow = "none"
|
||||
export const navHeight = 62
|
||||
export const containerWidth = 1380
|
||||
export const containerWidthMedium = 1080
|
||||
export const sidePadding = 24
|
||||
export const TitleIconSize = 48
|
||||
export const CardRadius = 2
|
||||
export const CardPadding = 20
|
||||
|
||||
@@ -19,23 +19,6 @@ export const dispatchCustomEvent = <D = unknown>(
|
||||
/** Annotates a custom event listener with descriptive type information. */
|
||||
export type CustomEventListener<D = unknown> = (event: CustomEvent<D>) => void
|
||||
|
||||
/**
|
||||
* An event listener is a function an Event-like object.
|
||||
*
|
||||
* Especially helpful when using `element.addEventListener` with a predeclared function.
|
||||
* e.g.
|
||||
*
|
||||
* ```ts
|
||||
* const handleClick = AnnotatedEventListener<MouseEvent> = (event) => {
|
||||
* event.preventDefault()
|
||||
* }
|
||||
*
|
||||
* window.addEventListener('click', handleClick)
|
||||
* window.removeEventListener('click', handleClick)
|
||||
* ```
|
||||
*/
|
||||
export type AnnotatedEventListener<E extends Event> = (event: E) => void
|
||||
|
||||
/**
|
||||
* Determines if an Event object is a CustomEvent.
|
||||
*
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { useSearchParams } from "react-router-dom"
|
||||
import * as TypesGen from "../api/typesGenerated"
|
||||
|
||||
export const queryToFilter = (
|
||||
@@ -20,22 +19,3 @@ export const userFilterQuery = {
|
||||
active: "status:active",
|
||||
all: "",
|
||||
}
|
||||
|
||||
export const useFilter = (
|
||||
defaultFilter: string,
|
||||
): {
|
||||
filter: string
|
||||
setFilter: (filter: string) => void
|
||||
} => {
|
||||
const [searchParams, setSearchParams] = useSearchParams()
|
||||
const filter = searchParams.get("filter") ?? defaultFilter
|
||||
|
||||
const setFilter = (filter: string) => {
|
||||
setSearchParams({ filter })
|
||||
}
|
||||
|
||||
return {
|
||||
filter,
|
||||
setFilter,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
} from "react"
|
||||
import * as Yup from "yup"
|
||||
|
||||
export const Language = {
|
||||
const Language = {
|
||||
nameRequired: (name: string): string => {
|
||||
return name ? `Please enter a ${name.toLowerCase()}.` : "Required"
|
||||
},
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export * from "./array"
|
||||
@@ -11,7 +11,7 @@ dayjs.extend(duration)
|
||||
dayjs.extend(utc)
|
||||
dayjs.extend(minMax)
|
||||
|
||||
export const DisplayWorkspaceBuildStatusLanguage = {
|
||||
const DisplayWorkspaceBuildStatusLanguage = {
|
||||
succeeded: "Succeeded",
|
||||
pending: "Pending",
|
||||
running: "Running",
|
||||
@@ -20,7 +20,7 @@ export const DisplayWorkspaceBuildStatusLanguage = {
|
||||
failed: "Failed",
|
||||
}
|
||||
|
||||
export const DisplayAgentVersionLanguage = {
|
||||
const DisplayAgentVersionLanguage = {
|
||||
unknown: "Unknown",
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ export const getDisplayWorkspaceBuildInitiatedBy = (
|
||||
}
|
||||
}
|
||||
|
||||
export const getWorkspaceBuildDurationInSeconds = (
|
||||
const getWorkspaceBuildDurationInSeconds = (
|
||||
build: TypesGen.WorkspaceBuild,
|
||||
): number | undefined => {
|
||||
const isCompleted = build.job.started_at && build.job.completed_at
|
||||
|
||||
@@ -3,11 +3,6 @@ import { assign, createMachine } from "xstate"
|
||||
import * as API from "../../api/api"
|
||||
import { AppearanceConfig } from "../../api/typesGenerated"
|
||||
|
||||
export const Language = {
|
||||
getAppearanceError: "Error getting appearance.",
|
||||
setAppearanceError: "Error setting appearance.",
|
||||
}
|
||||
|
||||
export type AppearanceContext = {
|
||||
appearance: AppearanceConfig
|
||||
getAppearanceError?: Error | unknown
|
||||
|
||||
@@ -3,10 +3,6 @@ import { assign, createMachine } from "xstate"
|
||||
import * as API from "../../api/api"
|
||||
import { Entitlements } from "../../api/typesGenerated"
|
||||
|
||||
export const Language = {
|
||||
getEntitlementsError: "Error getting license entitlements.",
|
||||
}
|
||||
|
||||
export type EntitlementsContext = {
|
||||
entitlements: Entitlements
|
||||
getEntitlementsError?: Error | unknown
|
||||
|
||||
@@ -2,10 +2,6 @@ import { assign, createMachine } from "xstate"
|
||||
import * as API from "../../api/api"
|
||||
import { WorkspaceQuota } from "../../api/typesGenerated"
|
||||
|
||||
export const Language = {
|
||||
getQuotaError: "Failed to get Quota",
|
||||
}
|
||||
|
||||
export type QuotaContext = {
|
||||
quota?: WorkspaceQuota
|
||||
getQuotaError?: Error | unknown
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Workspace } from "api/typesGenerated"
|
||||
import dayjs from "dayjs"
|
||||
import minMax from "dayjs/plugin/minMax"
|
||||
import { getDeadline, getMaxDeadline, getMinDeadline } from "util/schedule"
|
||||
import { ActorRefFrom, assign, createMachine } from "xstate"
|
||||
import { assign, createMachine } from "xstate"
|
||||
import * as API from "../../api/api"
|
||||
import {
|
||||
displayError,
|
||||
@@ -39,10 +39,6 @@ export type WorkspaceScheduleBannerEvent =
|
||||
workspace: Workspace
|
||||
}
|
||||
|
||||
export type WorkspaceScheduleBannerMachineRef = ActorRefFrom<
|
||||
typeof workspaceScheduleBannerMachine
|
||||
>
|
||||
|
||||
export const workspaceScheduleBannerMachine = createMachine(
|
||||
{
|
||||
id: "workspaceScheduleBannerState",
|
||||
|
||||
@@ -6,10 +6,6 @@ import { assign, createMachine } from "xstate"
|
||||
import * as API from "../../api/api"
|
||||
import * as TypesGen from "../../api/typesGenerated"
|
||||
|
||||
export const Language = {
|
||||
successMessage: "Successfully updated workspace schedule.",
|
||||
}
|
||||
|
||||
type Permissions = Record<keyof ReturnType<typeof permissionsToCheck>, boolean>
|
||||
|
||||
export interface WorkspaceScheduleContext {
|
||||
|
||||
+47
-2
@@ -2948,6 +2948,16 @@
|
||||
resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82"
|
||||
integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==
|
||||
|
||||
"@ts-morph/common@~0.12.3":
|
||||
version "0.12.3"
|
||||
resolved "https://registry.yarnpkg.com/@ts-morph/common/-/common-0.12.3.tgz#a96e250217cd30e480ab22ec6a0ebbe65fd784ff"
|
||||
integrity sha512-4tUmeLyXJnJWvTFOKtcNJ1yh0a3SsTLi2MUoyj8iUNznFRN1ZquaNe7Oukqrnki2FzZkm0J9adCNLDZxUzvj+w==
|
||||
dependencies:
|
||||
fast-glob "^3.2.7"
|
||||
minimatch "^3.0.4"
|
||||
mkdirp "^1.0.4"
|
||||
path-browserify "^1.0.1"
|
||||
|
||||
"@types/aria-query@^4.2.0":
|
||||
version "4.2.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-4.2.2.tgz#ed4e0ad92306a704f9fb132a0cfcf77486dbe2bc"
|
||||
@@ -5223,6 +5233,11 @@ co@^4.6.0:
|
||||
resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
|
||||
integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==
|
||||
|
||||
code-block-writer@^11.0.0:
|
||||
version "11.0.3"
|
||||
resolved "https://registry.yarnpkg.com/code-block-writer/-/code-block-writer-11.0.3.tgz#9eec2993edfb79bfae845fbc093758c0a0b73b76"
|
||||
integrity sha512-NiujjUFB4SwScJq2bwbYUtXbZhBSlY6vYzm++3Q6oC+U+injTqfPYFK8wS9COOmb2lueqp0ZRB4nK1VYeHgNyw==
|
||||
|
||||
collapse-white-space@^1.0.2:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/collapse-white-space/-/collapse-white-space-1.0.6.tgz#e63629c0016665792060dbbeb79c42239d2c5287"
|
||||
@@ -5454,7 +5469,7 @@ cosmiconfig@^6.0.0:
|
||||
path-type "^4.0.0"
|
||||
yaml "^1.7.2"
|
||||
|
||||
cosmiconfig@^7.0.0:
|
||||
cosmiconfig@^7.0.0, cosmiconfig@^7.0.1:
|
||||
version "7.1.0"
|
||||
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.1.0.tgz#1443b9afa596b670082ea46cbd8f6a62b84635f6"
|
||||
integrity sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==
|
||||
@@ -6912,7 +6927,7 @@ fast-glob@^2.2.6:
|
||||
merge2 "^1.2.3"
|
||||
micromatch "^3.1.10"
|
||||
|
||||
fast-glob@^3.2.11, fast-glob@^3.2.9:
|
||||
fast-glob@^3.2.11, fast-glob@^3.2.7, fast-glob@^3.2.9:
|
||||
version "3.2.12"
|
||||
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80"
|
||||
integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==
|
||||
@@ -11032,6 +11047,11 @@ path-browserify@0.0.1:
|
||||
resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.1.tgz#e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a"
|
||||
integrity sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==
|
||||
|
||||
path-browserify@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd"
|
||||
integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==
|
||||
|
||||
path-dirname@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0"
|
||||
@@ -13310,6 +13330,11 @@ trough@^2.0.0:
|
||||
resolved "https://registry.yarnpkg.com/trough/-/trough-2.1.0.tgz#0f7b511a4fde65a46f18477ab38849b22c554876"
|
||||
integrity sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==
|
||||
|
||||
"true-myth@^4.1.0":
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/true-myth/-/true-myth-4.1.1.tgz#ff4ac9d5130276e34aa338757e2416ec19248ba2"
|
||||
integrity sha512-rqy30BSpxPznbbTcAcci90oZ1YR4DqvKcNXNerG5gQBU2v4jk0cygheiul5J6ExIMrgDVuanv/MkGfqZbKrNNg==
|
||||
|
||||
ts-dedent@^2.0.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/ts-dedent/-/ts-dedent-2.2.0.tgz#39e4bd297cd036292ae2394eb3412be63f563bb5"
|
||||
@@ -13329,11 +13354,31 @@ ts-jest@27.1.4:
|
||||
semver "7.x"
|
||||
yargs-parser "20.x"
|
||||
|
||||
ts-morph@^13.0.1:
|
||||
version "13.0.3"
|
||||
resolved "https://registry.yarnpkg.com/ts-morph/-/ts-morph-13.0.3.tgz#c0c51d1273ae2edb46d76f65161eb9d763444c1d"
|
||||
integrity sha512-pSOfUMx8Ld/WUreoSzvMFQG5i9uEiWIsBYjpU9+TTASOeUa89j5HykomeqVULm1oqWtBdleI3KEFRLrlA3zGIw==
|
||||
dependencies:
|
||||
"@ts-morph/common" "~0.12.3"
|
||||
code-block-writer "^11.0.0"
|
||||
|
||||
ts-pnp@^1.1.6:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.2.0.tgz#a500ad084b0798f1c3071af391e65912c86bca92"
|
||||
integrity sha512-csd+vJOb/gkzvcCHgTGSChYpy5f1/XKNsmvBGO4JXS+z1v2HobugDz4s1IeFXM3wZB44uczs+eazB5Q/ccdhQw==
|
||||
|
||||
ts-prune@0.10.3:
|
||||
version "0.10.3"
|
||||
resolved "https://registry.yarnpkg.com/ts-prune/-/ts-prune-0.10.3.tgz#b6c71a525543b38dcf947a7d3adfb7f9e8b91f38"
|
||||
integrity sha512-iS47YTbdIcvN8Nh/1BFyziyUqmjXz7GVzWu02RaZXqb+e/3Qe1B7IQ4860krOeCGUeJmterAlaM2FRH0Ue0hjw==
|
||||
dependencies:
|
||||
commander "^6.2.1"
|
||||
cosmiconfig "^7.0.1"
|
||||
json5 "^2.1.3"
|
||||
lodash "^4.17.21"
|
||||
"true-myth" "^4.1.0"
|
||||
ts-morph "^13.0.1"
|
||||
|
||||
tsconfig-paths@^3.14.1:
|
||||
version "3.14.1"
|
||||
resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz#ba0734599e8ea36c862798e920bcf163277b137a"
|
||||
|
||||
Reference in New Issue
Block a user