generated from hotwax/dxp-components
-
Notifications
You must be signed in to change notification settings - Fork 27
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: logic to edit data #22c8vgh #8
Merged
Merged
Changes from 16 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
4b96fb4
Implemeted Static UI for displaying parsed csv and Implemented logic …
disha1202 e39d275
Improved spacing(#22c8vf8)
disha1202 85cf50f
Rendered data on purchase order detail page(#22c8vf8)
disha1202 a9b1146
Added changelog entry(#22c8vf8)
disha1202 30ce3d5
Improved code to render data on order detail page(#22c8vf8)
disha1202 b8bde2d
Removed unwanted code(#22c8vf8)
disha1202 0919210
Implemented logic to get product information(#22c8vf8)
disha1202 83da67d
Improved spacing and removed console statements(#22c8vf8)
disha1202 0eca8be
Implemented logic to render data(#22c8vgh)
disha1202 af887f2
Improved logic to render products(#22c8vgh)
disha1202 29a5de0
Merge branch 'main' of https://github.com/hotwax/import into #22c8vgh
disha1202 21b1b04
Updated code(#22c8vgh)
disha1202 4529e82
Updated code (#22c8vgh)
disha1202 85bd3b0
Updated order getters(#22c8vgh)
disha1202 6181616
Improved code(#22c8vgh)
disha1202 80255ff
Improved code and updated method name and valiables name(#22c8vgh)
disha1202 7f1a888
Improved order state and logic to select products(#22c8vgh)
disha1202 dc7df79
Updated order state and logic to select products(#22c8vgh)
disha1202 831de85
Added changelog entry(#22c8vgh)
disha1202 57e9549
Improved indentation and removed unwanted changes(#22c8vgh)
disha1202 5bb2d03
Updated the code to use correct variable(#22c8vgh)
disha1202 116c7d0
Updated component name(#22c8vgh)
disha1202 b796b47
Improved order actions(#22c8vgh)
disha1202 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import { ActionTree } from 'vuex' | ||
import RootState from './RootState' | ||
|
||
const actions: ActionTree<RootState, RootState> = {} | ||
const actions: ActionTree<RootState, RootState> = { | ||
|
||
} | ||
|
||
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
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,37 @@ | ||
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 orderListUpdated ({commit}, orderItems) { | ||
const productIds = orderItems.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); | ||
orderItems = orderItems.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(orderItems)) | ||
commit(types.ORDER_LIST_UPDATED, { orderItems: orderItems, original: original }); | ||
} | ||
} | ||
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> = { | ||||||
getOrdersList(state){ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
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_ITEMS_UPDATED = SN_ORDER + '/ITEMS_UPDATED' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is not used anywhere. We could remove |
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,15 @@ | ||
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.orderItems; | ||
state.list.original = payload.original; | ||
}, | ||
[types.ORDER_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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.