Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Redesign workspaces page#1450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
kylecarbs merged 24 commits intomainfromworkspacepage
May 16, 2022
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
24 commits
Select commitHold shift + click to select a range
1a667d9
feat: Improve navbar to be more compact
kylecarbsMay 13, 2022
dc47ae0
Attempt to remove overrides
kylecarbsMay 13, 2022
c34ad45
Update theme
kylecarbsMay 14, 2022
104b1d9
Add text field
kylecarbsMay 14, 2022
52a4e76
Merge branch 'main' into workspacepage
kylecarbsMay 14, 2022
83397e0
Update theme to dark!
kylecarbsMay 14, 2022
d19c124
Fix import ordering
kylecarbsMay 14, 2022
db820ce
Fix page location
kylecarbsMay 14, 2022
851111b
Fix requested changes
kylecarbsMay 16, 2022
190b7d1
Add storybook for workspaces page view
kylecarbsMay 16, 2022
cbc1015
Add empty view
kylecarbsMay 16, 2022
169d733
Add tests for empty view
kylecarbsMay 16, 2022
53781e9
Remove templates page
kylecarbsMay 16, 2022
f606a51
Merge branch 'main' into workspacepage
kylecarbsMay 16, 2022
09ce0ec
Fix local port
kylecarbsMay 16, 2022
71bf439
Remove templates from nav
kylecarbsMay 16, 2022
82641ab
Fix e2e test
kylecarbsMay 16, 2022
82cdace
Remove time.ts
kylecarbsMay 16, 2022
6044d91
Remove dep
kylecarbsMay 16, 2022
bd50c9f
Merge branch 'main' into workspacepage
kylecarbsMay 16, 2022
191c9d7
Add background color to margins
kylecarbsMay 16, 2022
fccacfe
Merge status checking from workspace page
kylecarbsMay 16, 2022
f87c8e7
Fix requested changes
kylecarbsMay 16, 2022
a058b8c
Fix workspace status tests
kylecarbsMay 16, 2022
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
13 changes: 5 additions & 8 deletionssite/.storybook/preview.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
import CssBaseline from "@material-ui/core/CssBaseline"
import ThemeProvider from "@material-ui/styles/ThemeProvider"
import { withThemes } from "@react-theming/storybook-addon"
Copy link
Contributor

@greyscaledgreyscaledMay 16, 2022
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Question(if-minor): Are we able to remove this dependency now"@react-theming/storybook-addon": "1.1.5", ?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think so!

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Good catch.

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 { dark } from "../src/theme"
import "../src/theme/globalFonts"

const providerFn = ({ children, theme }) => (
<ThemeProvider theme={theme}>
addDecorator((story) => (
<ThemeProvider theme={dark}>
<CssBaseline />
{children}
{story()}
</ThemeProvider>
)

addDecorator(withThemes(null, [light, dark], { providerFn }))
))

const history = createMemoryHistory()

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
import { Page } from "@playwright/test"
import { BasePom } from "./BasePom"

export classTemplatesPage extends BasePom {
export classWorkspacesPage extends BasePom {
constructor(baseURL: string | undefined, page: Page) {
super(baseURL, "/templates", page)
super(baseURL, "/workspaces", page)
}
}
2 changes: 1 addition & 1 deletionsite/e2e/pom/index.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
export * from "./SignInPage"
export * from "./TemplatesPage"
export * from "./WorkspacesPage"
10 changes: 5 additions & 5 deletionssite/e2e/tests/login.spec.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
import { test } from "@playwright/test"
import { email, password } from "../constants"
import { SignInPage,TemplatesPage } from "../pom"
import { SignInPage,WorkspacesPage } from "../pom"
import { waitForClientSideNavigation } from "./../util"

test("Login takes user to /templates", async ({ baseURL, page }) => {
test("Login takes user to /workspaces", async ({ baseURL, page }) => {
await page.goto(baseURL + "/", { waitUntil: "networkidle" })

// Log-in with the default credentials we set up in the development server
const signInPage = new SignInPage(baseURL, page)
await signInPage.submitBuiltInAuthentication(email, password)

consttemplatesPage = newTemplatesPage(baseURL, page)
await waitForClientSideNavigation(page, { to:templatesPage.url })
constworkspacesPage = newWorkspacesPage(baseURL, page)
await waitForClientSideNavigation(page, { to:workspacesPage.url })

await page.waitForSelector("text=Templates")
await page.waitForSelector("text=Workspaces")
})
4 changes: 2 additions & 2 deletionssite/package.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,7 +25,7 @@
"typegen": "xstate typegen 'src/**/*.ts'"
},
"dependencies": {
"@fontsource/fira-code": "4.5.9",
"@fontsource/ibm-plex-mono": "4.5.9",
"@fontsource/inter": "4.5.7",
"@material-ui/core": "4.9.4",
"@material-ui/icons": "4.5.1",
Expand All@@ -35,6 +35,7 @@
"@xstate/react": "3.0.0",
"axios": "0.26.1",
"cronstrue": "2.4.0",
"dayjs": "^1.11.2",
"formik": "2.2.9",
"history": "5.3.0",
"react": "17.0.2",
Expand All@@ -53,7 +54,6 @@
"devDependencies": {
"@playwright/test": "1.21.1",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.5",
"@react-theming/storybook-addon": "1.1.5",
"@storybook/addon-actions": "6.4.22",
"@storybook/addon-essentials": "6.4.22",
"@storybook/addon-links": "6.4.22",
Expand Down
29 changes: 3 additions & 26 deletionssite/src/AppRouter.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,15 +12,13 @@ import { OrgsPage } from "./pages/OrgsPage/OrgsPage"
import { SettingsPage } from "./pages/SettingsPage/SettingsPage"
import { AccountPage } from "./pages/SettingsPages/AccountPage/AccountPage"
import { SSHKeysPage } from "./pages/SettingsPages/SSHKeysPage/SSHKeysPage"
import { CreateWorkspacePage } from "./pages/TemplatesPages/OrganizationPage/TemplatePage/CreateWorkspacePage"
import { TemplatePage } from "./pages/TemplatesPages/OrganizationPage/TemplatePage/TemplatePage"
import { TemplatesPage } from "./pages/TemplatesPages/TemplatesPage"
import { CreateUserPage } from "./pages/UsersPage/CreateUserPage/CreateUserPage"
import { UsersPage } from "./pages/UsersPage/UsersPage"
import { WorkspacePage } from "./pages/WorkspacePage/WorkspacePage"
import { WorkspaceSettingsPage } from "./pages/WorkspaceSettingsPage/WorkspaceSettingsPage"

const TerminalPage = React.lazy(() => import("./pages/TerminalPage/TerminalPage"))
const WorkspacesPage = React.lazy(() => import("./pages/WorkspacesPage/WorkspacesPage"))

export const AppRouter: React.FC = () => (
<React.Suspense fallback={<></>}>
Expand All@@ -46,36 +44,15 @@ export const AppRouter: React.FC = () => (
}
/>

<Route path="templates">
<Route path="workspaces">
<Route
index
element={
<AuthAndFrame>
<TemplatesPage />
<WorkspacesPage />
</AuthAndFrame>
}
/>
<Route path=":organization/:template">
<Route
index
element={
<AuthAndFrame>
<TemplatePage />
</AuthAndFrame>
}
/>
<Route
path="create"
element={
<RequireAuth>
<CreateWorkspacePage />
</RequireAuth>
}
/>
</Route>
</Route>

<Route path="workspaces">
<Route path=":workspace">
<Route
index
Expand Down
5 changes: 5 additions & 0 deletionssite/src/api/api.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -115,6 +115,11 @@ export const getWorkspace = async (workspaceId: string): Promise<TypesGen.Worksp
return response.data
}

export const getWorkspaces = async (userID = "me"): Promise<TypesGen.Workspace[]> => {
const response = await axios.get<TypesGen.Workspace[]>(`/api/v2/users/${userID}/workspaces`)
return response.data
}

export const getWorkspaceByOwnerAndName = async (
organizationID: string,
username = "me",
Expand Down
4 changes: 2 additions & 2 deletionssite/src/app.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@ import { BrowserRouter as Router } from "react-router-dom"
import { SWRConfig } from "swr"
import { AppRouter } from "./AppRouter"
import { GlobalSnackbar } from "./components/GlobalSnackbar/GlobalSnackbar"
import {light } from "./theme"
import {dark } from "./theme"
import "./theme/globalFonts"
import { XServiceProvider } from "./xServices/StateContext"

Expand All@@ -31,7 +31,7 @@ export const App: React.FC = () => {
}}
>
<XServiceProvider>
<ThemeProvider theme={light}>
<ThemeProvider theme={dark}>
<CssBaseline />
<AppRouter />
<GlobalSnackbar />
Expand Down
2 changes: 1 addition & 1 deletionsite/src/components/AdminDropdown/AdminDropdown.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,7 +51,7 @@ export const AdminDropdown: React.FC = () => {
<>
<div className={styles.link}>
<ListItem selected={Boolean(anchorEl)} button onClick={onOpenAdminMenu}>
<ListItemText className="no-brace"color="primary"primary={Language.menuTitle} />
<ListItemText className="no-brace" primary={Language.menuTitle} />
{anchorEl ? <CloseDropdown /> : <OpenDropdown />}
</ListItem>
</div>
Expand Down
2 changes: 1 addition & 1 deletionsite/src/components/CodeBlock/CodeBlock.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@ const useStyles = makeStyles((theme) => ({
root: {
minHeight: 156,
background: theme.palette.background.default,
color: theme.palette.codeBlock.contrastText,
color: theme.palette.text.primary,
fontFamily: MONOSPACE_FONT_FAMILY,
fontSize: 13,
wordBreak: "break-all",
Expand Down
2 changes: 1 addition & 1 deletionsite/src/components/CodeExample/CodeExample.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -28,7 +28,7 @@ const useStyles = makeStyles((theme) => ({
justifyContent: "space-between",
alignItems: "center",
background: theme.palette.background.default,
color: theme.palette.codeBlock.contrastText,
color: theme.palette.primary.contrastText,
fontFamily: MONOSPACE_FONT_FAMILY,
fontSize: 13,
padding: theme.spacing(2),
Expand Down
7 changes: 3 additions & 4 deletionssite/src/components/ConfirmDialog/ConfirmDialog.test.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
import ThemeProvider from "@material-ui/styles/ThemeProvider"
import { fireEvent, render } from "@testing-library/react"
import React from "react"
import { act } from "react-dom/test-utils"
import {light } from "../../theme"
import {WrapperComponent } from "../../testHelpers/renderHelpers"
import { ConfirmDialog, ConfirmDialogProps } from "./ConfirmDialog"

namespace Helpers {
export const Component: React.FC<ConfirmDialogProps> = (props: ConfirmDialogProps) => {
return (
<ThemeProvider theme={light}>
<WrapperComponent>
<ConfirmDialog {...props} />
</ThemeProvider>
</WrapperComponent>
)
}
}
Expand Down
15 changes: 6 additions & 9 deletionssite/src/components/ConfirmDialog/ConfirmDialog.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -48,14 +48,11 @@ interface StyleProps {
const useStyles = makeStyles((theme) => ({
dialogWrapper: (props: StyleProps) => ({
"& .MuiPaper-root": {
background:
props.type === "info"
? theme.palette.confirmDialog.info.background
: theme.palette.confirmDialog.error.background,
background: props.type === "info" ? theme.palette.primary.main : theme.palette.error.dark,
},
}),
dialogContent: (props: StyleProps) => ({
color: props.type === "info" ? theme.palette.confirmDialog.info.text : theme.palette.confirmDialog.error.text,
color: props.type === "info" ? theme.palette.primary.contrastText : theme.palette.error.contrastText,
padding: theme.spacing(6),
textAlign: "center",
}),
Expand All@@ -65,15 +62,15 @@ const useStyles = makeStyles((theme) => ({
description: (props: StyleProps) => ({
color:
props.type === "info"
? fade(theme.palette.confirmDialog.info.text, 0.75)
: fade(theme.palette.confirmDialog.error.text, 0.75),
? fade(theme.palette.primary.contrastText, 0.75)
: fade(theme.palette.error.contrastText, 0.75),
lineHeight: "160%",

"& strong": {
color:
props.type === "info"
? fade(theme.palette.confirmDialog.info.text, 0.95)
: fade(theme.palette.confirmDialog.error.text, 0.95),
? fade(theme.palette.primary.contrastText, 0.95)
: fade(theme.palette.error.contrastText, 0.95),
},
}),
}))
Expand Down
6 changes: 3 additions & 3 deletionssite/src/components/CopyButton/CopyButton.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -52,13 +52,13 @@ const useStyles = makeStyles((theme) => ({
},
copyButton: {
borderRadius: 7,
background: theme.palette.codeBlock.button.main,
color: theme.palette.codeBlock.button.contrastText,
background: theme.palette.background.default,
color: theme.palette.primary.contrastText,
padding: theme.spacing(0.85),
minWidth: 32,

"&:hover": {
background: theme.palette.codeBlock.button.hover,
background: theme.palette.background.paper,
},
},
fileCopyIcon: {
Expand Down
2 changes: 1 addition & 1 deletionsite/src/components/Dialog/Dialog.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -161,7 +161,7 @@ const useButtonStyles = makeStyles((theme) => ({
},
},
confirmDialogCancelButton: (props: StyleProps) => {
const color = props.type === "info" ? theme.palette.confirmDialog.info.text : theme.palette.confirmDialog.error.text
const color = props.type === "info" ? theme.palette.primary.contrastText : theme.palette.error.contrastText
return {
background: fade(color, 0.15),
color,
Expand Down
2 changes: 1 addition & 1 deletionsite/src/components/Header/Header.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -68,7 +68,7 @@ const useStyles = makeStyles((theme) => ({
display: "flex",
alignItems: "center",
height: 126,
background: theme.palette.hero.main,
background: theme.palette.background.default,
boxShadow: theme.shadows[3],
},
topInner: {
Expand Down
6 changes: 2 additions & 4 deletionssite/src/components/HeaderButton/HeaderButton.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
import Button from "@material-ui/core/Button"
import {lighten,makeStyles } from "@material-ui/core/styles"
import { makeStyles } from "@material-ui/core/styles"
import React from "react"

export interface HeaderButtonProps {
Expand DownExpand Up@@ -28,10 +28,8 @@ export const HeaderButton: React.FC<HeaderButtonProps> = (props) => {
)
}

const useStyles = makeStyles((theme) => ({
const useStyles = makeStyles(() => ({
pageButton: {
whiteSpace: "nowrap",
backgroundColor: lighten(theme.palette.hero.main, 0.1),
color: "#B5BFD2",
},
}))
2 changes: 1 addition & 1 deletionsite/src/components/Margins/Margins.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@ export default {

const Template: Story = (args) => (
<Margins {...args}>
<div style={{ width: "100%", background: "lightgrey" }}>Here is some content that will not get too wide!</div>
<div style={{ width: "100%", background: "black" }}>Here is some content that will not get too wide!</div>
</Margins>
)

Expand Down
7 changes: 2 additions & 5 deletionssite/src/components/Margins/Margins.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,14 +8,11 @@ const useStyles = makeStyles(() => ({
maxWidth,
padding: `0 ${sidePadding}`,
flex: 1,
width: "100%",
},
}))

export const Margins: React.FC = ({ children }) => {
const styles = useStyles()
return (
<div>
<div className={styles.margins}>{children}</div>
</div>
)
return <div className={styles.margins}>{children}</div>
}
Loading

[8]ページ先頭

©2009-2025 Movatter.jp