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

refactor(site): apply cosmetic changes and remove ExternalAuth from settings page#11756

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
BrunoQuaresma merged 2 commits intomainfrombq/refactor-external-auth
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
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
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,8 +24,9 @@ import {
MoreMenuTrigger,
ThreeDotsButton,
} from "components/MoreMenu/MoreMenu";
import { ExternalAuth } from "pages/CreateWorkspacePage/ExternalAuth";
import { ExternalAuthPollingState } from "pages/CreateWorkspacePage/CreateWorkspacePage";
import LoadingButton from "@mui/lab/LoadingButton";
import visuallyHidden from "@mui/utils/visuallyHidden";

export type ExternalAuthPageViewProps = {
isLoading: boolean;
Expand DownExpand Up@@ -60,8 +61,12 @@ export const ExternalAuthPageView: FC<ExternalAuthPageViewProps> = ({
<TableHead>
<TableRow>
<TableCell>Application</TableCell>
<TableCell>Link</TableCell>
<TableCell width="1%"></TableCell>
<TableCell>
<span aria-hidden css={{ ...visuallyHidden }}>
Link to connect
</span>
</TableCell>
<TableCell width="1%" />
</TableRow>
</TableHead>
<TableBody>
Expand DownExpand Up@@ -133,57 +138,59 @@ const ExternalAuthRow: FC<ExternalAuthRowProps> = ({
title={name}
avatar={
app.display_icon && (
<Avatar src={app.display_icon} variant="square" fitImage />
<Avatar
src={app.display_icon}
variant="square"
fitImage
size="sm"
/>
)
}
/>
</TableCell>
<TableCell>
<ExternalAuth
displayName={name}
// We could specify the user is linked, but the link is invalid.
// This could indicate it expired, or was revoked on the other end.
authenticated={authenticated}
authenticateURL={authURL}
displayIcon=""
message={authenticated ? "Authenticated" : "Click to Login"}
externalAuthPollingState={externalAuthPollingState}
startPollingExternalAuth={startPollingExternalAuth}
fullWidth={false}
/>
<TableCell css={{ textAlign: "right" }}>
<LoadingButton
disabled={authenticated}
variant="contained"
loading={externalAuthPollingState === "polling"}
onClick={() => {
window.open(authURL, "_blank", "width=900,height=600");
startPollingExternalAuth();
}}
>
{authenticated ? "Authenticated" : "Click to Login"}
</LoadingButton>
</TableCell>
<TableCell>
{(link || externalAuth?.authenticated) && (
<MoreMenu>
<MoreMenuTrigger>
<ThreeDotsButton />
</MoreMenuTrigger>
<MoreMenuContent>
<MoreMenuItem
onClick={async () => {
onValidateExternalAuth();
// This is kinda jank. It does a refetch of the thing
// it just validated... But we need to refetch to update the
// login button. And the 'onValidateExternalAuth' does the
// message display.
await refetch();
}}
>
Test Validate&hellip;
</MoreMenuItem>
<Divider />
<MoreMenuItem
danger
onClick={async () => {
onUnlinkExternalAuth();
await refetch();
}}
>
Unlink&hellip;
</MoreMenuItem>
</MoreMenuContent>
</MoreMenu>
)}
<MoreMenu>
<MoreMenuTrigger>
<ThreeDotsButton size="small" disabled={!authenticated} />
</MoreMenuTrigger>
<MoreMenuContent>
<MoreMenuItem
onClick={async () => {
onValidateExternalAuth();
// This is kinda jank. It does a refetch of the thing
// it just validated... But we need to refetch to update the
// login button. And the 'onValidateExternalAuth' does the
// message display.
await refetch();
}}
>
Test Validate&hellip;
</MoreMenuItem>
<Divider />
<MoreMenuItem
danger
onClick={async () => {
onUnlinkExternalAuth();
await refetch();
}}
>
Unlink&hellip;
</MoreMenuItem>
</MoreMenuContent>
</MoreMenu>
</TableCell>
</TableRow>
);
Expand Down
6 changes: 3 additions & 3 deletionssite/src/pages/UserSettingsPage/Sidebar.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -39,6 +39,9 @@ export const Sidebar: FC<SidebarProps> = ({ user }) => {
<SidebarNavItem href="appearance" icon={AppearanceIcon}>
Appearance
</SidebarNavItem>
<SidebarNavItem href="external-auth" icon={GitIcon}>
External Authentication
</SidebarNavItem>
{showSchedulePage && (
<SidebarNavItem href="schedule" icon={ScheduleIcon}>
Schedule
Expand All@@ -50,9 +53,6 @@ export const Sidebar: FC<SidebarProps> = ({ user }) => {
<SidebarNavItem href="ssh-keys" icon={FingerprintOutlinedIcon}>
SSH Keys
</SidebarNavItem>
<SidebarNavItem href="external-auth" icon={GitIcon}>
External Authentication
</SidebarNavItem>
<SidebarNavItem href="tokens" icon={VpnKeyOutlined}>
Tokens
</SidebarNavItem>
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp