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

Implemented: Added the support for using facility selector from dxp-component(#dxp/228) #753

Merged
merged 6 commits into from
Nov 19, 2024

Conversation

R-Sourabh
Copy link
Contributor

Related Issues

hotwax/dxp-components#228

Short Description and Why It's Useful

  • Added support for using the facility selector on the settings page from the dxp-component.
  • Replaced the app-level facility state and updated the logic to use the dxp-component for facility state management.
  • Removed code related to storing/fetching facilities and currentFacility in the application.
  • Utilized getters from the user store in dxp-components across the entire application.

Contribution and Currently Important Rules Acceptance

@R-Sourabh R-Sourabh marked this pull request as ready for review November 18, 2024 05:37
…p-component version to latest and changed the emitted updateFacilty function name(#dxp/288)

const actions: ActionTree<StockState, RootState> = {
async fetchStock({ commit }, { productId, facilityId = '' }) {
const id = facilityId ? facilityId : this.state.user.currentFacility.facilityId
const getCurrentFacility: any = useUserStore().getCurrentFacility
Copy link
Contributor

Choose a reason for hiding this comment

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

Use getCurrentFacilityId() util function here.


const getters: GetterTree <StockState, RootState> = {
getProductStock: (state, getters, RootState) => (productId: any, facilityId?: any) => {
const id = facilityId ? facilityId : RootState.user.currentFacility.facilityId
getProductStock: (state, getters) => (productId: any, facilityId?: any) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Use the getCurrentFacilityId() util function here.

@@ -18,6 +18,7 @@ const actions: ActionTree<TransferOrderState, RootState> = {
emitter.emit('presentLoader');
let resp;
const transferOrderQuery = JSON.parse(JSON.stringify(state.transferOrder.query))
const currentFacilityId = getCurrentFacilityId();
Copy link
Contributor

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 variable is not reused.

…lity instead of useUserStore from dxp-component in various files(#dxp/288)
…lity instead of useUserStore from dxp-component in various files(#dxp/288)
@ravilodhi ravilodhi merged commit 92e8238 into hotwax:main Nov 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants