-
Notifications
You must be signed in to change notification settings - Fork 46
Implemented: Added the support for using facility selector from dxp-component(#dxp/228) #218
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
Open
R-Sourabh
wants to merge
5
commits into
hotwax:main
Choose a base branch
from
R-Sourabh:#dxp/288-facility-selector
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
56fc9ed
Implemented: Added the support for using facility selector from dxp-c…
R-Sourabh 400fca2
Improved: updated locale files & change code wrt to updated emit from…
R-Sourabh 3335908
Improved: chnaged the fetch picklist action params & updated function…
R-Sourabh ab0e30f
Merge remote-tracking branch 'upstream/main' into #dxp/288-facility-s…
R-Sourabh 6857453
Improved: Added permission in Action/Rules & updated the dxp-componen…
R-Sourabh 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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,15 +1,18 @@ | ||
| import { api, client, getConfig, getProductIdentificationPref, hasError, initialise, logout, resetConfig, setProductIdentificationPref, updateInstanceUrl, updateToken } from '@hotwax/oms-api' | ||
| import { api, client, getConfig, getUserFacilities, getUserPreference, getProductIdentificationPref, hasError, initialise, logout, resetConfig, setProductIdentificationPref, setUserPreference, updateInstanceUrl, updateToken } from '@hotwax/oms-api' | ||
|
|
||
| export { | ||
| api, | ||
| client, | ||
| getConfig, | ||
| getProductIdentificationPref, | ||
| getUserFacilities, | ||
| getUserPreference, | ||
| hasError, | ||
| initialise, | ||
| logout, | ||
| resetConfig, | ||
| setProductIdentificationPref, | ||
| setUserPreference, | ||
| updateInstanceUrl, | ||
| updateToken | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,7 +7,7 @@ import { showToast } from '@/utils' | |||||
| import { translate } from '@/i18n' | ||||||
| import { Settings } from 'luxon'; | ||||||
| import { hasError, logout, updateInstanceUrl, updateToken, resetConfig } from '@/adapter' | ||||||
| import { useAuthStore, useProductIdentificationStore } from '@hotwax/dxp-components' | ||||||
| import { useAuthStore, useProductIdentificationStore, useUserStore } from '@hotwax/dxp-components' | ||||||
| import emitter from '@/event-bus' | ||||||
| import router from '@/router'; | ||||||
|
|
||||||
|
|
@@ -123,10 +123,10 @@ const actions: ActionTree<UserState, RootState> = { | |||||
| } | ||||||
| commit(types.USER_INFO_UPDATED, resp.data); | ||||||
|
|
||||||
| const currentFacility = resp.data.facilities.length > 0 ? resp.data.facilities[0] : {}; | ||||||
|
|
||||||
| commit(types.USER_CURRENT_FACILITY_UPDATED, currentFacility); | ||||||
| await useUserStore().getUserFacilities(resp.data.partyId, "", false) | ||||||
| await useUserStore().getFacilityPreference('SELECTED_FACILITY') | ||||||
|
|
||||||
| const currentFacility: any = useUserStore().getCurrentFacility | ||||||
| // get and set current ecom store in state | ||||||
| const currentEComStore = await UserService.getCurrentEComStore(token, currentFacility?.facilityId); | ||||||
| commit(types.USER_CURRENT_ECOM_STORE_UPDATED, currentEComStore); | ||||||
|
|
@@ -151,12 +151,9 @@ const actions: ActionTree<UserState, RootState> = { | |||||
| } | ||||||
| }, | ||||||
|
|
||||||
| // update current facility information | ||||||
| async setFacility ({ commit, state }, payload) { | ||||||
| commit(types.USER_CURRENT_FACILITY_UPDATED, payload.facility); | ||||||
|
|
||||||
| async setFacilityUpdates ({ commit, state }, payload) { | ||||||
|
||||||
| async setFacilityUpdates ({ commit, state }, payload) { | |
| async setFacility({ commit, state }, payload) { |
Improve indentation
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -34,22 +34,7 @@ | |||||
| </div> | ||||||
| <section> | ||||||
| <DxpOmsInstanceNavigator /> | ||||||
|
|
||||||
| <ion-card> | ||||||
| <ion-card-header> | ||||||
| <ion-card-title> | ||||||
| {{ $t("Facility") }} | ||||||
| </ion-card-title> | ||||||
| </ion-card-header> | ||||||
| <ion-card-content> | ||||||
| {{ $t('Specify which facility you want to operate from. Order, inventory and other configuration data will be specific to the facility you select.') }} | ||||||
| </ion-card-content> | ||||||
| <ion-item lines="none"> | ||||||
| <ion-select :label="$t('Select facility')" interface="popover" :value="currentFacility.facilityId" @ionChange="setFacility($event)"> | ||||||
| <ion-select-option v-for="facility in (userProfile ? userProfile.facilities : [])" :key="facility.facilityId" :value="facility.facilityId" >{{ facility.name }}</ion-select-option> | ||||||
| </ion-select> | ||||||
| </ion-item> | ||||||
| </ion-card> | ||||||
| <DxpFacilitySwitcher @updateFacility="handleFacilityUpdate($event)"/> | ||||||
|
||||||
| <DxpFacilitySwitcher @updateFacility="handleFacilityUpdate($event)"/> | |
| <DxpFacilitySwitcher @updateFacility="updateFacility(facility)"/> |
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.
Directly use
useUserStore().getCurrentFacilitywherever required as we only have a couple of places where this data is used.