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

Fixed: restricting user to login to app without any facility associated (#235) #497

Merged
merged 3 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,10 @@
"will be removed from your dashboard. This action cannot be undone.": "{ productName } will be removed from your dashboard.{ space } This action cannot be undone.",
"Worn Display": "Worn Display",
"This order will be removed from your dashboard. This action cannot be undone.": "This order will be removed from your dashboard.{ space } This action cannot be undone.",
"Update notification preferences": "Update notification preferences",
"Unable to login. User is not associated with any facility": "Unable to login. User is not associated with any facility",
"units": "{ item } units",
"unit": "{ item } unit",
"Update notification preferences": "Update notification preferences",
"Verify that the items in the package are valid and the customer has received their order. Once the order is handed over to the customer it cannot be undone.": "Verify that the items in the package are valid and the customer has received their order.{ space }Once the order is handed over to the customer it cannot be undone.",
"View shipping orders along with pickup orders.": "View shipping orders along with pickup orders.",
"You do not have permission to access this page": "You do not have permission to access this page",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,10 @@
"will be removed from your dashboard. This action cannot be undone.": "{ productName } se eliminará de su panel de control.{ space } Esta acción no se puede deshacer.",
"Worn Display": "Pantalla desgastada",
"This order will be removed from your dashboard. This action cannot be undone.": "Este pedido será eliminado de tu panel de control.{ space } Esta acción no se puede deshacer.",
"Update notification preferences": "Actualizar preferencias de notificación",
"Unable to login. User is not associated with any facility": "Unable to login. User is not associated with any facility",
"units": "{ item } units",
"unit": "{ item } unit",
"Update notification preferences": "Actualizar preferencias de notificación",
"Verify that the items in the package are valid and the customer has received their order. Once the order is handed over to the customer it cannot be undone.": "Verify that the items in the package are valid and the customer has received their order.{ space }Once the order is handed over to the customer it cannot be undone.",
"View shipping orders along with pickup orders.": "Ver órdenes de envío junto con órdenes de recogida.",
"You do not have permission to access this page": "No tienes permiso para acceder a esta página",
Expand Down
1 change: 1 addition & 0 deletions src/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
"Total": "Total",
"Track Pickers": "受取人の追跡",
"Track who picked orders by entering picker IDs when packing an order.": "注文を梱包する際に受取人IDを入力することで、誰が注文を受け取ったかを追跡できます。",
"Unable to login. User is not associated with any facility": "Unable to login. User is not associated with any facility",
"Unable to open as browser is blocking pop-ups.": "ブラウザーがポップアップをブロックしているため、{documentName} を開くことができません。",
"Unfillable Items": "記入不可の項目",
"Update time zone": "タイムゾーンを更新する",
Expand Down
2 changes: 2 additions & 0 deletions src/store/modules/user/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
/**
* Login user and return token
*/
async login ({ commit, dispatch, getters }, payload) {

Check warning on line 36 in src/store/modules/user/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'getters' is defined but never used

Check warning on line 36 in src/store/modules/user/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'getters' is defined but never used
try {
const {token, oms} = payload;
dispatch("setUserInstanceUrl", oms);
Expand Down Expand Up @@ -70,6 +70,8 @@
//fetching user facilities
const isAdminUser = appPermissions.some((appPermission: any) => appPermission?.action === "APP_STOREFULFILLMENT_ADMIN" );
const facilities = await useUserStore().getUserFacilities(userProfile?.partyId, "PICKUP", isAdminUser)
if(!facilities.length) throw "Unable to login. User is not associated with any facility"

await useUserStore().getFacilityPreference('SELECTED_FACILITY')

userProfile.facilities = facilities;
Expand Down Expand Up @@ -323,7 +325,7 @@
commit(types.USER_ALL_NOTIFICATION_PREFS_UPDATED, allNotificationPrefs)
},

async fetchBopisProductStoreSettings({ commit, dispatch }) {

Check warning on line 328 in src/store/modules/user/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'dispatch' is defined but never used

Check warning on line 328 in src/store/modules/user/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'dispatch' is defined but never used
const productStoreSettings = JSON.parse(process.env.VUE_APP_PRODUCT_STORE_SETTING_ENUMS);
const settingValues = {} as any;

Expand Down Expand Up @@ -357,7 +359,7 @@
commit(types.USER_BOPIS_PRODUCT_STORE_SETTINGS_UPDATED, settingValues)
},

async createProductStoreSetting({ commit }, enumeration) {

Check warning on line 362 in src/store/modules/user/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'commit' is defined but never used

Check warning on line 362 in src/store/modules/user/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'commit' is defined but never used
const fromDate = Date.now()

try {
Expand Down Expand Up @@ -389,8 +391,8 @@
return fromDate;
},

async setProductStoreSetting({ commit, dispatch, state }, payload) {

Check warning on line 394 in src/store/modules/user/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'dispatch' is defined but never used

Check warning on line 394 in src/store/modules/user/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'dispatch' is defined but never used
const productStoreSettings = JSON.parse(process.env.VUE_APP_PRODUCT_STORE_SETTING_ENUMS);

Check warning on line 395 in src/store/modules/user/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'productStoreSettings' is assigned a value but never used

Check warning on line 395 in src/store/modules/user/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'productStoreSettings' is assigned a value but never used
let prefValue = state.bopisProductStoreSettings[payload.enumId]
const eComStoreId = this.state.user.currentEComStore.productStoreId;

Expand Down
Loading