- Notifications
You must be signed in to change notification settings - Fork1.1k
refactor: move required external auth buttons to the submit side#18586
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
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
da84dd6db8a91b8a12f60a6ff6852c2be53d294d9bFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -207,7 +207,7 @@ const TaskForm: FC<TaskFormProps> = ({ templates }) => { | ||
| const selectedTemplate = templates.find( | ||
| (t) => t.id === selectedTemplateId, | ||
| ) as Template; | ||
| const { externalAuth,externalAuthError, isPollingExternalAuth } = | ||
| useExternalAuth(selectedTemplate.active_version_id); | ||
| const missedExternalAuth = externalAuth?.filter( | ||
| (auth) => !auth.optional && !auth.authenticated, | ||
| @@ -294,7 +294,7 @@ const TaskForm: FC<TaskFormProps> = ({ templates }) => { | ||
| </Select> | ||
| <div className="flex items-center gap-2"> | ||
| {missedExternalAuth && ( | ||
| <ExternalAuthButtons | ||
| template={selectedTemplate} | ||
| missedExternalAuth={missedExternalAuth} | ||
| @@ -303,7 +303,7 @@ const TaskForm: FC<TaskFormProps> = ({ templates }) => { | ||
| <Button size="sm" type="submit" disabled={isMissingExternalAuth}> | ||
| <Spinner | ||
| loading={createTaskMutation.isPending ||isPollingExternalAuth} | ||
| ||
| > | ||
| <SendIcon /> | ||
| </Spinner> | ||
| @@ -325,7 +325,7 @@ const ExternalAuthButtons: FC<ExternalAuthButtonProps> = ({ | ||
| template, | ||
| missedExternalAuth, | ||
| }) => { | ||
| const { startPollingExternalAuth,isPollingExternalAuth } = useExternalAuth( | ||
| template.active_version_id, | ||
| ); | ||
| @@ -335,16 +335,16 @@ const ExternalAuthButtons: FC<ExternalAuthButtonProps> = ({ | ||
| variant="outline" | ||
| key={auth.id} | ||
| size="sm" | ||
| disabled={isPollingExternalAuth || auth.authenticated} | ||
| onClick={() => { | ||
| window.open(auth.authenticate_url, "_blank", "width=900,height=600"); | ||
| startPollingExternalAuth(); | ||
| }} | ||
| > | ||
| <Spinner loading={isPollingExternalAuth}> | ||
| <ExternalImage src={auth.display_icon} /> | ||
| </Spinner> | ||
| Connect to {auth.display_name} | ||
| </Button> | ||
| ); | ||
| }); | ||
Uh oh!
There was an error while loading.Please reload this page.