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

Commita31d19d

Browse files
refactor(site): apply cosmetic changes and remove ExternalAuth from settings page (#11756)
1 parent7589df3 commita31d19d

File tree

2 files changed

+58
-51
lines changed

2 files changed

+58
-51
lines changed

‎site/src/pages/UserSettingsPage/ExternalAuthPage/ExternalAuthPageView.tsx

Lines changed: 55 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ import {
2424
MoreMenuTrigger,
2525
ThreeDotsButton,
2626
}from"components/MoreMenu/MoreMenu";
27-
import{ExternalAuth}from"pages/CreateWorkspacePage/ExternalAuth";
2827
import{ExternalAuthPollingState}from"pages/CreateWorkspacePage/CreateWorkspacePage";
28+
importLoadingButtonfrom"@mui/lab/LoadingButton";
29+
importvisuallyHiddenfrom"@mui/utils/visuallyHidden";
2930

3031
exporttypeExternalAuthPageViewProps={
3132
isLoading:boolean;
@@ -60,8 +61,12 @@ export const ExternalAuthPageView: FC<ExternalAuthPageViewProps> = ({
6061
<TableHead>
6162
<TableRow>
6263
<TableCell>Application</TableCell>
63-
<TableCell>Link</TableCell>
64-
<TableCellwidth="1%"></TableCell>
64+
<TableCell>
65+
<spanaria-hiddencss={{ ...visuallyHidden}}>
66+
Link to connect
67+
</span>
68+
</TableCell>
69+
<TableCellwidth="1%"/>
6570
</TableRow>
6671
</TableHead>
6772
<TableBody>
@@ -133,57 +138,59 @@ const ExternalAuthRow: FC<ExternalAuthRowProps> = ({
133138
title={name}
134139
avatar={
135140
app.display_icon&&(
136-
<Avatarsrc={app.display_icon}variant="square"fitImage/>
141+
<Avatar
142+
src={app.display_icon}
143+
variant="square"
144+
fitImage
145+
size="sm"
146+
/>
137147
)
138148
}
139149
/>
140150
</TableCell>
141-
<TableCell>
142-
<ExternalAuth
143-
displayName={name}
144-
// We could specify the user is linked, but the link is invalid.
145-
// This could indicate it expired, or was revoked on the other end.
146-
authenticated={authenticated}
147-
authenticateURL={authURL}
148-
displayIcon=""
149-
message={authenticated ?"Authenticated" :"Click to Login"}
150-
externalAuthPollingState={externalAuthPollingState}
151-
startPollingExternalAuth={startPollingExternalAuth}
152-
fullWidth={false}
153-
/>
151+
<TableCellcss={{textAlign:"right"}}>
152+
<LoadingButton
153+
disabled={authenticated}
154+
variant="contained"
155+
loading={externalAuthPollingState==="polling"}
156+
onClick={()=>{
157+
window.open(authURL,"_blank","width=900,height=600");
158+
startPollingExternalAuth();
159+
}}
160+
>
161+
{authenticated ?"Authenticated" :"Click to Login"}
162+
</LoadingButton>
154163
</TableCell>
155164
<TableCell>
156-
{(link||externalAuth?.authenticated)&&(
157-
<MoreMenu>
158-
<MoreMenuTrigger>
159-
<ThreeDotsButton/>
160-
</MoreMenuTrigger>
161-
<MoreMenuContent>
162-
<MoreMenuItem
163-
onClick={async()=>{
164-
onValidateExternalAuth();
165-
// This is kinda jank. It does a refetch of the thing
166-
// it just validated... But we need to refetch to update the
167-
// login button. And the 'onValidateExternalAuth' does the
168-
// message display.
169-
awaitrefetch();
170-
}}
171-
>
172-
Test Validate&hellip;
173-
</MoreMenuItem>
174-
<Divider/>
175-
<MoreMenuItem
176-
danger
177-
onClick={async()=>{
178-
onUnlinkExternalAuth();
179-
awaitrefetch();
180-
}}
181-
>
182-
Unlink&hellip;
183-
</MoreMenuItem>
184-
</MoreMenuContent>
185-
</MoreMenu>
186-
)}
165+
<MoreMenu>
166+
<MoreMenuTrigger>
167+
<ThreeDotsButtonsize="small"disabled={!authenticated}/>
168+
</MoreMenuTrigger>
169+
<MoreMenuContent>
170+
<MoreMenuItem
171+
onClick={async()=>{
172+
onValidateExternalAuth();
173+
// This is kinda jank. It does a refetch of the thing
174+
// it just validated... But we need to refetch to update the
175+
// login button. And the 'onValidateExternalAuth' does the
176+
// message display.
177+
awaitrefetch();
178+
}}
179+
>
180+
Test Validate&hellip;
181+
</MoreMenuItem>
182+
<Divider/>
183+
<MoreMenuItem
184+
danger
185+
onClick={async()=>{
186+
onUnlinkExternalAuth();
187+
awaitrefetch();
188+
}}
189+
>
190+
Unlink&hellip;
191+
</MoreMenuItem>
192+
</MoreMenuContent>
193+
</MoreMenu>
187194
</TableCell>
188195
</TableRow>
189196
);

‎site/src/pages/UserSettingsPage/Sidebar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ export const Sidebar: FC<SidebarProps> = ({ user }) => {
3939
<SidebarNavItemhref="appearance"icon={AppearanceIcon}>
4040
Appearance
4141
</SidebarNavItem>
42+
<SidebarNavItemhref="external-auth"icon={GitIcon}>
43+
External Authentication
44+
</SidebarNavItem>
4245
{showSchedulePage&&(
4346
<SidebarNavItemhref="schedule"icon={ScheduleIcon}>
4447
Schedule
@@ -50,9 +53,6 @@ export const Sidebar: FC<SidebarProps> = ({ user }) => {
5053
<SidebarNavItemhref="ssh-keys"icon={FingerprintOutlinedIcon}>
5154
SSH Keys
5255
</SidebarNavItem>
53-
<SidebarNavItemhref="external-auth"icon={GitIcon}>
54-
External Authentication
55-
</SidebarNavItem>
5656
<SidebarNavItemhref="tokens"icon={VpnKeyOutlined}>
5757
Tokens
5858
</SidebarNavItem>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp