Skip to content

feat: integrate backend with idp sync page #14755

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 13 commits into from
Sep 24, 2024
Prev Previous commit
fix: fix stories
  • Loading branch information
jaaydenh committed Sep 24, 2024
commit f166784b54cc7f0432d0f779a49f184dc865a33d
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
MockGroup,
MockGroup2,
MockGroupSyncSettings,
MockGroupSyncSettings2,
MockRoleSyncSettings,
} from "testHelpers/entities";
import { IdpSyncPageView } from "./IdpSyncPageView";
Expand All @@ -15,26 +16,32 @@ const meta: Meta<typeof IdpSyncPageView> = {
export default meta;
type Story = StoryObj<typeof IdpSyncPageView>;

const groupsMap = new Map<string, string>();

for (const group of [MockGroup, MockGroup2]) {
groupsMap.set(group.id, group.display_name || group.name);
}

export const Empty: Story = {
args: {
groupSyncSettings: undefined,
roleSyncSettings: undefined,
groups: [MockGroup, MockGroup2],
groupsMap: undefined,
},
};

export const Default: Story = {
args: {
groupSyncSettings: MockGroupSyncSettings,
roleSyncSettings: MockRoleSyncSettings,
groups: [MockGroup, MockGroup2],
groupsMap,
},
};

export const MissingGroups: Story = {
args: {
groupSyncSettings: MockGroupSyncSettings,
groupSyncSettings: MockGroupSyncSettings2,
roleSyncSettings: MockRoleSyncSettings,
groups: [],
groupsMap,
},
};
13 changes: 13 additions & 0 deletions site/src/testHelpers/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2613,6 +2613,19 @@ export const MockGroupSyncSettings: TypesGen.GroupSyncSettings = {
auto_create_missing_groups: false,
};

export const MockGroupSyncSettings2: TypesGen.GroupSyncSettings = {
field: "group-test",
mapping: {
"idp-group-1": [
"fbd2116a-8961-4954-87ae-e4575bd29ce0",
"13de3eb4-9b4f-49e7-b0f8-0c3728a0d2e3",
],
"idp-group-2": ["fbd2116a-8961-4954-87ae-e4575bd29ce2"],
},
regex_filter: "@[a-zA-Z0-9_]+",
auto_create_missing_groups: false,
};

export const MockRoleSyncSettings: TypesGen.RoleSyncSettings = {
field: "role-test",
mapping: {
Expand Down
Loading