@hmcts/rpx-xui-common-lib 1.7.21 → 1.7.31
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 +44 -30
- 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/components/find-location/find-location.component.js +3 -3
- package/esm2015/lib/components/find-service/find-service.component.js +21 -5
- package/esm2015/lib/components/generic-filter/generic-filter.component.js +1 -1
- package/esm2015/lib/components/search-location/search-location.component.js +1 -1
- package/esm2015/lib/components/search-service/search-service.component.js +3 -3
- package/esm2015/lib/services/role-guard/role.guard.js +22 -15
- package/esm2015/lib/services/role-guard/role.service.js +13 -13
- package/esm5/lib/components/find-location/find-location.component.js +3 -3
- package/esm5/lib/components/find-service/find-service.component.js +18 -5
- package/esm5/lib/components/generic-filter/generic-filter.component.js +1 -1
- package/esm5/lib/components/search-location/search-location.component.js +1 -1
- package/esm5/lib/components/search-service/search-service.component.js +3 -3
- package/esm5/lib/services/role-guard/role.guard.js +22 -15
- package/esm5/lib/services/role-guard/role.service.js +13 -13
- package/fesm2015/hmcts-rpx-xui-common-lib.js +48 -32
- package/fesm2015/hmcts-rpx-xui-common-lib.js.map +1 -1
- package/fesm5/hmcts-rpx-xui-common-lib.js +46 -33
- package/fesm5/hmcts-rpx-xui-common-lib.js.map +1 -1
- package/hmcts-rpx-xui-common-lib.metadata.json +1 -1
- package/lib/components/find-service/find-service.component.d.ts +3 -1
- package/lib/exui-common-lib.module.d.ts +2 -1
- package/lib/services/role-guard/role.guard.d.ts +2 -1
- package/lib/services/role-guard/role.service.d.ts +3 -1
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { Injectable } from '@angular/core';
|
|
7
7
|
import { Router } from '@angular/router';
|
|
8
|
+
import { map } from 'rxjs/operators';
|
|
8
9
|
import { RoleService } from './role.service';
|
|
9
10
|
import * as i0 from "@angular/core";
|
|
10
11
|
import * as i1 from "./role.service";
|
|
@@ -32,25 +33,31 @@ var RoleGuard = /** @class */ (function () {
|
|
|
32
33
|
*/
|
|
33
34
|
function (route) {
|
|
34
35
|
var _this = this;
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
/** @type {?} */
|
|
38
|
-
var check = (/**
|
|
39
|
-
* @param {?} roleRegEx
|
|
36
|
+
return this.roleService.roles$.pipe(map((/**
|
|
37
|
+
* @param {?} roles
|
|
40
38
|
* @return {?}
|
|
41
39
|
*/
|
|
42
|
-
function (
|
|
40
|
+
function (roles) {
|
|
43
41
|
/** @type {?} */
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
var canActivateRoles = ((/** @type {?} */ (route.data.needsRole)));
|
|
43
|
+
/** @type {?} */
|
|
44
|
+
var check = (/**
|
|
45
|
+
* @param {?} roleRegEx
|
|
47
46
|
* @return {?}
|
|
48
47
|
*/
|
|
49
|
-
function (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
function (roleRegEx) {
|
|
49
|
+
/** @type {?} */
|
|
50
|
+
var regex = new RegExp(roleRegEx);
|
|
51
|
+
return roles.some((/**
|
|
52
|
+
* @param {?} role
|
|
53
|
+
* @return {?}
|
|
54
|
+
*/
|
|
55
|
+
function (role) { return regex.test(role); }));
|
|
56
|
+
});
|
|
57
|
+
/** @type {?} */
|
|
58
|
+
var match = route.data.roleMatching === RoleMatching.ALL ? canActivateRoles.every(check) : canActivateRoles.some(check);
|
|
59
|
+
return match || _this.router.parseUrl((/** @type {?} */ (route.data.noRoleMatchRedirect)));
|
|
60
|
+
})));
|
|
54
61
|
};
|
|
55
62
|
RoleGuard.decorators = [
|
|
56
63
|
{ type: Injectable, args: [{
|
|
@@ -78,4 +85,4 @@ if (false) {
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1hdGNoaW5nID09PSBSb2xlTWF0Y2hpbmcuQUxMID8gY2FuQWN0aXZhdGVSb2xlcy5ldmVyeShjaGVjaykgOiBjYW5BY3RpdmF0ZVJvbGVzLnNvbWUoY2hlY2spO1xuXG4gICAgICAgICAgcmV0dXJuIG1hdGNoIHx8IHRoaXMucm91dGVyLnBhcnNlVXJsKHJvdXRlLmRhdGEubm9Sb2xlTWF0Y2hSZWRpcmVjdCBhcyBzdHJpbmcpO1xuICAgICAgICB9KVxuICAgICAgKTtcbiAgICB9XG59XG4iXX0=
|
|
@@ -4,24 +4,25 @@
|
|
|
4
4
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
5
5
|
*/
|
|
6
6
|
import { Injectable } from '@angular/core';
|
|
7
|
+
import { BehaviorSubject } from 'rxjs';
|
|
8
|
+
import { skipWhile } from 'rxjs/operators';
|
|
7
9
|
import * as i0 from "@angular/core";
|
|
8
10
|
var RoleService = /** @class */ (function () {
|
|
9
11
|
function RoleService() {
|
|
10
|
-
this.pRoles =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
get: /**
|
|
12
|
+
this.pRoles = new BehaviorSubject(null);
|
|
13
|
+
this.roles$ = this.pRoles.asObservable().pipe(skipWhile((/**
|
|
14
|
+
* @param {?} item
|
|
14
15
|
* @return {?}
|
|
15
16
|
*/
|
|
16
|
-
function () {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
function (item) { return item === null; })));
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(RoleService.prototype, "roles", {
|
|
19
20
|
set: /**
|
|
20
21
|
* @param {?} roles
|
|
21
22
|
* @return {?}
|
|
22
23
|
*/
|
|
23
24
|
function (roles) {
|
|
24
|
-
this.pRoles
|
|
25
|
+
this.pRoles.next(roles);
|
|
25
26
|
},
|
|
26
27
|
enumerable: true,
|
|
27
28
|
configurable: true
|
|
@@ -36,10 +37,9 @@ var RoleService = /** @class */ (function () {
|
|
|
36
37
|
}());
|
|
37
38
|
export { RoleService };
|
|
38
39
|
if (false) {
|
|
39
|
-
/**
|
|
40
|
-
* @type {?}
|
|
41
|
-
* @private
|
|
42
|
-
*/
|
|
40
|
+
/** @type {?} */
|
|
43
41
|
RoleService.prototype.pRoles;
|
|
42
|
+
/** @type {?} */
|
|
43
|
+
RoleService.prototype.roles$;
|
|
44
44
|
}
|
|
45
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
45
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm9sZS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQGhtY3RzL3JweC14dWktY29tbW9uLWxpYi8iLCJzb3VyY2VzIjpbImxpYi9zZXJ2aWNlcy9yb2xlLWd1YXJkL3JvbGUuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDM0MsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUN2QyxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7O0FBTTNDO0lBQUE7UUFJb0IsV0FBTSxHQUFHLElBQUksZUFBZSxDQUFRLElBQUksQ0FBQyxDQUFDO1FBQ25ELFdBQU0sR0FBRyxJQUFJLENBQUMsTUFBTSxDQUFDLFlBQVksRUFBRSxDQUFDLElBQUksQ0FBQyxTQUFTOzs7O1FBQUMsVUFBQSxJQUFJLElBQUksT0FBQSxJQUFJLEtBQUssSUFBSSxFQUFiLENBQWEsRUFBQyxDQUFDLENBQUM7S0FLckY7SUFIRyxzQkFBVyw4QkFBSzs7Ozs7UUFBaEIsVUFBaUIsS0FBWTtZQUN6QixJQUFJLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQztRQUM1QixDQUFDOzs7T0FBQTs7Z0JBVEosVUFBVSxTQUFDO29CQUNSLFVBQVUsRUFBRSxNQUFNO2lCQUNuQjs7O3NCQVZIO0NBa0JDLEFBVkQsSUFVQztTQVBZLFdBQVc7OztJQUNwQiw2QkFBMEQ7O0lBQzFELDZCQUFrRiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEluamVjdGFibGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IEJlaGF2aW9yU3ViamVjdCB9IGZyb20gJ3J4anMnO1xuaW1wb3J0IHsgc2tpcFdoaWxlIH0gZnJvbSAncnhqcy9vcGVyYXRvcnMnO1xuXG4vLyB1c2UgdHlwZXMgc28gd2UgY2FuIG1vdmUgdG8gc3RyaWN0ZWQgdHlwaW5nIGxhdGVyIG9uXG5leHBvcnQgdHlwZSBSb2xlID0gc3RyaW5nO1xuZXhwb3J0IHR5cGUgUm9sZXMgPSBSb2xlW107XG5cbkBJbmplY3RhYmxlKHtcbiAgICBwcm92aWRlZEluOiAncm9vdCdcbiAgfSlcbmV4cG9ydCBjbGFzcyBSb2xlU2VydmljZSB7XG4gICAgcHVibGljIHJlYWRvbmx5IHBSb2xlcyA9IG5ldyBCZWhhdmlvclN1YmplY3Q8Um9sZXM+KG51bGwpO1xuICAgIHB1YmxpYyByb2xlcyQgPSB0aGlzLnBSb2xlcy5hc09ic2VydmFibGUoKS5waXBlKHNraXBXaGlsZShpdGVtID0+IGl0ZW0gPT09IG51bGwpKTtcblxuICAgIHB1YmxpYyBzZXQgcm9sZXMocm9sZXM6IFJvbGVzKSB7XG4gICAgICAgIHRoaXMucFJvbGVzLm5leHQocm9sZXMpO1xuICAgIH1cbn1cbiJdfQ==
|
|
@@ -11,7 +11,7 @@ import { Keepalive } from '@ng-idle/keepalive';
|
|
|
11
11
|
import { RouterModule, Router, NavigationEnd } from '@angular/router';
|
|
12
12
|
import { Component, EventEmitter, Input, Output, ViewEncapsulation, Injectable, Directive, TemplateRef, ViewContainerRef, ElementRef, Inject, ViewChild, ChangeDetectorRef, InjectionToken, ChangeDetectionStrategy, defineInjectable, inject, NgModule } from '@angular/core';
|
|
13
13
|
import { BehaviorSubject, of, zip, Subject, combineLatest } from 'rxjs';
|
|
14
|
-
import { distinctUntilChanged, map, debounceTime, filter, mergeMap, tap, catchError, switchMap, delay } from 'rxjs/operators';
|
|
14
|
+
import { distinctUntilChanged, map, debounceTime, filter, mergeMap, tap, catchError, switchMap, delay, skipWhile } from 'rxjs/operators';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* @fileoverview added by tsickle
|
|
@@ -1208,7 +1208,7 @@ GenericFilterComponent.decorators = [
|
|
|
1208
1208
|
template: "<form [formGroup]=\"form\" (ngSubmit)=\"applyFilter(form)\">\n <div class=\"contain-classes\" *ngFor=\"let field of config.fields\">\n <hr *ngIf=\"field.lineBreakBefore\" class=\"govuk-section-break govuk-section-break--visible elevated-break\">\n <div class=\"govuk-form-group xui-generic-filter\"\n [hidden]=\"hidden(field, form)\"\n [id]=\"field.name\"\n [ngClass]=\"{'form-group-error': submitted && (form.get(field.name).errors?.minLength || form.get(field.name).errors?.maxLength)}\">\n <h3 *ngIf=\"field.title\" class=\"govuk-heading-s\">{{field.title}}</h3>\n <p class=\"govuk-body\" *ngIf=\"field.subTitle\">{{field.subTitle}}</p>\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\" *ngIf=\"field.displayMinSelectedError && submitted && form.get(field.name).errors?.minLength\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.minSelectedError}}\n </span>\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\" *ngIf=\"field.displayMaxSelectedError && submitted && form.get(field.name).errors?.maxLength\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.maxSelectedError}}\n </span>\n <div class=\"govuk-body\" [ngSwitch]=\"field.type\">\n <ng-container *ngSwitchCase=\"'select'\">\n <select class=\"govuk-select\" (change)=\"fieldChanged(field, form)\" [attr.disabled]=\"disabled(field, form)\" [name]=\"'select_' + field.name\" [id]=\"'select_' + field.name\" [formControlName]=\"field.name\">\n <option disabled selected hidden value=\"\">{{field.disabledText}}</option>\n <option class=\"govuk-radios__item\" *ngFor=\"let item of field.options\" [value]=\"item.key\">{{item.label}}</option>\n </select>\n </ng-container>\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <div class=\"govuk-checkboxes govuk-checkboxes--small\" [formGroupName]=\"field.name\" [attr.field]=\"field.name\" [id]=\"'checkbox_' + field.name\">\n <div *ngFor=\"let item of field.options; let i = index\" class=\"govuk-checkboxes__item\">\n <input type=\"checkbox\" class=\"govuk-checkboxes__input\"\n [attr.disabled]=\"disabled(field, form)\"\n [formControlName]=\"i\"\n (change)=\"toggleSelectAll($event, form, item, field)\"\n [value]=\"item.key\" [id]=\"'checkbox_' + item.key\"\n [name]=\"'checkbox_' + item.key\"\n />\n <label\n [for]=\"'checkbox_' + item.key\"\n class=\"govuk-label govuk-checkboxes__label\"\n [ngClass]=\"{'govuk-!-font-weight-bold': item.selectAll}\"\n >{{item.label}}</label>\n </div>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'checkbox-large'\">\n <div class=\"govuk-checkboxes\" [formGroupName]=\"field.name\" [attr.field]=\"field.name\" [id]=\"'checkbox_' + field.name\">\n <div *ngFor=\"let item of field.options; let i = index\" class=\"govuk-checkboxes__item\">\n <input type=\"checkbox\" class=\"govuk-checkboxes__input\"\n [attr.disabled]=\"disabled(field, form)\"\n [formControlName]=\"i\"\n (change)=\"toggleSelectAll($event, form, item, field)\"\n [value]=\"item.key\" [id]=\"'checkbox_' + item.key\"\n [name]=\"'checkbox_' + item.key\"\n />\n <label\n [for]=\"'checkbox_' + item.key\"\n class=\"govuk-label govuk-checkboxes__label\"\n [ngClass]=\"{'govuk-!-font-weight-bold': item.selectAll}\"\n >{{item.label}}</label>\n </div>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'radio'\">\n <div class=\"govuk-radios\">\n <div *ngFor=\"let item of field.options\" class=\"govuk-radios__item\">\n <input type=\"radio\"\n [formControlName]=\"field.name\"\n [id]=\"'radio_' + item.key\"\n [attr.disabled]=\"disabled(field, form)\"\n [checked]=\"item.key === form.get(field.name).value\"\n class=\"govuk-radios__input\"\n [value]=\"item.key\"\n (change)=\"fieldChanged(field, form)\"\n />\n <label [for]=\"'radio_' + item.key\" class=\"govuk-label govuk-radios__label\">{{item.label}}</label>\n </div>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-person'\">\n <xuilib-find-person subTitle=\"\" (personSelected)=\"updatePersonControls($event, field)\"\n (personFieldChanged)=\"inputChanged(field)\"\n [submitted]=\"submitted\"\n [disabled]=\"disabled(field, form)\"\n [domain]=\"form.get(field.domainField)?.value\"\n [findPersonGroup]=\"form\"\n [selectedPerson]=\"form.get(field.name)?.value?.email\"\n [userIncluded]=\"false\"\n ></xuilib-find-person>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-location'\">\n <xuilib-find-location (locationFieldChanged)=\"inputChanged(field)\"\n [form]=\"form\"\n [fields]=\"config.fields\"\n [locationTitle]=\"field.locationTitle\"\n [enableAddLocationButton]=\"field.enableAddButton\"\n [disabled]=\"disabled(field, form)\"\n [disableInputField]=\"field.disable\"\n [selectedLocations]=\"form.get(field.name)?.value\"\n [submitted]=\"submitted\"\n [services]=\"form.get(field.findLocationField)?.value\"\n [field]=\"field\"\n ></xuilib-find-location>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-service'\">\n <xuilib-find-service (serviceFieldChanged)=\"inputChanged(field)\"\n [form]=\"form\"\n [fields]=\"config.fields\"\n [title]=\"field.title\"\n [enableAddServiceButton]=\"field.enableAddButton\"\n [disabled]=\"disabled(field, form)\"\n [disableInputField]=\"field.disable\"\n [selectedServices]=\"form.get(field.name)?.value\" \n [field]=\"field\"\n ></xuilib-find-service>\n </ng-container>\n </div>\n </div>\n </div>\n <hr class=\"govuk-section-break govuk-section-break--m govuk-section-break--visible\"/>\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full\">\n <button\n class=\"govuk-button govuk-!-margin-right-1 govuk-!-margin-bottom-0\"\n type=\"submit\"\n id=\"applyFilter\"\n [disabled]=\"config.enableDisabledButton && form.invalid\"\n >{{config.applyButtonText || 'Apply'}}</button>\n <button *ngIf=\"config.showCancelFilterButton\"\n class=\"govuk-button govuk-button--secondary govuk-!-margin-bottom-0\"\n type=\"button\"\n id=\"cancelFilter\"\n (click)=\"cancelFilter()\">{{ config.cancelButtonText || 'Cancel'}}</button>\n </div>\n </div>\n</form>\n",
|
|
1209
1209
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1210
1210
|
encapsulation: ViewEncapsulation.None,
|
|
1211
|
-
styles: [".contain-classes .elevated-break{
|
|
1211
|
+
styles: [".contain-classes .elevated-break{margin-bottom:20px}@media (min-width:40.0625em){.contain-classes .elevated-break{margin-bottom:30px}}.contain-classes .xui-generic-filter .select-all{margin-bottom:10px}.contain-classes .xui-generic-filter .govuk-checkboxes{display:flex;flex-direction:column;flex-wrap:wrap}.contain-classes .xui-generic-filter .govuk-checkboxes>div{flex-grow:1;flex-shrink:0}.contain-classes .govuk-select{width:100%}"]
|
|
1212
1212
|
}] }
|
|
1213
1213
|
];
|
|
1214
1214
|
/** @nocollapse */
|
|
@@ -3252,7 +3252,7 @@ SearchLocationComponent.decorators = [
|
|
|
3252
3252
|
{ type: Component, args: [{
|
|
3253
3253
|
selector: 'exui-search-location',
|
|
3254
3254
|
template: "<div class=\"auto-complete-container\">\n <input\n id=\"inputLocationSearch\"\n (input)=\"onInput()\"\n [formControl]=\"form.controls.searchTerm\"\n [matAutocomplete]=\"autoSearchLocation\"\n class=\"govuk-input\"\n [attr.disabled]=\"disabled\">\n <mat-autocomplete class=\"mat-autocomplete-panel-extend\" autoActiveFirstOption #autoSearchLocation=\"matAutocomplete\">\n <mat-option *ngFor=\"let location of locations\"\n (onSelectionChange)=\"onSelectionChange(location)\">\n {{ location.site_name }}\n </mat-option>\n <mat-option *ngIf=\"!locations.length && showAutocomplete && term && term.length >= this.minSearchCharacters\">No results found</mat-option>\n </mat-autocomplete>\n</div>\n",
|
|
3255
|
-
styles: [".autocomplete__input--show-all-values{padding:5px 34px 5px 5px;cursor:pointer}.autocomplete__dropdown-arrow-down{z-index:-1;display:inline-block;position:absolute;right:8px;width:24px;height:24px;top:10px}.autocomplete__menu{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:
|
|
3255
|
+
styles: [".autocomplete__input--show-all-values{padding:5px 34px 5px 5px;cursor:pointer}.autocomplete__dropdown-arrow-down{z-index:-1;display:inline-block;position:absolute;right:8px;width:24px;height:24px;top:10px}.autocomplete__menu{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:calc(100% - 4px)}.autocomplete__menu--visible{display:block}.autocomplete__menu--hidden{display:none}.autocomplete__menu--overlay{box-shadow:rgba(0,0,0,.256863) 0 2px 6px;left:0;position:absolute;top:100%;z-index:100}.autocomplete__menu--inline{position:relative}.autocomplete__option{border-bottom:solid #b1b4b6;border-width:1px 0;cursor:pointer;display:block;position:relative}.autocomplete__option>*{pointer-events:none}.autocomplete__option:first-of-type{border-top-width:0}.autocomplete__option:last-of-type{border-bottom-width:0}.autocomplete__option--odd{background-color:#fafafa}.autocomplete__option--focused,.autocomplete__option:hover{background-color:#1d70b8;border-color:#1d70b8;color:#fff;outline:0}.autocomplete__option--no-results{background-color:#fafafa;color:#646b6f;cursor:not-allowed}.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.25}.autocomplete__hint,.autocomplete__option{padding:5px}@media (min-width:641px){.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.31579}}.div-action{display:inline-block}.add-location{display:inline}.remove-location-button{margin:5px}.hide-autocomplete{display:none}.auto-complete-container{display:inline-block;margin-right:4px;width:calc(100% - 4px)}.autocomplete__input{line-height:24px;font-size:19px}"]
|
|
3256
3256
|
}] }
|
|
3257
3257
|
];
|
|
3258
3258
|
/** @nocollapse */
|
|
@@ -3460,8 +3460,8 @@ class FindLocationComponent {
|
|
|
3460
3460
|
FindLocationComponent.decorators = [
|
|
3461
3461
|
{ type: Component, args: [{
|
|
3462
3462
|
selector: 'xuilib-find-location',
|
|
3463
|
-
template: "<div class=\"location-picker-custom\">\n <div class=\"search-location\">\n <div>\n <label id=\"input-selected-location-label\" *ngIf=\"locationTitle\">{{locationTitle}}</label>\n </div>\n <exui-search-location class=\"search-
|
|
3464
|
-
styles: [""]
|
|
3463
|
+
template: "<div class=\"location-picker-custom\">\n <div class=\"search-location\">\n <div>\n <label id=\"input-selected-location-label\" *ngIf=\"locationTitle\">{{locationTitle}}</label>\n </div>\n\n <div class=\"search-location__input-container\">\n <exui-search-location class=\"search-location__input\"\n [locations]=\"locations\"\n [selectedLocations]=\"selectedLocations\"\n [singleMode]=\"field.maxSelected === 1\"\n [bookingCheck]=\"field.bookingCheckType\"\n [delay]=\"300\"\n [disabled]=\"disabled\"\n [serviceIds]=\"serviceIds\"\n (locationInputChanged)=\"onInputChanged($event)\"\n (locationSelected)=\"onLocationSelected($event)\"\n (searchLocationChanged)=\"onSearchInputChanged()\"\n [locationType]=\"'case-management'\"></exui-search-location>\n <a href=\"javascript:void(0)\" (click)=\"addLocation()\" class=\"govuk-button govuk-button--secondary govuk-!-margin-bottom-0\" data-module=\"govuk-button\" *ngIf=\"enableAddLocationButton\">\n Add\n </a>\n </div>\n </div>\n <ul class=\"hmcts-filter-tags selection-container\" *ngIf=\"field.maxSelected != 1\">\n <li class=\"location-selection\" *ngFor=\"let selection of selectedLocations\">\n <a class=\"hmcts-filter__tag\" (click)=\"removeLocation(selection)\" href=\"javascript:void(0)\">\n {{ selection.site_name }}\n </a>\n </li>\n </ul>\n</div>\n",
|
|
3464
|
+
styles: [".search-location__input-container{display:flex}.search-location .auto-complete-container{min-width:unset;width:calc(100% - 4px)}.search-location__input{flex:1 0 auto}.search-location .govuk-button--secondary{background-color:#ddd}"]
|
|
3465
3465
|
}] }
|
|
3466
3466
|
];
|
|
3467
3467
|
FindLocationComponent.propDecorators = {
|
|
@@ -4115,10 +4115,17 @@ FindPersonComponent.propDecorators = {
|
|
|
4115
4115
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4116
4116
|
*/
|
|
4117
4117
|
class FindServiceComponent {
|
|
4118
|
-
|
|
4118
|
+
/**
|
|
4119
|
+
* @param {?} fb
|
|
4120
|
+
*/
|
|
4121
|
+
constructor(fb) {
|
|
4122
|
+
this.fb = fb;
|
|
4119
4123
|
this.serviceTitle = 'Search for a service by name';
|
|
4120
4124
|
this.enableAddServiceButton = true;
|
|
4121
4125
|
this.disableInputField = false;
|
|
4126
|
+
this.form = this.fb.group({
|
|
4127
|
+
searchTerm: ['']
|
|
4128
|
+
});
|
|
4122
4129
|
}
|
|
4123
4130
|
/**
|
|
4124
4131
|
* @return {?}
|
|
@@ -4130,10 +4137,14 @@ class FindServiceComponent {
|
|
|
4130
4137
|
FindServiceComponent.decorators = [
|
|
4131
4138
|
{ type: Component, args: [{
|
|
4132
4139
|
selector: 'xuilib-find-service',
|
|
4133
|
-
template: "<div class=\"service-picker-custom\">\n
|
|
4134
|
-
styles: ["#add-service{background-color:#ddd}"]
|
|
4140
|
+
template: "<div class=\"service-picker-custom\">\n <div class=\"search-service\">\n <div class=\"govuk-body\">\n <label id=\"input-selected-service-label\" *ngIf=\"serviceTitle\">{{serviceTitle}}</label>\n </div>\n <div class=\"search-service__input-container\">\n <exui-search-service class=\"search-service__input\"\n [services]=\"services\"\n [selectedServices]=\"selectedServices\"\n [delay]=\"300\"\n [disabled]=\"disabled\"></exui-search-service>\n <a href=\"javascript:void(0)\" (click)=\"addService()\" class=\"govuk-button govuk-button--secondary govuk-!-margin-bottom-0\"\n data-module=\"govuk-button\" *ngIf=\"enableAddServiceButton\" id=\"add-service\">\n Add\n </a>\n </div>\n </div>\n <ul class=\"hmcts-filter-tags selection-container\" *ngIf=\"field.maxSelected != 1\">\n <li class=\"service-selection\" *ngFor=\"let selection of selectedServices\">\n <a class=\"hmcts-filter__tag\" href=\"javascript:void(0)\">\n {{ selection.name }}\n </a>\n </li>\n </ul>\n</div>\n",
|
|
4141
|
+
styles: ["#add-service{background-color:#ddd}.search-service__input-container{display:flex}.search-service__input{flex:1 0 auto}"]
|
|
4135
4142
|
}] }
|
|
4136
4143
|
];
|
|
4144
|
+
/** @nocollapse */
|
|
4145
|
+
FindServiceComponent.ctorParameters = () => [
|
|
4146
|
+
{ type: FormBuilder }
|
|
4147
|
+
];
|
|
4137
4148
|
FindServiceComponent.propDecorators = {
|
|
4138
4149
|
field: [{ type: Input }],
|
|
4139
4150
|
fields: [{ type: Input }],
|
|
@@ -4373,8 +4384,8 @@ class SearchServiceComponent {
|
|
|
4373
4384
|
SearchServiceComponent.decorators = [
|
|
4374
4385
|
{ type: Component, args: [{
|
|
4375
4386
|
selector: 'exui-search-service',
|
|
4376
|
-
template: "<div class=\"auto-complete-container\">\n <input\n id=\"inputServiceSearch\"\n (input)=\"onInput()\"\n [formControl]=\"form
|
|
4377
|
-
styles: [".autocomplete__input--show-all-values{padding:5px 34px 5px 5px;cursor:pointer}.autocomplete__dropdown-arrow-down{z-index:-1;display:inline-block;position:absolute;right:8px;width:24px;height:24px;top:10px}.autocomplete__menu{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:
|
|
4387
|
+
template: "<div class=\"auto-complete-container\">\n <input\n id=\"inputServiceSearch\"\n (input)=\"onInput()\"\n [formControl]=\"form?.controls?.searchTerm\"\n [matAutocomplete]=\"autoSearchService\"\n class=\"govuk-input\"\n [attr.disabled]=\"disabled\">\n <mat-autocomplete class=\"mat-autocomplete-panel-extend\" autoActiveFirstOption #autoSearchService=\"matAutocomplete\">\n <mat-option *ngFor=\"let service of services\" (onSelectionChange)=\"onSelectionChange()\">\n {{ service.name }}\n </mat-option>\n <mat-option *ngIf=\"!services?.length && showAutocomplete && term && term.length >= this.minSearchCharacters\">No results found</mat-option>\n </mat-autocomplete>\n</div>\n",
|
|
4388
|
+
styles: [".autocomplete__input--show-all-values{padding:5px 34px 5px 5px;cursor:pointer}.autocomplete__dropdown-arrow-down{z-index:-1;display:inline-block;position:absolute;right:8px;width:24px;height:24px;top:10px}.autocomplete__menu{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:calc(100% - 4px)}.autocomplete__menu--visible{display:block}.autocomplete__menu--hidden{display:none}.autocomplete__menu--overlay{box-shadow:rgba(0,0,0,.256863) 0 2px 6px;left:0;position:absolute;top:100%;z-index:100}.autocomplete__menu--inline{position:relative}.autocomplete__option{border-bottom:solid #b1b4b6;border-width:1px 0;cursor:pointer;display:block;position:relative}.autocomplete__option>*{pointer-events:none}.autocomplete__option:first-of-type{border-top-width:0}.autocomplete__option:last-of-type{border-bottom-width:0}.autocomplete__option--odd{background-color:#fafafa}.autocomplete__option--focused,.autocomplete__option:hover{background-color:#1d70b8;border-color:#1d70b8;color:#fff;outline:0}.autocomplete__option--no-results{background-color:#fafafa;color:#646b6f;cursor:not-allowed}.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.25}.autocomplete__hint,.autocomplete__option{padding:5px}@media (min-width:641px){.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.31579}}.div-action{display:inline-block}.add-location{display:inline}.remove-location-button{margin:5px}.hide-autocomplete{display:none}.auto-complete-container{width:calc(100% - 4px);display:inline-block;margin-right:4px}.autocomplete__input{line-height:24px;font-size:19px}"]
|
|
4378
4389
|
}] }
|
|
4379
4390
|
];
|
|
4380
4391
|
SearchServiceComponent.propDecorators = {
|
|
@@ -6267,20 +6278,19 @@ TimeoutNotificationsService.ctorParameters = () => [
|
|
|
6267
6278
|
*/
|
|
6268
6279
|
class RoleService {
|
|
6269
6280
|
constructor() {
|
|
6270
|
-
this.pRoles =
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
return this.pRoles;
|
|
6281
|
+
this.pRoles = new BehaviorSubject(null);
|
|
6282
|
+
this.roles$ = this.pRoles.asObservable().pipe(skipWhile((/**
|
|
6283
|
+
* @param {?} item
|
|
6284
|
+
* @return {?}
|
|
6285
|
+
*/
|
|
6286
|
+
item => item === null)));
|
|
6277
6287
|
}
|
|
6278
6288
|
/**
|
|
6279
6289
|
* @param {?} roles
|
|
6280
6290
|
* @return {?}
|
|
6281
6291
|
*/
|
|
6282
6292
|
set roles(roles) {
|
|
6283
|
-
this.pRoles
|
|
6293
|
+
this.pRoles.next(roles);
|
|
6284
6294
|
}
|
|
6285
6295
|
}
|
|
6286
6296
|
RoleService.decorators = [
|
|
@@ -6316,25 +6326,31 @@ class RoleGuard {
|
|
|
6316
6326
|
* @return {?}
|
|
6317
6327
|
*/
|
|
6318
6328
|
canActivate(route) {
|
|
6319
|
-
/**
|
|
6320
|
-
|
|
6321
|
-
/** @type {?} */
|
|
6322
|
-
const check = (/**
|
|
6323
|
-
* @param {?} roleRegEx
|
|
6329
|
+
return this.roleService.roles$.pipe(map((/**
|
|
6330
|
+
* @param {?} roles
|
|
6324
6331
|
* @return {?}
|
|
6325
6332
|
*/
|
|
6326
|
-
|
|
6333
|
+
roles => {
|
|
6327
6334
|
/** @type {?} */
|
|
6328
|
-
const
|
|
6329
|
-
|
|
6330
|
-
|
|
6335
|
+
const canActivateRoles = ((/** @type {?} */ (route.data.needsRole)));
|
|
6336
|
+
/** @type {?} */
|
|
6337
|
+
const check = (/**
|
|
6338
|
+
* @param {?} roleRegEx
|
|
6331
6339
|
* @return {?}
|
|
6332
6340
|
*/
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6341
|
+
(roleRegEx) => {
|
|
6342
|
+
/** @type {?} */
|
|
6343
|
+
const regex = new RegExp(roleRegEx);
|
|
6344
|
+
return roles.some((/**
|
|
6345
|
+
* @param {?} role
|
|
6346
|
+
* @return {?}
|
|
6347
|
+
*/
|
|
6348
|
+
role => regex.test(role)));
|
|
6349
|
+
});
|
|
6350
|
+
/** @type {?} */
|
|
6351
|
+
const match = route.data.roleMatching === RoleMatching.ALL ? canActivateRoles.every(check) : canActivateRoles.some(check);
|
|
6352
|
+
return match || this.router.parseUrl((/** @type {?} */ (route.data.noRoleMatchRedirect)));
|
|
6353
|
+
})));
|
|
6338
6354
|
}
|
|
6339
6355
|
}
|
|
6340
6356
|
RoleGuard.decorators = [
|