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: 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

Merged
BrunoQuaresma merged 6 commits intomainfrombq/improve-external-auth-on-tasks
Jun 27, 2025
Merged
Show file tree
Hide file tree
Changes from1 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
PrevPrevious commit
NextNext commit
Apply asher's review comments
  • Loading branch information
@BrunoQuaresma
BrunoQuaresma committedJun 26, 2025
commit8a12f602fc8f87b18093d1560b0aed1af96ed77a
1 change: 1 addition & 0 deletionssite/src/hooks/useExternalAuth.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -50,5 +50,6 @@ export const useExternalAuth = (versionId: string | undefined) => {
externalAuthPollingState,
isLoadingExternalAuth,
externalAuthError: error,
isPollingExternalAuth: externalAuthPollingState === "polling",
};
};
14 changes: 7 additions & 7 deletionssite/src/pages/TasksPage/TasksPage.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -207,7 +207,7 @@ const TaskForm: FC<TaskFormProps> = ({ templates }) => {
const selectedTemplate = templates.find(
(t) => t.id === selectedTemplateId,
) as Template;
const { externalAuth,isLoadingExternalAuth, externalAuthError } =
const { externalAuth,externalAuthError, isPollingExternalAuth } =
useExternalAuth(selectedTemplate.active_version_id);
const missedExternalAuth = externalAuth?.filter(
(auth) => !auth.optional && !auth.authenticated,
Expand DownExpand Up@@ -294,7 +294,7 @@ const TaskForm: FC<TaskFormProps> = ({ templates }) => {
</Select>

<div className="flex items-center gap-2">
{missedExternalAuth &&isMissingExternalAuth &&(
{missedExternalAuth && (
<ExternalAuthButtons
template={selectedTemplate}
missedExternalAuth={missedExternalAuth}
Expand All@@ -303,7 +303,7 @@ const TaskForm: FC<TaskFormProps> = ({ templates }) => {

<Button size="sm" type="submit" disabled={isMissingExternalAuth}>
<Spinner
loading={createTaskMutation.isPending ||isLoadingExternalAuth}
loading={createTaskMutation.isPending ||isPollingExternalAuth}
Copy link
Member

Choose a reason for hiding this comment

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

I think this one should becreateTaskMutation.isPending || isLoadingExternalAuth || isPollingExternalAuth so it spins while waiting for auth to load as well right? (or we could use!missedExternalAuth).

BrunoQuaresma reacted with thumbs up emoji
>
<SendIcon />
</Spinner>
Expand All@@ -325,7 +325,7 @@ const ExternalAuthButtons: FC<ExternalAuthButtonProps> = ({
template,
missedExternalAuth,
}) => {
const { startPollingExternalAuth,isLoadingExternalAuth } = useExternalAuth(
const { startPollingExternalAuth,isPollingExternalAuth } = useExternalAuth(
template.active_version_id,
);

Expand All@@ -335,16 +335,16 @@ const ExternalAuthButtons: FC<ExternalAuthButtonProps> = ({
variant="outline"
key={auth.id}
size="sm"
disabled={isLoadingExternalAuth || auth.authenticated}
disabled={isPollingExternalAuth || auth.authenticated}
onClick={() => {
window.open(auth.authenticate_url, "_blank", "width=900,height=600");
startPollingExternalAuth();
}}
>
<Spinner loading={isLoadingExternalAuth}>
<Spinner loading={isPollingExternalAuth}>
<ExternalImage src={auth.display_icon} />
</Spinner>
Login with {auth.display_name}
Connect to {auth.display_name}
</Button>
);
});
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp