@hmcts/rpx-xui-common-lib 1.9.0-route-expected-feature → 1.9.0-route-expected-feature-2
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/bundles/hmcts-rpx-xui-common-lib.umd.js +2 -1
- package/bundles/hmcts-rpx-xui-common-lib.umd.js.map +1 -1
- package/bundles/hmcts-rpx-xui-common-lib.umd.min.js +1 -1
- package/bundles/hmcts-rpx-xui-common-lib.umd.min.js.map +1 -1
- package/esm2015/lib/services/feature-toggle/feature-toggle.guard.js +3 -2
- package/fesm2015/hmcts-rpx-xui-common-lib.js +2 -1
- package/fesm2015/hmcts-rpx-xui-common-lib.js.map +1 -1
- package/lib/services/feature-toggle/feature-toggle.guard.d.ts +1 -0
- package/package.json +1 -1
|
@@ -779,11 +779,12 @@
|
|
|
779
779
|
* in the data array for the route:
|
|
780
780
|
* - needsFeaturesEnabled: An array of feature keys that need to be enabled for this route
|
|
781
781
|
* - featureDisabledRedirect: the URL to redirect to when the this route is not accessible due to disabled features
|
|
782
|
+
* - expectFeatureEnabled: Sets whether a route should be enabled/disabled based on whether feature is present
|
|
782
783
|
* @param route Automatically provided by Angular
|
|
783
784
|
*/
|
|
784
785
|
FeatureToggleGuard.prototype.canActivate = function (route) {
|
|
785
786
|
var _this = this;
|
|
786
|
-
return rxjs.combineLatest(__spread(route.data.needsFeaturesEnabled.map(function (feature) { return _this.featureToggleService.getValueOnce(feature, false); }))).pipe(operators.map(function (featureStatuses) { return featureStatuses.every(function (status) { return status; }); }), operators.map(function (status) { return (route.data.expectFeatureEnabled !== false && status) || (
|
|
787
|
+
return rxjs.combineLatest(__spread(route.data.needsFeaturesEnabled.map(function (feature) { return _this.featureToggleService.getValueOnce(feature, false); }))).pipe(operators.map(function (featureStatuses) { return featureStatuses.every(function (status) { return status; }); }), operators.map(function (status) { return (route.data.expectFeatureEnabled !== false && status) || (route.data.expectFeatureEnabled === false && !status) || _this.router.parseUrl(route.data.featureDisabledRedirect); }));
|
|
787
788
|
};
|
|
788
789
|
return FeatureToggleGuard;
|
|
789
790
|
}());
|