@@ -24,8 +24,8 @@ import {
24
24
MoreMenuTrigger ,
25
25
ThreeDotsButton ,
26
26
} from "components/MoreMenu/MoreMenu" ;
27
- import { ExternalAuth } from "pages/CreateWorkspacePage/ExternalAuth" ;
28
27
import { ExternalAuthPollingState } from "pages/CreateWorkspacePage/CreateWorkspacePage" ;
28
+ import LoadingButton from "@mui/lab/LoadingButton" ;
29
29
30
30
export type ExternalAuthPageViewProps = {
31
31
isLoading :boolean ;
@@ -60,7 +60,7 @@ export const ExternalAuthPageView: FC<ExternalAuthPageViewProps> = ({
60
60
< TableHead >
61
61
< TableRow >
62
62
< TableCell > Application</ TableCell >
63
- < TableCell > Link </ TableCell >
63
+ < TableCell / >
64
64
< TableCell width = "1%" > </ TableCell >
65
65
</ TableRow >
66
66
</ TableHead >
@@ -133,57 +133,59 @@ const ExternalAuthRow: FC<ExternalAuthRowProps> = ({
133
133
title = { name }
134
134
avatar = {
135
135
app . display_icon && (
136
- < Avatar src = { app . display_icon } variant = "square" fitImage />
136
+ < Avatar
137
+ src = { app . display_icon }
138
+ variant = "square"
139
+ fitImage
140
+ size = "sm"
141
+ />
137
142
)
138
143
}
139
144
/>
140
145
</ 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
- />
146
+ < TableCell css = { { textAlign :"right" } } >
147
+ < LoadingButton
148
+ disabled = { authenticated }
149
+ variant = "contained"
150
+ loading = { externalAuthPollingState === "polling" }
151
+ onClick = { ( ) => {
152
+ window . open ( authURL , "_blank" , "width=900,height=600" ) ;
153
+ startPollingExternalAuth ( ) ;
154
+ } }
155
+ >
156
+ { authenticated ?"Authenticated" :"Click to Login" }
157
+ </ LoadingButton >
154
158
</ TableCell >
155
159
< 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
- await refetch ( ) ;
170
- } }
171
- >
172
- Test Validate…
173
- </ MoreMenuItem >
174
- < Divider />
175
- < MoreMenuItem
176
- danger
177
- onClick = { async ( ) => {
178
- onUnlinkExternalAuth ( ) ;
179
- await refetch ( ) ;
180
- } }
181
- >
182
- Unlink…
183
- </ MoreMenuItem >
184
- </ MoreMenuContent >
185
- </ MoreMenu >
186
- ) }
160
+ < MoreMenu >
161
+ < MoreMenuTrigger >
162
+ < ThreeDotsButton size = "small" disabled = { ! authenticated } />
163
+ </ MoreMenuTrigger >
164
+ < MoreMenuContent >
165
+ < MoreMenuItem
166
+ onClick = { async ( ) => {
167
+ onValidateExternalAuth ( ) ;
168
+ // This is kinda jank. It does a refetch of the thing
169
+ // it just validated... But we need to refetch to update the
170
+ // login button. And the 'onValidateExternalAuth' does the
171
+ // message display.
172
+ await refetch ( ) ;
173
+ } }
174
+ >
175
+ Test Validate…
176
+ </ MoreMenuItem >
177
+ < Divider />
178
+ < MoreMenuItem
179
+ danger
180
+ onClick = { async ( ) => {
181
+ onUnlinkExternalAuth ( ) ;
182
+ await refetch ( ) ;
183
+ } }
184
+ >
185
+ Unlink…
186
+ </ MoreMenuItem >
187
+ </ MoreMenuContent >
188
+ </ MoreMenu >
187
189
</ TableCell >
188
190
</ TableRow >
189
191
) ;