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

Block user navigating to details page if no records after review action(#24pp0fm) #27

Merged
merged 18 commits into from
Nov 21, 2022
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
8ed2f0e
Block user navigating to details page if no records after review acti…
disha1202 Mar 30, 2022
3686bca
Added changelg entry(#24pp0fm)
disha1202 Mar 30, 2022
ebd5e11
Updated the logic to block user navigation and added a different toas…
disha1202 Apr 14, 2022
db6ddd6
Updated the toast message(#24pp0fm)
disha1202 Apr 14, 2022
b06cf88
Merge branch 'main' of https://github.com/hotwax/import into #24pp0fm
disha1202 Jul 18, 2022
202add7
Updated the code(#24pp0fm)
disha1202 Jul 18, 2022
835a0b8
Delete -24pp0fm.yml
adityasharma7 Oct 27, 2022
165c426
Updated toast message and added static text in en.json file(#24pp0fm)
disha1202 Oct 31, 2022
40f2114
Merge branch '#24pp0fm' of https://github.com/disha1202/import into #…
disha1202 Oct 31, 2022
0a35113
Merge branch 'main' of https://github.com/hotwax/import into #24pp0fm
disha1202 Oct 31, 2022
0a5cb30
Updated code(#24pp0fm)
disha1202 Oct 31, 2022
d1dc837
Updated the code to map fields only if all the fields are selected(#2…
disha1202 Oct 31, 2022
35a350d
Improved code(#24pp0fm)
disha1202 Oct 31, 2022
4a257c0
Improved variable name(#24pp0fm)
disha1202 Oct 31, 2022
43eab40
Updated condition to check whether all fields are selected(#24pp0fm)
disha1202 Oct 31, 2022
5776179
Merge branch 'main' of https://github.com/hotwax/import into #24pp0fm
disha1202 Nov 2, 2022
465aea2
Merge branch 'main' of https://github.com/hotwax/import into #24pp0fm
disha1202 Nov 18, 2022
d2cd966
Merge branch 'main' into #24pp0fm
adityasharma7 Nov 21, 2022
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
2 changes: 2 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"Ordered": "Ordered",
"Ordered quantity": "Ordered quantity",
"Password": "Password",
"Please upload a valid purchase order csv to continue": "Please upload a valid purchase order csv to continue",
"PO External Order ID": "PO External Order ID",
"Preorder": "Preorder",
"Purchase order": "Purchase order",
Expand All @@ -43,6 +44,7 @@
"Search products": "Search products",
"Search time zones": "Search time zones",
"Select": "Select",
"Select all the fields to continue": "Select all the fields to continue",
"Select time zone": "Select time zone",
"Select the column index for the following information in the uploaded CSV.": "Select the column index for the following information in the uploaded CSV.",
"Something went wrong": "Something went wrong",
Expand Down
51 changes: 30 additions & 21 deletions src/views/PurchaseOrder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,35 @@
<ion-list-header>{{ $t("Select the column index for the following information in the uploaded CSV.") }}</ion-list-header>
<ion-item>
<ion-label>{{ $t("Order ID") }}</ion-label>
<ion-select interface="popover" v-if="content.length" :placeholder = "$t('Select')" v-model="orderIdField">
<ion-select interface="popover" v-if="content.length" :placeholder = "$t('Select')" v-model="fields.orderIdField">
<ion-select-option v-bind:key="index" v-for="(prop, index) in Object.keys(content[0])">{{ prop }}</ion-select-option>
</ion-select>
</ion-item>

<ion-item>
<ion-label>{{ $t("Shopify product SKU") }}</ion-label>
<ion-select interface="popover" v-if="content.length" :placeholder = "$t('Select')" v-model="productSkuField">
<ion-select interface="popover" v-if="content.length" :placeholder = "$t('Select')" v-model="fields.productSkuField">
<ion-select-option v-bind:key="index" v-for="(prop, index) in Object.keys(content[0])">{{ prop }}</ion-select-option>
</ion-select>
</ion-item>

<ion-item>
<ion-label>{{ $t("Arrival date") }}</ion-label>
<ion-select interface="popover" v-if="content.length" :placeholder = "$t('Select')" v-model="dateField">
<ion-select interface="popover" v-if="content.length" :placeholder = "$t('Select')" v-model="fields.dateField">
<ion-select-option v-bind:key="index" v-for="(prop, index) in Object.keys(content[0])">{{ prop }}</ion-select-option>
</ion-select>
</ion-item>

<ion-item>
<ion-label>{{ $t("Ordered quantity") }}</ion-label>
<ion-select interface="popover" v-if="content.length" :placeholder = "$t('Select')" v-model="quantityField">
<ion-select interface="popover" v-if="content.length" :placeholder = "$t('Select')" v-model="fields.quantityField">
<ion-select-option v-bind:key="index" v-for="(prop, index) in Object.keys(content[0])">{{ prop }}</ion-select-option>
</ion-select>
</ion-item>

<ion-item>
<ion-label>{{ $t("Facility ID") }}</ion-label>
<ion-select interface="popover" v-if="content.length" :placeholder = "$t('Select')" v-model="facilityField">
<ion-select interface="popover" v-if="content.length" :placeholder = "$t('Select')" v-model="fields.facilityField">
<ion-select-option v-bind:key="index" v-for="(prop, index) in Object.keys(content[0])">{{ prop }}</ion-select-option>
</ion-select>
</ion-item>
Expand Down Expand Up @@ -92,11 +92,13 @@ export default defineComponent({
return {
file: "",
content: [],
orderIdField: "",
productSkuField: "",
dateField: "",
quantityField: "",
facilityField: "",
fields:{
orderIdField: "",
productSkuField: "",
dateField: "",
quantityField: "",
facilityField: "",
},
orderItemsList: [],
}
},
Expand All @@ -121,19 +123,26 @@ export default defineComponent({
mapFields() {
this.orderItemsList = this.content.map(item => {
ymaheshwari1 marked this conversation as resolved.
Show resolved Hide resolved
ymaheshwari1 marked this conversation as resolved.
Show resolved Hide resolved
return {
orderId: item[this.orderIdField],
shopifyProductSKU: item[this.productSkuField],
shopifyProductUPC: item[this.productUpcField],
arrivalDate: item[this.dateField],
quantityOrdered: item[this.quantityField],
facilityId: '',
externalFacilityId: item[this.facilityField]
orderId: item[this.fields.orderIdField],
shopifyProductSKU: item[this.fields.productSkuField],
arrivalDate: item[this.fields.dateField],
quantityOrdered: item[this.fields.quantityField],
externalFacilityId: item[this.fields.facilityField]
}
})
this.store.dispatch('order/updatedOrderList', this.orderItemsList);
this.router.push({
name:'PurchaseOrderDetail'
})
const review = Object.values(this.fields).some(field => {
ymaheshwari1 marked this conversation as resolved.
Show resolved Hide resolved
ymaheshwari1 marked this conversation as resolved.
Show resolved Hide resolved
return field === "";
});
if (this.content.length <= 0) {
showToast(translate("Please upload a valid purchase order csv to continue"));
} else if (!review) {
this.store.dispatch('order/updatedOrderList', this.orderItemsList);
this.router.push({
name:'PurchaseOrderDetail'
})
} else {
showToast(translate("Select all the fields to continue"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add both the text to en.json

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added static text in en.json file

}
},
},
setup() {
Expand Down