Skip to content

Commit

Permalink
Merge pull request hotwax#497 from amansinghbais/hotwax#235
Browse files Browse the repository at this point in the history
Fixed: restricting user to login to app without any facility associated (hotwax#235)
  • Loading branch information
ymaheshwari1 authored Jan 27, 2025
2 parents 4b73be4 + da02d33 commit 551bc9b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
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 @@ -70,6 +70,8 @@ const actions: ActionTree<UserState, RootState> = {
//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

0 comments on commit 551bc9b

Please sign in to comment.