@coolon/angular-ui-powerups 3.7.0-alpha.3 → 3.7.0-alpha.4

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 CHANGED
@@ -2,6 +2,13 @@
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.0-alpha.4](https://bitbucket.org/coolon/angular-ui-powerups/compare/v3.7.0-alpha.3...v3.7.0-alpha.4) (2020-12-16)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * routing to not check authorisation for guest places ([f4a7024](https://bitbucket.org/coolon/angular-ui-powerups/commit/f4a70246ecc40a0103dfe1ff8893536bb6efa963))
11
+
5
12
  ## [3.7.0-alpha.3](https://bitbucket.org/coolon/angular-ui-powerups/compare/v3.7.0-alpha.2...v3.7.0-alpha.3) (2020-12-16)
6
13
 
7
14
 
@@ -7966,23 +7966,17 @@
7966
7966
  // @Trace()
7967
7967
  PlaceGuard.prototype.canActivate = function (activatedRoute, state) {
7968
7968
  return __awaiter(this, void 0, void 0, function () {
7969
- var placeDefinition_1, needsAuth, proceed, _a, redirectLocation, nextPlaceDef, redirectLocation, nextPlaceDef, result;
7969
+ var placeDefinition_1, redirectLocation, nextPlaceDef, redirectLocation, nextPlaceDef, result;
7970
7970
  var _this = this;
7971
- return __generator(this, function (_b) {
7972
- switch (_b.label) {
7971
+ return __generator(this, function (_a) {
7972
+ switch (_a.label) {
7973
7973
  case 0:
7974
7974
  if (!exports.PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) return [3 /*break*/, 4];
7975
7975
  placeDefinition_1 = exports.PlaceComponent.getDefinition(activatedRoute.component);
7976
- needsAuth = placeDefinition_1.authenticate;
7977
- _a = !needsAuth;
7978
- if (_a) return [3 /*break*/, 2];
7976
+ if (!placeDefinition_1.authenticate) return [3 /*break*/, 2];
7979
7977
  return [4 /*yield*/, this.placeAuthService.isAuthenticated()];
7980
7978
  case 1:
7981
- _a = (_b.sent());
7982
- _b.label = 2;
7983
- case 2:
7984
- proceed = _a;
7985
- if (!proceed) {
7979
+ if (!(_a.sent())) {
7986
7980
  redirectLocation = this.placeAuthService.handleNotAuthenticated(activatedRoute, state);
7987
7981
  nextPlaceDef = this.getPlaceDefinition(redirectLocation);
7988
7982
  if (nextPlaceDef.authenticate) {
@@ -7998,35 +7992,36 @@
7998
7992
  }
7999
7993
  return [2 /*return*/, this.createUrlTree(redirectLocation)];
8000
7994
  }
8001
- return [4 /*yield*/, this.cleanInteractionState(activatedRoute, state, function () { return __awaiter(_this, void 0, void 0, function () {
8002
- var params, parsedParams, navigationSession, initialVisit, sanitiser, sanitisedVisit, urlSnapshot;
8003
- return __generator(this, function (_a) {
8004
- switch (_a.label) {
8005
- case 0:
8006
- params = new ConsolidatedParameterMap(activatedRoute.paramMap, activatedRoute.url);
8007
- parsedParams = placeDefinition_1.parseRouteParams(params);
8008
- navigationSession = this.placeRouter.navigationSession;
8009
- initialVisit = navigationSession.getVisitFor(placeDefinition_1) || new Visit(placeDefinition_1, parsedParams);
8010
- sanitiser = new VisitSanitiser(navigationSession, activatedRoute, this.router, this.placeHistory, this.injector);
8011
- return [4 /*yield*/, sanitiser.sanitise(initialVisit.mergeRouteParameters(parsedParams))];
8012
- case 1:
8013
- sanitisedVisit = _a.sent();
8014
- // Save the visit with any updated parameters. We need to save it so we remember any non route parameters
8015
- navigationSession.storeVisit(sanitisedVisit);
8016
- if (initialVisit.hasRoutingChangedFrom(sanitisedVisit)) {
8017
- urlSnapshot = this.urlService.parseUrl(state.url).updateVisitSegments(sanitisedVisit);
8018
- // console.log('##### Place Guard Redirect', urlSnapshot);
8019
- return [2 /*return*/, urlSnapshot];
8020
- }
8021
- else {
8022
- return [2 /*return*/, true];
8023
- }
8024
- return [2 /*return*/];
8025
- }
8026
- });
8027
- }); })];
7995
+ _a.label = 2;
7996
+ case 2: return [4 /*yield*/, this.cleanInteractionState(activatedRoute, state, function () { return __awaiter(_this, void 0, void 0, function () {
7997
+ var params, parsedParams, navigationSession, initialVisit, sanitiser, sanitisedVisit, urlSnapshot;
7998
+ return __generator(this, function (_a) {
7999
+ switch (_a.label) {
8000
+ case 0:
8001
+ params = new ConsolidatedParameterMap(activatedRoute.paramMap, activatedRoute.url);
8002
+ parsedParams = placeDefinition_1.parseRouteParams(params);
8003
+ navigationSession = this.placeRouter.navigationSession;
8004
+ initialVisit = navigationSession.getVisitFor(placeDefinition_1) || new Visit(placeDefinition_1, parsedParams);
8005
+ sanitiser = new VisitSanitiser(navigationSession, activatedRoute, this.router, this.placeHistory, this.injector);
8006
+ return [4 /*yield*/, sanitiser.sanitise(initialVisit.mergeRouteParameters(parsedParams))];
8007
+ case 1:
8008
+ sanitisedVisit = _a.sent();
8009
+ // Save the visit with any updated parameters. We need to save it so we remember any non route parameters
8010
+ navigationSession.storeVisit(sanitisedVisit);
8011
+ if (initialVisit.hasRoutingChangedFrom(sanitisedVisit)) {
8012
+ urlSnapshot = this.urlService.parseUrl(state.url).updateVisitSegments(sanitisedVisit);
8013
+ // console.log('##### Place Guard Redirect', urlSnapshot);
8014
+ return [2 /*return*/, urlSnapshot];
8015
+ }
8016
+ else {
8017
+ return [2 /*return*/, true];
8018
+ }
8019
+ return [2 /*return*/];
8020
+ }
8021
+ });
8022
+ }); })];
8028
8023
  case 3:
8029
- result = _b.sent();
8024
+ result = _a.sent();
8030
8025
  return [2 /*return*/, result instanceof exports.UrlSnapshot ? result.urlTree : result];
8031
8026
  case 4: return [2 /*return*/, pectin.lang.illegalState("expected component to be an instance of PlaceComponent, got " + activatedRoute.component)];
8032
8027
  }