@coolon/angular-ui-powerups 3.7.1 → 3.7.3
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/CHANGELOG.md +15 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +176 -114
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/components/commands/group/popup-menu/abstract-popup-menu.component.js +2 -2
- package/esm2015/lib/components/commands/group/popup-menu/abstract-popup-menu.component.js.map +1 -1
- package/esm2015/lib/components/forms/number-input/number-input.component.js.map +1 -1
- package/esm2015/lib/components/table/column-model.js +8 -0
- package/esm2015/lib/components/table/column-model.js.map +1 -1
- package/esm2015/lib/components/table/column-model.metadata.json +1 -1
- package/esm2015/lib/components/table/table.component.js +1 -1
- package/esm2015/lib/components/table/table.component.metadata.json +1 -1
- package/esm2015/lib/place/components/abstract-place-navigation.component.js +9 -5
- package/esm2015/lib/place/components/abstract-place-navigation.component.js.map +1 -1
- package/esm2015/lib/place/components/abstract-place-navigation.component.metadata.json +1 -1
- package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js +5 -5
- package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js.map +1 -1
- package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.metadata.json +1 -1
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +6 -16
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.js.map +1 -1
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.metadata.json +1 -1
- package/esm2015/lib/place/components/side-place-navigation/side-place-navigation.component.js +5 -8
- package/esm2015/lib/place/components/side-place-navigation/side-place-navigation.component.js.map +1 -1
- package/esm2015/lib/place/components/side-place-navigation/side-place-navigation.component.metadata.json +1 -1
- package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +5 -5
- package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js.map +1 -1
- package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.metadata.json +1 -1
- package/esm2015/lib/place/exports.js +1 -1
- package/esm2015/lib/place/exports.js.map +1 -1
- package/esm2015/lib/place/exports.metadata.json +1 -1
- package/esm2015/lib/place/guards/place.guard.js +9 -13
- package/esm2015/lib/place/guards/place.guard.js.map +1 -1
- package/esm2015/lib/place/guards/place.guard.metadata.json +1 -1
- package/esm2015/lib/place/place-access-guard.js +28 -0
- package/esm2015/lib/place/place-access-guard.js.map +1 -0
- package/esm2015/lib/place/place-access-guard.metadata.json +1 -0
- package/esm2015/lib/place/place-router.js +36 -2
- package/esm2015/lib/place/place-router.js.map +1 -1
- package/esm2015/lib/place/place-router.metadata.json +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +167 -110
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/table/column-model.d.ts +6 -0
- package/lib/place/components/abstract-place-navigation.component.d.ts +3 -2
- package/lib/place/components/list-place-nav/list-place-nav.component.d.ts +2 -2
- package/lib/place/components/place-outlet/place-outlet.component.d.ts +1 -3
- package/lib/place/components/side-place-navigation/side-place-navigation.component.d.ts +2 -4
- package/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.d.ts +2 -2
- package/lib/place/exports.d.ts +1 -1
- package/lib/place/guards/place.guard.d.ts +1 -3
- package/lib/place/place-access-guard.d.ts +11 -0
- package/lib/place/place-router.d.ts +18 -4
- package/package.json +1 -1
- package/esm2015/lib/place/place-auth-service.js +0 -3
- package/esm2015/lib/place/place-auth-service.js.map +0 -1
- package/esm2015/lib/place/place-auth-service.metadata.json +0 -1
- package/lib/place/place-auth-service.d.ts +0 -36
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [3.7.3](https://bitbucket.org/coolon/angular-ui-powerups/compare/v3.7.2...v3.7.3) (2021-01-28)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* added css fix for firefox rendering of aup tables ([fa73ea5](https://bitbucket.org/coolon/angular-ui-powerups/commit/fa73ea5bb3b0b6de48abb5a89dbdf1d8ddb80f19))
|
|
11
|
+
* improved auth service design ([f6af33d](https://bitbucket.org/coolon/angular-ui-powerups/commit/f6af33d036d5fee3039871479d09d673ca3ef0bc))
|
|
12
|
+
|
|
13
|
+
### [3.7.2](https://bitbucket.org/coolon/angular-ui-powerups/compare/v3.7.1...v3.7.2) (2021-01-22)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* fixed null point workaround to always return something ([b53bb4b](https://bitbucket.org/coolon/angular-ui-powerups/commit/b53bb4b322908189d087b27c4fce5f87de077c7d))
|
|
19
|
+
|
|
5
20
|
### [3.7.1](https://bitbucket.org/coolon/angular-ui-powerups/compare/v3.7.0...v3.7.1) (2021-01-22)
|
|
6
21
|
|
|
7
22
|
|
|
@@ -1075,7 +1075,7 @@
|
|
|
1075
1075
|
_this.faceModelDelegate = new pectin.DelegatingValueModel();
|
|
1076
1076
|
_this.xPosition = 'after';
|
|
1077
1077
|
_this.yPosition = 'below';
|
|
1078
|
-
var
|
|
1078
|
+
var _c = pectin.Dsl.disposeWith(_this), chain = _c.chain, valueOf = _c.valueOf, before = _c.before, when = _c.when, after = _c.after, observe = _c.observe, switchOn = _c.switchOn;
|
|
1079
1079
|
// group.faceListModel = chain(this.faceModel).mapToList(face => [face]);
|
|
1080
1080
|
_this.faceAdapterModel = chain(_this.faceModelDelegate).map(function (f) { return new exports.CommandFace.Adapter(f); });
|
|
1081
1081
|
_this.children = chain(_this._unorderedChildren).sortBy('componentIndex');
|
|
@@ -1087,11 +1087,11 @@
|
|
|
1087
1087
|
};
|
|
1088
1088
|
Object.defineProperty(AbstractPopupMenuComponent.prototype, "faceAdapter", {
|
|
1089
1089
|
get: function () {
|
|
1090
|
-
var _a;
|
|
1090
|
+
var _a, _b;
|
|
1091
1091
|
if (!this.faceAdapterModel) {
|
|
1092
1092
|
console.error("Somehow faceAdapterModel is nil -- set a break point here and let me know what's going on");
|
|
1093
1093
|
}
|
|
1094
|
-
return (_a = this.faceAdapterModel) === null || _a === void 0 ? void 0 : _a.value;
|
|
1094
|
+
return (_b = (_a = this.faceAdapterModel) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : new exports.CommandFace.Adapter(undefined);
|
|
1095
1095
|
},
|
|
1096
1096
|
enumerable: false,
|
|
1097
1097
|
configurable: true
|
|
@@ -2654,6 +2654,14 @@
|
|
|
2654
2654
|
}));
|
|
2655
2655
|
return this;
|
|
2656
2656
|
};
|
|
2657
|
+
PropertyColumnModel.prototype.liveEditCellRenderer = function (componentType, options) {
|
|
2658
|
+
return this.mutableCellRenderer(componentType, options);
|
|
2659
|
+
};
|
|
2660
|
+
/**
|
|
2661
|
+
* Deprecated. Use #liveEditCellRenderer instead.
|
|
2662
|
+
* @param componentType
|
|
2663
|
+
* @param options
|
|
2664
|
+
*/
|
|
2657
2665
|
PropertyColumnModel.prototype.mutableCellRenderer = function (componentType, options) {
|
|
2658
2666
|
var _this = this;
|
|
2659
2667
|
this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, function (component, rowData, firstTime) {
|
|
@@ -3176,7 +3184,7 @@
|
|
|
3176
3184
|
{ type: i0.Component, args: [{
|
|
3177
3185
|
selector: 'aup-table',
|
|
3178
3186
|
template: "<table mat-table [dataSource]=\"tableModel.dataSource.value\" [trackBy]=\"tableModel.trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\" matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef>\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"onCellClicked(column, row)\" [class.enable-cursor]=\"tableModel.isRowSelectionEnabledFor(column)\">\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"tableModel\"\n [editSession]=\"tableModel.getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"tableModel.getRowClasses(row)\" [attr.trackBy]=\"tableModel.trackBy(i, row)\"\n ></tr>\n\n</table>\n",
|
|
3179
|
-
styles: [":host{align-items:stretch;display:flex;flex-direction:column}:host table{flex:1}"]
|
|
3187
|
+
styles: [":host{align-items:stretch;display:flex;flex-direction:column}:host table{flex:1;width:100%}"]
|
|
3180
3188
|
},] }
|
|
3181
3189
|
];
|
|
3182
3190
|
TableComponent.ctorParameters = function () { return []; };
|
|
@@ -4939,8 +4947,6 @@
|
|
|
4939
4947
|
},] }
|
|
4940
4948
|
];
|
|
4941
4949
|
|
|
4942
|
-
var PLACE_AUTH_SERVICE = new i0.InjectionToken("PlaceAuthService");
|
|
4943
|
-
|
|
4944
4950
|
exports.ParameterDefinition = /** @class */ (function () {
|
|
4945
4951
|
function ParameterDefinition(propertyName, options, urlFormat) {
|
|
4946
4952
|
this.propertyName = propertyName;
|
|
@@ -5312,77 +5318,6 @@
|
|
|
5312
5318
|
PlaceComponent.injectDefinition = injectDefinition;
|
|
5313
5319
|
})(exports.PlaceComponent || (exports.PlaceComponent = {}));
|
|
5314
5320
|
|
|
5315
|
-
var Visit = /** @class */ (function () {
|
|
5316
|
-
function Visit(placeDefinition, visitParameters) {
|
|
5317
|
-
if (visitParameters === void 0) { visitParameters = {}; }
|
|
5318
|
-
this.placeDefinition = placeDefinition;
|
|
5319
|
-
this.visitParameters = visitParameters;
|
|
5320
|
-
}
|
|
5321
|
-
// @Trace()
|
|
5322
|
-
Visit.prototype.getRouteId = function () {
|
|
5323
|
-
return this.placeDefinition.getRouteIdFrom(this);
|
|
5324
|
-
};
|
|
5325
|
-
// @Trace()
|
|
5326
|
-
Visit.prototype.hasRouteId = function () {
|
|
5327
|
-
return !_.isNil(this.getRouteId());
|
|
5328
|
-
};
|
|
5329
|
-
/**
|
|
5330
|
-
* Returns the value of the place parameter with the specified name. The parameter
|
|
5331
|
-
* name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
|
|
5332
|
-
* same as the the ValueModel property name.
|
|
5333
|
-
* @param parameterName the field name of the property model or the `as` option if specified.
|
|
5334
|
-
*/
|
|
5335
|
-
Visit.prototype.getParameter = function (parameterName) {
|
|
5336
|
-
return this.visitParameters[parameterName];
|
|
5337
|
-
};
|
|
5338
|
-
// @Trace()
|
|
5339
|
-
Visit.prototype.hasParameter = function (parameterName) {
|
|
5340
|
-
return Object.keys(this.visitParameters).includes(parameterName);
|
|
5341
|
-
};
|
|
5342
|
-
Visit.prototype.replace = function (parameter, value) {
|
|
5343
|
-
var _a;
|
|
5344
|
-
return new Visit(this.placeDefinition, Object.assign(Object.assign({}, this.visitParameters), (_a = {}, _a[parameter.name] = value, _a)));
|
|
5345
|
-
};
|
|
5346
|
-
Visit.prototype.mergeRouteParameters = function (routeParams) {
|
|
5347
|
-
var _this = this;
|
|
5348
|
-
// todo: whitelist parameters.
|
|
5349
|
-
var routeParameterKeys = Object.keys(routeParams);
|
|
5350
|
-
var params = {};
|
|
5351
|
-
this.placeDefinition.getVisitParameterDefs().forEach(function (def) {
|
|
5352
|
-
if (def.isRouteId || def.isRouteParameter) {
|
|
5353
|
-
if (routeParameterKeys.includes(def.name)) {
|
|
5354
|
-
params[def.name] = routeParams[def.name];
|
|
5355
|
-
}
|
|
5356
|
-
}
|
|
5357
|
-
else {
|
|
5358
|
-
// copy non route params as is, but only if they already exist otherwise we'll inject nil values and break the
|
|
5359
|
-
// defaults and remember sanitisation process.
|
|
5360
|
-
var value = _this.getParameter(def.name);
|
|
5361
|
-
if (_this.hasParameter(def.name)) {
|
|
5362
|
-
params[def.name] = value;
|
|
5363
|
-
}
|
|
5364
|
-
}
|
|
5365
|
-
});
|
|
5366
|
-
return new Visit(this.placeDefinition, params);
|
|
5367
|
-
};
|
|
5368
|
-
Visit.prototype.hasRoutingChangedFrom = function (other) {
|
|
5369
|
-
var samePlace = other.placeDefinition === this.placeDefinition;
|
|
5370
|
-
var sameRouteParameters = _.isEqual(this.placeDefinition.getFormattedRouteParameters(this, true), this.placeDefinition.getFormattedRouteParameters(other, true));
|
|
5371
|
-
return !samePlace || !sameRouteParameters;
|
|
5372
|
-
};
|
|
5373
|
-
Visit.prototype.hasChangedFrom = function (other) {
|
|
5374
|
-
var sameNonRouteParameters = _.isEqual(this.placeDefinition.getNonRouteParameters(this), this.placeDefinition.getNonRouteParameters(other));
|
|
5375
|
-
return !sameNonRouteParameters || this.hasRoutingChangedFrom(other);
|
|
5376
|
-
};
|
|
5377
|
-
Visit.prototype.toDebugString = function () {
|
|
5378
|
-
var _this = this;
|
|
5379
|
-
return Object.keys(this.visitParameters).map(function (k) { return k + "=" + _this.visitParameters[k]; }).join(",");
|
|
5380
|
-
};
|
|
5381
|
-
return Visit;
|
|
5382
|
-
}());
|
|
5383
|
-
|
|
5384
|
-
var AUP_PLACE_CONFIG = new i0.InjectionToken('AUP_PLACE_CONFIG');
|
|
5385
|
-
|
|
5386
5321
|
/**
|
|
5387
5322
|
* This class handles the logic around canDeactivate for a given router state transition. It's core responsibilities are:
|
|
5388
5323
|
* 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.)
|
|
@@ -6247,6 +6182,33 @@
|
|
|
6247
6182
|
return PopStateNavigation;
|
|
6248
6183
|
}(AbstractPopStateNavigation));
|
|
6249
6184
|
|
|
6185
|
+
(function (PlaceAccessGuard) {
|
|
6186
|
+
var NoAuth = /** @class */ (function () {
|
|
6187
|
+
function NoAuth() {
|
|
6188
|
+
}
|
|
6189
|
+
NoAuth.prototype.isAuthenticated = function () {
|
|
6190
|
+
return true;
|
|
6191
|
+
};
|
|
6192
|
+
NoAuth.prototype.isAuthorised = function (placeDefinition) {
|
|
6193
|
+
return true;
|
|
6194
|
+
};
|
|
6195
|
+
return NoAuth;
|
|
6196
|
+
}());
|
|
6197
|
+
__decorate([
|
|
6198
|
+
pectin.Trace(),
|
|
6199
|
+
__metadata("design:type", Function),
|
|
6200
|
+
__metadata("design:paramtypes", []),
|
|
6201
|
+
__metadata("design:returntype", Object)
|
|
6202
|
+
], NoAuth.prototype, "isAuthenticated", null);
|
|
6203
|
+
__decorate([
|
|
6204
|
+
pectin.Trace(),
|
|
6205
|
+
__metadata("design:type", Function),
|
|
6206
|
+
__metadata("design:paramtypes", [PlaceDefinition]),
|
|
6207
|
+
__metadata("design:returntype", Boolean)
|
|
6208
|
+
], NoAuth.prototype, "isAuthorised", null);
|
|
6209
|
+
PlaceAccessGuard.NoAuth = NoAuth;
|
|
6210
|
+
})(exports.PlaceAccessGuard || (exports.PlaceAccessGuard = {}));
|
|
6211
|
+
|
|
6250
6212
|
exports.PlaceHistory = /** @class */ (function () {
|
|
6251
6213
|
function PlaceHistory() {
|
|
6252
6214
|
this._archive = new Map();
|
|
@@ -6557,6 +6519,11 @@
|
|
|
6557
6519
|
_this.navigationSessionModel = new pectin.MutableValueModel();
|
|
6558
6520
|
_this._activeVisits = new pectin.MutableListModel();
|
|
6559
6521
|
_this.sessionFinishedJobs = [];
|
|
6522
|
+
/**
|
|
6523
|
+
* An observable model containing the authoriser function. This allows places to react to changes
|
|
6524
|
+
* in permissions when any underlying auth logic changes, e.g. a role being removed from a user.
|
|
6525
|
+
*/
|
|
6526
|
+
_this._accessGuard = new pectin.DelegatingValueModel().withDefault(new exports.PlaceAccessGuard.NoAuth());
|
|
6560
6527
|
if (window['Cypress']) {
|
|
6561
6528
|
window['aup.PlaceRouter'] = _this;
|
|
6562
6529
|
}
|
|
@@ -6616,6 +6583,32 @@
|
|
|
6616
6583
|
angularLocation.onUrlChange(function (url) { return _this.onUrlChanged(url); });
|
|
6617
6584
|
return _this;
|
|
6618
6585
|
}
|
|
6586
|
+
Object.defineProperty(PlaceRouter.prototype, "accessGuard", {
|
|
6587
|
+
get: function () {
|
|
6588
|
+
return this._accessGuard.readonly;
|
|
6589
|
+
},
|
|
6590
|
+
enumerable: false,
|
|
6591
|
+
configurable: true
|
|
6592
|
+
});
|
|
6593
|
+
PlaceRouter.prototype.configureAuth = function (accessGrant, redirections) {
|
|
6594
|
+
// We need a shitty mutable model until setDelegate is clever enough to work with readonly models.
|
|
6595
|
+
var hackyMutableModel = new pectin.MutableValueModel();
|
|
6596
|
+
var binding = new pectin.Binding(hackyMutableModel, accessGrant, {
|
|
6597
|
+
toRight: function (leftValue) {
|
|
6598
|
+
return pectin.lang.illegalState('hackyMutableModel is read only');
|
|
6599
|
+
},
|
|
6600
|
+
toLeft: function (rightValue) { return rightValue; }
|
|
6601
|
+
});
|
|
6602
|
+
binding.writeLeft();
|
|
6603
|
+
this._accessGuard.setDelegate(hackyMutableModel);
|
|
6604
|
+
this.redirections = redirections;
|
|
6605
|
+
};
|
|
6606
|
+
PlaceRouter.prototype.getAuthenticationFailureRedirect = function (activatedRoute, state) {
|
|
6607
|
+
return this.redirections.onAuthenticationFailure(activatedRoute, state);
|
|
6608
|
+
};
|
|
6609
|
+
PlaceRouter.prototype.getAuthorisationFailureRedirect = function (activatedRoute, state) {
|
|
6610
|
+
return this.redirections.onAuthorisationFailure(activatedRoute, state);
|
|
6611
|
+
};
|
|
6619
6612
|
Object.defineProperty(PlaceRouter.prototype, "navigationSession", {
|
|
6620
6613
|
get: function () {
|
|
6621
6614
|
return this.navigationSessionModel.value;
|
|
@@ -6854,6 +6847,83 @@
|
|
|
6854
6847
|
{ type: UrlService },
|
|
6855
6848
|
{ type: exports.PlaceHistory }
|
|
6856
6849
|
]; };
|
|
6850
|
+
__decorate([
|
|
6851
|
+
pectin.Trace(),
|
|
6852
|
+
__metadata("design:type", Function),
|
|
6853
|
+
__metadata("design:paramtypes", [pectin.ValueModel, Object]),
|
|
6854
|
+
__metadata("design:returntype", void 0)
|
|
6855
|
+
], PlaceRouter.prototype, "configureAuth", null);
|
|
6856
|
+
|
|
6857
|
+
var Visit = /** @class */ (function () {
|
|
6858
|
+
function Visit(placeDefinition, visitParameters) {
|
|
6859
|
+
if (visitParameters === void 0) { visitParameters = {}; }
|
|
6860
|
+
this.placeDefinition = placeDefinition;
|
|
6861
|
+
this.visitParameters = visitParameters;
|
|
6862
|
+
}
|
|
6863
|
+
// @Trace()
|
|
6864
|
+
Visit.prototype.getRouteId = function () {
|
|
6865
|
+
return this.placeDefinition.getRouteIdFrom(this);
|
|
6866
|
+
};
|
|
6867
|
+
// @Trace()
|
|
6868
|
+
Visit.prototype.hasRouteId = function () {
|
|
6869
|
+
return !_.isNil(this.getRouteId());
|
|
6870
|
+
};
|
|
6871
|
+
/**
|
|
6872
|
+
* Returns the value of the place parameter with the specified name. The parameter
|
|
6873
|
+
* name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
|
|
6874
|
+
* same as the the ValueModel property name.
|
|
6875
|
+
* @param parameterName the field name of the property model or the `as` option if specified.
|
|
6876
|
+
*/
|
|
6877
|
+
Visit.prototype.getParameter = function (parameterName) {
|
|
6878
|
+
return this.visitParameters[parameterName];
|
|
6879
|
+
};
|
|
6880
|
+
// @Trace()
|
|
6881
|
+
Visit.prototype.hasParameter = function (parameterName) {
|
|
6882
|
+
return Object.keys(this.visitParameters).includes(parameterName);
|
|
6883
|
+
};
|
|
6884
|
+
Visit.prototype.replace = function (parameter, value) {
|
|
6885
|
+
var _a;
|
|
6886
|
+
return new Visit(this.placeDefinition, Object.assign(Object.assign({}, this.visitParameters), (_a = {}, _a[parameter.name] = value, _a)));
|
|
6887
|
+
};
|
|
6888
|
+
Visit.prototype.mergeRouteParameters = function (routeParams) {
|
|
6889
|
+
var _this = this;
|
|
6890
|
+
// todo: whitelist parameters.
|
|
6891
|
+
var routeParameterKeys = Object.keys(routeParams);
|
|
6892
|
+
var params = {};
|
|
6893
|
+
this.placeDefinition.getVisitParameterDefs().forEach(function (def) {
|
|
6894
|
+
if (def.isRouteId || def.isRouteParameter) {
|
|
6895
|
+
if (routeParameterKeys.includes(def.name)) {
|
|
6896
|
+
params[def.name] = routeParams[def.name];
|
|
6897
|
+
}
|
|
6898
|
+
}
|
|
6899
|
+
else {
|
|
6900
|
+
// copy non route params as is, but only if they already exist otherwise we'll inject nil values and break the
|
|
6901
|
+
// defaults and remember sanitisation process.
|
|
6902
|
+
var value = _this.getParameter(def.name);
|
|
6903
|
+
if (_this.hasParameter(def.name)) {
|
|
6904
|
+
params[def.name] = value;
|
|
6905
|
+
}
|
|
6906
|
+
}
|
|
6907
|
+
});
|
|
6908
|
+
return new Visit(this.placeDefinition, params);
|
|
6909
|
+
};
|
|
6910
|
+
Visit.prototype.hasRoutingChangedFrom = function (other) {
|
|
6911
|
+
var samePlace = other.placeDefinition === this.placeDefinition;
|
|
6912
|
+
var sameRouteParameters = _.isEqual(this.placeDefinition.getFormattedRouteParameters(this, true), this.placeDefinition.getFormattedRouteParameters(other, true));
|
|
6913
|
+
return !samePlace || !sameRouteParameters;
|
|
6914
|
+
};
|
|
6915
|
+
Visit.prototype.hasChangedFrom = function (other) {
|
|
6916
|
+
var sameNonRouteParameters = _.isEqual(this.placeDefinition.getNonRouteParameters(this), this.placeDefinition.getNonRouteParameters(other));
|
|
6917
|
+
return !sameNonRouteParameters || this.hasRoutingChangedFrom(other);
|
|
6918
|
+
};
|
|
6919
|
+
Visit.prototype.toDebugString = function () {
|
|
6920
|
+
var _this = this;
|
|
6921
|
+
return Object.keys(this.visitParameters).map(function (k) { return k + "=" + _this.visitParameters[k]; }).join(",");
|
|
6922
|
+
};
|
|
6923
|
+
return Visit;
|
|
6924
|
+
}());
|
|
6925
|
+
|
|
6926
|
+
var AUP_PLACE_CONFIG = new i0.InjectionToken('AUP_PLACE_CONFIG');
|
|
6857
6927
|
|
|
6858
6928
|
// Freezes the state of the components at the start of the animation.
|
|
6859
6929
|
var animationStartStyle = animations$1.style({ position: 'absolute', top: '0', left: '0', bottom: '0', right: '0' });
|
|
@@ -6901,11 +6971,10 @@
|
|
|
6901
6971
|
|
|
6902
6972
|
var PlaceOutletComponent = /** @class */ (function (_super) {
|
|
6903
6973
|
__extends(PlaceOutletComponent, _super);
|
|
6904
|
-
function PlaceOutletComponent(router, placeRouter,
|
|
6974
|
+
function PlaceOutletComponent(router, placeRouter, placeConfig, parentOutlet) {
|
|
6905
6975
|
var _this = _super.call(this) || this;
|
|
6906
6976
|
_this.router = router;
|
|
6907
6977
|
_this.placeRouter = placeRouter;
|
|
6908
|
-
_this.placeAuthService = placeAuthService;
|
|
6909
6978
|
_this.placeConfig = placeConfig;
|
|
6910
6979
|
_this.placeChanged = new i0.EventEmitter();
|
|
6911
6980
|
_this.outletActivated = new pectin.MutableValueModel(false);
|
|
@@ -6950,11 +7019,11 @@
|
|
|
6950
7019
|
chain(_this._activePlaceModel)
|
|
6951
7020
|
.postponeWhile(_this.navigationInProgress)
|
|
6952
7021
|
.subscribe(function (place) { return _this.placeChanged.emit(place); });
|
|
6953
|
-
when(
|
|
7022
|
+
when(placeRouter.accessGuard).changes(function (guard) {
|
|
6954
7023
|
var activePlace = _this._activePlaceModel.value;
|
|
6955
|
-
if (activePlace && !isAuthorised(activePlace.placeDefinition)) {
|
|
6956
|
-
var
|
|
6957
|
-
_this.placeRouter.navigate(
|
|
7024
|
+
if (activePlace && !guard.isAuthorised(activePlace.placeDefinition)) {
|
|
7025
|
+
var visit = placeRouter.getAuthorisationFailureRedirect(_this._activatedRouteModel.value.snapshot, _this.router.routerState.snapshot);
|
|
7026
|
+
_this.placeRouter.navigate(visit);
|
|
6958
7027
|
}
|
|
6959
7028
|
});
|
|
6960
7029
|
return _this;
|
|
@@ -7004,6 +7073,7 @@
|
|
|
7004
7073
|
enumerable: false,
|
|
7005
7074
|
configurable: true
|
|
7006
7075
|
});
|
|
7076
|
+
// @Trace()
|
|
7007
7077
|
PlaceOutletComponent.prototype.onOutletActivated = function (routerOutlet, place) {
|
|
7008
7078
|
this._activatedRouteModel.value = routerOutlet.activatedRoute;
|
|
7009
7079
|
this._activePlaceModel.value = place;
|
|
@@ -7098,7 +7168,6 @@
|
|
|
7098
7168
|
PlaceOutletComponent.ctorParameters = function () { return [
|
|
7099
7169
|
{ type: i1$1.Router },
|
|
7100
7170
|
{ type: PlaceRouter },
|
|
7101
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [PLACE_AUTH_SERVICE,] }] },
|
|
7102
7171
|
{ type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [AUP_PLACE_CONFIG,] }] },
|
|
7103
7172
|
{ type: PlaceOutletComponent, decorators: [{ type: i0.SkipSelf }, { type: i0.Optional }] }
|
|
7104
7173
|
]; };
|
|
@@ -7126,12 +7195,6 @@
|
|
|
7126
7195
|
pectin.StoreInListModel('customPlaceAnimationOrderModel'),
|
|
7127
7196
|
__metadata("design:type", Array)
|
|
7128
7197
|
], PlaceOutletComponent.prototype, "customPlaceAnimationOrder", void 0);
|
|
7129
|
-
__decorate([
|
|
7130
|
-
pectin.Trace(),
|
|
7131
|
-
__metadata("design:type", Function),
|
|
7132
|
-
__metadata("design:paramtypes", [i1$1.RouterOutlet, exports.PlaceComponent]),
|
|
7133
|
-
__metadata("design:returntype", void 0)
|
|
7134
|
-
], PlaceOutletComponent.prototype, "onOutletActivated", null);
|
|
7135
7198
|
__decorate([
|
|
7136
7199
|
pectin.Trace(),
|
|
7137
7200
|
__metadata("design:type", Function),
|
|
@@ -7141,13 +7204,17 @@
|
|
|
7141
7204
|
|
|
7142
7205
|
var AbstractPlaceNavigationComponent = /** @class */ (function (_super) {
|
|
7143
7206
|
__extends(AbstractPlaceNavigationComponent, _super);
|
|
7144
|
-
function AbstractPlaceNavigationComponent(
|
|
7207
|
+
function AbstractPlaceNavigationComponent(placeRouter) {
|
|
7145
7208
|
var _this = _super.call(this) || this;
|
|
7209
|
+
_this.placeRouter = placeRouter;
|
|
7146
7210
|
_this._activePlaceComponent = new pectin.DelegatingValueModel();
|
|
7147
7211
|
var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
7148
7212
|
_this.placeDefinitions = chain(_this.placesModel)
|
|
7149
7213
|
.map(function (c) { return exports.PlaceComponent.getDefinition(c); })
|
|
7150
|
-
.select(function (d) {
|
|
7214
|
+
.select(function (d) {
|
|
7215
|
+
var guard = placeRouter.accessGuard.value;
|
|
7216
|
+
return guard.isAuthorised(d);
|
|
7217
|
+
}, { dependsOn: placeRouter.accessGuard });
|
|
7151
7218
|
_this.commandFactory = pectin.Command.createFactory(function (placeDefinition) {
|
|
7152
7219
|
_this.placeOutlet.navigate(new Visit(placeDefinition));
|
|
7153
7220
|
});
|
|
@@ -7181,7 +7248,7 @@
|
|
|
7181
7248
|
},] }
|
|
7182
7249
|
];
|
|
7183
7250
|
AbstractPlaceNavigationComponent.ctorParameters = function () { return [
|
|
7184
|
-
{ type:
|
|
7251
|
+
{ type: PlaceRouter }
|
|
7185
7252
|
]; };
|
|
7186
7253
|
AbstractPlaceNavigationComponent.propDecorators = {
|
|
7187
7254
|
places: [{ type: i0.Input }],
|
|
@@ -7258,8 +7325,8 @@
|
|
|
7258
7325
|
|
|
7259
7326
|
var ListPlaceNavComponent = /** @class */ (function (_super) {
|
|
7260
7327
|
__extends(ListPlaceNavComponent, _super);
|
|
7261
|
-
function ListPlaceNavComponent(
|
|
7262
|
-
return _super.call(this,
|
|
7328
|
+
function ListPlaceNavComponent(router) {
|
|
7329
|
+
return _super.call(this, router) || this;
|
|
7263
7330
|
}
|
|
7264
7331
|
return ListPlaceNavComponent;
|
|
7265
7332
|
}(AbstractPlaceNavigationComponent));
|
|
@@ -7271,7 +7338,7 @@
|
|
|
7271
7338
|
},] }
|
|
7272
7339
|
];
|
|
7273
7340
|
ListPlaceNavComponent.ctorParameters = function () { return [
|
|
7274
|
-
{ type:
|
|
7341
|
+
{ type: PlaceRouter }
|
|
7275
7342
|
]; };
|
|
7276
7343
|
|
|
7277
7344
|
/**
|
|
@@ -7318,9 +7385,8 @@
|
|
|
7318
7385
|
*/
|
|
7319
7386
|
var SidePlaceNavigationComponent = /** @class */ (function (_super) {
|
|
7320
7387
|
__extends(SidePlaceNavigationComponent, _super);
|
|
7321
|
-
function SidePlaceNavigationComponent(router
|
|
7322
|
-
var _this = _super.call(this,
|
|
7323
|
-
_this.router = router;
|
|
7388
|
+
function SidePlaceNavigationComponent(router) {
|
|
7389
|
+
var _this = _super.call(this, router) || this;
|
|
7324
7390
|
_this.expanded = false;
|
|
7325
7391
|
return _this;
|
|
7326
7392
|
}
|
|
@@ -7343,8 +7409,7 @@
|
|
|
7343
7409
|
},] }
|
|
7344
7410
|
];
|
|
7345
7411
|
SidePlaceNavigationComponent.ctorParameters = function () { return [
|
|
7346
|
-
{ type:
|
|
7347
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [PLACE_AUTH_SERVICE,] }] }
|
|
7412
|
+
{ type: PlaceRouter }
|
|
7348
7413
|
]; };
|
|
7349
7414
|
SidePlaceNavigationComponent.propDecorators = {
|
|
7350
7415
|
expanded: [{ type: i0.HostBinding, args: ['class.expanded',] }],
|
|
@@ -7353,8 +7418,8 @@
|
|
|
7353
7418
|
|
|
7354
7419
|
var TabbedPlaceNavigationComponent = /** @class */ (function (_super) {
|
|
7355
7420
|
__extends(TabbedPlaceNavigationComponent, _super);
|
|
7356
|
-
function TabbedPlaceNavigationComponent(
|
|
7357
|
-
return _super.call(this,
|
|
7421
|
+
function TabbedPlaceNavigationComponent(router) {
|
|
7422
|
+
return _super.call(this, router) || this;
|
|
7358
7423
|
}
|
|
7359
7424
|
return TabbedPlaceNavigationComponent;
|
|
7360
7425
|
}(AbstractPlaceNavigationComponent));
|
|
@@ -7366,7 +7431,7 @@
|
|
|
7366
7431
|
},] }
|
|
7367
7432
|
];
|
|
7368
7433
|
TabbedPlaceNavigationComponent.ctorParameters = function () { return [
|
|
7369
|
-
{ type:
|
|
7434
|
+
{ type: PlaceRouter }
|
|
7370
7435
|
]; };
|
|
7371
7436
|
|
|
7372
7437
|
var PlaceModule = /** @class */ (function () {
|
|
@@ -7719,12 +7784,11 @@
|
|
|
7719
7784
|
}());
|
|
7720
7785
|
|
|
7721
7786
|
var PlaceGuard = /** @class */ (function () {
|
|
7722
|
-
function PlaceGuard(router, urlService, placeRouter, placeHistory,
|
|
7787
|
+
function PlaceGuard(router, urlService, placeRouter, placeHistory, interactionService, injector) {
|
|
7723
7788
|
this.router = router;
|
|
7724
7789
|
this.urlService = urlService;
|
|
7725
7790
|
this.placeRouter = placeRouter;
|
|
7726
7791
|
this.placeHistory = placeHistory;
|
|
7727
|
-
this.placeAuthService = placeAuthService;
|
|
7728
7792
|
this.interactionService = interactionService;
|
|
7729
7793
|
this.injector = injector;
|
|
7730
7794
|
}
|
|
@@ -7739,20 +7803,20 @@
|
|
|
7739
7803
|
if (!exports.PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) return [3 /*break*/, 4];
|
|
7740
7804
|
placeDefinition_1 = exports.PlaceComponent.getDefinition(activatedRoute.component);
|
|
7741
7805
|
if (!placeDefinition_1.authenticate) return [3 /*break*/, 2];
|
|
7742
|
-
return [4 /*yield*/, this.
|
|
7806
|
+
return [4 /*yield*/, this.placeRouter.accessGuard.value.isAuthenticated()];
|
|
7743
7807
|
case 1:
|
|
7744
7808
|
if (!(_a.sent())) {
|
|
7745
|
-
redirectLocation = this.
|
|
7809
|
+
redirectLocation = this.placeRouter.getAuthenticationFailureRedirect(activatedRoute, state);
|
|
7746
7810
|
nextPlaceDef = this.getPlaceDefinition(redirectLocation);
|
|
7747
7811
|
if (nextPlaceDef.authenticate) {
|
|
7748
7812
|
pectin.lang.illegalState("handleNotAuthenticated hook returned place " + nextPlaceDef.component.name + " that requires authentication.");
|
|
7749
7813
|
}
|
|
7750
7814
|
return [2 /*return*/, this.createUrlTree(redirectLocation)];
|
|
7751
7815
|
}
|
|
7752
|
-
if (!this.
|
|
7753
|
-
redirectLocation = this.
|
|
7816
|
+
if (!(this.placeRouter.accessGuard.value ? this.placeRouter.accessGuard.value.isAuthorised(placeDefinition_1) : true)) {
|
|
7817
|
+
redirectLocation = this.placeRouter.getAuthorisationFailureRedirect(activatedRoute, state);
|
|
7754
7818
|
nextPlaceDef = this.getPlaceDefinition(redirectLocation);
|
|
7755
|
-
if (!this.
|
|
7819
|
+
if (!(this.placeRouter.accessGuard.value ? this.placeRouter.accessGuard.value.isAuthorised(nextPlaceDef) : true)) {
|
|
7756
7820
|
pectin.lang.illegalState("handleNotAuthorised hook returned place " + nextPlaceDef.component.name + " that is not authorised for the current user.");
|
|
7757
7821
|
}
|
|
7758
7822
|
return [2 /*return*/, this.createUrlTree(redirectLocation)];
|
|
@@ -7860,7 +7924,7 @@
|
|
|
7860
7924
|
};
|
|
7861
7925
|
return PlaceGuard;
|
|
7862
7926
|
}());
|
|
7863
|
-
PlaceGuard.ɵprov = i0.ɵɵdefineInjectable({ factory: function PlaceGuard_Factory() { return new PlaceGuard(i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(UrlService), i0.ɵɵinject(PlaceRouter), i0.ɵɵinject(exports.PlaceHistory), i0.ɵɵinject(
|
|
7927
|
+
PlaceGuard.ɵprov = i0.ɵɵdefineInjectable({ factory: function PlaceGuard_Factory() { return new PlaceGuard(i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(UrlService), i0.ɵɵinject(PlaceRouter), i0.ɵɵinject(exports.PlaceHistory), i0.ɵɵinject(exports.InteractionService), i0.ɵɵinject(i0.INJECTOR)); }, token: PlaceGuard, providedIn: "root" });
|
|
7864
7928
|
PlaceGuard.decorators = [
|
|
7865
7929
|
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
|
7866
7930
|
];
|
|
@@ -7869,7 +7933,6 @@
|
|
|
7869
7933
|
{ type: UrlService },
|
|
7870
7934
|
{ type: PlaceRouter },
|
|
7871
7935
|
{ type: exports.PlaceHistory },
|
|
7872
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [PLACE_AUTH_SERVICE,] }] },
|
|
7873
7936
|
{ type: exports.InteractionService },
|
|
7874
7937
|
{ type: i0.Injector }
|
|
7875
7938
|
]; };
|
|
@@ -8059,7 +8122,6 @@
|
|
|
8059
8122
|
exports.NoopAuthGuard = NoopAuthGuard;
|
|
8060
8123
|
exports.NoopComponent = NoopComponent;
|
|
8061
8124
|
exports.NumberInputComponent = NumberInputComponent;
|
|
8062
|
-
exports.PLACE_AUTH_SERVICE = PLACE_AUTH_SERVICE;
|
|
8063
8125
|
exports.POPUP_CONTAINER = POPUP_CONTAINER;
|
|
8064
8126
|
exports.PORTAL_EDITOR_COMPONENT = PORTAL_EDITOR_COMPONENT;
|
|
8065
8127
|
exports.PORTAL_RENDERER_COMPONENT = PORTAL_RENDERER_COMPONENT;
|