mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
@ -114,6 +114,9 @@ rules:
|
|||||||
react/jsx-curly-brace-presence:
|
react/jsx-curly-brace-presence:
|
||||||
- error
|
- error
|
||||||
- children: ignore
|
- children: ignore
|
||||||
|
# https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#eslint
|
||||||
|
react/jsx-uses-react: "off"
|
||||||
|
react/react-in-jsx-scope: "off"
|
||||||
settings:
|
settings:
|
||||||
react:
|
react:
|
||||||
version: detect
|
version: detect
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import React from "react"
|
import { FC, lazy, Suspense } from "react"
|
||||||
import { Route, Routes } from "react-router-dom"
|
import { Route, Routes } from "react-router-dom"
|
||||||
import { AuthAndFrame } from "./components/AuthAndFrame/AuthAndFrame"
|
import { AuthAndFrame } from "./components/AuthAndFrame/AuthAndFrame"
|
||||||
import { RequireAuth } from "./components/RequireAuth/RequireAuth"
|
import { RequireAuth } from "./components/RequireAuth/RequireAuth"
|
||||||
@ -19,12 +19,12 @@ import { WorkspaceBuildPage } from "./pages/WorkspaceBuildPage/WorkspaceBuildPag
|
|||||||
import { WorkspacePage } from "./pages/WorkspacePage/WorkspacePage"
|
import { WorkspacePage } from "./pages/WorkspacePage/WorkspacePage"
|
||||||
import { WorkspaceSchedulePage } from "./pages/WorkspaceSchedulePage/WorkspaceSchedulePage"
|
import { WorkspaceSchedulePage } from "./pages/WorkspaceSchedulePage/WorkspaceSchedulePage"
|
||||||
|
|
||||||
const TerminalPage = React.lazy(() => import("./pages/TerminalPage/TerminalPage"))
|
const TerminalPage = lazy(() => import("./pages/TerminalPage/TerminalPage"))
|
||||||
const WorkspacesPage = React.lazy(() => import("./pages/WorkspacesPage/WorkspacesPage"))
|
const WorkspacesPage = lazy(() => import("./pages/WorkspacesPage/WorkspacesPage"))
|
||||||
const CreateWorkspacePage = React.lazy(() => import("./pages/CreateWorkspacePage/CreateWorkspacePage"))
|
const CreateWorkspacePage = lazy(() => import("./pages/CreateWorkspacePage/CreateWorkspacePage"))
|
||||||
|
|
||||||
export const AppRouter: React.FC = () => (
|
export const AppRouter: FC = () => (
|
||||||
<React.Suspense fallback={<></>}>
|
<Suspense fallback={<></>}>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path="/">
|
<Route path="/">
|
||||||
<Route
|
<Route
|
||||||
@ -159,5 +159,5 @@ export const AppRouter: React.FC = () => (
|
|||||||
<Route path="*" element={<NotFoundPage />} />
|
<Route path="*" element={<NotFoundPage />} />
|
||||||
</Route>
|
</Route>
|
||||||
</Routes>
|
</Routes>
|
||||||
</React.Suspense>
|
</Suspense>
|
||||||
)
|
)
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { inspect } from "@xstate/inspect"
|
import { inspect } from "@xstate/inspect"
|
||||||
import React from "react"
|
|
||||||
import ReactDOM from "react-dom"
|
import ReactDOM from "react-dom"
|
||||||
import { Interpreter } from "xstate"
|
import { Interpreter } from "xstate"
|
||||||
import { App } from "./app"
|
import { App } from "./app"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from "react"
|
import { FC } from "react"
|
||||||
|
|
||||||
const ReactMarkdown: React.FC = ({ children }) => {
|
const ReactMarkdown: FC = ({ children }) => {
|
||||||
return <div data-testid="markdown">{children}</div>
|
return <div data-testid="markdown">{children}</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
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 React from "react"
|
import { FC } from "react"
|
||||||
import { BrowserRouter as Router } from "react-router-dom"
|
import { BrowserRouter as Router } from "react-router-dom"
|
||||||
import { SWRConfig } from "swr"
|
import { SWRConfig } from "swr"
|
||||||
import { AppRouter } from "./AppRouter"
|
import { AppRouter } from "./AppRouter"
|
||||||
@ -10,7 +10,7 @@ import { dark } from "./theme"
|
|||||||
import "./theme/globalFonts"
|
import "./theme/globalFonts"
|
||||||
import { XServiceProvider } from "./xServices/StateContext"
|
import { XServiceProvider } from "./xServices/StateContext"
|
||||||
|
|
||||||
export const App: React.FC = () => {
|
export const App: FC = () => {
|
||||||
return (
|
return (
|
||||||
<Router>
|
<Router>
|
||||||
<SWRConfig
|
<SWRConfig
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import React from "react"
|
import { FC } from "react"
|
||||||
import { Footer } from "../Footer/Footer"
|
import { Footer } from "../Footer/Footer"
|
||||||
import { Navbar } from "../Navbar/Navbar"
|
import { Navbar } from "../Navbar/Navbar"
|
||||||
import { RequireAuth } from "../RequireAuth/RequireAuth"
|
import { RequireAuth } from "../RequireAuth/RequireAuth"
|
||||||
@ -10,7 +10,7 @@ interface AuthAndFrameProps {
|
|||||||
/**
|
/**
|
||||||
* Wraps page in RequireAuth and renders it between Navbar and Footer
|
* Wraps page in RequireAuth and renders it between Navbar and Footer
|
||||||
*/
|
*/
|
||||||
export const AuthAndFrame: React.FC<AuthAndFrameProps> = ({ children }) => (
|
export const AuthAndFrame: FC<AuthAndFrameProps> = ({ children }) => (
|
||||||
<RequireAuth>
|
<RequireAuth>
|
||||||
<>
|
<>
|
||||||
<Navbar />
|
<Navbar />
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { AvatarData, AvatarDataProps } from "./AvatarData"
|
import { AvatarData, AvatarDataProps } from "./AvatarData"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import Avatar from "@material-ui/core/Avatar"
|
import Avatar from "@material-ui/core/Avatar"
|
||||||
import Link from "@material-ui/core/Link"
|
import Link from "@material-ui/core/Link"
|
||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
import { Link as RouterLink } from "react-router-dom"
|
import { Link as RouterLink } from "react-router-dom"
|
||||||
import { combineClasses } from "../../util/combineClasses"
|
import { combineClasses } from "../../util/combineClasses"
|
||||||
import { firstLetter } from "../../util/firstLetter"
|
import { firstLetter } from "../../util/firstLetter"
|
||||||
@ -12,7 +12,7 @@ export interface AvatarDataProps {
|
|||||||
link?: string
|
link?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AvatarData: React.FC<AvatarDataProps> = ({ title, subtitle, link }) => {
|
export const AvatarData: FC<AvatarDataProps> = ({ title, subtitle, link }) => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { BorderedMenuRow } from "../BorderedMenuRow/BorderedMenuRow"
|
import { BorderedMenuRow } from "../BorderedMenuRow/BorderedMenuRow"
|
||||||
import { BuildingIcon } from "../Icons/BuildingIcon"
|
import { BuildingIcon } from "../Icons/BuildingIcon"
|
||||||
import { UsersOutlinedIcon } from "../Icons/UsersOutlinedIcon"
|
import { UsersOutlinedIcon } from "../Icons/UsersOutlinedIcon"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import Popover, { PopoverProps } from "@material-ui/core/Popover"
|
import Popover, { PopoverProps } from "@material-ui/core/Popover"
|
||||||
import { fade, makeStyles } from "@material-ui/core/styles"
|
import { fade, makeStyles } from "@material-ui/core/styles"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
|
|
||||||
type BorderedMenuVariant = "admin-dropdown" | "user-dropdown"
|
type BorderedMenuVariant = "admin-dropdown" | "user-dropdown"
|
||||||
|
|
||||||
@ -8,7 +8,7 @@ export type BorderedMenuProps = Omit<PopoverProps, "variant"> & {
|
|||||||
variant?: BorderedMenuVariant
|
variant?: BorderedMenuVariant
|
||||||
}
|
}
|
||||||
|
|
||||||
export const BorderedMenu: React.FC<BorderedMenuProps> = ({ children, variant, ...rest }) => {
|
export const BorderedMenu: FC<BorderedMenuProps> = ({ children, variant, ...rest }) => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -2,7 +2,7 @@ import ListItem from "@material-ui/core/ListItem"
|
|||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import SvgIcon from "@material-ui/core/SvgIcon"
|
import SvgIcon from "@material-ui/core/SvgIcon"
|
||||||
import CheckIcon from "@material-ui/icons/Check"
|
import CheckIcon from "@material-ui/icons/Check"
|
||||||
import React 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 "../../util/ellipsizeText"
|
||||||
import { Typography } from "../Typography/Typography"
|
import { Typography } from "../Typography/Typography"
|
||||||
@ -26,7 +26,7 @@ interface BorderedMenuRowProps {
|
|||||||
onClick?: () => void
|
onClick?: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
export const BorderedMenuRow: React.FC<BorderedMenuRowProps> = ({
|
export const BorderedMenuRow: FC<BorderedMenuRowProps> = ({
|
||||||
active,
|
active,
|
||||||
description,
|
description,
|
||||||
Icon,
|
Icon,
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { ComponentMeta, Story } from "@storybook/react"
|
import { ComponentMeta, Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { MockBuilds } from "../../testHelpers/entities"
|
import { MockBuilds } from "../../testHelpers/entities"
|
||||||
import { BuildsTable, BuildsTableProps } from "./BuildsTable"
|
import { BuildsTable, BuildsTableProps } from "./BuildsTable"
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import TableCell from "@material-ui/core/TableCell"
|
|||||||
import TableHead from "@material-ui/core/TableHead"
|
import TableHead from "@material-ui/core/TableHead"
|
||||||
import TableRow from "@material-ui/core/TableRow"
|
import TableRow from "@material-ui/core/TableRow"
|
||||||
import useTheme from "@material-ui/styles/useTheme"
|
import useTheme from "@material-ui/styles/useTheme"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
import { useNavigate } from "react-router-dom"
|
import { useNavigate } from "react-router-dom"
|
||||||
import * as TypesGen from "../../api/typesGenerated"
|
import * as TypesGen from "../../api/typesGenerated"
|
||||||
import { displayWorkspaceBuildDuration, getDisplayStatus } from "../../util/workspace"
|
import { displayWorkspaceBuildDuration, getDisplayStatus } from "../../util/workspace"
|
||||||
@ -27,7 +27,7 @@ export interface BuildsTableProps {
|
|||||||
className?: string
|
className?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const BuildsTable: React.FC<BuildsTableProps> = ({ builds, className }) => {
|
export const BuildsTable: FC<BuildsTableProps> = ({ builds, className }) => {
|
||||||
const isLoading = !builds
|
const isLoading = !builds
|
||||||
const theme: Theme = useTheme()
|
const theme: Theme = useTheme()
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { CliAuthToken, CliAuthTokenProps } from "./CliAuthToken"
|
import { CliAuthToken, CliAuthTokenProps } from "./CliAuthToken"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { screen } from "@testing-library/react"
|
import { screen } from "@testing-library/react"
|
||||||
import React from "react"
|
|
||||||
import { render } from "../../testHelpers/renderHelpers"
|
import { render } from "../../testHelpers/renderHelpers"
|
||||||
import { CliAuthToken } from "./CliAuthToken"
|
import { CliAuthToken } from "./CliAuthToken"
|
||||||
|
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
import Paper from "@material-ui/core/Paper"
|
import Paper from "@material-ui/core/Paper"
|
||||||
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 React from "react"
|
import { FC } from "react"
|
||||||
import { CodeExample } from "../CodeExample/CodeExample"
|
import { CodeExample } from "../CodeExample/CodeExample"
|
||||||
|
|
||||||
export interface CliAuthTokenProps {
|
export interface CliAuthTokenProps {
|
||||||
sessionToken: string
|
sessionToken: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CliAuthToken: React.FC<CliAuthTokenProps> = ({ sessionToken }) => {
|
export const CliAuthToken: FC<CliAuthTokenProps> = ({ sessionToken }) => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
return (
|
return (
|
||||||
<Paper className={styles.container}>
|
<Paper className={styles.container}>
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { CodeBlock, CodeBlockProps } from "./CodeBlock"
|
import { CodeBlock, CodeBlockProps } from "./CodeBlock"
|
||||||
|
|
||||||
const sampleLines = `Successfully assigned coder/image-jcws7 to cluster-1
|
const sampleLines = `Successfully assigned coder/image-jcws7 to cluster-1
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { screen } from "@testing-library/react"
|
import { screen } from "@testing-library/react"
|
||||||
import React from "react"
|
|
||||||
import { render } from "../../testHelpers/renderHelpers"
|
import { render } from "../../testHelpers/renderHelpers"
|
||||||
import { CodeBlock } from "./CodeBlock"
|
import { CodeBlock } from "./CodeBlock"
|
||||||
|
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import React 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 "../../util/combineClasses"
|
||||||
|
|
||||||
export interface CodeBlockProps {
|
export interface CodeBlockProps {
|
||||||
lines: string[]
|
lines: string[]
|
||||||
ctas?: React.ReactElement[]
|
ctas?: ReactElement[]
|
||||||
className?: string
|
className?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CodeBlock: React.FC<CodeBlockProps> = ({ lines, ctas, className = "" }) => {
|
export const CodeBlock: FC<CodeBlockProps> = ({ lines, ctas, className = "" }) => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -24,7 +24,7 @@ export const CodeBlock: React.FC<CodeBlockProps> = ({ lines, ctas, className = "
|
|||||||
{ctas && ctas.length && (
|
{ctas && ctas.length && (
|
||||||
<div className={styles.ctaBar}>
|
<div className={styles.ctaBar}>
|
||||||
{ctas.map((cta, i) => {
|
{ctas.map((cta, i) => {
|
||||||
return <React.Fragment key={i}>{cta}</React.Fragment>
|
return <Fragment key={i}>{cta}</Fragment>
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { CodeExample, CodeExampleProps } from "./CodeExample"
|
import { CodeExample, CodeExampleProps } from "./CodeExample"
|
||||||
|
|
||||||
const sampleCode = `echo "Hello, world"`
|
const sampleCode = `echo "Hello, world"`
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { screen } from "@testing-library/react"
|
import { screen } from "@testing-library/react"
|
||||||
import React from "react"
|
|
||||||
import { render } from "../../testHelpers/renderHelpers"
|
import { render } from "../../testHelpers/renderHelpers"
|
||||||
import { CodeExample } from "./CodeExample"
|
import { CodeExample } from "./CodeExample"
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"
|
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"
|
||||||
import { CopyButton } from "../CopyButton/CopyButton"
|
import { CopyButton } from "../CopyButton/CopyButton"
|
||||||
|
|
||||||
@ -10,7 +10,7 @@ export interface CodeExampleProps {
|
|||||||
/**
|
/**
|
||||||
* Component to show single-line code examples, with a copy button
|
* Component to show single-line code examples, with a copy button
|
||||||
*/
|
*/
|
||||||
export const CodeExample: React.FC<CodeExampleProps> = ({ code }) => {
|
export const CodeExample: FC<CodeExampleProps> = ({ code }) => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { ComponentMeta, Story } from "@storybook/react"
|
import { ComponentMeta, Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { ConfirmDialog, ConfirmDialogProps } from "./ConfirmDialog"
|
import { ConfirmDialog, ConfirmDialogProps } from "./ConfirmDialog"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { fireEvent, render } from "@testing-library/react"
|
import { fireEvent, render } from "@testing-library/react"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
import { act } from "react-dom/test-utils"
|
import { act } from "react-dom/test-utils"
|
||||||
import { WrapperComponent } from "../../testHelpers/renderHelpers"
|
import { WrapperComponent } from "../../testHelpers/renderHelpers"
|
||||||
import { ConfirmDialog, ConfirmDialogProps } from "./ConfirmDialog"
|
import { ConfirmDialog, ConfirmDialogProps } from "./ConfirmDialog"
|
||||||
|
|
||||||
namespace Helpers {
|
namespace Helpers {
|
||||||
export const Component: React.FC<ConfirmDialogProps> = (props: ConfirmDialogProps) => {
|
export const Component: FC<ConfirmDialogProps> = (props: ConfirmDialogProps) => {
|
||||||
return (
|
return (
|
||||||
<WrapperComponent>
|
<WrapperComponent>
|
||||||
<ConfirmDialog {...props} />
|
<ConfirmDialog {...props} />
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { action } from "@storybook/addon-actions"
|
import { action } from "@storybook/addon-actions"
|
||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { CreateUserForm, CreateUserFormProps } from "./CreateUserForm"
|
import { CreateUserForm, CreateUserFormProps } from "./CreateUserForm"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import FormHelperText from "@material-ui/core/FormHelperText"
|
import FormHelperText from "@material-ui/core/FormHelperText"
|
||||||
import TextField from "@material-ui/core/TextField"
|
import TextField from "@material-ui/core/TextField"
|
||||||
import { FormikContextType, FormikErrors, useFormik } from "formik"
|
import { FormikContextType, FormikErrors, useFormik } from "formik"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
import * as Yup from "yup"
|
import * as Yup from "yup"
|
||||||
import * as TypesGen from "../../api/typesGenerated"
|
import * as TypesGen from "../../api/typesGenerated"
|
||||||
import { getFormHelpers, nameValidator, onChangeTrimmed } from "../../util/formUtils"
|
import { getFormHelpers, nameValidator, onChangeTrimmed } from "../../util/formUtils"
|
||||||
@ -34,7 +34,7 @@ const validationSchema = Yup.object({
|
|||||||
username: nameValidator(Language.usernameLabel),
|
username: nameValidator(Language.usernameLabel),
|
||||||
})
|
})
|
||||||
|
|
||||||
export const CreateUserForm: React.FC<CreateUserFormProps> = ({
|
export const CreateUserForm: FC<CreateUserFormProps> = ({
|
||||||
onSubmit,
|
onSubmit,
|
||||||
onCancel,
|
onCancel,
|
||||||
formErrors,
|
formErrors,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { fade, makeStyles, Theme } from "@material-ui/core/styles"
|
import { fade, makeStyles, Theme } from "@material-ui/core/styles"
|
||||||
import KeyboardArrowDown from "@material-ui/icons/KeyboardArrowDown"
|
import KeyboardArrowDown from "@material-ui/icons/KeyboardArrowDown"
|
||||||
import KeyboardArrowUp from "@material-ui/icons/KeyboardArrowUp"
|
import KeyboardArrowUp from "@material-ui/icons/KeyboardArrowUp"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) => ({
|
const useStyles = makeStyles((theme: Theme) => ({
|
||||||
arrowIcon: {
|
arrowIcon: {
|
||||||
@ -15,12 +15,12 @@ const useStyles = makeStyles((theme: Theme) => ({
|
|||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
|
|
||||||
export const OpenDropdown: React.FC = () => {
|
export const OpenDropdown: FC = () => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
return <KeyboardArrowDown className={styles.arrowIcon} />
|
return <KeyboardArrowDown className={styles.arrowIcon} />
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CloseDropdown: React.FC = () => {
|
export const CloseDropdown: FC = () => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
return <KeyboardArrowUp className={`${styles.arrowIcon} ${styles.arrowIconUp}`} />
|
return <KeyboardArrowUp className={`${styles.arrowIcon} ${styles.arrowIconUp}`} />
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { screen } from "@testing-library/react"
|
import { screen } from "@testing-library/react"
|
||||||
import React from "react"
|
|
||||||
import { render } from "../../testHelpers/renderHelpers"
|
import { render } from "../../testHelpers/renderHelpers"
|
||||||
import { EmptyState } from "./EmptyState"
|
import { EmptyState } from "./EmptyState"
|
||||||
|
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
import Box from "@material-ui/core/Box"
|
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 React from "react"
|
import { FC, ReactNode } from "react"
|
||||||
|
|
||||||
export interface EmptyStateProps {
|
export interface EmptyStateProps {
|
||||||
/** Text Message to display, placed inside Typography component */
|
/** Text Message to display, placed inside Typography component */
|
||||||
message: string
|
message: string
|
||||||
/** Longer optional description to display below the message */
|
/** Longer optional description to display below the message */
|
||||||
description?: string
|
description?: string
|
||||||
cta?: React.ReactNode
|
cta?: ReactNode
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -19,7 +19,7 @@ export interface EmptyStateProps {
|
|||||||
* EmptyState's props extend the [Material UI Box component](https://material-ui.com/components/box/)
|
* EmptyState's props extend the [Material UI Box component](https://material-ui.com/components/box/)
|
||||||
* that you can directly pass props through to to customize the shape and layout of it.
|
* that you can directly pass props through to to customize the shape and layout of it.
|
||||||
*/
|
*/
|
||||||
export const EmptyState: React.FC<EmptyStateProps> = (props) => {
|
export const EmptyState: FC<EmptyStateProps> = (props) => {
|
||||||
const { message, description, cta, ...boxProps } = props
|
const { message, description, cta, ...boxProps } = props
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { EnterpriseSnackbar, EnterpriseSnackbarProps } from "./EnterpriseSnackbar"
|
import { EnterpriseSnackbar, EnterpriseSnackbarProps } from "./EnterpriseSnackbar"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -2,7 +2,7 @@ import IconButton from "@material-ui/core/IconButton"
|
|||||||
import Snackbar, { SnackbarProps as MuiSnackbarProps } from "@material-ui/core/Snackbar"
|
import Snackbar, { SnackbarProps as MuiSnackbarProps } from "@material-ui/core/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 React from "react"
|
import { FC } from "react"
|
||||||
import { combineClasses } from "../../util/combineClasses"
|
import { combineClasses } from "../../util/combineClasses"
|
||||||
|
|
||||||
type EnterpriseSnackbarVariant = "error" | "info"
|
type EnterpriseSnackbarVariant = "error" | "info"
|
||||||
@ -25,7 +25,7 @@ export interface EnterpriseSnackbarProps extends MuiSnackbarProps {
|
|||||||
*
|
*
|
||||||
* See original component's Material UI documentation here: https://material-ui.com/components/snackbars/
|
* See original component's Material UI documentation here: https://material-ui.com/components/snackbars/
|
||||||
*/
|
*/
|
||||||
export const EnterpriseSnackbar: React.FC<EnterpriseSnackbarProps> = ({
|
export const EnterpriseSnackbar: FC<EnterpriseSnackbarProps> = ({
|
||||||
onClose,
|
onClose,
|
||||||
variant = "info",
|
variant = "info",
|
||||||
ContentProps = {},
|
ContentProps = {},
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import React from "react"
|
import { Component, ReactNode } from "react"
|
||||||
import { RuntimeErrorState } from "../RuntimeErrorState/RuntimeErrorState"
|
import { RuntimeErrorState } from "../RuntimeErrorState/RuntimeErrorState"
|
||||||
|
|
||||||
type ErrorBoundaryProps = Record<string, unknown>
|
type ErrorBoundaryProps = Record<string, unknown>
|
||||||
@ -11,7 +11,7 @@ interface ErrorBoundaryState {
|
|||||||
* Our app's Error Boundary
|
* Our app's Error Boundary
|
||||||
* Read more about React Error Boundaries: https://reactjs.org/docs/error-boundaries.html
|
* Read more about React Error Boundaries: https://reactjs.org/docs/error-boundaries.html
|
||||||
*/
|
*/
|
||||||
export class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
export class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
||||||
constructor(props: ErrorBoundaryProps) {
|
constructor(props: ErrorBoundaryProps) {
|
||||||
super(props)
|
super(props)
|
||||||
this.state = { error: null }
|
this.state = { error: null }
|
||||||
@ -21,7 +21,7 @@ export class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoun
|
|||||||
return { error }
|
return { error }
|
||||||
}
|
}
|
||||||
|
|
||||||
render(): React.ReactNode {
|
render(): ReactNode {
|
||||||
if (this.state.error) {
|
if (this.state.error) {
|
||||||
return <RuntimeErrorState error={this.state.error} />
|
return <RuntimeErrorState error={this.state.error} />
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { action } from "@storybook/addon-actions"
|
import { action } from "@storybook/addon-actions"
|
||||||
import { ComponentMeta, Story } from "@storybook/react"
|
import { ComponentMeta, Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { ErrorSummary, ErrorSummaryProps } from "./ErrorSummary"
|
import { ErrorSummary, ErrorSummaryProps } from "./ErrorSummary"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { render, screen } from "@testing-library/react"
|
import { render, screen } from "@testing-library/react"
|
||||||
import React from "react"
|
|
||||||
import { ErrorSummary } from "./ErrorSummary"
|
import { ErrorSummary } from "./ErrorSummary"
|
||||||
|
|
||||||
describe("ErrorSummary", () => {
|
describe("ErrorSummary", () => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import Button from "@material-ui/core/Button"
|
import Button from "@material-ui/core/Button"
|
||||||
import RefreshIcon from "@material-ui/icons/Refresh"
|
import RefreshIcon from "@material-ui/icons/Refresh"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
import { Stack } from "../Stack/Stack"
|
import { Stack } from "../Stack/Stack"
|
||||||
|
|
||||||
const Language = {
|
const Language = {
|
||||||
@ -13,7 +13,7 @@ export interface ErrorSummaryProps {
|
|||||||
retry?: () => void
|
retry?: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ErrorSummary: React.FC<ErrorSummaryProps> = ({ error, retry }) => (
|
export const ErrorSummary: FC<ErrorSummaryProps> = ({ error, retry }) => (
|
||||||
<Stack>
|
<Stack>
|
||||||
{!(error instanceof Error) ? <div>{Language.unknownErrorMessage}</div> : <div>{error.toString()}</div>}
|
{!(error instanceof Error) ? <div>{Language.unknownErrorMessage}</div> : <div>{error.toString()}</div>}
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { screen } from "@testing-library/react"
|
import { screen } from "@testing-library/react"
|
||||||
import React from "react"
|
|
||||||
import { MockBuildInfo, render } from "../../testHelpers/renderHelpers"
|
import { MockBuildInfo, render } from "../../testHelpers/renderHelpers"
|
||||||
import { Footer, Language } from "./Footer"
|
import { Footer, Language } from "./Footer"
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { FormCloseButton, FormCloseButtonProps } from "./FormCloseButton"
|
import { FormCloseButton, FormCloseButtonProps } from "./FormCloseButton"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { fireEvent, render, screen } from "@testing-library/react"
|
import { fireEvent, render, screen } from "@testing-library/react"
|
||||||
import React from "react"
|
|
||||||
import { FormCloseButton } from "./FormCloseButton"
|
import { FormCloseButton } from "./FormCloseButton"
|
||||||
|
|
||||||
describe("FormCloseButton", () => {
|
describe("FormCloseButton", () => {
|
||||||
|
@ -2,7 +2,7 @@ import Box from "@material-ui/core/Box"
|
|||||||
import MenuItem from "@material-ui/core/MenuItem"
|
import MenuItem from "@material-ui/core/MenuItem"
|
||||||
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 React from "react"
|
import { ReactElement } from "react"
|
||||||
import { FormTextField, FormTextFieldProps } from "../FormTextField/FormTextField"
|
import { FormTextField, FormTextFieldProps } from "../FormTextField/FormTextField"
|
||||||
|
|
||||||
export interface FormDropdownItem {
|
export interface FormDropdownItem {
|
||||||
@ -15,7 +15,7 @@ export interface FormDropdownFieldProps<T> extends FormTextFieldProps<T> {
|
|||||||
items: FormDropdownItem[]
|
items: FormDropdownItem[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export const FormDropdownField = <T,>({ items, ...props }: FormDropdownFieldProps<T>): React.ReactElement => {
|
export const FormDropdownField = <T,>({ items, ...props }: FormDropdownFieldProps<T>): ReactElement => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
return (
|
return (
|
||||||
<FormTextField select {...props}>
|
<FormTextField select {...props}>
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { ComponentMeta, Story } from "@storybook/react"
|
import { ComponentMeta, Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { FormFooter, FormFooterProps } from "./FormFooter"
|
import { FormFooter, FormFooterProps } from "./FormFooter"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import Button from "@material-ui/core/Button"
|
import Button from "@material-ui/core/Button"
|
||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
import { LoadingButton } from "../LoadingButton/LoadingButton"
|
import { LoadingButton } from "../LoadingButton/LoadingButton"
|
||||||
|
|
||||||
export const Language = {
|
export const Language = {
|
||||||
@ -27,11 +27,7 @@ const useStyles = makeStyles(() => ({
|
|||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
|
|
||||||
export const FormFooter: React.FC<FormFooterProps> = ({
|
export const FormFooter: FC<FormFooterProps> = ({ onCancel, isLoading, submitLabel = Language.defaultSubmitLabel }) => {
|
||||||
onCancel,
|
|
||||||
isLoading,
|
|
||||||
submitLabel = Language.defaultSubmitLabel,
|
|
||||||
}) => {
|
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
return (
|
return (
|
||||||
<div className={styles.footer}>
|
<div className={styles.footer}>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
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 React from "react"
|
import { FC } from "react"
|
||||||
|
|
||||||
export interface FormSectionProps {
|
export interface FormSectionProps {
|
||||||
title: string
|
title: string
|
||||||
@ -39,7 +39,7 @@ export const useStyles = makeStyles((theme) => ({
|
|||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
|
|
||||||
export const FormSection: React.FC<FormSectionProps> = ({ title, description, children }) => {
|
export const FormSection: FC<FormSectionProps> = ({ title, description, children }) => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { act, fireEvent, render, screen } from "@testing-library/react"
|
import { act, fireEvent, render, screen } from "@testing-library/react"
|
||||||
import { useFormik } from "formik"
|
import { useFormik } from "formik"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
import * as yup from "yup"
|
import * as yup from "yup"
|
||||||
import { FormTextField, FormTextFieldProps } from "./FormTextField"
|
import { FormTextField, FormTextFieldProps } from "./FormTextField"
|
||||||
|
|
||||||
@ -11,7 +11,7 @@ namespace Helpers {
|
|||||||
|
|
||||||
export const requiredValidationMsg = "required"
|
export const requiredValidationMsg = "required"
|
||||||
|
|
||||||
export const Component: React.FC<Omit<FormTextFieldProps<FormValues>, "form" | "formFieldName">> = (props) => {
|
export const Component: FC<Omit<FormTextFieldProps<FormValues>, "form" | "formFieldName">> = (props) => {
|
||||||
const form = useFormik<FormValues>({
|
const form = useFormik<FormValues>({
|
||||||
initialValues: {
|
initialValues: {
|
||||||
name: "",
|
name: "",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import TextField, { TextFieldProps } from "@material-ui/core/TextField"
|
import TextField, { TextFieldProps } from "@material-ui/core/TextField"
|
||||||
import { FormikContextType } from "formik"
|
import { FormikContextType } from "formik"
|
||||||
import React from "react"
|
import { ReactElement } from "react"
|
||||||
import { PasswordField } from "../PasswordField/PasswordField"
|
import { PasswordField } from "../PasswordField/PasswordField"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -118,7 +118,7 @@ export const FormTextField = <T,>({
|
|||||||
type,
|
type,
|
||||||
variant = "outlined",
|
variant = "outlined",
|
||||||
...rest
|
...rest
|
||||||
}: FormTextFieldProps<T>): React.ReactElement => {
|
}: FormTextFieldProps<T>): ReactElement => {
|
||||||
const isError = form.touched[formFieldName] && Boolean(form.errors[formFieldName])
|
const isError = form.touched[formFieldName] && Boolean(form.errors[formFieldName])
|
||||||
|
|
||||||
// Conversion to a string primitive is necessary as formFieldName is an in
|
// Conversion to a string primitive is necessary as formFieldName is an in
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
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 React from "react"
|
import { FC, ReactNode } from "react"
|
||||||
|
|
||||||
export interface FormTitleProps {
|
export interface FormTitleProps {
|
||||||
title: string
|
title: string
|
||||||
detail?: React.ReactNode
|
detail?: ReactNode
|
||||||
}
|
}
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
@ -19,7 +19,7 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
|
|
||||||
export const FormTitle: React.FC<FormTitleProps> = ({ title, detail }) => {
|
export const FormTitle: FC<FormTitleProps> = ({ title, detail }) => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import TextField from "@material-ui/core/TextField"
|
import TextField from "@material-ui/core/TextField"
|
||||||
import { action } from "@storybook/addon-actions"
|
import { action } from "@storybook/addon-actions"
|
||||||
import { ComponentMeta, Story } from "@storybook/react"
|
import { ComponentMeta, Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { FormFooter } from "../FormFooter/FormFooter"
|
import { FormFooter } from "../FormFooter/FormFooter"
|
||||||
import { Stack } from "../Stack/Stack"
|
import { Stack } from "../Stack/Stack"
|
||||||
import { FullPageForm, FullPageFormProps } from "./FullPageForm"
|
import { FullPageForm, FullPageFormProps } from "./FullPageForm"
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import React from "react"
|
import { FC, ReactNode } from "react"
|
||||||
import { FormCloseButton } from "../FormCloseButton/FormCloseButton"
|
import { FormCloseButton } from "../FormCloseButton/FormCloseButton"
|
||||||
import { FormTitle } from "../FormTitle/FormTitle"
|
import { FormTitle } from "../FormTitle/FormTitle"
|
||||||
import { Margins } from "../Margins/Margins"
|
import { Margins } from "../Margins/Margins"
|
||||||
|
|
||||||
export interface FullPageFormProps {
|
export interface FullPageFormProps {
|
||||||
title: string
|
title: string
|
||||||
detail?: React.ReactNode
|
detail?: ReactNode
|
||||||
onCancel: () => void
|
onCancel: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ const useStyles = makeStyles(() => ({
|
|||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
|
|
||||||
export const FullPageForm: React.FC<FullPageFormProps> = ({ title, detail, onCancel, children }) => {
|
export const FullPageForm: FC<FullPageFormProps> = ({ title, detail, onCancel, children }) => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
return (
|
return (
|
||||||
<main className={styles.root}>
|
<main className={styles.root}>
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { BuildingIcon } from "./BuildingIcon"
|
import { BuildingIcon } from "./BuildingIcon"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import SvgIcon, { SvgIconProps } from "@material-ui/core/SvgIcon"
|
import SvgIcon, { SvgIconProps } from "@material-ui/core/SvgIcon"
|
||||||
import React from "react"
|
|
||||||
|
|
||||||
export const BuildingIcon = (props: SvgIconProps): JSX.Element => (
|
export const BuildingIcon = (props: SvgIconProps): JSX.Element => (
|
||||||
<SvgIcon {...props} viewBox="0 0 24 24">
|
<SvgIcon {...props} viewBox="0 0 24 24">
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { CloseIcon } from "./CloseIcon"
|
import { CloseIcon } from "./CloseIcon"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import SvgIcon from "@material-ui/core/SvgIcon"
|
import SvgIcon from "@material-ui/core/SvgIcon"
|
||||||
import React from "react"
|
|
||||||
|
|
||||||
export const CloseIcon: typeof SvgIcon = (props) => (
|
export const CloseIcon: typeof SvgIcon = (props) => (
|
||||||
<SvgIcon {...props} viewBox="0 0 31 31">
|
<SvgIcon {...props} viewBox="0 0 31 31">
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { CoderIcon } from "./CoderIcon"
|
import { CoderIcon } from "./CoderIcon"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import SvgIcon, { SvgIconProps } from "@material-ui/core/SvgIcon"
|
import SvgIcon, { SvgIconProps } from "@material-ui/core/SvgIcon"
|
||||||
import React from "react"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CoderIcon represents the cloud with brackets Coder brand icon. It does not
|
* CoderIcon represents the cloud with brackets Coder brand icon. It does not
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { DocsIcon } from "./DocsIcon"
|
import { DocsIcon } from "./DocsIcon"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import SvgIcon, { SvgIconProps } from "@material-ui/core/SvgIcon"
|
import SvgIcon, { SvgIconProps } from "@material-ui/core/SvgIcon"
|
||||||
import React from "react"
|
|
||||||
|
|
||||||
export const DocsIcon = (props: SvgIconProps): JSX.Element => (
|
export const DocsIcon = (props: SvgIconProps): JSX.Element => (
|
||||||
<SvgIcon {...props} viewBox="0 0 24 24">
|
<SvgIcon {...props} viewBox="0 0 24 24">
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { ErrorIcon } from "./ErrorIcon"
|
import { ErrorIcon } from "./ErrorIcon"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import SvgIcon, { SvgIconProps } from "@material-ui/core/SvgIcon"
|
import SvgIcon, { SvgIconProps } from "@material-ui/core/SvgIcon"
|
||||||
import React from "react"
|
|
||||||
|
|
||||||
export const ErrorIcon = (props: SvgIconProps): JSX.Element => (
|
export const ErrorIcon = (props: SvgIconProps): JSX.Element => (
|
||||||
<SvgIcon {...props} viewBox="0 0 24 24">
|
<SvgIcon {...props} viewBox="0 0 24 24">
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { FileCopyIcon } from "./FileCopyIcon"
|
import { FileCopyIcon } from "./FileCopyIcon"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import SvgIcon from "@material-ui/core/SvgIcon"
|
import SvgIcon from "@material-ui/core/SvgIcon"
|
||||||
import React from "react"
|
|
||||||
|
|
||||||
export const FileCopyIcon: typeof SvgIcon = (props) => (
|
export const FileCopyIcon: typeof SvgIcon = (props) => (
|
||||||
<SvgIcon {...props} viewBox="0 0 20 20">
|
<SvgIcon {...props} viewBox="0 0 20 20">
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { Logo } from "./Logo"
|
import { Logo } from "./Logo"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { LogoutIcon } from "./LogoutIcon"
|
import { LogoutIcon } from "./LogoutIcon"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import SvgIcon, { SvgIconProps } from "@material-ui/core/SvgIcon"
|
import SvgIcon, { SvgIconProps } from "@material-ui/core/SvgIcon"
|
||||||
import React from "react"
|
|
||||||
|
|
||||||
export const LogoutIcon = (props: SvgIconProps): JSX.Element => (
|
export const LogoutIcon = (props: SvgIconProps): JSX.Element => (
|
||||||
<SvgIcon {...props} viewBox="0 0 20 20">
|
<SvgIcon {...props} viewBox="0 0 20 20">
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import SvgIcon from "@material-ui/core/SvgIcon"
|
import SvgIcon from "@material-ui/core/SvgIcon"
|
||||||
import React from "react"
|
|
||||||
|
|
||||||
export const SearchIcon: typeof SvgIcon = (props) => (
|
export const SearchIcon: typeof SvgIcon = (props) => (
|
||||||
<SvgIcon {...props} viewBox="0 0 16 16">
|
<SvgIcon {...props} viewBox="0 0 16 16">
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { UsersOutlinedIcon } from "./UsersOutlinedIcon"
|
import { UsersOutlinedIcon } from "./UsersOutlinedIcon"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import SvgIcon from "@material-ui/core/SvgIcon"
|
import SvgIcon from "@material-ui/core/SvgIcon"
|
||||||
import React from "react"
|
|
||||||
|
|
||||||
export const UsersOutlinedIcon: typeof SvgIcon = (props) => (
|
export const UsersOutlinedIcon: typeof SvgIcon = (props) => (
|
||||||
<SvgIcon {...props} viewBox="0 0 20 20">
|
<SvgIcon {...props} viewBox="0 0 20 20">
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { WorkspacesIcon } from "./WorkspacesIcon"
|
import { WorkspacesIcon } from "./WorkspacesIcon"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import SvgIcon from "@material-ui/core/SvgIcon"
|
import SvgIcon from "@material-ui/core/SvgIcon"
|
||||||
import React from "react"
|
|
||||||
|
|
||||||
export const WorkspacesIcon: typeof SvgIcon = (props) => (
|
export const WorkspacesIcon: typeof SvgIcon = (props) => (
|
||||||
<SvgIcon {...props} viewBox="0 0 16 16">
|
<SvgIcon {...props} viewBox="0 0 16 16">
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { render, screen } from "@testing-library/react"
|
import { render, screen } from "@testing-library/react"
|
||||||
import React from "react"
|
|
||||||
import { FullScreenLoader } from "./FullScreenLoader"
|
import { FullScreenLoader } from "./FullScreenLoader"
|
||||||
|
|
||||||
describe("FullScreenLoader", () => {
|
describe("FullScreenLoader", () => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import CircularProgress from "@material-ui/core/CircularProgress"
|
import CircularProgress from "@material-ui/core/CircularProgress"
|
||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
|
|
||||||
export const useStyles = makeStyles((theme) => ({
|
export const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
@ -16,7 +16,7 @@ export const useStyles = makeStyles((theme) => ({
|
|||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
|
|
||||||
export const FullScreenLoader: React.FC = () => {
|
export const FullScreenLoader: FC = () => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import Box from "@material-ui/core/Box"
|
import Box from "@material-ui/core/Box"
|
||||||
import CircularProgress from "@material-ui/core/CircularProgress"
|
import CircularProgress from "@material-ui/core/CircularProgress"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
|
|
||||||
export const Loader: React.FC<{ size?: number }> = ({ size = 26 }) => {
|
export const Loader: FC<{ size?: number }> = ({ size = 26 }) => {
|
||||||
return (
|
return (
|
||||||
<Box p={4} width="100%" display="flex" alignItems="center" justifyContent="center">
|
<Box p={4} width="100%" display="flex" alignItems="center" justifyContent="center">
|
||||||
<CircularProgress size={size} />
|
<CircularProgress size={size} />
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { LoadingButton, LoadingButtonProps } from "./LoadingButton"
|
import { LoadingButton, LoadingButtonProps } from "./LoadingButton"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { render, screen } from "@testing-library/react"
|
import { render, screen } from "@testing-library/react"
|
||||||
import React from "react"
|
|
||||||
import { LoadingButton } from "./LoadingButton"
|
import { LoadingButton } from "./LoadingButton"
|
||||||
|
|
||||||
describe("LoadingButton", () => {
|
describe("LoadingButton", () => {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { ComponentMeta, Story } from "@storybook/react"
|
import { ComponentMeta, Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { MockWorkspaceBuildLogs } from "../../testHelpers/entities"
|
import { MockWorkspaceBuildLogs } from "../../testHelpers/entities"
|
||||||
import { Logs, LogsProps } from "./Logs"
|
import { Logs, LogsProps } from "./Logs"
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import dayjs from "dayjs"
|
import dayjs from "dayjs"
|
||||||
import React 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 "../../util/combineClasses"
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ export interface LogsProps {
|
|||||||
className?: string
|
className?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Logs: React.FC<LogsProps> = ({ lines, className = "" }) => {
|
export const Logs: FC<LogsProps> = ({ lines, className = "" }) => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { ComponentMeta, Story } from "@storybook/react"
|
import { ComponentMeta, Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { Margins } from "./Margins"
|
import { Margins } from "./Margins"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
import { maxWidth, sidePadding } from "../../theme/constants"
|
import { maxWidth, sidePadding } from "../../theme/constants"
|
||||||
|
|
||||||
const useStyles = makeStyles(() => ({
|
const useStyles = makeStyles(() => ({
|
||||||
@ -12,7 +12,7 @@ const useStyles = makeStyles(() => ({
|
|||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
|
|
||||||
export const Margins: React.FC = ({ children }) => {
|
export const Margins: FC = ({ children }) => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
return <div className={styles.margins}>{children}</div>
|
return <div className={styles.margins}>{children}</div>
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { MockUser, MockUser2 } from "../../testHelpers/entities"
|
import { MockUser, MockUser2 } from "../../testHelpers/entities"
|
||||||
import { NavbarView, NavbarViewProps } from "./NavbarView"
|
import { NavbarView, NavbarViewProps } from "./NavbarView"
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { screen } from "@testing-library/react"
|
import { screen } from "@testing-library/react"
|
||||||
import React from "react"
|
|
||||||
import { MockUser } from "../../testHelpers/entities"
|
import { MockUser } from "../../testHelpers/entities"
|
||||||
import { render } from "../../testHelpers/renderHelpers"
|
import { render } from "../../testHelpers/renderHelpers"
|
||||||
import { Language as navLanguage, NavbarView } from "./NavbarView"
|
import { Language as navLanguage, NavbarView } from "./NavbarView"
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import List from "@material-ui/core/List"
|
import List from "@material-ui/core/List"
|
||||||
import ListItem from "@material-ui/core/ListItem"
|
import ListItem from "@material-ui/core/ListItem"
|
||||||
import { fade, makeStyles } from "@material-ui/core/styles"
|
import { fade, makeStyles } from "@material-ui/core/styles"
|
||||||
import React from "react"
|
|
||||||
import { NavLink } from "react-router-dom"
|
import { NavLink } from "react-router-dom"
|
||||||
import * as TypesGen from "../../api/typesGenerated"
|
import * as TypesGen from "../../api/typesGenerated"
|
||||||
import { navHeight } from "../../theme/constants"
|
import { navHeight } from "../../theme/constants"
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { ParameterSchema } from "../../api/typesGenerated"
|
import { ParameterSchema } from "../../api/typesGenerated"
|
||||||
import { ParameterInput, ParameterInputProps } from "./ParameterInput"
|
import { ParameterInput, ParameterInputProps } from "./ParameterInput"
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import Radio from "@material-ui/core/Radio"
|
|||||||
import RadioGroup from "@material-ui/core/RadioGroup"
|
import RadioGroup from "@material-ui/core/RadioGroup"
|
||||||
import { lighten, makeStyles } from "@material-ui/core/styles"
|
import { lighten, makeStyles } from "@material-ui/core/styles"
|
||||||
import TextField from "@material-ui/core/TextField"
|
import TextField from "@material-ui/core/TextField"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
import { ParameterSchema } from "../../api/typesGenerated"
|
import { ParameterSchema } from "../../api/typesGenerated"
|
||||||
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"
|
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ export interface ParameterInputProps {
|
|||||||
onChange: (value: string) => void
|
onChange: (value: string) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ParameterInput: React.FC<ParameterInputProps> = ({ disabled, onChange, schema }) => {
|
export const ParameterInput: FC<ParameterInputProps> = ({ disabled, onChange, schema }) => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
return (
|
return (
|
||||||
<Paper className={styles.paper}>
|
<Paper className={styles.paper}>
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { render, screen } from "@testing-library/react"
|
import { render, screen } from "@testing-library/react"
|
||||||
import React from "react"
|
|
||||||
import { PasswordField } from "./PasswordField"
|
import { PasswordField } from "./PasswordField"
|
||||||
|
|
||||||
describe("PasswordField", () => {
|
describe("PasswordField", () => {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { MockUser } from "../../testHelpers/renderHelpers"
|
import { MockUser } from "../../testHelpers/renderHelpers"
|
||||||
import { ResetPasswordDialog, ResetPasswordDialogProps } from "./ResetPasswordDialog"
|
import { ResetPasswordDialog, ResetPasswordDialogProps } from "./ResetPasswordDialog"
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import DialogActions from "@material-ui/core/DialogActions"
|
|||||||
import DialogContent from "@material-ui/core/DialogContent"
|
import DialogContent from "@material-ui/core/DialogContent"
|
||||||
import DialogContentText from "@material-ui/core/DialogContentText"
|
import DialogContentText from "@material-ui/core/DialogContentText"
|
||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
import * as TypesGen from "../../api/typesGenerated"
|
import * as TypesGen from "../../api/typesGenerated"
|
||||||
import { CodeBlock } from "../CodeBlock/CodeBlock"
|
import { CodeBlock } from "../CodeBlock/CodeBlock"
|
||||||
import { Dialog, DialogActionButtons, DialogTitle } from "../Dialog/Dialog"
|
import { Dialog, DialogActionButtons, DialogTitle } from "../Dialog/Dialog"
|
||||||
@ -26,7 +26,7 @@ export const Language = {
|
|||||||
confirmText: "Reset password",
|
confirmText: "Reset password",
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ResetPasswordDialog: React.FC<ResetPasswordDialogProps> = ({
|
export const ResetPasswordDialog: FC<ResetPasswordDialogProps> = ({
|
||||||
open,
|
open,
|
||||||
onClose,
|
onClose,
|
||||||
onConfirm,
|
onConfirm,
|
||||||
|
@ -5,7 +5,7 @@ import TableCell from "@material-ui/core/TableCell"
|
|||||||
import TableHead from "@material-ui/core/TableHead"
|
import TableHead from "@material-ui/core/TableHead"
|
||||||
import TableRow from "@material-ui/core/TableRow"
|
import TableRow from "@material-ui/core/TableRow"
|
||||||
import useTheme from "@material-ui/styles/useTheme"
|
import useTheme from "@material-ui/styles/useTheme"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
import { Workspace, WorkspaceResource } from "../../api/typesGenerated"
|
import { Workspace, WorkspaceResource } from "../../api/typesGenerated"
|
||||||
import { getDisplayAgentStatus } from "../../util/workspace"
|
import { getDisplayAgentStatus } from "../../util/workspace"
|
||||||
import { TableHeaderRow } from "../TableHeaders/TableHeaders"
|
import { TableHeaderRow } from "../TableHeaders/TableHeaders"
|
||||||
@ -27,7 +27,7 @@ interface ResourcesProps {
|
|||||||
workspace: Workspace
|
workspace: Workspace
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Resources: React.FC<ResourcesProps> = ({ resources, getResourcesError, workspace }) => {
|
export const Resources: FC<ResourcesProps> = ({ resources, getResourcesError, workspace }) => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
const theme: Theme = useTheme()
|
const theme: Theme = useTheme()
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { ComponentMeta, Story } from "@storybook/react"
|
import { ComponentMeta, Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { MockAdminRole, MockMemberRole, MockSiteRoles } from "../../testHelpers/renderHelpers"
|
import { MockAdminRole, MockMemberRole, MockSiteRoles } from "../../testHelpers/renderHelpers"
|
||||||
import { RoleSelect, RoleSelectProps } from "./RoleSelect"
|
import { RoleSelect, RoleSelectProps } from "./RoleSelect"
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import Checkbox from "@material-ui/core/Checkbox"
|
|||||||
import MenuItem from "@material-ui/core/MenuItem"
|
import MenuItem from "@material-ui/core/MenuItem"
|
||||||
import Select from "@material-ui/core/Select"
|
import Select from "@material-ui/core/Select"
|
||||||
import { makeStyles, Theme } from "@material-ui/core/styles"
|
import { makeStyles, Theme } from "@material-ui/core/styles"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
import { Role } from "../../api/typesGenerated"
|
import { Role } from "../../api/typesGenerated"
|
||||||
|
|
||||||
export const Language = {
|
export const Language = {
|
||||||
@ -16,7 +16,7 @@ export interface RoleSelectProps {
|
|||||||
open?: boolean
|
open?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export const RoleSelect: React.FC<RoleSelectProps> = ({ roles, selectedRoles, loading, onChange, open }) => {
|
export const RoleSelect: FC<RoleSelectProps> = ({ roles, selectedRoles, loading, onChange, open }) => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
const value = selectedRoles.map((r) => r.name)
|
const value = selectedRoles.map((r) => r.name)
|
||||||
const renderValue = () => selectedRoles.map((r) => r.display_name).join(", ")
|
const renderValue = () => selectedRoles.map((r) => r.display_name).join(", ")
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import React from "react"
|
import { ReactElement } from "react"
|
||||||
import { CodeBlock } from "../CodeBlock/CodeBlock"
|
import { CodeBlock } from "../CodeBlock/CodeBlock"
|
||||||
import { createCtas } from "./createCtas"
|
import { createCtas } from "./createCtas"
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ export const createFormattedStackTrace = (error: Error, mappedStack: string[] |
|
|||||||
/**
|
/**
|
||||||
* A code block component that contains the error stack resulting from an error boundary trigger
|
* A code block component that contains the error stack resulting from an error boundary trigger
|
||||||
*/
|
*/
|
||||||
export const RuntimeErrorReport = ({ error, mappedStack }: ReportState): React.ReactElement => {
|
export const RuntimeErrorReport = ({ error, mappedStack }: ReportState): ReactElement => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
|
|
||||||
if (!mappedStack) {
|
if (!mappedStack) {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { ComponentMeta, Story } from "@storybook/react"
|
import { ComponentMeta, Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { RuntimeErrorState, RuntimeErrorStateProps } from "./RuntimeErrorState"
|
import { RuntimeErrorState, RuntimeErrorStateProps } from "./RuntimeErrorState"
|
||||||
|
|
||||||
const error = new Error("An error occurred")
|
const error = new Error("An error occurred")
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { screen } from "@testing-library/react"
|
import { screen } from "@testing-library/react"
|
||||||
import React from "react"
|
|
||||||
import { render } from "../../testHelpers/renderHelpers"
|
import { render } from "../../testHelpers/renderHelpers"
|
||||||
import { Language as ButtonLanguage } from "./createCtas"
|
import { Language as ButtonLanguage } from "./createCtas"
|
||||||
import { Language as RuntimeErrorStateLanguage, RuntimeErrorState } from "./RuntimeErrorState"
|
import { Language as RuntimeErrorStateLanguage, RuntimeErrorState } from "./RuntimeErrorState"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import Button from "@material-ui/core/Button"
|
import Button from "@material-ui/core/Button"
|
||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import RefreshIcon from "@material-ui/icons/Refresh"
|
import RefreshIcon from "@material-ui/icons/Refresh"
|
||||||
import React from "react"
|
import { ReactElement } from "react"
|
||||||
import { CopyButton } from "../CopyButton/CopyButton"
|
import { CopyButton } from "../CopyButton/CopyButton"
|
||||||
|
|
||||||
export const Language = {
|
export const Language = {
|
||||||
@ -12,7 +12,7 @@ export const Language = {
|
|||||||
/**
|
/**
|
||||||
* A wrapper component for a full-width copy button
|
* A wrapper component for a full-width copy button
|
||||||
*/
|
*/
|
||||||
const CopyStackButton = ({ text }: { text: string }): React.ReactElement => {
|
const CopyStackButton = ({ text }: { text: string }): ReactElement => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -28,7 +28,7 @@ const CopyStackButton = ({ text }: { text: string }): React.ReactElement => {
|
|||||||
/**
|
/**
|
||||||
* A button that reloads our application
|
* A button that reloads our application
|
||||||
*/
|
*/
|
||||||
const ReloadAppButton = (): React.ReactElement => {
|
const ReloadAppButton = (): ReactElement => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -47,7 +47,7 @@ const ReloadAppButton = (): React.ReactElement => {
|
|||||||
/**
|
/**
|
||||||
* createCtas generates an array of buttons to be used with our error boundary UI
|
* createCtas generates an array of buttons to be used with our error boundary UI
|
||||||
*/
|
*/
|
||||||
export const createCtas = (codeBlock: string[]): React.ReactElement[] => {
|
export const createCtas = (codeBlock: string[]): ReactElement[] => {
|
||||||
// REMARK: we don't have to worry about key order changing
|
// REMARK: we don't have to worry about key order changing
|
||||||
// eslint-disable-next-line react/jsx-key
|
// eslint-disable-next-line react/jsx-key
|
||||||
return [<CopyStackButton text={codeBlock.join("\r\n")} />, <ReloadAppButton />]
|
return [<CopyStackButton text={codeBlock.join("\r\n")} />, <ReloadAppButton />]
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import Button from "@material-ui/core/Button"
|
import Button from "@material-ui/core/Button"
|
||||||
import TextField from "@material-ui/core/TextField"
|
import TextField from "@material-ui/core/TextField"
|
||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { Section, SectionProps } from "./Section"
|
import { Section, SectionProps } from "./Section"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import { fade } from "@material-ui/core/styles/colorManipulator"
|
import { fade } from "@material-ui/core/styles/colorManipulator"
|
||||||
import Typography from "@material-ui/core/Typography"
|
import Typography from "@material-ui/core/Typography"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
import { combineClasses } from "../../util/combineClasses"
|
import { combineClasses } from "../../util/combineClasses"
|
||||||
import { SectionAction } from "../SectionAction/SectionAction"
|
import { SectionAction } from "../SectionAction/SectionAction"
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ export interface SectionProps {
|
|||||||
children?: React.ReactNode
|
children?: React.ReactNode
|
||||||
}
|
}
|
||||||
|
|
||||||
type SectionFC = React.FC<SectionProps> & { Action: typeof SectionAction }
|
type SectionFC = FC<SectionProps> & { Action: typeof SectionAction }
|
||||||
|
|
||||||
export const Section: SectionFC = ({
|
export const Section: SectionFC = ({
|
||||||
title,
|
title,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
@ -11,7 +11,7 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
* SectionAction is a content box that call to actions should be placed
|
* SectionAction is a content box that call to actions should be placed
|
||||||
* within
|
* within
|
||||||
*/
|
*/
|
||||||
export const SectionAction: React.FC = ({ children }) => {
|
export const SectionAction: FC = ({ children }) => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
return <div className={styles.root}>{children}</div>
|
return <div className={styles.root}>{children}</div>
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import FormHelperText from "@material-ui/core/FormHelperText"
|
import FormHelperText from "@material-ui/core/FormHelperText"
|
||||||
import TextField from "@material-ui/core/TextField"
|
import TextField from "@material-ui/core/TextField"
|
||||||
import { FormikContextType, FormikErrors, useFormik } from "formik"
|
import { FormikContextType, FormikErrors, useFormik } from "formik"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
import * as Yup from "yup"
|
import * as Yup from "yup"
|
||||||
import { getFormHelpers, nameValidator, onChangeTrimmed } from "../../util/formUtils"
|
import { getFormHelpers, nameValidator, onChangeTrimmed } from "../../util/formUtils"
|
||||||
import { LoadingButton } from "../LoadingButton/LoadingButton"
|
import { LoadingButton } from "../LoadingButton/LoadingButton"
|
||||||
@ -32,7 +32,7 @@ export interface AccountFormProps {
|
|||||||
error?: string
|
error?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AccountForm: React.FC<AccountFormProps> = ({
|
export const AccountForm: FC<AccountFormProps> = ({
|
||||||
email,
|
email,
|
||||||
isLoading,
|
isLoading,
|
||||||
onSubmit,
|
onSubmit,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import Box from "@material-ui/core/Box"
|
import Box from "@material-ui/core/Box"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
import { Outlet } from "react-router-dom"
|
import { Outlet } from "react-router-dom"
|
||||||
import { AuthAndFrame } from "../AuthAndFrame/AuthAndFrame"
|
import { AuthAndFrame } from "../AuthAndFrame/AuthAndFrame"
|
||||||
import { Margins } from "../Margins/Margins"
|
import { Margins } from "../Margins/Margins"
|
||||||
@ -18,7 +18,7 @@ const menuItems = [
|
|||||||
{ label: Language.sshKeysLabel, path: "/settings/ssh-keys" },
|
{ label: Language.sshKeysLabel, path: "/settings/ssh-keys" },
|
||||||
]
|
]
|
||||||
|
|
||||||
export const SettingsLayout: React.FC = () => {
|
export const SettingsLayout: FC = () => {
|
||||||
return (
|
return (
|
||||||
<AuthAndFrame>
|
<AuthAndFrame>
|
||||||
<Box display="flex" flexDirection="column">
|
<Box display="flex" flexDirection="column">
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { SignInForm, SignInFormProps } from "./SignInForm"
|
import { SignInForm, SignInFormProps } from "./SignInForm"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -4,7 +4,7 @@ import Link from "@material-ui/core/Link"
|
|||||||
import { makeStyles } from "@material-ui/core/styles"
|
import { makeStyles } from "@material-ui/core/styles"
|
||||||
import TextField from "@material-ui/core/TextField"
|
import TextField from "@material-ui/core/TextField"
|
||||||
import { FormikContextType, useFormik } from "formik"
|
import { FormikContextType, useFormik } from "formik"
|
||||||
import React from "react"
|
import { FC } from "react"
|
||||||
import * as Yup from "yup"
|
import * as Yup from "yup"
|
||||||
import { AuthMethods } from "../../api/typesGenerated"
|
import { AuthMethods } from "../../api/typesGenerated"
|
||||||
import { getFormHelpers, onChangeTrimmed } from "../../util/formUtils"
|
import { getFormHelpers, onChangeTrimmed } from "../../util/formUtils"
|
||||||
@ -60,7 +60,7 @@ export interface SignInFormProps {
|
|||||||
onSubmit: ({ email, password }: { email: string; password: string }) => Promise<void>
|
onSubmit: ({ email, password }: { email: string; password: string }) => Promise<void>
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SignInForm: React.FC<SignInFormProps> = ({
|
export const SignInForm: FC<SignInFormProps> = ({
|
||||||
authMethods,
|
authMethods,
|
||||||
redirectTo,
|
redirectTo,
|
||||||
isLoading,
|
isLoading,
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { fireEvent, render, screen } from "@testing-library/react"
|
import { fireEvent, render, screen } from "@testing-library/react"
|
||||||
import React from "react"
|
|
||||||
import { SplitButton, SplitButtonProps } from "./SplitButton"
|
import { SplitButton, SplitButtonProps } from "./SplitButton"
|
||||||
|
|
||||||
namespace Helpers {
|
namespace Helpers {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import TextField from "@material-ui/core/TextField"
|
import TextField from "@material-ui/core/TextField"
|
||||||
import { Story } from "@storybook/react"
|
import { Story } from "@storybook/react"
|
||||||
import React from "react"
|
|
||||||
import { Stack, StackProps } from "./Stack"
|
import { Stack, StackProps } from "./Stack"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user