Skip to content

feat: create idp sync page skeleton #14543

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 14 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
feat: add help tooltip
  • Loading branch information
jaaydenh committed Sep 5, 2024
commit 82983463f837e35419b10568509381ae5e02ccdd
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import {
HelpTooltip,
HelpTooltipContent,
HelpTooltipLink,
HelpTooltipLinksGroup,
HelpTooltipText,
HelpTooltipTitle,
HelpTooltipTrigger,
} from "components/HelpTooltip/HelpTooltip";
import type { FC } from "react";
import { docs } from "utils/docs";

export const IdpSyncHelpTooltip: FC = () => {
return (
<HelpTooltip>
<HelpTooltipTrigger />
<HelpTooltipContent>
<HelpTooltipTitle>What is IdP Sync?</HelpTooltipTitle>
<HelpTooltipText>
View the current mappings between your external OIDC provider and
Coder. Use the Coder CLI to configure these mappings.
</HelpTooltipText>
<HelpTooltipLinksGroup>
<HelpTooltipLink href={docs("/admin/auth#group-sync-enterprise")}>
Configure IdP Sync
</HelpTooltipLink>
</HelpTooltipLinksGroup>
</HelpTooltipContent>
</HelpTooltip>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import { type FC, useEffect, useState } from "react";
import { Helmet } from "react-helmet-async";
import { useQuery, useQueryClient } from "react-query";
import { Link as RouterLink, useParams } from "react-router-dom";
import { docs } from "utils/docs";
import { pageTitle } from "utils/page";
import { useOrganizationSettings } from "../ManagementSettingsLayout";
import { docs } from "utils/docs";
import { IdpSyncHelpTooltip } from "./IdpSyncHelpTooltip";
import IdpSyncPageView from "./IdpSyncPageView";

export const IdpSyncPage: FC = () => {
Copy link
Member

Choose a reason for hiding this comment

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

Just calling this out because I don't see anything about this in the commented-out code: do we want to do a redirect if the user navigates to this page if organization.permissions.editMembers is false?

I know we're using that property to define whether we show the page link in the side navbar, but is there anything stopping someone from navigating to the page directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Parkreiner I haven't addressed permissions yet because a permission hasn't been defined for this page. Btw, how do other pages handle this case when the user doesn't have the permissions?

Expand Down Expand Up @@ -59,12 +60,13 @@ export const IdpSyncPage: FC = () => {
<SettingsHeader
title="IdP Sync"
description="Group and role sync mappings (configured outside Coder)."
tooltip={<IdpSyncHelpTooltip />}
/>
<Stack direction="row" spacing={2}>
<Button
startIcon={<LaunchOutlined />}
component="a"
href={docs("/cli/server#--notifications-webhook-endpoint")}
href={docs("/admin/auth#group-sync-enterprise")}
target="_blank"
>
Setup IdP Sync
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ const RoleTable: FC<RoleTableProps> = ({ roles }) => {
<Button
startIcon={<LaunchOutlined />}
component="a"
href={docs(
"/cli/server#--notifications-webhook-endpoint",
)}
href={docs("/admin/auth#group-sync-enterprise")}
target="_blank"
>
How to setup IdP role sync
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/ManagementSettingsPage/SidebarView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ const OrganizationSettingsNavigation: FC<
<SidebarNavSubItem
href={urlForSubpage(organization.name, "idp-sync")}
>
Idp Sync
IdP Sync
</SidebarNavSubItem>
)}
</Stack>
Expand Down