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: implement CRUD UI for IDP organization sync settings#15503

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
jaaydenh merged 71 commits intomainfromjaaydenh/org-sync-settings-ui
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
71 commits
Select commitHold shift + click to select a range
d0baa8c
feat: initial commit for idp org sync settings
jaaydenhNov 13, 2024
6463076
feat: add export policy button
jaaydenhNov 15, 2024
f714986
feat: update badge styles for multiple selector
jaaydenhNov 17, 2024
072d775
feat: use input component and move export button
jaaydenhNov 17, 2024
f6e286c
feat: add delete button for org mapping
jaaydenhNov 17, 2024
acf8cbe
feat: disabled button states
jaaydenhNov 17, 2024
ad1aa84
feat: update export policy button to shadcn
jaaydenhNov 17, 2024
b01588d
fix: fix format
jaaydenhNov 17, 2024
6203d04
feat: display success/error toast on form submission
jaaydenhNov 20, 2024
bc37998
feat: create story for export policy button
jaaydenhNov 20, 2024
2c2246d
feat: update pill list component
jaaydenhNov 21, 2024
6971f91
feat: add down chevron to multiple selector
jaaydenhNov 21, 2024
6e87130
chore: update conventions for shadcn components
jaaydenhNov 23, 2024
a1b6e79
feat: use semantic list html for overflow pills
jaaydenhNov 24, 2024
36c8706
chore: update css variable colors
jaaydenhNov 24, 2024
a4e66c2
fix: make link style and behavior match existing links
jaaydenhNov 24, 2024
f7be49f
fix: use display name for org in multi-select component
jaaydenhNov 24, 2024
90a65fe
chore: cleanup
jaaydenhNov 25, 2024
c282765
fix: styling for x and chevron buttons
jaaydenhNov 25, 2024
40155bc
chore: extract fixed filter options to a variable
jaaydenhNov 25, 2024
a129820
fix: update focus styles
jaaydenhNov 25, 2024
8edd4b4
fix: multi-select placement fix
jaaydenhNov 25, 2024
e54e5ca
fix: improve export policy button logic
jaaydenhNov 25, 2024
bb16bd1
chore: update to use pointer instead of mouse events
jaaydenhNov 25, 2024
678a91d
fix: extract UUID testing to separate variable
jaaydenhNov 25, 2024
a13d9b2
fix: update error handling
jaaydenhNov 25, 2024
1b8efd1
chore: add source comment
jaaydenhNov 26, 2024
137c25c
chore: remove debounce
jaaydenhNov 26, 2024
46a4646
fix: format
jaaydenhNov 26, 2024
85a455c
feat: update form save logic
jaaydenhNov 26, 2024
a9e06f1
fix: remove popover and muted colors from shadcn
jaaydenhNov 26, 2024
d921b08
chore: cleanup
jaaydenhNov 26, 2024
ba665b4
fix: use form instead of sync settings for state
jaaydenhNov 26, 2024
8a0e789
chore: fix component filename casing
jaaydenhNov 26, 2024
234c0fb
fix: dont await form.setFieldValue
jaaydenhNov 26, 2024
7d88a38
feat: add radix visually hidden
jaaydenhNov 26, 2024
c6c9b16
fix: improve focus styling
jaaydenhNov 27, 2024
5322a4e
chore: cleanup
jaaydenhNov 27, 2024
eab8a0d
fix: format
jaaydenhNov 27, 2024
721d5d4
feat: updates for Badge component
jaaydenhNov 27, 2024
8986cbd
feat: updates for shadcn button component
jaaydenhNov 27, 2024
89a7b12
feat: update stories and input component
jaaydenhNov 27, 2024
148dca7
fix: format
jaaydenhNov 27, 2024
0c338b0
feat: add stories for switch component
jaaydenhNov 27, 2024
0cadc8b
feat: setup stories for Label component
jaaydenhNov 27, 2024
1d7153b
feat: setup stories for shadcn Dialog component
jaaydenhNov 27, 2024
a914c54
fix: format
jaaydenhNov 27, 2024
bd307c0
chore: make clasnames multi-line
jaaydenhNov 27, 2024
95bfd17
fix: use multiline classnames
jaaydenhNov 27, 2024
82bd850
fix: display blue outline on multiple selector when focused
jaaydenhNov 27, 2024
6eb6987
fix: format
jaaydenhNov 27, 2024
3822b2e
feat: add stories for MultiSelectCombobox
jaaydenhDec 2, 2024
fe17b1c
feat: add tooltip for assign default org switch
jaaydenhDec 2, 2024
e75e179
feat: add stories for IdpOrgSyncPageview
jaaydenhDec 2, 2024
c6e07ff
chore: extract UUID regex
jaaydenhDec 2, 2024
a3b9b27
chore: cleanup
jaaydenhDec 2, 2024
0601164
feat: add form validation schema
jaaydenhDec 2, 2024
b01e5d3
fix: cleanup paywall copy
jaaydenhDec 2, 2024
1c5b6ef
fix: cleanup
jaaydenhDec 2, 2024
6e2ee08
fix: remove useEffect
jaaydenhDec 2, 2024
ae30db0
chore: cleanup
jaaydenhDec 2, 2024
ac74cdc
fix: format
jaaydenhDec 2, 2024
a99dca5
chore: cleanup for PR review comments
jaaydenhDec 3, 2024
4c00959
fix: focus rings
jaaydenhDec 3, 2024
568a5a9
chore: use tailwinds sr-only class
jaaydenhDec 4, 2024
c313439
fix: fix 2xs fontSize
jaaydenhDec 4, 2024
506223d
chore: convert UUID regex to a function
jaaydenhDec 4, 2024
f223ab7
feat: add enabled check
jaaydenhDec 4, 2024
94ff4ca
chore: cleanup
jaaydenhDec 4, 2024
9101e0e
fix: fix format
jaaydenhDec 4, 2024
5ca2c0c
chore: cleanup
jaaydenhDec 4, 2024
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
3 changes: 2 additions & 1 deletionsite/components.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,5 +16,6 @@
"ui": "/components/ui",
"lib": "/lib",
"hooks": "/hooks"
}
},
"iconLibrary": "lucide"
}
12 changes: 11 additions & 1 deletionsite/package.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -50,7 +50,12 @@
"@mui/system": "5.16.7",
"@mui/utils": "5.16.6",
"@mui/x-tree-view": "7.18.0",
"@radix-ui/react-dialog": "1.1.2",
"@radix-ui/react-label": "2.1.0",
"@radix-ui/react-slider": "1.2.1",
"@radix-ui/react-slot": "1.1.0",
"@radix-ui/react-switch": "1.1.1",
"@radix-ui/react-visually-hidden": "1.1.0",
"@tanstack/react-query-devtools": "4.35.3",
"@xterm/addon-canvas": "0.7.0",
"@xterm/addon-fit": "0.10.0",
Expand All@@ -67,6 +72,7 @@
"chroma-js": "2.4.2",
"class-variance-authority": "0.7.0",
"clsx": "2.1.1",
"cmdk": "1.0.0",
"color-convert": "2.0.1",
"cron-parser": "4.9.0",
"cronstrue": "2.50.0",
Expand DownExpand Up@@ -176,7 +182,11 @@
"vite-plugin-checker": "0.8.0",
"vite-plugin-turbosnap": "1.0.3"
},
"browserslist": ["chrome 110", "firefox 111", "safari 16.0"],
"browserslist": [
"chrome 110",
"firefox 111",
"safari 16.0"
],
"resolutions": {
"optionator": "0.9.3",
"semver": "7.6.2"
Expand Down
2,604 changes: 1,773 additions & 831 deletionssite/pnpm-lock.yaml
View file
Open in desktop

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletionssite/src/api/api.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -712,6 +712,24 @@ class ApiMethods {
return response.data;
};

getOrganizationIdpSyncSettings =
async (): Promise<TypesGen.OrganizationSyncSettings> => {
const response = await this.axios.get<TypesGen.OrganizationSyncSettings>(
"/api/v2/settings/idpsync/organization",
);
return response.data;
};

patchOrganizationIdpSyncSettings = async (
data: TypesGen.OrganizationSyncSettings,
) => {
const response = await this.axios.patch<TypesGen.Response>(
"/api/v2/settings/idpsync/organization",
data,
);
return response.data;
};

/**
* @param organization Can be the organization's ID or name
*/
Expand Down
24 changes: 24 additions & 0 deletionssite/src/api/queries/idpsync.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
import { API } from "api/api";
import type { OrganizationSyncSettings } from "api/typesGenerated";
import type { QueryClient } from "react-query";

export const getOrganizationIdpSyncSettingsKey = () => [
"organizationIdpSyncSettings",
];

export const patchOrganizationSyncSettings = (queryClient: QueryClient) => {
return {
mutationFn: (request: OrganizationSyncSettings) =>
API.patchOrganizationIdpSyncSettings(request),
onSuccess: async () =>
await queryClient.invalidateQueries(getOrganizationIdpSyncSettingsKey()),
};
};

export const organizationIdpSyncSettings = (isIdpSyncEnabled: boolean) => {
return {
queryKey: getOrganizationIdpSyncSettingsKey(),
queryFn: () => API.getOrganizationIdpSyncSettings(),
enabled: isIdpSyncEnabled,
};
};
15 changes: 15 additions & 0 deletionssite/src/components/Badge/Badge.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
import type { Meta, StoryObj } from "@storybook/react";
import { Badge } from "./Badge";

const meta: Meta<typeof Badge> = {
title: "components/Badge",
component: Badge,
args: {
children: "Badge",
},
};

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

export const Default: Story = {};
32 changes: 32 additions & 0 deletionssite/src/components/Badge/Badge.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
/**
* Copied from shadc/ui on 11/13/2024
* @see {@link https://ui.shadcn.com/docs/components/badge}
*/
import { type VariantProps, cva } from "class-variance-authority";
import type { FC } from "react";
import { cn } from "utils/cn";

export const badgeVariants = cva(
"inline-flex items-center rounded-md border px-2.5 py-1 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
{
variants: {
variant: {
default:
"border-transparent bg-surface-secondary text-content-secondary shadow hover:bg-surface-tertiary",
},
},
defaultVariants: {
variant: "default",
},
},
);

export interface BadgeProps
extends React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof badgeVariants> {}

export const Badge: FC<BadgeProps> = ({ className, variant, ...props }) => {
return (
<div className={cn(badgeVariants({ variant }), className)} {...props} />
);
};
80 changes: 80 additions & 0 deletionssite/src/components/Button/Button.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
import type { Meta, StoryObj } from "@storybook/react";
import { Trash } from "lucide-react";
Copy link
Member

Choose a reason for hiding this comment

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

does this bring inall of lucide? how does this affect our bundle size?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Only the icons that are used,https://lucide.dev/guide/#code-optimization

import { Button } from "./Button";

const meta: Meta<typeof Button> = {
title: "components/Button",
component: Button,
args: {
children: (
<>
<Trash />
Button
</>
),
},
};

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

export const Default: Story = {};

export const Outline: Story = {
args: {
variant: "outline",
},
};

export const Subtle: Story = {
args: {
variant: "subtle",
},
};

export const Warning: Story = {
args: {
variant: "warning",
},
};

export const DefaultDisabled: Story = {
args: {
disabled: true,
},
};

export const OutlineDisabled: Story = {
args: {
variant: "outline",
disabled: true,
},
};

export const SubtleDisabled: Story = {
args: {
variant: "subtle",
disabled: true,
},
};

export const IconButtonDefault: Story = {
args: {
variant: "default",
children: <Trash />,
},
};

export const IconButtonOutline: Story = {
args: {
variant: "outline",
children: <Trash />,
},
};

export const IconButtonSubtle: Story = {
args: {
variant: "subtle",
children: <Trash />,
},
};
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
/**
* Copied from shadc/ui on 11/06/2024
* @see {@link https://ui.shadcn.com/docs/components/button}
*/
import { Slot } from "@radix-ui/react-slot";
import { type VariantProps, cva } from "class-variance-authority";
import * as React from "react";

import { type FC, forwardRef } from "react";
import { cn } from "utils/cn";

const buttonVariants = cva(
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 font-semibold border-solid",
exportconst buttonVariants = cva(
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-content-link disabled:pointer-events-none disabled:text-content-disabled [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 font-semibold border-solid cursor-pointer",
{
variants: {
variant: {
default:
"bg-surface-invert-primary text-content-invert hover:bg-surface-invert-secondary",
"bg-surface-invert-primary text-content-invert hover:bg-surface-invert-secondary border-none disabled:bg-surface-secondary",
outline:
"border border-border-default text-content-primary bg-transparent hover:bg-surface-secondary",
subtle:
Expand All@@ -19,7 +22,7 @@ const buttonVariants = cva(
"border border-border-error text-content-primary bg-surface-error hover:bg-transparent",
},
size: {
default: "h-10 px-3 py-2",
default: "h-9 px-3 py-2",
sm: "h-8 px-2 text-xs",
},
},
Expand All@@ -36,18 +39,16 @@ export interface ButtonProps
asChild?: boolean;
}

const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button";
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
);
},
);
Button.displayName = "Button";

export { Button, buttonVariants };
export const Button: FC<ButtonProps> = forwardRef<
HTMLButtonElement,
ButtonProps
>(({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button";
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
);
});
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp