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
  • Loading branch information
k2maan committed Jul 25, 2023
2 parents b8b10c0 + fe5b43b commit d3702a4
Show file tree
Hide file tree
Showing 11 changed files with 414 additions and 196 deletions.
102 changes: 102 additions & 0 deletions src/components/CustomFieldModal.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<template>
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-button @click="closeModal">
<ion-icon slot="icon-only" :icon="closeOutline" />
</ion-button>
</ion-buttons>
<ion-title>{{ $t("Add custom field") }}</ion-title>
</ion-toolbar>
</ion-header>

<ion-content>
<ion-list>
<ion-item lines="full">
<ion-label position="fixed">{{ $t("Key") }}</ion-label>
<ion-input :placeholder="$t('Enter key')" name="key" v-model="key" id="key" type="text" required />
</ion-item>
<ion-item>
<ion-label position="fixed">{{ $t("Value") }}</ion-label>
<ion-input :placeholder="$t('Enter value')" name="value" v-model="value" id="value" type="text" required />
</ion-item>
</ion-list>

<ion-fab @click="saveCustomField()" vertical="bottom" horizontal="end" slot="fixed">
<ion-fab-button>
<ion-icon :icon="checkmarkDoneOutline" />
</ion-fab-button>
</ion-fab>
</ion-content>
</template>

<script lang="ts">
import {
IonButtons,
IonButton,
IonContent,
IonFab,
IonFabButton,
IonHeader,
IonIcon,
IonInput,
IonItem,
IonLabel,
IonList,
IonTitle,
IonToolbar,
modalController
} from "@ionic/vue";
import { defineComponent } from "vue";
import { checkmarkDoneOutline, closeOutline } from "ionicons/icons";
import { useStore } from "vuex";
import { showToast } from "@/utils"
import { translate } from "@/i18n";
export default defineComponent({
name: "CustomFieldModal",
components: {
IonButtons,
IonButton,
IonContent,
IonFab,
IonFabButton,
IonHeader,
IonIcon,
IonInput,
IonItem,
IonLabel,
IonList,
IonTitle,
IonToolbar,
},
data() {
return {
key: '',
value: ''
}
},
methods: {
closeModal() {
modalController.dismiss({ dismissed: true});
},
saveCustomField() {
const fieldKey = this.key.trim();
if(!fieldKey) {
showToast(translate('Please enter a valid key'))
return;
}
modalController.dismiss({ dismissed: true, value: { key: fieldKey, value: this.value } });
}
},
setup() {
const store = useStore();
return {
checkmarkDoneOutline,
closeOutline,
store
};
},
});
</script>
10 changes: 8 additions & 2 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
" doesn't have any orders in progress right now.": " doesn't have any orders in progress right now.",
" doesn't have any outstanding orders right now.": " doesn't have any outstanding orders right now.",
"Add Box": "Add Box",
"Add custom field": "Add custom field",
"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 perform this action?": "Are you sure you want perform this action?",
"Are you sure you want to recycle outstanding order(s)?": "Are you sure you want to recycle { ordersCount } outstanding order(s)?",
Expand All @@ -28,14 +29,18 @@
"Download packed orders": "Download packed orders",
"eCom Store": "eCom Store",
"Edit packaging": "Edit packaging",
"Enter key": "Enter key",
"Enter value": "Enter value",
"EXIM": "EXIM",
"Facility ID": "Facility ID",
"Facility updated successfully": "Facility updated successfully",
"Failed to add box": "Failed to add box",
"Failed to create picklist for orders": "Failed to create picklist for orders",
"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",
"Failed to pack orders": "Failed to pack orders",
"Failed to parse the data": "Failed to parse the data",
"Failed to print shipping label and packing slip": "Failed to print shipping label and packing slip",
"Failed to ship order": "Failed to ship order",
"Failed to recycle in progress orders": "Failed to recycle in progress orders",
Expand All @@ -52,6 +57,7 @@
"Import shipped order details from an external system based on tracking codes. Orders that have tracking codes will automatically be shipped at the end of the day.": "Import shipped order details from an external system based on tracking codes. Orders that have tracking codes will automatically be shipped at the end of the day.",
"Import shipped orders": "Import shipped orders",
"In Progress": "In Progress",
"Key": "Key",
"Last brokered": "Last brokered",
"Loading": "Loading",
"Login": "Login",
Expand Down Expand Up @@ -100,7 +106,6 @@
"Print Customer Letter": "Print Customer Letter",
"Print Picklist": "Print Picklist",
"Print Picksheet": "Print Picksheet",
"Print Shipping Label": "Print Shipping Label",
"Provide a value greater than 0": "Provide a value greater than 0",
"Ready to pack": "Ready to pack",
"Recycle": "Recycle",
Expand All @@ -112,10 +117,10 @@
"Recycle outstanding orders": "Recycle outstanding orders",
"Recycling has been started. All in progress orders will be recycled shortly.": "Recycling has been started. All in progress orders will be recycled shortly.",
"Recycling has been started. All outstanding orders will be recycled shortly.": "Recycling has been started. All outstanding orders will be recycled shortly.",
"Regenerate Shipping Label": "Regenerate Shipping Label",
"Report": "Report",
"Report an issue": "Report an issue",
"Result Size": "Result Size",
"Retry Generate Label": "Retry Generate Label",
"Same Day": "Same Day",
"Save": "Save",
"Search time zones": "Search time zones",
Expand Down Expand Up @@ -163,6 +168,7 @@
"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.",
"Upload": "Upload",
"Username": "Username",
"Value": "Value",
"Worn Display": "Worn Display",
"Yes": "Yes",
"You are packing an order. Select additional documents that you would like to print.": "You are packing an order. Select additional documents that you would like to print.",
Expand Down
Loading

0 comments on commit d3702a4

Please sign in to comment.