@dereekb/dbx-core 5.2.1 → 7.0.0
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/esm2020/lib/action/directive/state/action.disabled.directive.mjs +2 -3
- package/esm2020/lib/action/directive/state/action.enforce.modified.directive.mjs +2 -2
- package/esm2020/lib/auth/router/provider/uirouter/hook.mjs +6 -4
- package/esm2020/lib/auth/router/provider/uirouter/redirect.mjs +1 -1
- package/esm2020/lib/auth/router/provider/uirouter/role.hook.mjs +3 -4
- package/esm2020/lib/auth/router/provider/uirouter/state.hook.mjs +3 -3
- package/fesm2015/dereekb-dbx-core.mjs +10 -11
- package/fesm2015/dereekb-dbx-core.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-core.mjs +10 -10
- package/fesm2020/dereekb-dbx-core.mjs.map +1 -1
- package/lib/action/directive/state/action.enforce.modified.directive.d.ts +1 -1
- package/lib/auth/router/provider/uirouter/hook.d.ts +4 -4
- package/lib/auth/router/provider/uirouter/state.hook.d.ts +2 -2
- package/package.json +4 -4
|
@@ -5,7 +5,7 @@ import { switchMap, first, BehaviorSubject, combineLatest, distinctUntilChanged,
|
|
|
5
5
|
import * as i1$5 from '@dereekb/rxjs';
|
|
6
6
|
import { SubscriptionObject, LockSet, filterMaybe, LoadingStateType, beginLoading, idleLoadingState, errorResult, successResult, scanCount, combineLatestFromMapValuesObsFn, workFactory, emitDelayObs, asObservable, returnIfIs, skipFirstMaybe, onFalseToTrue, onTrueToFalse, setContainsAllValuesFrom, FilterSourceInstance, FilterSource, FilterSourceConnector, FilterMap } from '@dereekb/rxjs';
|
|
7
7
|
import * as i1$6 from '@dereekb/util';
|
|
8
|
-
import { isDefinedAndNotFalse, hasValueOrNotEmpty, BooleanStringKeyArrayUtilityInstance, reduceBooleansWithOrFn, getValueFromGetter, toReadableError, isGetter,
|
|
8
|
+
import { isDefinedAndNotFalse, hasValueOrNotEmpty, BooleanStringKeyArrayUtilityInstance, reduceBooleansWithOrFn, getValueFromGetter, toReadableError, isGetter, setIncludes, maybeSet, isAllowed, expandTreeFunction, flattenTreeToArrayFunction, expandFlattenTreeFunction, mergeArrays, filterMaybeValues, mergeObjects, mergeArrayOrValueIntoArray, makePromiseFullRef, DataIsExpiredError, DataDoesNotExistError, filterMaybeValuesFn, StorageObjectUtility, SHARED_MEMORY_STORAGE } from '@dereekb/util';
|
|
9
9
|
import { ComponentStore } from '@ngrx/component-store';
|
|
10
10
|
import { CommonModule, formatDate } from '@angular/common';
|
|
11
11
|
import * as i1$3 from '@ngrx/effects';
|
|
@@ -1102,8 +1102,7 @@ class DbxActionDisabledDirective extends AbstractSubscriptionDirective {
|
|
|
1102
1102
|
return this._disabled.value;
|
|
1103
1103
|
}
|
|
1104
1104
|
set disabled(disabled) {
|
|
1105
|
-
|
|
1106
|
-
this._disabled.next(disable);
|
|
1105
|
+
this._disabled.next(disabled !== false);
|
|
1107
1106
|
}
|
|
1108
1107
|
}
|
|
1109
1108
|
DbxActionDisabledDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionDisabledDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -1389,7 +1388,7 @@ class DbxActionEnforceModifiedDirective extends AbstractSubscriptionDirective {
|
|
|
1389
1388
|
return this._enabled.value;
|
|
1390
1389
|
}
|
|
1391
1390
|
set enabled(enabled) {
|
|
1392
|
-
this._enabled.next(
|
|
1391
|
+
this._enabled.next(enabled !== false);
|
|
1393
1392
|
}
|
|
1394
1393
|
}
|
|
1395
1394
|
DbxActionEnforceModifiedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionEnforceModifiedDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -1706,7 +1705,8 @@ function makeAuthTransitionHook(config) {
|
|
|
1706
1705
|
else {
|
|
1707
1706
|
resultObs = of(redirectTo);
|
|
1708
1707
|
}
|
|
1709
|
-
redirectToObs = resultObs.pipe(map((
|
|
1708
|
+
redirectToObs = resultObs.pipe(map((inputStateRef) => {
|
|
1709
|
+
const stateRef = asSegueRef(inputStateRef);
|
|
1710
1710
|
let redirectTarget;
|
|
1711
1711
|
let redirectParams;
|
|
1712
1712
|
if (stateRef) {
|
|
@@ -1734,7 +1734,8 @@ function makeAuthTransitionHook(config) {
|
|
|
1734
1734
|
}
|
|
1735
1735
|
}
|
|
1736
1736
|
else {
|
|
1737
|
-
|
|
1737
|
+
const segueRef = asSegueRef(decision);
|
|
1738
|
+
return of($state.target(asSegueRefString(segueRef.ref), segueRef.refParams, segueRef.refOptions));
|
|
1738
1739
|
}
|
|
1739
1740
|
}), catchError((x) => {
|
|
1740
1741
|
console.warn('Encountered error in auth transition hook.', x);
|
|
@@ -1815,8 +1816,7 @@ function enableHasAuthRoleHook(transitionService, config) {
|
|
|
1815
1816
|
const targetState = transition.targetState();
|
|
1816
1817
|
const data = targetState.state().data;
|
|
1817
1818
|
const requiredRoles = new Set(data.authRoles);
|
|
1818
|
-
|
|
1819
|
-
return authService.authUserState$.pipe(map((x) => setIncludes(x)));
|
|
1819
|
+
return authService.authRoles$.pipe(map((x) => setIncludes(x, requiredRoles, data.authRolesMode)));
|
|
1820
1820
|
}
|
|
1821
1821
|
});
|
|
1822
1822
|
// Register the "requires auth" hook with the TransitionsService
|
|
@@ -1844,8 +1844,8 @@ function enableHasAuthStateHook(transitionService, config) {
|
|
|
1844
1844
|
const targetState = transition.targetState();
|
|
1845
1845
|
const data = targetState.state().data;
|
|
1846
1846
|
const config = toHasAuthStateObjectConfig(data.authStates);
|
|
1847
|
-
const
|
|
1848
|
-
return authService.authUserState$.pipe(map((x) => isAllowed(x,
|
|
1847
|
+
const allowedStates = toParsedHasAuthStateConfig(config);
|
|
1848
|
+
return authService.authUserState$.pipe(map((x) => isAllowed(x, allowedStates)));
|
|
1849
1849
|
}
|
|
1850
1850
|
});
|
|
1851
1851
|
// Register the "requires auth" hook with the TransitionsService
|