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

Implemented: confirmation alert on inventory count upload (#85zrx64et) #173

Merged
merged 1 commit into from
Apr 18, 2023
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
2 changes: 2 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"Location": "Location",
"Login": "Login",
"Logout": "Logout",
"Make sure you've reviewed the products and their counts before uploading them for review": "Make sure you've reviewed the products and their counts before uploading them for review",
"No time zone found": "No time zone found",
"Ok": "Ok",
"OMS": "OMS",
Expand Down Expand Up @@ -49,5 +50,6 @@
"Update time zone": "Update time zone",
"Upload": "Upload",
"Username": "Username",
"Upload inventory count": "Upload inventory count",
"View": "View"
}
20 changes: 19 additions & 1 deletion src/views/Upload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<ion-button fill="clear" @click="removeItem(product.sku)">{{ $t( "Remove" ) }}</ion-button>
</ion-card>
<ion-fab vertical="bottom" horizontal="end" slot="fixed">
<ion-fab-button @click="upload()" :disabled="Object.keys(uploadProducts).length === 0">
<ion-fab-button @click="presentAlertOnUpload()" :disabled="Object.keys(uploadProducts).length === 0">
<ion-icon :icon="cloudUploadOutline" />
</ion-fab-button>
</ion-fab>
Expand All @@ -41,6 +41,7 @@

<script lang="ts">
import {
alertController,
IonBadge,
IonButton,
IonCard,
Expand Down Expand Up @@ -93,6 +94,23 @@ export default defineComponent({
removeItem (sku: any) {
this.store.dispatch('product/removeItemFromUploadProducts', sku)
},
async presentAlertOnUpload() {
const alert = await alertController.create({
header: this.$t("Upload inventory count"),
message: this.$t("Make sure you've reviewed the products and their counts before uploading them for review"),
buttons: [{
text: this.$t('Cancel'),
role: 'cancel',
},
{
text: this.$t('Upload'),
handler: () => {
this.upload()
}
}]
});
await alert.present();
},
upload () {
const inventoryCountRegister = Object.entries(this.uploadProducts).map((product: any) => {
return {"locationId": product[1].locationId, "productId": product[1].productId, "quantity": product[1].quantity};
Expand Down