-
Notifications
You must be signed in to change notification settings - Fork 39
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: Added the support for using facility selector from dxp-component(#dxp/228) #384
Conversation
package.json
Outdated
@@ -16,8 +16,8 @@ | |||
"@casl/ability": "^6.0.0", | |||
"@hotwax/app-version-info": "^1.0.0", | |||
"@hotwax/apps-theme": "^1.2.6", | |||
"@hotwax/dxp-components": "^1.13.0", | |||
"@hotwax/oms-api": "^1.14.0", | |||
"@hotwax/dxp-components": "file:../dxp-components", |
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.
Published the latest version of dxp-components. Please use the same here.
package.json
Outdated
"@hotwax/dxp-components": "^1.13.0", | ||
"@hotwax/oms-api": "^1.14.0", | ||
"@hotwax/dxp-components": "file:../dxp-components", | ||
"@hotwax/oms-api": "file:../oms-api", |
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.
Same here. Use the latest oms-api version here.
src/store/modules/order/actions.ts
Outdated
import emitter from "@/event-bus"; | ||
import store from "@/store"; | ||
|
||
const getCurrentFacilityId = () => { |
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.
Can we add a util function for this?
src/store/modules/user/actions.ts
Outdated
async setFacility ({ commit, dispatch }, payload) { | ||
const eComStore = await UserService.getEComStores(undefined, payload.facility.facilityId); | ||
|
||
async setFacilityUpdates ({ commit, dispatch, state }, payload) { |
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.
Rename payload to facilityId.
… & changed functions name(#dxp/288) - Updated the dxp-components & oms-api to latest versions.
src/store/modules/order/actions.ts
Outdated
|
||
if (current.length && current[0]?.orderId === orderId) { return current } | ||
|
||
else if(orders.length > 0) { |
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.
What is the purpose of this change?
src/store/modules/order/actions.ts
Outdated
@@ -70,6 +70,7 @@ const actions: ActionTree<OrderState, RootState> = { | |||
}, | |||
async getOrderDetail({ commit, state }, { orderId }) { | |||
let resp; | |||
const currentFacilityId = getCurrentFacilityId(); |
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.
Use the getCurrentFacilityId() directly if currentFacilityId is not reused.
src/store/modules/order/actions.ts
Outdated
@@ -208,7 +209,8 @@ const actions: ActionTree<OrderState, RootState> = { | |||
"orderBy": 'datetimeReceived DESC', | |||
"viewSize": "250" | |||
} | |||
const facilityLocations = await this.dispatch('user/getFacilityLocations', this.state.user.currentFacility.facilityId); | |||
const currentFacilityId = getCurrentFacilityId() |
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.
Use the getCurrentFacilityId() directly if currentFacilityId is not reused.
@@ -72,8 +72,8 @@ const actions: ActionTree<ShipmentState, RootState> = { | |||
const shipmentAttributes = await ShipmentService.fetchShipmentAttributes([shipmentDetail.shipmentId]) | |||
shipmentDetail.externalOrderId = shipmentAttributes?.[shipmentDetail.shipmentId]?.['EXTERNAL_ORDER_ID'] | |||
shipmentDetail.externalOrderName = shipmentAttributes?.[shipmentDetail.shipmentId]?.['EXTERNAL_ORDER_NAME'] | |||
|
|||
const facilityLocations = await this.dispatch('user/getFacilityLocations', this.state.user.currentFacility.facilityId); | |||
const currentFacilityId = getCurrentFacilityId(); |
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.
Same here.
…lity instead of useUserStore from dxp-component in various files(#dxp/288)
Related Issues
hotwax/dxp-components#228
Short Description and Why It's Useful
facility selector
on the settings page from thedxp-component
.state
management.getters
from the user store in dxp-components across the entire application.Contribution and Currently Important Rules Acceptance