-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/hotwax/fulfillment-pwa into…
… fulfillment-pwa/#178-productIdentifier
- Loading branch information
Showing
34 changed files
with
904 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export default { | ||
"APP_TURN_OFF_STORE": "APP_TURN_OFF_STORE", | ||
"APP_UPDT_STR_FULFLMNT_CONFIG": "APP_UPDT_STR_FULFLMNT_CONFIG", | ||
"APP_UPDT_ECOM_INV_CONFIG": "APP_UPDT_ECOM_INV_CONFIG", | ||
"APP_UNPACK_ORDER": "APP_UNPACK_ORDER", | ||
"APP_RECYCLE_ORDER": "APP_RECYCLE_ORDER", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<template> | ||
<ion-content> | ||
<ion-list> | ||
<ion-list-header>{{ $t('Options') }}</ion-list-header> | ||
<ion-item button @click="copyInfo"> | ||
<ion-icon slot="end" :icon="copyOutline" /> | ||
{{ $t("Copy ID") }} | ||
</ion-item> | ||
<ion-item button lines="none" @click="assignPickers"> | ||
<ion-icon slot="end" :icon="bagCheckOutline" /> | ||
{{ $t("Pick order") }} | ||
</ion-item> | ||
</ion-list> | ||
</ion-content> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { | ||
IonContent, | ||
IonIcon, | ||
IonItem, | ||
IonList, | ||
IonListHeader, | ||
modalController, | ||
popoverController, | ||
} from "@ionic/vue"; | ||
import { defineComponent } from "vue"; | ||
import { bagCheckOutline, copyOutline } from 'ionicons/icons' | ||
import { copyToClipboard } from "@/utils"; | ||
import AssignPickerModal from '@/views/AssignPickerModal.vue'; | ||
export default defineComponent({ | ||
name: "OrderActionsPopover", | ||
components: { | ||
IonContent, | ||
IonIcon, | ||
IonItem, | ||
IonList, | ||
IonListHeader | ||
}, | ||
props: ["order"], | ||
methods: { | ||
closePopover() { | ||
popoverController.dismiss(); | ||
}, | ||
copyInfo() { | ||
this.copyToClipboard(this.order.doclist.docs[0].orderName, 'Copied to clipboard') | ||
// closing the popover after copy action | ||
this.closePopover(); | ||
}, | ||
async assignPickers() { | ||
const assignPickerModal = await modalController.create({ | ||
component: AssignPickerModal, | ||
componentProps: { order: this.order } | ||
}); | ||
// dismissing the popover once the picker modal is closed | ||
assignPickerModal.onDidDismiss().finally(() => { | ||
this.closePopover(); | ||
}); | ||
return assignPickerModal.present(); | ||
}, | ||
}, | ||
setup() { | ||
return { | ||
bagCheckOutline, | ||
copyOutline, | ||
copyToClipboard | ||
} | ||
} | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
<template> | ||
<ion-content> | ||
<ion-list> | ||
<ion-list-header> | ||
{{ $t("Fulfillment capacity") }} | ||
</ion-list-header> | ||
<ion-item button @click="updateOrderLimitType('unlimited')"> | ||
<ion-icon slot="end" :icon="lockOpenOutline" /> | ||
{{ $t("Unlimited Capacity") }} | ||
</ion-item> | ||
<ion-item button @click="updateOrderLimitType('no-capacity')"> | ||
{{ $t("No Capacity") }} | ||
<ion-icon slot="end" :icon="lockClosedOutline" /> | ||
</ion-item> | ||
<ion-item button lines="none" @click="updateOrderLimitType('custom')"> | ||
{{ $t("Custom") }} | ||
</ion-item> | ||
</ion-list> | ||
</ion-content> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { | ||
IonContent, | ||
IonIcon, | ||
IonItem, | ||
IonList, | ||
IonListHeader, | ||
alertController, | ||
popoverController | ||
} from "@ionic/vue"; | ||
import { defineComponent } from "vue"; | ||
import { lockClosedOutline, lockOpenOutline } from 'ionicons/icons' | ||
import { translate } from '@/i18n'; | ||
import { showToast } from '@/utils'; | ||
export default defineComponent({ | ||
name: "OrderLimitPopover", | ||
components: { | ||
IonContent, | ||
IonIcon, | ||
IonItem, | ||
IonList, | ||
IonListHeader | ||
}, | ||
setup() { | ||
return { | ||
lockClosedOutline, | ||
lockOpenOutline | ||
} | ||
}, | ||
props: ['fulfillmentOrderLimit'], | ||
data() { | ||
return { | ||
setLimit: this.fulfillmentOrderLimit as any | ||
} | ||
}, | ||
methods: { | ||
async updateOrderLimitType(orderLimitType: string) { | ||
let header = "Unlimited fulfillment capacity" | ||
let message = "Unlimited capacity removes the fulfillment capacity limit entirely. To add a fulfillment capacity to this facility, use the custom option." | ||
let showInput = false | ||
if (orderLimitType === 'custom') { | ||
header = "Custom fulfillment capacity" | ||
message = "" | ||
showInput = true | ||
} else if (orderLimitType === 'no-capacity') { | ||
this.setLimit = 0 | ||
header = "No fulfillment capacity" | ||
message = "No capacity sets the fulfillment capacity to 0, preventing any new orders from being allocated to this facility. Use the \"Reject all orders\" option in the fulfillment pages to clear your facilities fulfillment queue. To add a fulfillment capacity to this facility, use the custom option." | ||
} else if (orderLimitType === 'unlimited') { | ||
this.setLimit = "" | ||
} | ||
this.showOrderLimitAlert(header, message, showInput) | ||
}, | ||
async showOrderLimitAlert(header: string, message: string, showInput: boolean) { | ||
const alert = await alertController.create({ | ||
header: translate(header), | ||
message: translate(message, {space: '</br></br>'}), | ||
inputs: showInput ? [{ | ||
name: "setLimit", | ||
placeholder: translate("Order fulfillment capacity"), | ||
type: "number", | ||
min: 0 | ||
}] : [], | ||
buttons: [{ | ||
text: translate('Cancel'), | ||
role: "cancel" | ||
}, | ||
{ | ||
text: translate('Apply'), | ||
handler: (data) => { | ||
let setLimit = this.setLimit as any; | ||
if(data) { | ||
if(data.setLimit === '') { | ||
showToast(translate('Please provide a value')) | ||
return false; | ||
} else if(data.setLimit <= 0) { | ||
showToast(translate('Provide a value greater than 0')) | ||
return false; | ||
} else { | ||
setLimit = data.setLimit | ||
} | ||
} | ||
popoverController.dismiss(setLimit) | ||
} | ||
}] | ||
}) | ||
await alert.present() | ||
} | ||
} | ||
}); | ||
</script> |
Oops, something went wrong.