generated from hotwax/dxp-components
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from disha1202/#22c8vgh
Implemented: logic to edit data #22c8vgh
- Loading branch information
Showing
20 changed files
with
450 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
title: Implemented logic to render data on order detail page | ||
ticket_id: "#22c8vf8" | ||
merge_request: 5 | ||
author: Disha Talreja | ||
type: added |
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,6 @@ | ||
--- | ||
title: Implemented logic to render and edit data on purchase order detail page | ||
ticket_id: "#22c8vgh" | ||
merge_request: 8 | ||
author: Disha Talreja | ||
type: added |
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,4 +1,5 @@ | ||
export default interface RootState { | ||
user: any; | ||
product: any; | ||
order: any; | ||
} |
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,6 @@ | ||
export default interface OrderState { | ||
list: { | ||
items: any, | ||
original: any | ||
} | ||
} |
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,40 @@ | ||
import { ActionTree } from 'vuex' | ||
import store from '@/store' | ||
import RootState from '@/store/RootState' | ||
import OrderState from './OrderState' | ||
import * as types from './mutation-types' | ||
import router from '@/router' | ||
|
||
|
||
const actions: ActionTree<OrderState, RootState> = { | ||
async updatedOrderList ({commit}, items) { | ||
const productIds = items.map((item: any) => { | ||
return item.shopifyProductSKU | ||
}) | ||
const viewSize = productIds.length; | ||
const viewIndex = 0; | ||
const payload = { | ||
viewSize, | ||
viewIndex, | ||
productIds | ||
} | ||
const resp = await store.dispatch("product/fetchProducts", payload); | ||
items = items.map((item: any) => { | ||
const product = resp.data.response.docs.find((product: any) => { | ||
return item.shopifyProductSKU == product.internalName; | ||
}) | ||
item.parentProductId = product.groupId; | ||
item.internalName = product.internalName; | ||
item.parentProductName = product.parentProductName; | ||
item.imageUrl = product.mainImageUrl; | ||
item.isNewProduct = false; | ||
return item; | ||
}) | ||
const original = JSON.parse(JSON.stringify(items)) | ||
commit(types.ORDER_LIST_UPDATED, { items, original }); | ||
}, | ||
updatedOrderListItems({ commit }, orderListItems){ | ||
commit(types.ORDER_LIST_ITEMS_UPDATED, orderListItems) | ||
} | ||
} | ||
export default actions; |
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,10 @@ | ||
import { GetterTree } from "vuex"; | ||
import OrderState from "./OrderState"; | ||
import RootState from "../../RootState"; | ||
|
||
const getters: GetterTree<OrderState, RootState> = { | ||
getOrder(state) { | ||
return state.list; | ||
} | ||
}; | ||
export default getters; |
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,21 @@ | ||
import getters from './getters' | ||
import { Module } from 'vuex' | ||
import actions from './actions' | ||
import mutations from './mutations' | ||
import OrderState from './OrderState' | ||
import RootState from '../../RootState' | ||
|
||
const orderModule: Module<OrderState, RootState> = { | ||
namespaced: true, | ||
state: { | ||
list: { | ||
items: [], | ||
original: [] | ||
}, | ||
}, | ||
actions, | ||
getters, | ||
mutations | ||
} | ||
|
||
export default orderModule; |
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,3 @@ | ||
export const SN_ORDER = 'order' | ||
export const ORDER_LIST_UPDATED = SN_ORDER + '/LIST_UPDATED' | ||
export const ORDER_LIST_ITEMS_UPDATED = SN_ORDER + '/LIST_ITEMS_UPDATED' |
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,14 @@ | ||
import { MutationTree } from 'vuex' | ||
import OrderState from './OrderState' | ||
import * as types from './mutation-types' | ||
|
||
const mutations: MutationTree <OrderState> = { | ||
[types.ORDER_LIST_UPDATED] (state, payload) { | ||
state.list.items = payload.items; | ||
state.list.original = payload.original; | ||
}, | ||
[types.ORDER_LIST_ITEMS_UPDATED] (state, payload) { | ||
state.list.items = payload; | ||
} | ||
} | ||
export default mutations; |
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,4 +1,5 @@ | ||
export default interface ProductState { | ||
cached: any; | ||
products: { | ||
list: any; | ||
total: number; | ||
|
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,2 +1,3 @@ | ||
export const SN_PRODUCT = 'product' | ||
export const PRODUCT_SEARCH_UPDATED = SN_PRODUCT + '/SEARCH_UPDATED' | ||
export const PRODUCT_ADD_TO_CACHED_MULTIPLE = SN_PRODUCT + '/ADD_TO_CACHED_MULTIPLE' |
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
Oops, something went wrong.