Skip to content

Commit

Permalink
Improved: message to be displayed after performing an operation on th…
Browse files Browse the repository at this point in the history
…e order

Changed the message to more informative when user either changes the shipping address or change pickup location. This updated message will only be displayed untill user does not refreshes the page, once refreshed the message will be changed to the default 'not-eligible order' message.
  • Loading branch information
ymaheshwari1 committed Jul 26, 2024
1 parent 77b9188 commit bf12b0f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"Add address": "Add address",
"An email will be sent to you when your item(s) are ready to collect at the new requested location(s).": "An email will be sent to you when your item(s) are ready to collect at the new requested location(s).",
"Are you sure you want to save the changes?": "Are you sure you want to save the changes?",
"Are you sure you want to cancel the order items?": "Are you sure you want to cancel the order items?",
"Cancel": "Cancel",
Expand Down
8 changes: 7 additions & 1 deletion src/views/Order.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@
<ion-button v-if="hasPermission(Actions.APP_SHPGRP_CNCL)" @click="cancel(shipGroup)" fill="clear" color="danger">{{ $t("Cancel") }}</ion-button>
</ion-card>
</div>
<div v-else-if="isOrderUpdated" class="ion-text-center ion-padding-top">
<ion-label>{{ $t("An email will be sent to you when your item(s) are ready to collect at the new requested location(s).") }}</ion-label>
</div>
<div v-else class="ion-text-center ion-padding-top">
<ion-label>{{ $t("Order item not eligible for reroute fulfilment") }}</ion-label>
</div>
Expand Down Expand Up @@ -150,7 +153,8 @@ export default defineComponent({
name: 'Shipping',
value: 'STANDARD'
}
]
],
isOrderUpdated: false
}
},
computed: {
Expand Down Expand Up @@ -286,6 +290,7 @@ export default defineComponent({
shipGroup.shipTo.postalAddress = shipGroup.updatedAddress
shipGroup.updatedAddress = null
showToast(translate("Changes saved"))
this.isOrderUpdated = true
} else {
showToast(translate("Failed to update the shipping addess"))
}
Expand Down Expand Up @@ -313,6 +318,7 @@ export default defineComponent({
if (resp.status === 200 && !hasError(resp)) {
shipGroup.facilityId = shipGroup.selectedFacility.facilityId
showToast(translate("Changes saved"))
this.isOrderUpdated = true
} else {
showToast(translate("Failed to update the pickup store"))
}
Expand Down

0 comments on commit bf12b0f

Please sign in to comment.