@webitel/ui-sdk 26.2.66 → 26.2.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "26.2.66",
3
+ "version": "26.2.67",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "make-all": "npm version patch --git-tag-version false && npm run build && (npm run build:types || true) && (npm run biome:format:all || true) && npm run publish-lib",
@@ -105,6 +105,12 @@ export const createUserAccessStore = ({
105
105
  };
106
106
 
107
107
  const routeAccessGuard: NavigationGuard = (to) => {
108
+ let wtApplication = to.matched
109
+ .toReversed()
110
+ .find(({ meta }) => meta.WtApplication)?.meta?.WtApplication as
111
+ | WtApplication
112
+ | ((RouteLocationNormalized) => WtApplication);
113
+
108
114
  /* find last because "matched" has top=>bottom routes order */
109
115
  let uiSection = to.matched.toReversed().find(({ meta }) => meta.UiSection)
110
116
  ?.meta?.UiSection as
@@ -114,6 +120,11 @@ export const createUserAccessStore = ({
114
120
  let wtObject = to.matched.toReversed().find(({ meta }) => meta.UiSection)
115
121
  ?.meta?.WtObject as WtObject | ((RouteLocationNormalized) => WtObject);
116
122
 
123
+ // if, then compute fn
124
+ if (typeof wtApplication === 'function') {
125
+ wtApplication = wtApplication(to);
126
+ }
127
+
117
128
  // if, then compute fn
118
129
  if (typeof uiSection === 'function') {
119
130
  uiSection = uiSection(to);
@@ -123,8 +134,13 @@ export const createUserAccessStore = ({
123
134
  wtObject = wtObject(to);
124
135
  }
125
136
 
137
+ if (wtApplication && !hasApplicationVisibility(wtApplication)) {
138
+ return {
139
+ path: '/access-denied',
140
+ };
141
+ }
142
+
126
143
  if (uiSection && !hasSectionVisibility(uiSection, wtObject)) {
127
- // return false;
128
144
  return {
129
145
  path: '/access-denied',
130
146
  };