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
13 changes: 11 additions & 2 deletions src/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
</ion-item>

<div class="ion-padding">
<ion-button v-if="isSpinnerActive" color="primary" expand="block">
<ion-spinner />
</ion-button>
<!-- @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 v-else color="primary" expand="block" @click.prevent="setOms()" @keyup.enter.stop>
{{ $t("Next") }}
<ion-icon slot="end" :icon="arrowForwardOutline" />
</ion-button>
Expand Down Expand Up @@ -69,6 +72,7 @@
IonItem,
IonLabel,
IonPage,
IonSpinner,
loadingController
} from "@ionic/vue";
import { defineComponent } from "vue";
Expand All @@ -94,6 +98,7 @@
IonItem,
IonLabel,
IonPage,
IonSpinner,
Logo
},
data () {
Expand All @@ -108,7 +113,8 @@
hideBackground: true,
isConfirmingForActiveSession: false,
loader: null as any,
loginOption: {} as any
loginOption: {} as any,
isSpinnerActive: false
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
isSpinnerActive: false
isLoading: false

};
},
ionViewWillEnter() {
Expand Down Expand Up @@ -203,6 +209,8 @@
return
}

this.isSpinnerActive = true

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

Expand All @@ -217,6 +225,7 @@
} else {
this.toggleOmsInput()
}
this.isSpinnerActive = false
},
async fetchLoginOptions() {
this.loginOption = {}
Expand All @@ -226,7 +235,7 @@
this.loginOption = resp.data
}
} catch (error) {
console.error(error)

Check warning on line 238 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 238 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 @@ -247,7 +256,7 @@
this.router.push('/')
}
} catch (error) {
console.error(error)

Check warning on line 259 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 259 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 samlLogin() {
Expand All @@ -260,7 +269,7 @@
this.router.push('/')
}
} catch (error) {
console.error(error)

Check warning on line 272 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 272 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 confirmActvSessnLoginOnRedrct() {
Expand Down
Loading