Skip to content

Commit

Permalink
Merge pull request #445 from amansinghbais/#444
Browse files Browse the repository at this point in the history
Improved: showing ion spinner until picker list is being fetched (#444)
  • Loading branch information
ravilodhi authored Oct 21, 2024
2 parents ccb498a + 18f060f commit c11efee
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"Failed to update configuration": "Failed to update configuration",
"Failed to print shipping label and packing slip": "Failed to print shipping label and packing slip",
"Failed to update product store setting.": "Failed to update product store setting.",
"Fetching pickers": "Fetching pickers",
"First name": "First name",
"Generate packing slips": "Generate packing slips",
"Generate shipping documents": "Generate shipping documents",
Expand Down
1 change: 1 addition & 0 deletions src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"Failed to update configuration": "No se pudo actualizar la configuración",
"Failed to print shipping label and packing slip": "Error al imprimir la etiqueta de envío y la hoja de embalaje",
"Failed to update product store setting.": "Failed to update product store setting.",
"Fetching pickers": "Fetching pickers",
"First name": "Nombre",
"Generate packing slips": "Generar documentos de embalaje",
"Generate shipping documents": "Generar documentos de envío",
Expand Down
1 change: 1 addition & 0 deletions src/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"Failed to update configuration": "設定の更新に失敗しました",
"Failed to print shipping label and packing slip": "出荷ラベルと納品書の印刷に失敗しました。",
"Failed to update product store setting.":"Failed to update product store setting.",
"Fetching pickers": "Fetching pickers",
"First name": "",
"Generate packing slips": "内容明細票の作成",
"Generate shipping documents": "出荷書類を生成する",
Expand Down
15 changes: 13 additions & 2 deletions src/views/AssignPickerModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
<ion-content ref="contentRef" :scroll-events="true" @ionScroll="enableScrolling()">
<ion-searchbar v-model="queryString" @keyup.enter="queryString = $event.target.value; searchPicker()"/>

<div class="ion-text-center ion-margin-top" v-if="!availablePickers.length">{{ translate('No picker found') }}</div>
<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>

<ion-list v-else>
<ion-list-header>{{ translate("Staff") }}</ion-list-header>
Expand Down Expand Up @@ -64,11 +68,13 @@ import {
IonHeader,
IonIcon,
IonItem,
IonLabel,
IonList,
IonListHeader,
IonRadio,
IonRadioGroup,
IonSearchbar,
IonSpinner,
IonTitle,
IonToolbar,
IonInfiniteScroll,
Expand All @@ -94,11 +100,13 @@ export default defineComponent({
IonHeader,
IonIcon,
IonItem,
IonLabel,
IonList,
IonListHeader,
IonRadio,
IonRadioGroup,
IonSearchbar,
IonSpinner,
IonTitle,
IonToolbar,
IonInfiniteScroll,
Expand All @@ -111,7 +119,8 @@ export default defineComponent({
queryString: '',
availablePickers: [],
isScrollable: true,
isScrollingEnabled: false
isScrollingEnabled: false,
isLoading: false
}
},
methods: {
Expand Down Expand Up @@ -155,6 +164,7 @@ export default defineComponent({
});
},
async getPicker(vSize, vIndex) {
this.isLoading = true;
let inputFields = {}
if(this.queryString.length > 0) {
Expand Down Expand Up @@ -216,6 +226,7 @@ export default defineComponent({
logger.error(translate('Something went wrong'))
}
this.isScrollable = this.availablePickers.length < total;
this.isLoading = false;
}
},
async mounted() {
Expand Down

0 comments on commit c11efee

Please sign in to comment.