Skip to content

Commit 9c3d81e

Browse files
committed
Merge branch 'main' into oauth
2 parents 86f2f4a + 3151bef commit 9c3d81e

File tree

133 files changed

+376
-240
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+376
-240
lines changed

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
site @coder/frontend
1+
site/ @coder/frontend
22
site/src/xServices @presleyp

cli/start.go

+22-2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ func start() *cobra.Command {
7070
traceDatadog bool
7171
secureAuthCookie bool
7272
sshKeygenAlgorithmRaw string
73+
spooky bool
7374
)
7475

7576
root := &cobra.Command{
@@ -83,7 +84,7 @@ func start() *cobra.Command {
8384
defer tracer.Stop()
8485
}
8586

86-
printLogo(cmd)
87+
printLogo(cmd, spooky)
8788
listener, err := net.Listen("tcp", address)
8889
if err != nil {
8990
return xerrors.Errorf("listen %q: %w", address, err)
@@ -416,6 +417,8 @@ func start() *cobra.Command {
416417
cliflag.BoolVarP(root.Flags(), &secureAuthCookie, "secure-auth-cookie", "", "CODER_SECURE_AUTH_COOKIE", false, "Specifies if the 'Secure' property is set on browser session cookies")
417418
cliflag.StringVarP(root.Flags(), &sshKeygenAlgorithmRaw, "ssh-keygen-algorithm", "", "CODER_SSH_KEYGEN_ALGORITHM", "ed25519", "Specifies the algorithm to use for generating ssh keys. "+
418419
`Accepted values are "ed25519", "ecdsa", or "rsa4096"`)
420+
cliflag.BoolVarP(root.Flags(), &spooky, "spooky", "", "", false, "Specifies spookiness level")
421+
_ = root.Flags().MarkHidden("spooky")
419422

420423
return root
421424
}
@@ -486,7 +489,24 @@ func newProvisionerDaemon(ctx context.Context, client *codersdk.Client, logger s
486489
}), nil
487490
}
488491

489-
func printLogo(cmd *cobra.Command) {
492+
// nolint: revive
493+
func printLogo(cmd *cobra.Command, spooky bool) {
494+
if spooky {
495+
_, _ = fmt.Fprintf(cmd.OutOrStdout(), `
496+
▄████▄ ▒█████ ▓█████▄ ▓█████ ██▀███
497+
▒██▀ ▀█ ▒██▒ ██▒▒██▀ ██▌▓█ ▀ ▓██ ▒ ██▒
498+
▒▓█ ▄ ▒██░ ██▒░██ █▌▒███ ▓██ ░▄█ ▒
499+
▒▓▓▄ ▄██▒▒██ ██░░▓█▄ ▌▒▓█ ▄ ▒██▀▀█▄
500+
▒ ▓███▀ ░░ ████▓▒░░▒████▓ ░▒████▒░██▓ ▒██▒
501+
░ ░▒ ▒ ░░ ▒░▒░▒░ ▒▒▓ ▒ ░░ ▒░ ░░ ▒▓ ░▒▓░
502+
░ ▒ ░ ▒ ▒░ ░ ▒ ▒ ░ ░ ░ ░▒ ░ ▒░
503+
░ ░ ░ ░ ▒ ░ ░ ░ ░ ░░ ░
504+
░ ░ ░ ░ ░ ░ ░ ░
505+
░ ░
506+
507+
`)
508+
return
509+
}
490510
_, _ = fmt.Fprintf(cmd.OutOrStdout(), ` ▄█▀ ▀█▄
491511
▄▄ ▀▀▀ █▌ ██▀▀█▄ ▐█
492512
▄▄██▀▀█▄▄▄ ██ ██ █▀▀█ ▐█▀▀██ ▄█▀▀█ █▀▀

examples/docker-local/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ resource "docker_volume" "coder_volume" {
3737
}
3838

3939
resource "docker_container" "workspace" {
40-
count = data.coder_workspace.me.start_count
40+
count = data.coder_workspace.me.start_count
4141
image = var.docker_image
4242
name = "coder-${data.coder_workspace.me.owner}-${data.coder_workspace.me.name}-root"
4343
dns = ["1.1.1.1"]

site/htmlTemplates/index.html

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
<!DOCTYPE html>
22

3+
<!--
4+
▄█▀ ▀█▄
5+
▄▄ ▀▀▀ █▌ ██▀▀█▄ ▐█
6+
▄▄██▀▀█▄▄▄ ██ ██ █▀▀█ ▐█▀▀██ ▄█▀▀█ █▀▀
7+
█▌ ▄▌ ▐█ █▌ ▀█▄▄▄█▌ █ █ ▐█ ██ ██▀▀ █
8+
██████▀▄█ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀▀ ▀▀▀▀ ▀
9+
-->
10+
311
<head>
412
<meta charset="utf-8" />
513
<meta name="viewport" content="width=device-width, initial-scale=1" />

site/src/AppRouter.tsx

+22-22
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
import React from "react"
22
import { Route, Routes } from "react-router-dom"
3-
import { RequireAuth } from "./components"
43
import { AuthAndFrame } from "./components/AuthAndFrame/AuthAndFrame"
5-
import { PreferencesLayout } from "./components/Preferences/Layout"
4+
import { PreferencesLayout } from "./components/PreferencesLayout/PreferencesLayout"
5+
import { RequireAuth } from "./components/RequireAuth/RequireAuth"
66
import { IndexPage } from "./pages"
7-
import { NotFoundPage } from "./pages/404"
8-
import { CliAuthenticationPage } from "./pages/cli-auth"
9-
import { HealthzPage } from "./pages/healthz"
10-
import { SignInPage } from "./pages/login"
11-
import { OrganizationsPage } from "./pages/orgs"
12-
import { PreferencesAccountPage } from "./pages/preferences/account"
13-
import { PreferencesLinkedAccountsPage } from "./pages/preferences/linkedAccounts"
14-
import { PreferencesSecurityPage } from "./pages/preferences/security"
15-
import { PreferencesSSHKeysPage } from "./pages/preferences/sshKeys"
16-
import { SettingsPage } from "./pages/settings"
17-
import { TemplatesPage } from "./pages/templates"
18-
import { TemplatePage } from "./pages/templates/[organization]/[template]"
19-
import { CreateWorkspacePage } from "./pages/templates/[organization]/[template]/create"
7+
import { NotFoundPage } from "./pages/404Page/404Page"
8+
import { CliAuthenticationPage } from "./pages/CliAuthPage/CliAuthPage"
9+
import { HealthzPage } from "./pages/HealthzPage/HealthzPage"
10+
import { LoginPage } from "./pages/LoginPage/LoginPage"
11+
import { OrgsPage } from "./pages/OrgsPage/OrgsPage"
12+
import { AccountPage } from "./pages/PreferencesPages/AccountPage/AccountPage"
13+
import { LinkedAccountsPage } from "./pages/PreferencesPages/LinkedAccountsPage/LinkedAccountsPage"
14+
import { SecurityPage } from "./pages/PreferencesPages/SecurityPage/SecurityPage"
15+
import { SSHKeysPage } from "./pages/PreferencesPages/SSHKeysPage/SSHKeysPage"
16+
import { SettingsPage } from "./pages/SettingsPage/SettingsPage"
17+
import { CreateWorkspacePage } from "./pages/TemplatesPages/OrganizationPage/TemplatePage/CreateWorkspacePage"
18+
import { TemplatePage } from "./pages/TemplatesPages/OrganizationPage/TemplatePage/TemplatePage"
19+
import { TemplatesPage } from "./pages/TemplatesPages/TemplatesPage"
2020
import { UsersPage } from "./pages/UsersPage/UsersPage"
21-
import { WorkspacePage } from "./pages/workspaces/[workspace]"
21+
import { WorkspacePage } from "./pages/WorkspacesPage/WorkspacesPage"
2222

2323
export const AppRouter: React.FC = () => (
2424
<Routes>
@@ -32,7 +32,7 @@ export const AppRouter: React.FC = () => (
3232
}
3333
/>
3434

35-
<Route path="login" element={<SignInPage />} />
35+
<Route path="login" element={<LoginPage />} />
3636
<Route path="healthz" element={<HealthzPage />} />
3737
<Route path="cli-auth" element={<CliAuthenticationPage />} />
3838

@@ -88,7 +88,7 @@ export const AppRouter: React.FC = () => (
8888
path="orgs"
8989
element={
9090
<AuthAndFrame>
91-
<OrganizationsPage />
91+
<OrgsPage />
9292
</AuthAndFrame>
9393
}
9494
/>
@@ -102,10 +102,10 @@ export const AppRouter: React.FC = () => (
102102
/>
103103

104104
<Route path="preferences" element={<PreferencesLayout />}>
105-
<Route path="account" element={<PreferencesAccountPage />} />
106-
<Route path="security" element={<PreferencesSecurityPage />} />
107-
<Route path="ssh-keys" element={<PreferencesSSHKeysPage />} />
108-
<Route path="linked-accounts" element={<PreferencesLinkedAccountsPage />} />
105+
<Route path="account" element={<AccountPage />} />
106+
<Route path="security" element={<SecurityPage />} />
107+
<Route path="ssh-keys" element={<SSHKeysPage />} />
108+
<Route path="linked-accounts" element={<LinkedAccountsPage />} />
109109
</Route>
110110

111111
{/* Using path="*"" means "match anything", so this route

site/src/Main.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ if (process.env.NODE_ENV === "development" && process.env.INSPECT_XSTATE === "tr
1919
// In the future, we'll likely bring in more bootstrapping logic -
2020
// like: https://github.com/coder/m/blob/50898bd4803df7639bd181e484c74ac5d84da474/product/coder/site/pages/_app.tsx#L32
2121
const main = () => {
22+
console.info(` ▄█▀ ▀█▄
23+
▄▄ ▀▀▀ █▌ ██▀▀█▄ ▐█
24+
▄▄██▀▀█▄▄▄ ██ ██ █▀▀█ ▐█▀▀██ ▄█▀▀█ █▀▀
25+
█▌ ▄▌ ▐█ █▌ ▀█▄▄▄█▌ █ █ ▐█ ██ ██▀▀ █
26+
██████▀▄█ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀▀ ▀▀▀▀ ▀
27+
`)
2228
const element = document.getElementById("root")
2329
ReactDOM.render(<App />, element)
2430
}

site/src/app.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import React from "react"
44
import { BrowserRouter as Router } from "react-router-dom"
55
import { SWRConfig } from "swr"
66
import { AppRouter } from "./AppRouter"
7-
import { GlobalSnackbar } from "./components/Snackbar/GlobalSnackbar"
7+
import { GlobalSnackbar } from "./components/GlobalSnackbar/GlobalSnackbar"
88
import { light } from "./theme"
99
import "./theme/globalFonts"
1010
import { XServiceProvider } from "./xServices/StateContext"

site/src/components/AuthAndFrame/AuthAndFrame.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react"
2-
import { Navbar } from "../Navbar"
3-
import { Footer } from "../Page/Footer"
4-
import { RequireAuth } from "../Page/RequireAuth"
2+
import { Footer } from "../Footer/Footer"
3+
import { Navbar } from "../Navbar/Navbar"
4+
import { RequireAuth } from "../RequireAuth/RequireAuth"
55

66
interface AuthAndFrameProps {
77
children: JSX.Element

site/src/components/Button/index.ts

-3
This file was deleted.

site/src/components/SignIn/CliAuthToken.stories.tsx renamed to site/src/components/CliAuthToken/CliAuthToken.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from "react"
33
import { CliAuthToken, CliAuthTokenProps } from "./CliAuthToken"
44

55
export default {
6-
title: "SignIn/CliAuthToken",
6+
title: "components/CliAuthToken",
77
component: CliAuthToken,
88
argTypes: {
99
sessionToken: { control: "text", defaultValue: "some-session-token" },

site/src/components/SignIn/CliAuthToken.tsx renamed to site/src/components/CliAuthToken/CliAuthToken.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Paper from "@material-ui/core/Paper"
22
import { makeStyles } from "@material-ui/core/styles"
33
import Typography from "@material-ui/core/Typography"
44
import React from "react"
5-
import { CodeExample } from "../CodeExample"
5+
import { CodeExample } from "../CodeExample/CodeExample"
66

77
export interface CliAuthTokenProps {
88
sessionToken: string

site/src/components/CodeBlock/index.stories.tsx renamed to site/src/components/CodeBlock/CodeBlock.stories.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Story } from "@storybook/react"
22
import React from "react"
3-
import { CodeBlock, CodeBlockProps } from "./index"
3+
import { CodeBlock, CodeBlockProps } from "./CodeBlock"
44

55
const sampleLines = `Successfully assigned coder/image-jcws7 to cluster-1
66
Container image "gcr.io/coder-dogfood/master/coder-dev-ubuntu@sha256" already present on machine
@@ -9,7 +9,7 @@ Started container user
99
Using user 'coder' with shell '/bin/bash'`.split("\n")
1010

1111
export default {
12-
title: "CodeBlock/CodeBlock",
12+
title: "components/CodeBlock",
1313
component: CodeBlock,
1414
argTypes: {
1515
lines: { control: "text", defaultValue: sampleLines },

site/src/components/CodeBlock/index.test.tsx renamed to site/src/components/CodeBlock/CodeBlock.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { screen } from "@testing-library/react"
22
import React from "react"
33
import { render } from "../../testHelpers"
4-
import { CodeBlock } from "./index"
4+
import { CodeBlock } from "./CodeBlock"
55

66
describe("CodeBlock", () => {
77
it("renders lines)", async () => {

site/src/components/CodeExample/CodeExample.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { CodeExample, CodeExampleProps } from "./CodeExample"
55
const sampleCode = `echo "Hello, world"`
66

77
export default {
8-
title: "CodeBlock/CodeExample",
8+
title: "components/CodeExample",
99
component: CodeExample,
1010
argTypes: {
1111
code: { control: "string", defaultValue: sampleCode },

site/src/components/CodeExample/CodeExample.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { makeStyles } from "@material-ui/core/styles"
22
import React from "react"
33
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"
4-
import { CopyButton } from "../Button"
4+
import { CopyButton } from "../CopyButton/CopyButton"
55

66
export interface CodeExampleProps {
77
code: string

site/src/components/CodeExample/index.ts

-1
This file was deleted.

site/src/components/Button/CopyButton.tsx renamed to site/src/components/CopyButton/CopyButton.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { makeStyles } from "@material-ui/core/styles"
33
import Tooltip from "@material-ui/core/Tooltip"
44
import Check from "@material-ui/icons/Check"
55
import React, { useState } from "react"
6-
import { FileCopy } from "../Icons"
6+
import { FileCopyIcon } from "../Icons/FileCopyIcon"
77

88
interface CopyButtonProps {
99
text: string
@@ -38,7 +38,7 @@ export const CopyButton: React.FC<CopyButtonProps> = ({ className = "", text })
3838
<Tooltip title="Copy to Clipboard" placement="top">
3939
<div className={`${styles.copyButtonWrapper} ${className}`}>
4040
<Button className={styles.copyButton} onClick={copyToClipboard} size="small">
41-
{isCopied ? <Check className={styles.fileCopyIcon} /> : <FileCopy className={styles.fileCopyIcon} />}
41+
{isCopied ? <Check className={styles.fileCopyIcon} /> : <FileCopyIcon className={styles.fileCopyIcon} />}
4242
</Button>
4343
</div>
4444
</Tooltip>

site/src/components/EmptyState/index.test.tsx renamed to site/src/components/EmptyState/EmptyState.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { screen } from "@testing-library/react"
22
import React from "react"
33
import { render } from "../../testHelpers"
4-
import { EmptyState } from "./index"
4+
import { EmptyState } from "./EmptyState"
55

66
describe("EmptyState", () => {
77
it("renders (smoke test)", async () => {

site/src/components/Snackbar/EnterpriseSnackbar.stories.tsx renamed to site/src/components/EnterpriseSnackbar/EnterpriseSnackbar.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from "react"
33
import { EnterpriseSnackbar, EnterpriseSnackbarProps } from "./EnterpriseSnackbar"
44

55
export default {
6-
title: "Snackbar/EnterpriseSnackbar",
6+
title: "components/EnterpriseSnackbar",
77
component: EnterpriseSnackbar,
88
}
99

site/src/components/ErrorSummary/ErrorSummary.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ComponentMeta, Story } from "@storybook/react"
22
import React from "react"
3-
import { ErrorSummary, ErrorSummaryProps } from "."
3+
import { ErrorSummary, ErrorSummaryProps } from "./ErrorSummary"
44

55
export default {
66
title: "components/ErrorSummary",

site/src/components/ErrorSummary/index.test.tsx renamed to site/src/components/ErrorSummary/ErrorSummary.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { render, screen } from "@testing-library/react"
22
import React from "react"
3-
import { ErrorSummary } from "./index"
3+
import { ErrorSummary } from "./ErrorSummary"
44

55
describe("ErrorSummary", () => {
66
it("renders", async () => {

site/src/components/Form/FormCloseButton.stories.tsx renamed to site/src/components/FormCloseButton/FormCloseButton.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from "react"
33
import { FormCloseButton, FormCloseButtonProps } from "./FormCloseButton"
44

55
export default {
6-
title: "Form/FormCloseButton",
6+
title: "components/FormCloseButton",
77
component: FormCloseButton,
88
argTypes: {
99
onClose: { action: "onClose" },

site/src/components/Form/FormCloseButton.tsx renamed to site/src/components/FormCloseButton/FormCloseButton.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import IconButton from "@material-ui/core/IconButton"
22
import { makeStyles } from "@material-ui/core/styles"
33
import Typography from "@material-ui/core/Typography"
44
import React, { useEffect } from "react"
5-
import { CloseIcon } from "../Icons/Close"
5+
import { CloseIcon } from "../Icons/CloseIcon"
66

77
export interface FormCloseButtonProps {
88
onClose: () => void

site/src/components/Form/FormDropdownField.tsx renamed to site/src/components/FormDropdownField/FormDropdownField.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ import MenuItem from "@material-ui/core/MenuItem"
33
import { makeStyles } from "@material-ui/core/styles"
44
import Typography from "@material-ui/core/Typography"
55
import React from "react"
6-
import { FormTextField, FormTextFieldProps } from "./FormTextField"
6+
import { FormTextField, FormTextFieldProps } from "../FormTextField/FormTextField"
77

8-
export interface DropdownItem {
8+
export interface FormDropdownItem {
99
value: string
1010
name: string
1111
description?: string
1212
}
1313

1414
export interface FormDropdownFieldProps<T> extends FormTextFieldProps<T> {
15-
items: DropdownItem[]
15+
items: FormDropdownItem[]
1616
}
1717

1818
export const FormDropdownField = <T,>({ items, ...props }: FormDropdownFieldProps<T>): React.ReactElement => {
1919
const styles = useStyles()
2020
return (
2121
<FormTextField select {...props}>
22-
{items.map((item: DropdownItem) => (
22+
{items.map((item: FormDropdownItem) => (
2323
<MenuItem key={item.value} value={item.value}>
2424
<Box alignItems="center" display="flex">
2525
<Box ml={1}>

site/src/components/Form/FormTextField.tsx renamed to site/src/components/FormTextField/FormTextField.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import TextField, { TextFieldProps } from "@material-ui/core/TextField"
22
import { FormikContextType } from "formik"
33
import React from "react"
4-
import { PasswordField } from "./PasswordField"
4+
import { PasswordField } from "../PasswordField/PasswordField"
55

66
/**
77
* FormFieldProps are required props for creating form fields using a factory.

site/src/components/Snackbar/GlobalSnackbar.tsx renamed to site/src/components/GlobalSnackbar/GlobalSnackbar.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { makeStyles } from "@material-ui/core/styles"
22
import React, { useCallback, useState } from "react"
3+
import { useCustomEvent } from "../../hooks/events"
4+
import { CustomEventListener } from "../../util/events"
5+
import { EnterpriseSnackbar } from "../EnterpriseSnackbar/EnterpriseSnackbar"
6+
import { ErrorIcon } from "../Icons/ErrorIcon"
7+
import { Typography } from "../Typography/Typography"
38
import {
49
AdditionalMessage,
510
isNotificationList,
@@ -8,12 +13,7 @@ import {
813
MsgType,
914
NotificationMsg,
1015
SnackbarEventType,
11-
} from "."
12-
import { useCustomEvent } from "../../hooks/events"
13-
import { CustomEventListener } from "../../util/events"
14-
import { ErrorIcon } from "../Icons/ErrorIcon"
15-
import { Typography } from "../Typography/Typography"
16-
import { EnterpriseSnackbar } from "./EnterpriseSnackbar"
16+
} from "./utils"
1717

1818
export const GlobalSnackbar: React.FC = () => {
1919
const styles = useStyles()

site/src/components/Snackbar/index.test.ts renamed to site/src/components/GlobalSnackbar/utils.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { displaySuccess, isNotificationTextPrefixed, MsgType, NotificationMsg } from "./index"
1+
import { displaySuccess, isNotificationTextPrefixed, MsgType, NotificationMsg } from "./utils"
22

33
describe("Snackbar", () => {
44
describe("isNotificationTextPrefixed", () => {

0 commit comments

Comments
 (0)