Skip to content

chore(site): refactor stories and test from page components #9603

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 31 commits into from
Sep 8, 2023
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
52fae61
Refactor AuditPage
BrunoQuaresma Sep 7, 2023
cc2a549
Refactor CliAuthPageView stories
BrunoQuaresma Sep 7, 2023
4f7bb53
Refactor CreateTemplateForm stories
BrunoQuaresma Sep 7, 2023
cd5b40f
Refactor CreateUserPage test
BrunoQuaresma Sep 7, 2023
c5b4eb5
Refactor CreateWorkspacePage tests
BrunoQuaresma Sep 7, 2023
6121f0d
Fix stories name
BrunoQuaresma Sep 7, 2023
a5440cb
Refactor AppereancePageView stories
BrunoQuaresma Sep 7, 2023
4b3d9f8
Refactor GitAuthSettingsPageView stories
BrunoQuaresma Sep 7, 2023
8f654b6
Refactor NetworkSettingsPageView stories
BrunoQuaresma Sep 7, 2023
1618d36
Refactor SecuritySettingsPageView stories
BrunoQuaresma Sep 7, 2023
64ee732
Refactor UserAuthSettingsPageView stories
BrunoQuaresma Sep 7, 2023
1e40624
Refactor GroupsPage stories
BrunoQuaresma Sep 7, 2023
974bb3f
Refactor LoginPage tests
BrunoQuaresma Sep 7, 2023
30a783a
Refactor SetupPage stories
BrunoQuaresma Sep 7, 2023
5e5e35c
Refactor StarterTemplatePageView stories
BrunoQuaresma Sep 7, 2023
429b823
Refactor StarterTemplatesPage tests
BrunoQuaresma Sep 8, 2023
5dd69e9
Refactor TemplatePage tests
BrunoQuaresma Sep 8, 2023
d5532f0
RefactorTemplateSettingsPage tests
BrunoQuaresma Sep 8, 2023
d6444c9
Refactor TemplatesPage tests
BrunoQuaresma Sep 8, 2023
08adf24
Flat TemplateVersionEditorPage
BrunoQuaresma Sep 8, 2023
d40214a
Refactor TemplateVersionPage stories
BrunoQuaresma Sep 8, 2023
5a8b649
Refactor UserSettingsPage stories
BrunoQuaresma Sep 8, 2023
2d1e6bf
Refactor UsersPage stories
BrunoQuaresma Sep 8, 2023
30ad92b
Simplify IndexPage
BrunoQuaresma Sep 8, 2023
5c64496
Refactor WorkspaceSettingsPage stories
BrunoQuaresma Sep 8, 2023
5d8bcde
Refactor WorkspacePage stories
BrunoQuaresma Sep 8, 2023
7f0e89e
Refactor Conditionals stories
BrunoQuaresma Sep 8, 2023
b5d365b
Fix typo
BrunoQuaresma Sep 8, 2023
2f55e6b
Fix imports
BrunoQuaresma Sep 8, 2023
b3114d6
Fix ChooseOne story
BrunoQuaresma Sep 8, 2023
397370c
Fix UserAuthSettingsPageView stories
BrunoQuaresma Sep 8, 2023
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
Prev Previous commit
Next Next commit
Refactor UserAuthSettingsPageView stories
  • Loading branch information
BrunoQuaresma committed Sep 8, 2023
commit 64ee7323b110a2177a529e75f305c38d22d2b138
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
import { ComponentMeta, Story } from "@storybook/react";
import {
UserAuthSettingsPageView,
UserAuthSettingsPageViewProps,
} from "./UserAuthSettingsPageView";
import { DeploymentGroup } from "api/types";
import { UserAuthSettingsPageView } from "./UserAuthSettingsPageView";
import type { Meta, StoryObj } from "@storybook/react";

export default {
const oidcGroup: DeploymentGroup = {
name: "OIDC",
description: "",
children: [] as DeploymentGroup[],
};

const ghGroup: DeploymentGroup = {
name: "Networking",
description: "",
children: [] as DeploymentGroup[],
};

const meta: Meta<typeof UserAuthSettingsPageView> = {
title: "pages/UserAuthSettingsPageView",
component: UserAuthSettingsPageView,
args: {
Expand All @@ -13,91 +23,101 @@ export default {
name: "OIDC Client ID",
description: "Client ID to use for Login with OIDC.",
value: "1234",
group: {
name: "OIDC",
},
group: oidcGroup,
flag: "oidc",
flag_shorthand: "o",
hidden: false,
},
{
name: "OIDC Allow Signups",
description: "Whether new users can sign up with OIDC.",
value: true,
group: {
name: "OIDC",
},
group: oidcGroup,
flag: "oidc",
flag_shorthand: "o",
hidden: false,
},
{
name: "OIDC Email Domain",
description:
"Email domains that clients logging in with OIDC must match.",
value: "@coder.com",
group: {
name: "OIDC",
},
group: oidcGroup,
flag: "oidc",
flag_shorthand: "o",
hidden: false,
},
{
name: "OIDC Issuer URL",
description: "Issuer URL to use for Login with OIDC.",
value: "https://coder.com",
group: {
name: "OIDC",
},
group: oidcGroup,
flag: "oidc",
flag_shorthand: "o",
hidden: false,
},
{
name: "OIDC Scopes",
description: "Scopes to grant when authenticating with OIDC.",
value: ["idk"],
group: {
name: "OIDC",
},
group: oidcGroup,
flag: "oidc",
flag_shorthand: "o",
hidden: false,
},
{
name: "OAuth2 GitHub Client ID",
description: "Client ID for Login with GitHub.",
value: "1224",
group: {
name: "GitHub",
},
group: ghGroup,
flag: "oidc",
flag_shorthand: "o",
hidden: false,
},
{
name: "OAuth2 GitHub Allow Signups",
description: "Whether new users can sign up with GitHub.",
value: true,
group: {
name: "GitHub",
},
group: ghGroup,
flag: "oidc",
flag_shorthand: "o",
hidden: false,
},
{
name: "OAuth2 GitHub Enterprise Base URL",
description:
"Base URL of a GitHub Enterprise deployment to use for Login with GitHub.",
value: "https://google.com",
group: {
name: "GitHub",
},
group: ghGroup,
flag: "oidc",
flag_shorthand: "o",
hidden: false,
},
{
name: "OAuth2 GitHub Allowed Orgs",
description:
"Organizations the user must be a member of to Login with GitHub.",
value: true,
group: {
name: "GitHub",
},
group: ghGroup,
flag: "oidc",
flag_shorthand: "o",
hidden: false,
},
{
name: "OAuth2 GitHub Allowed Teams",
description:
"Teams inside organizations the user must be a member of to Login with GitHub. Structured as: <organization-name>/<team-slug>.",
value: true,
group: {
name: "GitHub",
},
group: ghGroup,
flag: "oidc",
flag_shorthand: "o",
hidden: false,
},
],
},
} as ComponentMeta<typeof UserAuthSettingsPageView>;
};

export default meta;
type Story = StoryObj<typeof UserAuthSettingsPageView>;

const Template: Story<UserAuthSettingsPageViewProps> = (args) => (
<UserAuthSettingsPageView {...args} />
);
export const Page = Template.bind({});
export const Page: Story = {};