@hmcts/rpx-xui-common-lib 1.8.5-angular-upgrade-r4 → 1.8.7-fix-wrong-services
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 +431 -1076
- 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/hmcts-rpx-xui-common-lib.js +29 -32
- package/esm2015/lib/components/find-location/find-location.component.js +3 -3
- package/esm2015/lib/components/find-service/find-service.component.js +12 -129
- package/esm2015/lib/components/generic-filter/generic-filter-utils.js +2 -2
- package/esm2015/lib/components/generic-filter/generic-filter.component.js +15 -361
- package/esm2015/lib/components/search-location/search-location.component.js +3 -3
- package/esm2015/lib/components/search-service/search-service.component.js +34 -17
- package/esm2015/lib/components/selected-case/selected-case.component.js +4 -10
- package/esm2015/lib/components/selected-case-confirm/selected-case-confirm.component.js +1 -1
- package/esm2015/lib/components/share-case/share-case.component.js +186 -14
- package/esm2015/lib/exui-common-lib.module.js +5 -13
- package/esm2015/lib/gov-ui/components/gov-uk-checkboxes/gov-uk-checkboxes.component.js +6 -80
- package/esm2015/lib/gov-ui/components/gov-uk-input/gov-uk-input.component.js +3 -3
- package/esm2015/lib/gov-ui/components/gov-uk-label/gov-uk-label.component.js +2 -3
- package/esm2015/lib/gov-ui/components/gov-uk-radios/gov-uk-radios.component.js +1 -1
- package/esm2015/lib/gov-ui/components/gov-uk-select/gov-uk-select.component.js +2 -2
- package/esm2015/lib/gov-ui/components/hmcts-banner/hmcts-banner.component.js +14 -19
- package/esm2015/lib/gov-ui/components/hmcts-main-wrapper/hmcts-main-wrapper.component.js +2 -2
- package/esm2015/lib/gov-ui/components/index.js +2 -2
- package/esm2015/lib/gov-ui/components/public_api.js +1 -2
- package/esm2015/lib/gov-ui/index.js +2 -2
- package/esm2015/lib/gov-ui/models/banner-data-model.js +16 -0
- package/esm2015/lib/gov-ui/models/checkboxes-model.js +8 -6
- package/esm2015/lib/gov-ui/models/gov-ui-config-model.js +1 -5
- package/esm2015/lib/gov-ui/models/public_api.js +2 -1
- package/esm2015/lib/gov-ui/public_api.js +2 -2
- package/esm2015/lib/models/case-share.model.js +8 -1
- package/esm2015/lib/models/filter.model.js +5 -65
- package/esm2015/lib/models/index.js +2 -2
- package/esm2015/lib/models/person.model.js +2 -2
- package/esm2015/lib/services/case-sharing-state/case-sharing-state.service.js +39 -15
- package/esm2015/lib/services/filter/filter.service.js +3 -17
- package/esm2015/lib/services/find-person/find-person.service.js +3 -3
- package/esm2015/lib/services/role-guard/role.guard.js +15 -22
- package/esm2015/lib/services/role-guard/role.service.js +13 -13
- package/esm2015/lib/services/session-storage/session-storage.service.js +55 -0
- package/esm2015/public-api.js +3 -3
- package/esm5/hmcts-rpx-xui-common-lib.js +29 -32
- package/esm5/lib/components/find-location/find-location.component.js +3 -3
- package/esm5/lib/components/find-service/find-service.component.js +12 -166
- package/esm5/lib/components/generic-filter/generic-filter-utils.js +2 -2
- package/esm5/lib/components/generic-filter/generic-filter.component.js +14 -397
- package/esm5/lib/components/search-location/search-location.component.js +3 -3
- package/esm5/lib/components/search-service/search-service.component.js +38 -19
- package/esm5/lib/components/selected-case/selected-case.component.js +4 -13
- package/esm5/lib/components/selected-case-confirm/selected-case-confirm.component.js +1 -1
- package/esm5/lib/components/share-case/share-case.component.js +219 -14
- package/esm5/lib/exui-common-lib.module.js +5 -11
- package/esm5/lib/gov-ui/components/gov-uk-checkboxes/gov-uk-checkboxes.component.js +6 -100
- package/esm5/lib/gov-ui/components/gov-uk-input/gov-uk-input.component.js +3 -3
- package/esm5/lib/gov-ui/components/gov-uk-label/gov-uk-label.component.js +2 -3
- package/esm5/lib/gov-ui/components/gov-uk-radios/gov-uk-radios.component.js +1 -1
- package/esm5/lib/gov-ui/components/gov-uk-select/gov-uk-select.component.js +2 -2
- package/esm5/lib/gov-ui/components/hmcts-banner/hmcts-banner.component.js +13 -17
- package/esm5/lib/gov-ui/components/hmcts-main-wrapper/hmcts-main-wrapper.component.js +2 -2
- package/esm5/lib/gov-ui/components/index.js +2 -2
- package/esm5/lib/gov-ui/components/public_api.js +1 -2
- package/esm5/lib/gov-ui/index.js +2 -2
- package/esm5/lib/gov-ui/models/banner-data-model.js +16 -0
- package/esm5/lib/gov-ui/models/checkboxes-model.js +8 -6
- package/esm5/lib/gov-ui/models/gov-ui-config-model.js +1 -5
- package/esm5/lib/gov-ui/models/public_api.js +2 -1
- package/esm5/lib/gov-ui/public_api.js +2 -2
- package/esm5/lib/models/case-share.model.js +8 -1
- package/esm5/lib/models/filter.model.js +5 -65
- package/esm5/lib/models/index.js +2 -2
- package/esm5/lib/models/person.model.js +2 -2
- package/esm5/lib/services/case-sharing-state/case-sharing-state.service.js +40 -16
- package/esm5/lib/services/filter/filter.service.js +3 -21
- package/esm5/lib/services/find-person/find-person.service.js +3 -3
- package/esm5/lib/services/role-guard/role.guard.js +15 -22
- package/esm5/lib/services/role-guard/role.service.js +13 -13
- package/esm5/lib/services/{storage/session-storage → session-storage}/session-storage.service.js +2 -2
- package/esm5/public-api.js +3 -3
- package/fesm2015/hmcts-rpx-xui-common-lib.js +447 -1040
- package/fesm2015/hmcts-rpx-xui-common-lib.js.map +1 -1
- package/fesm5/hmcts-rpx-xui-common-lib.js +415 -1094
- package/fesm5/hmcts-rpx-xui-common-lib.js.map +1 -1
- package/hmcts-rpx-xui-common-lib.d.ts +27 -30
- package/hmcts-rpx-xui-common-lib.metadata.json +1 -1
- package/lib/components/find-service/find-service.component.d.ts +6 -14
- package/lib/components/generic-filter/generic-filter-utils.d.ts +5 -2
- package/lib/components/generic-filter/generic-filter.component.d.ts +2 -12
- package/lib/components/search-location/search-location.component.d.ts +1 -1
- package/lib/components/search-service/search-service.component.d.ts +11 -5
- package/lib/components/selected-case/selected-case.component.d.ts +0 -1
- package/lib/components/share-case/share-case.component.d.ts +35 -2
- package/lib/exui-common-lib.module.d.ts +3 -4
- package/lib/gov-ui/components/gov-uk-checkboxes/gov-uk-checkboxes.component.d.ts +5 -14
- package/lib/gov-ui/components/gov-uk-input/gov-uk-input.component.d.ts +2 -1
- package/lib/gov-ui/components/gov-uk-label/gov-uk-label.component.d.ts +0 -1
- package/lib/gov-ui/components/gov-uk-radios/gov-uk-radios.component.d.ts +2 -2
- package/lib/gov-ui/components/hmcts-banner/hmcts-banner.component.d.ts +2 -4
- package/lib/gov-ui/components/hmcts-main-wrapper/hmcts-main-wrapper.component.d.ts +3 -3
- package/lib/gov-ui/components/public_api.d.ts +0 -1
- package/lib/gov-ui/models/banner-data-model.d.ts +4 -0
- package/lib/gov-ui/models/checkboxes-model.d.ts +7 -4
- package/lib/gov-ui/models/gov-ui-config-model.d.ts +0 -2
- package/lib/gov-ui/models/public_api.d.ts +1 -0
- package/lib/models/case-share.model.d.ts +5 -0
- package/lib/models/filter.model.d.ts +8 -30
- package/lib/models/person.model.d.ts +1 -1
- package/lib/services/case-sharing-state/case-sharing-state.service.d.ts +1 -1
- package/lib/services/filter/filter.service.d.ts +0 -1
- package/lib/services/find-person/find-person.service.d.ts +1 -1
- package/lib/services/role-guard/role.guard.d.ts +1 -2
- package/lib/services/role-guard/role.service.d.ts +1 -3
- package/lib/services/{storage/session-storage → session-storage}/session-storage.service.d.ts +0 -0
- package/package.json +1 -1
- package/esm2015/lib/components/find-task-name/find-task-name.component.js +0 -228
- package/esm2015/lib/gov-ui/components/hmcts-banner/hmcts-banner-info.interface.js +0 -22
- package/esm2015/lib/gov-ui/models/radio-buttons.model.js +0 -22
- package/esm2015/lib/models/task-name.model.js +0 -16
- package/esm2015/lib/pipes/capitalize.pipe.js +0 -21
- package/esm2015/lib/services/storage/session-storage/session-storage.service.js +0 -55
- package/esm2015/lib/services/task-name/task-name.service.js +0 -65
- package/esm5/lib/components/find-task-name/find-task-name.component.js +0 -243
- package/esm5/lib/gov-ui/components/hmcts-banner/hmcts-banner-info.interface.js +0 -22
- package/esm5/lib/gov-ui/models/radio-buttons.model.js +0 -22
- package/esm5/lib/models/task-name.model.js +0 -16
- package/esm5/lib/pipes/capitalize.pipe.js +0 -29
- package/esm5/lib/services/task-name/task-name.service.js +0 -70
- package/lib/components/find-task-name/find-task-name.component.d.ts +0 -41
- package/lib/gov-ui/components/hmcts-banner/hmcts-banner-info.interface.d.ts +0 -7
- package/lib/gov-ui/models/radio-buttons.model.d.ts +0 -9
- package/lib/models/task-name.model.d.ts +0 -4
- package/lib/pipes/capitalize.pipe.d.ts +0 -4
- package/lib/services/task-name/task-name.service.d.ts +0 -14
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { MatInputModule, MatTabsModule } from '@angular/material';
|
|
2
1
|
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
2
|
+
import { MatInputModule } from '@angular/material/input';
|
|
3
|
+
import { MatTabsModule } from '@angular/material/tabs';
|
|
3
4
|
import { NgxPaginationModule, PaginatePipe } from 'ngx-pagination';
|
|
4
5
|
import { HttpClient } from '@angular/common/http';
|
|
5
6
|
import { FormArray, FormBuilder, FormControl, FormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
@@ -9,10 +10,10 @@ import { formatDate, DOCUMENT, CommonModule } from '@angular/common';
|
|
|
9
10
|
import { Title } from '@angular/platform-browser';
|
|
10
11
|
import { DocumentInterruptSource, Idle } from '@ng-idle/core';
|
|
11
12
|
import { Keepalive } from '@ng-idle/keepalive';
|
|
12
|
-
import {
|
|
13
|
-
import { Component, EventEmitter, Input, Output, ViewEncapsulation, Injectable,
|
|
13
|
+
import { Router, RouterModule, NavigationEnd } from '@angular/router';
|
|
14
|
+
import { Component, EventEmitter, Input, Output, ViewEncapsulation, Injectable, Directive, TemplateRef, ViewContainerRef, ElementRef, Inject, ViewChild, ChangeDetectorRef, InjectionToken, defineInjectable, inject, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
14
15
|
import { BehaviorSubject, of, zip, Subject, combineLatest } from 'rxjs';
|
|
15
|
-
import { distinctUntilChanged, map, debounceTime, filter, mergeMap,
|
|
16
|
+
import { distinctUntilChanged, map, tap, debounceTime, filter, mergeMap, catchError, switchMap, delay } from 'rxjs/operators';
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* @fileoverview added by tsickle
|
|
@@ -662,7 +663,7 @@ var FilterService = /** @class */ (function () {
|
|
|
662
663
|
return this.filterSettings[id];
|
|
663
664
|
}
|
|
664
665
|
if (sessionStorage.getItem(id)) {
|
|
665
|
-
return JSON.parse(sessionStorage.getItem(id));
|
|
666
|
+
return JSON.parse(window.sessionStorage.getItem(id));
|
|
666
667
|
}
|
|
667
668
|
if (localStorage.getItem(id)) {
|
|
668
669
|
if (this.isSameUser(id)) {
|
|
@@ -701,24 +702,6 @@ var FilterService = /** @class */ (function () {
|
|
|
701
702
|
}
|
|
702
703
|
return this.streams[id].asObservable();
|
|
703
704
|
};
|
|
704
|
-
/**
|
|
705
|
-
* @param {?} id
|
|
706
|
-
* @return {?}
|
|
707
|
-
*/
|
|
708
|
-
FilterService.prototype.clearSessionAndLocalPersistance = /**
|
|
709
|
-
* @param {?} id
|
|
710
|
-
* @return {?}
|
|
711
|
-
*/
|
|
712
|
-
function (id) {
|
|
713
|
-
sessionStorage.removeItem(id);
|
|
714
|
-
localStorage.removeItem(id);
|
|
715
|
-
if (this.filterSettings[id] !== undefined) {
|
|
716
|
-
this.filterSettings[id] = null;
|
|
717
|
-
}
|
|
718
|
-
if (this.streams[id] !== undefined) {
|
|
719
|
-
this.streams[id].next(null);
|
|
720
|
-
}
|
|
721
|
-
};
|
|
722
705
|
/**
|
|
723
706
|
* @private
|
|
724
707
|
* @param {?} setting
|
|
@@ -744,7 +727,7 @@ var FilterService = /** @class */ (function () {
|
|
|
744
727
|
* @return {?}
|
|
745
728
|
*/
|
|
746
729
|
function (setting) {
|
|
747
|
-
sessionStorage.setItem(setting.id, JSON.stringify(setting));
|
|
730
|
+
window.sessionStorage.setItem(setting.id, JSON.stringify(setting));
|
|
748
731
|
};
|
|
749
732
|
/**
|
|
750
733
|
* @private
|
|
@@ -823,7 +806,7 @@ function minSelectedValidator(min) {
|
|
|
823
806
|
* @param {?} value
|
|
824
807
|
* @return {?}
|
|
825
808
|
*/
|
|
826
|
-
function (value) { return value; })).length >= min ? null : {
|
|
809
|
+
function (value) { return value; })).length >= min ? null : { minLength: true };
|
|
827
810
|
});
|
|
828
811
|
}
|
|
829
812
|
/**
|
|
@@ -876,7 +859,6 @@ var GenericFilterComponent = /** @class */ (function () {
|
|
|
876
859
|
this.filterService = filterService;
|
|
877
860
|
this.fb = fb;
|
|
878
861
|
this.submitted = false;
|
|
879
|
-
this.previousSelectedNestedCheckbox = [];
|
|
880
862
|
}
|
|
881
863
|
Object.defineProperty(GenericFilterComponent.prototype, "config", {
|
|
882
864
|
get: /**
|
|
@@ -936,10 +918,10 @@ var GenericFilterComponent = /** @class */ (function () {
|
|
|
936
918
|
function (field) {
|
|
937
919
|
/** @type {?} */
|
|
938
920
|
var validators = [];
|
|
939
|
-
if (field && field.minSelected
|
|
921
|
+
if (field && field.minSelected) {
|
|
940
922
|
validators.push(minSelectedValidator(field.minSelected));
|
|
941
923
|
}
|
|
942
|
-
if (field && field.maxSelected
|
|
924
|
+
if (field && field.maxSelected) {
|
|
943
925
|
validators.push(maxSelectedValidator(field.maxSelected));
|
|
944
926
|
}
|
|
945
927
|
return validators;
|
|
@@ -961,17 +943,6 @@ var GenericFilterComponent = /** @class */ (function () {
|
|
|
961
943
|
* @return {?}
|
|
962
944
|
*/
|
|
963
945
|
function () { return _this.submitted = false; }));
|
|
964
|
-
this.filterSkillsByServices(null, this.config);
|
|
965
|
-
/** @type {?} */
|
|
966
|
-
var services = this.config.fields.find((/**
|
|
967
|
-
* @param {?} field
|
|
968
|
-
* @return {?}
|
|
969
|
-
*/
|
|
970
|
-
function (field) { return field.name === 'user-services'; }));
|
|
971
|
-
if (services) {
|
|
972
|
-
this.startFilterSkillsByServices(this.form, services);
|
|
973
|
-
this.initValuesFromCacheForSkillsByServices();
|
|
974
|
-
}
|
|
975
946
|
};
|
|
976
947
|
/**
|
|
977
948
|
* @return {?}
|
|
@@ -1146,11 +1117,6 @@ var GenericFilterComponent = /** @class */ (function () {
|
|
|
1146
1117
|
* @return {?}
|
|
1147
1118
|
*/
|
|
1148
1119
|
function (field) {
|
|
1149
|
-
if (field.name === 'user-services') {
|
|
1150
|
-
/** @type {?} */
|
|
1151
|
-
var selectedServices = this.getSelectedValuesForFields(this.form.controls, field);
|
|
1152
|
-
this.filterSkillsByServices(selectedServices, this.config);
|
|
1153
|
-
}
|
|
1154
1120
|
if (field.radioSelectionChange && typeof field.radioSelectionChange === 'string') {
|
|
1155
1121
|
var _a = __read(field.enableCondition.split('='), 2), name_3 = _a[0], value = _a[1];
|
|
1156
1122
|
this.form.get(name_3).patchValue(value);
|
|
@@ -1172,9 +1138,6 @@ var GenericFilterComponent = /** @class */ (function () {
|
|
|
1172
1138
|
this.filterService.persist(settings, this.config.persistence);
|
|
1173
1139
|
this.filterService.givenErrors.next(null);
|
|
1174
1140
|
this.submitted = false;
|
|
1175
|
-
if (this.config.cancelButtonCallback) {
|
|
1176
|
-
this.config.cancelButtonCallback();
|
|
1177
|
-
}
|
|
1178
1141
|
};
|
|
1179
1142
|
/**
|
|
1180
1143
|
* @param {?} values
|
|
@@ -1214,32 +1177,6 @@ var GenericFilterComponent = /** @class */ (function () {
|
|
|
1214
1177
|
finally { if (e_2) throw e_2.error; }
|
|
1215
1178
|
}
|
|
1216
1179
|
};
|
|
1217
|
-
/**
|
|
1218
|
-
* @param {?} field
|
|
1219
|
-
* @param {?} i
|
|
1220
|
-
* @return {?}
|
|
1221
|
-
*/
|
|
1222
|
-
GenericFilterComponent.prototype.checkBoxChecked = /**
|
|
1223
|
-
* @param {?} field
|
|
1224
|
-
* @param {?} i
|
|
1225
|
-
* @return {?}
|
|
1226
|
-
*/
|
|
1227
|
-
function (field, i) {
|
|
1228
|
-
return ((/** @type {?} */ (this.form.get(field.name))))['controls'][i]['value'];
|
|
1229
|
-
};
|
|
1230
|
-
/**
|
|
1231
|
-
* @param {?} values
|
|
1232
|
-
* @param {?} field
|
|
1233
|
-
* @return {?}
|
|
1234
|
-
*/
|
|
1235
|
-
GenericFilterComponent.prototype.updateTaskNameControls = /**
|
|
1236
|
-
* @param {?} values
|
|
1237
|
-
* @param {?} field
|
|
1238
|
-
* @return {?}
|
|
1239
|
-
*/
|
|
1240
|
-
function (values, field) {
|
|
1241
|
-
this.form.get(field.name).patchValue(values);
|
|
1242
|
-
};
|
|
1243
1180
|
/**
|
|
1244
1181
|
* @param {?} event
|
|
1245
1182
|
* @param {?} form
|
|
@@ -1341,58 +1278,6 @@ var GenericFilterComponent = /** @class */ (function () {
|
|
|
1341
1278
|
finally { if (e_3) throw e_3.error; }
|
|
1342
1279
|
}
|
|
1343
1280
|
}
|
|
1344
|
-
if (field.name === 'user-services') {
|
|
1345
|
-
this.startFilterSkillsByServices(form, field);
|
|
1346
|
-
}
|
|
1347
|
-
else if (field.name === 'user-skills') {
|
|
1348
|
-
if (isChecked) {
|
|
1349
|
-
/** @type {?} */
|
|
1350
|
-
var selectedIndex = field.options.findIndex((/**
|
|
1351
|
-
* @param {?} option
|
|
1352
|
-
* @return {?}
|
|
1353
|
-
*/
|
|
1354
|
-
function (option) { return Number(option.key) === Number(event.target.value); }));
|
|
1355
|
-
/** @type {?} */
|
|
1356
|
-
var selectedCheckbox = this.form.get('user-skills').value;
|
|
1357
|
-
selectedCheckbox[selectedIndex] = true;
|
|
1358
|
-
this.form.get('user-skills').setValue(selectedCheckbox);
|
|
1359
|
-
this.previousSelectedNestedCheckbox.push(event.target.value);
|
|
1360
|
-
}
|
|
1361
|
-
else {
|
|
1362
|
-
/** @type {?} */
|
|
1363
|
-
var index = this.previousSelectedNestedCheckbox.indexOf(event.target.value);
|
|
1364
|
-
if (index !== -1) {
|
|
1365
|
-
this.previousSelectedNestedCheckbox.splice(index, 1);
|
|
1366
|
-
}
|
|
1367
|
-
}
|
|
1368
|
-
}
|
|
1369
|
-
};
|
|
1370
|
-
/**
|
|
1371
|
-
* @private
|
|
1372
|
-
* @param {?} form
|
|
1373
|
-
* @param {?} field
|
|
1374
|
-
* @return {?}
|
|
1375
|
-
*/
|
|
1376
|
-
GenericFilterComponent.prototype.startFilterSkillsByServices = /**
|
|
1377
|
-
* @private
|
|
1378
|
-
* @param {?} form
|
|
1379
|
-
* @param {?} field
|
|
1380
|
-
* @return {?}
|
|
1381
|
-
*/
|
|
1382
|
-
function (form, field) {
|
|
1383
|
-
/** @type {?} */
|
|
1384
|
-
var servicesArray = [];
|
|
1385
|
-
form.value[field.name].map((/**
|
|
1386
|
-
* @param {?} service
|
|
1387
|
-
* @param {?} index
|
|
1388
|
-
* @return {?}
|
|
1389
|
-
*/
|
|
1390
|
-
function (service, index) {
|
|
1391
|
-
if (service) {
|
|
1392
|
-
servicesArray.push(field.options[index].key);
|
|
1393
|
-
}
|
|
1394
|
-
}));
|
|
1395
|
-
this.filterSkillsByServices(servicesArray, this.config);
|
|
1396
1281
|
};
|
|
1397
1282
|
/**
|
|
1398
1283
|
* @private
|
|
@@ -1500,14 +1385,14 @@ var GenericFilterComponent = /** @class */ (function () {
|
|
|
1500
1385
|
this.form.addControl('findPersonControl', findPersonControl);
|
|
1501
1386
|
}
|
|
1502
1387
|
var _loop_1 = function (field) {
|
|
1503
|
-
if (field.type === 'checkbox' || field.type === 'checkbox-large'
|
|
1388
|
+
if (field.type === 'checkbox' || field.type === 'checkbox-large') {
|
|
1504
1389
|
/** @type {?} */
|
|
1505
1390
|
var formArray = this_1.buildCheckBoxFormArray(field, settings);
|
|
1506
1391
|
this_1.form.addControl(field.name, formArray);
|
|
1507
1392
|
}
|
|
1508
|
-
else if (field.type === 'find-location'
|
|
1393
|
+
else if (field.type === 'find-location') {
|
|
1509
1394
|
/** @type {?} */
|
|
1510
|
-
var formArray = this_1.
|
|
1395
|
+
var formArray = this_1.buildFindLocationFormArray(field, settings);
|
|
1511
1396
|
this_1.form.addControl(field.name, formArray);
|
|
1512
1397
|
}
|
|
1513
1398
|
else {
|
|
@@ -1515,12 +1400,6 @@ var GenericFilterComponent = /** @class */ (function () {
|
|
|
1515
1400
|
var validators = [];
|
|
1516
1401
|
if (field.minSelected && field.minSelected > 0) {
|
|
1517
1402
|
validators.push(Validators.required);
|
|
1518
|
-
if (field.type === 'text-input') {
|
|
1519
|
-
validators.push(Validators.minLength(field.minSelected));
|
|
1520
|
-
}
|
|
1521
|
-
if (field.type === 'email-input') {
|
|
1522
|
-
validators.push(Validators.email);
|
|
1523
|
-
}
|
|
1524
1403
|
}
|
|
1525
1404
|
/** @type {?} */
|
|
1526
1405
|
var defaultValue = null;
|
|
@@ -1554,7 +1433,7 @@ var GenericFilterComponent = /** @class */ (function () {
|
|
|
1554
1433
|
});
|
|
1555
1434
|
this_1.form.addControl(field.name, formGroup);
|
|
1556
1435
|
}
|
|
1557
|
-
else
|
|
1436
|
+
else {
|
|
1558
1437
|
/** @type {?} */
|
|
1559
1438
|
var control = new FormControl(defaultValue, validators);
|
|
1560
1439
|
this_1.form.addControl(field.name, control);
|
|
@@ -1640,7 +1519,7 @@ var GenericFilterComponent = /** @class */ (function () {
|
|
|
1640
1519
|
* @param {?} settings
|
|
1641
1520
|
* @return {?}
|
|
1642
1521
|
*/
|
|
1643
|
-
GenericFilterComponent.prototype.
|
|
1522
|
+
GenericFilterComponent.prototype.buildFindLocationFormArray = /**
|
|
1644
1523
|
* @private
|
|
1645
1524
|
* @param {?} field
|
|
1646
1525
|
* @param {?} settings
|
|
@@ -1705,7 +1584,7 @@ var GenericFilterComponent = /** @class */ (function () {
|
|
|
1705
1584
|
* @return {?}
|
|
1706
1585
|
*/
|
|
1707
1586
|
function (f) { return f.name === name; }));
|
|
1708
|
-
if (field.type === 'find-location'
|
|
1587
|
+
if (field.type === 'find-location') {
|
|
1709
1588
|
return { value: values, name: name };
|
|
1710
1589
|
}
|
|
1711
1590
|
else {
|
|
@@ -1736,11 +1615,11 @@ var GenericFilterComponent = /** @class */ (function () {
|
|
|
1736
1615
|
var field = _c.value;
|
|
1737
1616
|
/** @type {?} */
|
|
1738
1617
|
var formGroup = form.get(field.name);
|
|
1739
|
-
if (formGroup && formGroup.errors &&
|
|
1618
|
+
if (formGroup && formGroup.errors && formGroup.errors.minLength) {
|
|
1740
1619
|
errors.push({ name: field.name, error: field.minSelectedError });
|
|
1741
1620
|
}
|
|
1742
|
-
if (formGroup && formGroup.errors && formGroup.errors.
|
|
1743
|
-
errors.push({ name: field.name, error: field.
|
|
1621
|
+
if (formGroup && formGroup.errors && formGroup.errors.maxLength) {
|
|
1622
|
+
errors.push({ name: field.name, error: field.minSelectedError });
|
|
1744
1623
|
}
|
|
1745
1624
|
}
|
|
1746
1625
|
}
|
|
@@ -1751,290 +1630,17 @@ var GenericFilterComponent = /** @class */ (function () {
|
|
|
1751
1630
|
}
|
|
1752
1631
|
finally { if (e_8) throw e_8.error; }
|
|
1753
1632
|
}
|
|
1754
|
-
// remove duplicates
|
|
1755
|
-
errors = errors.filter((/**
|
|
1756
|
-
* @param {?} filterError
|
|
1757
|
-
* @param {?} i
|
|
1758
|
-
* @param {?} arr
|
|
1759
|
-
* @return {?}
|
|
1760
|
-
*/
|
|
1761
|
-
function (filterError, i, arr) {
|
|
1762
|
-
return errors.indexOf(arr.find((/**
|
|
1763
|
-
* @param {?} item
|
|
1764
|
-
* @return {?}
|
|
1765
|
-
*/
|
|
1766
|
-
function (item) { return item.name === filterError.name; }))) === i;
|
|
1767
|
-
}));
|
|
1768
1633
|
if (errors.length) {
|
|
1769
1634
|
this.filterService.givenErrors.next(errors);
|
|
1770
1635
|
}
|
|
1771
1636
|
};
|
|
1772
|
-
/**
|
|
1773
|
-
* @return {?}
|
|
1774
|
-
*/
|
|
1775
|
-
GenericFilterComponent.prototype.initValuesFromCacheForSkillsByServices = /**
|
|
1776
|
-
* @return {?}
|
|
1777
|
-
*/
|
|
1778
|
-
function () {
|
|
1779
|
-
var _this = this;
|
|
1780
|
-
/** @type {?} */
|
|
1781
|
-
var cachedValues = this.filteredSkillsByServicesCheckbox.map((/**
|
|
1782
|
-
* @param {?} skill
|
|
1783
|
-
* @return {?}
|
|
1784
|
-
*/
|
|
1785
|
-
function (skill) {
|
|
1786
|
-
/** @type {?} */
|
|
1787
|
-
var selected = false;
|
|
1788
|
-
if (_this.settings && _this.settings.fields) {
|
|
1789
|
-
/** @type {?} */
|
|
1790
|
-
var isSelectedUserSkill = void 0;
|
|
1791
|
-
/** @type {?} */
|
|
1792
|
-
var selectedUserSkills = _this.settings.fields.find((/**
|
|
1793
|
-
* @param {?} setting
|
|
1794
|
-
* @return {?}
|
|
1795
|
-
*/
|
|
1796
|
-
function (setting) { return setting.name === 'user-skills'; }));
|
|
1797
|
-
if (selectedUserSkills && selectedUserSkills.value && selectedUserSkills.value.length > 0) {
|
|
1798
|
-
isSelectedUserSkill = selectedUserSkills.value.findIndex((/**
|
|
1799
|
-
* @param {?} val
|
|
1800
|
-
* @return {?}
|
|
1801
|
-
*/
|
|
1802
|
-
function (val) {
|
|
1803
|
-
return String(val) === String(skill.key);
|
|
1804
|
-
}));
|
|
1805
|
-
selected = isSelectedUserSkill !== -1;
|
|
1806
|
-
}
|
|
1807
|
-
}
|
|
1808
|
-
return selected;
|
|
1809
|
-
}));
|
|
1810
|
-
this.form.get('user-skills').setValue(cachedValues);
|
|
1811
|
-
};
|
|
1812
|
-
/**
|
|
1813
|
-
* @param {?} services
|
|
1814
|
-
* @param {?} config
|
|
1815
|
-
* @return {?}
|
|
1816
|
-
*/
|
|
1817
|
-
GenericFilterComponent.prototype.filterSkillsByServices = /**
|
|
1818
|
-
* @param {?} services
|
|
1819
|
-
* @param {?} config
|
|
1820
|
-
* @return {?}
|
|
1821
|
-
*/
|
|
1822
|
-
function (services, config) {
|
|
1823
|
-
var _this = this;
|
|
1824
|
-
this.filteredSkillsByServices = [];
|
|
1825
|
-
this.filteredSkillsByServicesCheckbox = [];
|
|
1826
|
-
/** @type {?} */
|
|
1827
|
-
var userSkillsSelectField = config.fields.find((/**
|
|
1828
|
-
* @param {?} f
|
|
1829
|
-
* @return {?}
|
|
1830
|
-
*/
|
|
1831
|
-
function (f) { return f.name === 'user-skills' && f.type === 'group-select'; }));
|
|
1832
|
-
/** @type {?} */
|
|
1833
|
-
var userSkillsCheckboxField = config.fields.find((/**
|
|
1834
|
-
* @param {?} f
|
|
1835
|
-
* @return {?}
|
|
1836
|
-
*/
|
|
1837
|
-
function (f) { return f.name === 'user-skills' && f.type === 'nested-checkbox'; }));
|
|
1838
|
-
if (userSkillsSelectField) {
|
|
1839
|
-
/** @type {?} */
|
|
1840
|
-
var userSkills_1 = userSkillsSelectField.groupOptions;
|
|
1841
|
-
if (!services || services.length === 0) {
|
|
1842
|
-
this.filteredSkillsByServices = userSkills_1;
|
|
1843
|
-
}
|
|
1844
|
-
else {
|
|
1845
|
-
services.forEach((/**
|
|
1846
|
-
* @param {?} s
|
|
1847
|
-
* @return {?}
|
|
1848
|
-
*/
|
|
1849
|
-
function (s) {
|
|
1850
|
-
/** @type {?} */
|
|
1851
|
-
var groupOption = userSkills_1.find((/**
|
|
1852
|
-
* @param {?} u
|
|
1853
|
-
* @return {?}
|
|
1854
|
-
*/
|
|
1855
|
-
function (u) { return u.group.toLowerCase() === s.toLowerCase(); }));
|
|
1856
|
-
if (groupOption) {
|
|
1857
|
-
_this.filteredSkillsByServices.push(groupOption);
|
|
1858
|
-
}
|
|
1859
|
-
}));
|
|
1860
|
-
}
|
|
1861
|
-
}
|
|
1862
|
-
else if (userSkillsCheckboxField) {
|
|
1863
|
-
/** @type {?} */
|
|
1864
|
-
var userSkills_2 = userSkillsCheckboxField.groupOptions;
|
|
1865
|
-
if (!services || services.length === 0) {
|
|
1866
|
-
this.filteredSkillsByServices = userSkills_2;
|
|
1867
|
-
}
|
|
1868
|
-
else {
|
|
1869
|
-
services.forEach((/**
|
|
1870
|
-
* @param {?} s
|
|
1871
|
-
* @return {?}
|
|
1872
|
-
*/
|
|
1873
|
-
function (s) {
|
|
1874
|
-
/** @type {?} */
|
|
1875
|
-
var groupOption = userSkills_2.find((/**
|
|
1876
|
-
* @param {?} u
|
|
1877
|
-
* @return {?}
|
|
1878
|
-
*/
|
|
1879
|
-
function (u) { return u.group.toLowerCase() === s.toLowerCase(); }));
|
|
1880
|
-
if (groupOption) {
|
|
1881
|
-
_this.filteredSkillsByServices.push(groupOption);
|
|
1882
|
-
}
|
|
1883
|
-
}));
|
|
1884
|
-
this.filteredSkillsByServicesCheckbox = this.filteredSkillsByServices.map((/**
|
|
1885
|
-
* @param {?} skill
|
|
1886
|
-
* @return {?}
|
|
1887
|
-
*/
|
|
1888
|
-
function (skill) {
|
|
1889
|
-
return skill.options;
|
|
1890
|
-
})).reduce((/**
|
|
1891
|
-
* @param {?} a
|
|
1892
|
-
* @param {?} b
|
|
1893
|
-
* @return {?}
|
|
1894
|
-
*/
|
|
1895
|
-
function (a, b) {
|
|
1896
|
-
return a.concat(b);
|
|
1897
|
-
}), []);
|
|
1898
|
-
userSkillsCheckboxField.options = [];
|
|
1899
|
-
userSkillsCheckboxField.options = this.filteredSkillsByServicesCheckbox;
|
|
1900
|
-
this.form.setControl('user-skills', new FormArray([]));
|
|
1901
|
-
this.filteredSkillsByServicesCheckbox.forEach((/**
|
|
1902
|
-
* @return {?}
|
|
1903
|
-
*/
|
|
1904
|
-
function () {
|
|
1905
|
-
((/** @type {?} */ (_this.form.get('user-skills')))).push(new FormControl(false));
|
|
1906
|
-
}));
|
|
1907
|
-
/** @type {?} */
|
|
1908
|
-
var prevValues = this.filteredSkillsByServicesCheckbox.map((/**
|
|
1909
|
-
* @param {?} skill
|
|
1910
|
-
* @return {?}
|
|
1911
|
-
*/
|
|
1912
|
-
function (skill) {
|
|
1913
|
-
/** @type {?} */
|
|
1914
|
-
var selected = false;
|
|
1915
|
-
if (_this.settings && _this.settings.fields) {
|
|
1916
|
-
if (_this.previousSelectedNestedCheckbox.length > 0) {
|
|
1917
|
-
selected = _this.previousSelectedNestedCheckbox.includes(skill.key);
|
|
1918
|
-
}
|
|
1919
|
-
/** @type {?} */
|
|
1920
|
-
var isSelectedUserSkill = void 0;
|
|
1921
|
-
/** @type {?} */
|
|
1922
|
-
var selectedUserSkills = _this.settings.fields.find((/**
|
|
1923
|
-
* @param {?} setting
|
|
1924
|
-
* @return {?}
|
|
1925
|
-
*/
|
|
1926
|
-
function (setting) { return setting.name === 'user-skills'; }));
|
|
1927
|
-
if (selectedUserSkills && selectedUserSkills.value && selectedUserSkills.value.length > 0) {
|
|
1928
|
-
isSelectedUserSkill = selectedUserSkills.value.findIndex((/**
|
|
1929
|
-
* @param {?} val
|
|
1930
|
-
* @return {?}
|
|
1931
|
-
*/
|
|
1932
|
-
function (val) { return Number(val) === Number(skill.key); }));
|
|
1933
|
-
selected = isSelectedUserSkill !== -1;
|
|
1934
|
-
}
|
|
1935
|
-
if (_this.previousSelectedNestedCheckbox.length > 0) {
|
|
1936
|
-
// Pick up from previous selected
|
|
1937
|
-
selected = _this.previousSelectedNestedCheckbox.includes(String(skill.key));
|
|
1938
|
-
}
|
|
1939
|
-
}
|
|
1940
|
-
return selected;
|
|
1941
|
-
}));
|
|
1942
|
-
this.form.get('user-skills').setValue(prevValues);
|
|
1943
|
-
return this.filteredSkillsByServicesCheckbox;
|
|
1944
|
-
}
|
|
1945
|
-
}
|
|
1946
|
-
this.filteredSkillsByServices = this.sortGroupOptions(this.filteredSkillsByServices);
|
|
1947
|
-
return this.filteredSkillsByServices;
|
|
1948
|
-
};
|
|
1949
|
-
/**
|
|
1950
|
-
* @private
|
|
1951
|
-
* @param {?} formValues
|
|
1952
|
-
* @param {?} field
|
|
1953
|
-
* @return {?}
|
|
1954
|
-
*/
|
|
1955
|
-
GenericFilterComponent.prototype.getSelectedValuesForFields = /**
|
|
1956
|
-
* @private
|
|
1957
|
-
* @param {?} formValues
|
|
1958
|
-
* @param {?} field
|
|
1959
|
-
* @return {?}
|
|
1960
|
-
*/
|
|
1961
|
-
function (formValues, field) {
|
|
1962
|
-
/** @type {?} */
|
|
1963
|
-
var selectedValues = [];
|
|
1964
|
-
Object.keys(formValues).map((/**
|
|
1965
|
-
* @param {?} name
|
|
1966
|
-
* @return {?}
|
|
1967
|
-
*/
|
|
1968
|
-
function (name) {
|
|
1969
|
-
/** @type {?} */
|
|
1970
|
-
var values = formValues[name].value;
|
|
1971
|
-
if (name === field.name) {
|
|
1972
|
-
values.forEach((/**
|
|
1973
|
-
* @param {?} v
|
|
1974
|
-
* @return {?}
|
|
1975
|
-
*/
|
|
1976
|
-
function (v) {
|
|
1977
|
-
selectedValues.push(v.key);
|
|
1978
|
-
}));
|
|
1979
|
-
}
|
|
1980
|
-
}));
|
|
1981
|
-
return selectedValues;
|
|
1982
|
-
};
|
|
1983
|
-
/**
|
|
1984
|
-
* @private
|
|
1985
|
-
* @param {?} groupOptions
|
|
1986
|
-
* @return {?}
|
|
1987
|
-
*/
|
|
1988
|
-
GenericFilterComponent.prototype.sortGroupOptions = /**
|
|
1989
|
-
* @private
|
|
1990
|
-
* @param {?} groupOptions
|
|
1991
|
-
* @return {?}
|
|
1992
|
-
*/
|
|
1993
|
-
function (groupOptions) {
|
|
1994
|
-
/** @type {?} */
|
|
1995
|
-
var sortedResults = [];
|
|
1996
|
-
/** @type {?} */
|
|
1997
|
-
var groups = groupOptions.map((/**
|
|
1998
|
-
* @param {?} go
|
|
1999
|
-
* @return {?}
|
|
2000
|
-
*/
|
|
2001
|
-
function (go) { return go.group; }));
|
|
2002
|
-
groups.sort().forEach((/**
|
|
2003
|
-
* @param {?} g
|
|
2004
|
-
* @return {?}
|
|
2005
|
-
*/
|
|
2006
|
-
function (g) {
|
|
2007
|
-
/** @type {?} */
|
|
2008
|
-
var options = groupOptions.find((/**
|
|
2009
|
-
* @param {?} go
|
|
2010
|
-
* @return {?}
|
|
2011
|
-
*/
|
|
2012
|
-
function (go) { return go.group === g; })).options;
|
|
2013
|
-
/** @type {?} */
|
|
2014
|
-
var sortedOptions = options.sort((/**
|
|
2015
|
-
* @param {?} a
|
|
2016
|
-
* @param {?} b
|
|
2017
|
-
* @return {?}
|
|
2018
|
-
*/
|
|
2019
|
-
function (a, b) {
|
|
2020
|
-
return a.label.toLowerCase() > b.label.toLowerCase() ? 1 : (b.label.toLowerCase() > a.label.toLowerCase() ? -1 : 0);
|
|
2021
|
-
}));
|
|
2022
|
-
/** @type {?} */
|
|
2023
|
-
var result = {
|
|
2024
|
-
group: g,
|
|
2025
|
-
options: sortedOptions
|
|
2026
|
-
};
|
|
2027
|
-
sortedResults.push(result);
|
|
2028
|
-
}));
|
|
2029
|
-
return sortedResults;
|
|
2030
|
-
};
|
|
2031
1637
|
GenericFilterComponent.decorators = [
|
|
2032
1638
|
{ type: Component, args: [{
|
|
2033
1639
|
selector: 'xuilib-generic-filter',
|
|
2034
|
-
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 elevated-break\">\n <ng-container [ngSwitch]=\"field.type\">\n <ng-container *ngSwitchCase=\"'group-title'\">\n <div [class]=\"field.titleClasses ? field.titleClasses: 'govuk-label govuk-label--m govuk-!-margin-bottom-4'\">\n {{ field.name | capitalize }}\n </div>\n </ng-container>\n <ng-container *ngSwitchDefault>\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?.required) || form.get(field.name).errors?.maxlength || form.get(field.name).errors?.email)}\">\n <div *ngIf=\"field.title\" class=\"xui-generic-filter__field-title\">\n <h3 [class]=\"field.titleClasses ? field.titleClasses : 'govuk-heading-s'\" style=\"margin-bottom: 0!important\">\n {{field.title | capitalize}}\n </h3>\n <div *ngIf=\"field?.titleHint\" class=\"govuk-!-margin-left-2\">\n {{ field.titleHint }}\n </div>\n </div>\n <p class=\"govuk-body\" *ngIf=\"field.subTitle\">{{field.subTitle}}</p>\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\"\n *ngIf=\"field.displayMinSelectedError && submitted && (form.get(field.name).errors?.minlength || form.get(field.name).errors?.required)\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.minSelectedError}}\n </span>\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\"\n *ngIf=\"field.displayMaxSelectedError && submitted && form.get(field.name).errors?.maxlength\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.maxSelectedError}}\n </span>\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\"\n *ngIf=\"field.emailError && submitted && form.get(field.name).errors?.email\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.emailError}}\n </span>\n <div class=\"govuk-body\" [class.govuk-body--maxWidth480px]=\"field.maxWidth480px\" [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 *ngIf=\"field.defaultOption\" [attr.selected]=\"true\" [value]=\"field.defaultOption.key\">{{field.defaultOption.label}}</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=\"'group-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 *ngIf=\"field.defaultOption\" selected [value]=\"field.defaultOption.key\">{{field.defaultOption.label}}</option>\n <optgroup *ngFor = 'let grp of filteredSkillsByServices' label=\"{{grp.group | titlecase}}\">\n <option *ngFor = 'let item of grp.options' [value]=\"item.key\">{{item.label}}</option>\n </optgroup>\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=\"'nested-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 filteredSkillsByServicesCheckbox; 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 [placeholderContent]=\"field.placeholderContent ? field.placeholderContent : ''\"\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-task-name'\">\n <xuilib-find-task-name subTitle=\"\" (taskNameSelected)=\"updateTaskNameControls($event, field)\"\n (taskNameFieldChanged)=\"inputChanged(field)\"\n [submitted]=\"submitted\"\n [disabled]=\"disabled(field, form)\"\n [domain]=\"form.get(field.domainField)?.value\"\n [findTaskNameGroup]=\"form\"\n [selectedTaskName]=\"form.get(field.name).value.taskName\"\n [userIncluded]=\"false\"\n ></xuilib-find-task-name>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-service'\">\n <xuilib-find-service (serviceFieldChanged)=\"inputChanged(field)\"\n [form]=\"form\"\n [enableAddServiceButton]=\"field.enableAddButton\"\n [disabled]=\"disabled(field, form)\"\n [selectedServices]=\"form.get(field.name)?.value\"\n [services]=\"field.options\"\n [field]=\"field\"\n ></xuilib-find-service>\n </ng-container>\n <ng-container *ngSwitchCase=\"'text-input'\">\n <input class=\"govuk-input\" type=\"text\"\n [formControlName]=\"field.name\"\n [id]=\"field.name\"\n [attr.disabled]=\"disabled(field, form)\"\n (change)=\"fieldChanged(field, form)\"\n [attr.maxlength]=\"field.maxlength ? field.maxlength : null\"\n />\n </ng-container>\n <ng-container *ngSwitchCase=\"'email-input'\">\n <input class=\"govuk-input\" type=\"email\"\n [formControlName]=\"field.name\"\n [id]=\"field.name\"\n [attr.disabled]=\"disabled(field, form)\"\n (change)=\"fieldChanged(field, form)\"\n />\n </ng-container>\n </div>\n </div>\n </ng-container>\n </ng-container>\n </div>\n <hr class=\"govuk-section-break govuk-section-break--m\"/>\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",
|
|
1640
|
+
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 [placeholderContent]=\"field.placeholderContent ? field.placeholderContent : ''\"\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 [field]=\"field\"\n [services]=\"form.get(field.findLocationField)?.value\"\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 [field]=\"field\"\n [selectedServices]=\"form.get(field.name)?.value\" \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",
|
|
2035
1641
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2036
1642
|
encapsulation: ViewEncapsulation.None,
|
|
2037
|
-
styles: [".contain-classes .elevated-break{
|
|
1643
|
+
styles: [".contain-classes .elevated-break{position:relative;top:-10px}.contain-classes .xui-generic-filter .select-all{margin-bottom:10px}.contain-classes .xui-generic-filter .govuk-checkboxes{display:flex;flex-wrap:wrap}.contain-classes .xui-generic-filter .govuk-checkboxes>div{flex-grow:1;flex-shrink:0}"]
|
|
2038
1644
|
}] }
|
|
2039
1645
|
];
|
|
2040
1646
|
/** @nocollapse */
|
|
@@ -2293,29 +1899,52 @@ var CaseSharingStateService = /** @class */ (function () {
|
|
|
2293
1899
|
return newSharedCases;
|
|
2294
1900
|
};
|
|
2295
1901
|
/**
|
|
2296
|
-
* @param {?} caseId
|
|
2297
1902
|
* @param {?} user
|
|
1903
|
+
* @param {?=} caseId
|
|
2298
1904
|
* @return {?}
|
|
2299
1905
|
*/
|
|
2300
1906
|
CaseSharingStateService.prototype.requestUnshare = /**
|
|
2301
|
-
* @param {?} caseId
|
|
2302
1907
|
* @param {?} user
|
|
1908
|
+
* @param {?=} caseId
|
|
2303
1909
|
* @return {?}
|
|
2304
1910
|
*/
|
|
2305
|
-
function (
|
|
1911
|
+
function (user, caseId) {
|
|
2306
1912
|
var e_2, _a;
|
|
2307
1913
|
/** @type {?} */
|
|
2308
1914
|
var newSharedCases = [];
|
|
2309
1915
|
try {
|
|
2310
1916
|
for (var _b = __values(this.caseState), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2311
1917
|
var sharedCase = _c.value;
|
|
2312
|
-
|
|
1918
|
+
// If no caseId, then request unshare from all shared cases
|
|
1919
|
+
if (caseId === undefined || sharedCase.caseId === caseId) {
|
|
2313
1920
|
if (!sharedCase.pendingUnshares) {
|
|
2314
1921
|
sharedCase.pendingUnshares = [];
|
|
2315
1922
|
}
|
|
2316
1923
|
/** @type {?} */
|
|
2317
1924
|
var newPendingUnshares = sharedCase.pendingUnshares.slice();
|
|
2318
|
-
|
|
1925
|
+
// If the user is pending shared access, just remove them from pendingShares
|
|
1926
|
+
/** @type {?} */
|
|
1927
|
+
var newPendingShares = void 0;
|
|
1928
|
+
/** @type {?} */
|
|
1929
|
+
var indexOfPreviouslyAddedUser = -1;
|
|
1930
|
+
if (sharedCase.pendingShares) {
|
|
1931
|
+
indexOfPreviouslyAddedUser = sharedCase.pendingShares.findIndex((/**
|
|
1932
|
+
* @param {?} u
|
|
1933
|
+
* @return {?}
|
|
1934
|
+
*/
|
|
1935
|
+
function (u) { return u.idamId === user.idamId; }));
|
|
1936
|
+
if (indexOfPreviouslyAddedUser > -1) {
|
|
1937
|
+
newPendingShares = sharedCase.pendingShares.slice();
|
|
1938
|
+
newPendingShares.splice(indexOfPreviouslyAddedUser, 1);
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
// If the user does not exist in pendingShares, and already has shared access (i.e. exists in sharedWith),
|
|
1942
|
+
// request removal of shared access
|
|
1943
|
+
if (indexOfPreviouslyAddedUser === -1 && sharedCase.sharedWith && sharedCase.sharedWith.findIndex((/**
|
|
1944
|
+
* @param {?} u
|
|
1945
|
+
* @return {?}
|
|
1946
|
+
*/
|
|
1947
|
+
function (u) { return u.idamId === user.idamId; })) > -1) {
|
|
2319
1948
|
if (!newPendingUnshares.some((/**
|
|
2320
1949
|
* @param {?} u
|
|
2321
1950
|
* @return {?}
|
|
@@ -2324,11 +1953,10 @@ var CaseSharingStateService = /** @class */ (function () {
|
|
|
2324
1953
|
newPendingUnshares.push(user);
|
|
2325
1954
|
}
|
|
2326
1955
|
}
|
|
2327
|
-
else {
|
|
2328
|
-
newPendingUnshares.push(user);
|
|
2329
|
-
}
|
|
2330
1956
|
/** @type {?} */
|
|
2331
|
-
var newSharedCase = __assign({}, sharedCase, { pendingUnshares: newPendingUnshares }
|
|
1957
|
+
var newSharedCase = __assign({}, sharedCase, { pendingUnshares: newPendingUnshares }, (newPendingShares && {
|
|
1958
|
+
pendingShares: newPendingShares
|
|
1959
|
+
}));
|
|
2332
1960
|
newSharedCases.push(newSharedCase);
|
|
2333
1961
|
}
|
|
2334
1962
|
else {
|
|
@@ -2344,7 +1972,7 @@ var CaseSharingStateService = /** @class */ (function () {
|
|
|
2344
1972
|
finally { if (e_2) throw e_2.error; }
|
|
2345
1973
|
}
|
|
2346
1974
|
this.subject.next(newSharedCases);
|
|
2347
|
-
return;
|
|
1975
|
+
return newSharedCases;
|
|
2348
1976
|
};
|
|
2349
1977
|
/**
|
|
2350
1978
|
* @param {?} caseId
|
|
@@ -2414,11 +2042,13 @@ var CaseSharingStateService = /** @class */ (function () {
|
|
|
2414
2042
|
* @return {?}
|
|
2415
2043
|
*/
|
|
2416
2044
|
function (caseId) {
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
this.caseState.
|
|
2420
|
-
|
|
2421
|
-
|
|
2045
|
+
if (this.caseState.length > 1) {
|
|
2046
|
+
for (var i = 0, l = this.caseState.length; i < l; i++) {
|
|
2047
|
+
if (this.caseState[i].caseId === caseId) {
|
|
2048
|
+
this.caseState.splice(i, 1);
|
|
2049
|
+
this.subject.next(this.caseState);
|
|
2050
|
+
return;
|
|
2051
|
+
}
|
|
2422
2052
|
}
|
|
2423
2053
|
}
|
|
2424
2054
|
};
|
|
@@ -2505,7 +2135,7 @@ var SelectedCaseConfirmComponent = /** @class */ (function () {
|
|
|
2505
2135
|
SelectedCaseConfirmComponent.decorators = [
|
|
2506
2136
|
{ type: Component, args: [{
|
|
2507
2137
|
selector: 'xuilib-selected-case-confirm',
|
|
2508
|
-
template: "<div id=\"user-access-block-{{ sharedCase.caseId }}\" *ngIf=\"showUserAccessBlock()\">\n <h2 class=\"govuk-heading-m case-share-confirm__title\">{{ sharedCase.caseTitle }}</h2>\n <div class=\"case-share-confirm__caption-area\">\n <div class=\"govuk-caption-m case-share-confirm__caption\">\n {{ sharedCase.caseId }}\n </div>\n <a [routerLink]=\"changeLink\" class=\"case-share-confirm__change-link govuk-link govuk-!-font-size-19\">Change</a>\n </div>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th class=\"govuk-table__header govuk-table-column-header\" scope=\"col\">Name</th>\n <th class=\"govuk-table__header govuk-table-column-header\" scope=\"col\">Email address</th>\n <th class=\"govuk-table__header govuk-table-column-actions\" scope=\"col\">Actions</th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\" *ngFor=\"let user of sharedCase.pendingShares; trackBy: trackByUserId\">\n <td class=\"govuk-table__cell\">{{ user.firstName + ' ' + user.lastName }}</td>\n <td class=\"govuk-table__cell\">{{ user.email }}</td>\n <td class=\"govuk-table__cell\">\n <span class=\"hmcts-badge\">To be added</span>\n </td>\n </tr>\n <tr class=\"govuk-table__row\" *ngFor=\"let user of sharedCase.pendingUnshares; trackBy: trackByUserId\">\n <td class=\"govuk-table__cell\">{{ user.firstName + ' ' + user.lastName }}</td>\n <td class=\"govuk-table__cell\">{{ user.email }}</td>\n <td class=\"govuk-table__cell\">\n <span class=\"hmcts-badge hmcts-badge--red\">
|
|
2138
|
+
template: "<div id=\"user-access-block-{{ sharedCase.caseId }}\" *ngIf=\"showUserAccessBlock()\">\n <h2 class=\"govuk-heading-m case-share-confirm__title\">{{ sharedCase.caseTitle }}</h2>\n <div class=\"case-share-confirm__caption-area\">\n <div class=\"govuk-caption-m case-share-confirm__caption\">\n {{ sharedCase.caseId }}\n </div>\n <a [routerLink]=\"changeLink\" class=\"case-share-confirm__change-link govuk-link govuk-!-font-size-19\">Change</a>\n </div>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th class=\"govuk-table__header govuk-table-column-header\" scope=\"col\">Name</th>\n <th class=\"govuk-table__header govuk-table-column-header\" scope=\"col\">Email address</th>\n <th class=\"govuk-table__header govuk-table-column-actions\" scope=\"col\">Actions</th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\" *ngFor=\"let user of sharedCase.pendingShares; trackBy: trackByUserId\">\n <td class=\"govuk-table__cell\">{{ user.firstName + ' ' + user.lastName }}</td>\n <td class=\"govuk-table__cell\">{{ user.email }}</td>\n <td class=\"govuk-table__cell\">\n <span class=\"hmcts-badge\">To be added</span>\n </td>\n </tr>\n <tr class=\"govuk-table__row\" *ngFor=\"let user of sharedCase.pendingUnshares; trackBy: trackByUserId\">\n <td class=\"govuk-table__cell\">{{ user.firstName + ' ' + user.lastName }}</td>\n <td class=\"govuk-table__cell\">{{ user.email }}</td>\n <td class=\"govuk-table__cell\">\n <span class=\"hmcts-badge hmcts-badge--red\">To be removed</span>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n",
|
|
2509
2139
|
styles: [".case-share-confirm__title{margin-bottom:0}.case-share-confirm__caption-area{border-bottom:1px solid #b1b4b6;padding-bottom:10px;display:inline-block;width:100%;clear:both}.case-share-confirm__caption{float:left}.case-share-confirm__change-link{float:right}.govuk-table-column-header{width:45%}.govuk-table-column-actions{width:10%}"]
|
|
2510
2140
|
}] }
|
|
2511
2141
|
];
|
|
@@ -2652,15 +2282,6 @@ var SelectedCaseComponent = /** @class */ (function () {
|
|
|
2652
2282
|
this.combinedSortedShares = this.combineAndSortShares(sharedWith, pendingShares);
|
|
2653
2283
|
}
|
|
2654
2284
|
};
|
|
2655
|
-
/**
|
|
2656
|
-
* @return {?}
|
|
2657
|
-
*/
|
|
2658
|
-
SelectedCaseComponent.prototype.onUnselect = /**
|
|
2659
|
-
* @return {?}
|
|
2660
|
-
*/
|
|
2661
|
-
function () {
|
|
2662
|
-
this.unselect.emit(this.sharedCase);
|
|
2663
|
-
};
|
|
2664
2285
|
/**
|
|
2665
2286
|
* @param {?} c
|
|
2666
2287
|
* @return {?}
|
|
@@ -2869,7 +2490,7 @@ var SelectedCaseComponent = /** @class */ (function () {
|
|
|
2869
2490
|
* @return {?}
|
|
2870
2491
|
*/
|
|
2871
2492
|
function (user, sharedCase) {
|
|
2872
|
-
this.stateService.requestUnshare(sharedCase.caseId
|
|
2493
|
+
this.stateService.requestUnshare(user, sharedCase.caseId);
|
|
2873
2494
|
this.synchronizeStore.emit(this.shareCases);
|
|
2874
2495
|
};
|
|
2875
2496
|
/**
|
|
@@ -2989,8 +2610,8 @@ var SelectedCaseComponent = /** @class */ (function () {
|
|
|
2989
2610
|
SelectedCaseComponent.decorators = [
|
|
2990
2611
|
{ type: Component, args: [{
|
|
2991
2612
|
selector: 'xuilib-selected-case',
|
|
2992
|
-
template: "<div id=\"{{buildElementId('govuk-accordion__section')}}\" class=\"govuk-accordion__section\">\n <div class=\"govuk-grid-row govuk-case-header\">\n <div class=\"govuk-grid-column-three-quarters\">\n <h3 id=\"{{buildElementId('case-title')}}\" class=\"govuk-case-title\">{{ sharedCase.caseTitle }}</h3>\n <h1 id=\"{{buildElementId('case-id')}}\" class=\"govuk-case-sub-title\">{{ sharedCase.caseId }}</h1>\n </div>\n <div class=\"govuk-grid-column-twenty-percent\">\n <button *ngIf=\"caseCount > 1\"\n id=\"{{buildElementId('btn-deselect-case')}}\" \n class=\"govuk-button hmcts-button--secondary\" \n (click)=\"onDeselect(sharedCase)\" \n title=\"Deselect case\">Deselect case\n </button>\n </div>\n <div class=\"govuk-accordion__section-header govuk-grid-column-five-percent\">\n <div class=\"govuk-accordion__section-heading\">\n <button type=\"button\" id=\"{{buildElementId('accordion-with-summary-sections-heading')}}\"\n aria-controls=\"accordion-with-summary-sections-content-1\" class=\"govuk-accordion__section-button\"\n aria-describedby=\"accordion-with-summary-sections-summary-1\" aria-expanded=\"false\" title=\"Expand or Collapse\">\n <span class=\"govuk-accordion__icon\" aria-hidden=\"true\"></span></button>\n </div>\n </div>\n </div>\n <div id=\"{{buildElementId('accordion-with-summary-sections-content')}}\" class=\"govuk-accordion__section-content\"\n aria-labelledby=\"buildElementId('accordion-with-summary-sections-heading')\" >\n <div class=\"govuk-grid-row\" *ngIf=\"showNoUsersAccessInfo()\">\n <span id=\"{{buildElementId('access-info-no-user')}}\" class=\"govuk-div-align-left\">No users from your organisation currently have access to this case.</span>\n </div>\n <div class=\"govuk-grid-row\" *ngIf=\"showUserHasAccessInfo()\">\n <span id=\"{{buildElementId('access-info-has-users')}}\" class=\"govuk-div-align-left\">Users from your organisation with access to this case.</span>\n </div>\n <table class=\"govuk-table\" *ngIf=\"showUserAccessTable()\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th id=\"{{buildElementId('name-heading')}}\" class=\"govuk-table__header govuk-table-column-header\" scope=\"col\">Name</th>\n <th id=\"{{buildElementId('email-heading')}}\" class=\"govuk-table__header govuk-table-column-header\" scope=\"col\">Email address</th>\n <th id=\"{{buildElementId('action-heading')}}\" class=\"govuk-table__header govuk-table-column-actions\" scope=\"col\">Actions</th>\n <th id=\"{{buildElementId('label-heading')}}\" class=\"govuk-table__header govuk-table-column-label\" scope=\"col\"
|
|
2993
|
-
styles: [".govuk-case-header{border-top:1px solid #bfc1c3}.govuk-case-title{font-family:nta,Arial,sans-serif;font-size:24px;color:#005ea5;font-weight:700;padding-left:0}.govuk-case-sub-title{font-family:nta,Arial,sans-serif;font-size:1rem!important;color:#6f777b;font-weight:400;padding-left:0}.govuk-grid-row{margin-left:0;margin-right:0}.govuk-grid-column-three-quarters{padding-top:5px;padding-left:0}.govuk-grid-column-twenty-percent{box-sizing:border-box;padding-top:10px;width:20%;float:left}.govuk-grid-column-five-percent{box-sizing:border-box;padding-top:15px;width:5%;float:left}.govuk-table-column-header{width:
|
|
2613
|
+
template: "<div id=\"{{buildElementId('govuk-accordion__section')}}\" class=\"govuk-accordion__section\">\n <div class=\"govuk-grid-row govuk-case-header\">\n <div class=\"govuk-grid-column-three-quarters\">\n <h3 id=\"{{buildElementId('case-title')}}\" class=\"govuk-case-title\">{{ sharedCase.caseTitle }}</h3>\n <h1 id=\"{{buildElementId('case-id')}}\" class=\"govuk-case-sub-title\">{{ sharedCase.caseId }}</h1>\n </div>\n <div class=\"govuk-grid-column-twenty-percent\">\n <button *ngIf=\"caseCount > 1\"\n id=\"{{buildElementId('btn-deselect-case')}}\" \n class=\"govuk-button hmcts-button--secondary\" \n (click)=\"onDeselect(sharedCase)\" \n title=\"Deselect case\">Deselect case\n </button>\n </div>\n <div class=\"govuk-accordion__section-header govuk-grid-column-five-percent\">\n <div class=\"govuk-accordion__section-heading\">\n <button type=\"button\" id=\"{{buildElementId('accordion-with-summary-sections-heading')}}\"\n aria-controls=\"accordion-with-summary-sections-content-1\" class=\"govuk-accordion__section-button\"\n aria-describedby=\"accordion-with-summary-sections-summary-1\" aria-expanded=\"false\" title=\"Expand or Collapse\">\n <span class=\"govuk-accordion__icon\" aria-hidden=\"true\"></span></button>\n </div>\n </div>\n </div>\n <div id=\"{{buildElementId('accordion-with-summary-sections-content')}}\" class=\"govuk-accordion__section-content\"\n aria-labelledby=\"buildElementId('accordion-with-summary-sections-heading')\" >\n <div class=\"govuk-grid-row\" *ngIf=\"showNoUsersAccessInfo()\">\n <span id=\"{{buildElementId('access-info-no-user')}}\" class=\"govuk-div-align-left\">No users from your organisation currently have access to this case.</span>\n </div>\n <div class=\"govuk-grid-row\" *ngIf=\"showUserHasAccessInfo()\">\n <span id=\"{{buildElementId('access-info-has-users')}}\" class=\"govuk-div-align-left\">Users from your organisation with access to this case.</span>\n </div>\n <table class=\"govuk-table\" *ngIf=\"showUserAccessTable()\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th id=\"{{buildElementId('name-heading')}}\" class=\"govuk-table__header govuk-table-column-header\" scope=\"col\">Name</th>\n <th id=\"{{buildElementId('email-heading')}}\" class=\"govuk-table__header govuk-table-column-header\" scope=\"col\">Email address</th>\n <th id=\"{{buildElementId('action-heading')}}\" class=\"govuk-table__header govuk-table-column-actions\" scope=\"col\">Actions</th>\n <th id=\"{{buildElementId('label-heading')}}\" class=\"govuk-table__header govuk-table-column-label\" scope=\"col\">Status</th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\" *ngFor=\"let user of combinedSortedShares; index as idx; trackBy: trackByUserId\">\n <td id=\"user-full-name-{{ userIdSetter(canCancel(sharedCase.caseId, user) | async, idx) }}\" class=\"govuk-table__cell\">{{ user.firstName + ' ' + user.lastName }}</td>\n <td id=\"user-email-{{ userIdSetter(canCancel(sharedCase.caseId, user) | async, idx) }}\" class=\"govuk-table__cell\">{{ user.email }}</td>\n <td class=\"govuk-table__cell\">\n <a *ngIf=\"canRemove(sharedCase.caseId, user) | async\" (click)=\"onRemove(user, sharedCase)\" href=\"javascript:void(0);\">Remove <span class=\"govuk-visually-hidden\">{{ user.firstName + ' ' + user.lastName }} from case</span></a>\n <a *ngIf=\"canCancel(sharedCase.caseId, user) | async\" (click)=\"onCancel(user, sharedCase)\" href=\"javascript:void(0);\">Cancel <span class=\"govuk-visually-hidden\">adding {{ user.firstName + ' ' + user.lastName }} to case</span></a>\n </td>\n <td class=\"govuk-table__cell\">\n <span *ngIf=\"isToBeRemoved(sharedCase.caseId, user) | async\" class=\"hmcts-badge hmcts-badge--red\">To be removed</span>\n <span *ngIf=\"isToBeAdded(sharedCase.caseId, user) | async\" class=\"hmcts-badge\">To be added</span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n</div>\n",
|
|
2614
|
+
styles: [".govuk-case-header{border-top:1px solid #bfc1c3}.govuk-case-title{font-family:nta,Arial,sans-serif;font-size:24px;color:#005ea5;font-weight:700;padding-left:0}.govuk-case-sub-title{font-family:nta,Arial,sans-serif;font-size:1rem!important;color:#6f777b;font-weight:400;padding-left:0}.govuk-grid-row{margin-left:0;margin-right:0}.govuk-grid-column-three-quarters{padding-top:5px;padding-left:0}.govuk-grid-column-twenty-percent{box-sizing:border-box;padding-top:10px;width:20%;float:left}.govuk-grid-column-five-percent{box-sizing:border-box;padding-top:15px;width:5%;float:left}.govuk-table-column-header{width:38%}.govuk-table-column-actions,.govuk-table-column-label{width:12%}.govuk-div-align-left{font-family:nta,Arial,sans-serif;font-size:1.1875rem!important;line-height:1.31579!important;text-align:left;margin-bottom:20px;padding-left:0;color:#0b0c0c}.govuk-accordion__section-header{border-top:0}.govuk-accordion__section-content{padding-top:0}"]
|
|
2994
2615
|
}] }
|
|
2995
2616
|
];
|
|
2996
2617
|
/** @nocollapse */
|
|
@@ -3279,6 +2900,18 @@ var ShareCaseConfirmComponent = /** @class */ (function () {
|
|
|
3279
2900
|
return ShareCaseConfirmComponent;
|
|
3280
2901
|
}());
|
|
3281
2902
|
|
|
2903
|
+
/**
|
|
2904
|
+
* @fileoverview added by tsickle
|
|
2905
|
+
* Generated from: lib/models/case-share.model.ts
|
|
2906
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2907
|
+
*/
|
|
2908
|
+
/** @enum {string} */
|
|
2909
|
+
var SharedCaseErrorMessages = {
|
|
2910
|
+
OneCaseMustBeSelected: "At least one case must be selected",
|
|
2911
|
+
NoChangesRequested: "You have not requested any changes to case sharing",
|
|
2912
|
+
OnePersonMustBeAssigned: "At least one person must be assigned to each case",
|
|
2913
|
+
};
|
|
2914
|
+
|
|
3282
2915
|
/**
|
|
3283
2916
|
* @fileoverview added by tsickle
|
|
3284
2917
|
* Generated from: lib/components/user-select/user-select.component.ts
|
|
@@ -3402,17 +3035,23 @@ var UserSelectComponent = /** @class */ (function () {
|
|
|
3402
3035
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3403
3036
|
*/
|
|
3404
3037
|
var ShareCaseComponent = /** @class */ (function () {
|
|
3405
|
-
function ShareCaseComponent(stateService) {
|
|
3038
|
+
function ShareCaseComponent(stateService, router) {
|
|
3406
3039
|
this.stateService = stateService;
|
|
3040
|
+
this.router = router;
|
|
3407
3041
|
this.shareCases = []; // cases selected for sharing
|
|
3408
|
-
|
|
3042
|
+
this.continueAllowed = false;
|
|
3043
|
+
this.selectedUserToRemove = null;
|
|
3409
3044
|
this.removeUserFromCaseToggleOn = false;
|
|
3410
3045
|
this.users = []; // users of this organisation the cases can be shared with
|
|
3411
3046
|
// users of this organisation the cases can be shared with
|
|
3412
3047
|
this.confirmLink = '';
|
|
3048
|
+
this.cancelLink = '';
|
|
3413
3049
|
this.showRemoveUsers = false;
|
|
3050
|
+
this.fnTitle = '';
|
|
3051
|
+
this.title = '';
|
|
3414
3052
|
this.unselect = new EventEmitter();
|
|
3415
3053
|
this.synchronizeStore = new EventEmitter();
|
|
3054
|
+
this.validationErrors = [];
|
|
3416
3055
|
}
|
|
3417
3056
|
/**
|
|
3418
3057
|
* @return {?}
|
|
@@ -3422,15 +3061,36 @@ var ShareCaseComponent = /** @class */ (function () {
|
|
|
3422
3061
|
*/
|
|
3423
3062
|
function () {
|
|
3424
3063
|
var _this = this;
|
|
3425
|
-
this.shareCases
|
|
3064
|
+
this.shareCases$
|
|
3065
|
+
.pipe(tap((/**
|
|
3066
|
+
* @param {?} sharedCases
|
|
3067
|
+
* @return {?}
|
|
3068
|
+
*/
|
|
3069
|
+
function (sharedCases) {
|
|
3070
|
+
// Update the list of users assigned to at least one case
|
|
3071
|
+
_this.getAssignedUsers(sharedCases.filter((/**
|
|
3072
|
+
* @param {?} sharedCase
|
|
3073
|
+
* @return {?}
|
|
3074
|
+
*/
|
|
3075
|
+
function (sharedCase) { return sharedCase.sharedWith && sharedCase.sharedWith.length > 0; })));
|
|
3076
|
+
})))
|
|
3077
|
+
.subscribe((/**
|
|
3426
3078
|
* @param {?} shareCases
|
|
3427
3079
|
* @return {?}
|
|
3428
3080
|
*/
|
|
3429
3081
|
function (shareCases) {
|
|
3430
3082
|
_this.shareCases = shareCases;
|
|
3431
3083
|
_this.stateService.setCases(shareCases);
|
|
3084
|
+
// Set the config to be used by the xuilib-gov-uk-error-message component, in particular the element ID to
|
|
3085
|
+
// which the error message is associated
|
|
3086
|
+
if (shareCases) {
|
|
3087
|
+
_this.selectedCasesErrorMessageConfig = {
|
|
3088
|
+
id: shareCases.length > 0 ? 'cases' : 'noCaseDisplay'
|
|
3089
|
+
};
|
|
3090
|
+
}
|
|
3432
3091
|
}));
|
|
3433
3092
|
this.shareCases$ = this.stateService.state;
|
|
3093
|
+
this.shareCaseErrorMessage = { isInvalid: false, messages: [] };
|
|
3434
3094
|
};
|
|
3435
3095
|
/**
|
|
3436
3096
|
* @param {?} c
|
|
@@ -3441,8 +3101,16 @@ var ShareCaseComponent = /** @class */ (function () {
|
|
|
3441
3101
|
* @return {?}
|
|
3442
3102
|
*/
|
|
3443
3103
|
function (c) {
|
|
3444
|
-
this.
|
|
3445
|
-
this.stateService.
|
|
3104
|
+
this.validationErrors = [];
|
|
3105
|
+
if (this.stateService.getCases().length === 1) {
|
|
3106
|
+
this.validationErrors.push({ id: 'cases', message: SharedCaseErrorMessages.OneCaseMustBeSelected });
|
|
3107
|
+
this.shareCaseErrorMessage = { isInvalid: true, messages: [SharedCaseErrorMessages.OneCaseMustBeSelected] };
|
|
3108
|
+
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
|
|
3109
|
+
}
|
|
3110
|
+
else {
|
|
3111
|
+
this.unselect.emit(c);
|
|
3112
|
+
this.stateService.removeCase(c.caseId);
|
|
3113
|
+
}
|
|
3446
3114
|
};
|
|
3447
3115
|
/**
|
|
3448
3116
|
* @param {?} event
|
|
@@ -3480,6 +3148,21 @@ var ShareCaseComponent = /** @class */ (function () {
|
|
|
3480
3148
|
this.userSelect.clear();
|
|
3481
3149
|
}
|
|
3482
3150
|
this.synchronizeStore.emit(newSharedCases);
|
|
3151
|
+
// Update the list of assigned users (which includes pending users)
|
|
3152
|
+
this.getAssignedUsers(newSharedCases);
|
|
3153
|
+
};
|
|
3154
|
+
/**
|
|
3155
|
+
* @return {?}
|
|
3156
|
+
*/
|
|
3157
|
+
ShareCaseComponent.prototype.removeUser = /**
|
|
3158
|
+
* @return {?}
|
|
3159
|
+
*/
|
|
3160
|
+
function () {
|
|
3161
|
+
if (this.selectedUserToRemove) {
|
|
3162
|
+
/** @type {?} */
|
|
3163
|
+
var newSharedCases = this.stateService.requestUnshare(this.selectedUserToRemove);
|
|
3164
|
+
this.synchronizeStore.emit(newSharedCases);
|
|
3165
|
+
}
|
|
3483
3166
|
};
|
|
3484
3167
|
/**
|
|
3485
3168
|
* @return {?}
|
|
@@ -3491,14 +3174,25 @@ var ShareCaseComponent = /** @class */ (function () {
|
|
|
3491
3174
|
return this.selectedUser === null || this.shareCases.length === 0;
|
|
3492
3175
|
};
|
|
3493
3176
|
/**
|
|
3177
|
+
* Function originally used to set disabled state of "Continue" button, now called by the button click handler to
|
|
3178
|
+
* control whether navigation to the confirmation page is allowed. It is prevented if no changes have been made
|
|
3179
|
+
*/
|
|
3180
|
+
/**
|
|
3181
|
+
* Function originally used to set disabled state of "Continue" button, now called by the button click handler to
|
|
3182
|
+
* control whether navigation to the confirmation page is allowed. It is prevented if no changes have been made
|
|
3494
3183
|
* @return {?}
|
|
3495
3184
|
*/
|
|
3496
|
-
ShareCaseComponent.prototype.
|
|
3185
|
+
ShareCaseComponent.prototype.setContinueAllowed = /**
|
|
3186
|
+
* Function originally used to set disabled state of "Continue" button, now called by the button click handler to
|
|
3187
|
+
* control whether navigation to the confirmation page is allowed. It is prevented if no changes have been made
|
|
3497
3188
|
* @return {?}
|
|
3498
3189
|
*/
|
|
3499
3190
|
function () {
|
|
3500
|
-
|
|
3501
|
-
|
|
3191
|
+
var _this = this;
|
|
3192
|
+
// Always start with continueAllowed = false. This covers the scenario where a user might add someone for sharing
|
|
3193
|
+
// a case (so, continueAllowed = true), then removes the same user before trying to continue. This would
|
|
3194
|
+
// erroneously leave continueAllowed as true
|
|
3195
|
+
this.continueAllowed = false;
|
|
3502
3196
|
this.shareCases$.subscribe((/**
|
|
3503
3197
|
* @param {?} shareCases
|
|
3504
3198
|
* @return {?}
|
|
@@ -3509,11 +3203,11 @@ var ShareCaseComponent = /** @class */ (function () {
|
|
|
3509
3203
|
for (var shareCases_1 = __values(shareCases), shareCases_1_1 = shareCases_1.next(); !shareCases_1_1.done; shareCases_1_1 = shareCases_1.next()) {
|
|
3510
3204
|
var caseState = shareCases_1_1.value;
|
|
3511
3205
|
if (caseState.pendingShares && caseState.pendingShares.length > 0) {
|
|
3512
|
-
|
|
3206
|
+
_this.continueAllowed = true;
|
|
3513
3207
|
break;
|
|
3514
3208
|
}
|
|
3515
3209
|
if (caseState.pendingUnshares && caseState.pendingUnshares.length > 0) {
|
|
3516
|
-
|
|
3210
|
+
_this.continueAllowed = true;
|
|
3517
3211
|
break;
|
|
3518
3212
|
}
|
|
3519
3213
|
}
|
|
@@ -3526,7 +3220,6 @@ var ShareCaseComponent = /** @class */ (function () {
|
|
|
3526
3220
|
finally { if (e_1) throw e_1.error; }
|
|
3527
3221
|
}
|
|
3528
3222
|
}));
|
|
3529
|
-
return isDisabled;
|
|
3530
3223
|
};
|
|
3531
3224
|
/**
|
|
3532
3225
|
* @param {?} sharedCase
|
|
@@ -3560,24 +3253,143 @@ var ShareCaseComponent = /** @class */ (function () {
|
|
|
3560
3253
|
}
|
|
3561
3254
|
this.stateService.setCases(this.shareCases);
|
|
3562
3255
|
};
|
|
3256
|
+
/**
|
|
3257
|
+
* @return {?}
|
|
3258
|
+
*/
|
|
3259
|
+
ShareCaseComponent.prototype.onContinue = /**
|
|
3260
|
+
* @return {?}
|
|
3261
|
+
*/
|
|
3262
|
+
function () {
|
|
3263
|
+
this.setContinueAllowed();
|
|
3264
|
+
// If continuation is not allowed, set an error message
|
|
3265
|
+
if (!this.continueAllowed) {
|
|
3266
|
+
this.validationErrors = [];
|
|
3267
|
+
this.validationErrors.push({ id: 'cases', message: SharedCaseErrorMessages.NoChangesRequested });
|
|
3268
|
+
this.shareCaseErrorMessage = { isInvalid: true, messages: [SharedCaseErrorMessages.NoChangesRequested] };
|
|
3269
|
+
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
|
|
3270
|
+
}
|
|
3271
|
+
// Navigate to confirmation page only if allowed to continue
|
|
3272
|
+
if (this.continueAllowed) {
|
|
3273
|
+
// Check that no case is left unassigned; a user can be removed only if there is another current user, or if at
|
|
3274
|
+
// least one user is to be added. Prevent navigation to confirmation page if there is at least one case left in
|
|
3275
|
+
// an unassigned state
|
|
3276
|
+
if (this.hasCasesLeftUnassigned(this.shareCases)) {
|
|
3277
|
+
this.validationErrors = [];
|
|
3278
|
+
this.validationErrors.push({ id: 'cases', message: SharedCaseErrorMessages.OnePersonMustBeAssigned });
|
|
3279
|
+
this.shareCaseErrorMessage = { isInvalid: true, messages: [SharedCaseErrorMessages.OnePersonMustBeAssigned] };
|
|
3280
|
+
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
|
|
3281
|
+
}
|
|
3282
|
+
else {
|
|
3283
|
+
this.router.navigate([this.confirmLink]);
|
|
3284
|
+
}
|
|
3285
|
+
}
|
|
3286
|
+
};
|
|
3287
|
+
/**
|
|
3288
|
+
* Gets a unique list of all users that have been assigned, or are pending assigment to, at least one case
|
|
3289
|
+
* @param sharedCases The list of shared cases from which to get users these are shared with, or are to be shared with
|
|
3290
|
+
*/
|
|
3291
|
+
/**
|
|
3292
|
+
* Gets a unique list of all users that have been assigned, or are pending assigment to, at least one case
|
|
3293
|
+
* @param {?} sharedCases The list of shared cases from which to get users these are shared with, or are to be shared with
|
|
3294
|
+
* @return {?}
|
|
3295
|
+
*/
|
|
3296
|
+
ShareCaseComponent.prototype.getAssignedUsers = /**
|
|
3297
|
+
* Gets a unique list of all users that have been assigned, or are pending assigment to, at least one case
|
|
3298
|
+
* @param {?} sharedCases The list of shared cases from which to get users these are shared with, or are to be shared with
|
|
3299
|
+
* @return {?}
|
|
3300
|
+
*/
|
|
3301
|
+
function (sharedCases) {
|
|
3302
|
+
/** @type {?} */
|
|
3303
|
+
var users = [];
|
|
3304
|
+
sharedCases.forEach((/**
|
|
3305
|
+
* @param {?} sharedCase
|
|
3306
|
+
* @return {?}
|
|
3307
|
+
*/
|
|
3308
|
+
function (sharedCase) {
|
|
3309
|
+
if (sharedCase.sharedWith) {
|
|
3310
|
+
sharedCase.sharedWith.forEach((/**
|
|
3311
|
+
* @param {?} user
|
|
3312
|
+
* @return {?}
|
|
3313
|
+
*/
|
|
3314
|
+
function (user) {
|
|
3315
|
+
if (!users.some((/**
|
|
3316
|
+
* @param {?} existingUser
|
|
3317
|
+
* @return {?}
|
|
3318
|
+
*/
|
|
3319
|
+
function (existingUser) { return user.idamId === existingUser.idamId; }))) {
|
|
3320
|
+
users.push(user);
|
|
3321
|
+
}
|
|
3322
|
+
}));
|
|
3323
|
+
}
|
|
3324
|
+
if (sharedCase.pendingShares) {
|
|
3325
|
+
sharedCase.pendingShares.forEach((/**
|
|
3326
|
+
* @param {?} user
|
|
3327
|
+
* @return {?}
|
|
3328
|
+
*/
|
|
3329
|
+
function (user) {
|
|
3330
|
+
if (!users.some((/**
|
|
3331
|
+
* @param {?} existingUser
|
|
3332
|
+
* @return {?}
|
|
3333
|
+
*/
|
|
3334
|
+
function (existingUser) { return user.idamId === existingUser.idamId; }))) {
|
|
3335
|
+
users.push(user);
|
|
3336
|
+
}
|
|
3337
|
+
}));
|
|
3338
|
+
}
|
|
3339
|
+
}));
|
|
3340
|
+
this.assignedUsers = users;
|
|
3341
|
+
};
|
|
3342
|
+
/**
|
|
3343
|
+
* Checks if any shared cases have been left unassigned. This occurs if a shared case has a number of pending
|
|
3344
|
+
* unshares equal to the number of current shares, and there are no pending shares.
|
|
3345
|
+
* @param sharedCases The array of shared cases to check
|
|
3346
|
+
* @returns `true` if at least one case has the condition described above; `false` otherwise
|
|
3347
|
+
*/
|
|
3348
|
+
/**
|
|
3349
|
+
* Checks if any shared cases have been left unassigned. This occurs if a shared case has a number of pending
|
|
3350
|
+
* unshares equal to the number of current shares, and there are no pending shares.
|
|
3351
|
+
* @param {?} sharedCases The array of shared cases to check
|
|
3352
|
+
* @return {?} `true` if at least one case has the condition described above; `false` otherwise
|
|
3353
|
+
*/
|
|
3354
|
+
ShareCaseComponent.prototype.hasCasesLeftUnassigned = /**
|
|
3355
|
+
* Checks if any shared cases have been left unassigned. This occurs if a shared case has a number of pending
|
|
3356
|
+
* unshares equal to the number of current shares, and there are no pending shares.
|
|
3357
|
+
* @param {?} sharedCases The array of shared cases to check
|
|
3358
|
+
* @return {?} `true` if at least one case has the condition described above; `false` otherwise
|
|
3359
|
+
*/
|
|
3360
|
+
function (sharedCases) {
|
|
3361
|
+
return sharedCases.some((/**
|
|
3362
|
+
* @param {?} sharedCase
|
|
3363
|
+
* @return {?}
|
|
3364
|
+
*/
|
|
3365
|
+
function (sharedCase) {
|
|
3366
|
+
return sharedCase.pendingUnshares && sharedCase.sharedWith &&
|
|
3367
|
+
sharedCase.pendingUnshares.length === sharedCase.sharedWith.length &&
|
|
3368
|
+
(!sharedCase.pendingShares || sharedCase.pendingShares.length === 0);
|
|
3369
|
+
}));
|
|
3370
|
+
};
|
|
3563
3371
|
ShareCaseComponent.decorators = [
|
|
3564
3372
|
{ type: Component, args: [{
|
|
3565
3373
|
selector: 'xuilib-share-case',
|
|
3566
|
-
template: "<div id=\"add-user\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-!-font-weight-bold\" for=\"add-user-input\">{{addUserLabel}}</label>\n <span id=\"add-user-hint\" class=\"govuk-hint\">\n Search by name or email address. You can share access with as many people as you need.\n </span>\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <xuilib-user-select\n id=\"add-user-input\"\n aria-describedby=\"add-user-hint\"\n [users]=\"users\"\n (selected)=\"onSelectedUser($event)\">\n </xuilib-user-select>\n </div>\n <div class=\"govuk-grid-column-one-thirds\">\n <button id=\"btn-add-user\" (click)=\"addUser()\" class=\"govuk-button govuk-button--secondary\" [disabled]=\"isDisabledAdd()\" title=\"Add user to selected cases\">Add</button>\n </div>\n </div>\n <details id=\"add-user-help\" class=\"govuk-details\" data-module=\"govuk-details\">\n <summary class=\"govuk-details__summary\">\n <span id=\"content-why-can-not-find-email\" class=\"govuk-details__summary-text\">\n Can't find an email address?\n </span>\n </summary>\n <div id=\"content-reason-can-not-find-email\" class=\"govuk-details__text\">\n If you can't find your colleague's email address, they will need to complete their registration. Contact your\n administrator for help.\n </div>\n </details>\n </div>\n <div class=\"govuk-form-group\" *ngIf=\"showRemoveUsers\">\n <label class=\"govuk-label govuk-!-font-weight-bold\" for=\"remove-user-input\">Remove a person from all cases</label>\n <span id=\"remove-user-hint\" class=\"govuk-hint\">\n Select a person to remove them from all selected cases.\n </span>\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <select class=\"govuk-select\" id=\"remove-user-input\" aria-describedby=\"remove-user-hint\">\n <option
|
|
3374
|
+
template: "<xuilib-hmcts-error-summary\n [errorMessages]=\"validationErrors\"\n [header]=\"'There is a problem'\"\n></xuilib-hmcts-error-summary>\n<h1 *ngIf=\"title\" class=\"govuk-heading-xl govuk-!-margin-top-2\">\n <span *ngIf=\"fnTitle\" class=\"govuk-caption-xl\">{{fnTitle}}</span>\n {{title}}\n</h1>\n<div id=\"add-user\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-!-font-weight-bold\" for=\"add-user-input\">{{addUserLabel}}</label>\n <span id=\"add-user-hint\" class=\"govuk-hint\">\n Search by name or email address. You can share access with as many people as you need.\n </span>\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <xuilib-user-select\n id=\"add-user-input\"\n aria-describedby=\"add-user-hint\"\n [users]=\"users\"\n (selected)=\"onSelectedUser($event)\">\n </xuilib-user-select>\n </div>\n <div class=\"govuk-grid-column-one-thirds\">\n <button id=\"btn-add-user\" (click)=\"addUser()\" class=\"govuk-button govuk-button--secondary\" [disabled]=\"isDisabledAdd()\" title=\"Add user to selected cases\">Add</button>\n </div>\n </div>\n <details id=\"add-user-help\" class=\"govuk-details\" data-module=\"govuk-details\">\n <summary class=\"govuk-details__summary\">\n <span id=\"content-why-can-not-find-email\" class=\"govuk-details__summary-text\">\n Can't find an email address?\n </span>\n </summary>\n <div id=\"content-reason-can-not-find-email\" class=\"govuk-details__text\">\n If you can't find your colleague's email address, they will need to complete their registration. Contact your\n administrator for help.\n </div>\n </details>\n </div>\n <div class=\"govuk-form-group\" *ngIf=\"showRemoveUsers\">\n <label class=\"govuk-label govuk-!-font-weight-bold\" for=\"remove-user-input\">Remove a person from all cases</label>\n <span id=\"remove-user-hint\" class=\"govuk-hint\">\n Select a person to remove them from all selected cases.\n </span>\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <select [(ngModel)]=\"selectedUserToRemove\" class=\"govuk-select\" id=\"remove-user-input\" aria-describedby=\"remove-user-hint\">\n <option [ngValue]=\"null\" selected>Select a person</option>\n <option *ngFor=\"let user of assignedUsers\" [ngValue]=\"user\">{{user.firstName}} {{user.lastName}} - {{user.email}}</option>\n </select>\n </div>\n <div class=\"govuk-grid-column-one-thirds\">\n <button id=\"btn-remove-user\" (click)=\"removeUser()\" class=\"govuk-button govuk-button--secondary\" title=\"Remove user from selected cases\">Remove</button>\n </div>\n </div>\n </div>\n</div>\n\n<div id=\"cases\" [ngClass]=\"{'govuk-form-group--error': shareCaseErrorMessage.messages && shareCaseErrorMessage.messages.length > 0}\">\n <h3 id=\"title-selected-cases\" class=\"govuk-heading-m\">Selected cases</h3>\n <xuilib-gov-uk-error-message [config]=\"selectedCasesErrorMessageConfig\" [errorMessage]=\"shareCaseErrorMessage\"></xuilib-gov-uk-error-message>\n <div *ngIf=\"shareCases && shareCases.length > 0\" class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"accordion-with-summary-sections\">\n <xuilib-selected-case-list\n [shareCases$]=\"shareCases$\"\n [removeUserFromCaseToggleOn]=\"removeUserFromCaseToggleOn\"\n (unselect)=\"onUnselect($event)\"\n (synchronizeStore)=\"onSynchronizeStore($event)\"\n >\n </xuilib-selected-case-list>\n </div>\n\n <div id=\"noCaseDisplay\" *ngIf=\"shareCases && shareCases.length === 0\" class=\"govuk-hint\"\n [ngClass]=\"{'govuk-form-group--error': shareCaseErrorMessage.messages && shareCaseErrorMessage.messages.length > 0}\">\n No cases to display.\n </div>\n\n</div>\n\n<div id=\"share-case-nav\" class=\"govuk-button-group\">\n <button id=\"btn-continue\" class=\"govuk-button\" data-module=\"govuk-button\" (click)=\"onContinue()\" title=\"Continue\">Continue</button>\n <button id=\"btn-cancel\" class=\"govuk-button govuk-button--secondary\" data-module=\"govuk-button\" title=\"Cancel\" [routerLink]=\"cancelLink\">Cancel</button>\n</div>\n",
|
|
3567
3375
|
styles: ["select{width:100%}"]
|
|
3568
3376
|
}] }
|
|
3569
3377
|
];
|
|
3570
3378
|
/** @nocollapse */
|
|
3571
3379
|
ShareCaseComponent.ctorParameters = function () { return [
|
|
3572
|
-
{ type: CaseSharingStateService }
|
|
3380
|
+
{ type: CaseSharingStateService },
|
|
3381
|
+
{ type: Router }
|
|
3573
3382
|
]; };
|
|
3574
3383
|
ShareCaseComponent.propDecorators = {
|
|
3575
3384
|
removeUserFromCaseToggleOn: [{ type: Input }],
|
|
3576
3385
|
shareCases$: [{ type: Input }],
|
|
3577
3386
|
users: [{ type: Input }],
|
|
3578
3387
|
confirmLink: [{ type: Input }],
|
|
3388
|
+
cancelLink: [{ type: Input }],
|
|
3579
3389
|
addUserLabel: [{ type: Input }],
|
|
3580
3390
|
showRemoveUsers: [{ type: Input }],
|
|
3391
|
+
fnTitle: [{ type: Input }],
|
|
3392
|
+
title: [{ type: Input }],
|
|
3581
3393
|
unselect: [{ type: Output }],
|
|
3582
3394
|
synchronizeStore: [{ type: Output }],
|
|
3583
3395
|
userSelect: [{ type: ViewChild, args: [UserSelectComponent,] }]
|
|
@@ -4111,12 +3923,6 @@ var CookieBannerComponent = /** @class */ (function () {
|
|
|
4111
3923
|
return CookieBannerComponent;
|
|
4112
3924
|
}());
|
|
4113
3925
|
|
|
4114
|
-
/**
|
|
4115
|
-
* @fileoverview added by tsickle
|
|
4116
|
-
* Generated from: lib/models/case-share.model.ts
|
|
4117
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4118
|
-
*/
|
|
4119
|
-
|
|
4120
3926
|
/**
|
|
4121
3927
|
* @fileoverview added by tsickle
|
|
4122
3928
|
* Generated from: lib/models/contact-details.model.ts
|
|
@@ -4179,7 +3985,7 @@ var PersonRole = {
|
|
|
4179
3985
|
JUDICIAL: "Judicial",
|
|
4180
3986
|
CASEWORKER: "Legal Ops",
|
|
4181
3987
|
ADMIN: "Admin",
|
|
4182
|
-
CTSC: "CTSC
|
|
3988
|
+
CTSC: "CTSC",
|
|
4183
3989
|
ALL: "All",
|
|
4184
3990
|
};
|
|
4185
3991
|
/** @enum {string} */
|
|
@@ -4320,7 +4126,7 @@ var LocationService = /** @class */ (function () {
|
|
|
4320
4126
|
|
|
4321
4127
|
/**
|
|
4322
4128
|
* @fileoverview added by tsickle
|
|
4323
|
-
* Generated from: lib/services/
|
|
4129
|
+
* Generated from: lib/services/session-storage/session-storage.service.ts
|
|
4324
4130
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4325
4131
|
*/
|
|
4326
4132
|
var SessionStorageService = /** @class */ (function () {
|
|
@@ -4638,7 +4444,7 @@ var SearchLocationComponent = /** @class */ (function () {
|
|
|
4638
4444
|
{ type: Component, args: [{
|
|
4639
4445
|
selector: 'exui-search-location',
|
|
4640
4446
|
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",
|
|
4641
|
-
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
|
|
4447
|
+
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:100%;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{min-width:550px;display:inline-block;margin-right:4px}.autocomplete__input{line-height:24px;font-size:19px}"]
|
|
4642
4448
|
}] }
|
|
4643
4449
|
];
|
|
4644
4450
|
/** @nocollapse */
|
|
@@ -4897,8 +4703,8 @@ var FindLocationComponent = /** @class */ (function () {
|
|
|
4897
4703
|
FindLocationComponent.decorators = [
|
|
4898
4704
|
{ type: Component, args: [{
|
|
4899
4705
|
selector: 'xuilib-find-location',
|
|
4900
|
-
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
|
|
4901
|
-
styles: ["
|
|
4706
|
+
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-location\"\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\" data-module=\"govuk-button\" *ngIf=\"enableAddLocationButton\">\n Add location\n </a>\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",
|
|
4707
|
+
styles: [""]
|
|
4902
4708
|
}] }
|
|
4903
4709
|
];
|
|
4904
4710
|
FindLocationComponent.propDecorators = {
|
|
@@ -5635,408 +5441,38 @@ var FindPersonComponent = /** @class */ (function () {
|
|
|
5635
5441
|
*/
|
|
5636
5442
|
var FindServiceComponent = /** @class */ (function () {
|
|
5637
5443
|
function FindServiceComponent() {
|
|
5638
|
-
this.
|
|
5639
|
-
this.selectedServices = [];
|
|
5444
|
+
this.serviceTitle = 'Search for a service by name';
|
|
5640
5445
|
this.enableAddServiceButton = true;
|
|
5641
|
-
this.
|
|
5642
|
-
this.serviceFieldChanged = new EventEmitter();
|
|
5643
|
-
this.tempSelectedService = null;
|
|
5446
|
+
this.disableInputField = false;
|
|
5644
5447
|
}
|
|
5645
|
-
/**
|
|
5646
|
-
* @return {?}
|
|
5647
|
-
*/
|
|
5648
|
-
FindServiceComponent.prototype.ngOnInit = /**
|
|
5649
|
-
* @return {?}
|
|
5650
|
-
*/
|
|
5651
|
-
function () {
|
|
5652
|
-
this.selectedServices = this.selectedServices !== null ? this.selectedServices.filter((/**
|
|
5653
|
-
* @param {?} service
|
|
5654
|
-
* @return {?}
|
|
5655
|
-
*/
|
|
5656
|
-
function (service) { return service.key; })) : [];
|
|
5657
|
-
this.SortAnOptions();
|
|
5658
|
-
};
|
|
5659
5448
|
/**
|
|
5660
5449
|
* @return {?}
|
|
5661
5450
|
*/
|
|
5662
5451
|
FindServiceComponent.prototype.addService = /**
|
|
5663
|
-
* @return {?}
|
|
5664
|
-
*/
|
|
5665
|
-
function () {
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
/**
|
|
5681
|
-
* @param {?} service
|
|
5682
|
-
* @return {?}
|
|
5683
|
-
*/
|
|
5684
|
-
FindServiceComponent.prototype.removeService = /**
|
|
5685
|
-
* @param {?} service
|
|
5686
|
-
* @return {?}
|
|
5687
|
-
*/
|
|
5688
|
-
function (service) {
|
|
5689
|
-
if (service.key) {
|
|
5690
|
-
this.selectedServices = this.selectedServices !== null ? this.selectedServices.filter((/**
|
|
5691
|
-
* @param {?} selectedService
|
|
5692
|
-
* @return {?}
|
|
5693
|
-
*/
|
|
5694
|
-
function (selectedService) { return selectedService.key !== service.key; })) : [];
|
|
5695
|
-
/** @type {?} */
|
|
5696
|
-
var formArray = (/** @type {?} */ (this.form.get(this.field.name)));
|
|
5697
|
-
/** @type {?} */
|
|
5698
|
-
var index = (formArray.value).findIndex((/**
|
|
5699
|
-
* @param {?} selectedService
|
|
5700
|
-
* @return {?}
|
|
5701
|
-
*/
|
|
5702
|
-
function (selectedService) { return selectedService.key === service.key; }));
|
|
5703
|
-
if (index > -1) {
|
|
5704
|
-
formArray.removeAt(index);
|
|
5705
|
-
this.services.splice(index, 0, service);
|
|
5706
|
-
this.SortAnOptions();
|
|
5707
|
-
}
|
|
5708
|
-
this.serviceFieldChanged.emit();
|
|
5709
|
-
}
|
|
5710
|
-
};
|
|
5711
|
-
/**
|
|
5712
|
-
* @param {?} service
|
|
5713
|
-
* @return {?}
|
|
5714
|
-
*/
|
|
5715
|
-
FindServiceComponent.prototype.onServiceSelected = /**
|
|
5716
|
-
* @param {?} service
|
|
5717
|
-
* @return {?}
|
|
5718
|
-
*/
|
|
5719
|
-
function (service) {
|
|
5720
|
-
if (!service) {
|
|
5721
|
-
this.tempSelectedService = null;
|
|
5722
|
-
return;
|
|
5723
|
-
}
|
|
5724
|
-
if (this.field.maxSelected === 1) {
|
|
5725
|
-
this.removeSelectedValues();
|
|
5726
|
-
this.addSelectedServicesToForm([service]);
|
|
5727
|
-
}
|
|
5728
|
-
else {
|
|
5729
|
-
if (!this.selectedServices.find((/**
|
|
5730
|
-
* @param {?} s
|
|
5731
|
-
* @return {?}
|
|
5732
|
-
*/
|
|
5733
|
-
function (s) { return s.key === service.key; }))) {
|
|
5734
|
-
if (service.key) {
|
|
5735
|
-
this.tempSelectedService = service;
|
|
5736
|
-
}
|
|
5737
|
-
}
|
|
5738
|
-
}
|
|
5739
|
-
};
|
|
5740
|
-
/**
|
|
5741
|
-
* @private
|
|
5742
|
-
* @return {?}
|
|
5743
|
-
*/
|
|
5744
|
-
FindServiceComponent.prototype.removeSelectedValues = /**
|
|
5745
|
-
* @private
|
|
5746
|
-
* @return {?}
|
|
5747
|
-
*/
|
|
5748
|
-
function () {
|
|
5749
|
-
/** @type {?} */
|
|
5750
|
-
var formArray = (/** @type {?} */ (this.form.get(this.field.name)));
|
|
5751
|
-
for (var i = 0; i < formArray.length; i++) {
|
|
5752
|
-
formArray.removeAt(i);
|
|
5753
|
-
}
|
|
5754
|
-
this.selectedServices = [];
|
|
5755
|
-
};
|
|
5756
|
-
/**
|
|
5757
|
-
* @private
|
|
5758
|
-
* @param {?} services
|
|
5759
|
-
* @return {?}
|
|
5760
|
-
*/
|
|
5761
|
-
FindServiceComponent.prototype.addSelectedServicesToForm = /**
|
|
5762
|
-
* @private
|
|
5763
|
-
* @param {?} services
|
|
5764
|
-
* @return {?}
|
|
5765
|
-
*/
|
|
5766
|
-
function (services) {
|
|
5767
|
-
var e_1, _a;
|
|
5768
|
-
/** @type {?} */
|
|
5769
|
-
var formArray = (/** @type {?} */ (this.form.get(this.field.name)));
|
|
5770
|
-
try {
|
|
5771
|
-
for (var services_1 = __values(services), services_1_1 = services_1.next(); !services_1_1.done; services_1_1 = services_1.next()) {
|
|
5772
|
-
var service = services_1_1.value;
|
|
5773
|
-
formArray.push(new FormControl(service));
|
|
5774
|
-
}
|
|
5775
|
-
}
|
|
5776
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
5777
|
-
finally {
|
|
5778
|
-
try {
|
|
5779
|
-
if (services_1_1 && !services_1_1.done && (_a = services_1.return)) _a.call(services_1);
|
|
5780
|
-
}
|
|
5781
|
-
finally { if (e_1) throw e_1.error; }
|
|
5782
|
-
}
|
|
5783
|
-
};
|
|
5784
|
-
/**
|
|
5785
|
-
* @private
|
|
5786
|
-
* @return {?}
|
|
5787
|
-
*/
|
|
5788
|
-
FindServiceComponent.prototype.SortAnOptions = /**
|
|
5789
|
-
* @private
|
|
5790
|
-
* @return {?}
|
|
5791
|
-
*/
|
|
5792
|
-
function () {
|
|
5793
|
-
return this.services.sort((/**
|
|
5794
|
-
* @param {?} a
|
|
5795
|
-
* @param {?} b
|
|
5796
|
-
* @return {?}
|
|
5797
|
-
*/
|
|
5798
|
-
function (a, b) {
|
|
5799
|
-
return a.label.toLowerCase() > b.label.toLowerCase() ? 1 : (b.label.toLowerCase() > a.label.toLowerCase() ? -1 : 0);
|
|
5800
|
-
}));
|
|
5801
|
-
};
|
|
5802
|
-
FindServiceComponent.decorators = [
|
|
5803
|
-
{ type: Component, args: [{
|
|
5804
|
-
selector: 'xuilib-find-service',
|
|
5805
|
-
template: "<div class=\"service-picker-custom\">\n <div class=\"search-service\">\n <div class=\"govuk-body\">\n <label id=\"selectServiceSearch-label\" for=\"serviceSearch__select\" *ngIf=\"serviceTitle\">\n {{ serviceTitle}}\n </label>\n </div>\n <div class=\"search-service__input-container\">\n <exui-search-service class=\"search-service__input\" [services]=\"services\"\n (serviceChanged)=\"onServiceSelected($event)\">\n </exui-search-service>\n <a href=\"javascript:void(0)\" (click)=\"addService()\"\n class=\"govuk-button govuk-button--secondary govuk-!-margin-bottom-0\" data-module=\"govuk-button\"\n *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=\"location-selection\" *ngFor=\"let selection of selectedServices\">\n <a class=\"hmcts-filter__tag\" (click)=\"removeService(selection)\" href=\"javascript:void(0)\">\n {{ selection.label }}\n </a>\n </li>\n </ul>\n</div>",
|
|
5806
|
-
styles: ["#add-service{background-color:#ddd}.search-service__input-container{display:flex}.search-service__input{flex:1 0 auto}"]
|
|
5807
|
-
}] }
|
|
5808
|
-
];
|
|
5809
|
-
FindServiceComponent.propDecorators = {
|
|
5810
|
-
field: [{ type: Input }],
|
|
5811
|
-
fields: [{ type: Input }],
|
|
5812
|
-
serviceTitle: [{ type: Input }],
|
|
5813
|
-
form: [{ type: Input }],
|
|
5814
|
-
services: [{ type: Input }],
|
|
5815
|
-
selectedServices: [{ type: Input }],
|
|
5816
|
-
enableAddServiceButton: [{ type: Input }],
|
|
5817
|
-
disabled: [{ type: Input }],
|
|
5818
|
-
serviceFieldChanged: [{ type: Output }]
|
|
5819
|
-
};
|
|
5820
|
-
return FindServiceComponent;
|
|
5821
|
-
}());
|
|
5822
|
-
|
|
5823
|
-
/**
|
|
5824
|
-
* @fileoverview added by tsickle
|
|
5825
|
-
* Generated from: lib/services/task-name/task-name.service.ts
|
|
5826
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
5827
|
-
*/
|
|
5828
|
-
var TaskNameService = /** @class */ (function () {
|
|
5829
|
-
function TaskNameService(http, sessionStorageService) {
|
|
5830
|
-
this.http = http;
|
|
5831
|
-
this.sessionStorageService = sessionStorageService;
|
|
5832
|
-
}
|
|
5833
|
-
/**
|
|
5834
|
-
* @return Observable<any[]>: Array of taskName in Observable
|
|
5835
|
-
*/
|
|
5836
|
-
/**
|
|
5837
|
-
* @return {?} Observable<any[]>: Array of taskName in Observable
|
|
5838
|
-
*/
|
|
5839
|
-
TaskNameService.prototype.getTaskName = /**
|
|
5840
|
-
* @return {?} Observable<any[]>: Array of taskName in Observable
|
|
5841
|
-
*/
|
|
5842
|
-
function () {
|
|
5843
|
-
var _this = this;
|
|
5844
|
-
if (this.sessionStorageService.getItem(TaskNameService.taskNamesKey)) {
|
|
5845
|
-
/** @type {?} */
|
|
5846
|
-
var taskNames = JSON.parse(this.sessionStorageService.getItem(TaskNameService.taskNamesKey));
|
|
5847
|
-
return of((/** @type {?} */ (taskNames)));
|
|
5848
|
-
}
|
|
5849
|
-
return this.http.get("/workallocation/taskNames").pipe(tap((/**
|
|
5850
|
-
* @param {?} taskNames
|
|
5851
|
-
* @return {?}
|
|
5852
|
-
*/
|
|
5853
|
-
function (taskNames) { return _this.sessionStorageService.setItem(TaskNameService.taskNamesKey, JSON.stringify(taskNames)); })));
|
|
5854
|
-
};
|
|
5855
|
-
TaskNameService.taskNamesKey = 'taskNames';
|
|
5856
|
-
TaskNameService.decorators = [
|
|
5857
|
-
{ type: Injectable, args: [{
|
|
5858
|
-
providedIn: 'root'
|
|
5859
|
-
},] }
|
|
5860
|
-
];
|
|
5861
|
-
/** @nocollapse */
|
|
5862
|
-
TaskNameService.ctorParameters = function () { return [
|
|
5863
|
-
{ type: HttpClient },
|
|
5864
|
-
{ type: SessionStorageService }
|
|
5865
|
-
]; };
|
|
5866
|
-
/** @nocollapse */ TaskNameService.ngInjectableDef = defineInjectable({ factory: function TaskNameService_Factory() { return new TaskNameService(inject(HttpClient), inject(SessionStorageService)); }, token: TaskNameService, providedIn: "root" });
|
|
5867
|
-
return TaskNameService;
|
|
5868
|
-
}());
|
|
5869
|
-
|
|
5870
|
-
/**
|
|
5871
|
-
* @fileoverview added by tsickle
|
|
5872
|
-
* Generated from: lib/components/find-task-name/find-task-name.component.ts
|
|
5873
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
5874
|
-
*/
|
|
5875
|
-
var FindTaskNameComponent = /** @class */ (function () {
|
|
5876
|
-
function FindTaskNameComponent(cd, taskService) {
|
|
5877
|
-
this.cd = cd;
|
|
5878
|
-
this.taskService = taskService;
|
|
5879
|
-
this.taskNameSelected = new EventEmitter();
|
|
5880
|
-
this.taskNameFieldChanged = new EventEmitter();
|
|
5881
|
-
this.boldTitle = 'Find the task name';
|
|
5882
|
-
this.subTitle = 'Type the name of the task name and select them.';
|
|
5883
|
-
this.domain = PersonRole.ALL;
|
|
5884
|
-
this.findTaskNameGroup = new FormGroup({});
|
|
5885
|
-
this.submitted = true;
|
|
5886
|
-
this.userIncluded = false;
|
|
5887
|
-
this.placeholderContent = '';
|
|
5888
|
-
this.isNoResultsShown = true;
|
|
5889
|
-
this.showUpdatedColor = false;
|
|
5890
|
-
this.selectedTaskNames = [];
|
|
5891
|
-
this.errorMessage = 'You must select a name';
|
|
5892
|
-
this.idValue = '';
|
|
5893
|
-
this.services = ['IA'];
|
|
5894
|
-
this.disabled = null;
|
|
5895
|
-
this.showAutocomplete = false;
|
|
5896
|
-
this.filteredOptions = [];
|
|
5897
|
-
this.minSearchCharacters = 1;
|
|
5898
|
-
this.searchTerm = '';
|
|
5899
|
-
}
|
|
5900
|
-
/**
|
|
5901
|
-
* @return {?}
|
|
5902
|
-
*/
|
|
5903
|
-
FindTaskNameComponent.prototype.ngOnDestroy = /**
|
|
5904
|
-
* @return {?}
|
|
5905
|
-
*/
|
|
5906
|
-
function () {
|
|
5907
|
-
if (this.sub) {
|
|
5908
|
-
this.sub.unsubscribe();
|
|
5909
|
-
}
|
|
5910
|
-
};
|
|
5911
|
-
/**
|
|
5912
|
-
* @return {?}
|
|
5913
|
-
*/
|
|
5914
|
-
FindTaskNameComponent.prototype.ngOnChanges = /**
|
|
5915
|
-
* @return {?}
|
|
5916
|
-
*/
|
|
5917
|
-
function () {
|
|
5918
|
-
var _this = this;
|
|
5919
|
-
this.findTaskNameControl = new FormControl(this.selectedTaskName);
|
|
5920
|
-
this.findTaskNameGroup.addControl('findTaskNameControl', this.findTaskNameControl);
|
|
5921
|
-
this.sub = this.findTaskNameControl.valueChanges
|
|
5922
|
-
.pipe(tap((/**
|
|
5923
|
-
* @return {?}
|
|
5924
|
-
*/
|
|
5925
|
-
function () { return _this.showAutocomplete = false; })), tap((/**
|
|
5926
|
-
* @return {?}
|
|
5927
|
-
*/
|
|
5928
|
-
function () { return _this.filteredOptions = []; })), tap((/**
|
|
5929
|
-
* @param {?} term
|
|
5930
|
-
* @return {?}
|
|
5931
|
-
*/
|
|
5932
|
-
function (term) { return _this.searchTerm = term; })), debounceTime(300), tap((/**
|
|
5933
|
-
* @param {?} searchTerm
|
|
5934
|
-
* @return {?}
|
|
5935
|
-
*/
|
|
5936
|
-
function (searchTerm) {
|
|
5937
|
-
if (!searchTerm) {
|
|
5938
|
-
_this.taskNameSelected.emit('');
|
|
5939
|
-
}
|
|
5940
|
-
return searchTerm;
|
|
5941
|
-
})),
|
|
5942
|
-
// tap((searchTerm) => typeof searchTerm === 'string' ? this.taskNameSelected.emit('null') : void 0),
|
|
5943
|
-
filter((/**
|
|
5944
|
-
* @param {?} searchTerm
|
|
5945
|
-
* @return {?}
|
|
5946
|
-
*/
|
|
5947
|
-
function (searchTerm) { return searchTerm && searchTerm.length >= _this.minSearchCharacters; })), mergeMap((/**
|
|
5948
|
-
* @return {?}
|
|
5949
|
-
*/
|
|
5950
|
-
function () { return _this.getTaskName(); }))).subscribe((/**
|
|
5951
|
-
* @param {?} taskNameModel
|
|
5952
|
-
* @return {?}
|
|
5953
|
-
*/
|
|
5954
|
-
function (taskNameModel) {
|
|
5955
|
-
_this.filteredOptions = taskNameModel.map((/**
|
|
5956
|
-
* @param {?} task
|
|
5957
|
-
* @return {?}
|
|
5958
|
-
*/
|
|
5959
|
-
function (task) { return task.taskName; }));
|
|
5960
|
-
if (_this.searchTerm) {
|
|
5961
|
-
_this.filteredOptions = _this.filteredOptions.filter((/**
|
|
5962
|
-
* @param {?} taskName
|
|
5963
|
-
* @return {?}
|
|
5964
|
-
*/
|
|
5965
|
-
function (taskName) { return taskName.toLocaleLowerCase().includes(_this.searchTerm.toLocaleLowerCase()); })).map((/**
|
|
5966
|
-
* @param {?} taskName
|
|
5967
|
-
* @return {?}
|
|
5968
|
-
*/
|
|
5969
|
-
function (taskName) { return taskName; }));
|
|
5970
|
-
}
|
|
5971
|
-
_this.cd.detectChanges();
|
|
5972
|
-
}));
|
|
5973
|
-
};
|
|
5974
|
-
/**
|
|
5975
|
-
* @return {?}
|
|
5976
|
-
*/
|
|
5977
|
-
FindTaskNameComponent.prototype.getTaskName = /**
|
|
5978
|
-
* @return {?}
|
|
5979
|
-
*/
|
|
5980
|
-
function () {
|
|
5981
|
-
return this.taskService.getTaskName();
|
|
5982
|
-
};
|
|
5983
|
-
/**
|
|
5984
|
-
* @param {?} selectedTaskName
|
|
5985
|
-
* @return {?}
|
|
5986
|
-
*/
|
|
5987
|
-
FindTaskNameComponent.prototype.onSelectionChange = /**
|
|
5988
|
-
* @param {?} selectedTaskName
|
|
5989
|
-
* @return {?}
|
|
5990
|
-
*/
|
|
5991
|
-
function (selectedTaskName) {
|
|
5992
|
-
if (selectedTaskName) {
|
|
5993
|
-
this.taskNameSelected.emit(selectedTaskName);
|
|
5994
|
-
this.findTaskNameControl.setValue(selectedTaskName);
|
|
5995
|
-
}
|
|
5996
|
-
};
|
|
5997
|
-
/**
|
|
5998
|
-
* @return {?}
|
|
5999
|
-
*/
|
|
6000
|
-
FindTaskNameComponent.prototype.onInput = /**
|
|
6001
|
-
* @return {?}
|
|
6002
|
-
*/
|
|
6003
|
-
function () {
|
|
6004
|
-
this.taskNameFieldChanged.emit();
|
|
6005
|
-
};
|
|
6006
|
-
FindTaskNameComponent.decorators = [
|
|
6007
|
-
{ type: Component, args: [{
|
|
6008
|
-
selector: 'xuilib-find-task-name',
|
|
6009
|
-
template: "<h1 class=\"govuk-heading-l\" *ngIf=\"title && title.length\">\n <span class=\"govuk-caption-l\">{{title}}</span>\n {{boldTitle}}\n</h1>\n<div class=\"govuk-form-group\" [formGroup]=\"findTaskNameGroup\"\n [ngClass]=\"{'form-group-error': findTaskNameGroup.get('findTaskNameControl')?.invalid && submitted}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"sub-title-hint\">\n <div id=\"sub-title-hint\" class=\"govuk-hint\" *ngIf=\"subTitle && subTitle.length\">\n {{subTitle}}\n </div>\n <span id=\"validation-error\" class=\"govuk-error-message\" *ngIf=\"findTaskNameGroup && findTaskNameGroup.errors\">\n <span class=\"govuk-visually-hidden\">Error:</span>{{findTaskNameGroup.errors.error ? findTaskNameGroup.errors.error : errorMessage}}\n </span>\n <input id=\"inputSelectTaskName{{idValue}}\" type=\"text\" aria-label=\"select a task name\"\n formControlName=\"findTaskNameControl\"\n [matAutocomplete]=\"auto\"\n class=\"govuk-input govuk-!-width-one-third\"\n [placeholder]=\"placeholderContent\"\n [attr.disabled]=\"disabled\"\n (input)=\"onInput()\">\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\" (optionSelected)=\"onSelectionChange($event.option.value)\">\n <mat-option *ngFor=\"let option of filteredOptions\"\n [value]=\"option\"\n [ngClass]=\"{'hide-autocomplete': !showAutocomplete, 'select-option': showUpdatedColor}\">\n {{ option }}\n </mat-option>\n <mat-option [ngClass]=\"{'select-option': showUpdatedColor}\" *ngIf=\"isNoResultsShown && !filteredOptions.length && showAutocomplete\">No results found</mat-option>\n </mat-autocomplete>\n </fieldset>\n</div>\n",
|
|
6010
|
-
styles: [""]
|
|
6011
|
-
}] }
|
|
6012
|
-
];
|
|
6013
|
-
/** @nocollapse */
|
|
6014
|
-
FindTaskNameComponent.ctorParameters = function () { return [
|
|
6015
|
-
{ type: ChangeDetectorRef },
|
|
6016
|
-
{ type: TaskNameService }
|
|
6017
|
-
]; };
|
|
6018
|
-
FindTaskNameComponent.propDecorators = {
|
|
6019
|
-
taskNameSelected: [{ type: Output }],
|
|
6020
|
-
taskNameFieldChanged: [{ type: Output }],
|
|
6021
|
-
title: [{ type: Input }],
|
|
6022
|
-
boldTitle: [{ type: Input }],
|
|
6023
|
-
subTitle: [{ type: Input }],
|
|
6024
|
-
domain: [{ type: Input }],
|
|
6025
|
-
findTaskNameGroup: [{ type: Input }],
|
|
6026
|
-
selectedTaskName: [{ type: Input }],
|
|
6027
|
-
submitted: [{ type: Input }],
|
|
6028
|
-
userIncluded: [{ type: Input }],
|
|
6029
|
-
assignedUser: [{ type: Input }],
|
|
6030
|
-
placeholderContent: [{ type: Input }],
|
|
6031
|
-
isNoResultsShown: [{ type: Input }],
|
|
6032
|
-
showUpdatedColor: [{ type: Input }],
|
|
6033
|
-
selectedTaskNames: [{ type: Input }],
|
|
6034
|
-
errorMessage: [{ type: Input }],
|
|
6035
|
-
idValue: [{ type: Input }],
|
|
5452
|
+
* @return {?}
|
|
5453
|
+
*/
|
|
5454
|
+
function () {
|
|
5455
|
+
// Todo
|
|
5456
|
+
};
|
|
5457
|
+
FindServiceComponent.decorators = [
|
|
5458
|
+
{ type: Component, args: [{
|
|
5459
|
+
selector: 'xuilib-find-service',
|
|
5460
|
+
template: "<div class=\"service-picker-custom\">\n <div class=\"search-service\">\n <div>\n <label id=\"input-selected-service-label\" *ngIf=\"serviceTitle\">{{serviceTitle}}</label>\n </div>\n <exui-search-service class=\"search-service\"\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 <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>",
|
|
5461
|
+
styles: ["#add-service{background-color:#ddd}"]
|
|
5462
|
+
}] }
|
|
5463
|
+
];
|
|
5464
|
+
FindServiceComponent.propDecorators = {
|
|
5465
|
+
field: [{ type: Input }],
|
|
5466
|
+
fields: [{ type: Input }],
|
|
5467
|
+
serviceTitle: [{ type: Input }],
|
|
5468
|
+
form: [{ type: Input }],
|
|
6036
5469
|
services: [{ type: Input }],
|
|
6037
|
-
|
|
5470
|
+
selectedServices: [{ type: Input }],
|
|
5471
|
+
disabled: [{ type: Input }],
|
|
5472
|
+
enableAddServiceButton: [{ type: Input }],
|
|
5473
|
+
disableInputField: [{ type: Input }]
|
|
6038
5474
|
};
|
|
6039
|
-
return
|
|
5475
|
+
return FindServiceComponent;
|
|
6040
5476
|
}());
|
|
6041
5477
|
|
|
6042
5478
|
/**
|
|
@@ -6287,36 +5723,42 @@ var SearchJudicialsComponent = /** @class */ (function () {
|
|
|
6287
5723
|
*/
|
|
6288
5724
|
var SearchServiceComponent = /** @class */ (function () {
|
|
6289
5725
|
function SearchServiceComponent() {
|
|
6290
|
-
this.
|
|
6291
|
-
this.
|
|
5726
|
+
this.showAutocomplete = false;
|
|
5727
|
+
this.minSearchCharacters = 3;
|
|
5728
|
+
this.term = '';
|
|
6292
5729
|
}
|
|
6293
5730
|
/**
|
|
6294
|
-
* @param {?} key
|
|
6295
5731
|
* @return {?}
|
|
6296
5732
|
*/
|
|
6297
|
-
SearchServiceComponent.prototype.
|
|
6298
|
-
* @param {?} key
|
|
5733
|
+
SearchServiceComponent.prototype.onInput = /**
|
|
6299
5734
|
* @return {?}
|
|
6300
5735
|
*/
|
|
6301
|
-
function (
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
5736
|
+
function () {
|
|
5737
|
+
// Todo
|
|
5738
|
+
};
|
|
5739
|
+
/**
|
|
5740
|
+
* @return {?}
|
|
5741
|
+
*/
|
|
5742
|
+
SearchServiceComponent.prototype.onSelectionChange = /**
|
|
5743
|
+
* @return {?}
|
|
5744
|
+
*/
|
|
5745
|
+
function () {
|
|
5746
|
+
// Todo
|
|
6309
5747
|
};
|
|
6310
5748
|
SearchServiceComponent.decorators = [
|
|
6311
5749
|
{ type: Component, args: [{
|
|
6312
5750
|
selector: 'exui-search-service',
|
|
6313
|
-
template: "<div class=\"
|
|
6314
|
-
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:
|
|
5751
|
+
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",
|
|
5752
|
+
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:100%;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{min-width:250px;display:inline-block;margin-right:4px}.autocomplete__input{line-height:24px;font-size:19px}"]
|
|
6315
5753
|
}] }
|
|
6316
5754
|
];
|
|
6317
5755
|
SearchServiceComponent.propDecorators = {
|
|
6318
5756
|
services: [{ type: Input }],
|
|
6319
|
-
|
|
5757
|
+
selectedServices: [{ type: Input }],
|
|
5758
|
+
disabled: [{ type: Input }],
|
|
5759
|
+
delay: [{ type: Input }],
|
|
5760
|
+
form: [{ type: Input }],
|
|
5761
|
+
showAutocomplete: [{ type: Input }]
|
|
6320
5762
|
};
|
|
6321
5763
|
return SearchServiceComponent;
|
|
6322
5764
|
}());
|
|
@@ -6606,58 +6048,6 @@ var GovUkCheckboxComponent = /** @class */ (function () {
|
|
|
6606
6048
|
return GovUkCheckboxComponent;
|
|
6607
6049
|
}());
|
|
6608
6050
|
|
|
6609
|
-
/**
|
|
6610
|
-
* @fileoverview added by tsickle
|
|
6611
|
-
* Generated from: lib/gov-ui/util/helpers/html-templates.helper.ts
|
|
6612
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
6613
|
-
*/
|
|
6614
|
-
/*
|
|
6615
|
-
* Helper Class
|
|
6616
|
-
* Used for dynamic templates manipulation
|
|
6617
|
-
* */
|
|
6618
|
-
var /*
|
|
6619
|
-
* Helper Class
|
|
6620
|
-
* Used for dynamic templates manipulation
|
|
6621
|
-
* */
|
|
6622
|
-
HtmlTemplatesHelper = /** @class */ (function () {
|
|
6623
|
-
function HtmlTemplatesHelper() {
|
|
6624
|
-
}
|
|
6625
|
-
/*
|
|
6626
|
-
* Sets described by string depending if
|
|
6627
|
-
* there is an error, error and hit or nothing
|
|
6628
|
-
* */
|
|
6629
|
-
/*
|
|
6630
|
-
* Sets described by string depending if
|
|
6631
|
-
* there is an error, error and hit or nothing
|
|
6632
|
-
* */
|
|
6633
|
-
/**
|
|
6634
|
-
* @param {?} errorMessage
|
|
6635
|
-
* @param {?} config
|
|
6636
|
-
* @return {?}
|
|
6637
|
-
*/
|
|
6638
|
-
HtmlTemplatesHelper.setDescribedBy = /*
|
|
6639
|
-
* Sets described by string depending if
|
|
6640
|
-
* there is an error, error and hit or nothing
|
|
6641
|
-
* */
|
|
6642
|
-
/**
|
|
6643
|
-
* @param {?} errorMessage
|
|
6644
|
-
* @param {?} config
|
|
6645
|
-
* @return {?}
|
|
6646
|
-
*/
|
|
6647
|
-
function (errorMessage, config) {
|
|
6648
|
-
if (!errorMessage) {
|
|
6649
|
-
return config.hint ? config.id + "-hint" : null;
|
|
6650
|
-
}
|
|
6651
|
-
else if (errorMessage && errorMessage.isInvalid) {
|
|
6652
|
-
return config.hint ? config.id + "-hint " + config.id + "-error" : config.id + "-error";
|
|
6653
|
-
}
|
|
6654
|
-
else {
|
|
6655
|
-
return config.hint ? config.id + "-hint" : null;
|
|
6656
|
-
}
|
|
6657
|
-
};
|
|
6658
|
-
return HtmlTemplatesHelper;
|
|
6659
|
-
}());
|
|
6660
|
-
|
|
6661
6051
|
/**
|
|
6662
6052
|
* @fileoverview added by tsickle
|
|
6663
6053
|
* Generated from: lib/gov-ui/components/gov-uk-checkboxes/gov-uk-checkboxes.component.ts
|
|
@@ -6673,100 +6063,15 @@ HtmlTemplatesHelper = /** @class */ (function () {
|
|
|
6673
6063
|
var GovUkCheckboxesComponent = /** @class */ (function () {
|
|
6674
6064
|
function GovUkCheckboxesComponent() {
|
|
6675
6065
|
}
|
|
6676
|
-
/**
|
|
6677
|
-
* @return {?}
|
|
6678
|
-
*/
|
|
6679
|
-
GovUkCheckboxesComponent.prototype.ngOnInit = /**
|
|
6680
|
-
* @return {?}
|
|
6681
|
-
*/
|
|
6682
|
-
function () {
|
|
6683
|
-
this.columns = this.setColumns();
|
|
6684
|
-
};
|
|
6685
|
-
/**
|
|
6686
|
-
* @return {?}
|
|
6687
|
-
*/
|
|
6688
|
-
GovUkCheckboxesComponent.prototype.setDescribedBy = /**
|
|
6689
|
-
* @return {?}
|
|
6690
|
-
*/
|
|
6691
|
-
function () {
|
|
6692
|
-
return HtmlTemplatesHelper.setDescribedBy(this.errorMessage, this.config);
|
|
6693
|
-
};
|
|
6694
|
-
/**
|
|
6695
|
-
* @param {?} checked
|
|
6696
|
-
* @param {?} value
|
|
6697
|
-
* @return {?}
|
|
6698
|
-
*/
|
|
6699
|
-
GovUkCheckboxesComponent.prototype.onChecked = /**
|
|
6700
|
-
* @param {?} checked
|
|
6701
|
-
* @param {?} value
|
|
6702
|
-
* @return {?}
|
|
6703
|
-
*/
|
|
6704
|
-
function (checked, value) {
|
|
6705
|
-
/** @type {?} */
|
|
6706
|
-
var formControl = this.group.get(this.config.name);
|
|
6707
|
-
/** @type {?} */
|
|
6708
|
-
var array = formControl.value ? formControl.value : [];
|
|
6709
|
-
if (!checked) {
|
|
6710
|
-
/** @type {?} */
|
|
6711
|
-
var modifiedArray = array.filter((/**
|
|
6712
|
-
* @param {?} item
|
|
6713
|
-
* @return {?}
|
|
6714
|
-
*/
|
|
6715
|
-
function (item) { return item !== value; }));
|
|
6716
|
-
formControl.setValue(modifiedArray);
|
|
6717
|
-
}
|
|
6718
|
-
else {
|
|
6719
|
-
formControl.setValue(__spread(array, [value]));
|
|
6720
|
-
}
|
|
6721
|
-
};
|
|
6722
|
-
/**
|
|
6723
|
-
* @param {?} value
|
|
6724
|
-
* @return {?}
|
|
6725
|
-
*/
|
|
6726
|
-
GovUkCheckboxesComponent.prototype.isChecked = /**
|
|
6727
|
-
* @param {?} value
|
|
6728
|
-
* @return {?}
|
|
6729
|
-
*/
|
|
6730
|
-
function (value) {
|
|
6731
|
-
/** @type {?} */
|
|
6732
|
-
var formControl = this.group.get(this.config.name);
|
|
6733
|
-
return formControl.value && formControl.value.includes(value);
|
|
6734
|
-
};
|
|
6735
|
-
/**
|
|
6736
|
-
* @private
|
|
6737
|
-
* @return {?}
|
|
6738
|
-
*/
|
|
6739
|
-
GovUkCheckboxesComponent.prototype.setColumns = /**
|
|
6740
|
-
* @private
|
|
6741
|
-
* @return {?}
|
|
6742
|
-
*/
|
|
6743
|
-
function () {
|
|
6744
|
-
if (this.config.rows && this.config.rows > 1) {
|
|
6745
|
-
/** @type {?} */
|
|
6746
|
-
var array = [];
|
|
6747
|
-
for (var i = 0; i < this.items.length; i += this.config.rows) {
|
|
6748
|
-
/** @type {?} */
|
|
6749
|
-
var arrayChunk = this.items.slice(i, i + this.config.rows);
|
|
6750
|
-
array.push(arrayChunk);
|
|
6751
|
-
}
|
|
6752
|
-
return array;
|
|
6753
|
-
}
|
|
6754
|
-
else {
|
|
6755
|
-
return [this.items];
|
|
6756
|
-
}
|
|
6757
|
-
};
|
|
6758
6066
|
GovUkCheckboxesComponent.decorators = [
|
|
6759
6067
|
{ type: Component, args: [{
|
|
6760
6068
|
selector: 'xuilib-gov-uk-checkboxes',
|
|
6761
|
-
template: "<
|
|
6762
|
-
styles: [".govuk-checkboxes-multi-column{display:flex;flex-wrap:wrap;margin-left:-20px;margin-right:-20px}.govuk-checkboxes-multi-column__single{padding-left:20px;padding-right:20px}"]
|
|
6069
|
+
template: "<xuilib-gov-uk-form-group-wrapper\n[error]=\"errors\"\n[config]=\"options.config\"\n[group]=\"options.key\">\n<div class=\"govuk-checkboxes\">\n <xuilib-gov-checkbox *ngFor=\"let item of options.items\"\n [group]=\"item.group\"\n [config]=\"item.config\">\n </xuilib-gov-checkbox>\n</div>\n</xuilib-gov-uk-form-group-wrapper>"
|
|
6763
6070
|
}] }
|
|
6764
6071
|
];
|
|
6765
6072
|
GovUkCheckboxesComponent.propDecorators = {
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
items: [{ type: Input }],
|
|
6769
|
-
errorMessage: [{ type: Input }]
|
|
6073
|
+
options: [{ type: Input }],
|
|
6074
|
+
errors: [{ type: Input }]
|
|
6770
6075
|
};
|
|
6771
6076
|
return GovUkCheckboxesComponent;
|
|
6772
6077
|
}());
|
|
@@ -6917,6 +6222,58 @@ var GovUkErrorMessageComponent = /** @class */ (function () {
|
|
|
6917
6222
|
return GovUkErrorMessageComponent;
|
|
6918
6223
|
}());
|
|
6919
6224
|
|
|
6225
|
+
/**
|
|
6226
|
+
* @fileoverview added by tsickle
|
|
6227
|
+
* Generated from: lib/gov-ui/util/helpers/html-templates.helper.ts
|
|
6228
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
6229
|
+
*/
|
|
6230
|
+
/*
|
|
6231
|
+
* Helper Class
|
|
6232
|
+
* Used for dynamic templates manipulation
|
|
6233
|
+
* */
|
|
6234
|
+
var /*
|
|
6235
|
+
* Helper Class
|
|
6236
|
+
* Used for dynamic templates manipulation
|
|
6237
|
+
* */
|
|
6238
|
+
HtmlTemplatesHelper = /** @class */ (function () {
|
|
6239
|
+
function HtmlTemplatesHelper() {
|
|
6240
|
+
}
|
|
6241
|
+
/*
|
|
6242
|
+
* Sets described by string depending if
|
|
6243
|
+
* there is an error, error and hit or nothing
|
|
6244
|
+
* */
|
|
6245
|
+
/*
|
|
6246
|
+
* Sets described by string depending if
|
|
6247
|
+
* there is an error, error and hit or nothing
|
|
6248
|
+
* */
|
|
6249
|
+
/**
|
|
6250
|
+
* @param {?} errorMessage
|
|
6251
|
+
* @param {?} config
|
|
6252
|
+
* @return {?}
|
|
6253
|
+
*/
|
|
6254
|
+
HtmlTemplatesHelper.setDescribedBy = /*
|
|
6255
|
+
* Sets described by string depending if
|
|
6256
|
+
* there is an error, error and hit or nothing
|
|
6257
|
+
* */
|
|
6258
|
+
/**
|
|
6259
|
+
* @param {?} errorMessage
|
|
6260
|
+
* @param {?} config
|
|
6261
|
+
* @return {?}
|
|
6262
|
+
*/
|
|
6263
|
+
function (errorMessage, config) {
|
|
6264
|
+
if (!errorMessage) {
|
|
6265
|
+
return config.hint ? config.id + "-hint" : null;
|
|
6266
|
+
}
|
|
6267
|
+
else if (errorMessage && errorMessage.isInvalid) {
|
|
6268
|
+
return config.hint ? config.id + "-hint " + config.id + "-error" : config.id + "-error";
|
|
6269
|
+
}
|
|
6270
|
+
else {
|
|
6271
|
+
return config.hint ? config.id + "-hint" : null;
|
|
6272
|
+
}
|
|
6273
|
+
};
|
|
6274
|
+
return HtmlTemplatesHelper;
|
|
6275
|
+
}());
|
|
6276
|
+
|
|
6920
6277
|
/**
|
|
6921
6278
|
* @fileoverview added by tsickle
|
|
6922
6279
|
* Generated from: lib/gov-ui/components/gov-uk-fieldset/gov-uk-fieldset.component.ts
|
|
@@ -7064,7 +6421,7 @@ var GovUkInputComponent = /** @class */ (function () {
|
|
|
7064
6421
|
* @return {?}
|
|
7065
6422
|
*/
|
|
7066
6423
|
function () {
|
|
7067
|
-
this.config.classes =
|
|
6424
|
+
this.config.classes = 'govuk-label--m';
|
|
7068
6425
|
};
|
|
7069
6426
|
/**
|
|
7070
6427
|
* @return {?}
|
|
@@ -7078,7 +6435,7 @@ var GovUkInputComponent = /** @class */ (function () {
|
|
|
7078
6435
|
GovUkInputComponent.decorators = [
|
|
7079
6436
|
{ type: Component, args: [{
|
|
7080
6437
|
selector: 'xuilib-gov-uk-input',
|
|
7081
|
-
template: "<div class=\"govuk-form-group gov-uk-input\" [formGroup]=\"group\"\n[ngClass]=\"{'govuk-form-group--error': errorMessage?.isInvalid}\">\n\n<xuilib-gov-label [config]=\"config\"></xuilib-gov-label>\n\n<span *ngIf=\"config.hint\" [id]=\"config.id +'-hint'\" class=\"govuk-hint\">\n {{config.hint}}\n</span>\n\n<xuilib-gov-uk-error-message [config]=\"config\" [errorMessage]=\"errorMessage\"></xuilib-gov-uk-error-message>\n\n<input class=\"govuk-input\"\n [
|
|
6438
|
+
template: "<div class=\"govuk-form-group gov-uk-input\" [formGroup]=\"group\"\n[ngClass]=\"{'govuk-form-group--error': errorMessage?.isInvalid}\">\n\n<xuilib-gov-label [config]=\"config\"></xuilib-gov-label>\n\n<span *ngIf=\"config.hint\" [id]=\"config.id +'-hint'\" class=\"govuk-hint\">\n {{config.hint}}\n</span>\n\n<xuilib-gov-uk-error-message [config]=\"config\" [errorMessage]=\"errorMessage\"></xuilib-gov-uk-error-message>\n\n<input class=\"govuk-input\"\n [ngClass]=\"{'govuk-input--error': errorMessage?.isInvalid}\"\n [id]=\"config.id\"\n [name]=\"config.name\"\n [type]=\"config.type\"\n [attr.aria-invalid]=\"errorMessage?.isInvalid\"\n [formControlName]=\"config.name\"\n [attr.aria-describedby]='setDescribedBy()'>\n</div>\n",
|
|
7082
6439
|
styles: [".gov-uk-input input:disabled{background:#b1b4b6}"]
|
|
7083
6440
|
}] }
|
|
7084
6441
|
];
|
|
@@ -7109,8 +6466,7 @@ var GovUkLabelComponent = /** @class */ (function () {
|
|
|
7109
6466
|
GovUkLabelComponent.decorators = [
|
|
7110
6467
|
{ type: Component, args: [{
|
|
7111
6468
|
selector: 'xuilib-gov-label',
|
|
7112
|
-
template: "<h1 *ngIf=\"config.isPageHeading else noHeading\">\n <label *ngIf=\"config.label\" [
|
|
7113
|
-
styles: [".govuk-label{display:flex;align-items:center;flex-wrap:wrap}.govuk-label__optional{font-weight:400;font-size:16px;display:inline-block;margin-left:.75rem}"]
|
|
6469
|
+
template: "<h1 *ngIf=\"config.isPageHeading else noHeading\">\n <label *ngIf=\"config.label\" [class]=\"config.classes + ' govuk-label'\"\n [for]=\"config.id\" [innerHTML]=\"config.label\">\n </label>\n</h1>\n<ng-template #noHeading>\n <label *ngIf=\"config.label\" [class]=\"config.classes + ' govuk-label'\"\n [for]=\"config.id\" [innerHTML]=\"config.label\">\n </label>\n</ng-template>"
|
|
7114
6470
|
}] }
|
|
7115
6471
|
];
|
|
7116
6472
|
/** @nocollapse */
|
|
@@ -7229,7 +6585,7 @@ var GovUkSelectComponent = /** @class */ (function () {
|
|
|
7229
6585
|
GovUkSelectComponent.decorators = [
|
|
7230
6586
|
{ type: Component, args: [{
|
|
7231
6587
|
selector: 'xuilib-gov-select',
|
|
7232
|
-
template: "<div class=\"govuk-form-group\" [formGroup]=\"group\"\n[ngClass]=\"{'govuk-form-group--error': errorMessage?.isInvalid}\">\n<xuilib-gov-label [config]=\"config\"></xuilib-gov-label>\n<span *ngIf=\"config.hint\" [id]=\"config.id +'-hint'\" class=\"govuk-hint\">\n {{config.hint}}\n</span>\n<xuilib-gov-uk-error-message [config]=\"config\" [errorMessage]=\"errorMessage\"></xuilib-gov-uk-error-message>\n\n<select class=\"govuk-select\"
|
|
6588
|
+
template: "<div class=\"govuk-form-group\" [formGroup]=\"group\"\n[ngClass]=\"{'govuk-form-group--error': errorMessage?.isInvalid}\">\n<xuilib-gov-label [config]=\"config\"></xuilib-gov-label>\n<span *ngIf=\"config.hint\" [id]=\"config.id +'-hint'\" class=\"govuk-hint\">\n {{config.hint}}\n</span>\n<xuilib-gov-uk-error-message [config]=\"config\" [errorMessage]=\"errorMessage\"></xuilib-gov-uk-error-message>\n\n<select class=\"govuk-select\" [id]=\"config.id\" [name]=\"config.id\" [formControlName]=\"config.id\" [attr.aria-describedby]='setDescribedBy()'>\n<option value=\"{{item.value}}\" *ngFor=\"let item of items\">{{item.label}}</option>\n</select>\n</div>"
|
|
7233
6589
|
}] }
|
|
7234
6590
|
];
|
|
7235
6591
|
/** @nocollapse */
|
|
@@ -7331,25 +6687,27 @@ var GovUkTextareaComponent = /** @class */ (function () {
|
|
|
7331
6687
|
* Generated from: lib/gov-ui/components/hmcts-banner/hmcts-banner.component.ts
|
|
7332
6688
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
7333
6689
|
*/
|
|
6690
|
+
/*
|
|
6691
|
+
* Hmcts Banner
|
|
6692
|
+
* Responsible for displaying prominent message and related actions
|
|
6693
|
+
* @prop message to display
|
|
6694
|
+
* @prop type
|
|
6695
|
+
* */
|
|
7334
6696
|
var HmctsBannerComponent = /** @class */ (function () {
|
|
7335
6697
|
function HmctsBannerComponent() {
|
|
7336
|
-
this.title = '';
|
|
7337
|
-
this.showMessageIcon = false;
|
|
7338
|
-
this.messageBoldText = false;
|
|
7339
6698
|
}
|
|
7340
6699
|
HmctsBannerComponent.decorators = [
|
|
7341
6700
|
{ type: Component, args: [{
|
|
7342
6701
|
selector: 'xuilib-hmcts-banner',
|
|
7343
|
-
template: "<
|
|
7344
|
-
styles: ["
|
|
6702
|
+
template: "<div class=\"hmcts-banner hmcts-banner--{{type}}\">\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"25\" width=\"25\">\n <path d=\"M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z\" /></svg>\n <div class=\"hmcts-banner__message\">\n <span class=\"hmcts-banner__assistive\">{{type}}</span>\n {{message}}\n </div>\n</div>",
|
|
6703
|
+
styles: [":host{display:block;width:100%}"]
|
|
7345
6704
|
}] }
|
|
7346
6705
|
];
|
|
6706
|
+
/** @nocollapse */
|
|
6707
|
+
HmctsBannerComponent.ctorParameters = function () { return []; };
|
|
7347
6708
|
HmctsBannerComponent.propDecorators = {
|
|
7348
|
-
message: [{ type: Input }],
|
|
7349
6709
|
type: [{ type: Input }],
|
|
7350
|
-
|
|
7351
|
-
showMessageIcon: [{ type: Input }],
|
|
7352
|
-
messageBoldText: [{ type: Input }]
|
|
6710
|
+
message: [{ type: Input }]
|
|
7353
6711
|
};
|
|
7354
6712
|
return HmctsBannerComponent;
|
|
7355
6713
|
}());
|
|
@@ -7530,7 +6888,7 @@ var HmctsMainWrapperComponent = /** @class */ (function () {
|
|
|
7530
6888
|
HmctsMainWrapperComponent.decorators = [
|
|
7531
6889
|
{ type: Component, args: [{
|
|
7532
6890
|
selector: 'xuilib-hmcts-main-wrapper',
|
|
7533
|
-
template: "<a *ngIf=\"hasBackLink\" [routerLink]=\"backLink\" (click)=\"onGoBack()\" class=\"govuk-back-link\">Back</a>\n<main id=\"content\" role=\"main\" class=\"govuk-main-wrapper\">\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <xuilib-hmcts-error-summary\n *ngIf=\"summaryErrors && !summaryErrors.isFromValid\"\n [errorMessages]=\"summaryErrors.items\"\n [header]=\"summaryErrors.header\"\n [showWarningMessage]=\"showWarningMessage\">\n </xuilib-hmcts-error-summary>\n <xuilib-hmcts-banner *ngIf=\"bannerData\"
|
|
6891
|
+
template: "<a *ngIf=\"hasBackLink\" [routerLink]=\"backLink\" (click)=\"onGoBack()\" class=\"govuk-back-link\">Back</a>\n<main id=\"content\" role=\"main\" class=\"govuk-main-wrapper\">\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <xuilib-hmcts-error-summary\n *ngIf=\"summaryErrors && !summaryErrors.isFromValid\"\n [errorMessages]=\"summaryErrors.items\"\n [header]=\"summaryErrors.header\"\n [showWarningMessage]=\"showWarningMessage\">\n </xuilib-hmcts-error-summary>\n <xuilib-hmcts-banner *ngIf=\"bannerData\" [message]=\"bannerData.message\" [type]=\"bannerData.type\"></xuilib-hmcts-banner>\n <h1 *ngIf=\"title\" class=\"govuk-heading-xl\">{{title}}</h1>\n <ng-content></ng-content>\n </div>\n <div class=\"govuk-grid-column-one-third\" *ngIf=\"actionButtons?.length > 0\">\n <div class=\"hmcts-page-heading__actions-wrapper\">\n <a\n *ngFor=\"let actionButton of actionButtons\"\n (click)=\"actionButton.action()\"\n role=\"button\"\n draggable=\"false\"\n class=\"govuk-button {{ actionButton.class }}\"\n >{{ actionButton.name }}</a>\n </div>\n </div>\n </div>\n</main>\n"
|
|
7534
6892
|
}] }
|
|
7535
6893
|
];
|
|
7536
6894
|
/** @nocollapse */
|
|
@@ -7682,33 +7040,6 @@ var RemoveHostDirective = /** @class */ (function () {
|
|
|
7682
7040
|
return RemoveHostDirective;
|
|
7683
7041
|
}());
|
|
7684
7042
|
|
|
7685
|
-
/**
|
|
7686
|
-
* @fileoverview added by tsickle
|
|
7687
|
-
* Generated from: lib/pipes/capitalize.pipe.ts
|
|
7688
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
7689
|
-
*/
|
|
7690
|
-
var CapitalizePipe = /** @class */ (function () {
|
|
7691
|
-
function CapitalizePipe() {
|
|
7692
|
-
}
|
|
7693
|
-
/**
|
|
7694
|
-
* @param {?} value
|
|
7695
|
-
* @return {?}
|
|
7696
|
-
*/
|
|
7697
|
-
CapitalizePipe.prototype.transform = /**
|
|
7698
|
-
* @param {?} value
|
|
7699
|
-
* @return {?}
|
|
7700
|
-
*/
|
|
7701
|
-
function (value) {
|
|
7702
|
-
/** @type {?} */
|
|
7703
|
-
var lowerCaseString = value.toLowerCase();
|
|
7704
|
-
return lowerCaseString.charAt(0).toUpperCase() + lowerCaseString.slice(1);
|
|
7705
|
-
};
|
|
7706
|
-
CapitalizePipe.decorators = [
|
|
7707
|
-
{ type: Pipe, args: [{ name: 'capitalize' },] }
|
|
7708
|
-
];
|
|
7709
|
-
return CapitalizePipe;
|
|
7710
|
-
}());
|
|
7711
|
-
|
|
7712
7043
|
/**
|
|
7713
7044
|
* @fileoverview added by tsickle
|
|
7714
7045
|
* Generated from: lib/exui-common-lib.module.ts
|
|
@@ -7747,7 +7078,6 @@ var COMMON_COMPONENTS = [
|
|
|
7747
7078
|
FindPersonComponent,
|
|
7748
7079
|
SearchJudicialsComponent,
|
|
7749
7080
|
FindLocationComponent,
|
|
7750
|
-
FindTaskNameComponent,
|
|
7751
7081
|
SearchLocationComponent,
|
|
7752
7082
|
FindServiceComponent,
|
|
7753
7083
|
SearchServiceComponent,
|
|
@@ -7779,17 +7109,13 @@ var GOV_UI_COMPONENTS = [
|
|
|
7779
7109
|
GovUkFileUploadComponent,
|
|
7780
7110
|
RemoveHostDirective
|
|
7781
7111
|
];
|
|
7782
|
-
/** @type {?} */
|
|
7783
|
-
var pipes = [
|
|
7784
|
-
CapitalizePipe
|
|
7785
|
-
];
|
|
7786
7112
|
var ɵ0 = windowProvider;
|
|
7787
7113
|
var ExuiCommonLibModule = /** @class */ (function () {
|
|
7788
7114
|
function ExuiCommonLibModule() {
|
|
7789
7115
|
}
|
|
7790
7116
|
ExuiCommonLibModule.decorators = [
|
|
7791
7117
|
{ type: NgModule, args: [{
|
|
7792
|
-
declarations: __spread(COMMON_COMPONENTS, GOV_UI_COMPONENTS
|
|
7118
|
+
declarations: __spread(COMMON_COMPONENTS, GOV_UI_COMPONENTS),
|
|
7793
7119
|
imports: [
|
|
7794
7120
|
CommonModule,
|
|
7795
7121
|
FormsModule,
|
|
@@ -7805,7 +7131,7 @@ var ExuiCommonLibModule = /** @class */ (function () {
|
|
|
7805
7131
|
],
|
|
7806
7132
|
exports: __spread(COMMON_COMPONENTS, GOV_UI_COMPONENTS, [
|
|
7807
7133
|
PaginatePipe
|
|
7808
|
-
]
|
|
7134
|
+
])
|
|
7809
7135
|
},] }
|
|
7810
7136
|
];
|
|
7811
7137
|
return ExuiCommonLibModule;
|
|
@@ -8625,20 +7951,21 @@ var TimeoutNotificationsService = /** @class */ (function () {
|
|
|
8625
7951
|
*/
|
|
8626
7952
|
var RoleService = /** @class */ (function () {
|
|
8627
7953
|
function RoleService() {
|
|
8628
|
-
this.pRoles =
|
|
8629
|
-
this.roles$ = this.pRoles.asObservable().pipe(skipWhile((/**
|
|
8630
|
-
* @param {?} item
|
|
8631
|
-
* @return {?}
|
|
8632
|
-
*/
|
|
8633
|
-
function (item) { return item === null; })));
|
|
7954
|
+
this.pRoles = [];
|
|
8634
7955
|
}
|
|
8635
7956
|
Object.defineProperty(RoleService.prototype, "roles", {
|
|
7957
|
+
get: /**
|
|
7958
|
+
* @return {?}
|
|
7959
|
+
*/
|
|
7960
|
+
function () {
|
|
7961
|
+
return this.pRoles;
|
|
7962
|
+
},
|
|
8636
7963
|
set: /**
|
|
8637
7964
|
* @param {?} roles
|
|
8638
7965
|
* @return {?}
|
|
8639
7966
|
*/
|
|
8640
7967
|
function (roles) {
|
|
8641
|
-
this.pRoles
|
|
7968
|
+
this.pRoles = roles;
|
|
8642
7969
|
},
|
|
8643
7970
|
enumerable: true,
|
|
8644
7971
|
configurable: true
|
|
@@ -8679,31 +8006,25 @@ var RoleGuard = /** @class */ (function () {
|
|
|
8679
8006
|
*/
|
|
8680
8007
|
function (route) {
|
|
8681
8008
|
var _this = this;
|
|
8682
|
-
|
|
8683
|
-
|
|
8009
|
+
/** @type {?} */
|
|
8010
|
+
var roles = ((/** @type {?} */ (route.data.needsRole)));
|
|
8011
|
+
/** @type {?} */
|
|
8012
|
+
var check = (/**
|
|
8013
|
+
* @param {?} roleRegEx
|
|
8684
8014
|
* @return {?}
|
|
8685
8015
|
*/
|
|
8686
|
-
function (
|
|
8687
|
-
/** @type {?} */
|
|
8688
|
-
var canActivateRoles = ((/** @type {?} */ (route.data.needsRole)));
|
|
8016
|
+
function (roleRegEx) {
|
|
8689
8017
|
/** @type {?} */
|
|
8690
|
-
var
|
|
8691
|
-
|
|
8018
|
+
var regex = new RegExp(roleRegEx);
|
|
8019
|
+
return _this.roleService.roles.some((/**
|
|
8020
|
+
* @param {?} role
|
|
8692
8021
|
* @return {?}
|
|
8693
8022
|
*/
|
|
8694
|
-
function (
|
|
8695
|
-
|
|
8696
|
-
|
|
8697
|
-
|
|
8698
|
-
|
|
8699
|
-
* @return {?}
|
|
8700
|
-
*/
|
|
8701
|
-
function (role) { return regex.test(role); }));
|
|
8702
|
-
});
|
|
8703
|
-
/** @type {?} */
|
|
8704
|
-
var match = route.data.roleMatching === RoleMatching.ALL ? canActivateRoles.every(check) : canActivateRoles.some(check);
|
|
8705
|
-
return match || _this.router.parseUrl((/** @type {?} */ (route.data.noRoleMatchRedirect)));
|
|
8706
|
-
})));
|
|
8023
|
+
function (role) { return regex.test(role); }));
|
|
8024
|
+
});
|
|
8025
|
+
/** @type {?} */
|
|
8026
|
+
var match = route.data.roleMatching === RoleMatching.ALL ? roles.every(check) : roles.some(check);
|
|
8027
|
+
return match || this.router.parseUrl((/** @type {?} */ (route.data.noRoleMatchRedirect)));
|
|
8707
8028
|
};
|
|
8708
8029
|
RoleGuard.decorators = [
|
|
8709
8030
|
{ type: Injectable, args: [{
|
|
@@ -8831,6 +8152,6 @@ var LoadingService = /** @class */ (function () {
|
|
|
8831
8152
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
8832
8153
|
*/
|
|
8833
8154
|
|
|
8834
|
-
export { AccessibilityComponent, CheckboxListComponent, ContactDetailsComponent, DueDateComponent, GenericFilterComponent, HmctsSessionDialogComponent, InviteUserFormComponent, InviteUserPermissionComponent, LoadingSpinnerComponent, SelectedCaseConfirmComponent, SelectedCaseListComponent, SelectedCaseComponent, ServiceMessageComponent, ServiceMessagesComponent, ShareCaseConfirmComponent, ShareCaseComponent, TabComponent, TcConfirmComponent, TcDisplayHtmlComponent, TcDisplayPlainComponent, TermsAndConditionsComponent, UserDetailsComponent, UserListComponent, CookieBannerComponent, FindLocationComponent, SearchLocationComponent, PaginationComponent, FeatureToggleDirective, LetContext, LetDirective, COMMON_COMPONENTS, GOV_UI_COMPONENTS, ExuiCommonLibModule, GovUiService, checkboxesBeCheckedValidator, dateValidator, radioGroupValidator, HmctsSubNavigationComponent,
|
|
8155
|
+
export { AccessibilityComponent, CheckboxListComponent, ContactDetailsComponent, DueDateComponent, GenericFilterComponent, HmctsSessionDialogComponent, InviteUserFormComponent, InviteUserPermissionComponent, LoadingSpinnerComponent, SelectedCaseConfirmComponent, SelectedCaseListComponent, SelectedCaseComponent, ServiceMessageComponent, ServiceMessagesComponent, ShareCaseConfirmComponent, ShareCaseComponent, TabComponent, TcConfirmComponent, TcDisplayHtmlComponent, TcDisplayPlainComponent, TermsAndConditionsComponent, UserDetailsComponent, UserListComponent, CookieBannerComponent, FindLocationComponent, SearchLocationComponent, PaginationComponent, FeatureToggleDirective, LetContext, LetDirective, COMMON_COMPONENTS, GOV_UI_COMPONENTS, ExuiCommonLibModule, GovUiService, checkboxesBeCheckedValidator, dateValidator, radioGroupValidator, HmctsSubNavigationComponent, SharedCaseErrorMessages, BadgeColour, DateBadgeColour, SECONDS_IN_A_DAY, AnonymousFeatureUser, LoggedInFeatureUser, BookingCheckType, PersonRole, RoleCategory, RadioFilterFieldConfig, FeatureToggleGuard, FeatureToggleService, LaunchDarklyService, GoogleAnalyticsService, GoogleTagManagerService, ManageSessionServices, TimeoutNotificationsService, RoleMatching, RoleGuard, RoleService, CookieService, HasLoadingState, LoadingService, FilterService, windowProvider, windowToken, AccessibilityComponent as ɵx, CheckboxListComponent as ɵz, ContactDetailsComponent as ɵf, CookieBannerComponent as ɵbf, DueDateComponent as ɵy, ExuiPageWrapperComponent as ɵa, FindLocationComponent as ɵbl, FindPersonComponent as ɵbh, FindServiceComponent as ɵbo, GenericFilterComponent as ɵbd, HmctsSessionDialogComponent as ɵk, InviteUserFormComponent as ɵo, InviteUserPermissionComponent as ɵn, LoadingSpinnerComponent as ɵbc, PaginationComponent as ɵbr, SearchJudicialsComponent as ɵbk, SearchLocationComponent as ɵbm, SearchServiceComponent as ɵbp, SearchVenueComponent as ɵbq, SelectedCaseConfirmComponent as ɵv, SelectedCaseListComponent as ɵt, SelectedCaseComponent as ɵu, ServiceMessageComponent as ɵba, ServiceMessagesComponent as ɵbb, ShareCaseConfirmComponent as ɵs, ShareCaseComponent as ɵp, TabComponent as ɵw, TcConfirmComponent as ɵe, TcDisplayHtmlComponent as ɵc, TcDisplayPlainComponent as ɵd, TermsAndConditionsComponent as ɵb, UserDetailsComponent as ɵm, UserListComponent as ɵl, UserSelectComponent as ɵq, FeatureToggleDirective as ɵg, LetContext as ɵi, LetDirective as ɵj, GovUkCheckboxComponent as ɵcb, GovUkCheckboxesComponent as ɵch, GovUkDateComponent as ɵcg, GovUkErrorMessageComponent as ɵce, GovUkFieldsetComponent as ɵcf, GovUkFileUploadComponent as ɵcm, GovUkFormGroupWrapperComponent as ɵcc, GovUkInputComponent as ɵca, GovUkLabelComponent as ɵcd, GovUkRadioComponent as ɵci, GovUkRadiosComponent as ɵcj, GovUkSelectComponent as ɵck, GovukTableComponent as ɵbz, GovUkTextareaComponent as ɵcl, HmctsBannerComponent as ɵby, HmctsErrorSummaryComponent as ɵbw, HmctsIdentityBarComponent as ɵbs, HmctsMainWrapperComponent as ɵbx, HmctsPaginationComponent as ɵbt, HmctsPrimaryNavigationComponent as ɵbv, HmctsSubNavigationComponent as ɵbu, RemoveHostDirective as ɵcn, CaseSharingStateService as ɵr, CookieService as ɵbg, FeatureToggleService as ɵh, FilterService as ɵbe, FindAPersonService as ɵbi, LocationService as ɵbn, SessionStorageService as ɵbj };
|
|
8835
8156
|
|
|
8836
8157
|
//# sourceMappingURL=hmcts-rpx-xui-common-lib.js.map
|