Skip to content

Commit

Permalink
Merge pull request #449 from amansinghbais/#444
Browse files Browse the repository at this point in the history
Implemented: spinner inside of the edit picker modal (#444)
  • Loading branch information
ravilodhi authored Oct 21, 2024
2 parents 0b68f89 + 8469575 commit 56c0526
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/components/EditPickerModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@

<ion-list>
<ion-list-header>{{ translate("Staff") }}</ion-list-header>
<div class="ion-padding" v-if="!availablePickers.length">
{{ translate("No picker found") }}
<div v-if="isLoading" class="empty-state">
<ion-spinner name="crescent" />
<ion-label>{{ translate("Fetching pickers") }}</ion-label>
</div>
<div class="empty-state" v-else-if="!availablePickers.length">{{ translate('No picker found') }}</div>

<div v-else>
<ion-radio-group :value="selectedPicker.id">
<ion-item v-for="(picker, index) in availablePickers" :key="index" @click="updateSelectedPicker(picker.id)">
Expand Down Expand Up @@ -55,6 +58,7 @@ import {
IonRadio,
IonRadioGroup,
IonSearchbar,
IonSpinner,
IonTitle,
IonToolbar,
alertController,
Expand Down Expand Up @@ -88,14 +92,16 @@ export default defineComponent({
IonToolbar,
IonRadio,
IonRadioGroup,
IonSearchbar
IonSearchbar,
IonSpinner
},
data () {
return {
availablePickers: [] as any,
queryString: '',
selectedPicker: {} as any,
selectedPickerId: this.order.pickerIds[0]
selectedPickerId: this.order.pickerIds[0],
isLoading: false
}
},
async mounted() {
Expand All @@ -108,6 +114,7 @@ export default defineComponent({
this.selectedPicker = this.availablePickers.find((picker: any) => picker.id == id)
},
async findPickers() {
this.isLoading = true;
let inputFields = {}
this.availablePickers = []
Expand Down Expand Up @@ -159,6 +166,7 @@ export default defineComponent({
} catch (err) {
logger.error('Failed to fetch the pickers information or there are no pickers available', err)
}
this.isLoading = false;
},
async confirmSave() {
const message = translate("Replace current pickers with new selection?");
Expand Down

0 comments on commit 56c0526

Please sign in to comment.