Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions site/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import ThemeProvider from "@material-ui/styles/ThemeProvider"
import { withThemes } from "@react-theming/storybook-addon"
import { light, dark } from "../src/theme"
import { addDecorator } from "node_modules/@storybook/react"
import { createMemoryHistory } from "history"
import { addDecorator } from "node_modules/@storybook/react"
import { unstable_HistoryRouter as HistoryRouter } from "react-router-dom"
import { dark, light } from "../src/theme"
import "../src/theme/global-fonts"

addDecorator(withThemes(ThemeProvider, [light, dark]))
Expand Down
2 changes: 1 addition & 1 deletion site/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as path from "path"
import { PlaywrightTestConfig } from "@playwright/test"
import * as path from "path"

const config: PlaywrightTestConfig = {
testDir: "tests",
Expand Down
2 changes: 1 addition & 1 deletion site/e2e/tests/login.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test } from "@playwright/test"
import { ProjectsPage, SignInPage } from "../pom"
import { email, password } from "../constants"
import { ProjectsPage, SignInPage } from "../pom"
import { waitForClientSideNavigation } from "./../util"

test("Login takes user to /projects", async ({ baseURL, page }) => {
Expand Down
1 change: 1 addition & 0 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"mini-css-extract-plugin": "2.6.0",
"msw": "0.39.2",
"prettier": "2.6.2",
"prettier-plugin-organize-imports": "2.3.4",
"react-hot-loader": "4.13.0",
"sql-formatter": "4.0.2",
"style-loader": "3.3.1",
Expand Down
4 changes: 2 additions & 2 deletions site/src/AppRouter.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react"
import { Routes, Route } from "react-router-dom"
import { RequireAuth, AuthAndNav } from "./components"
import { Route, Routes } from "react-router-dom"
import { AuthAndNav, RequireAuth } from "./components"
import { IndexPage } from "./pages"
import { NotFoundPage } from "./pages/404"
import { CliAuthenticationPage } from "./pages/cli-auth"
Expand Down
2 changes: 1 addition & 1 deletion site/src/Main.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { inspect } from "@xstate/inspect"
import React from "react"
import ReactDOM from "react-dom"
import { inspect } from "@xstate/inspect"
import { Interpreter } from "xstate"
import { App } from "./app"

Expand Down
2 changes: 1 addition & 1 deletion site/src/api/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from "axios"
import { getApiKey, login, logout } from "."
import { LoginResponse, APIKeyResponse } from "./types"
import { APIKeyResponse, LoginResponse } from "./types"

// Mock the axios module so that no real network requests are made, but rather
// we swap in a resolved or rejected value
Expand Down
9 changes: 4 additions & 5 deletions site/src/app.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import React from "react"
import CssBaseline from "@material-ui/core/CssBaseline"
import ThemeProvider from "@material-ui/styles/ThemeProvider"
import { SWRConfig } from "swr"
import { light } from "./theme"
import React from "react"
import { BrowserRouter as Router } from "react-router-dom"

import { XServiceProvider } from "./xServices/StateContext"
import { SWRConfig } from "swr"
import { AppRouter } from "./AppRouter"
import { light } from "./theme"
import "./theme/global-fonts"
import { XServiceProvider } from "./xServices/StateContext"

export const App: React.FC = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Button/CopyButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { makeStyles } from "@material-ui/core/styles"
import Button from "@material-ui/core/Button"
import { makeStyles } from "@material-ui/core/styles"
import Tooltip from "@material-ui/core/Tooltip"
import Check from "@material-ui/icons/Check"
import React, { useState } from "react"
Expand Down
4 changes: 2 additions & 2 deletions site/src/components/Button/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from "./SplitButton"
export * from "./LoadingButton"
export * from "./CopyButton"
export * from "./LoadingButton"
export * from "./SplitButton"
2 changes: 1 addition & 1 deletion site/src/components/CodeBlock/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { screen } from "@testing-library/react"
import { render } from "../../test_helpers"
import React from "react"
import { render } from "../../test_helpers"
import { CodeBlock } from "./index"

describe("CodeBlock", () => {
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/CodeExample/CodeExample.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { screen } from "@testing-library/react"
import { render } from "../../test_helpers"
import React from "react"
import { render } from "../../test_helpers"
import { CodeExample } from "./CodeExample"

describe("CodeExample", () => {
Expand Down
1 change: 0 additions & 1 deletion site/src/components/CodeExample/CodeExample.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { makeStyles } from "@material-ui/core/styles"
import React from "react"
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"

import { CopyButton } from "../Button"

export interface CodeExampleProps {
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/EmptyState/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { screen } from "@testing-library/react"
import { render } from "../../test_helpers"
import React from "react"
import { render } from "../../test_helpers"
import { EmptyState } from "./index"

describe("EmptyState", () => {
Expand Down
4 changes: 2 additions & 2 deletions site/src/components/EmptyState/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react"
import { makeStyles } from "@material-ui/core/styles"
import Box from "@material-ui/core/Box"
import Button, { ButtonProps } from "@material-ui/core/Button"
import { makeStyles } from "@material-ui/core/styles"
import Typography from "@material-ui/core/Typography"
import React from "react"

export interface EmptyStateProps {
/** Text Message to display, placed inside Typography component */
Expand Down
1 change: 0 additions & 1 deletion site/src/components/Form/FormDropdownField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import MenuItem from "@material-ui/core/MenuItem"
import { makeStyles } from "@material-ui/core/styles"
import Typography from "@material-ui/core/Typography"
import React from "react"

import { FormTextField, FormTextFieldProps } from "./FormTextField"

export interface DropdownItem {
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Form/FormTextField.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import TextField, { TextFieldProps } from "@material-ui/core/TextField"
import { FormikContextType } from "formik"
import React from "react"
import { PasswordField } from "./PasswordField"
import { FormikContextType } from "formik"

/**
* FormFieldProps are required props for creating form fields using a factory.
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Form/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { FormikContextType, getIn } from "formik"
import { ChangeEvent, ChangeEventHandler, FocusEventHandler } from "react"

export * from "./FormCloseButton"
export * from "./FormSection"
export * from "./FormDropdownField"
export * from "./FormSection"
export * from "./FormTextField"
export * from "./FormTitle"

Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Header/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { screen } from "@testing-library/react"
import { render } from "./../../test_helpers"
import React from "react"
import { render } from "./../../test_helpers"
import { Header } from "./index"

describe("Header", () => {
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Box from "@material-ui/core/Box"
import Typography from "@material-ui/core/Typography"
import { makeStyles } from "@material-ui/core/styles"
import Typography from "@material-ui/core/Typography"
import React from "react"
import { HeaderButton } from "./HeaderButton"

Expand Down
3 changes: 1 addition & 2 deletions site/src/components/Icons/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react"
import SvgIcon from "@material-ui/core/SvgIcon"
import React from "react"
import { render } from "./../../test_helpers"

import * as Icons from "./index"

const getAllIcons = (): [string, typeof SvgIcon][] => {
Expand Down
3 changes: 1 addition & 2 deletions site/src/components/Navbar/NavbarView.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react"
import { screen } from "@testing-library/react"

import React from "react"
import { render } from "../../test_helpers"
import { MockUser } from "../../test_helpers/entities"
import { NavbarView } from "./NavbarView"
Expand Down
4 changes: 2 additions & 2 deletions site/src/components/Navbar/NavbarView.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from "react"
import Button from "@material-ui/core/Button"
import { makeStyles } from "@material-ui/core/styles"
import React from "react"
import { Link } from "react-router-dom"
import { UserResponse } from "../../api/types"
import { Logo } from "../Icons"
import { UserDropdown } from "./UserDropdown"
import { UserResponse } from "../../api/types"

export interface NavbarViewProps {
user?: UserResponse
Expand Down
7 changes: 3 additions & 4 deletions site/src/components/Navbar/UserDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ import { fade, makeStyles } from "@material-ui/core/styles"
import KeyboardArrowDown from "@material-ui/icons/KeyboardArrowDown"
import KeyboardArrowUp from "@material-ui/icons/KeyboardArrowUp"
import React, { useState } from "react"
import { UserResponse } from "../../api/types"
import { LogoutIcon } from "../Icons"
import { BorderedMenu } from "./BorderedMenu"
import { UserProfileCard } from "../User/UserProfileCard"

import { UserAvatar } from "../User"
import { UserResponse } from "../../api/types"
import { UserProfileCard } from "../User/UserProfileCard"
import { BorderedMenu } from "./BorderedMenu"

export interface UserDropdownProps {
user: UserResponse
Expand Down
4 changes: 2 additions & 2 deletions site/src/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useContext } from "react"
import { useActor } from "@xstate/react"
import { NavbarView } from "./NavbarView"
import React, { useContext } from "react"
import { XServiceContext } from "../../xServices/StateContext"
import { NavbarView } from "./NavbarView"

export const Navbar: React.FC = () => {
const xServices = useContext(XServiceContext)
Expand Down
3 changes: 1 addition & 2 deletions site/src/components/Page/Footer.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react"
import { screen } from "@testing-library/react"

import React from "react"
import { render } from "../../test_helpers"
import { Footer } from "./Footer"

Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Page/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from "./AuthAndNav"
export * from "./Footer"
export * from "./RequireAuth"
export * from "./AuthAndNav"
3 changes: 1 addition & 2 deletions site/src/components/SignIn/CliAuthToken.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react"
import { screen } from "@testing-library/react"
import React from "react"
import { render } from "../../test_helpers"

import { CliAuthToken } from "./CliAuthToken"

describe("CliAuthToken", () => {
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/SignIn/CliAuthToken.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Paper from "@material-ui/core/Paper"
import Typography from "@material-ui/core/Typography"
import { makeStyles } from "@material-ui/core/styles"
import Typography from "@material-ui/core/Typography"
import React from "react"
import { CodeExample } from "../CodeExample"

Expand Down
9 changes: 4 additions & 5 deletions site/src/components/SignIn/SignInForm.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import FormHelperText from "@material-ui/core/FormHelperText"
import { makeStyles } from "@material-ui/core/styles"
import TextField from "@material-ui/core/TextField"
import { FormikContextType, useFormik } from "formik"
import React from "react"
import * as Yup from "yup"

import { Welcome } from "./Welcome"
import FormHelperText from "@material-ui/core/FormHelperText"
import { LoadingButton } from "./../Button"
import TextField from "@material-ui/core/TextField"
import { getFormHelpers, onChangeTrimmed } from "../Form"
import { LoadingButton } from "./../Button"
import { Welcome } from "./Welcome"

/**
* BuiltInAuthFormValues describes a form using built-in (email/password)
Expand Down
4 changes: 2 additions & 2 deletions site/src/components/SignIn/Welcome.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { makeStyles } from "@material-ui/core/styles"
import { CoderIcon } from "../Icons"
import React from "react"
import Typography from "@material-ui/core/Typography"
import React from "react"
import { CoderIcon } from "../Icons"

export const Welcome: React.FC = () => {
const styles = useStyles()
Expand Down
4 changes: 2 additions & 2 deletions site/src/components/Table/Cells/UserCell.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { fireEvent, render, screen } from "@testing-library/react"
import React from "react"
import { MockUser, MockUserAgent, WrapperComponent } from "../../../test_helpers"
import { UserCell, UserCellProps } from "./UserCell"
import React from "react"
import { fireEvent, render, screen } from "@testing-library/react"

namespace Helpers {
export const Props: UserCellProps = {
Expand Down
4 changes: 2 additions & 2 deletions site/src/components/Table/Table.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { screen } from "@testing-library/react"
import { render } from "./../../test_helpers"
import React from "react"
import { Table, Column } from "./Table"
import { render } from "./../../test_helpers"
import { Column, Table } from "./Table"

interface TestData {
name: string
Expand Down
9 changes: 4 additions & 5 deletions site/src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import React from "react"
import Box from "@material-ui/core/Box"
import MuiTable from "@material-ui/core/Table"
import TableBody from "@material-ui/core/TableBody"
import TableCell from "@material-ui/core/TableCell"
import TableHead from "@material-ui/core/TableHead"
import TableRow from "@material-ui/core/TableRow"
import TableCell from "@material-ui/core/TableCell"

import { TableTitle } from "./TableTitle"
import React from "react"
import { TableHeaders } from "./TableHeaders"
import TableBody from "@material-ui/core/TableBody"
import { TableTitle } from "./TableTitle"

export interface Column<T> {
/**
Expand Down
4 changes: 2 additions & 2 deletions site/src/components/Table/TableHeaders.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react"
import { makeStyles } from "@material-ui/core/styles"
import TableCell from "@material-ui/core/TableCell"
import TableRow from "@material-ui/core/TableRow"
import { makeStyles } from "@material-ui/core/styles"
import React from "react"

export interface TableHeadersProps {
columns: string[]
Expand Down
1 change: 0 additions & 1 deletion site/src/components/User/UserProfileCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { makeStyles } from "@material-ui/core/styles"
import Typography from "@material-ui/core/Typography"
import React from "react"
import { UserResponse } from "../../api/types"

import { UserAvatar } from "./UserAvatar"

interface UserProfileCardProps {
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Workspace/Workspace.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Story } from "@storybook/react"
import React from "react"
import { Workspace, WorkspaceProps } from "./Workspace"
import { MockOrganization, MockProject, MockWorkspace } from "../../test_helpers"
import { Workspace, WorkspaceProps } from "./Workspace"

export default {
title: "Workspaces/Workspace",
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Workspace/Workspace.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { screen } from "@testing-library/react"
import React from "react"
import { Workspace } from "./Workspace"
import { MockOrganization, MockProject, MockWorkspace, render } from "../../test_helpers"
import { Workspace } from "./Workspace"

describe("Workspace", () => {
it("renders", async () => {
Expand Down
6 changes: 3 additions & 3 deletions site/src/components/Workspace/Workspace.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import Box from "@material-ui/core/Box"
import Paper from "@material-ui/core/Paper"
import Typography from "@material-ui/core/Typography"
import { makeStyles } from "@material-ui/core/styles"
import Typography from "@material-ui/core/Typography"
import CloudCircleIcon from "@material-ui/icons/CloudCircle"
import { Link } from "react-router-dom"
import React from "react"
import * as Constants from "./constants"
import { Link } from "react-router-dom"
import * as Types from "../../api/types"
import * as Constants from "./constants"
import { WorkspaceSection } from "./WorkspaceSection"

export interface WorkspaceProps {
Expand Down
2 changes: 1 addition & 1 deletion site/src/forms/CreateProjectForm.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { render, screen } from "@testing-library/react"
import React from "react"
import { MockOrganization, MockProject, MockProvisioner } from "./../test_helpers"
import { CreateProjectForm } from "./CreateProjectForm"
import { MockProvisioner, MockOrganization, MockProject } from "./../test_helpers"

describe("CreateProjectForm", () => {
it("renders", async () => {
Expand Down
Loading