Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/hotwax/fulfillment-pwa into…
Browse files Browse the repository at this point in the history
… fulfillment-pwa/#244-completedpage
  • Loading branch information
amansinghbais committed Oct 9, 2023
2 parents 99f8cd7 + 6f44fe3 commit 8c0348f
Show file tree
Hide file tree
Showing 37 changed files with 2,890 additions and 234 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ VUE_APP_VIEW_SIZE=10
VUE_APP_BASE_URL=
VUE_APP_PERMISSION_ID=
VUE_APP_ALIAS={}
VUE_APP_DEFAULT_LOG_LEVEL="error"
VUE_APP_MAPPING_TYPES={"IMPORD": "IMP_ORD_MAPPING_PREF","EXPORD": "EXP_PKD_ORD_MAPPING_PREF"}
VUE_APP_MAPPING_IMPORD={"orderId": { "label": "Order ID", "value": "" }, "facilityId": { "label": "Facility ID", "value": "" },"trackingCode": { "label": "Tracking Code", "value": "" }}
VUE_APP_MAPPING_EXPORD={"shipment-id": { "label": "Shipment ID", "value": "" }, "order-id": { "label": "Order ID", "value": "" },"to-name": { "label": "To Name", "value": "" },"address1": { "label": "Address 1", "value": "" },"address2": { "label": "Address 2", "value": "" },"city": { "label": "City", "value": "" },"state": { "label": "State", "value": "" },"zip-code": { "label": "Zip Code", "value": "" },"country-code": { "label": "Country Code", "value": "" },"full-to-address": { "label": "Full Address", "value": "" },"phone-number": { "label": "Phone Number", "value": "" },"email-address": { "label": "Email", "value": "" },"weight": { "label": "Weight", "value": "" },"quantity": { "label": "Quantity", "value": "" },"product-name": { "label": "Product Name", "value": "" },"product-sku": { "label": "Product Sku", "value": "" },"shipping-method": { "label": "Shipping Method", "value": "" },"facility-name": { "label": "Facility Name", "value": "" },"facility-address1": { "label": "Facility Address 1", "value": "" },"facility-address2": { "label": "Facility Address 2", "value": "" },"facility-city": { "label": "Facility City", "value": "" },"facility-state": { "label": "Facility State", "value": "" },"facility-zip-code": { "label": "Facility Zip Code", "value": "" },"facility-phone": { "label": "Facility Phone", "value": "" },"facility-full-address": { "label": "Facility Full Address", "value": "" }}
Expand Down
2,193 changes: 2,131 additions & 62 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fulfillment",
"version": "1.10.0",
"version": "1.13.1",
"private": true,
"description": "An Ionic project",
"scripts": {
Expand All @@ -16,8 +16,8 @@
"@capacitor/core": "^2.4.7",
"@casl/ability": "^6.0.0",
"@hotwax/app-version-info": "^1.0.0",
"@hotwax/dxp-components": "^1.3.4",
"@hotwax/oms-api": "^1.9.0",
"@hotwax/dxp-components": "^1.7.5",
"@hotwax/oms-api": "^1.10.0",
"@ionic/core": "6.7.5",
"@ionic/vue": "6.7.5",
"@ionic/vue-router": "6.7.5",
Expand Down
12 changes: 8 additions & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,16 @@ export default defineComponent({
})
},
methods: {
async presentLoader() {
async presentLoader(options = { message: '', backdropDismiss: true }) {
// When having a custom message remove already existing loader
if(options.message && this.loader) this.dismissLoader();
if (!this.loader) {
this.loader = await loadingController
.create({
message: this.$t("Click the backdrop to dismiss."),
message: options.message ? this.$t(options.message) : this.$t("Click the backdrop to dismiss."),
translucent: true,
backdropDismiss: true
backdropDismiss: options.backdropDismiss
});
}
this.loader.present();
Expand All @@ -59,7 +62,8 @@ export default defineComponent({
}
},
async unauthorised() {
this.store.dispatch("user/logout");
// Mark the user as unauthorised, this will help in not making the logout api call in actions
this.store.dispatch("user/logout", { isUserUnauthorised: true });
const redirectUrl = window.location.origin + '/login';
window.location.href = `${process.env.VUE_APP_LOGIN_URL}?redirectUrl=${redirectUrl}`;
},
Expand Down
6 changes: 4 additions & 2 deletions src/adapter/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { api, client, getConfig, hasError, initialise, resetConfig, updateInstanceUrl, updateToken } from '@hotwax/oms-api'
import { api, client, getConfig, hasError, initialise, logout, resetConfig, updateInstanceUrl, updateToken, getUserFacilities } from '@hotwax/oms-api'

export {
api,
client,
getConfig,
hasError,
initialise,
logout,
resetConfig,
updateInstanceUrl,
updateToken
updateToken,
getUserFacilities
}
3 changes: 2 additions & 1 deletion src/authorization/Actions.ts
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",
}
4 changes: 3 additions & 1 deletion src/authorization/Rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ export default {
"APP_EXIM_VIEW": "",
"APP_UPLOAD_IMPORT_ORDERS_VIEW": "",
"APP_DOWNLOAD_PACKED_ORDERS_VIEW": "",
"APP_TURN_OFF_STORE": "COMMON_ADMIN",
"APP_UPDT_STR_FULFLMNT_CONFIG": "COMMON_ADMIN",
"APP_UPDT_ECOM_INV_CONFIG": "COMMON_ADMIN",
"APP_UNPACK_ORDER": "COMMON_ADMIN",
"APP_RECYCLE_ORDER": "COMMON_ADMIN",
"APP_STOREFULFILLMENT_ADMIN": "STOREFULFILLMENT_ADMIN",
} as any
8 changes: 6 additions & 2 deletions src/components/CreateMappingModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default defineComponent({
},
props: ["content", "mappings", "mappingType"],
mounted() {
// mappings needs to be in format { <key>: { value: <value>, label: <label>, isSelected | optional: <boolean> }}
// mappings needs to be in format { <key>: { value: <value>, label: <label>, isSelected | optional: <boolean>, isCustomField | optional: <boolean> }}
this.fieldMapping = JSON.parse(JSON.stringify(this.mappings));
this.fileColumns = Object.keys(this.content[0]);
},
Expand All @@ -115,7 +115,11 @@ export default defineComponent({
// removing label from mappings as we don't need to save label with the mappings as it will just increase the size of the value
Object.keys(this.fieldMapping).map((mapping) => {
mappings[mapping] = {
mappings[mapping] = this.fieldMapping[mapping].isCustomField ? {
value: this.fieldMapping[mapping].value,
isSelected: this.fieldMapping[mapping].isSelected,
isCustomField: this.fieldMapping[mapping].isCustomField
} : {
value: this.fieldMapping[mapping].value,
isSelected: this.fieldMapping[mapping].isSelected
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/EditPickersModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ export default defineComponent({
}
},
async confirmSave() {
const message = this.$t("Are you sure you want to remove the current pickers from the picklist and replace them with new pickers?");
const message = this.$t("Replace current pickers with new selection?");
const alert = await alertController.create({
header: this.$t("Edit pickers"),
header: this.$t("Replace pickers"),
message,
buttons: [
{
Expand Down
2 changes: 1 addition & 1 deletion src/components/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ion-menu side="start" content-id="main-content" type="overlay" :disabled="!isUserAuthenticated">
<ion-header>
<ion-toolbar>
<ion-title>{{ currentFacility.name }}</ion-title>
<ion-title>{{ currentFacility.facilityName }}</ion-title>
</ion-toolbar>
</ion-header>

Expand Down
73 changes: 73 additions & 0 deletions src/components/OrderActionsPopover.vue
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>
34 changes: 28 additions & 6 deletions src/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"All": "All",
"App": "App",
"Are you sure you want to remove the current pickers from the picklist and replace them with new pickers?": "Are you sure you want to remove the current pickers from the picklist and replace them with new pickers?",
"A store represents a company or a unique catalog of products. If your OMS is connected to multiple eCommerce stores selling different collections of products, you may have multiple Product Stores set up in HotWax Commerce.": "A store represents a company or a unique catalog of products. If your OMS is connected to multiple eCommerce stores selling different collections of products, you may have multiple Product Stores set up in HotWax Commerce.",
"doesn't have any completed orders right now.": "{facilityName} doesn't have any completed orders right now.",
"doesn't have any orders in progress right now.": "{facilityName} doesn't have any orders in progress right now.",
Expand All @@ -15,7 +14,9 @@
"Are you sure you want to change the time zone to?": "Are you sure you want to change the time zone to?",
"Are you sure you want to delete this CSV mapping? This action cannot be undone.": "Are you sure you want to delete this CSV mapping? This action cannot be undone.",
"Are you sure you want to update this CSV mapping? This action cannot be undone.": "Are you sure you want to update this CSV mapping? This action cannot be undone.",
"Are you sure you want perform this action?": "Are you sure you want perform this action?",
"Are you sure you want to perform this action?": "Are you sure you want to perform this action?",
"Are you sure you want to reject outstanding order(s)?": "Are you sure you want to reject { ordersCount } outstanding order(s)?",
"Are you sure you want to reject in progress order(s)?": "Are you sure you want to reject { ordersCount } in progress order(s)?",
"Assign Pickers": "Assign Pickers",
"Box added successfully": "Box added successfully",
"Boxes": "Boxes",
Expand All @@ -31,6 +32,7 @@
"Control whether the store's inventory should be made available for online sales or not.": "Control whether the store's inventory should be made available for online sales or not.",
"Copied": "Copied { value }",
"Copied to clipboard": "Copied to clipboard",
"Copy ID": "Copy ID",
"Country Code": "Country Code",
"CSV Mapping": "CSV Mapping",
"Custom Label": "Custom Label",
Expand All @@ -40,10 +42,8 @@
"Dismiss": "Dismiss",
"Delete": "Delete",
"Delete mapping": "Delete mapping",
"Download": "Download",
"Download orders that are packed and haven't been shipped yet. Use the downloaded file to send the packed order details to a carrier where shipping labels and tracking codes will be generated.": "Download orders that are packed and haven't been shipped yet. Use the downloaded file to send the packed order details to a carrier where shipping labels and tracking codes will be generated.",
"Download packed orders": "Download packed orders",
"eCom Store": "eCom Store",
"ECom inventory status updated successfully": "ECom inventory status updated successfully",
"Edit packaging": "Edit packaging",
"Edit pickers": "Edit pickers",
"Edit Pickers": "Edit Pickers",
Expand All @@ -52,7 +52,10 @@
"Enter mapping name": "Enter mapping name",
"Enter value": "Enter value",
"EXIM": "EXIM",
"Export": "Export",
"Export Orders": "Export Orders",
"Export orders that are packed and haven't been shipped yet. Use the exported file to send the packed order details to a carrier where shipping labels and tracking codes will be generated.": "Export orders that are packed and haven't been shipped yet. Use the exported file to send the packed order details to a carrier where shipping labels and tracking codes will be generated.",
"Export packed orders": "Export packed orders",
"Facility": "Facility",
"Facility Address 1": "Facility Address 1",
"Facility Address 2": "Facility Address 2",
Expand All @@ -67,6 +70,7 @@
"Failed to add box": "Failed to add box",
"Failed to create picklist for orders": "Failed to create picklist for orders",
"Failed to delete CSV mapping.": "Failed to delete CSV mapping.",
"Failed to fetch eCom inventory config": "Failed to fetch eCom inventory config",
"Failed to generate shipping label": "Failed to generate shipping label",
"Failed to get packed orders information": "Failed to get packed orders information",
"Failed to pack order": "Failed to pack order",
Expand All @@ -78,6 +82,7 @@
"Failed to reject in progress orders": "Failed to reject in progress orders",
"Failed to reject outstanding orders": "Failed to reject outstanding orders",
"Failed to update CSV mapping.": "Failed to update CSV mapping.",
"Failed to update eCom inventory status": "Failed to update eCom inventory status",
"Failed to update facility": "Failed to update facility",
"Failed to update order": "Failed to update order",
"Field mapping name": "Field mapping name",
Expand All @@ -89,6 +94,9 @@
"Generate shipping label": "Generate shipping label",
"Go to OMS": "Go to OMS",
"Go to Launchpad": "Go to Launchpad",
"is identified as unfulfillable. other containing this product will be unassigned from this store and sent to be rebrokered.": "{ productName } is identified as unfulfillable. { space } { orders } other { orderText } containing this product will be unassigned from this store and sent to be rebrokered.",
"is identified as unfulfillable. This order item will be unassigned from this store and sent to be rebrokered.": "{ productName } is identified as unfulfillable. { space } This order item will be unassigned from this store and sent to be rebrokered.",
"is identified as. This order item will be unassigned from the store and sent to be rebrokered.": "{ productName } is identified as { rejectReason }. This order item will be unassigned from the store and sent to be rebrokered.",
"item": "item",
"items": "items",
"Import": "Import",
Expand All @@ -102,13 +110,15 @@
"Loading": "Loading",
"Login": "Login",
"Logging in": "Logging in",
"Logging out": "Logging out",
"Logout": "Logout",
"Loyalty": "Loyalty",
"Make sure all the labels provided are correct.": "Make sure all the labels provided are correct.",
"Make sure all the mappings you have selected is correct.": "Make sure all the mappings you have selected is correct.",
"Map all fields": "Map all fields",
"Mapping name": "Mapping name",
"Mismatch": "Mismatch",
"No data available!": "No data available!",
"No data Found.": "No data Found.",
"No new file upload. Please try again": "No new file upload. Please try again",
"No reason": "No reason",
Expand All @@ -125,6 +135,7 @@
"On": "On",
"Online Order Fulfillment": "Online Order Fulfillment",
"Open": "Open",
"Options": "Options",
"Ordered": "Ordered",
"Order ID": "Order ID",
"Order packed successfully": "Order packed successfully",
Expand All @@ -148,6 +159,7 @@
"Packed Orders": "Packed Orders",
"Password": "Password",
"Phone Number": "Phone Number",
"Pick order": "Pick order",
"Pickers successfully replaced in the picklist with the new selections.": "Pickers successfully replaced in the picklist with the new selections.",
"picklists": "{count} picklists",
"Picklist created successfully": "Picklist created successfully",
Expand Down Expand Up @@ -179,6 +191,8 @@
"Rejecting has been started. All outstanding orders will be rejected shortly.": "Rejecting has been started. All outstanding orders will be rejected shortly.",
"Regenerate shipping label": "Regenerate shipping label",
"Replace": "Replace",
"Replace pickers": "Replace pickers",
"Replace current pickers with new selection?": "Replace current pickers with new selection?",
"Report": "Report",
"Report an issue": "Report an issue",
"Result Size": "Result Size",
Expand All @@ -202,6 +216,7 @@
"Select the fields you want to include in your export": "Select the fields you want to include in your export",
"Select time zone": "Select time zone",
"Select your preferred language.": "Select your preferred language.",
"Selected Fields: ": "Selected Fields: ",
"Sell inventory online": "Sell inventory online",
"Sell online": "Sell online",
"Settings": "Settings",
Expand Down Expand Up @@ -243,10 +258,15 @@
"To Name": "To Name",
"Tracking Code": "Tracking Code",
"Tracking ID": "Tracking ID",
"Turn off eCom inventory": "Turn off eCom inventory",
"Turn on eCom inventory": "Turn on eCom inventory",
"Turn off eCom inventory for ": "Turn off eCom inventory for { facilityName }",
"Turn on eCom inventory for ": "Turn on eCom inventory for { facilityName }",
"Turn off fulfillment": "Turn off fulfillment",
"Turn on fulfillment": "Turn on fulfillment",
"Turn on fulfillment for ": "Turn on fulfillment for { facilityName }",
"Turn off fulfillment for ": "Turn off fulfillment for { facilityName }",
"Unable to open as browser is blocking pop-ups.": "Unable to open { documentName } as browser is blocking pop-ups.",
"Unpack": "Unpack",
"Unpacking this order will send it back to 'In progress' and it will have to be repacked.": "Unpacking this order will send it back to 'In progress' and it will have to be repacked.",
"Update": "Update",
Expand All @@ -263,5 +283,7 @@
"You are shipping orders. You cannot unpack and edit orders after they have been shipped. Are you sure you are ready to ship this orders?": "You are shipping { count } order. { space } You cannot unpack and edit orders after they have been shipped. Are you sure you are ready to ship this order? | You are shipping { count } orders. { space } You cannot unpack and edit orders after they have been shipped. Are you sure you are ready to ship these orders?",
"You do not have permission to access this page": "You do not have permission to access this page",
"Zip Code": "Zip Code",
", and other products are identified as unfulfillable. other orders containing these products will be unassigned from this store and sent to be rebrokered.": "{ productName }, and { products } other products are identified as unfulfillable. { space } { orders } other orders containing these products will be unassigned from this store and sent to be rebrokered."
", and other products are identified as unfulfillable. These order items will be unassigned from this store and sent to be rebrokered.": "{ productName }, and { products } other products are identified as unfulfillable. { space } These order items will be unassigned from this store and sent to be rebrokered.",
", and other products are identified as unfulfillable. other containing these products will be unassigned from this store and sent to be rebrokered.": "{ productName }, and { products } other products are identified as unfulfillable. { space } { orders } other { orderText } containing these products will be unassigned from this store and sent to be rebrokered.",
", and other products were identified as unfulfillable. These items will be unassigned from this store and sent to be rebrokered.": "{ productName }, and { products } other products were identified as unfulfillable. { space } These items will be unassigned from this store and sent to be rebrokered."
}
Loading

0 comments on commit 8c0348f

Please sign in to comment.