Skip to content

Commit

Permalink
Merge pull request #173 from k2maan/#85zrx64et
Browse files Browse the repository at this point in the history
Implemented: confirmation alert on inventory count upload (#85zrx64et)
  • Loading branch information
adityasharma7 authored Apr 18, 2023
2 parents 2b2fa65 + 9da6c0a commit 57fd4ba
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
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

0 comments on commit 57fd4ba

Please sign in to comment.