@coolon/angular-ui-powerups 14.43.0 → 14.45.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/interaction/components/input-activities/input-activity.mjs +8 -2
- package/esm2020/lib/interaction/components/input-activities/select-input-activity.mjs +1 -1
- package/esm2020/lib/place/components/place-outlet/place-outlet.component.mjs +2 -2
- package/esm2020/lib/place/exports.mjs +2 -1
- package/esm2020/lib/place/guards/place.guard.mjs +10 -9
- package/esm2020/lib/place/place-access-guard.mjs +1 -1
- package/esm2020/lib/place/place-auth-service.mjs +121 -0
- package/esm2020/lib/place/place-component.mjs +3 -3
- package/esm2020/lib/place/place-router.mjs +6 -28
- package/fesm2015/coolon-angular-ui-powerups.mjs +159 -55
- package/fesm2015/coolon-angular-ui-powerups.mjs.map +1 -1
- package/fesm2020/coolon-angular-ui-powerups.mjs +158 -55
- package/fesm2020/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/interaction/components/input-activities/input-activity.d.ts +2 -0
- package/lib/place/exports.d.ts +1 -0
- package/lib/place/guards/place.guard.d.ts +2 -2
- package/lib/place/place-access-guard.d.ts +2 -2
- package/lib/place/place-auth-service.d.ts +49 -0
- package/lib/place/place-router.d.ts +2 -9
- package/package.json +3 -2
|
@@ -39,7 +39,7 @@ import { MatTableModule } from '@angular/material/table';
|
|
|
39
39
|
import * as i4$1 from '@angular/material/tooltip';
|
|
40
40
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
41
41
|
import * as i1$3 from '@coolon/pectin';
|
|
42
|
-
import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, ValueModel, StoreInValueModel, Command, MutableListModel, StoreInListModel, Disposable, DelegatingListModel, MutableValueModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, Functions, HasDelegate, MultipleSelectionModel, SelectionModel, DelegatingCommand, AbstractComputedListModel, DirtyTrackingForm, DelegatingSelectionModel, PageController, PagedListModel, ComputedListModel, Deferred } from '@coolon/pectin';
|
|
42
|
+
import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, ValueModel, StoreInValueModel, Command, MutableListModel, StoreInListModel, Disposable, DelegatingListModel, MutableValueModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, Functions, HasDelegate, MultipleSelectionModel, SelectionModel, DelegatingCommand, AbstractComputedListModel, DirtyTrackingForm, DelegatingSelectionModel, PageController, PagedListModel, ComputedListModel, Deferred, ReducingValueModel, AndValueModel } from '@coolon/pectin';
|
|
43
43
|
import { __decorate, __param, __metadata, __awaiter } from 'tslib';
|
|
44
44
|
import escapeStringRegexp from 'escape-string-regexp';
|
|
45
45
|
import { isEmpty, isString, isFunction, isNil, isInteger, isObject, isEqual, join, uniq, last as last$1, first, isNumber, isNaN as isNaN$1 } from 'lodash';
|
|
@@ -60,8 +60,9 @@ import * as i1$6 from '@angular/material/dialog';
|
|
|
60
60
|
import { MatDialogModule, MAT_DIALOG_DEFAULT_OPTIONS } from '@angular/material/dialog';
|
|
61
61
|
import * as i1$4 from '@angular/router';
|
|
62
62
|
import { ActivatedRouteSnapshot, UrlSegment, NavigationStart, NavigationEnd, NavigationError, NavigationCancel, RouterModule } from '@angular/router';
|
|
63
|
-
import {
|
|
63
|
+
import { ArrayMultimap } from '@teppeis/multimaps';
|
|
64
64
|
import 'reflect-metadata';
|
|
65
|
+
import { Memoize as Memoize$1 } from 'typescript-memoize';
|
|
65
66
|
import * as i1$5 from '@angular/cdk/overlay';
|
|
66
67
|
import * as i3$1 from '@angular/material/list';
|
|
67
68
|
import { MatListModule } from '@angular/material/list';
|
|
@@ -6603,11 +6604,11 @@ class PlaceComponent extends DisposableComponent {
|
|
|
6603
6604
|
.select(placeType => {
|
|
6604
6605
|
var _a;
|
|
6605
6606
|
const definition = PlaceComponent.getDefinition(placeType);
|
|
6606
|
-
const guard = this.placeRouter.accessGuard$.value;
|
|
6607
|
+
const guard = this.placeRouter.authService.accessGuard$.value;
|
|
6607
6608
|
return guard.isAuthorised(definition) || ((_a = this.placeRouter.activeVisit$.value) === null || _a === void 0 ? void 0 : _a.isPlaceActive(definition));
|
|
6608
6609
|
}, {
|
|
6609
6610
|
postponeWhile: this.placeRouter.navigationInProgress$,
|
|
6610
|
-
dependsOn: [this.placeRouter.accessGuard$, this.placeRouter.activeVisit$]
|
|
6611
|
+
dependsOn: [this.placeRouter.authService.accessGuard$, this.placeRouter.activeVisit$]
|
|
6611
6612
|
});
|
|
6612
6613
|
}
|
|
6613
6614
|
initialiseVisit(visit, notifyVisitChanged) {
|
|
@@ -6956,6 +6957,123 @@ __decorate([
|
|
|
6956
6957
|
// .withAncestorParameters(ParentB, {id: "c"}) // barf if not a ancestor or missing parameters are required or parameter isn't valid
|
|
6957
6958
|
//
|
|
6958
6959
|
|
|
6960
|
+
class PlaceAuthorisationChecker extends ReducingValueModel {
|
|
6961
|
+
constructor() {
|
|
6962
|
+
super([]);
|
|
6963
|
+
this.predicatesByPlace = new ArrayMultimap;
|
|
6964
|
+
this.defaultAuthCheck = () => true;
|
|
6965
|
+
}
|
|
6966
|
+
setDefaultAuthCheck(options) {
|
|
6967
|
+
this.defaultAuthCheck = (placeDef) => {
|
|
6968
|
+
return options.isAuthorised(placeDef);
|
|
6969
|
+
};
|
|
6970
|
+
if (options.dependsOn) {
|
|
6971
|
+
this.trackSource(options.dependsOn);
|
|
6972
|
+
}
|
|
6973
|
+
}
|
|
6974
|
+
authoriseWhen(placeDefinition, condition$) {
|
|
6975
|
+
const { chain } = Dsl.disposeWith(this);
|
|
6976
|
+
this.predicatesByPlace.put(placeDefinition, condition$);
|
|
6977
|
+
this.trackSource(condition$);
|
|
6978
|
+
}
|
|
6979
|
+
isAuthorised(placeDef) {
|
|
6980
|
+
return this.value(placeDef);
|
|
6981
|
+
}
|
|
6982
|
+
compute(values) {
|
|
6983
|
+
return (def) => {
|
|
6984
|
+
return this.defaultAuthCheck(def) && this.checkPredicatesByPlace(def);
|
|
6985
|
+
};
|
|
6986
|
+
}
|
|
6987
|
+
checkPredicatesByPlace(def) {
|
|
6988
|
+
const placePredicates = this.predicatesByPlace.get(def);
|
|
6989
|
+
if (!placePredicates || placePredicates.length < 1) {
|
|
6990
|
+
return true;
|
|
6991
|
+
}
|
|
6992
|
+
else {
|
|
6993
|
+
return placePredicates.reduce((sum, model) => {
|
|
6994
|
+
return sum && model.value;
|
|
6995
|
+
}, true);
|
|
6996
|
+
}
|
|
6997
|
+
}
|
|
6998
|
+
}
|
|
6999
|
+
class PlaceAuthService extends GarbageCollector {
|
|
7000
|
+
constructor() {
|
|
7001
|
+
super();
|
|
7002
|
+
this.placeGuards$ = new MutableListModel();
|
|
7003
|
+
this._ready$ = new AndValueModel().setDefault(true);
|
|
7004
|
+
this.authenticated$ = this.registerDisposable(new DelegatingValueModel).withDefault(true);
|
|
7005
|
+
this.authorisationChecker$ = this.registerDisposable(new PlaceAuthorisationChecker());
|
|
7006
|
+
const { chain } = Dsl.disposeWith(this);
|
|
7007
|
+
this.accessGuard$ = chain.reduce(this.authenticated$, this.authorisationChecker$, (authenticated, authCheck) => {
|
|
7008
|
+
return new PlaceAuthService.AccessGuard(authenticated, authCheck);
|
|
7009
|
+
});
|
|
7010
|
+
}
|
|
7011
|
+
configureAuthentication(options) {
|
|
7012
|
+
this.authNOptions = options;
|
|
7013
|
+
this.authenticated$.setDelegate(options.isAuthenticated$);
|
|
7014
|
+
this.capturePostoneDependency(options);
|
|
7015
|
+
}
|
|
7016
|
+
configureAuthorisation(options) {
|
|
7017
|
+
const { chain } = Dsl.disposeWith(this);
|
|
7018
|
+
this.authZOptions = options;
|
|
7019
|
+
this.authorisationChecker$.setDefaultAuthCheck(options);
|
|
7020
|
+
this.capturePostoneDependency(options);
|
|
7021
|
+
}
|
|
7022
|
+
enablePlace(placeDefinition, options) {
|
|
7023
|
+
const { chain } = Dsl.disposeWith(this);
|
|
7024
|
+
const when$ = options.when$ ? options.when$ : chain(options.unless$).isFalsey();
|
|
7025
|
+
this.authorisationChecker$.authoriseWhen(PlaceComponent.getDefinition(placeDefinition), when$);
|
|
7026
|
+
this.capturePostoneDependency(options);
|
|
7027
|
+
}
|
|
7028
|
+
waitUntilReady() {
|
|
7029
|
+
return this.toPromise(this._ready$);
|
|
7030
|
+
}
|
|
7031
|
+
getAuthenticationFailureRedirect(activatedRoute, state) {
|
|
7032
|
+
const redirect = this.authNOptions.redirectTo(activatedRoute, state);
|
|
7033
|
+
return redirect instanceof Visit ? redirect : Visit.goto(redirect);
|
|
7034
|
+
}
|
|
7035
|
+
getAuthorisationFailureRedirectOptions(component) {
|
|
7036
|
+
return this.authZOptions.redirectTo(component).map(it => it instanceof Visit ? it : Visit.goto(it));
|
|
7037
|
+
}
|
|
7038
|
+
toPromise(condition$) {
|
|
7039
|
+
// TODO: move this functionality to pectin with a waitUnit(model$).isTruthy() DSL.
|
|
7040
|
+
const { when } = Dsl.disposeWith(this);
|
|
7041
|
+
return new Promise((resolve) => {
|
|
7042
|
+
when(condition$).becomesTruthy(() => resolve(), { once: true, initialValue: "evaluate" });
|
|
7043
|
+
});
|
|
7044
|
+
}
|
|
7045
|
+
capturePostoneDependency(options) {
|
|
7046
|
+
const { chain } = Dsl.disposeWith(this);
|
|
7047
|
+
if (options.postponeUntil) {
|
|
7048
|
+
this._ready$.addSource(options.postponeUntil);
|
|
7049
|
+
}
|
|
7050
|
+
else if (options.postponeWhile) {
|
|
7051
|
+
this._ready$.addSource(chain(options.postponeWhile).isFalsey());
|
|
7052
|
+
}
|
|
7053
|
+
}
|
|
7054
|
+
isAuthenticated() {
|
|
7055
|
+
return this.accessGuard$.value.isAuthenticated();
|
|
7056
|
+
}
|
|
7057
|
+
isAuthorised(c) {
|
|
7058
|
+
return this.accessGuard$.value.isAuthorised(c);
|
|
7059
|
+
}
|
|
7060
|
+
}
|
|
7061
|
+
(function (PlaceAuthService) {
|
|
7062
|
+
class AccessGuard {
|
|
7063
|
+
constructor(authenticated, authCheck) {
|
|
7064
|
+
this.authenticated = authenticated;
|
|
7065
|
+
this.authCheck = authCheck;
|
|
7066
|
+
}
|
|
7067
|
+
isAuthenticated() {
|
|
7068
|
+
return this.authenticated;
|
|
7069
|
+
}
|
|
7070
|
+
isAuthorised(placeDefinition) {
|
|
7071
|
+
return this.authCheck(placeDefinition);
|
|
7072
|
+
}
|
|
7073
|
+
}
|
|
7074
|
+
PlaceAuthService.AccessGuard = AccessGuard;
|
|
7075
|
+
})(PlaceAuthService || (PlaceAuthService = {}));
|
|
7076
|
+
|
|
6959
7077
|
/**
|
|
6960
7078
|
* This class handles the logic around canDeactivate for a given router state transition. It's core responsibilities are:
|
|
6961
7079
|
* 1. Ensure we only ask the component to deactivate once on a given navigation cycle (since visit sanitisation can result in multiple round trips to through the router.)
|
|
@@ -7745,21 +7863,6 @@ class PopStateNavigation extends AbstractPopStateNavigation {
|
|
|
7745
7863
|
}
|
|
7746
7864
|
}
|
|
7747
7865
|
|
|
7748
|
-
var PlaceAccessGuard;
|
|
7749
|
-
(function (PlaceAccessGuard) {
|
|
7750
|
-
class NoAuth {
|
|
7751
|
-
// @Trace()
|
|
7752
|
-
isAuthenticated() {
|
|
7753
|
-
return true;
|
|
7754
|
-
}
|
|
7755
|
-
// @Trace()
|
|
7756
|
-
isAuthorised(placeDefinition) {
|
|
7757
|
-
return true;
|
|
7758
|
-
}
|
|
7759
|
-
}
|
|
7760
|
-
PlaceAccessGuard.NoAuth = NoAuth;
|
|
7761
|
-
})(PlaceAccessGuard || (PlaceAccessGuard = {}));
|
|
7762
|
-
|
|
7763
7866
|
class InteractionServiceRoutingAdapter {
|
|
7764
7867
|
constructor(activeInteractionContextIds, activeModalContext, createExclusiveInteractionContext) {
|
|
7765
7868
|
this.activeInteractionContextIds = activeInteractionContextIds;
|
|
@@ -8313,11 +8416,7 @@ class PlaceRouter extends GarbageCollector {
|
|
|
8313
8416
|
this.navigationSession$ = new MutableValueModel();
|
|
8314
8417
|
this._activeVisit$ = new MutableValueModel();
|
|
8315
8418
|
this.sessionFinishedJobs = [];
|
|
8316
|
-
|
|
8317
|
-
* An observable model containing the authoriser function. This allows places to react to changes
|
|
8318
|
-
* in permissions when any underlying auth logic changes, e.g. a role being removed from a user.
|
|
8319
|
-
*/
|
|
8320
|
-
this._accessGuard$ = this.registerDisposable(new DelegatingValueModel().withDefault(new PlaceAccessGuard.NoAuth()));
|
|
8419
|
+
this.authService = new PlaceAuthService();
|
|
8321
8420
|
if (window["Cypress"]) {
|
|
8322
8421
|
window["aup.PlaceRouter"] = this;
|
|
8323
8422
|
}
|
|
@@ -8376,29 +8475,11 @@ class PlaceRouter extends GarbageCollector {
|
|
|
8376
8475
|
// the back button was clicked.
|
|
8377
8476
|
angularLocation.onUrlChange(url => this.onUrlChanged(url));
|
|
8378
8477
|
}
|
|
8379
|
-
get accessGuard$() {
|
|
8380
|
-
return this._accessGuard$.readonly;
|
|
8381
|
-
}
|
|
8382
|
-
// @Trace()
|
|
8383
|
-
configureAuth(accessGrant, redirections) {
|
|
8384
|
-
// We need a shitty mutable model until setDelegate is clever enough to work with readonly models.
|
|
8385
|
-
const hackyMutableModel = new MutableValueModel();
|
|
8386
|
-
const binding = new Binding(hackyMutableModel, accessGrant, {
|
|
8387
|
-
toRight(leftValue) {
|
|
8388
|
-
return lang.illegalState("hackyMutableModel is read only");
|
|
8389
|
-
},
|
|
8390
|
-
toLeft: (rightValue) => rightValue
|
|
8391
|
-
});
|
|
8392
|
-
binding.writeLeft();
|
|
8393
|
-
this._accessGuard$.setDelegate(hackyMutableModel);
|
|
8394
|
-
this.redirections = redirections;
|
|
8395
|
-
}
|
|
8396
8478
|
getAuthenticationFailureRedirect(activatedRoute, state) {
|
|
8397
|
-
|
|
8398
|
-
return redirect instanceof Visit ? redirect : Visit.goto(redirect);
|
|
8479
|
+
return this.authService.getAuthenticationFailureRedirect(activatedRoute, state);
|
|
8399
8480
|
}
|
|
8400
8481
|
getAuthorisationFailureRedirectOptions(component) {
|
|
8401
|
-
return this.
|
|
8482
|
+
return this.authService.getAuthorisationFailureRedirectOptions(component);
|
|
8402
8483
|
}
|
|
8403
8484
|
get navigationSession() {
|
|
8404
8485
|
return this.navigationSession$.value;
|
|
@@ -9493,6 +9574,10 @@ class InputActivity extends Activity {
|
|
|
9493
9574
|
var _a;
|
|
9494
9575
|
return (_a = this.activityData.cssClassName) !== null && _a !== void 0 ? _a : '';
|
|
9495
9576
|
}
|
|
9577
|
+
get dataCyAttribute() {
|
|
9578
|
+
var _a;
|
|
9579
|
+
return (_a = this.activityData.dataCy) !== null && _a !== void 0 ? _a : '';
|
|
9580
|
+
}
|
|
9496
9581
|
onEscape() {
|
|
9497
9582
|
if (this.shouldCancelOnEscape() && this.cancelCommand.enabled$.value) {
|
|
9498
9583
|
this.cancelCommand.execute();
|
|
@@ -9504,7 +9589,7 @@ class InputActivity extends Activity {
|
|
|
9504
9589
|
}
|
|
9505
9590
|
}
|
|
9506
9591
|
InputActivity.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: InputActivity, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9507
|
-
InputActivity.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: InputActivity, selector: "ng-component", inputs: { layout: "layout" }, host: { listeners: { "keydown.escape": "onEscape()" }, properties: { "class": "this.additionalCssClassName", "attr.layout": "this.layout" } }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
9592
|
+
InputActivity.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: InputActivity, selector: "ng-component", inputs: { layout: "layout" }, host: { listeners: { "keydown.escape": "onEscape()" }, properties: { "class": "this.additionalCssClassName", "attr.layout": "this.layout", "attr.data-cy": "this.dataCyAttribute" } }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
9508
9593
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: InputActivity, decorators: [{
|
|
9509
9594
|
type: Component,
|
|
9510
9595
|
args: [{ template: `` }]
|
|
@@ -9519,6 +9604,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
9519
9604
|
}], additionalCssClassName: [{
|
|
9520
9605
|
type: HostBinding,
|
|
9521
9606
|
args: ["class"]
|
|
9607
|
+
}], dataCyAttribute: [{
|
|
9608
|
+
type: HostBinding,
|
|
9609
|
+
args: ["attr.data-cy"]
|
|
9522
9610
|
}], onEscape: [{
|
|
9523
9611
|
type: HostListener,
|
|
9524
9612
|
args: ['keydown.escape']
|
|
@@ -10121,7 +10209,7 @@ class PlaceOutletComponent extends DisposableComponent {
|
|
|
10121
10209
|
chain(this._activePlaceModel)
|
|
10122
10210
|
.postponeWhile(this.navigationInProgress)
|
|
10123
10211
|
.subscribe(place => this.placeChanged.emit(place));
|
|
10124
|
-
this.authorised = chain(placeRouter.accessGuard$).map(guard => guard.isAuthorised(this._activePlaceDefinition.value), {
|
|
10212
|
+
this.authorised = chain(placeRouter.authService.accessGuard$).map(guard => guard.isAuthorised(this._activePlaceDefinition.value), {
|
|
10125
10213
|
dependsOn: this._activePlaceDefinition,
|
|
10126
10214
|
postponeWhile: chain(this._activePlaceDefinition).isNil()
|
|
10127
10215
|
}).otherwise(true); // if we don't have a place def yet we need to show the outlet so we get one injected.
|
|
@@ -10792,6 +10880,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
10792
10880
|
* @file Automatically generated by barrelsby.
|
|
10793
10881
|
*/
|
|
10794
10882
|
|
|
10883
|
+
var PlaceAccessGuard;
|
|
10884
|
+
(function (PlaceAccessGuard) {
|
|
10885
|
+
class NoAuth {
|
|
10886
|
+
// @Trace()
|
|
10887
|
+
isAuthenticated() {
|
|
10888
|
+
return true;
|
|
10889
|
+
}
|
|
10890
|
+
// @Trace()
|
|
10891
|
+
isAuthorised(placeDefinition) {
|
|
10892
|
+
return true;
|
|
10893
|
+
}
|
|
10894
|
+
}
|
|
10895
|
+
PlaceAccessGuard.NoAuth = NoAuth;
|
|
10896
|
+
})(PlaceAccessGuard || (PlaceAccessGuard = {}));
|
|
10897
|
+
|
|
10795
10898
|
function Place(options) {
|
|
10796
10899
|
return (target) => {
|
|
10797
10900
|
var _a, _b;
|
|
@@ -10877,8 +10980,8 @@ class PlaceGuard {
|
|
|
10877
10980
|
this.interactionService = interactionService;
|
|
10878
10981
|
this.injector = injector;
|
|
10879
10982
|
}
|
|
10880
|
-
get
|
|
10881
|
-
return this.placeRouter.
|
|
10983
|
+
get authService() {
|
|
10984
|
+
return this.placeRouter.authService;
|
|
10882
10985
|
}
|
|
10883
10986
|
// @Trace()
|
|
10884
10987
|
canActivate(activatedRoute, state) {
|
|
@@ -10886,16 +10989,17 @@ class PlaceGuard {
|
|
|
10886
10989
|
if (PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) {
|
|
10887
10990
|
const placeDefinition = PlaceComponent.getDefinition(activatedRoute.component);
|
|
10888
10991
|
if (placeDefinition.authenticate) {
|
|
10889
|
-
|
|
10992
|
+
yield this.placeRouter.authService.waitUntilReady();
|
|
10993
|
+
const authenticated = this.authService.isAuthenticated();
|
|
10890
10994
|
if (!authenticated) {
|
|
10891
|
-
const redirect = this.
|
|
10995
|
+
const redirect = this.authService.getAuthenticationFailureRedirect(activatedRoute, state);
|
|
10892
10996
|
// const nextPlaceDef = this.getPlaceDefinition(redirect);
|
|
10893
10997
|
if (redirect.requiresAuthentication()) {
|
|
10894
10998
|
lang.illegalState(`onAuthenticationFailure hook returned place ${redirect.toDebugString()} that requires authentication.`);
|
|
10895
10999
|
}
|
|
10896
11000
|
return this.createUrlTree(redirect);
|
|
10897
11001
|
}
|
|
10898
|
-
if (!this.
|
|
11002
|
+
if (!this.authService.isAuthorised(placeDefinition)) {
|
|
10899
11003
|
const nextRedirect = this.findBestAuthenticatedAlternative(placeDefinition, activatedRoute);
|
|
10900
11004
|
return this.createUrlTree(nextRedirect);
|
|
10901
11005
|
}
|
|
@@ -10924,7 +11028,7 @@ class PlaceGuard {
|
|
|
10924
11028
|
lang.illegalState(`redirectToFirstChild set to true, but there were no children `);
|
|
10925
11029
|
}
|
|
10926
11030
|
for (let child of placeDefinition.children) {
|
|
10927
|
-
if (!child.authenticate || this.
|
|
11031
|
+
if (!child.authenticate || this.authService.isAuthorised(child)) {
|
|
10928
11032
|
return destUrlSnapshot.appendSegment(new VisitSegment(child));
|
|
10929
11033
|
}
|
|
10930
11034
|
}
|
|
@@ -10945,7 +11049,7 @@ class PlaceGuard {
|
|
|
10945
11049
|
let currentPlace = placeDefinition;
|
|
10946
11050
|
while (!currentPlace.isRoot()) {
|
|
10947
11051
|
currentPlace = currentPlace.parent;
|
|
10948
|
-
const permittedChild = currentPlace.findChild(c => this.
|
|
11052
|
+
const permittedChild = currentPlace.findChild(c => this.authService.isAuthorised(c));
|
|
10949
11053
|
if (permittedChild) {
|
|
10950
11054
|
return Visit.goto(permittedChild.component);
|
|
10951
11055
|
}
|
|
@@ -10956,7 +11060,7 @@ class PlaceGuard {
|
|
|
10956
11060
|
return lang.illegalState(`onAuthorisationFailure hook didn't return any alternate places`);
|
|
10957
11061
|
}
|
|
10958
11062
|
else {
|
|
10959
|
-
const nextRedirect = alternativeRoutes.find(it => it.isAuthorised(this.
|
|
11063
|
+
const nextRedirect = alternativeRoutes.find(it => it.isAuthorised(this.authService));
|
|
10960
11064
|
return nextRedirect !== null && nextRedirect !== void 0 ? nextRedirect : lang.illegalState(`onAuthorisationFailure hook didn't return any authorised locations`);
|
|
10961
11065
|
}
|
|
10962
11066
|
}
|
|
@@ -11193,5 +11297,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
11193
11297
|
* Generated bundle index. Do not edit.
|
|
11194
11298
|
*/
|
|
11195
11299
|
|
|
11196
|
-
export { ACTIVITY_DATA, ALERT_CONFIG, AUP_PLACE_CONFIG, AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT, AbstractActivityTriggerComponent, AbstractCardContainerComponent, AbstractConfirmDialogComponent, AbstractDialogComponent, AbstractInputComponent, AbstractInteractionContext, AbstractListInputComponent, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, AbstractPopupMenuComponent, AbstractTableComponent, AbstractTableModel, AbstractValueInputComponent, Activity, ActivityActionsComponent, ActivityBodyComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, ActivityTitleComponent, AddCardActivityComponent, AddItemInteractionContextComponent, Alert, AlertDialogComponent, AngularUiPowerupsModule, AutocompleteInputComponent, Bounds, BusyOverlayComponent, CELL_EDITOR_PORTAL, CELL_RENDERER_PORTAL, CardContainerComponent, CardStackComponent, CellEditorPortalRef, CellHeaderPortalRef, CellPortalRef, CellRendererPortalRef, CheckboxInputComponent, ColumnListModel, ColumnModel, ColumnTemplateDirective, ColumnTextSearchFormatter, CommandComponent, CommandContainer, CommandDirective, CommandFace, CommandFaceComponent, ComponentCellRendererPortalRef, ComponentsModule, ConfirmThenDialogComponent, ConfirmThenExecuteDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, CustomTemplateColumnModel, CustomValueColumnModel, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DecoratedTreeNode, DefaultCellRendererComponent, DefaultHeaderCellRendererComponent, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditSession, EditorControlColumnModel, EmptyStateComponent, EnableCellTextSearch, EventCleanUpSession, FlattenedTreeListModel, FlexComponent, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, GarbageCollectorDirective, HEADER_CELL_RENDERER_PORTAL, HighlightPipe, HighlightTextModelDirective, HorizontalAlignment, IconComponent, InPlaceInteractionContextComponent, InlineActivityTriggerComponent, InlineEditorModel, InlineStringEditorComponent, InputActivity, InteractionContextTriggerFor, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, Keys, LEFT_RIGHT_PLACE_ANIMATION, LabelledValueComponent, ListPlaceNavComponent, ListPropertyColumnModel, LoadingContainerComponent, MarkdownComponent, MarkdownService, ModalActivityTriggerComponent, ModalInteractionContextFactory, MoreMenuComponent, MultipleSelectInputComponent, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NotAuthorisedNoticeComponent, NumberInputComponent, POPUP_CONTAINER, PORTAL_EDITOR_COMPONENT, PORTAL_RENDERER_COMPONENT, PaginatorComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceAccessGuard, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, PopupActivityTriggerComponent, PopupAwareComponent, PopupInteractionContextComponent, PopupMenuComponent, PopupMenuRendererComponent, PropertyColumnModel, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SectionHeaderComponent, SelectInputActivity, SelectInputComponent, SelectionCellComponent, SelectionColumnModel, SelectionHeaderCellComponent, SeparatorComponent, SidePlaceNavigationComponent, StringInputActivity, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TableBodyComponent, TableCellComponent, TableComponent, TableFilterModel, TableHeaderCellComponent, TableModel, TableMoreMenuComponent, TableMoreMenuPopupComponent, TableRowMenuComponent, TemplateCellRendererPortalRef, TextInputComponent, ToolBarComponent, TrackBy, TreeExpansionModel, TreeInheritanceIconComponent, TreeLabelCellRendererComponent, TreeLabelColumnModel, TreeTableComponent, TreeTableModel, UrlService, UrlSnapshot, VerticalFocusContainerComponent, VisibilityService, Visit, VisitParameter, VisitParameterList, VisitSegment, VisitSegmentSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationTypeDetermined, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, markdownPillExtension, slideDownAndRightOnEnterAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, treeNodeDecorator };
|
|
11300
|
+
export { ACTIVITY_DATA, ALERT_CONFIG, AUP_PLACE_CONFIG, AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT, AbstractActivityTriggerComponent, AbstractCardContainerComponent, AbstractConfirmDialogComponent, AbstractDialogComponent, AbstractInputComponent, AbstractInteractionContext, AbstractListInputComponent, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, AbstractPopupMenuComponent, AbstractTableComponent, AbstractTableModel, AbstractValueInputComponent, Activity, ActivityActionsComponent, ActivityBodyComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, ActivityTitleComponent, AddCardActivityComponent, AddItemInteractionContextComponent, Alert, AlertDialogComponent, AngularUiPowerupsModule, AutocompleteInputComponent, Bounds, BusyOverlayComponent, CELL_EDITOR_PORTAL, CELL_RENDERER_PORTAL, CardContainerComponent, CardStackComponent, CellEditorPortalRef, CellHeaderPortalRef, CellPortalRef, CellRendererPortalRef, CheckboxInputComponent, ColumnListModel, ColumnModel, ColumnTemplateDirective, ColumnTextSearchFormatter, CommandComponent, CommandContainer, CommandDirective, CommandFace, CommandFaceComponent, ComponentCellRendererPortalRef, ComponentsModule, ConfirmThenDialogComponent, ConfirmThenExecuteDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, CustomTemplateColumnModel, CustomValueColumnModel, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DecoratedTreeNode, DefaultCellRendererComponent, DefaultHeaderCellRendererComponent, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditSession, EditorControlColumnModel, EmptyStateComponent, EnableCellTextSearch, EventCleanUpSession, FlattenedTreeListModel, FlexComponent, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, GarbageCollectorDirective, HEADER_CELL_RENDERER_PORTAL, HighlightPipe, HighlightTextModelDirective, HorizontalAlignment, IconComponent, InPlaceInteractionContextComponent, InlineActivityTriggerComponent, InlineEditorModel, InlineStringEditorComponent, InputActivity, InteractionContextTriggerFor, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, Keys, LEFT_RIGHT_PLACE_ANIMATION, LabelledValueComponent, ListPlaceNavComponent, ListPropertyColumnModel, LoadingContainerComponent, MarkdownComponent, MarkdownService, ModalActivityTriggerComponent, ModalInteractionContextFactory, MoreMenuComponent, MultipleSelectInputComponent, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NotAuthorisedNoticeComponent, NumberInputComponent, POPUP_CONTAINER, PORTAL_EDITOR_COMPONENT, PORTAL_RENDERER_COMPONENT, PaginatorComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceAccessGuard, PlaceAuthService, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, PopupActivityTriggerComponent, PopupAwareComponent, PopupInteractionContextComponent, PopupMenuComponent, PopupMenuRendererComponent, PropertyColumnModel, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SectionHeaderComponent, SelectInputActivity, SelectInputComponent, SelectionCellComponent, SelectionColumnModel, SelectionHeaderCellComponent, SeparatorComponent, SidePlaceNavigationComponent, StringInputActivity, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TableBodyComponent, TableCellComponent, TableComponent, TableFilterModel, TableHeaderCellComponent, TableModel, TableMoreMenuComponent, TableMoreMenuPopupComponent, TableRowMenuComponent, TemplateCellRendererPortalRef, TextInputComponent, ToolBarComponent, TrackBy, TreeExpansionModel, TreeInheritanceIconComponent, TreeLabelCellRendererComponent, TreeLabelColumnModel, TreeTableComponent, TreeTableModel, UrlService, UrlSnapshot, VerticalFocusContainerComponent, VisibilityService, Visit, VisitParameter, VisitParameterList, VisitSegment, VisitSegmentSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationTypeDetermined, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, markdownPillExtension, slideDownAndRightOnEnterAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, treeNodeDecorator };
|
|
11197
11301
|
//# sourceMappingURL=coolon-angular-ui-powerups.mjs.map
|