Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved: added spinner in launchpad login next button to be shown while checkLoginOption request accomplishes (#88) #89

Merged
merged 5 commits into from
Aug 23, 2024
9 changes: 7 additions & 2 deletions src/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
<div class="ion-padding">
<!-- @keyup.enter.stop to stop the form from submitting on enter press as keyup.enter is already bound
through the form above, causing both the form and the button to submit. -->
<ion-button color="primary" expand="block" @click.prevent="setOms()" @keyup.enter.stop>
<ion-button color="primary" expand="block" @click.prevent="isCheckingOms ? '' : setOms()" @keyup.enter.stop>
{{ $t("Next") }}
<ion-icon slot="end" :icon="arrowForwardOutline" />
<ion-spinner v-if="isCheckingOms" name="crescent" data-spinner-size="medium" slot="end" />
<ion-icon v-else slot="end" :icon="arrowForwardOutline" />
</ion-button>
</div>
</section>
Expand Down Expand Up @@ -106,6 +107,7 @@
isConfirmingForActiveSession: false,
loader: null as any,
loginOption: {} as any,
isCheckingOms: false,
isLoggingIn: false
};
},
Expand Down Expand Up @@ -212,6 +214,8 @@
return
}

this.isCheckingOms = true

const instanceURL = this.instanceUrl.trim().toLowerCase();
if (!this.baseURL) this.authStore.setOMS(this.alias[instanceURL] ? this.alias[instanceURL] : instanceURL);

Expand All @@ -226,6 +230,7 @@
} else {
this.toggleOmsInput()
}
this.isCheckingOms = false
},
async fetchLoginOptions() {
this.loginOption = {}
Expand All @@ -236,7 +241,7 @@
await this.authStore.setMaargInstance(resp.data.maargInstanceUrl)
}
} catch (error) {
console.error(error)

Check warning on line 244 in src/views/Login.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

Unexpected console statement

Check warning on line 244 in src/views/Login.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

Unexpected console statement
}
},
async login() {
Expand All @@ -258,7 +263,7 @@
this.router.push('/')
}
} catch (error) {
console.error(error)

Check warning on line 266 in src/views/Login.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

Unexpected console statement

Check warning on line 266 in src/views/Login.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

Unexpected console statement
}
this.isLoggingIn = false;
},
Expand All @@ -273,7 +278,7 @@
}
} catch (error) {
this.router.push('/')
console.error(error)

Check warning on line 281 in src/views/Login.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

Unexpected console statement

Check warning on line 281 in src/views/Login.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

Unexpected console statement
}
},
async basicLogin() {
Expand Down
Loading