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: showing ion spinner until picker list is being fetched (#444) #445

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Loading