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: 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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jaaydenh merged 13 commits intomainfromjaaydenh/idp-sync
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
13 commits
Select commitHold shift + click to select a range
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
PrevPrevious commit
NextNext commit
chore: cleanup
  • Loading branch information
@jaaydenh
jaaydenh committedSep 20, 2024
commit6e303f42df0b1a25e03bc06df49697a85236eb89
7 changes: 7 additions & 0 deletionssite/src/api/queries/organizations.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -269,6 +269,13 @@ export const organizationsPermissions = (
},
action: "read",
},
viewIdpSyncSettings: {
object: {
resource_type: "idpsync_settings",
organization_id: organizationId,
},
action: "read",
},
});

// The endpoint takes a flat array, so to avoid collisions prepend each
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,7 @@ import {
organizationsPermissions,
roleIdpSyncSettings,
} from "api/queries/organizations";
import { ErrorAlert } from "components/Alert/ErrorAlert";
import { EmptyState } from "components/EmptyState/EmptyState";
import { FeatureStageBadge } from "components/FeatureStageBadge/FeatureStageBadge";
import { Loader } from "components/Loader/Loader";
Expand All@@ -27,12 +28,6 @@ export const IdpSyncPage: FC = () => {
const { organization: organizationName } = useParams() as {
organization: string;
};

// feature visibility and permissions to be implemented when integrating with backend
// const feats = useFeatureVisibility();
// const { organization: organizationName } = useParams() as {
// organization: string;
// };
const { organizations } = useOrganizationSettings();

const organization = organizations?.find((o) => o.name === organizationName);
Expand All@@ -48,8 +43,6 @@ export const IdpSyncPage: FC = () => {
roleIdpSyncSettings(organizationName),
);

// const permissions = permissionsQuery.data;

if (!organization) {
return <EmptyState message="Organization not found" />;
}
Expand All@@ -62,6 +55,19 @@ export const IdpSyncPage: FC = () => {
return <Loader />;
}

const error =
groupIdpSyncSettingsQuery.error ||
roleIdpSyncSettingsQuery.error ||
groupsQuery.error;
if (
error ||
!groupIdpSyncSettingsQuery.data ||
!roleIdpSyncSettingsQuery.data ||
!groupsQuery.data
) {
return <ErrorAlert error={error} />;
}

return (
<>
<Helmet>
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
import type { Interpolation, Theme } from "@emotion/react";
import { useTheme } from "@emotion/react";
import LaunchOutlined from "@mui/icons-material/LaunchOutlined";
import Button from "@mui/material/Button";
import Skeleton from "@mui/material/Skeleton";
Expand DownExpand Up@@ -39,8 +38,6 @@ export const IdpSyncPageView: FC<IdpSyncPageViewProps> = ({
roleSyncSettings,
groups,
}) => {
// const theme = useTheme();

const groupsMap = new Map<string, string>();
if (groups) {
for (const group of groups) {
Expand DownExpand Up@@ -101,6 +98,29 @@ export const IdpSyncPageView: FC<IdpSyncPageViewProps> = ({
</Stack>
</fieldset>
</Stack>
{groupSyncSettings?.mapping && roleSyncSettings?.mapping && (
<div
css={(theme) => ({
margin: 0,
fontSize: 13,
paddingBottom: 14,
color: theme.palette.text.secondary,
"& strong": {
color: theme.palette.text.primary,
},
})}
>
Showing{" "}
<strong>
{Object.entries(groupSyncSettings?.mapping).length}
</strong>{" "}
groups and{" "}
<strong>
{Object.entries(roleSyncSettings?.mapping).length}
</strong>{" "}
provisioners
</div>
)}
<Stack spacing={6}>
<IdpMappingTable
type="Group"
Expand Down
2 changes: 1 addition & 1 deletionsite/src/pages/ManagementSettingsPage/SidebarView.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -297,7 +297,7 @@ const OrganizationSettingsNavigation: FC<
Provisioners
</SidebarNavSubItem>
)}
{organization.permissions.editMembers && (
{organization.permissions.viewIdpSyncSettings && (
<SidebarNavSubItem
href={urlForSubpage(organization.name, "idp-sync")}
>
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp