-
Notifications
You must be signed in to change notification settings - Fork 933
feat: Add preferences pages #893
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b579a7c
Add preferences page
BrunoQuaresma 70a782c
Fix AppRouter
BrunoQuaresma d64d8e5
Merge main
BrunoQuaresma 9a19e48
chore: Merge branch 'main' of github.com:coder/coder into bq/preferen…
BrunoQuaresma 32a5542
refactor: use react-router-dom outlet
BrunoQuaresma 20ddc3f
refactor: use Language object
BrunoQuaresma 2c30b54
chore: Merge branch 'main' of github.com:coder/coder into bq/preferen…
BrunoQuaresma b95af04
refactor: use Language object
BrunoQuaresma 0c8fde7
chore: Update site/src/components/TabPanel/TabPanel.stories.tsx
BrunoQuaresma b82c55e
Update site/src/components/TabPanel/TabPanel.stories.tsx
greyscaled 86a1d7a
Update site/src/components/TabPanel/TabSidebar.stories.tsx
greyscaled File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import Box from "@material-ui/core/Box" | ||
import React from "react" | ||
import { Outlet } from "react-router-dom" | ||
import { AuthAndNav } from "../Page" | ||
import { TabPanel } from "../TabPanel" | ||
|
||
export const Language = { | ||
accountLabel: "Account", | ||
securityLabel: "Security", | ||
sshKeysLabel: "SSH Keys", | ||
linkedAccountsLabel: "Linked Accounts", | ||
preferencesLabel: "Preferences", | ||
} | ||
|
||
const menuItems = [ | ||
{ label: Language.accountLabel, path: "/preferences/account" }, | ||
{ label: Language.securityLabel, path: "/preferences/security" }, | ||
{ label: Language.sshKeysLabel, path: "/preferences/ssh-keys" }, | ||
{ label: Language.linkedAccountsLabel, path: "/preferences/linked-accounts" }, | ||
] | ||
|
||
export const PreferencesLayout: React.FC = () => { | ||
return ( | ||
<AuthAndNav> | ||
<Box display="flex" flexDirection="column"> | ||
<Box style={{ maxWidth: "1380px", margin: "1em auto" }}> | ||
<TabPanel title={Language.preferencesLabel} menuItems={menuItems}> | ||
<Outlet /> | ||
greyscaled marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</TabPanel> | ||
</Box> | ||
</Box> | ||
</AuthAndNav> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Story } from "@storybook/react" | ||
import React from "react" | ||
import { TabPanel, TabPanelProps } from "." | ||
|
||
export default { | ||
title: "TabPanel/TabPanel", | ||
component: TabPanel, | ||
} | ||
|
||
const Template: Story<TabPanelProps> = (args: TabPanelProps) => <TabPanel {...args} /> | ||
|
||
export const Example = Template.bind({}) | ||
Example.args = { | ||
title: "Title", | ||
menuItems: [ | ||
{ label: "OAuth Settings", path: "oauthSettings" }, | ||
{ label: "Security", path: "oauthSettings", hasChanges: true }, | ||
{ label: "Hardware", path: "oauthSettings" }, | ||
], | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Story } from "@storybook/react" | ||
import React from "react" | ||
import { TabSidebar, TabSidebarProps } from "./TabSidebar" | ||
|
||
export default { | ||
title: "TabPanel/TabSidebar", | ||
component: TabSidebar, | ||
} | ||
|
||
const Template: Story<TabSidebarProps> = (args: TabSidebarProps) => <TabSidebar {...args} /> | ||
|
||
export const Example = Template.bind({}) | ||
Example.args = { | ||
menuItems: [ | ||
{ label: "OAuth Settings", path: "oauthSettings" }, | ||
{ label: "Security", path: "security", hasChanges: true }, | ||
{ label: "Hardware", path: "hardware" }, | ||
], | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 5 additions & 7 deletions
12
site/src/components/Panel/index.tsx → site/src/components/TabPanel/index.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from "react" | ||
import { Section } from "../../components/Section" | ||
|
||
const Language = { | ||
title: "Account", | ||
description: "Update your display name, email, profile picture, and dotfiles preferences.", | ||
} | ||
|
||
export const PreferencesAccountPage: React.FC = () => { | ||
return <Section title={Language.title} description={Language.description} /> | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from "react" | ||
import { Section } from "../../components/Section" | ||
|
||
const Language = { | ||
title: "Linked Accounts", | ||
description: | ||
"Linking your Coder account will add your workspace SSH key, allowing you to perform Git actions on all your workspaces.", | ||
} | ||
|
||
export const PreferencesLinkedAccountsPage: React.FC = () => { | ||
return <Section title={Language.title} description={Language.description} /> | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from "react" | ||
import { Section } from "../../components/Section" | ||
|
||
const Language = { | ||
title: "Security", | ||
description: "Changing your password will sign you out of your current session.", | ||
} | ||
|
||
export const PreferencesSecurityPage: React.FC = () => { | ||
return <Section title={Language.title} description={Language.description} /> | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from "react" | ||
import { Section } from "../../components/Section" | ||
|
||
const Language = { | ||
title: "SSH Keys", | ||
description: | ||
"Coder automatically inserts a private key into every workspace; you can add the corresponding public key to any services (such as Git) that you need access to from your workspace.", | ||
} | ||
|
||
export const PreferencesSSHKeysPage: React.FC = () => { | ||
return <Section title={Language.title} description={Language.description} /> | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.