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: Online Store Order Limit on Online Fulfillment Card in the settings page (#241) #255

Merged
merged 18 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
3204b02
Implemented: Store Order Limit on Online Fulfillment Card in the sett…
amansinghbais Aug 24, 2023
4a1b2ab
Fixed: changed the indentation, removed console, used console.error f…
amansinghbais Aug 24, 2023
c5d431b
Merge branch 'main' of https://github.com/amansinghbais/fulfillment-p…
amansinghbais Aug 29, 2023
8e28f5d
Fixed: removed merge conflict markers and updated api functions (#241)
amansinghbais Aug 31, 2023
fd3271f
Fixed: variable names, translation entries and argument type (#241)
amansinghbais Sep 1, 2023
d10352e
Improved: changed the variable and function name, and fixed some issu…
amansinghbais Sep 1, 2023
828e405
Improved: condition for api call fail check (#241)
amansinghbais Sep 1, 2023
cface96
Improved: unused function updateFulfillmentStatus removed (#241)
amansinghbais Sep 1, 2023
73a131f
Fixed: code for settings page and function names (#241)
amansinghbais Sep 4, 2023
d69cf34
Improved: code for orderCount api call, added a check for getting cou…
amansinghbais Sep 5, 2023
0086825
Improved: code for calling api's parallely and removed cache from per…
amansinghbais Sep 7, 2023
5fcd264
Improved: code for store order limit (#241)
amansinghbais Sep 11, 2023
8eb82c6
Improved: code for popover header and translation (#241)
amansinghbais Sep 11, 2023
62ebbfd
Improved: calling orderCount api when facility changes (#241)
amansinghbais Sep 18, 2023
2e11e55
Merge branch 'main' of https://github.com/hotwax/fulfillment-pwa into…
amansinghbais Sep 18, 2023
9e8cb58
Merge branch 'main' of https://github.com/hotwax/fulfillment-pwa into…
amansinghbais Oct 9, 2023
3463145
Fixed: unused space in a line (#241)
amansinghbais Oct 9, 2023
97f1471
Improved: alert buttons handling for apply case (#241)
amansinghbais Oct 10, 2023
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
24 changes: 20 additions & 4 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"Additional documents": "Additional documents",
"Address 1": "Address 1",
"Address 2": "Address 2",
"Apply": "Apply",
"Authenticating": "Authenticating",
"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.",
Expand All @@ -26,12 +27,15 @@
"Completed": "Completed",
"Configuration Missing": "Configuration Missing",
"Confirm": "Confirm",
"Configure the order fulfillment capacity of your facility.": "Configure the order fulfillment capacity of your facility.",
"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",
"Country Code": "Country Code",
"CSV Mapping": "CSV Mapping",
"Custom Label": "Custom Label",
"Custom": "Custom",
"Custom fulfillment capacity": "Custom fulfillment capacity",
"Customer letter": "Customer letter",
"Damaged": "Damaged",
"Define custom label for": "Define custom label for {field}",
Expand Down Expand Up @@ -80,7 +84,7 @@
"File downloaded successfully": "File downloaded successfully",
"File uploaded successfully": "File uploaded successfully",
"Full Address": "Full Address",
"Fulfill online orders": "Fulfill online orders",
"Fulfillment Capacity": "Fulfillment Capacity",
"Generate packing slip": "Generate packing slip",
"Generate shipping label": "Generate shipping label",
"Go to OMS": "Go to OMS",
Expand All @@ -105,14 +109,20 @@
"Map all fields": "Map all fields",
"Mapping name": "Mapping name",
"Mismatch": "Mismatch",
"Next day": "Next day",
"New mapping": "New mapping",
"No data Found.": "No data Found.",
"No capacity removes 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.": "No capacity removes 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. {space}To add a fulfillment capacity to this facility, use the custom option.",
"No new file upload. Please try again": "No new file upload. Please try again",
"No fulfillment capacity": "No fulfillment capacity",
"No reason": "No reason",
"No results found for . Try searching Open or Completed tab instead. If you still can't find what you're looking for, try switching stores.": "No results found for { searchedQuery }. Try searching Open or Completed tab instead.{ lineBreak } If you still can't find what you're looking for, try switching stores.",
"No results found for . Try searching In Progress or Open tab instead. If you still can't find what you're looking for, try switching stores.": "No results found for { searchedQuery }. Try searching In Progress or Open tab instead.{ lineBreak } If you still can't find what you're looking for, try switching stores.",
"No results found for . Try searching In Progress or Completed tab instead. If you still can't find what you're looking for, try switching stores.": "No results found for { searchedQuery }. Try searching In Progress or Completed tab instead.{ lineBreak } If you still can't find what you're looking for, try switching stores.",
"No time zone found": "No time zone found",
"Not in Stock": "Not in Stock",
"No Capacity": "No Capacity",
"No packed shipments to ship for these orders": "No packed shipments to ship for these orders",
"order": "order",
"of": "of",
"Off": "Off",
Expand All @@ -121,6 +131,10 @@
"On": "On",
"Online Order Fulfillment": "Online Order Fulfillment",
"Open": "Open",
"orders allocated today": "{orderCount} orders allocated today",
"orders in fulfillment queue": "{orderCount} orders in fulfillment queue",
"Order fulfillment capacity": "Order fulfillment capacity",
"Order fulfillment capacity updated successfully": "Order fulfillment capacity updated successfully",
"Ordered": "Ordered",
"Order ID": "Order ID",
"Order packed successfully": "Order packed successfully",
Expand All @@ -131,9 +145,6 @@
"Order updated successfully": "Order updated successfully",
"orders": "orders",
"Out of stock": "Out of stock",
"New mapping": "New mapping",
"Next day": "Next day",
"No packed shipments to ship for these orders": "No packed shipments to ship for these orders",
"package": "package",
"packages": "packages",
"Pack": "Pack",
Expand Down Expand Up @@ -196,6 +207,7 @@
"Select your preferred language.": "Select your preferred language.",
"Sell inventory online": "Sell inventory online",
"Sell online": "Sell online",
"Setting fulfillment capacity to 0 disables new order from being allocated to this facility. Leave this empty if this facility's fulfillment capacity is unrestricted.": "Setting fulfillment capacity to 0 disables new order from being allocated to this facility. Leave this empty if this facility's fulfillment capacity is unrestricted.",
"Settings": "Settings",
"Set Limit": "Set Limit",
"Ship": "Ship",
Expand Down Expand Up @@ -238,6 +250,10 @@
"Turn on fulfillment": "Turn on fulfillment",
"Turn on fulfillment for ": "Turn on fulfillment for { facilityName }",
"Turn off fulfillment for ": "Turn off fulfillment for { facilityName }",
"Unlimited": "Unlimited",
"Unlimited Capacity": "Unlimited Capacity",
"Unlimited capacity removes the fulfillment capacity limit entirely. To add a fulfillment capacity to this facility, use the custom option.": "Unlimited capacity removes the fulfillment capacity limit entirely. To add a fulfillment capacity to this facility, use the custom option.",
"Unlimited fulfillment capacity": "Unlimited fulfillment capacity",
"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 Down
24 changes: 20 additions & 4 deletions src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"Additional documents": "Additional documents",
"Address 1": "Address 1",
"Address 2": "Address 2",
"Apply": "Apply",
"Authenticating": "Authenticating",
"Are you sure you want to change the time zone to?": "¿Estás seguro/a de que quieres cambiar la zona horaria a?",
"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.",
Expand All @@ -26,11 +27,14 @@
"Completed": "Completado",
"Configuration Missing": "Configuración Faltante",
"Confirm": "Confirmar",
"Configure the order fulfillment capacity of your facility.": "Configure the order fulfillment capacity of your facility.",
"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": "Copiado {texto}",
"Copied to clipboard": "Copiado al portapapeles",
"Country Code": "Country Code",
"CSV Mapping": "CSV Mapping",
"Custom": "Custom",
"Custom fulfillment capacity": "Custom fulfillment capacity",
"Custom Label": "Etiqueta Personalizada",
"Customer letter": "Carta al Cliente",
"Damaged": "Dañado",
Expand Down Expand Up @@ -80,7 +84,7 @@
"File downloaded successfully": "Archivo descargado exitosamente",
"File uploaded successfully": "Archivo cargado exitosamente",
"Full Address": "Full Address",
"Fulfill online orders": "Fulfill online orders",
"Fulfillment Capacity": "Fulfillment Capacity",
"Generate packing slip": "Generate packing slip",
"Generate shipping label": "Generate shipping label",
"Go to OMS": "Go to OMS",
Expand All @@ -105,15 +109,23 @@
"Map all fields": "Map all fields",
"Mapping name": "Mapping name",
"Mismatch": "Inconsistencia",
"New mapping": "New mapping",
"Next day": "Día siguiente",
"No Capacity": "No Capacity",
"No capacity removes 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.": "No capacity removes 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. {space}To add a fulfillment capacity to this facility, use the custom option.",
"No data Found.": "No data Found.",
"No new file upload. Please try again": "No se cargó ningún archivo nuevo. Por favor, inténtalo nuevamente.",
"No reason": "Sin motivo",
"No results found for . Try searching Open or Completed tab instead. If you still can't find what you're looking for, try switching stores.": "No results found for { searchedQuery }. Try searching Open or Completed tab instead.{ lineBreak }If you still can't find what you're looking for, try switching stores.",
"No results found for . Try searching In Progress or Open tab instead. If you still can't find what you're looking for, try switching stores.": "No results found for { searchedQuery }. Try searching In Progress or Open tab instead.{ lineBreak } If you still can't find what you're looking for, try switching stores.",
"No results found for . Try searching In Progress or Completed tab instead. If you still can't find what you're looking for, try switching stores.": "No results found for { searchedQuery }. Try searching In Progress or Completed tab instead.{ lineBreak } If you still can't find what you're looking for, try switching stores.",
"No time zone found": "No se encontró zona horaria",
"No fulfillment capacity": "No fulfillment capacity",
"Not in Stock": "No en Stock",
"No packed shipments to ship for these orders": "No hay envíos empacados para estos pedidos",
"order": "pedido",
"orders allocated today": "{orderCount} orders allocated today",
"orders in fulfillment queue": "{orderCount} orders in fulfillment queue",
"of": "de",
"Off": "Apagado",
"OMS": "OMS",
Expand All @@ -122,6 +134,8 @@
"Online Order Fulfillment": "Online Order Fulfillment",
"Open": "Abierto",
"Ordered": "Ordenado",
"Order fulfillment capacity": "Order fulfillment capacity",
"Order fulfillment capacity updated successfully": "Order fulfillment capacity updated successfully",
"Order ID": "ID del Pedido",
"Order packed successfully": "Pedido empacado exitosamente",
"Order packed successfully. Document generation in process": "Order packed successfully. Document generation in process",
Expand All @@ -131,9 +145,6 @@
"Order updated successfully": "Pedido actualizado exitosamente",
"orders": "pedidos",
"Out of stock": "Agotado",
"New mapping": "New mapping",
"Next day": "Día siguiente",
"No packed shipments to ship for these orders": "No hay envíos empacados para estos pedidos",
"package": "paquete",
"packages": "paquetes",
"Pack": "Empacar",
Expand Down Expand Up @@ -197,6 +208,7 @@
"Select your preferred language.": "Select your preferred language.",
"Sell inventory online": "Sell inventory online",
"Sell online": "Sell online",
"Setting fulfillment capacity to 0 disables new order from being allocated to this facility. Leave this empty if this facility's fulfillment capacity is unrestricted.": "Setting fulfillment capacity to 0 disables new order from being allocated to this facility. Leave this empty if this facility's fulfillment capacity is unrestricted.",
"Settings": "Configuraciones",
"Set Limit": "Establecer Límite",
"Ship": "Enviar",
Expand Down Expand Up @@ -238,6 +250,10 @@
"Turn on fulfillment": "Activar Cumplimiento",
"Turn on fulfillment for ": "Activar cumplimiento para {facilityName}",
"Turn off fulfillment for ": "Desactivar cumplimiento para {facilityName}",
"Unlimited": "Unlimited",
"Unlimited Capacity": "Unlimited Capacity",
"Unlimited fulfillment capacity": "Unlimited fulfillment capacity",
"Unlimited capacity removes the fulfillment capacity limit entirely. To add a fulfillment capacity to this facility, use the custom option.": "Unlimited capacity removes the fulfillment capacity limit entirely. To add a fulfillment capacity to this facility, use the custom option.",
"Unpack": "Desempacar",
"Unpacking this order will send it back to 'In progress' and it will have to be repacked.": "Desempacar este pedido lo enviará de vuelta a 'En curso' y tendrá que ser vuelto a empacar.",
"Update": "Update",
Expand Down
12 changes: 11 additions & 1 deletion src/services/UserService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ const getFacilityDetails = async (payload: any): Promise<any> => {
})
}

const getCurrentOrdersCount = async (payload: any): Promise<any> => {
return api({
url: "performFind",
method: "get",
params: payload,
cached: true
})
}

const updateFacility = async (payload: any): Promise<any> => {
return api({
url: "service/updateFacility",
Expand Down Expand Up @@ -285,5 +294,6 @@ export const UserService = {
setUserTimeZone,
getUserPermissions,
updateFacility,
updateFieldMapping
updateFieldMapping,
getCurrentOrdersCount
}
106 changes: 106 additions & 0 deletions src/views/OrderLimitPopover.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<template>
ymaheshwari1 marked this conversation as resolved.
Show resolved Hide resolved
<ion-content>
<ion-list>
<ion-item lines="none">
<ion-card-subtitle>{{ $t("Fulfillment Capacity") }}</ion-card-subtitle>
</ion-item>
<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 {
IonCardSubtitle,
IonContent,
IonIcon,
IonItem,
IonList,
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: "OrderLimitPopver",
components: {
IonContent,
IonIcon,
IonItem,
IonList,
IonCardSubtitle
},
setup() {
return {
lockClosedOutline,
lockOpenOutline
}
},
props: ['fulfillmentOrderLimit'],
data() {
return {
setLimit: this.fulfillmentOrderLimit as any
}
},
methods: {
async updateOrderLimitType(orderLimitType: string) {
if (orderLimitType === 'custom') {
this.showOrderLimitAlert("Custom fulfillment capacity", "", true)
} else if (orderLimitType === 'no-capacity') {
this.setLimit = 0
this.showOrderLimitAlert("No fulfillment capacity", "No capacity removes 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.", false)
} else if (orderLimitType === 'unlimited') {
this.setLimit = ""
this.showOrderLimitAlert("Unlimited fulfillment capacity", "Unlimited capacity removes the fulfillment capacity limit entirely. To add a fulfillment capacity to this facility, use the custom option.", false)
}
},
async showOrderLimitAlert(header: any, message: any, 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: showInput ? [{
text: translate('Cancel'),
role: "cancel"
},
{
text: translate('Apply'),
handler: (data) => {
if (data.setLimit <= 0) {
showToast(translate('Provide a value greater than 0'))
return;
}
popoverController.dismiss(data.setLimit)
}
}] : [{
text: translate('Cancel'),
role: 'cancel'
}, {
text: translate('Apply'),
handler: () => {
popoverController.dismiss(this.setLimit)
}
}]
})
await alert.present()
}
}
});
</script>
Loading