mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
chore(site): Upgrade storybook to 7.0.4 (#7127)
This commit is contained in:
6
.github/workflows/ci.yaml
vendored
6
.github/workflows/ci.yaml
vendored
@ -634,6 +634,9 @@ jobs:
|
|||||||
- name: Publish to Chromatic (non-mainline)
|
- name: Publish to Chromatic (non-mainline)
|
||||||
if: github.ref != 'refs/heads/main' && github.repository_owner == 'coder'
|
if: github.ref != 'refs/heads/main' && github.repository_owner == 'coder'
|
||||||
uses: chromaui/action@v1
|
uses: chromaui/action@v1
|
||||||
|
env:
|
||||||
|
NODE_OPTIONS: "--max_old_space_size=4096"
|
||||||
|
STORYBOOK: true
|
||||||
with:
|
with:
|
||||||
buildScriptName: "storybook:build"
|
buildScriptName: "storybook:build"
|
||||||
exitOnceUploaded: true
|
exitOnceUploaded: true
|
||||||
@ -651,6 +654,9 @@ jobs:
|
|||||||
- name: Publish to Chromatic (mainline)
|
- name: Publish to Chromatic (mainline)
|
||||||
if: github.ref == 'refs/heads/main' && github.repository_owner == 'coder'
|
if: github.ref == 'refs/heads/main' && github.repository_owner == 'coder'
|
||||||
uses: chromaui/action@v1
|
uses: chromaui/action@v1
|
||||||
|
env:
|
||||||
|
NODE_OPTIONS: "--max_old_space_size=4096"
|
||||||
|
STORYBOOK: true
|
||||||
with:
|
with:
|
||||||
autoAcceptChanges: true
|
autoAcceptChanges: true
|
||||||
buildScriptName: "storybook:build"
|
buildScriptName: "storybook:build"
|
||||||
|
@ -1,49 +1,14 @@
|
|||||||
/**
|
|
||||||
* @fileoverview This file is configures Storybook
|
|
||||||
*
|
|
||||||
* @see <https://storybook.js.org/docs/react/configure/overview>
|
|
||||||
*/
|
|
||||||
const path = require("path")
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// Automatically loads all stories in source ending in 'stories.tsx'
|
|
||||||
//
|
|
||||||
// SEE: https://storybook.js.org/docs/react/configure/overview#configure-story-loading
|
|
||||||
stories: ["../src/**/*.stories.tsx"],
|
stories: ["../src/**/*.stories.tsx"],
|
||||||
|
|
||||||
// addons are official and community plugins to extend Storybook.
|
|
||||||
//
|
|
||||||
// SEE: https://storybook.js.org/addons
|
|
||||||
addons: [
|
addons: [
|
||||||
"@storybook/addon-links",
|
"@storybook/addon-links",
|
||||||
{
|
"@storybook/addon-essentials",
|
||||||
name: "@storybook/addon-essentials",
|
"@storybook/addon-mdx-gfm",
|
||||||
options: {
|
"@storybook/addon-actions",
|
||||||
actions: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
|
|
||||||
// SEE: https://storybook.js.org/docs/react/configure/babel
|
|
||||||
babel: async (options) => ({
|
|
||||||
...options,
|
|
||||||
plugins: [["@babel/plugin-proposal-class-properties", { loose: true }]],
|
|
||||||
}),
|
|
||||||
|
|
||||||
// Static files loaded by storybook, relative to this file.
|
|
||||||
//
|
|
||||||
// SEE: https://storybook.js.org/docs/react/configure/overview#using-storybook-api
|
|
||||||
staticDirs: ["../static"],
|
staticDirs: ["../static"],
|
||||||
|
framework: {
|
||||||
// Storybook internally uses its own Webpack configuration instead of ours.
|
name: "@storybook/react-vite",
|
||||||
//
|
options: {},
|
||||||
// SEE: https://storybook.js.org/docs/react/configure/webpack
|
|
||||||
webpackFinal: async (config) => {
|
|
||||||
config.resolve.modules = [
|
|
||||||
path.resolve(__dirname, ".."),
|
|
||||||
"node_modules",
|
|
||||||
"../src",
|
|
||||||
]
|
|
||||||
return config
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -1,35 +1,32 @@
|
|||||||
import CssBaseline from "@material-ui/core/CssBaseline"
|
import CssBaseline from "@material-ui/core/CssBaseline"
|
||||||
import ThemeProvider from "@material-ui/styles/ThemeProvider"
|
import ThemeProvider from "@material-ui/styles/ThemeProvider"
|
||||||
import { createMemoryHistory } from "history"
|
import { createMemoryHistory } from "history"
|
||||||
import { addDecorator } from "node_modules/@storybook/react"
|
|
||||||
import { unstable_HistoryRouter as HistoryRouter } from "react-router-dom"
|
import { unstable_HistoryRouter as HistoryRouter } from "react-router-dom"
|
||||||
import { dark } from "../src/theme"
|
import { dark } from "../src/theme"
|
||||||
import "../src/theme/globalFonts"
|
import "../src/theme/globalFonts"
|
||||||
import "../src/i18n"
|
import "../src/i18n"
|
||||||
|
|
||||||
addDecorator((story) => (
|
|
||||||
<ThemeProvider theme={dark}>
|
|
||||||
<CssBaseline />
|
|
||||||
{story()}
|
|
||||||
</ThemeProvider>
|
|
||||||
))
|
|
||||||
|
|
||||||
const history = createMemoryHistory()
|
const history = createMemoryHistory()
|
||||||
|
|
||||||
const routerDecorator = (Story) => {
|
export const decorators = [
|
||||||
return (
|
(Story) => (
|
||||||
<HistoryRouter history={history}>
|
<ThemeProvider theme={dark}>
|
||||||
|
<CssBaseline />
|
||||||
<Story />
|
<Story />
|
||||||
</HistoryRouter>
|
</ThemeProvider>
|
||||||
)
|
),
|
||||||
}
|
(Story) => {
|
||||||
|
return (
|
||||||
addDecorator(routerDecorator)
|
<HistoryRouter history={history}>
|
||||||
|
<Story />
|
||||||
|
</HistoryRouter>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
export const parameters = {
|
export const parameters = {
|
||||||
actions: {
|
actions: {
|
||||||
argTypesRegex: "^on[A-Z].*",
|
argTypesRegex: "^(on|handler)[A-Z].*",
|
||||||
argTypesRegex: "^handle[A-Z].*",
|
|
||||||
},
|
},
|
||||||
controls: {
|
controls: {
|
||||||
expanded: true,
|
expanded: true,
|
@ -17,8 +17,8 @@
|
|||||||
"lint:fix": "FIX=true yarn lint",
|
"lint:fix": "FIX=true yarn lint",
|
||||||
"playwright:install": "playwright install --with-deps chromium",
|
"playwright:install": "playwright install --with-deps chromium",
|
||||||
"playwright:test": "playwright test --config=e2e/playwright.config.ts",
|
"playwright:test": "playwright test --config=e2e/playwright.config.ts",
|
||||||
"storybook": "start-storybook -p 6006",
|
"storybook": "STORYBOOK=true storybook dev -p 6006",
|
||||||
"storybook:build": "build-storybook",
|
"storybook:build": "storybook build",
|
||||||
"test": "jest --selectProjects test",
|
"test": "jest --selectProjects test",
|
||||||
"test:ci": "jest --selectProjects test --silent",
|
"test:ci": "jest --selectProjects test --silent",
|
||||||
"test:coverage": "jest --selectProjects test --collectCoverage",
|
"test:coverage": "jest --selectProjects test --collectCoverage",
|
||||||
@ -54,7 +54,7 @@
|
|||||||
"date-fns": "2.29.3",
|
"date-fns": "2.29.3",
|
||||||
"dayjs": "1.11.4",
|
"dayjs": "1.11.4",
|
||||||
"emoji-mart": "5.4.0",
|
"emoji-mart": "5.4.0",
|
||||||
"eslint-plugin-testing-library": "^5.10.2",
|
"eslint-plugin-testing-library": "5.10.2",
|
||||||
"eventsourcemock": "2.0.0",
|
"eventsourcemock": "2.0.0",
|
||||||
"formik": "2.2.9",
|
"formik": "2.2.9",
|
||||||
"front-matter": "4.0.2",
|
"front-matter": "4.0.2",
|
||||||
@ -75,8 +75,8 @@
|
|||||||
"react-markdown": "8.0.3",
|
"react-markdown": "8.0.3",
|
||||||
"react-router-dom": "6.4.1",
|
"react-router-dom": "6.4.1",
|
||||||
"react-syntax-highlighter": "15.5.0",
|
"react-syntax-highlighter": "15.5.0",
|
||||||
"react-virtualized-auto-sizer": "^1.0.7",
|
"react-virtualized-auto-sizer": "1.0.7",
|
||||||
"react-window": "^1.8.8",
|
"react-window": "1.8.8",
|
||||||
"remark-gfm": "3.0.1",
|
"remark-gfm": "3.0.1",
|
||||||
"rollup-plugin-visualizer": "5.9.0",
|
"rollup-plugin-visualizer": "5.9.0",
|
||||||
"sourcemapped-stacktrace": "1.1.11",
|
"sourcemapped-stacktrace": "1.1.11",
|
||||||
@ -84,7 +84,7 @@
|
|||||||
"tzdata": "1.0.30",
|
"tzdata": "1.0.30",
|
||||||
"ua-parser-js": "1.0.33",
|
"ua-parser-js": "1.0.33",
|
||||||
"uuid": "9.0.0",
|
"uuid": "9.0.0",
|
||||||
"vite": "3.1.3",
|
"vite": "4.2.1",
|
||||||
"xstate": "4.33.5",
|
"xstate": "4.33.5",
|
||||||
"xterm": "4.19.0",
|
"xterm": "4.19.0",
|
||||||
"xterm-addon-fit": "0.5.0",
|
"xterm-addon-fit": "0.5.0",
|
||||||
@ -93,10 +93,11 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@playwright/test": "1.29.2",
|
"@playwright/test": "1.29.2",
|
||||||
"@storybook/addon-actions": "6.5.9",
|
"@storybook/addon-actions": "7.0.4",
|
||||||
"@storybook/addon-essentials": "6.5.12",
|
"@storybook/addon-essentials": "7.0.4",
|
||||||
"@storybook/addon-links": "6.5.9",
|
"@storybook/addon-links": "7.0.4",
|
||||||
"@storybook/react": "6.5.12",
|
"@storybook/addon-mdx-gfm": "7.0.4",
|
||||||
|
"@storybook/react-vite": "7.0.4",
|
||||||
"@swc/core": "1.3.38",
|
"@swc/core": "1.3.38",
|
||||||
"@swc/jest": "0.2.24",
|
"@swc/jest": "0.2.24",
|
||||||
"@testing-library/jest-dom": "5.16.5",
|
"@testing-library/jest-dom": "5.16.5",
|
||||||
@ -127,6 +128,7 @@
|
|||||||
"eslint-plugin-jsx-a11y": "6.6.1",
|
"eslint-plugin-jsx-a11y": "6.6.1",
|
||||||
"eslint-plugin-react": "7.31.1",
|
"eslint-plugin-react": "7.31.1",
|
||||||
"eslint-plugin-react-hooks": "4.6.0",
|
"eslint-plugin-react-hooks": "4.6.0",
|
||||||
|
"eslint-plugin-storybook": "^0.6.11",
|
||||||
"eslint-plugin-unicorn": "44.0.0",
|
"eslint-plugin-unicorn": "44.0.0",
|
||||||
"jest": "29.5.0",
|
"jest": "29.5.0",
|
||||||
"jest-canvas-mock": "2.4.0",
|
"jest-canvas-mock": "2.4.0",
|
||||||
@ -139,7 +141,7 @@
|
|||||||
"prettier": "2.8.1",
|
"prettier": "2.8.1",
|
||||||
"resize-observer": "1.0.4",
|
"resize-observer": "1.0.4",
|
||||||
"semver": "7.3.7",
|
"semver": "7.3.7",
|
||||||
"storybook-addon-mock": "^3.2.0",
|
"storybook": "7.0.4",
|
||||||
"storybook-react-context": "^0.6.0",
|
"storybook-react-context": "^0.6.0",
|
||||||
"typescript": "4.8.2"
|
"typescript": "4.8.2"
|
||||||
},
|
},
|
||||||
|
@ -5,9 +5,9 @@ import { makeStyles } from "@material-ui/core/styles"
|
|||||||
import Tooltip from "@material-ui/core/Tooltip"
|
import Tooltip from "@material-ui/core/Tooltip"
|
||||||
import ErrorOutlineIcon from "@material-ui/icons/ErrorOutline"
|
import ErrorOutlineIcon from "@material-ui/icons/ErrorOutline"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
import * as TypesGen from "../../api/typesGenerated"
|
import * as TypesGen from "../../api/typesGenerated"
|
||||||
import { generateRandomString } from "../../util/random"
|
import { generateRandomString } from "../../utils/random"
|
||||||
import { BaseIcon } from "./BaseIcon"
|
import { BaseIcon } from "./BaseIcon"
|
||||||
import { ShareIcon } from "./ShareIcon"
|
import { ShareIcon } from "./ShareIcon"
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import { makeStyles } from "@material-ui/core/styles"
|
|||||||
import { AuditLog } from "api/typesGenerated"
|
import { AuditLog } from "api/typesGenerated"
|
||||||
import { colors } from "theme/colors"
|
import { colors } from "theme/colors"
|
||||||
import { MONOSPACE_FONT_FAMILY } from "theme/constants"
|
import { MONOSPACE_FONT_FAMILY } from "theme/constants"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
|
|
||||||
const getDiffValue = (value: unknown): string => {
|
const getDiffValue = (value: unknown): string => {
|
||||||
|
@ -5,7 +5,7 @@ import MuiAvatar, {
|
|||||||
} from "@material-ui/core/Avatar"
|
} from "@material-ui/core/Avatar"
|
||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
import { firstLetter } from "./firstLetter"
|
import { firstLetter } from "./firstLetter"
|
||||||
|
|
||||||
export type AvatarProps = MuiAvatarProps & {
|
export type AvatarProps = MuiAvatarProps & {
|
||||||
|
@ -4,7 +4,7 @@ import SvgIcon from "@material-ui/core/SvgIcon"
|
|||||||
import CheckIcon from "@material-ui/icons/Check"
|
import CheckIcon from "@material-ui/icons/Check"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { NavLink } from "react-router-dom"
|
import { NavLink } from "react-router-dom"
|
||||||
import { ellipsizeText } from "../../util/ellipsizeText"
|
import { ellipsizeText } from "../../utils/ellipsizeText"
|
||||||
import { Typography } from "../Typography/Typography"
|
import { Typography } from "../Typography/Typography"
|
||||||
|
|
||||||
type BorderedMenuRowVariant = "narrow" | "wide"
|
type BorderedMenuRowVariant = "narrow" | "wide"
|
||||||
|
@ -5,7 +5,7 @@ import PlayArrowOutlined from "@material-ui/icons/PlayArrowOutlined"
|
|||||||
import PauseOutlined from "@material-ui/icons/PauseOutlined"
|
import PauseOutlined from "@material-ui/icons/PauseOutlined"
|
||||||
import DeleteOutlined from "@material-ui/icons/DeleteOutlined"
|
import DeleteOutlined from "@material-ui/icons/DeleteOutlined"
|
||||||
import { WorkspaceBuild, WorkspaceTransition } from "api/typesGenerated"
|
import { WorkspaceBuild, WorkspaceTransition } from "api/typesGenerated"
|
||||||
import { getDisplayWorkspaceBuildStatus } from "util/workspace"
|
import { getDisplayWorkspaceBuildStatus } from "utils/workspace"
|
||||||
import { PaletteIndex } from "theme/palettes"
|
import { PaletteIndex } from "theme/palettes"
|
||||||
import { Avatar, AvatarProps } from "components/Avatar/Avatar"
|
import { Avatar, AvatarProps } from "components/Avatar/Avatar"
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import { MONOSPACE_FONT_FAMILY } from "theme/constants"
|
|||||||
import {
|
import {
|
||||||
displayWorkspaceBuildDuration,
|
displayWorkspaceBuildDuration,
|
||||||
getDisplayWorkspaceBuildInitiatedBy,
|
getDisplayWorkspaceBuildInitiatedBy,
|
||||||
} from "util/workspace"
|
} from "utils/workspace"
|
||||||
import { BuildAvatar } from "./BuildAvatar"
|
import { BuildAvatar } from "./BuildAvatar"
|
||||||
|
|
||||||
export interface BuildRowProps {
|
export interface BuildRowProps {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import { FC, Fragment, ReactElement } from "react"
|
import { FC, Fragment, ReactElement } from "react"
|
||||||
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"
|
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"
|
||||||
import { combineClasses } from "../../util/combineClasses"
|
import { combineClasses } from "../../utils/combineClasses"
|
||||||
|
|
||||||
export interface CodeBlockProps {
|
export interface CodeBlockProps {
|
||||||
lines: string[]
|
lines: string[]
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { makeStyles, Theme } from "@material-ui/core/styles"
|
import { makeStyles, Theme } from "@material-ui/core/styles"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"
|
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"
|
||||||
import { combineClasses } from "../../util/combineClasses"
|
import { combineClasses } from "../../utils/combineClasses"
|
||||||
import { CopyButton } from "../CopyButton/CopyButton"
|
import { CopyButton } from "../CopyButton/CopyButton"
|
||||||
|
|
||||||
export interface CodeExampleProps {
|
export interface CodeExampleProps {
|
||||||
|
@ -3,7 +3,7 @@ import { makeStyles } from "@material-ui/core/styles"
|
|||||||
import Tooltip from "@material-ui/core/Tooltip"
|
import Tooltip from "@material-ui/core/Tooltip"
|
||||||
import Check from "@material-ui/icons/Check"
|
import Check from "@material-ui/icons/Check"
|
||||||
import { useClipboard } from "hooks/useClipboard"
|
import { useClipboard } from "hooks/useClipboard"
|
||||||
import { combineClasses } from "../../util/combineClasses"
|
import { combineClasses } from "../../utils/combineClasses"
|
||||||
import { FileCopyIcon } from "../Icons/FileCopyIcon"
|
import { FileCopyIcon } from "../Icons/FileCopyIcon"
|
||||||
|
|
||||||
interface CopyButtonProps {
|
interface CopyButtonProps {
|
||||||
|
@ -3,7 +3,7 @@ import Tooltip from "@material-ui/core/Tooltip"
|
|||||||
import { useClickable } from "hooks/useClickable"
|
import { useClickable } from "hooks/useClickable"
|
||||||
import { useClipboard } from "hooks/useClipboard"
|
import { useClipboard } from "hooks/useClipboard"
|
||||||
import { FC, HTMLProps } from "react"
|
import { FC, HTMLProps } from "react"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
|
|
||||||
interface CopyableValueProps extends HTMLProps<HTMLDivElement> {
|
interface CopyableValueProps extends HTMLProps<HTMLDivElement> {
|
||||||
value: string
|
value: string
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
getFormHelpers,
|
getFormHelpers,
|
||||||
nameValidator,
|
nameValidator,
|
||||||
onChangeTrimmed,
|
onChangeTrimmed,
|
||||||
} from "../../util/formUtils"
|
} from "../../utils/formUtils"
|
||||||
import { FormFooter } from "../FormFooter/FormFooter"
|
import { FormFooter } from "../FormFooter/FormFooter"
|
||||||
import { FullPageForm } from "../FullPageForm/FullPageForm"
|
import { FullPageForm } from "../FullPageForm/FullPageForm"
|
||||||
import { Stack } from "../Stack/Stack"
|
import { Stack } from "../Stack/Stack"
|
||||||
|
@ -2,7 +2,7 @@ import { makeStyles } from "@material-ui/core/styles"
|
|||||||
import { Stack } from "components/Stack/Stack"
|
import { Stack } from "components/Stack/Stack"
|
||||||
import { PropsWithChildren, FC } from "react"
|
import { PropsWithChildren, FC } from "react"
|
||||||
import { MONOSPACE_FONT_FAMILY } from "theme/constants"
|
import { MONOSPACE_FONT_FAMILY } from "theme/constants"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
|
|
||||||
export const EnabledBadge: FC = () => {
|
export const EnabledBadge: FC = () => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
|
@ -8,7 +8,7 @@ import { GitIcon } from "components/Icons/GitIcon"
|
|||||||
import { Stack } from "components/Stack/Stack"
|
import { Stack } from "components/Stack/Stack"
|
||||||
import { ElementType, PropsWithChildren, ReactNode, FC } from "react"
|
import { ElementType, PropsWithChildren, ReactNode, FC } from "react"
|
||||||
import { NavLink } from "react-router-dom"
|
import { NavLink } from "react-router-dom"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
|
|
||||||
const SidebarNavItem: FC<
|
const SidebarNavItem: FC<
|
||||||
PropsWithChildren<{ href: string; icon: ReactNode }>
|
PropsWithChildren<{ href: string; icon: ReactNode }>
|
||||||
|
@ -6,22 +6,16 @@ export default {
|
|||||||
title: "Components/Dialogs/ConfirmDialog",
|
title: "Components/Dialogs/ConfirmDialog",
|
||||||
component: ConfirmDialog,
|
component: ConfirmDialog,
|
||||||
argTypes: {
|
argTypes: {
|
||||||
onClose: {
|
|
||||||
action: "onClose",
|
|
||||||
defaultValue: action("onClose"),
|
|
||||||
},
|
|
||||||
onConfirm: {
|
|
||||||
action: "onConfirm",
|
|
||||||
defaultValue: action("onConfirm"),
|
|
||||||
},
|
|
||||||
open: {
|
open: {
|
||||||
control: "boolean",
|
control: "boolean",
|
||||||
defaultValue: true,
|
|
||||||
},
|
|
||||||
title: {
|
|
||||||
defaultValue: "Confirm Dialog",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
args: {
|
||||||
|
onClose: action("onClose"),
|
||||||
|
onConfirm: action("onConfirm"),
|
||||||
|
open: true,
|
||||||
|
title: "Confirm Dialog",
|
||||||
|
},
|
||||||
} as ComponentMeta<typeof ConfirmDialog>
|
} as ComponentMeta<typeof ConfirmDialog>
|
||||||
|
|
||||||
const Template: Story<ConfirmDialogProps> = (args) => (
|
const Template: Story<ConfirmDialogProps> = (args) => (
|
||||||
|
@ -6,29 +6,18 @@ export default {
|
|||||||
title: "Components/Dialogs/DeleteDialog",
|
title: "Components/Dialogs/DeleteDialog",
|
||||||
component: DeleteDialog,
|
component: DeleteDialog,
|
||||||
argTypes: {
|
argTypes: {
|
||||||
onCancel: {
|
|
||||||
action: "onClose",
|
|
||||||
defaultValue: action("onClose"),
|
|
||||||
},
|
|
||||||
onConfirm: {
|
|
||||||
action: "onConfirm",
|
|
||||||
defaultValue: action("onConfirm"),
|
|
||||||
},
|
|
||||||
open: {
|
open: {
|
||||||
control: "boolean",
|
control: "boolean",
|
||||||
defaultValue: true,
|
|
||||||
},
|
|
||||||
entity: {
|
|
||||||
defaultValue: "foo",
|
|
||||||
},
|
|
||||||
name: {
|
|
||||||
defaultValue: "MyFoo",
|
|
||||||
},
|
|
||||||
info: {
|
|
||||||
defaultValue:
|
|
||||||
"Here's some info about the foo so you know you're deleting the right one.",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
args: {
|
||||||
|
onCancel: action("onClose"),
|
||||||
|
onConfirm: action("onConfirm"),
|
||||||
|
open: true,
|
||||||
|
entity: "foo",
|
||||||
|
name: "MyFoo",
|
||||||
|
info: "Here's some info about the foo so you know you're deleting the right one.",
|
||||||
|
},
|
||||||
} as ComponentMeta<typeof DeleteDialog>
|
} as ComponentMeta<typeof DeleteDialog>
|
||||||
|
|
||||||
const Template: Story<DeleteDialogProps> = (args) => <DeleteDialog {...args} />
|
const Template: Story<DeleteDialogProps> = (args) => <DeleteDialog {...args} />
|
||||||
|
@ -4,7 +4,7 @@ import MuiDialog, {
|
|||||||
import { alpha, darken, makeStyles } from "@material-ui/core/styles"
|
import { alpha, darken, makeStyles } from "@material-ui/core/styles"
|
||||||
import * as React from "react"
|
import * as React from "react"
|
||||||
import { colors } from "theme/colors"
|
import { colors } from "theme/colors"
|
||||||
import { combineClasses } from "../../util/combineClasses"
|
import { combineClasses } from "../../utils/combineClasses"
|
||||||
import {
|
import {
|
||||||
LoadingButton,
|
LoadingButton,
|
||||||
LoadingButtonProps,
|
LoadingButtonProps,
|
||||||
|
@ -11,7 +11,7 @@ import PlayCircleOutlineIcon from "@material-ui/icons/PlayCircleOutline"
|
|||||||
import { LoadingButton } from "components/LoadingButton/LoadingButton"
|
import { LoadingButton } from "components/LoadingButton/LoadingButton"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { useTranslation } from "react-i18next"
|
import { useTranslation } from "react-i18next"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
import { WorkspaceActionButton } from "../WorkspaceActionButton/WorkspaceActionButton"
|
import { WorkspaceActionButton } from "../WorkspaceActionButton/WorkspaceActionButton"
|
||||||
|
|
||||||
interface WorkspaceAction {
|
interface WorkspaceAction {
|
||||||
|
@ -2,7 +2,7 @@ import Box from "@material-ui/core/Box"
|
|||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import Typography from "@material-ui/core/Typography"
|
import Typography from "@material-ui/core/Typography"
|
||||||
import { FC, ReactNode } from "react"
|
import { FC, ReactNode } from "react"
|
||||||
import { combineClasses } from "../../util/combineClasses"
|
import { combineClasses } from "../../utils/combineClasses"
|
||||||
|
|
||||||
export interface EmptyStateProps {
|
export interface EmptyStateProps {
|
||||||
/** Text Message to display, placed inside Typography component */
|
/** Text Message to display, placed inside Typography component */
|
||||||
|
@ -5,7 +5,7 @@ import Snackbar, {
|
|||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import CloseIcon from "@material-ui/icons/Close"
|
import CloseIcon from "@material-ui/icons/Close"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { combineClasses } from "../../util/combineClasses"
|
import { combineClasses } from "../../utils/combineClasses"
|
||||||
|
|
||||||
type EnterpriseSnackbarVariant = "error" | "info" | "success"
|
type EnterpriseSnackbarVariant = "error" | "info" | "success"
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
import { PropsWithChildren, FC } from "react"
|
import { PropsWithChildren, FC } from "react"
|
||||||
import Collapse from "@material-ui/core/Collapse"
|
import Collapse from "@material-ui/core/Collapse"
|
||||||
import { useTranslation } from "react-i18next"
|
import { useTranslation } from "react-i18next"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
|
|
||||||
export interface ExpanderProps {
|
export interface ExpanderProps {
|
||||||
expanded: boolean
|
expanded: boolean
|
||||||
|
@ -11,7 +11,7 @@ import {
|
|||||||
PropsWithChildren,
|
PropsWithChildren,
|
||||||
useContext,
|
useContext,
|
||||||
} from "react"
|
} from "react"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
|
|
||||||
type FormContextValue = { direction?: "horizontal" | "vertical" }
|
type FormContextValue = { direction?: "horizontal" | "vertical" }
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import { useCallback, useState, FC } from "react"
|
import { useCallback, useState, FC } from "react"
|
||||||
import { useCustomEvent } from "../../hooks/events"
|
import { useCustomEvent } from "../../hooks/events"
|
||||||
import { CustomEventListener } from "../../util/events"
|
import { CustomEventListener } from "../../utils/events"
|
||||||
import { EnterpriseSnackbar } from "../EnterpriseSnackbar/EnterpriseSnackbar"
|
import { EnterpriseSnackbar } from "../EnterpriseSnackbar/EnterpriseSnackbar"
|
||||||
import { ErrorIcon } from "../Icons/ErrorIcon"
|
import { ErrorIcon } from "../Icons/ErrorIcon"
|
||||||
import { Typography } from "../Typography/Typography"
|
import { Typography } from "../Typography/Typography"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { dispatchCustomEvent } from "../../util/events"
|
import { dispatchCustomEvent } from "../../utils/events"
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Notification Types
|
// Notification Types
|
||||||
|
@ -5,8 +5,11 @@ export default {
|
|||||||
title: "components/LoadingButton",
|
title: "components/LoadingButton",
|
||||||
component: LoadingButton,
|
component: LoadingButton,
|
||||||
argTypes: {
|
argTypes: {
|
||||||
loading: { control: { type: "boolean" } },
|
loading: { control: "boolean" },
|
||||||
children: { control: "text", defaultValue: "Create workspace" },
|
children: { control: "text" },
|
||||||
|
},
|
||||||
|
args: {
|
||||||
|
children: "Create workspace",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import { LogLevel } from "api/typesGenerated"
|
|||||||
import dayjs from "dayjs"
|
import dayjs from "dayjs"
|
||||||
import { FC, useMemo } from "react"
|
import { FC, useMemo } from "react"
|
||||||
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"
|
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"
|
||||||
import { combineClasses } from "../../util/combineClasses"
|
import { combineClasses } from "../../utils/combineClasses"
|
||||||
import AnsiToHTML from "ansi-to-html"
|
import AnsiToHTML from "ansi-to-html"
|
||||||
|
|
||||||
export interface Line {
|
export interface Line {
|
||||||
|
@ -10,7 +10,7 @@ import { NavLink, useLocation } from "react-router-dom"
|
|||||||
import { colors } from "theme/colors"
|
import { colors } from "theme/colors"
|
||||||
import * as TypesGen from "../../api/typesGenerated"
|
import * as TypesGen from "../../api/typesGenerated"
|
||||||
import { navHeight } from "../../theme/constants"
|
import { navHeight } from "../../theme/constants"
|
||||||
import { combineClasses } from "../../util/combineClasses"
|
import { combineClasses } from "../../utils/combineClasses"
|
||||||
import { UserDropdown } from "../UserDropdown/UsersDropdown"
|
import { UserDropdown } from "../UserDropdown/UsersDropdown"
|
||||||
|
|
||||||
export const USERS_LINK = `/users?filter=${encodeURIComponent("status:active")}`
|
export const USERS_LINK = `/users?filter=${encodeURIComponent("status:active")}`
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import { PropsWithChildren, FC } from "react"
|
import { PropsWithChildren, FC } from "react"
|
||||||
import { combineClasses } from "../../util/combineClasses"
|
import { combineClasses } from "../../utils/combineClasses"
|
||||||
import { Stack } from "../Stack/Stack"
|
import { Stack } from "../Stack/Stack"
|
||||||
|
|
||||||
export interface PageHeaderProps {
|
export interface PageHeaderProps {
|
||||||
|
@ -5,19 +5,11 @@ import { createPaginationRef } from "./utils"
|
|||||||
export default {
|
export default {
|
||||||
title: "components/PaginationWidget",
|
title: "components/PaginationWidget",
|
||||||
component: PaginationWidget,
|
component: PaginationWidget,
|
||||||
argTypes: {
|
args: {
|
||||||
prevLabel: {
|
prevLabel: "Previous",
|
||||||
defaultValue: "Previous",
|
nextLabel: "Next",
|
||||||
},
|
paginationRef: createPaginationRef({ page: 1, limit: 12 }),
|
||||||
nextLabel: {
|
numRecords: 200,
|
||||||
defaultValue: "Next",
|
|
||||||
},
|
|
||||||
paginationRef: {
|
|
||||||
defaultValue: createPaginationRef({ page: 1, limit: 12 }),
|
|
||||||
},
|
|
||||||
numRecords: {
|
|
||||||
defaultValue: 200,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { makeStyles, Theme } from "@material-ui/core/styles"
|
import { makeStyles, Theme } from "@material-ui/core/styles"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { PaletteIndex } from "theme/palettes"
|
import { PaletteIndex } from "theme/palettes"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
|
|
||||||
export interface PillProps {
|
export interface PillProps {
|
||||||
className?: string
|
className?: string
|
||||||
|
@ -2,7 +2,7 @@ import { useAuth } from "components/AuthProvider/AuthProvider"
|
|||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { Navigate, useLocation } from "react-router"
|
import { Navigate, useLocation } from "react-router"
|
||||||
import { Outlet } from "react-router-dom"
|
import { Outlet } from "react-router-dom"
|
||||||
import { embedRedirect } from "../../util/redirect"
|
import { embedRedirect } from "../../utils/redirect"
|
||||||
import { FullScreenLoader } from "../Loader/FullScreenLoader"
|
import { FullScreenLoader } from "../Loader/FullScreenLoader"
|
||||||
|
|
||||||
export const RequireAuth: FC = () => {
|
export const RequireAuth: FC = () => {
|
||||||
|
@ -19,6 +19,7 @@ import {
|
|||||||
useRef,
|
useRef,
|
||||||
useState,
|
useState,
|
||||||
} from "react"
|
} from "react"
|
||||||
|
import { humanDuration } from "utils/duration"
|
||||||
|
|
||||||
export const WatchAgentMetadataContext = createContext(watchAgentMetadata)
|
export const WatchAgentMetadataContext = createContext(watchAgentMetadata)
|
||||||
|
|
||||||
@ -135,7 +136,6 @@ const MetadataItem: FC<{ item: WorkspaceAgentMetadata }> = ({ item }) => {
|
|||||||
<div
|
<div
|
||||||
className={styles.metadataLabel}
|
className={styles.metadataLabel}
|
||||||
onMouseEnter={() => setIsOpen(true)}
|
onMouseEnter={() => setIsOpen(true)}
|
||||||
// onMouseLeave={() => setIsOpen(false)}
|
|
||||||
role="presentation"
|
role="presentation"
|
||||||
ref={labelAnchorRef}
|
ref={labelAnchorRef}
|
||||||
>
|
>
|
||||||
@ -165,17 +165,16 @@ const MetadataItem: FC<{ item: WorkspaceAgentMetadata }> = ({ item }) => {
|
|||||||
{status === "stale" ? (
|
{status === "stale" ? (
|
||||||
<HelpTooltipText>
|
<HelpTooltipText>
|
||||||
This item is now stale because the agent hasn{"'"}t reported a new
|
This item is now stale because the agent hasn{"'"}t reported a new
|
||||||
value in {dayjs.duration(item.result.age, "s").humanize()}.
|
value in {humanDuration(item.result.age, "s")}.
|
||||||
</HelpTooltipText>
|
</HelpTooltipText>
|
||||||
) : (
|
) : (
|
||||||
<></>
|
<></>
|
||||||
)}
|
)}
|
||||||
{status === "valid" ? (
|
{status === "valid" ? (
|
||||||
<HelpTooltipText>
|
<HelpTooltipText>
|
||||||
The agent collected this value{" "}
|
The agent collected this value {humanDuration(item.result.age, "s")}{" "}
|
||||||
{dayjs.duration(item.result.age, "s").humanize()} ago and will
|
ago and will update it in{" "}
|
||||||
update it in{" "}
|
{humanDuration(Math.min(updatesInSeconds, 0), "s")}.
|
||||||
{dayjs.duration(Math.min(updatesInSeconds, 0), "s").humanize()}.
|
|
||||||
</HelpTooltipText>
|
</HelpTooltipText>
|
||||||
) : (
|
) : (
|
||||||
<></>
|
<></>
|
||||||
|
@ -73,7 +73,6 @@ export const AgentRow: FC<AgentRowProps> = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
const { t } = useTranslation("agent")
|
const { t } = useTranslation("agent")
|
||||||
|
|
||||||
const [logsMachine, sendLogsEvent] = useMachine(workspaceAgentLogsMachine, {
|
const [logsMachine, sendLogsEvent] = useMachine(workspaceAgentLogsMachine, {
|
||||||
context: { agentID: agent.id },
|
context: { agentID: agent.id },
|
||||||
services: process.env.STORYBOOK
|
services: process.env.STORYBOOK
|
||||||
|
@ -3,7 +3,7 @@ import { AppPreviewLink } from "components/AppLink/AppPreviewLink"
|
|||||||
import { Maybe } from "components/Conditionals/Maybe"
|
import { Maybe } from "components/Conditionals/Maybe"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { useTranslation } from "react-i18next"
|
import { useTranslation } from "react-i18next"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
import { WorkspaceAgent } from "../../api/typesGenerated"
|
import { WorkspaceAgent } from "../../api/typesGenerated"
|
||||||
import { Stack } from "../Stack/Stack"
|
import { Stack } from "../Stack/Stack"
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import Tooltip from "@material-ui/core/Tooltip"
|
import Tooltip from "@material-ui/core/Tooltip"
|
||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
import { WorkspaceAgent } from "api/typesGenerated"
|
import { WorkspaceAgent } from "api/typesGenerated"
|
||||||
import { ChooseOne, Cond } from "components/Conditionals/ChooseOne"
|
import { ChooseOne, Cond } from "components/Conditionals/ChooseOne"
|
||||||
import { useTranslation } from "react-i18next"
|
import { useTranslation } from "react-i18next"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useRef, useState, FC } from "react"
|
import { useRef, useState, FC } from "react"
|
||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import { WorkspaceAgent } from "api/typesGenerated"
|
import { WorkspaceAgent } from "api/typesGenerated"
|
||||||
import { getDisplayVersionStatus } from "util/workspace"
|
import { getDisplayVersionStatus } from "utils/workspace"
|
||||||
import { AgentOutdatedTooltip } from "components/Tooltips/AgentOutdatedTooltip"
|
import { AgentOutdatedTooltip } from "components/Tooltips/AgentOutdatedTooltip"
|
||||||
|
|
||||||
export const AgentVersion: FC<{
|
export const AgentVersion: FC<{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { ComponentMeta, Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import { userFilterQuery, workspaceFilterQuery } from "../../util/filters"
|
import { userFilterQuery, workspaceFilterQuery } from "../../utils/filters"
|
||||||
import {
|
import {
|
||||||
SearchBarWithFilter,
|
SearchBarWithFilter,
|
||||||
SearchBarWithFilterProps,
|
SearchBarWithFilterProps,
|
||||||
@ -8,12 +8,10 @@ import {
|
|||||||
export default {
|
export default {
|
||||||
title: "components/SearchBarWithFilter",
|
title: "components/SearchBarWithFilter",
|
||||||
component: SearchBarWithFilter,
|
component: SearchBarWithFilter,
|
||||||
argTypes: {
|
args: {
|
||||||
filter: {
|
filter: workspaceFilterQuery.me,
|
||||||
defaultValue: workspaceFilterQuery.me,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
} as ComponentMeta<typeof SearchBarWithFilter>
|
}
|
||||||
|
|
||||||
const Template: Story<SearchBarWithFilterProps> = (args) => (
|
const Template: Story<SearchBarWithFilterProps> = (args) => (
|
||||||
<SearchBarWithFilter {...args} />
|
<SearchBarWithFilter {...args} />
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import Typography from "@material-ui/core/Typography"
|
import Typography from "@material-ui/core/Typography"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { combineClasses } from "../../util/combineClasses"
|
import { combineClasses } from "../../utils/combineClasses"
|
||||||
import { SectionAction } from "../SectionAction/SectionAction"
|
import { SectionAction } from "../SectionAction/SectionAction"
|
||||||
|
|
||||||
type SectionLayout = "fixed" | "fluid"
|
type SectionLayout = "fixed" | "fluid"
|
||||||
|
@ -6,7 +6,7 @@ import {
|
|||||||
getFormHelpers,
|
getFormHelpers,
|
||||||
nameValidator,
|
nameValidator,
|
||||||
onChangeTrimmed,
|
onChangeTrimmed,
|
||||||
} from "../../util/formUtils"
|
} from "../../utils/formUtils"
|
||||||
import { LoadingButton } from "../LoadingButton/LoadingButton"
|
import { LoadingButton } from "../LoadingButton/LoadingButton"
|
||||||
import { Stack } from "../Stack/Stack"
|
import { Stack } from "../Stack/Stack"
|
||||||
import { AlertBanner } from "components/AlertBanner/AlertBanner"
|
import { AlertBanner } from "components/AlertBanner/AlertBanner"
|
||||||
|
@ -3,7 +3,7 @@ import { Sidebar } from "./Sidebar"
|
|||||||
import { Stack } from "components/Stack/Stack"
|
import { Stack } from "components/Stack/Stack"
|
||||||
import { FC, Suspense } from "react"
|
import { FC, Suspense } from "react"
|
||||||
import { Helmet } from "react-helmet-async"
|
import { Helmet } from "react-helmet-async"
|
||||||
import { pageTitle } from "../../util/page"
|
import { pageTitle } from "../../utils/page"
|
||||||
import { Margins } from "../Margins/Margins"
|
import { Margins } from "../Margins/Margins"
|
||||||
import { useMe } from "hooks/useMe"
|
import { useMe } from "hooks/useMe"
|
||||||
import { Loader } from "components/Loader/Loader"
|
import { Loader } from "components/Loader/Loader"
|
||||||
|
@ -6,7 +6,7 @@ import { Stack } from "components/Stack/Stack"
|
|||||||
import { UserAvatar } from "components/UserAvatar/UserAvatar"
|
import { UserAvatar } from "components/UserAvatar/UserAvatar"
|
||||||
import { FC, ElementType, PropsWithChildren, ReactNode } from "react"
|
import { FC, ElementType, PropsWithChildren, ReactNode } from "react"
|
||||||
import { NavLink } from "react-router-dom"
|
import { NavLink } from "react-router-dom"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
import AccountIcon from "@material-ui/icons/Person"
|
import AccountIcon from "@material-ui/icons/Person"
|
||||||
import SecurityIcon from "@material-ui/icons/LockOutlined"
|
import SecurityIcon from "@material-ui/icons/LockOutlined"
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import TextField from "@material-ui/core/TextField"
|
|||||||
import { FormikContextType, FormikTouched, useFormik } from "formik"
|
import { FormikContextType, FormikTouched, useFormik } from "formik"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import * as Yup from "yup"
|
import * as Yup from "yup"
|
||||||
import { getFormHelpers } from "../../util/formUtils"
|
import { getFormHelpers } from "../../utils/formUtils"
|
||||||
import { LoadingButton } from "../LoadingButton/LoadingButton"
|
import { LoadingButton } from "../LoadingButton/LoadingButton"
|
||||||
import { Stack } from "../Stack/Stack"
|
import { Stack } from "../Stack/Stack"
|
||||||
import { AlertBanner } from "components/AlertBanner/AlertBanner"
|
import { AlertBanner } from "components/AlertBanner/AlertBanner"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Stack } from "../Stack/Stack"
|
import { Stack } from "../Stack/Stack"
|
||||||
import TextField from "@material-ui/core/TextField"
|
import TextField from "@material-ui/core/TextField"
|
||||||
import { getFormHelpers, onChangeTrimmed } from "../../util/formUtils"
|
import { getFormHelpers, onChangeTrimmed } from "../../utils/formUtils"
|
||||||
import { LoadingButton } from "../LoadingButton/LoadingButton"
|
import { LoadingButton } from "../LoadingButton/LoadingButton"
|
||||||
import { Language } from "./SignInForm"
|
import { Language } from "./SignInForm"
|
||||||
import { FormikContextType, FormikTouched, useFormik } from "formik"
|
import { FormikContextType, FormikTouched, useFormik } from "formik"
|
||||||
|
@ -2,7 +2,7 @@ import { makeStyles } from "@material-ui/core/styles"
|
|||||||
import { CSSProperties } from "@material-ui/core/styles/withStyles"
|
import { CSSProperties } from "@material-ui/core/styles/withStyles"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { ReactNode } from "react-markdown/lib/react-markdown"
|
import { ReactNode } from "react-markdown/lib/react-markdown"
|
||||||
import { combineClasses } from "../../util/combineClasses"
|
import { combineClasses } from "../../utils/combineClasses"
|
||||||
|
|
||||||
type Direction = "column" | "row"
|
type Direction = "column" | "row"
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Theme, useTheme } from "@material-ui/core/styles"
|
import { Theme, useTheme } from "@material-ui/core/styles"
|
||||||
import { useMonaco } from "@monaco-editor/react"
|
import { useMonaco } from "@monaco-editor/react"
|
||||||
import { useEffect, useState } from "react"
|
import { useEffect, useState } from "react"
|
||||||
import { hslToHex } from "util/colors"
|
import { hslToHex } from "utils/colors"
|
||||||
import { editor } from "monaco-editor"
|
import { editor } from "monaco-editor"
|
||||||
|
|
||||||
// Theme based on https://github.com/brijeshb42/monaco-themes/blob/master/themes/Dracula.json
|
// Theme based on https://github.com/brijeshb42/monaco-themes/blob/master/themes/Dracula.json
|
||||||
|
@ -4,7 +4,7 @@ import { makeStyles } from "@material-ui/core/styles"
|
|||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { NavLink } from "react-router-dom"
|
import { NavLink } from "react-router-dom"
|
||||||
import { sidePadding } from "theme/constants"
|
import { sidePadding } from "theme/constants"
|
||||||
import { combineClasses } from "../../util/combineClasses"
|
import { combineClasses } from "../../utils/combineClasses"
|
||||||
|
|
||||||
export interface TabSidebarItem {
|
export interface TabSidebarItem {
|
||||||
path: string
|
path: string
|
||||||
|
@ -2,7 +2,7 @@ import Link from "@material-ui/core/Link"
|
|||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import TableCell, { TableCellProps } from "@material-ui/core/TableCell"
|
import TableCell, { TableCellProps } from "@material-ui/core/TableCell"
|
||||||
import { Link as RouterLink } from "react-router-dom"
|
import { Link as RouterLink } from "react-router-dom"
|
||||||
import { combineClasses } from "../../util/combineClasses"
|
import { combineClasses } from "../../utils/combineClasses"
|
||||||
|
|
||||||
// TableCellLink wraps a TableCell filling the entirety with a Link.
|
// TableCellLink wraps a TableCell filling the entirety with a Link.
|
||||||
// This allows table rows to be clickable with browser-behavior like ctrl+click.
|
// This allows table rows to be clickable with browser-behavior like ctrl+click.
|
||||||
|
@ -2,7 +2,7 @@ import { makeStyles } from "@material-ui/core/styles"
|
|||||||
import { TemplateExample } from "api/typesGenerated"
|
import { TemplateExample } from "api/typesGenerated"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { Link } from "react-router-dom"
|
import { Link } from "react-router-dom"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
|
|
||||||
export interface TemplateExampleCardProps {
|
export interface TemplateExampleCardProps {
|
||||||
example: TemplateExample
|
example: TemplateExample
|
||||||
|
@ -5,8 +5,8 @@ import { TerraformIcon } from "components/Icons/TerraformIcon"
|
|||||||
import { SyntaxHighlighter } from "components/SyntaxHighlighter/SyntaxHighlighter"
|
import { SyntaxHighlighter } from "components/SyntaxHighlighter/SyntaxHighlighter"
|
||||||
import { UseTabResult } from "hooks/useTab"
|
import { UseTabResult } from "hooks/useTab"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
import { TemplateVersionFiles } from "util/templateVersion"
|
import { TemplateVersionFiles } from "utils/templateVersion"
|
||||||
|
|
||||||
const iconByExtension: Record<string, JSX.Element> = {
|
const iconByExtension: Record<string, JSX.Element> = {
|
||||||
tf: <TerraformIcon />,
|
tf: <TerraformIcon />,
|
||||||
|
@ -2,7 +2,7 @@ import { makeStyles } from "@material-ui/core/styles"
|
|||||||
import { useOrganizationId } from "hooks/useOrganizationId"
|
import { useOrganizationId } from "hooks/useOrganizationId"
|
||||||
import { createContext, FC, Suspense, useContext } from "react"
|
import { createContext, FC, Suspense, useContext } from "react"
|
||||||
import { NavLink, Outlet, useNavigate, useParams } from "react-router-dom"
|
import { NavLink, Outlet, useNavigate, useParams } from "react-router-dom"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
import { Margins } from "components/Margins/Margins"
|
import { Margins } from "components/Margins/Margins"
|
||||||
import { Stack } from "components/Stack/Stack"
|
import { Stack } from "components/Stack/Stack"
|
||||||
import { Loader } from "components/Loader/Loader"
|
import { Loader } from "components/Loader/Loader"
|
||||||
|
@ -8,17 +8,11 @@ import {
|
|||||||
export default {
|
export default {
|
||||||
title: "Components/TemplatePageHeader",
|
title: "Components/TemplatePageHeader",
|
||||||
component: TemplatePageHeader,
|
component: TemplatePageHeader,
|
||||||
argTypes: {
|
args: {
|
||||||
template: {
|
template: MockTemplate,
|
||||||
defaultValue: MockTemplate,
|
activeVersion: MockTemplateVersion,
|
||||||
},
|
|
||||||
activeVersion: {
|
|
||||||
defaultValue: MockTemplateVersion,
|
|
||||||
},
|
|
||||||
permissions: {
|
permissions: {
|
||||||
defaultValue: {
|
canUpdateTemplate: true,
|
||||||
canUpdateTemplate: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as ComponentMeta<typeof TemplatePageHeader>
|
} as ComponentMeta<typeof TemplatePageHeader>
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { Stats, StatsItem } from "components/Stats/Stats"
|
import { Stats, StatsItem } from "components/Stats/Stats"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { Link } from "react-router-dom"
|
import { Link } from "react-router-dom"
|
||||||
import { createDayString } from "util/createDayString"
|
import { createDayString } from "utils/createDayString"
|
||||||
import {
|
import {
|
||||||
formatTemplateBuildTime,
|
formatTemplateBuildTime,
|
||||||
formatTemplateActiveDevelopers,
|
formatTemplateActiveDevelopers,
|
||||||
} from "util/templates"
|
} from "utils/templates"
|
||||||
import { Template, TemplateVersion } from "../../api/typesGenerated"
|
import { Template, TemplateVersion } from "../../api/typesGenerated"
|
||||||
|
|
||||||
const Language = {
|
const Language = {
|
||||||
|
@ -3,8 +3,8 @@ import { ConfirmDialog } from "components/Dialogs/ConfirmDialog/ConfirmDialog"
|
|||||||
import { Stack } from "components/Stack/Stack"
|
import { Stack } from "components/Stack/Stack"
|
||||||
import { ChangeEvent, FC, useState } from "react"
|
import { ChangeEvent, FC, useState } from "react"
|
||||||
import Typography from "@material-ui/core/Typography"
|
import Typography from "@material-ui/core/Typography"
|
||||||
import { allowedExtensions, isAllowedFile } from "util/templateVersion"
|
import { allowedExtensions, isAllowedFile } from "utils/templateVersion"
|
||||||
import { FileTree, isFolder, validatePath } from "util/filetree"
|
import { FileTree, isFolder, validatePath } from "utils/filetree"
|
||||||
|
|
||||||
export const CreateFileDialog: FC<{
|
export const CreateFileDialog: FC<{
|
||||||
onClose: () => void
|
onClose: () => void
|
||||||
|
@ -6,7 +6,7 @@ import TreeItem from "@material-ui/lab/TreeItem"
|
|||||||
import Menu from "@material-ui/core/Menu"
|
import Menu from "@material-ui/core/Menu"
|
||||||
import MenuItem from "@material-ui/core/MenuItem"
|
import MenuItem from "@material-ui/core/MenuItem"
|
||||||
import { CSSProperties, FC, useState } from "react"
|
import { CSSProperties, FC, useState } from "react"
|
||||||
import { FileTree } from "util/filetree"
|
import { FileTree } from "utils/filetree"
|
||||||
import { DockerIcon } from "components/Icons/DockerIcon"
|
import { DockerIcon } from "components/Icons/DockerIcon"
|
||||||
import { colors } from "theme/colors"
|
import { colors } from "theme/colors"
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import { useTheme } from "@material-ui/core/styles"
|
|||||||
import Editor from "@monaco-editor/react"
|
import Editor from "@monaco-editor/react"
|
||||||
import { FC, useLayoutEffect, useMemo, useState } from "react"
|
import { FC, useLayoutEffect, useMemo, useState } from "react"
|
||||||
import { MONOSPACE_FONT_FAMILY } from "theme/constants"
|
import { MONOSPACE_FONT_FAMILY } from "theme/constants"
|
||||||
import { hslToHex } from "util/colors"
|
import { hslToHex } from "utils/colors"
|
||||||
import type { editor } from "monaco-editor"
|
import type { editor } from "monaco-editor"
|
||||||
|
|
||||||
export const MonacoEditor: FC<{
|
export const MonacoEditor: FC<{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { DialogProps } from "components/Dialogs/Dialog"
|
import { DialogProps } from "components/Dialogs/Dialog"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { getFormHelpers } from "util/formUtils"
|
import { getFormHelpers } from "utils/formUtils"
|
||||||
import { FormFields } from "components/Form/Form"
|
import { FormFields } from "components/Form/Form"
|
||||||
import { useFormik } from "formik"
|
import { useFormik } from "formik"
|
||||||
import * as Yup from "yup"
|
import * as Yup from "yup"
|
||||||
|
@ -29,7 +29,7 @@ import {
|
|||||||
removeFile,
|
removeFile,
|
||||||
traverse,
|
traverse,
|
||||||
updateFile,
|
updateFile,
|
||||||
} from "util/filetree"
|
} from "utils/filetree"
|
||||||
import {
|
import {
|
||||||
CreateFileDialog,
|
CreateFileDialog,
|
||||||
DeleteFileDialog,
|
DeleteFileDialog,
|
||||||
|
@ -4,8 +4,8 @@ import { makeStyles } from "@material-ui/core/styles"
|
|||||||
import ComputerIcon from "@material-ui/icons/Computer"
|
import ComputerIcon from "@material-ui/icons/Computer"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import * as TypesGen from "../../api/typesGenerated"
|
import * as TypesGen from "../../api/typesGenerated"
|
||||||
import { combineClasses } from "../../util/combineClasses"
|
import { combineClasses } from "../../utils/combineClasses"
|
||||||
import { generateRandomString } from "../../util/random"
|
import { generateRandomString } from "../../utils/random"
|
||||||
|
|
||||||
export const Language = {
|
export const Language = {
|
||||||
linkText: "Terminal",
|
linkText: "Terminal",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import TableRow, { TableRowProps } from "@material-ui/core/TableRow"
|
import TableRow, { TableRowProps } from "@material-ui/core/TableRow"
|
||||||
import { PropsWithChildren } from "react"
|
import { PropsWithChildren } from "react"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
|
|
||||||
interface TimelineEntryProps {
|
interface TimelineEntryProps {
|
||||||
clickable?: boolean
|
clickable?: boolean
|
||||||
|
@ -11,7 +11,7 @@ import {
|
|||||||
FC,
|
FC,
|
||||||
PropsWithChildren,
|
PropsWithChildren,
|
||||||
} from "react"
|
} from "react"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
import { Stack } from "../../Stack/Stack"
|
import { Stack } from "../../Stack/Stack"
|
||||||
|
|
||||||
type Icon = typeof HelpIcon
|
type Icon = typeof HelpIcon
|
||||||
|
@ -8,7 +8,7 @@ import MuiTypography, {
|
|||||||
TypographyProps as MuiTypographyProps,
|
TypographyProps as MuiTypographyProps,
|
||||||
} from "@material-ui/core/Typography"
|
} from "@material-ui/core/Typography"
|
||||||
import * as React from "react"
|
import * as React from "react"
|
||||||
import { appendCSSString, combineClasses } from "../../util/combineClasses"
|
import { appendCSSString, combineClasses } from "../../utils/combineClasses"
|
||||||
|
|
||||||
export interface TypographyProps extends MuiTypographyProps {
|
export interface TypographyProps extends MuiTypographyProps {
|
||||||
short?: boolean
|
short?: boolean
|
||||||
|
@ -11,7 +11,7 @@ import { Link } from "react-router-dom"
|
|||||||
import * as TypesGen from "../../api/typesGenerated"
|
import * as TypesGen from "../../api/typesGenerated"
|
||||||
import DocsIcon from "@material-ui/icons/MenuBook"
|
import DocsIcon from "@material-ui/icons/MenuBook"
|
||||||
import LogoutIcon from "@material-ui/icons/ExitToAppOutlined"
|
import LogoutIcon from "@material-ui/icons/ExitToAppOutlined"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
|
|
||||||
export const Language = {
|
export const Language = {
|
||||||
accountLabel: "Account",
|
accountLabel: "Account",
|
||||||
|
@ -7,7 +7,7 @@ import { Group, User } from "api/typesGenerated"
|
|||||||
import { AvatarData } from "components/AvatarData/AvatarData"
|
import { AvatarData } from "components/AvatarData/AvatarData"
|
||||||
import debounce from "just-debounce-it"
|
import debounce from "just-debounce-it"
|
||||||
import { ChangeEvent, useState } from "react"
|
import { ChangeEvent, useState } from "react"
|
||||||
import { getGroupSubtitle } from "util/groups"
|
import { getGroupSubtitle } from "utils/groups"
|
||||||
import { searchUsersAndGroupsMachine } from "xServices/template/searchUsersAndGroupsXService"
|
import { searchUsersAndGroupsMachine } from "xServices/template/searchUsersAndGroupsXService"
|
||||||
|
|
||||||
export type UserOrGroupAutocompleteValue = User | Group | null
|
export type UserOrGroupAutocompleteValue = User | Group | null
|
||||||
|
@ -15,7 +15,7 @@ import {
|
|||||||
Outlet,
|
Outlet,
|
||||||
useNavigate,
|
useNavigate,
|
||||||
} from "react-router-dom"
|
} from "react-router-dom"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
import { authMethodsXService } from "xServices/auth/authMethodsXService"
|
import { authMethodsXService } from "xServices/auth/authMethodsXService"
|
||||||
import { Margins } from "../../components/Margins/Margins"
|
import { Margins } from "../../components/Margins/Margins"
|
||||||
import { Stack } from "../../components/Stack/Stack"
|
import { Stack } from "../../components/Stack/Stack"
|
||||||
|
@ -9,10 +9,8 @@ import { UsersTable, UsersTableProps } from "./UsersTable"
|
|||||||
export default {
|
export default {
|
||||||
title: "components/UsersTable",
|
title: "components/UsersTable",
|
||||||
component: UsersTable,
|
component: UsersTable,
|
||||||
argTypes: {
|
args: {
|
||||||
isNonInitialPage: {
|
isNonInitialPage: false,
|
||||||
defaultValue: false,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
} as ComponentMeta<typeof UsersTable>
|
} as ComponentMeta<typeof UsersTable>
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import { Pill } from "components/Pill/Pill"
|
|||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { useTranslation } from "react-i18next"
|
import { useTranslation } from "react-i18next"
|
||||||
import * as TypesGen from "../../api/typesGenerated"
|
import * as TypesGen from "../../api/typesGenerated"
|
||||||
import { combineClasses } from "../../util/combineClasses"
|
import { combineClasses } from "../../utils/combineClasses"
|
||||||
import { AvatarData } from "../AvatarData/AvatarData"
|
import { AvatarData } from "../AvatarData/AvatarData"
|
||||||
import { EmptyState } from "../EmptyState/EmptyState"
|
import { EmptyState } from "../EmptyState/EmptyState"
|
||||||
import { TableLoaderSkeleton } from "../TableLoader/TableLoader"
|
import { TableLoaderSkeleton } from "../TableLoader/TableLoader"
|
||||||
|
@ -10,7 +10,7 @@ import { useClickableTableRow } from "hooks/useClickableTableRow"
|
|||||||
import { useTranslation } from "react-i18next"
|
import { useTranslation } from "react-i18next"
|
||||||
import { useNavigate } from "react-router-dom"
|
import { useNavigate } from "react-router-dom"
|
||||||
import { colors } from "theme/colors"
|
import { colors } from "theme/colors"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
|
|
||||||
export interface VersionRowProps {
|
export interface VersionRowProps {
|
||||||
version: TemplateVersion
|
version: TemplateVersion
|
||||||
|
@ -24,6 +24,7 @@ Example.args = {
|
|||||||
},
|
},
|
||||||
MockTemplateVersion,
|
MockTemplateVersion,
|
||||||
],
|
],
|
||||||
|
onPromoteClick: undefined,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CanPromote = Template.bind({})
|
export const CanPromote = Template.bind({})
|
||||||
|
@ -3,7 +3,7 @@ import { FC } from "react"
|
|||||||
import { useTranslation } from "react-i18next"
|
import { useTranslation } from "react-i18next"
|
||||||
import { Link } from "react-router-dom"
|
import { Link } from "react-router-dom"
|
||||||
import { WorkspaceBuild } from "../../api/typesGenerated"
|
import { WorkspaceBuild } from "../../api/typesGenerated"
|
||||||
import { displayWorkspaceBuildDuration } from "../../util/workspace"
|
import { displayWorkspaceBuildDuration } from "../../utils/workspace"
|
||||||
|
|
||||||
export interface WorkspaceBuildStatsProps {
|
export interface WorkspaceBuildStatsProps {
|
||||||
build: WorkspaceBuild
|
build: WorkspaceBuild
|
||||||
|
@ -9,10 +9,8 @@ dayjs.extend(utc)
|
|||||||
export default {
|
export default {
|
||||||
title: "components/WorkspaceSchedule",
|
title: "components/WorkspaceSchedule",
|
||||||
component: WorkspaceSchedule,
|
component: WorkspaceSchedule,
|
||||||
argTypes: {
|
args: {
|
||||||
canUpdateWorkspace: {
|
canUpdateWorkspace: true,
|
||||||
defaultValue: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ import {
|
|||||||
autostopDisplay,
|
autostopDisplay,
|
||||||
extractTimezone,
|
extractTimezone,
|
||||||
Language as ScheduleLanguage,
|
Language as ScheduleLanguage,
|
||||||
} from "../../util/schedule"
|
} from "../../utils/schedule"
|
||||||
import { Stack } from "../Stack/Stack"
|
import { Stack } from "../Stack/Stack"
|
||||||
|
|
||||||
// REMARK: some plugins depend on utc, so it's listed first. Otherwise they're
|
// REMARK: some plugins depend on utc, so it's listed first. Otherwise they're
|
||||||
|
@ -28,7 +28,7 @@ import {
|
|||||||
} from "pages/WorkspaceSettingsPage/WorkspaceSchedulePage/schedule"
|
} from "pages/WorkspaceSettingsPage/WorkspaceSchedulePage/schedule"
|
||||||
import { ChangeEvent, FC } from "react"
|
import { ChangeEvent, FC } from "react"
|
||||||
import * as Yup from "yup"
|
import * as Yup from "yup"
|
||||||
import { getFormHelpers } from "../../util/formUtils"
|
import { getFormHelpers } from "../../utils/formUtils"
|
||||||
import { zones } from "./zones"
|
import { zones } from "./zones"
|
||||||
|
|
||||||
// REMARK: some plugins depend on utc, so it's listed first. Otherwise they're
|
// REMARK: some plugins depend on utc, so it's listed first. Otherwise they're
|
||||||
|
@ -3,7 +3,7 @@ import { makeStyles } from "@material-ui/core/styles"
|
|||||||
import Typography from "@material-ui/core/Typography"
|
import Typography from "@material-ui/core/Typography"
|
||||||
import { HTMLProps, ReactNode, FC, PropsWithChildren } from "react"
|
import { HTMLProps, ReactNode, FC, PropsWithChildren } from "react"
|
||||||
import { CardPadding } from "../../theme/constants"
|
import { CardPadding } from "../../theme/constants"
|
||||||
import { combineClasses } from "../../util/combineClasses"
|
import { combineClasses } from "../../utils/combineClasses"
|
||||||
|
|
||||||
export interface WorkspaceSectionProps {
|
export interface WorkspaceSectionProps {
|
||||||
/**
|
/**
|
||||||
|
@ -2,16 +2,16 @@ import Link from "@material-ui/core/Link"
|
|||||||
import { OutdatedHelpTooltip } from "components/Tooltips"
|
import { OutdatedHelpTooltip } from "components/Tooltips"
|
||||||
import { FC, useRef, useState } from "react"
|
import { FC, useRef, useState } from "react"
|
||||||
import { Link as RouterLink } from "react-router-dom"
|
import { Link as RouterLink } from "react-router-dom"
|
||||||
import { createDayString } from "util/createDayString"
|
import { createDayString } from "utils/createDayString"
|
||||||
import {
|
import {
|
||||||
getDisplayWorkspaceBuildInitiatedBy,
|
getDisplayWorkspaceBuildInitiatedBy,
|
||||||
getDisplayWorkspaceTemplateName,
|
getDisplayWorkspaceTemplateName,
|
||||||
isWorkspaceOn,
|
isWorkspaceOn,
|
||||||
} from "util/workspace"
|
} from "utils/workspace"
|
||||||
import { Workspace } from "../../api/typesGenerated"
|
import { Workspace } from "../../api/typesGenerated"
|
||||||
import { Stats, StatsItem } from "components/Stats/Stats"
|
import { Stats, StatsItem } from "components/Stats/Stats"
|
||||||
import upperFirst from "lodash/upperFirst"
|
import upperFirst from "lodash/upperFirst"
|
||||||
import { autostartDisplay, autostopDisplay } from "util/schedule"
|
import { autostartDisplay, autostopDisplay } from "utils/schedule"
|
||||||
import IconButton from "@material-ui/core/IconButton"
|
import IconButton from "@material-ui/core/IconButton"
|
||||||
import RemoveIcon from "@material-ui/icons/RemoveOutlined"
|
import RemoveIcon from "@material-ui/icons/RemoveOutlined"
|
||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
|
@ -6,7 +6,7 @@ import { AvatarData } from "components/AvatarData/AvatarData"
|
|||||||
import { WorkspaceStatusBadge } from "components/WorkspaceStatusBadge/WorkspaceStatusBadge"
|
import { WorkspaceStatusBadge } from "components/WorkspaceStatusBadge/WorkspaceStatusBadge"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { useNavigate } from "react-router-dom"
|
import { useNavigate } from "react-router-dom"
|
||||||
import { getDisplayWorkspaceTemplateName } from "util/workspace"
|
import { getDisplayWorkspaceTemplateName } from "utils/workspace"
|
||||||
import { LastUsed } from "../LastUsed/LastUsed"
|
import { LastUsed } from "../LastUsed/LastUsed"
|
||||||
import { Workspace } from "api/typesGenerated"
|
import { Workspace } from "api/typesGenerated"
|
||||||
import { OutdatedHelpTooltip } from "components/Tooltips/OutdatedHelpTooltip"
|
import { OutdatedHelpTooltip } from "components/Tooltips/OutdatedHelpTooltip"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { renderHook, waitFor } from "@testing-library/react"
|
import { renderHook, waitFor } from "@testing-library/react"
|
||||||
import { dispatchCustomEvent } from "../util/events"
|
import { dispatchCustomEvent } from "../utils/events"
|
||||||
import { useCustomEvent } from "./events"
|
import { useCustomEvent } from "./events"
|
||||||
|
|
||||||
describe("useCustomEvent", () => {
|
describe("useCustomEvent", () => {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useEffect } from "react"
|
import { useEffect } from "react"
|
||||||
import { CustomEventListener } from "../util/events"
|
import { CustomEventListener } from "../utils/events"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles a custom event with descriptive type information.
|
* Handles a custom event with descriptive type information.
|
||||||
|
@ -13,7 +13,7 @@ import {
|
|||||||
} from "testHelpers/renderHelpers"
|
} from "testHelpers/renderHelpers"
|
||||||
import { server } from "testHelpers/server"
|
import { server } from "testHelpers/server"
|
||||||
|
|
||||||
import * as CreateDayString from "util/createDayString"
|
import * as CreateDayString from "utils/createDayString"
|
||||||
import AuditPage from "./AuditPage"
|
import AuditPage from "./AuditPage"
|
||||||
|
|
||||||
interface RenderPageOptions {
|
interface RenderPageOptions {
|
||||||
|
@ -7,7 +7,7 @@ import { useFeatureVisibility } from "hooks/useFeatureVisibility"
|
|||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { Helmet } from "react-helmet-async"
|
import { Helmet } from "react-helmet-async"
|
||||||
import { useSearchParams } from "react-router-dom"
|
import { useSearchParams } from "react-router-dom"
|
||||||
import { pageTitle } from "util/page"
|
import { pageTitle } from "utils/page"
|
||||||
import { auditMachine } from "xServices/audit/auditXService"
|
import { auditMachine } from "xServices/audit/auditXService"
|
||||||
import { PaginationMachineRef } from "xServices/pagination/paginationXService"
|
import { PaginationMachineRef } from "xServices/pagination/paginationXService"
|
||||||
import { AuditPageView } from "./AuditPageView"
|
import { AuditPageView } from "./AuditPageView"
|
||||||
|
@ -6,19 +6,11 @@ import { AuditPageView, AuditPageViewProps } from "./AuditPageView"
|
|||||||
export default {
|
export default {
|
||||||
title: "pages/AuditPageView",
|
title: "pages/AuditPageView",
|
||||||
component: AuditPageView,
|
component: AuditPageView,
|
||||||
argTypes: {
|
args: {
|
||||||
auditLogs: {
|
auditLogs: [MockAuditLog, MockAuditLog2],
|
||||||
defaultValue: [MockAuditLog, MockAuditLog2],
|
count: 1000,
|
||||||
},
|
paginationRef: createPaginationRef({ page: 1, limit: 25 }),
|
||||||
count: {
|
isAuditLogVisible: true,
|
||||||
defaultValue: 1000,
|
|
||||||
},
|
|
||||||
paginationRef: {
|
|
||||||
defaultValue: createPaginationRef({ page: 1, limit: 25 }),
|
|
||||||
},
|
|
||||||
isAuditLogVisible: {
|
|
||||||
defaultValue: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
} as ComponentMeta<typeof AuditPageView>
|
} as ComponentMeta<typeof AuditPageView>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useEffect, useState, FC, PropsWithChildren } from "react"
|
import { useEffect, useState, FC, PropsWithChildren } from "react"
|
||||||
import { Helmet } from "react-helmet-async"
|
import { Helmet } from "react-helmet-async"
|
||||||
import { getApiKey } from "../../api/api"
|
import { getApiKey } from "../../api/api"
|
||||||
import { pageTitle } from "../../util/page"
|
import { pageTitle } from "../../utils/page"
|
||||||
import { CliAuthPageView } from "./CliAuthPageView"
|
import { CliAuthPageView } from "./CliAuthPageView"
|
||||||
|
|
||||||
export const CliAuthenticationPage: FC<PropsWithChildren<unknown>> = () => {
|
export const CliAuthenticationPage: FC<PropsWithChildren<unknown>> = () => {
|
||||||
|
@ -5,7 +5,10 @@ export default {
|
|||||||
title: "pages/CliAuthPageView",
|
title: "pages/CliAuthPageView",
|
||||||
component: CliAuthPageView,
|
component: CliAuthPageView,
|
||||||
argTypes: {
|
argTypes: {
|
||||||
sessionToken: { control: "text", defaultValue: "some-session-token" },
|
sessionToken: { control: "text" },
|
||||||
|
},
|
||||||
|
args: {
|
||||||
|
sessionToken: "some-session-token",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ import {
|
|||||||
getFormHelpers,
|
getFormHelpers,
|
||||||
onChangeTrimmed,
|
onChangeTrimmed,
|
||||||
templateDisplayNameValidator,
|
templateDisplayNameValidator,
|
||||||
} from "util/formUtils"
|
} from "utils/formUtils"
|
||||||
import { CreateTemplateData } from "xServices/createTemplate/createTemplateXService"
|
import { CreateTemplateData } from "xServices/createTemplate/createTemplateXService"
|
||||||
import * as Yup from "yup"
|
import * as Yup from "yup"
|
||||||
import { WorkspaceBuildLogs } from "components/WorkspaceBuildLogs/WorkspaceBuildLogs"
|
import { WorkspaceBuildLogs } from "components/WorkspaceBuildLogs/WorkspaceBuildLogs"
|
||||||
|
@ -11,7 +11,7 @@ import { FC } from "react"
|
|||||||
import { Helmet } from "react-helmet-async"
|
import { Helmet } from "react-helmet-async"
|
||||||
import { useTranslation } from "react-i18next"
|
import { useTranslation } from "react-i18next"
|
||||||
import { useNavigate, useSearchParams } from "react-router-dom"
|
import { useNavigate, useSearchParams } from "react-router-dom"
|
||||||
import { pageTitle } from "util/page"
|
import { pageTitle } from "utils/page"
|
||||||
import { createTemplateMachine } from "xServices/createTemplate/createTemplateXService"
|
import { createTemplateMachine } from "xServices/createTemplate/createTemplateXService"
|
||||||
import { CreateTemplateForm } from "./CreateTemplateForm"
|
import { CreateTemplateForm } from "./CreateTemplateForm"
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import { FC, DragEvent, useRef } from "react"
|
|||||||
import UploadIcon from "@material-ui/icons/CloudUploadOutlined"
|
import UploadIcon from "@material-ui/icons/CloudUploadOutlined"
|
||||||
import { useClickable } from "hooks/useClickable"
|
import { useClickable } from "hooks/useClickable"
|
||||||
import CircularProgress from "@material-ui/core/CircularProgress"
|
import CircularProgress from "@material-ui/core/CircularProgress"
|
||||||
import { combineClasses } from "util/combineClasses"
|
import { combineClasses } from "utils/combineClasses"
|
||||||
import IconButton from "@material-ui/core/IconButton"
|
import IconButton from "@material-ui/core/IconButton"
|
||||||
import RemoveIcon from "@material-ui/icons/DeleteOutline"
|
import RemoveIcon from "@material-ui/icons/DeleteOutline"
|
||||||
import FileIcon from "@material-ui/icons/FolderOutlined"
|
import FileIcon from "@material-ui/icons/FolderOutlined"
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
} from "components/Form/Form"
|
} from "components/Form/Form"
|
||||||
import makeStyles from "@material-ui/core/styles/makeStyles"
|
import makeStyles from "@material-ui/core/styles/makeStyles"
|
||||||
import { useTranslation } from "react-i18next"
|
import { useTranslation } from "react-i18next"
|
||||||
import { onChangeTrimmed, getFormHelpers } from "util/formUtils"
|
import { onChangeTrimmed, getFormHelpers } from "utils/formUtils"
|
||||||
import TextField from "@material-ui/core/TextField"
|
import TextField from "@material-ui/core/TextField"
|
||||||
import MenuItem from "@material-ui/core/MenuItem"
|
import MenuItem from "@material-ui/core/MenuItem"
|
||||||
import {
|
import {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { FC, useState } from "react"
|
import { FC, useState } from "react"
|
||||||
import { useTranslation } from "react-i18next"
|
import { useTranslation } from "react-i18next"
|
||||||
import { Helmet } from "react-helmet-async"
|
import { Helmet } from "react-helmet-async"
|
||||||
import { pageTitle } from "util/page"
|
import { pageTitle } from "utils/page"
|
||||||
import { FullPageHorizontalForm } from "components/FullPageForm/FullPageHorizontalForm"
|
import { FullPageHorizontalForm } from "components/FullPageForm/FullPageHorizontalForm"
|
||||||
import { useNavigate } from "react-router-dom"
|
import { useNavigate } from "react-router-dom"
|
||||||
import { useFormik } from "formik"
|
import { useFormik } from "formik"
|
||||||
|
@ -5,7 +5,7 @@ import { useOrganizationId } from "hooks/useOrganizationId"
|
|||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { Helmet } from "react-helmet-async"
|
import { Helmet } from "react-helmet-async"
|
||||||
import { useNavigate, useParams, useSearchParams } from "react-router-dom"
|
import { useNavigate, useParams, useSearchParams } from "react-router-dom"
|
||||||
import { pageTitle } from "util/page"
|
import { pageTitle } from "utils/page"
|
||||||
import { createWorkspaceMachine } from "xServices/createWorkspace/createWorkspaceXService"
|
import { createWorkspaceMachine } from "xServices/createWorkspace/createWorkspaceXService"
|
||||||
import {
|
import {
|
||||||
CreateWorkspaceErrors,
|
CreateWorkspaceErrors,
|
||||||
|
@ -135,6 +135,7 @@ RichParameters.args = {
|
|||||||
MockTemplateVersionParameter3,
|
MockTemplateVersionParameter3,
|
||||||
{
|
{
|
||||||
name: "Region",
|
name: "Region",
|
||||||
|
required: false,
|
||||||
description: "",
|
description: "",
|
||||||
description_plaintext: "",
|
description_plaintext: "",
|
||||||
type: "string",
|
type: "string",
|
||||||
|
@ -7,7 +7,7 @@ import { UserAutocomplete } from "components/UserAutocomplete/UserAutocomplete"
|
|||||||
import { FormikContextType, FormikTouched, useFormik } from "formik"
|
import { FormikContextType, FormikTouched, useFormik } from "formik"
|
||||||
import { FC, useEffect, useState } from "react"
|
import { FC, useEffect, useState } from "react"
|
||||||
import { useTranslation } from "react-i18next"
|
import { useTranslation } from "react-i18next"
|
||||||
import { getFormHelpers, nameValidator, onChangeTrimmed } from "util/formUtils"
|
import { getFormHelpers, nameValidator, onChangeTrimmed } from "utils/formUtils"
|
||||||
import * as Yup from "yup"
|
import * as Yup from "yup"
|
||||||
import { AlertBanner } from "components/AlertBanner/AlertBanner"
|
import { AlertBanner } from "components/AlertBanner/AlertBanner"
|
||||||
import { FullPageHorizontalForm } from "components/FullPageForm/FullPageHorizontalForm"
|
import { FullPageHorizontalForm } from "components/FullPageForm/FullPageHorizontalForm"
|
||||||
@ -25,7 +25,7 @@ import {
|
|||||||
selectInitialRichParametersValues,
|
selectInitialRichParametersValues,
|
||||||
useValidationSchemaForRichParameters,
|
useValidationSchemaForRichParameters,
|
||||||
workspaceBuildParameterValue,
|
workspaceBuildParameterValue,
|
||||||
} from "util/richParameters"
|
} from "utils/richParameters"
|
||||||
|
|
||||||
export enum CreateWorkspaceErrors {
|
export enum CreateWorkspaceErrors {
|
||||||
GET_TEMPLATES_ERROR = "getTemplatesError",
|
GET_TEMPLATES_ERROR = "getTemplatesError",
|
||||||
|
@ -2,7 +2,7 @@ import { UpdateAppearanceConfig } from "api/typesGenerated"
|
|||||||
import { useDashboard } from "components/Dashboard/DashboardProvider"
|
import { useDashboard } from "components/Dashboard/DashboardProvider"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { Helmet } from "react-helmet-async"
|
import { Helmet } from "react-helmet-async"
|
||||||
import { pageTitle } from "util/page"
|
import { pageTitle } from "utils/page"
|
||||||
import { AppearanceSettingsPageView } from "./AppearanceSettingsPageView"
|
import { AppearanceSettingsPageView } from "./AppearanceSettingsPageView"
|
||||||
|
|
||||||
// ServiceBanner is unlike the other Deployment Settings pages because it
|
// ServiceBanner is unlike the other Deployment Settings pages because it
|
||||||
|
@ -7,24 +7,18 @@ import {
|
|||||||
export default {
|
export default {
|
||||||
title: "pages/AppearanceSettingsPageView",
|
title: "pages/AppearanceSettingsPageView",
|
||||||
component: AppearanceSettingsPageView,
|
component: AppearanceSettingsPageView,
|
||||||
argTypes: {
|
args: {
|
||||||
appearance: {
|
appearance: {
|
||||||
defaultValue: {
|
logo_url: "https://github.com/coder.png",
|
||||||
logo_url: "https://github.com/coder.png",
|
service_banner: {
|
||||||
service_banner: {
|
enabled: true,
|
||||||
enabled: true,
|
message: "hello world",
|
||||||
message: "hello world",
|
background_color: "white",
|
||||||
background_color: "white",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
isEntitled: {
|
isEntitled: false,
|
||||||
defaultValue: false,
|
updateAppearance: () => {
|
||||||
},
|
return undefined
|
||||||
updateAppearance: {
|
|
||||||
defaultValue: () => {
|
|
||||||
return undefined
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as ComponentMeta<typeof AppearanceSettingsPageView>
|
} as ComponentMeta<typeof AppearanceSettingsPageView>
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
} from "components/DeploySettingsLayout/Badges"
|
} from "components/DeploySettingsLayout/Badges"
|
||||||
import InputAdornment from "@material-ui/core/InputAdornment"
|
import InputAdornment from "@material-ui/core/InputAdornment"
|
||||||
import { Fieldset } from "components/DeploySettingsLayout/Fieldset"
|
import { Fieldset } from "components/DeploySettingsLayout/Fieldset"
|
||||||
import { getFormHelpers } from "util/formUtils"
|
import { getFormHelpers } from "utils/formUtils"
|
||||||
import Button from "@material-ui/core/Button"
|
import Button from "@material-ui/core/Button"
|
||||||
import FormControlLabel from "@material-ui/core/FormControlLabel"
|
import FormControlLabel from "@material-ui/core/FormControlLabel"
|
||||||
import FormHelperText from "@material-ui/core/FormHelperText"
|
import FormHelperText from "@material-ui/core/FormHelperText"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useDeploySettings } from "components/DeploySettingsLayout/DeploySettingsLayout"
|
import { useDeploySettings } from "components/DeploySettingsLayout/DeploySettingsLayout"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { Helmet } from "react-helmet-async"
|
import { Helmet } from "react-helmet-async"
|
||||||
import { pageTitle } from "util/page"
|
import { pageTitle } from "utils/page"
|
||||||
import { GeneralSettingsPageView } from "./GeneralSettingsPageView"
|
import { GeneralSettingsPageView } from "./GeneralSettingsPageView"
|
||||||
|
|
||||||
const GeneralSettingsPage: FC = () => {
|
const GeneralSettingsPage: FC = () => {
|
||||||
|
@ -11,26 +11,22 @@ import {
|
|||||||
export default {
|
export default {
|
||||||
title: "pages/GeneralSettingsPageView",
|
title: "pages/GeneralSettingsPageView",
|
||||||
component: GeneralSettingsPageView,
|
component: GeneralSettingsPageView,
|
||||||
argTypes: {
|
args: {
|
||||||
deploymentOptions: {
|
deploymentOptions: [
|
||||||
defaultValue: [
|
{
|
||||||
{
|
name: "Access URL",
|
||||||
name: "Access URL",
|
description:
|
||||||
usage:
|
"External URL to access your deployment. This must be accessible by all provisioned workspaces.",
|
||||||
"External URL to access your deployment. This must be accessible by all provisioned workspaces.",
|
value: "https://dev.coder.com",
|
||||||
value: "https://dev.coder.com",
|
},
|
||||||
},
|
{
|
||||||
{
|
name: "Wildcard Access URL",
|
||||||
name: "Wildcard Access URL",
|
description:
|
||||||
usage:
|
'Specifies the wildcard hostname to use for workspace applications in the form "*.example.com".',
|
||||||
'Specifies the wildcard hostname to use for workspace applications in the form "*.example.com".',
|
value: "*--apps.dev.coder.com",
|
||||||
value: "*--apps.dev.coder.com",
|
},
|
||||||
},
|
],
|
||||||
],
|
deploymentDAUs: MockDeploymentDAUResponse,
|
||||||
},
|
|
||||||
deploymentDAUs: {
|
|
||||||
defaultValue: MockDeploymentDAUResponse,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
} as ComponentMeta<typeof GeneralSettingsPageView>
|
} as ComponentMeta<typeof GeneralSettingsPageView>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import { DAUChart } from "components/DAUChart/DAUChart"
|
|||||||
import { Header } from "components/DeploySettingsLayout/Header"
|
import { Header } from "components/DeploySettingsLayout/Header"
|
||||||
import OptionsTable from "components/DeploySettingsLayout/OptionsTable"
|
import OptionsTable from "components/DeploySettingsLayout/OptionsTable"
|
||||||
import { Stack } from "components/Stack/Stack"
|
import { Stack } from "components/Stack/Stack"
|
||||||
import { useDeploymentOptions } from "util/deployOptions"
|
import { useDeploymentOptions } from "utils/deployOptions"
|
||||||
|
|
||||||
export type GeneralSettingsPageViewProps = {
|
export type GeneralSettingsPageViewProps = {
|
||||||
deploymentOptions: DeploymentOption[]
|
deploymentOptions: DeploymentOption[]
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user