@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';
|
|
@@ -8,10 +9,10 @@ import { formatDate, DOCUMENT, CommonModule } from '@angular/common';
|
|
|
8
9
|
import { Title } from '@angular/platform-browser';
|
|
9
10
|
import { DocumentInterruptSource, Idle } from '@ng-idle/core';
|
|
10
11
|
import { Keepalive } from '@ng-idle/keepalive';
|
|
11
|
-
import {
|
|
12
|
-
import { Component, EventEmitter, Input, Output, ViewEncapsulation, Injectable,
|
|
12
|
+
import { Router, RouterModule, NavigationEnd } from '@angular/router';
|
|
13
|
+
import { Component, EventEmitter, Input, Output, ViewEncapsulation, Injectable, Directive, TemplateRef, ViewContainerRef, ElementRef, Inject, ViewChild, ChangeDetectorRef, InjectionToken, ChangeDetectionStrategy, defineInjectable, inject, NgModule } from '@angular/core';
|
|
13
14
|
import { BehaviorSubject, of, zip, Subject, combineLatest } from 'rxjs';
|
|
14
|
-
import { distinctUntilChanged, map, debounceTime, filter, mergeMap,
|
|
15
|
+
import { distinctUntilChanged, map, tap, debounceTime, filter, mergeMap, catchError, switchMap, delay } from 'rxjs/operators';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* @fileoverview added by tsickle
|
|
@@ -493,7 +494,7 @@ class FilterService {
|
|
|
493
494
|
return this.filterSettings[id];
|
|
494
495
|
}
|
|
495
496
|
if (sessionStorage.getItem(id)) {
|
|
496
|
-
return JSON.parse(sessionStorage.getItem(id));
|
|
497
|
+
return JSON.parse(window.sessionStorage.getItem(id));
|
|
497
498
|
}
|
|
498
499
|
if (localStorage.getItem(id)) {
|
|
499
500
|
if (this.isSameUser(id)) {
|
|
@@ -524,20 +525,6 @@ class FilterService {
|
|
|
524
525
|
}
|
|
525
526
|
return this.streams[id].asObservable();
|
|
526
527
|
}
|
|
527
|
-
/**
|
|
528
|
-
* @param {?} id
|
|
529
|
-
* @return {?}
|
|
530
|
-
*/
|
|
531
|
-
clearSessionAndLocalPersistance(id) {
|
|
532
|
-
sessionStorage.removeItem(id);
|
|
533
|
-
localStorage.removeItem(id);
|
|
534
|
-
if (this.filterSettings[id] !== undefined) {
|
|
535
|
-
this.filterSettings[id] = null;
|
|
536
|
-
}
|
|
537
|
-
if (this.streams[id] !== undefined) {
|
|
538
|
-
this.streams[id].next(null);
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
528
|
/**
|
|
542
529
|
* @private
|
|
543
530
|
* @param {?} setting
|
|
@@ -553,7 +540,7 @@ class FilterService {
|
|
|
553
540
|
* @return {?}
|
|
554
541
|
*/
|
|
555
542
|
persistSession(setting) {
|
|
556
|
-
sessionStorage.setItem(setting.id, JSON.stringify(setting));
|
|
543
|
+
window.sessionStorage.setItem(setting.id, JSON.stringify(setting));
|
|
557
544
|
}
|
|
558
545
|
/**
|
|
559
546
|
* @private
|
|
@@ -618,7 +605,7 @@ function minSelectedValidator(min) {
|
|
|
618
605
|
* @param {?} value
|
|
619
606
|
* @return {?}
|
|
620
607
|
*/
|
|
621
|
-
value => value)).length >= min ? null : {
|
|
608
|
+
value => value)).length >= min ? null : { minLength: true };
|
|
622
609
|
});
|
|
623
610
|
}
|
|
624
611
|
/**
|
|
@@ -675,7 +662,6 @@ class GenericFilterComponent {
|
|
|
675
662
|
this.filterService = filterService;
|
|
676
663
|
this.fb = fb;
|
|
677
664
|
this.submitted = false;
|
|
678
|
-
this.previousSelectedNestedCheckbox = [];
|
|
679
665
|
}
|
|
680
666
|
/**
|
|
681
667
|
* @return {?}
|
|
@@ -722,10 +708,10 @@ class GenericFilterComponent {
|
|
|
722
708
|
static addFormValidators(field) {
|
|
723
709
|
/** @type {?} */
|
|
724
710
|
const validators = [];
|
|
725
|
-
if (field && field.minSelected
|
|
711
|
+
if (field && field.minSelected) {
|
|
726
712
|
validators.push(minSelectedValidator(field.minSelected));
|
|
727
713
|
}
|
|
728
|
-
if (field && field.maxSelected
|
|
714
|
+
if (field && field.maxSelected) {
|
|
729
715
|
validators.push(maxSelectedValidator(field.maxSelected));
|
|
730
716
|
}
|
|
731
717
|
return validators;
|
|
@@ -743,17 +729,6 @@ class GenericFilterComponent {
|
|
|
743
729
|
* @return {?}
|
|
744
730
|
*/
|
|
745
731
|
() => this.submitted = false));
|
|
746
|
-
this.filterSkillsByServices(null, this.config);
|
|
747
|
-
/** @type {?} */
|
|
748
|
-
const services = this.config.fields.find((/**
|
|
749
|
-
* @param {?} field
|
|
750
|
-
* @return {?}
|
|
751
|
-
*/
|
|
752
|
-
field => field.name === 'user-services'));
|
|
753
|
-
if (services) {
|
|
754
|
-
this.startFilterSkillsByServices(this.form, services);
|
|
755
|
-
this.initValuesFromCacheForSkillsByServices();
|
|
756
|
-
}
|
|
757
732
|
}
|
|
758
733
|
/**
|
|
759
734
|
* @return {?}
|
|
@@ -885,11 +860,6 @@ class GenericFilterComponent {
|
|
|
885
860
|
* @return {?}
|
|
886
861
|
*/
|
|
887
862
|
inputChanged(field) {
|
|
888
|
-
if (field.name === 'user-services') {
|
|
889
|
-
/** @type {?} */
|
|
890
|
-
const selectedServices = this.getSelectedValuesForFields(this.form.controls, field);
|
|
891
|
-
this.filterSkillsByServices(selectedServices, this.config);
|
|
892
|
-
}
|
|
893
863
|
if (field.radioSelectionChange && typeof field.radioSelectionChange === 'string') {
|
|
894
864
|
const [name, value] = field.enableCondition.split('=');
|
|
895
865
|
this.form.get(name).patchValue(value);
|
|
@@ -908,9 +878,6 @@ class GenericFilterComponent {
|
|
|
908
878
|
this.filterService.persist(settings, this.config.persistence);
|
|
909
879
|
this.filterService.givenErrors.next(null);
|
|
910
880
|
this.submitted = false;
|
|
911
|
-
if (this.config.cancelButtonCallback) {
|
|
912
|
-
this.config.cancelButtonCallback();
|
|
913
|
-
}
|
|
914
881
|
}
|
|
915
882
|
/**
|
|
916
883
|
* @param {?} values
|
|
@@ -934,22 +901,6 @@ class GenericFilterComponent {
|
|
|
934
901
|
}
|
|
935
902
|
}
|
|
936
903
|
}
|
|
937
|
-
/**
|
|
938
|
-
* @param {?} field
|
|
939
|
-
* @param {?} i
|
|
940
|
-
* @return {?}
|
|
941
|
-
*/
|
|
942
|
-
checkBoxChecked(field, i) {
|
|
943
|
-
return ((/** @type {?} */ (this.form.get(field.name))))['controls'][i]['value'];
|
|
944
|
-
}
|
|
945
|
-
/**
|
|
946
|
-
* @param {?} values
|
|
947
|
-
* @param {?} field
|
|
948
|
-
* @return {?}
|
|
949
|
-
*/
|
|
950
|
-
updateTaskNameControls(values, field) {
|
|
951
|
-
this.form.get(field.name).patchValue(values);
|
|
952
|
-
}
|
|
953
904
|
/**
|
|
954
905
|
* @param {?} event
|
|
955
906
|
* @param {?} form
|
|
@@ -1033,52 +984,6 @@ class GenericFilterComponent {
|
|
|
1033
984
|
this.resetField(resetField, form);
|
|
1034
985
|
}
|
|
1035
986
|
}
|
|
1036
|
-
if (field.name === 'user-services') {
|
|
1037
|
-
this.startFilterSkillsByServices(form, field);
|
|
1038
|
-
}
|
|
1039
|
-
else if (field.name === 'user-skills') {
|
|
1040
|
-
if (isChecked) {
|
|
1041
|
-
/** @type {?} */
|
|
1042
|
-
const selectedIndex = field.options.findIndex((/**
|
|
1043
|
-
* @param {?} option
|
|
1044
|
-
* @return {?}
|
|
1045
|
-
*/
|
|
1046
|
-
option => Number(option.key) === Number(event.target.value)));
|
|
1047
|
-
/** @type {?} */
|
|
1048
|
-
const selectedCheckbox = this.form.get('user-skills').value;
|
|
1049
|
-
selectedCheckbox[selectedIndex] = true;
|
|
1050
|
-
this.form.get('user-skills').setValue(selectedCheckbox);
|
|
1051
|
-
this.previousSelectedNestedCheckbox.push(event.target.value);
|
|
1052
|
-
}
|
|
1053
|
-
else {
|
|
1054
|
-
/** @type {?} */
|
|
1055
|
-
const index = this.previousSelectedNestedCheckbox.indexOf(event.target.value);
|
|
1056
|
-
if (index !== -1) {
|
|
1057
|
-
this.previousSelectedNestedCheckbox.splice(index, 1);
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
}
|
|
1062
|
-
/**
|
|
1063
|
-
* @private
|
|
1064
|
-
* @param {?} form
|
|
1065
|
-
* @param {?} field
|
|
1066
|
-
* @return {?}
|
|
1067
|
-
*/
|
|
1068
|
-
startFilterSkillsByServices(form, field) {
|
|
1069
|
-
/** @type {?} */
|
|
1070
|
-
const servicesArray = [];
|
|
1071
|
-
form.value[field.name].map((/**
|
|
1072
|
-
* @param {?} service
|
|
1073
|
-
* @param {?} index
|
|
1074
|
-
* @return {?}
|
|
1075
|
-
*/
|
|
1076
|
-
(service, index) => {
|
|
1077
|
-
if (service) {
|
|
1078
|
-
servicesArray.push(field.options[index].key);
|
|
1079
|
-
}
|
|
1080
|
-
}));
|
|
1081
|
-
this.filterSkillsByServices(servicesArray, this.config);
|
|
1082
987
|
}
|
|
1083
988
|
/**
|
|
1084
989
|
* @private
|
|
@@ -1152,14 +1057,14 @@ class GenericFilterComponent {
|
|
|
1152
1057
|
this.form.addControl('findPersonControl', findPersonControl);
|
|
1153
1058
|
}
|
|
1154
1059
|
for (const field of config.fields) {
|
|
1155
|
-
if (field.type === 'checkbox' || field.type === 'checkbox-large'
|
|
1060
|
+
if (field.type === 'checkbox' || field.type === 'checkbox-large') {
|
|
1156
1061
|
/** @type {?} */
|
|
1157
1062
|
const formArray = this.buildCheckBoxFormArray(field, settings);
|
|
1158
1063
|
this.form.addControl(field.name, formArray);
|
|
1159
1064
|
}
|
|
1160
|
-
else if (field.type === 'find-location'
|
|
1065
|
+
else if (field.type === 'find-location') {
|
|
1161
1066
|
/** @type {?} */
|
|
1162
|
-
const formArray = this.
|
|
1067
|
+
const formArray = this.buildFindLocationFormArray(field, settings);
|
|
1163
1068
|
this.form.addControl(field.name, formArray);
|
|
1164
1069
|
}
|
|
1165
1070
|
else {
|
|
@@ -1167,12 +1072,6 @@ class GenericFilterComponent {
|
|
|
1167
1072
|
const validators = [];
|
|
1168
1073
|
if (field.minSelected && field.minSelected > 0) {
|
|
1169
1074
|
validators.push(Validators.required);
|
|
1170
|
-
if (field.type === 'text-input') {
|
|
1171
|
-
validators.push(Validators.minLength(field.minSelected));
|
|
1172
|
-
}
|
|
1173
|
-
if (field.type === 'email-input') {
|
|
1174
|
-
validators.push(Validators.email);
|
|
1175
|
-
}
|
|
1176
1075
|
}
|
|
1177
1076
|
/** @type {?} */
|
|
1178
1077
|
let defaultValue = null;
|
|
@@ -1206,7 +1105,7 @@ class GenericFilterComponent {
|
|
|
1206
1105
|
});
|
|
1207
1106
|
this.form.addControl(field.name, formGroup);
|
|
1208
1107
|
}
|
|
1209
|
-
else
|
|
1108
|
+
else {
|
|
1210
1109
|
/** @type {?} */
|
|
1211
1110
|
const control = new FormControl(defaultValue, validators);
|
|
1212
1111
|
this.form.addControl(field.name, control);
|
|
@@ -1258,7 +1157,7 @@ class GenericFilterComponent {
|
|
|
1258
1157
|
* @param {?} settings
|
|
1259
1158
|
* @return {?}
|
|
1260
1159
|
*/
|
|
1261
|
-
|
|
1160
|
+
buildFindLocationFormArray(field, settings) {
|
|
1262
1161
|
/** @type {?} */
|
|
1263
1162
|
const validators = GenericFilterComponent.addFormValidators(field);
|
|
1264
1163
|
/** @type {?} */
|
|
@@ -1300,7 +1199,7 @@ class GenericFilterComponent {
|
|
|
1300
1199
|
* @return {?}
|
|
1301
1200
|
*/
|
|
1302
1201
|
f => f.name === name));
|
|
1303
|
-
if (field.type === 'find-location'
|
|
1202
|
+
if (field.type === 'find-location') {
|
|
1304
1203
|
return { value: values, name };
|
|
1305
1204
|
}
|
|
1306
1205
|
else {
|
|
@@ -1319,281 +1218,29 @@ class GenericFilterComponent {
|
|
|
1319
1218
|
*/
|
|
1320
1219
|
emitFormErrors(form) {
|
|
1321
1220
|
/** @type {?} */
|
|
1322
|
-
|
|
1221
|
+
const errors = [];
|
|
1323
1222
|
for (const field of this.config.fields) {
|
|
1324
1223
|
/** @type {?} */
|
|
1325
1224
|
const formGroup = form.get(field.name);
|
|
1326
|
-
if (formGroup && formGroup.errors &&
|
|
1225
|
+
if (formGroup && formGroup.errors && formGroup.errors.minLength) {
|
|
1327
1226
|
errors.push({ name: field.name, error: field.minSelectedError });
|
|
1328
1227
|
}
|
|
1329
|
-
if (formGroup && formGroup.errors && formGroup.errors.
|
|
1330
|
-
errors.push({ name: field.name, error: field.
|
|
1228
|
+
if (formGroup && formGroup.errors && formGroup.errors.maxLength) {
|
|
1229
|
+
errors.push({ name: field.name, error: field.minSelectedError });
|
|
1331
1230
|
}
|
|
1332
1231
|
}
|
|
1333
|
-
// remove duplicates
|
|
1334
|
-
errors = errors.filter((/**
|
|
1335
|
-
* @param {?} filterError
|
|
1336
|
-
* @param {?} i
|
|
1337
|
-
* @param {?} arr
|
|
1338
|
-
* @return {?}
|
|
1339
|
-
*/
|
|
1340
|
-
(filterError, i, arr) => {
|
|
1341
|
-
return errors.indexOf(arr.find((/**
|
|
1342
|
-
* @param {?} item
|
|
1343
|
-
* @return {?}
|
|
1344
|
-
*/
|
|
1345
|
-
item => item.name === filterError.name))) === i;
|
|
1346
|
-
}));
|
|
1347
1232
|
if (errors.length) {
|
|
1348
1233
|
this.filterService.givenErrors.next(errors);
|
|
1349
1234
|
}
|
|
1350
1235
|
}
|
|
1351
|
-
/**
|
|
1352
|
-
* @return {?}
|
|
1353
|
-
*/
|
|
1354
|
-
initValuesFromCacheForSkillsByServices() {
|
|
1355
|
-
/** @type {?} */
|
|
1356
|
-
const cachedValues = this.filteredSkillsByServicesCheckbox.map((/**
|
|
1357
|
-
* @param {?} skill
|
|
1358
|
-
* @return {?}
|
|
1359
|
-
*/
|
|
1360
|
-
skill => {
|
|
1361
|
-
/** @type {?} */
|
|
1362
|
-
let selected = false;
|
|
1363
|
-
if (this.settings && this.settings.fields) {
|
|
1364
|
-
/** @type {?} */
|
|
1365
|
-
let isSelectedUserSkill;
|
|
1366
|
-
/** @type {?} */
|
|
1367
|
-
const selectedUserSkills = this.settings.fields.find((/**
|
|
1368
|
-
* @param {?} setting
|
|
1369
|
-
* @return {?}
|
|
1370
|
-
*/
|
|
1371
|
-
setting => setting.name === 'user-skills'));
|
|
1372
|
-
if (selectedUserSkills && selectedUserSkills.value && selectedUserSkills.value.length > 0) {
|
|
1373
|
-
isSelectedUserSkill = selectedUserSkills.value.findIndex((/**
|
|
1374
|
-
* @param {?} val
|
|
1375
|
-
* @return {?}
|
|
1376
|
-
*/
|
|
1377
|
-
val => {
|
|
1378
|
-
return String(val) === String(skill.key);
|
|
1379
|
-
}));
|
|
1380
|
-
selected = isSelectedUserSkill !== -1;
|
|
1381
|
-
}
|
|
1382
|
-
}
|
|
1383
|
-
return selected;
|
|
1384
|
-
}));
|
|
1385
|
-
this.form.get('user-skills').setValue(cachedValues);
|
|
1386
|
-
}
|
|
1387
|
-
/**
|
|
1388
|
-
* @param {?} services
|
|
1389
|
-
* @param {?} config
|
|
1390
|
-
* @return {?}
|
|
1391
|
-
*/
|
|
1392
|
-
filterSkillsByServices(services, config) {
|
|
1393
|
-
this.filteredSkillsByServices = [];
|
|
1394
|
-
this.filteredSkillsByServicesCheckbox = [];
|
|
1395
|
-
/** @type {?} */
|
|
1396
|
-
const userSkillsSelectField = config.fields.find((/**
|
|
1397
|
-
* @param {?} f
|
|
1398
|
-
* @return {?}
|
|
1399
|
-
*/
|
|
1400
|
-
f => f.name === 'user-skills' && f.type === 'group-select'));
|
|
1401
|
-
/** @type {?} */
|
|
1402
|
-
const userSkillsCheckboxField = config.fields.find((/**
|
|
1403
|
-
* @param {?} f
|
|
1404
|
-
* @return {?}
|
|
1405
|
-
*/
|
|
1406
|
-
f => f.name === 'user-skills' && f.type === 'nested-checkbox'));
|
|
1407
|
-
if (userSkillsSelectField) {
|
|
1408
|
-
/** @type {?} */
|
|
1409
|
-
const userSkills = userSkillsSelectField.groupOptions;
|
|
1410
|
-
if (!services || services.length === 0) {
|
|
1411
|
-
this.filteredSkillsByServices = userSkills;
|
|
1412
|
-
}
|
|
1413
|
-
else {
|
|
1414
|
-
services.forEach((/**
|
|
1415
|
-
* @param {?} s
|
|
1416
|
-
* @return {?}
|
|
1417
|
-
*/
|
|
1418
|
-
s => {
|
|
1419
|
-
/** @type {?} */
|
|
1420
|
-
const groupOption = userSkills.find((/**
|
|
1421
|
-
* @param {?} u
|
|
1422
|
-
* @return {?}
|
|
1423
|
-
*/
|
|
1424
|
-
u => u.group.toLowerCase() === s.toLowerCase()));
|
|
1425
|
-
if (groupOption) {
|
|
1426
|
-
this.filteredSkillsByServices.push(groupOption);
|
|
1427
|
-
}
|
|
1428
|
-
}));
|
|
1429
|
-
}
|
|
1430
|
-
}
|
|
1431
|
-
else if (userSkillsCheckboxField) {
|
|
1432
|
-
/** @type {?} */
|
|
1433
|
-
const userSkills = userSkillsCheckboxField.groupOptions;
|
|
1434
|
-
if (!services || services.length === 0) {
|
|
1435
|
-
this.filteredSkillsByServices = userSkills;
|
|
1436
|
-
}
|
|
1437
|
-
else {
|
|
1438
|
-
services.forEach((/**
|
|
1439
|
-
* @param {?} s
|
|
1440
|
-
* @return {?}
|
|
1441
|
-
*/
|
|
1442
|
-
s => {
|
|
1443
|
-
/** @type {?} */
|
|
1444
|
-
const groupOption = userSkills.find((/**
|
|
1445
|
-
* @param {?} u
|
|
1446
|
-
* @return {?}
|
|
1447
|
-
*/
|
|
1448
|
-
u => u.group.toLowerCase() === s.toLowerCase()));
|
|
1449
|
-
if (groupOption) {
|
|
1450
|
-
this.filteredSkillsByServices.push(groupOption);
|
|
1451
|
-
}
|
|
1452
|
-
}));
|
|
1453
|
-
this.filteredSkillsByServicesCheckbox = this.filteredSkillsByServices.map((/**
|
|
1454
|
-
* @param {?} skill
|
|
1455
|
-
* @return {?}
|
|
1456
|
-
*/
|
|
1457
|
-
skill => {
|
|
1458
|
-
return skill.options;
|
|
1459
|
-
})).reduce((/**
|
|
1460
|
-
* @param {?} a
|
|
1461
|
-
* @param {?} b
|
|
1462
|
-
* @return {?}
|
|
1463
|
-
*/
|
|
1464
|
-
(a, b) => {
|
|
1465
|
-
return a.concat(b);
|
|
1466
|
-
}), []);
|
|
1467
|
-
userSkillsCheckboxField.options = [];
|
|
1468
|
-
userSkillsCheckboxField.options = this.filteredSkillsByServicesCheckbox;
|
|
1469
|
-
this.form.setControl('user-skills', new FormArray([]));
|
|
1470
|
-
this.filteredSkillsByServicesCheckbox.forEach((/**
|
|
1471
|
-
* @return {?}
|
|
1472
|
-
*/
|
|
1473
|
-
() => {
|
|
1474
|
-
((/** @type {?} */ (this.form.get('user-skills')))).push(new FormControl(false));
|
|
1475
|
-
}));
|
|
1476
|
-
/** @type {?} */
|
|
1477
|
-
const prevValues = this.filteredSkillsByServicesCheckbox.map((/**
|
|
1478
|
-
* @param {?} skill
|
|
1479
|
-
* @return {?}
|
|
1480
|
-
*/
|
|
1481
|
-
skill => {
|
|
1482
|
-
/** @type {?} */
|
|
1483
|
-
let selected = false;
|
|
1484
|
-
if (this.settings && this.settings.fields) {
|
|
1485
|
-
if (this.previousSelectedNestedCheckbox.length > 0) {
|
|
1486
|
-
selected = this.previousSelectedNestedCheckbox.includes(skill.key);
|
|
1487
|
-
}
|
|
1488
|
-
/** @type {?} */
|
|
1489
|
-
let isSelectedUserSkill;
|
|
1490
|
-
/** @type {?} */
|
|
1491
|
-
const selectedUserSkills = this.settings.fields.find((/**
|
|
1492
|
-
* @param {?} setting
|
|
1493
|
-
* @return {?}
|
|
1494
|
-
*/
|
|
1495
|
-
setting => setting.name === 'user-skills'));
|
|
1496
|
-
if (selectedUserSkills && selectedUserSkills.value && selectedUserSkills.value.length > 0) {
|
|
1497
|
-
isSelectedUserSkill = selectedUserSkills.value.findIndex((/**
|
|
1498
|
-
* @param {?} val
|
|
1499
|
-
* @return {?}
|
|
1500
|
-
*/
|
|
1501
|
-
val => Number(val) === Number(skill.key)));
|
|
1502
|
-
selected = isSelectedUserSkill !== -1;
|
|
1503
|
-
}
|
|
1504
|
-
if (this.previousSelectedNestedCheckbox.length > 0) {
|
|
1505
|
-
// Pick up from previous selected
|
|
1506
|
-
selected = this.previousSelectedNestedCheckbox.includes(String(skill.key));
|
|
1507
|
-
}
|
|
1508
|
-
}
|
|
1509
|
-
return selected;
|
|
1510
|
-
}));
|
|
1511
|
-
this.form.get('user-skills').setValue(prevValues);
|
|
1512
|
-
return this.filteredSkillsByServicesCheckbox;
|
|
1513
|
-
}
|
|
1514
|
-
}
|
|
1515
|
-
this.filteredSkillsByServices = this.sortGroupOptions(this.filteredSkillsByServices);
|
|
1516
|
-
return this.filteredSkillsByServices;
|
|
1517
|
-
}
|
|
1518
|
-
/**
|
|
1519
|
-
* @private
|
|
1520
|
-
* @param {?} formValues
|
|
1521
|
-
* @param {?} field
|
|
1522
|
-
* @return {?}
|
|
1523
|
-
*/
|
|
1524
|
-
getSelectedValuesForFields(formValues, field) {
|
|
1525
|
-
/** @type {?} */
|
|
1526
|
-
const selectedValues = [];
|
|
1527
|
-
Object.keys(formValues).map((/**
|
|
1528
|
-
* @param {?} name
|
|
1529
|
-
* @return {?}
|
|
1530
|
-
*/
|
|
1531
|
-
(name) => {
|
|
1532
|
-
/** @type {?} */
|
|
1533
|
-
const values = formValues[name].value;
|
|
1534
|
-
if (name === field.name) {
|
|
1535
|
-
values.forEach((/**
|
|
1536
|
-
* @param {?} v
|
|
1537
|
-
* @return {?}
|
|
1538
|
-
*/
|
|
1539
|
-
(v) => {
|
|
1540
|
-
selectedValues.push(v.key);
|
|
1541
|
-
}));
|
|
1542
|
-
}
|
|
1543
|
-
}));
|
|
1544
|
-
return selectedValues;
|
|
1545
|
-
}
|
|
1546
|
-
/**
|
|
1547
|
-
* @private
|
|
1548
|
-
* @param {?} groupOptions
|
|
1549
|
-
* @return {?}
|
|
1550
|
-
*/
|
|
1551
|
-
sortGroupOptions(groupOptions) {
|
|
1552
|
-
/** @type {?} */
|
|
1553
|
-
const sortedResults = [];
|
|
1554
|
-
/** @type {?} */
|
|
1555
|
-
const groups = groupOptions.map((/**
|
|
1556
|
-
* @param {?} go
|
|
1557
|
-
* @return {?}
|
|
1558
|
-
*/
|
|
1559
|
-
go => go.group));
|
|
1560
|
-
groups.sort().forEach((/**
|
|
1561
|
-
* @param {?} g
|
|
1562
|
-
* @return {?}
|
|
1563
|
-
*/
|
|
1564
|
-
g => {
|
|
1565
|
-
/** @type {?} */
|
|
1566
|
-
const options = groupOptions.find((/**
|
|
1567
|
-
* @param {?} go
|
|
1568
|
-
* @return {?}
|
|
1569
|
-
*/
|
|
1570
|
-
(go) => go.group === g)).options;
|
|
1571
|
-
/** @type {?} */
|
|
1572
|
-
const sortedOptions = options.sort((/**
|
|
1573
|
-
* @param {?} a
|
|
1574
|
-
* @param {?} b
|
|
1575
|
-
* @return {?}
|
|
1576
|
-
*/
|
|
1577
|
-
(a, b) => {
|
|
1578
|
-
return a.label.toLowerCase() > b.label.toLowerCase() ? 1 : (b.label.toLowerCase() > a.label.toLowerCase() ? -1 : 0);
|
|
1579
|
-
}));
|
|
1580
|
-
/** @type {?} */
|
|
1581
|
-
const result = {
|
|
1582
|
-
group: g,
|
|
1583
|
-
options: sortedOptions
|
|
1584
|
-
};
|
|
1585
|
-
sortedResults.push(result);
|
|
1586
|
-
}));
|
|
1587
|
-
return sortedResults;
|
|
1588
|
-
}
|
|
1589
1236
|
}
|
|
1590
1237
|
GenericFilterComponent.decorators = [
|
|
1591
1238
|
{ type: Component, args: [{
|
|
1592
1239
|
selector: 'xuilib-generic-filter',
|
|
1593
|
-
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",
|
|
1240
|
+
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",
|
|
1594
1241
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1595
1242
|
encapsulation: ViewEncapsulation.None,
|
|
1596
|
-
styles: [".contain-classes .elevated-break{
|
|
1243
|
+
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}"]
|
|
1597
1244
|
}] }
|
|
1598
1245
|
];
|
|
1599
1246
|
/** @nocollapse */
|
|
@@ -1809,21 +1456,44 @@ class CaseSharingStateService {
|
|
|
1809
1456
|
return newSharedCases;
|
|
1810
1457
|
}
|
|
1811
1458
|
/**
|
|
1812
|
-
* @param {?} caseId
|
|
1813
1459
|
* @param {?} user
|
|
1460
|
+
* @param {?=} caseId
|
|
1814
1461
|
* @return {?}
|
|
1815
1462
|
*/
|
|
1816
|
-
requestUnshare(
|
|
1463
|
+
requestUnshare(user, caseId) {
|
|
1817
1464
|
/** @type {?} */
|
|
1818
1465
|
const newSharedCases = [];
|
|
1819
1466
|
for (const sharedCase of this.caseState) {
|
|
1820
|
-
|
|
1467
|
+
// If no caseId, then request unshare from all shared cases
|
|
1468
|
+
if (caseId === undefined || sharedCase.caseId === caseId) {
|
|
1821
1469
|
if (!sharedCase.pendingUnshares) {
|
|
1822
1470
|
sharedCase.pendingUnshares = [];
|
|
1823
1471
|
}
|
|
1824
1472
|
/** @type {?} */
|
|
1825
1473
|
const newPendingUnshares = sharedCase.pendingUnshares.slice();
|
|
1826
|
-
|
|
1474
|
+
// If the user is pending shared access, just remove them from pendingShares
|
|
1475
|
+
/** @type {?} */
|
|
1476
|
+
let newPendingShares;
|
|
1477
|
+
/** @type {?} */
|
|
1478
|
+
let indexOfPreviouslyAddedUser = -1;
|
|
1479
|
+
if (sharedCase.pendingShares) {
|
|
1480
|
+
indexOfPreviouslyAddedUser = sharedCase.pendingShares.findIndex((/**
|
|
1481
|
+
* @param {?} u
|
|
1482
|
+
* @return {?}
|
|
1483
|
+
*/
|
|
1484
|
+
u => u.idamId === user.idamId));
|
|
1485
|
+
if (indexOfPreviouslyAddedUser > -1) {
|
|
1486
|
+
newPendingShares = sharedCase.pendingShares.slice();
|
|
1487
|
+
newPendingShares.splice(indexOfPreviouslyAddedUser, 1);
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
// If the user does not exist in pendingShares, and already has shared access (i.e. exists in sharedWith),
|
|
1491
|
+
// request removal of shared access
|
|
1492
|
+
if (indexOfPreviouslyAddedUser === -1 && sharedCase.sharedWith && sharedCase.sharedWith.findIndex((/**
|
|
1493
|
+
* @param {?} u
|
|
1494
|
+
* @return {?}
|
|
1495
|
+
*/
|
|
1496
|
+
u => u.idamId === user.idamId)) > -1) {
|
|
1827
1497
|
if (!newPendingUnshares.some((/**
|
|
1828
1498
|
* @param {?} u
|
|
1829
1499
|
* @return {?}
|
|
@@ -1832,11 +1502,10 @@ class CaseSharingStateService {
|
|
|
1832
1502
|
newPendingUnshares.push(user);
|
|
1833
1503
|
}
|
|
1834
1504
|
}
|
|
1835
|
-
else {
|
|
1836
|
-
newPendingUnshares.push(user);
|
|
1837
|
-
}
|
|
1838
1505
|
/** @type {?} */
|
|
1839
|
-
const newSharedCase = Object.assign({}, sharedCase, { pendingUnshares: newPendingUnshares }
|
|
1506
|
+
const newSharedCase = Object.assign({}, sharedCase, { pendingUnshares: newPendingUnshares }, (newPendingShares && {
|
|
1507
|
+
pendingShares: newPendingShares
|
|
1508
|
+
}));
|
|
1840
1509
|
newSharedCases.push(newSharedCase);
|
|
1841
1510
|
}
|
|
1842
1511
|
else {
|
|
@@ -1844,7 +1513,7 @@ class CaseSharingStateService {
|
|
|
1844
1513
|
}
|
|
1845
1514
|
}
|
|
1846
1515
|
this.subject.next(newSharedCases);
|
|
1847
|
-
return;
|
|
1516
|
+
return newSharedCases;
|
|
1848
1517
|
}
|
|
1849
1518
|
/**
|
|
1850
1519
|
* @param {?} caseId
|
|
@@ -1894,11 +1563,13 @@ class CaseSharingStateService {
|
|
|
1894
1563
|
* @return {?}
|
|
1895
1564
|
*/
|
|
1896
1565
|
removeCase(caseId) {
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
this.caseState.
|
|
1900
|
-
|
|
1901
|
-
|
|
1566
|
+
if (this.caseState.length > 1) {
|
|
1567
|
+
for (let i = 0, l = this.caseState.length; i < l; i++) {
|
|
1568
|
+
if (this.caseState[i].caseId === caseId) {
|
|
1569
|
+
this.caseState.splice(i, 1);
|
|
1570
|
+
this.subject.next(this.caseState);
|
|
1571
|
+
return;
|
|
1572
|
+
}
|
|
1902
1573
|
}
|
|
1903
1574
|
}
|
|
1904
1575
|
}
|
|
@@ -1972,7 +1643,7 @@ class SelectedCaseConfirmComponent {
|
|
|
1972
1643
|
SelectedCaseConfirmComponent.decorators = [
|
|
1973
1644
|
{ type: Component, args: [{
|
|
1974
1645
|
selector: 'xuilib-selected-case-confirm',
|
|
1975
|
-
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\">
|
|
1646
|
+
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",
|
|
1976
1647
|
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%}"]
|
|
1977
1648
|
}] }
|
|
1978
1649
|
];
|
|
@@ -2098,12 +1769,6 @@ class SelectedCaseComponent {
|
|
|
2098
1769
|
this.combinedSortedShares = this.combineAndSortShares(sharedWith, pendingShares);
|
|
2099
1770
|
}
|
|
2100
1771
|
}
|
|
2101
|
-
/**
|
|
2102
|
-
* @return {?}
|
|
2103
|
-
*/
|
|
2104
|
-
onUnselect() {
|
|
2105
|
-
this.unselect.emit(this.sharedCase);
|
|
2106
|
-
}
|
|
2107
1772
|
/**
|
|
2108
1773
|
* @param {?} c
|
|
2109
1774
|
* @return {?}
|
|
@@ -2234,7 +1899,7 @@ class SelectedCaseComponent {
|
|
|
2234
1899
|
* @return {?}
|
|
2235
1900
|
*/
|
|
2236
1901
|
onRemove(user, sharedCase) {
|
|
2237
|
-
this.stateService.requestUnshare(sharedCase.caseId
|
|
1902
|
+
this.stateService.requestUnshare(user, sharedCase.caseId);
|
|
2238
1903
|
this.synchronizeStore.emit(this.shareCases);
|
|
2239
1904
|
}
|
|
2240
1905
|
/**
|
|
@@ -2330,8 +1995,8 @@ class SelectedCaseComponent {
|
|
|
2330
1995
|
SelectedCaseComponent.decorators = [
|
|
2331
1996
|
{ type: Component, args: [{
|
|
2332
1997
|
selector: 'xuilib-selected-case',
|
|
2333
|
-
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\"
|
|
2334
|
-
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:
|
|
1998
|
+
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",
|
|
1999
|
+
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}"]
|
|
2335
2000
|
}] }
|
|
2336
2001
|
];
|
|
2337
2002
|
/** @nocollapse */
|
|
@@ -2560,6 +2225,18 @@ ShareCaseConfirmComponent.propDecorators = {
|
|
|
2560
2225
|
completeLink: [{ type: Input }]
|
|
2561
2226
|
};
|
|
2562
2227
|
|
|
2228
|
+
/**
|
|
2229
|
+
* @fileoverview added by tsickle
|
|
2230
|
+
* Generated from: lib/models/case-share.model.ts
|
|
2231
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2232
|
+
*/
|
|
2233
|
+
/** @enum {string} */
|
|
2234
|
+
const SharedCaseErrorMessages = {
|
|
2235
|
+
OneCaseMustBeSelected: "At least one case must be selected",
|
|
2236
|
+
NoChangesRequested: "You have not requested any changes to case sharing",
|
|
2237
|
+
OnePersonMustBeAssigned: "At least one person must be assigned to each case",
|
|
2238
|
+
};
|
|
2239
|
+
|
|
2563
2240
|
/**
|
|
2564
2241
|
* @fileoverview added by tsickle
|
|
2565
2242
|
* Generated from: lib/components/user-select/user-select.component.ts
|
|
@@ -2660,40 +2337,76 @@ UserSelectComponent.propDecorators = {
|
|
|
2660
2337
|
class ShareCaseComponent {
|
|
2661
2338
|
/**
|
|
2662
2339
|
* @param {?} stateService
|
|
2340
|
+
* @param {?} router
|
|
2663
2341
|
*/
|
|
2664
|
-
constructor(stateService) {
|
|
2342
|
+
constructor(stateService, router) {
|
|
2665
2343
|
this.stateService = stateService;
|
|
2344
|
+
this.router = router;
|
|
2666
2345
|
this.shareCases = []; // cases selected for sharing
|
|
2667
|
-
|
|
2346
|
+
this.continueAllowed = false;
|
|
2347
|
+
this.selectedUserToRemove = null;
|
|
2668
2348
|
this.removeUserFromCaseToggleOn = false;
|
|
2669
2349
|
this.users = []; // users of this organisation the cases can be shared with
|
|
2670
2350
|
// users of this organisation the cases can be shared with
|
|
2671
2351
|
this.confirmLink = '';
|
|
2352
|
+
this.cancelLink = '';
|
|
2672
2353
|
this.showRemoveUsers = false;
|
|
2354
|
+
this.fnTitle = '';
|
|
2355
|
+
this.title = '';
|
|
2673
2356
|
this.unselect = new EventEmitter();
|
|
2674
2357
|
this.synchronizeStore = new EventEmitter();
|
|
2358
|
+
this.validationErrors = [];
|
|
2675
2359
|
}
|
|
2676
2360
|
/**
|
|
2677
2361
|
* @return {?}
|
|
2678
2362
|
*/
|
|
2679
2363
|
ngOnInit() {
|
|
2680
|
-
this.shareCases
|
|
2364
|
+
this.shareCases$
|
|
2365
|
+
.pipe(tap((/**
|
|
2366
|
+
* @param {?} sharedCases
|
|
2367
|
+
* @return {?}
|
|
2368
|
+
*/
|
|
2369
|
+
sharedCases => {
|
|
2370
|
+
// Update the list of users assigned to at least one case
|
|
2371
|
+
this.getAssignedUsers(sharedCases.filter((/**
|
|
2372
|
+
* @param {?} sharedCase
|
|
2373
|
+
* @return {?}
|
|
2374
|
+
*/
|
|
2375
|
+
sharedCase => sharedCase.sharedWith && sharedCase.sharedWith.length > 0)));
|
|
2376
|
+
})))
|
|
2377
|
+
.subscribe((/**
|
|
2681
2378
|
* @param {?} shareCases
|
|
2682
2379
|
* @return {?}
|
|
2683
2380
|
*/
|
|
2684
2381
|
shareCases => {
|
|
2685
2382
|
this.shareCases = shareCases;
|
|
2686
2383
|
this.stateService.setCases(shareCases);
|
|
2384
|
+
// Set the config to be used by the xuilib-gov-uk-error-message component, in particular the element ID to
|
|
2385
|
+
// which the error message is associated
|
|
2386
|
+
if (shareCases) {
|
|
2387
|
+
this.selectedCasesErrorMessageConfig = {
|
|
2388
|
+
id: shareCases.length > 0 ? 'cases' : 'noCaseDisplay'
|
|
2389
|
+
};
|
|
2390
|
+
}
|
|
2687
2391
|
}));
|
|
2688
2392
|
this.shareCases$ = this.stateService.state;
|
|
2393
|
+
this.shareCaseErrorMessage = { isInvalid: false, messages: [] };
|
|
2689
2394
|
}
|
|
2690
2395
|
/**
|
|
2691
2396
|
* @param {?} c
|
|
2692
2397
|
* @return {?}
|
|
2693
2398
|
*/
|
|
2694
2399
|
onUnselect(c) {
|
|
2695
|
-
this.
|
|
2696
|
-
this.stateService.
|
|
2400
|
+
this.validationErrors = [];
|
|
2401
|
+
if (this.stateService.getCases().length === 1) {
|
|
2402
|
+
this.validationErrors.push({ id: 'cases', message: SharedCaseErrorMessages.OneCaseMustBeSelected });
|
|
2403
|
+
this.shareCaseErrorMessage = { isInvalid: true, messages: [SharedCaseErrorMessages.OneCaseMustBeSelected] };
|
|
2404
|
+
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
|
|
2405
|
+
}
|
|
2406
|
+
else {
|
|
2407
|
+
this.unselect.emit(c);
|
|
2408
|
+
this.stateService.removeCase(c.caseId);
|
|
2409
|
+
}
|
|
2697
2410
|
}
|
|
2698
2411
|
/**
|
|
2699
2412
|
* @param {?} event
|
|
@@ -2720,6 +2433,18 @@ class ShareCaseComponent {
|
|
|
2720
2433
|
this.userSelect.clear();
|
|
2721
2434
|
}
|
|
2722
2435
|
this.synchronizeStore.emit(newSharedCases);
|
|
2436
|
+
// Update the list of assigned users (which includes pending users)
|
|
2437
|
+
this.getAssignedUsers(newSharedCases);
|
|
2438
|
+
}
|
|
2439
|
+
/**
|
|
2440
|
+
* @return {?}
|
|
2441
|
+
*/
|
|
2442
|
+
removeUser() {
|
|
2443
|
+
if (this.selectedUserToRemove) {
|
|
2444
|
+
/** @type {?} */
|
|
2445
|
+
const newSharedCases = this.stateService.requestUnshare(this.selectedUserToRemove);
|
|
2446
|
+
this.synchronizeStore.emit(newSharedCases);
|
|
2447
|
+
}
|
|
2723
2448
|
}
|
|
2724
2449
|
/**
|
|
2725
2450
|
* @return {?}
|
|
@@ -2728,11 +2453,15 @@ class ShareCaseComponent {
|
|
|
2728
2453
|
return this.selectedUser === null || this.shareCases.length === 0;
|
|
2729
2454
|
}
|
|
2730
2455
|
/**
|
|
2456
|
+
* Function originally used to set disabled state of "Continue" button, now called by the button click handler to
|
|
2457
|
+
* control whether navigation to the confirmation page is allowed. It is prevented if no changes have been made
|
|
2731
2458
|
* @return {?}
|
|
2732
2459
|
*/
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2460
|
+
setContinueAllowed() {
|
|
2461
|
+
// Always start with continueAllowed = false. This covers the scenario where a user might add someone for sharing
|
|
2462
|
+
// a case (so, continueAllowed = true), then removes the same user before trying to continue. This would
|
|
2463
|
+
// erroneously leave continueAllowed as true
|
|
2464
|
+
this.continueAllowed = false;
|
|
2736
2465
|
this.shareCases$.subscribe((/**
|
|
2737
2466
|
* @param {?} shareCases
|
|
2738
2467
|
* @return {?}
|
|
@@ -2740,16 +2469,15 @@ class ShareCaseComponent {
|
|
|
2740
2469
|
shareCases => {
|
|
2741
2470
|
for (const caseState of shareCases) {
|
|
2742
2471
|
if (caseState.pendingShares && caseState.pendingShares.length > 0) {
|
|
2743
|
-
|
|
2472
|
+
this.continueAllowed = true;
|
|
2744
2473
|
break;
|
|
2745
2474
|
}
|
|
2746
2475
|
if (caseState.pendingUnshares && caseState.pendingUnshares.length > 0) {
|
|
2747
|
-
|
|
2476
|
+
this.continueAllowed = true;
|
|
2748
2477
|
break;
|
|
2749
2478
|
}
|
|
2750
2479
|
}
|
|
2751
2480
|
}));
|
|
2752
|
-
return isDisabled;
|
|
2753
2481
|
}
|
|
2754
2482
|
/**
|
|
2755
2483
|
* @param {?} sharedCase
|
|
@@ -2768,35 +2496,130 @@ class ShareCaseComponent {
|
|
|
2768
2496
|
}
|
|
2769
2497
|
this.stateService.setCases(this.shareCases);
|
|
2770
2498
|
}
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
];
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
}
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2499
|
+
/**
|
|
2500
|
+
* @return {?}
|
|
2501
|
+
*/
|
|
2502
|
+
onContinue() {
|
|
2503
|
+
this.setContinueAllowed();
|
|
2504
|
+
// If continuation is not allowed, set an error message
|
|
2505
|
+
if (!this.continueAllowed) {
|
|
2506
|
+
this.validationErrors = [];
|
|
2507
|
+
this.validationErrors.push({ id: 'cases', message: SharedCaseErrorMessages.NoChangesRequested });
|
|
2508
|
+
this.shareCaseErrorMessage = { isInvalid: true, messages: [SharedCaseErrorMessages.NoChangesRequested] };
|
|
2509
|
+
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
|
|
2510
|
+
}
|
|
2511
|
+
// Navigate to confirmation page only if allowed to continue
|
|
2512
|
+
if (this.continueAllowed) {
|
|
2513
|
+
// Check that no case is left unassigned; a user can be removed only if there is another current user, or if at
|
|
2514
|
+
// least one user is to be added. Prevent navigation to confirmation page if there is at least one case left in
|
|
2515
|
+
// an unassigned state
|
|
2516
|
+
if (this.hasCasesLeftUnassigned(this.shareCases)) {
|
|
2517
|
+
this.validationErrors = [];
|
|
2518
|
+
this.validationErrors.push({ id: 'cases', message: SharedCaseErrorMessages.OnePersonMustBeAssigned });
|
|
2519
|
+
this.shareCaseErrorMessage = { isInvalid: true, messages: [SharedCaseErrorMessages.OnePersonMustBeAssigned] };
|
|
2520
|
+
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
|
|
2521
|
+
}
|
|
2522
|
+
else {
|
|
2523
|
+
this.router.navigate([this.confirmLink]);
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
}
|
|
2527
|
+
/**
|
|
2528
|
+
* Gets a unique list of all users that have been assigned, or are pending assigment to, at least one case
|
|
2529
|
+
* @param {?} sharedCases The list of shared cases from which to get users these are shared with, or are to be shared with
|
|
2530
|
+
* @return {?}
|
|
2531
|
+
*/
|
|
2532
|
+
getAssignedUsers(sharedCases) {
|
|
2533
|
+
/** @type {?} */
|
|
2534
|
+
const users = [];
|
|
2535
|
+
sharedCases.forEach((/**
|
|
2536
|
+
* @param {?} sharedCase
|
|
2537
|
+
* @return {?}
|
|
2538
|
+
*/
|
|
2539
|
+
sharedCase => {
|
|
2540
|
+
if (sharedCase.sharedWith) {
|
|
2541
|
+
sharedCase.sharedWith.forEach((/**
|
|
2542
|
+
* @param {?} user
|
|
2543
|
+
* @return {?}
|
|
2544
|
+
*/
|
|
2545
|
+
user => {
|
|
2546
|
+
if (!users.some((/**
|
|
2547
|
+
* @param {?} existingUser
|
|
2548
|
+
* @return {?}
|
|
2549
|
+
*/
|
|
2550
|
+
existingUser => user.idamId === existingUser.idamId))) {
|
|
2551
|
+
users.push(user);
|
|
2552
|
+
}
|
|
2553
|
+
}));
|
|
2554
|
+
}
|
|
2555
|
+
if (sharedCase.pendingShares) {
|
|
2556
|
+
sharedCase.pendingShares.forEach((/**
|
|
2557
|
+
* @param {?} user
|
|
2558
|
+
* @return {?}
|
|
2559
|
+
*/
|
|
2560
|
+
user => {
|
|
2561
|
+
if (!users.some((/**
|
|
2562
|
+
* @param {?} existingUser
|
|
2563
|
+
* @return {?}
|
|
2564
|
+
*/
|
|
2565
|
+
existingUser => user.idamId === existingUser.idamId))) {
|
|
2566
|
+
users.push(user);
|
|
2567
|
+
}
|
|
2568
|
+
}));
|
|
2569
|
+
}
|
|
2570
|
+
}));
|
|
2571
|
+
this.assignedUsers = users;
|
|
2572
|
+
}
|
|
2573
|
+
/**
|
|
2574
|
+
* Checks if any shared cases have been left unassigned. This occurs if a shared case has a number of pending
|
|
2575
|
+
* unshares equal to the number of current shares, and there are no pending shares.
|
|
2576
|
+
* @param {?} sharedCases The array of shared cases to check
|
|
2577
|
+
* @return {?} `true` if at least one case has the condition described above; `false` otherwise
|
|
2578
|
+
*/
|
|
2579
|
+
hasCasesLeftUnassigned(sharedCases) {
|
|
2580
|
+
return sharedCases.some((/**
|
|
2581
|
+
* @param {?} sharedCase
|
|
2582
|
+
* @return {?}
|
|
2583
|
+
*/
|
|
2584
|
+
sharedCase => {
|
|
2585
|
+
return sharedCase.pendingUnshares && sharedCase.sharedWith &&
|
|
2586
|
+
sharedCase.pendingUnshares.length === sharedCase.sharedWith.length &&
|
|
2587
|
+
(!sharedCase.pendingShares || sharedCase.pendingShares.length === 0);
|
|
2588
|
+
}));
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
ShareCaseComponent.decorators = [
|
|
2592
|
+
{ type: Component, args: [{
|
|
2593
|
+
selector: 'xuilib-share-case',
|
|
2594
|
+
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",
|
|
2595
|
+
styles: ["select{width:100%}"]
|
|
2596
|
+
}] }
|
|
2597
|
+
];
|
|
2598
|
+
/** @nocollapse */
|
|
2599
|
+
ShareCaseComponent.ctorParameters = () => [
|
|
2600
|
+
{ type: CaseSharingStateService },
|
|
2601
|
+
{ type: Router }
|
|
2602
|
+
];
|
|
2603
|
+
ShareCaseComponent.propDecorators = {
|
|
2604
|
+
removeUserFromCaseToggleOn: [{ type: Input }],
|
|
2605
|
+
shareCases$: [{ type: Input }],
|
|
2606
|
+
users: [{ type: Input }],
|
|
2607
|
+
confirmLink: [{ type: Input }],
|
|
2608
|
+
cancelLink: [{ type: Input }],
|
|
2609
|
+
addUserLabel: [{ type: Input }],
|
|
2610
|
+
showRemoveUsers: [{ type: Input }],
|
|
2611
|
+
fnTitle: [{ type: Input }],
|
|
2612
|
+
title: [{ type: Input }],
|
|
2613
|
+
unselect: [{ type: Output }],
|
|
2614
|
+
synchronizeStore: [{ type: Output }],
|
|
2615
|
+
userSelect: [{ type: ViewChild, args: [UserSelectComponent,] }]
|
|
2616
|
+
};
|
|
2617
|
+
|
|
2618
|
+
/**
|
|
2619
|
+
* @fileoverview added by tsickle
|
|
2620
|
+
* Generated from: lib/components/tab/tab.component.ts
|
|
2621
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2622
|
+
*/
|
|
2800
2623
|
class TabComponent {
|
|
2801
2624
|
constructor() {
|
|
2802
2625
|
this.tabChange = new EventEmitter();
|
|
@@ -3229,12 +3052,6 @@ CookieBannerComponent.propDecorators = {
|
|
|
3229
3052
|
acceptanceNotifier: [{ type: Output }]
|
|
3230
3053
|
};
|
|
3231
3054
|
|
|
3232
|
-
/**
|
|
3233
|
-
* @fileoverview added by tsickle
|
|
3234
|
-
* Generated from: lib/models/case-share.model.ts
|
|
3235
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3236
|
-
*/
|
|
3237
|
-
|
|
3238
3055
|
/**
|
|
3239
3056
|
* @fileoverview added by tsickle
|
|
3240
3057
|
* Generated from: lib/models/contact-details.model.ts
|
|
@@ -3291,7 +3108,7 @@ const PersonRole = {
|
|
|
3291
3108
|
JUDICIAL: "Judicial",
|
|
3292
3109
|
CASEWORKER: "Legal Ops",
|
|
3293
3110
|
ADMIN: "Admin",
|
|
3294
|
-
CTSC: "CTSC
|
|
3111
|
+
CTSC: "CTSC",
|
|
3295
3112
|
ALL: "All",
|
|
3296
3113
|
};
|
|
3297
3114
|
/** @enum {string} */
|
|
@@ -3401,7 +3218,7 @@ LocationService.ctorParameters = () => [
|
|
|
3401
3218
|
|
|
3402
3219
|
/**
|
|
3403
3220
|
* @fileoverview added by tsickle
|
|
3404
|
-
* Generated from: lib/services/
|
|
3221
|
+
* Generated from: lib/services/session-storage/session-storage.service.ts
|
|
3405
3222
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3406
3223
|
*/
|
|
3407
3224
|
class SessionStorageService {
|
|
@@ -3646,7 +3463,7 @@ SearchLocationComponent.decorators = [
|
|
|
3646
3463
|
{ type: Component, args: [{
|
|
3647
3464
|
selector: 'exui-search-location',
|
|
3648
3465
|
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",
|
|
3649
|
-
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
|
|
3466
|
+
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}"]
|
|
3650
3467
|
}] }
|
|
3651
3468
|
];
|
|
3652
3469
|
/** @nocollapse */
|
|
@@ -3854,8 +3671,8 @@ class FindLocationComponent {
|
|
|
3854
3671
|
FindLocationComponent.decorators = [
|
|
3855
3672
|
{ type: Component, args: [{
|
|
3856
3673
|
selector: 'xuilib-find-location',
|
|
3857
|
-
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
|
|
3858
|
-
styles: ["
|
|
3674
|
+
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",
|
|
3675
|
+
styles: [""]
|
|
3859
3676
|
}] }
|
|
3860
3677
|
];
|
|
3861
3678
|
FindLocationComponent.propDecorators = {
|
|
@@ -4426,445 +4243,129 @@ class FindPersonComponent {
|
|
|
4426
4243
|
({ id }) => id));
|
|
4427
4244
|
return persons.filter((/**
|
|
4428
4245
|
* @param {?} __0
|
|
4429
|
-
* @return {?}
|
|
4430
|
-
*/
|
|
4431
|
-
({ id }) => !ids.includes(id)));
|
|
4432
|
-
})));
|
|
4433
|
-
}
|
|
4434
|
-
case PersonRole.ALL: {
|
|
4435
|
-
return zip(findJudicialOrCTSCPeople, findCaseworkersOrAdminsOrCtsc).pipe(map((/**
|
|
4436
|
-
* @param {?} separatePeople
|
|
4437
|
-
* @return {?}
|
|
4438
|
-
*/
|
|
4439
|
-
separatePeople => separatePeople[0].concat(separatePeople[1]))));
|
|
4440
|
-
}
|
|
4441
|
-
case PersonRole.CTSC:
|
|
4442
|
-
case PersonRole.CASEWORKER:
|
|
4443
|
-
case PersonRole.ADMIN: {
|
|
4444
|
-
return findCaseworkersOrAdminsOrCtsc;
|
|
4445
|
-
}
|
|
4446
|
-
default: {
|
|
4447
|
-
return of([]);
|
|
4448
|
-
}
|
|
4449
|
-
}
|
|
4450
|
-
}
|
|
4451
|
-
return of([]);
|
|
4452
|
-
}
|
|
4453
|
-
/**
|
|
4454
|
-
* @param {?} selectedPerson
|
|
4455
|
-
* @return {?}
|
|
4456
|
-
*/
|
|
4457
|
-
onSelectionChange(selectedPerson) {
|
|
4458
|
-
this.personSelected.emit(selectedPerson);
|
|
4459
|
-
this.findPersonControl.setValue(this.getDisplayName(selectedPerson), { emitEvent: false, onlySelf: true });
|
|
4460
|
-
}
|
|
4461
|
-
/**
|
|
4462
|
-
* @param {?} selectedPerson
|
|
4463
|
-
* @return {?}
|
|
4464
|
-
*/
|
|
4465
|
-
getDisplayName(selectedPerson) {
|
|
4466
|
-
if (!selectedPerson) {
|
|
4467
|
-
return '';
|
|
4468
|
-
}
|
|
4469
|
-
if (selectedPerson.domain === PersonRole.JUDICIAL && selectedPerson.fullName) {
|
|
4470
|
-
return `${selectedPerson.fullName} (${selectedPerson.email})`;
|
|
4471
|
-
}
|
|
4472
|
-
return selectedPerson.email ? `${selectedPerson.name} (${selectedPerson.email})` : selectedPerson.name;
|
|
4473
|
-
}
|
|
4474
|
-
/**
|
|
4475
|
-
* @return {?}
|
|
4476
|
-
*/
|
|
4477
|
-
onInput() {
|
|
4478
|
-
this.personFieldChanged.emit();
|
|
4479
|
-
}
|
|
4480
|
-
}
|
|
4481
|
-
FindPersonComponent.decorators = [
|
|
4482
|
-
{ type: Component, args: [{
|
|
4483
|
-
selector: 'xuilib-find-person',
|
|
4484
|
-
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]=\"findPersonGroup\"\n [ngClass]=\"{'form-group-error': findPersonGroup.get('findPersonControl').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=\"findPersonGroup && findPersonGroup.errors\">\n <span class=\"govuk-visually-hidden\">Error:</span>{{findPersonGroup.errors.error ? findPersonGroup.errors.error : errorMessage}}\n </span>\n <input id=\"inputSelectPerson{{idValue}}\" type=\"text\" aria-label=\"select a person\"\n formControlName=\"findPersonControl\"\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 {{getDisplayName(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",
|
|
4485
|
-
styles: [".mat-option:hover{background:#2596be}.mat-option.select-option:hover{background:#1d70b8;color:#fff}.hide-autocomplete{display:none}"]
|
|
4486
|
-
}] }
|
|
4487
|
-
];
|
|
4488
|
-
/** @nocollapse */
|
|
4489
|
-
FindPersonComponent.ctorParameters = () => [
|
|
4490
|
-
{ type: FindAPersonService },
|
|
4491
|
-
{ type: ChangeDetectorRef }
|
|
4492
|
-
];
|
|
4493
|
-
FindPersonComponent.propDecorators = {
|
|
4494
|
-
personSelected: [{ type: Output }],
|
|
4495
|
-
personFieldChanged: [{ type: Output }],
|
|
4496
|
-
title: [{ type: Input }],
|
|
4497
|
-
boldTitle: [{ type: Input }],
|
|
4498
|
-
subTitle: [{ type: Input }],
|
|
4499
|
-
domain: [{ type: Input }],
|
|
4500
|
-
findPersonGroup: [{ type: Input }],
|
|
4501
|
-
selectedPerson: [{ type: Input }],
|
|
4502
|
-
submitted: [{ type: Input }],
|
|
4503
|
-
userIncluded: [{ type: Input }],
|
|
4504
|
-
assignedUser: [{ type: Input }],
|
|
4505
|
-
placeholderContent: [{ type: Input }],
|
|
4506
|
-
isNoResultsShown: [{ type: Input }],
|
|
4507
|
-
showUpdatedColor: [{ type: Input }],
|
|
4508
|
-
selectedPersons: [{ type: Input }],
|
|
4509
|
-
errorMessage: [{ type: Input }],
|
|
4510
|
-
idValue: [{ type: Input }],
|
|
4511
|
-
services: [{ type: Input }],
|
|
4512
|
-
disabled: [{ type: Input }]
|
|
4513
|
-
};
|
|
4514
|
-
|
|
4515
|
-
/**
|
|
4516
|
-
* @fileoverview added by tsickle
|
|
4517
|
-
* Generated from: lib/components/find-service/find-service.component.ts
|
|
4518
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4519
|
-
*/
|
|
4520
|
-
class FindServiceComponent {
|
|
4521
|
-
constructor() {
|
|
4522
|
-
this.services = [];
|
|
4523
|
-
this.selectedServices = [];
|
|
4524
|
-
this.enableAddServiceButton = true;
|
|
4525
|
-
this.disabled = false;
|
|
4526
|
-
this.serviceFieldChanged = new EventEmitter();
|
|
4527
|
-
this.tempSelectedService = null;
|
|
4528
|
-
}
|
|
4529
|
-
/**
|
|
4530
|
-
* @return {?}
|
|
4531
|
-
*/
|
|
4532
|
-
ngOnInit() {
|
|
4533
|
-
this.selectedServices = this.selectedServices !== null ? this.selectedServices.filter((/**
|
|
4534
|
-
* @param {?} service
|
|
4535
|
-
* @return {?}
|
|
4536
|
-
*/
|
|
4537
|
-
(service) => service.key)) : [];
|
|
4538
|
-
this.SortAnOptions();
|
|
4539
|
-
}
|
|
4540
|
-
/**
|
|
4541
|
-
* @return {?}
|
|
4542
|
-
*/
|
|
4543
|
-
addService() {
|
|
4544
|
-
if (this.tempSelectedService === null) {
|
|
4545
|
-
return;
|
|
4546
|
-
}
|
|
4547
|
-
this.selectedServices = [...this.selectedServices, this.tempSelectedService];
|
|
4548
|
-
this.addSelectedServicesToForm([this.tempSelectedService]);
|
|
4549
|
-
this.services = this.services.filter((/**
|
|
4550
|
-
* @param {?} s
|
|
4551
|
-
* @return {?}
|
|
4552
|
-
*/
|
|
4553
|
-
s => s.key !== this.tempSelectedService.key));
|
|
4554
|
-
this.tempSelectedService = null;
|
|
4555
|
-
this.serviceFieldChanged.emit();
|
|
4556
|
-
}
|
|
4557
|
-
/**
|
|
4558
|
-
* @param {?} service
|
|
4559
|
-
* @return {?}
|
|
4560
|
-
*/
|
|
4561
|
-
removeService(service) {
|
|
4562
|
-
if (service.key) {
|
|
4563
|
-
this.selectedServices = this.selectedServices !== null ? this.selectedServices.filter((/**
|
|
4564
|
-
* @param {?} selectedService
|
|
4565
|
-
* @return {?}
|
|
4566
|
-
*/
|
|
4567
|
-
(selectedService) => selectedService.key !== service.key)) : [];
|
|
4568
|
-
/** @type {?} */
|
|
4569
|
-
const formArray = (/** @type {?} */ (this.form.get(this.field.name)));
|
|
4570
|
-
/** @type {?} */
|
|
4571
|
-
const index = (formArray.value).findIndex((/**
|
|
4572
|
-
* @param {?} selectedService
|
|
4573
|
-
* @return {?}
|
|
4574
|
-
*/
|
|
4575
|
-
(selectedService) => selectedService.key === service.key));
|
|
4576
|
-
if (index > -1) {
|
|
4577
|
-
formArray.removeAt(index);
|
|
4578
|
-
this.services.splice(index, 0, service);
|
|
4579
|
-
this.SortAnOptions();
|
|
4580
|
-
}
|
|
4581
|
-
this.serviceFieldChanged.emit();
|
|
4582
|
-
}
|
|
4583
|
-
}
|
|
4584
|
-
/**
|
|
4585
|
-
* @param {?} service
|
|
4586
|
-
* @return {?}
|
|
4587
|
-
*/
|
|
4588
|
-
onServiceSelected(service) {
|
|
4589
|
-
if (!service) {
|
|
4590
|
-
this.tempSelectedService = null;
|
|
4591
|
-
return;
|
|
4592
|
-
}
|
|
4593
|
-
if (this.field.maxSelected === 1) {
|
|
4594
|
-
this.removeSelectedValues();
|
|
4595
|
-
this.addSelectedServicesToForm([service]);
|
|
4596
|
-
}
|
|
4597
|
-
else {
|
|
4598
|
-
if (!this.selectedServices.find((/**
|
|
4599
|
-
* @param {?} s
|
|
4600
|
-
* @return {?}
|
|
4601
|
-
*/
|
|
4602
|
-
s => s.key === service.key))) {
|
|
4603
|
-
if (service.key) {
|
|
4604
|
-
this.tempSelectedService = service;
|
|
4605
|
-
}
|
|
4606
|
-
}
|
|
4607
|
-
}
|
|
4608
|
-
}
|
|
4609
|
-
/**
|
|
4610
|
-
* @private
|
|
4611
|
-
* @return {?}
|
|
4612
|
-
*/
|
|
4613
|
-
removeSelectedValues() {
|
|
4614
|
-
/** @type {?} */
|
|
4615
|
-
const formArray = (/** @type {?} */ (this.form.get(this.field.name)));
|
|
4616
|
-
for (let i = 0; i < formArray.length; i++) {
|
|
4617
|
-
formArray.removeAt(i);
|
|
4618
|
-
}
|
|
4619
|
-
this.selectedServices = [];
|
|
4620
|
-
}
|
|
4621
|
-
/**
|
|
4622
|
-
* @private
|
|
4623
|
-
* @param {?} services
|
|
4624
|
-
* @return {?}
|
|
4625
|
-
*/
|
|
4626
|
-
addSelectedServicesToForm(services) {
|
|
4627
|
-
/** @type {?} */
|
|
4628
|
-
const formArray = (/** @type {?} */ (this.form.get(this.field.name)));
|
|
4629
|
-
for (const service of services) {
|
|
4630
|
-
formArray.push(new FormControl(service));
|
|
4631
|
-
}
|
|
4632
|
-
}
|
|
4633
|
-
/**
|
|
4634
|
-
* @private
|
|
4635
|
-
* @return {?}
|
|
4636
|
-
*/
|
|
4637
|
-
SortAnOptions() {
|
|
4638
|
-
return this.services.sort((/**
|
|
4639
|
-
* @param {?} a
|
|
4640
|
-
* @param {?} b
|
|
4641
|
-
* @return {?}
|
|
4642
|
-
*/
|
|
4643
|
-
(a, b) => {
|
|
4644
|
-
return a.label.toLowerCase() > b.label.toLowerCase() ? 1 : (b.label.toLowerCase() > a.label.toLowerCase() ? -1 : 0);
|
|
4645
|
-
}));
|
|
4646
|
-
}
|
|
4647
|
-
}
|
|
4648
|
-
FindServiceComponent.decorators = [
|
|
4649
|
-
{ type: Component, args: [{
|
|
4650
|
-
selector: 'xuilib-find-service',
|
|
4651
|
-
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>",
|
|
4652
|
-
styles: ["#add-service{background-color:#ddd}.search-service__input-container{display:flex}.search-service__input{flex:1 0 auto}"]
|
|
4653
|
-
}] }
|
|
4654
|
-
];
|
|
4655
|
-
FindServiceComponent.propDecorators = {
|
|
4656
|
-
field: [{ type: Input }],
|
|
4657
|
-
fields: [{ type: Input }],
|
|
4658
|
-
serviceTitle: [{ type: Input }],
|
|
4659
|
-
form: [{ type: Input }],
|
|
4660
|
-
services: [{ type: Input }],
|
|
4661
|
-
selectedServices: [{ type: Input }],
|
|
4662
|
-
enableAddServiceButton: [{ type: Input }],
|
|
4663
|
-
disabled: [{ type: Input }],
|
|
4664
|
-
serviceFieldChanged: [{ type: Output }]
|
|
4665
|
-
};
|
|
4666
|
-
|
|
4667
|
-
/**
|
|
4668
|
-
* @fileoverview added by tsickle
|
|
4669
|
-
* Generated from: lib/services/task-name/task-name.service.ts
|
|
4670
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4671
|
-
*/
|
|
4672
|
-
class TaskNameService {
|
|
4673
|
-
/**
|
|
4674
|
-
* @param {?} http
|
|
4675
|
-
* @param {?} sessionStorageService
|
|
4676
|
-
*/
|
|
4677
|
-
constructor(http, sessionStorageService) {
|
|
4678
|
-
this.http = http;
|
|
4679
|
-
this.sessionStorageService = sessionStorageService;
|
|
4680
|
-
}
|
|
4681
|
-
/**
|
|
4682
|
-
* @return {?} Observable<any[]>: Array of taskName in Observable
|
|
4683
|
-
*/
|
|
4684
|
-
getTaskName() {
|
|
4685
|
-
if (this.sessionStorageService.getItem(TaskNameService.taskNamesKey)) {
|
|
4686
|
-
/** @type {?} */
|
|
4687
|
-
const taskNames = JSON.parse(this.sessionStorageService.getItem(TaskNameService.taskNamesKey));
|
|
4688
|
-
return of((/** @type {?} */ (taskNames)));
|
|
4689
|
-
}
|
|
4690
|
-
return this.http.get(`/workallocation/taskNames`).pipe(tap((/**
|
|
4691
|
-
* @param {?} taskNames
|
|
4692
|
-
* @return {?}
|
|
4693
|
-
*/
|
|
4694
|
-
taskNames => this.sessionStorageService.setItem(TaskNameService.taskNamesKey, JSON.stringify(taskNames)))));
|
|
4695
|
-
}
|
|
4696
|
-
}
|
|
4697
|
-
TaskNameService.taskNamesKey = 'taskNames';
|
|
4698
|
-
TaskNameService.decorators = [
|
|
4699
|
-
{ type: Injectable, args: [{
|
|
4700
|
-
providedIn: 'root'
|
|
4701
|
-
},] }
|
|
4702
|
-
];
|
|
4703
|
-
/** @nocollapse */
|
|
4704
|
-
TaskNameService.ctorParameters = () => [
|
|
4705
|
-
{ type: HttpClient },
|
|
4706
|
-
{ type: SessionStorageService }
|
|
4707
|
-
];
|
|
4708
|
-
/** @nocollapse */ TaskNameService.ngInjectableDef = defineInjectable({ factory: function TaskNameService_Factory() { return new TaskNameService(inject(HttpClient), inject(SessionStorageService)); }, token: TaskNameService, providedIn: "root" });
|
|
4709
|
-
|
|
4710
|
-
/**
|
|
4711
|
-
* @fileoverview added by tsickle
|
|
4712
|
-
* Generated from: lib/components/find-task-name/find-task-name.component.ts
|
|
4713
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4714
|
-
*/
|
|
4715
|
-
class FindTaskNameComponent {
|
|
4716
|
-
/**
|
|
4717
|
-
* @param {?} cd
|
|
4718
|
-
* @param {?} taskService
|
|
4719
|
-
*/
|
|
4720
|
-
constructor(cd, taskService) {
|
|
4721
|
-
this.cd = cd;
|
|
4722
|
-
this.taskService = taskService;
|
|
4723
|
-
this.taskNameSelected = new EventEmitter();
|
|
4724
|
-
this.taskNameFieldChanged = new EventEmitter();
|
|
4725
|
-
this.boldTitle = 'Find the task name';
|
|
4726
|
-
this.subTitle = 'Type the name of the task name and select them.';
|
|
4727
|
-
this.domain = PersonRole.ALL;
|
|
4728
|
-
this.findTaskNameGroup = new FormGroup({});
|
|
4729
|
-
this.submitted = true;
|
|
4730
|
-
this.userIncluded = false;
|
|
4731
|
-
this.placeholderContent = '';
|
|
4732
|
-
this.isNoResultsShown = true;
|
|
4733
|
-
this.showUpdatedColor = false;
|
|
4734
|
-
this.selectedTaskNames = [];
|
|
4735
|
-
this.errorMessage = 'You must select a name';
|
|
4736
|
-
this.idValue = '';
|
|
4737
|
-
this.services = ['IA'];
|
|
4738
|
-
this.disabled = null;
|
|
4739
|
-
this.showAutocomplete = false;
|
|
4740
|
-
this.filteredOptions = [];
|
|
4741
|
-
this.minSearchCharacters = 1;
|
|
4742
|
-
this.searchTerm = '';
|
|
4743
|
-
}
|
|
4744
|
-
/**
|
|
4745
|
-
* @return {?}
|
|
4746
|
-
*/
|
|
4747
|
-
ngOnDestroy() {
|
|
4748
|
-
if (this.sub) {
|
|
4749
|
-
this.sub.unsubscribe();
|
|
4750
|
-
}
|
|
4751
|
-
}
|
|
4752
|
-
/**
|
|
4753
|
-
* @return {?}
|
|
4754
|
-
*/
|
|
4755
|
-
ngOnChanges() {
|
|
4756
|
-
this.findTaskNameControl = new FormControl(this.selectedTaskName);
|
|
4757
|
-
this.findTaskNameGroup.addControl('findTaskNameControl', this.findTaskNameControl);
|
|
4758
|
-
this.sub = this.findTaskNameControl.valueChanges
|
|
4759
|
-
.pipe(tap((/**
|
|
4760
|
-
* @return {?}
|
|
4761
|
-
*/
|
|
4762
|
-
() => this.showAutocomplete = false)), tap((/**
|
|
4763
|
-
* @return {?}
|
|
4764
|
-
*/
|
|
4765
|
-
() => this.filteredOptions = [])), tap((/**
|
|
4766
|
-
* @param {?} term
|
|
4767
|
-
* @return {?}
|
|
4768
|
-
*/
|
|
4769
|
-
(term) => this.searchTerm = term)), debounceTime(300), tap((/**
|
|
4770
|
-
* @param {?} searchTerm
|
|
4771
|
-
* @return {?}
|
|
4772
|
-
*/
|
|
4773
|
-
(searchTerm) => {
|
|
4774
|
-
if (!searchTerm) {
|
|
4775
|
-
this.taskNameSelected.emit('');
|
|
4776
|
-
}
|
|
4777
|
-
return searchTerm;
|
|
4778
|
-
})),
|
|
4779
|
-
// tap((searchTerm) => typeof searchTerm === 'string' ? this.taskNameSelected.emit('null') : void 0),
|
|
4780
|
-
filter((/**
|
|
4781
|
-
* @param {?} searchTerm
|
|
4782
|
-
* @return {?}
|
|
4783
|
-
*/
|
|
4784
|
-
(searchTerm) => searchTerm && searchTerm.length >= this.minSearchCharacters)), mergeMap((/**
|
|
4785
|
-
* @return {?}
|
|
4786
|
-
*/
|
|
4787
|
-
() => this.getTaskName()))).subscribe((/**
|
|
4788
|
-
* @param {?} taskNameModel
|
|
4789
|
-
* @return {?}
|
|
4790
|
-
*/
|
|
4791
|
-
(taskNameModel) => {
|
|
4792
|
-
this.filteredOptions = taskNameModel.map((/**
|
|
4793
|
-
* @param {?} task
|
|
4794
|
-
* @return {?}
|
|
4795
|
-
*/
|
|
4796
|
-
task => task.taskName));
|
|
4797
|
-
if (this.searchTerm) {
|
|
4798
|
-
this.filteredOptions = this.filteredOptions.filter((/**
|
|
4799
|
-
* @param {?} taskName
|
|
4800
|
-
* @return {?}
|
|
4801
|
-
*/
|
|
4802
|
-
(taskName) => taskName.toLocaleLowerCase().includes(this.searchTerm.toLocaleLowerCase()))).map((/**
|
|
4803
|
-
* @param {?} taskName
|
|
4804
|
-
* @return {?}
|
|
4805
|
-
*/
|
|
4806
|
-
taskName => taskName));
|
|
4246
|
+
* @return {?}
|
|
4247
|
+
*/
|
|
4248
|
+
({ id }) => !ids.includes(id)));
|
|
4249
|
+
})));
|
|
4250
|
+
}
|
|
4251
|
+
case PersonRole.ALL: {
|
|
4252
|
+
return zip(findJudicialOrCTSCPeople, findCaseworkersOrAdminsOrCtsc).pipe(map((/**
|
|
4253
|
+
* @param {?} separatePeople
|
|
4254
|
+
* @return {?}
|
|
4255
|
+
*/
|
|
4256
|
+
separatePeople => separatePeople[0].concat(separatePeople[1]))));
|
|
4257
|
+
}
|
|
4258
|
+
case PersonRole.CTSC:
|
|
4259
|
+
case PersonRole.CASEWORKER:
|
|
4260
|
+
case PersonRole.ADMIN: {
|
|
4261
|
+
return findCaseworkersOrAdminsOrCtsc;
|
|
4262
|
+
}
|
|
4263
|
+
default: {
|
|
4264
|
+
return of([]);
|
|
4265
|
+
}
|
|
4807
4266
|
}
|
|
4808
|
-
|
|
4809
|
-
|
|
4267
|
+
}
|
|
4268
|
+
return of([]);
|
|
4810
4269
|
}
|
|
4811
4270
|
/**
|
|
4271
|
+
* @param {?} selectedPerson
|
|
4812
4272
|
* @return {?}
|
|
4813
4273
|
*/
|
|
4814
|
-
|
|
4815
|
-
|
|
4274
|
+
onSelectionChange(selectedPerson) {
|
|
4275
|
+
this.personSelected.emit(selectedPerson);
|
|
4276
|
+
this.findPersonControl.setValue(this.getDisplayName(selectedPerson), { emitEvent: false, onlySelf: true });
|
|
4816
4277
|
}
|
|
4817
4278
|
/**
|
|
4818
|
-
* @param {?}
|
|
4279
|
+
* @param {?} selectedPerson
|
|
4819
4280
|
* @return {?}
|
|
4820
4281
|
*/
|
|
4821
|
-
|
|
4822
|
-
if (
|
|
4823
|
-
|
|
4824
|
-
this.findTaskNameControl.setValue(selectedTaskName);
|
|
4282
|
+
getDisplayName(selectedPerson) {
|
|
4283
|
+
if (!selectedPerson) {
|
|
4284
|
+
return '';
|
|
4825
4285
|
}
|
|
4286
|
+
if (selectedPerson.domain === PersonRole.JUDICIAL && selectedPerson.fullName) {
|
|
4287
|
+
return `${selectedPerson.fullName} (${selectedPerson.email})`;
|
|
4288
|
+
}
|
|
4289
|
+
return selectedPerson.email ? `${selectedPerson.name} (${selectedPerson.email})` : selectedPerson.name;
|
|
4826
4290
|
}
|
|
4827
4291
|
/**
|
|
4828
4292
|
* @return {?}
|
|
4829
4293
|
*/
|
|
4830
4294
|
onInput() {
|
|
4831
|
-
this.
|
|
4295
|
+
this.personFieldChanged.emit();
|
|
4832
4296
|
}
|
|
4833
4297
|
}
|
|
4834
|
-
|
|
4298
|
+
FindPersonComponent.decorators = [
|
|
4835
4299
|
{ type: Component, args: [{
|
|
4836
|
-
selector: 'xuilib-find-
|
|
4837
|
-
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]=\"
|
|
4838
|
-
styles: [""]
|
|
4300
|
+
selector: 'xuilib-find-person',
|
|
4301
|
+
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]=\"findPersonGroup\"\n [ngClass]=\"{'form-group-error': findPersonGroup.get('findPersonControl').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=\"findPersonGroup && findPersonGroup.errors\">\n <span class=\"govuk-visually-hidden\">Error:</span>{{findPersonGroup.errors.error ? findPersonGroup.errors.error : errorMessage}}\n </span>\n <input id=\"inputSelectPerson{{idValue}}\" type=\"text\" aria-label=\"select a person\"\n formControlName=\"findPersonControl\"\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 {{getDisplayName(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",
|
|
4302
|
+
styles: [".mat-option:hover{background:#2596be}.mat-option.select-option:hover{background:#1d70b8;color:#fff}.hide-autocomplete{display:none}"]
|
|
4839
4303
|
}] }
|
|
4840
4304
|
];
|
|
4841
4305
|
/** @nocollapse */
|
|
4842
|
-
|
|
4843
|
-
{ type:
|
|
4844
|
-
{ type:
|
|
4306
|
+
FindPersonComponent.ctorParameters = () => [
|
|
4307
|
+
{ type: FindAPersonService },
|
|
4308
|
+
{ type: ChangeDetectorRef }
|
|
4845
4309
|
];
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4310
|
+
FindPersonComponent.propDecorators = {
|
|
4311
|
+
personSelected: [{ type: Output }],
|
|
4312
|
+
personFieldChanged: [{ type: Output }],
|
|
4849
4313
|
title: [{ type: Input }],
|
|
4850
4314
|
boldTitle: [{ type: Input }],
|
|
4851
4315
|
subTitle: [{ type: Input }],
|
|
4852
4316
|
domain: [{ type: Input }],
|
|
4853
|
-
|
|
4854
|
-
|
|
4317
|
+
findPersonGroup: [{ type: Input }],
|
|
4318
|
+
selectedPerson: [{ type: Input }],
|
|
4855
4319
|
submitted: [{ type: Input }],
|
|
4856
4320
|
userIncluded: [{ type: Input }],
|
|
4857
4321
|
assignedUser: [{ type: Input }],
|
|
4858
4322
|
placeholderContent: [{ type: Input }],
|
|
4859
4323
|
isNoResultsShown: [{ type: Input }],
|
|
4860
4324
|
showUpdatedColor: [{ type: Input }],
|
|
4861
|
-
|
|
4325
|
+
selectedPersons: [{ type: Input }],
|
|
4862
4326
|
errorMessage: [{ type: Input }],
|
|
4863
4327
|
idValue: [{ type: Input }],
|
|
4864
4328
|
services: [{ type: Input }],
|
|
4865
4329
|
disabled: [{ type: Input }]
|
|
4866
4330
|
};
|
|
4867
4331
|
|
|
4332
|
+
/**
|
|
4333
|
+
* @fileoverview added by tsickle
|
|
4334
|
+
* Generated from: lib/components/find-service/find-service.component.ts
|
|
4335
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4336
|
+
*/
|
|
4337
|
+
class FindServiceComponent {
|
|
4338
|
+
constructor() {
|
|
4339
|
+
this.serviceTitle = 'Search for a service by name';
|
|
4340
|
+
this.enableAddServiceButton = true;
|
|
4341
|
+
this.disableInputField = false;
|
|
4342
|
+
}
|
|
4343
|
+
/**
|
|
4344
|
+
* @return {?}
|
|
4345
|
+
*/
|
|
4346
|
+
addService() {
|
|
4347
|
+
// Todo
|
|
4348
|
+
}
|
|
4349
|
+
}
|
|
4350
|
+
FindServiceComponent.decorators = [
|
|
4351
|
+
{ type: Component, args: [{
|
|
4352
|
+
selector: 'xuilib-find-service',
|
|
4353
|
+
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>",
|
|
4354
|
+
styles: ["#add-service{background-color:#ddd}"]
|
|
4355
|
+
}] }
|
|
4356
|
+
];
|
|
4357
|
+
FindServiceComponent.propDecorators = {
|
|
4358
|
+
field: [{ type: Input }],
|
|
4359
|
+
fields: [{ type: Input }],
|
|
4360
|
+
serviceTitle: [{ type: Input }],
|
|
4361
|
+
form: [{ type: Input }],
|
|
4362
|
+
services: [{ type: Input }],
|
|
4363
|
+
selectedServices: [{ type: Input }],
|
|
4364
|
+
disabled: [{ type: Input }],
|
|
4365
|
+
enableAddServiceButton: [{ type: Input }],
|
|
4366
|
+
disableInputField: [{ type: Input }]
|
|
4367
|
+
};
|
|
4368
|
+
|
|
4868
4369
|
/**
|
|
4869
4370
|
* @fileoverview added by tsickle
|
|
4870
4371
|
* Generated from: lib/components/search-judicials/search-judicials.component.ts
|
|
@@ -5072,33 +4573,37 @@ SearchJudicialsComponent.propDecorators = {
|
|
|
5072
4573
|
*/
|
|
5073
4574
|
class SearchServiceComponent {
|
|
5074
4575
|
constructor() {
|
|
5075
|
-
this.
|
|
5076
|
-
this.
|
|
4576
|
+
this.showAutocomplete = false;
|
|
4577
|
+
this.minSearchCharacters = 3;
|
|
4578
|
+
this.term = '';
|
|
5077
4579
|
}
|
|
5078
4580
|
/**
|
|
5079
|
-
* @param {?} key
|
|
5080
4581
|
* @return {?}
|
|
5081
4582
|
*/
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
4583
|
+
onInput() {
|
|
4584
|
+
// Todo
|
|
4585
|
+
}
|
|
4586
|
+
/**
|
|
4587
|
+
* @return {?}
|
|
4588
|
+
*/
|
|
4589
|
+
onSelectionChange() {
|
|
4590
|
+
// Todo
|
|
5090
4591
|
}
|
|
5091
4592
|
}
|
|
5092
4593
|
SearchServiceComponent.decorators = [
|
|
5093
4594
|
{ type: Component, args: [{
|
|
5094
4595
|
selector: 'exui-search-service',
|
|
5095
|
-
template: "<div class=\"
|
|
5096
|
-
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:
|
|
4596
|
+
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",
|
|
4597
|
+
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}"]
|
|
5097
4598
|
}] }
|
|
5098
4599
|
];
|
|
5099
4600
|
SearchServiceComponent.propDecorators = {
|
|
5100
4601
|
services: [{ type: Input }],
|
|
5101
|
-
|
|
4602
|
+
selectedServices: [{ type: Input }],
|
|
4603
|
+
disabled: [{ type: Input }],
|
|
4604
|
+
delay: [{ type: Input }],
|
|
4605
|
+
form: [{ type: Input }],
|
|
4606
|
+
showAutocomplete: [{ type: Input }]
|
|
5102
4607
|
};
|
|
5103
4608
|
|
|
5104
4609
|
/**
|
|
@@ -5339,38 +4844,6 @@ GovUkCheckboxComponent.propDecorators = {
|
|
|
5339
4844
|
isChecked: [{ type: Input }]
|
|
5340
4845
|
};
|
|
5341
4846
|
|
|
5342
|
-
/**
|
|
5343
|
-
* @fileoverview added by tsickle
|
|
5344
|
-
* Generated from: lib/gov-ui/util/helpers/html-templates.helper.ts
|
|
5345
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
5346
|
-
*/
|
|
5347
|
-
/*
|
|
5348
|
-
* Helper Class
|
|
5349
|
-
* Used for dynamic templates manipulation
|
|
5350
|
-
* */
|
|
5351
|
-
class HtmlTemplatesHelper {
|
|
5352
|
-
/*
|
|
5353
|
-
* Sets described by string depending if
|
|
5354
|
-
* there is an error, error and hit or nothing
|
|
5355
|
-
* */
|
|
5356
|
-
/**
|
|
5357
|
-
* @param {?} errorMessage
|
|
5358
|
-
* @param {?} config
|
|
5359
|
-
* @return {?}
|
|
5360
|
-
*/
|
|
5361
|
-
static setDescribedBy(errorMessage, config) {
|
|
5362
|
-
if (!errorMessage) {
|
|
5363
|
-
return config.hint ? `${config.id}-hint` : null;
|
|
5364
|
-
}
|
|
5365
|
-
else if (errorMessage && errorMessage.isInvalid) {
|
|
5366
|
-
return config.hint ? `${config.id}-hint ${config.id}-error` : `${config.id}-error`;
|
|
5367
|
-
}
|
|
5368
|
-
else {
|
|
5369
|
-
return config.hint ? `${config.id}-hint` : null;
|
|
5370
|
-
}
|
|
5371
|
-
}
|
|
5372
|
-
}
|
|
5373
|
-
|
|
5374
4847
|
/**
|
|
5375
4848
|
* @fileoverview added by tsickle
|
|
5376
4849
|
* Generated from: lib/gov-ui/components/gov-uk-checkboxes/gov-uk-checkboxes.component.ts
|
|
@@ -5384,82 +4857,16 @@ class HtmlTemplatesHelper {
|
|
|
5384
4857
|
* @param: errors - array of error stings
|
|
5385
4858
|
* */
|
|
5386
4859
|
class GovUkCheckboxesComponent {
|
|
5387
|
-
/**
|
|
5388
|
-
* @return {?}
|
|
5389
|
-
*/
|
|
5390
|
-
ngOnInit() {
|
|
5391
|
-
this.columns = this.setColumns();
|
|
5392
|
-
}
|
|
5393
|
-
/**
|
|
5394
|
-
* @return {?}
|
|
5395
|
-
*/
|
|
5396
|
-
setDescribedBy() {
|
|
5397
|
-
return HtmlTemplatesHelper.setDescribedBy(this.errorMessage, this.config);
|
|
5398
|
-
}
|
|
5399
|
-
/**
|
|
5400
|
-
* @param {?} checked
|
|
5401
|
-
* @param {?} value
|
|
5402
|
-
* @return {?}
|
|
5403
|
-
*/
|
|
5404
|
-
onChecked(checked, value) {
|
|
5405
|
-
/** @type {?} */
|
|
5406
|
-
const formControl = this.group.get(this.config.name);
|
|
5407
|
-
/** @type {?} */
|
|
5408
|
-
const array = formControl.value ? formControl.value : [];
|
|
5409
|
-
if (!checked) {
|
|
5410
|
-
/** @type {?} */
|
|
5411
|
-
const modifiedArray = array.filter((/**
|
|
5412
|
-
* @param {?} item
|
|
5413
|
-
* @return {?}
|
|
5414
|
-
*/
|
|
5415
|
-
(item) => item !== value));
|
|
5416
|
-
formControl.setValue(modifiedArray);
|
|
5417
|
-
}
|
|
5418
|
-
else {
|
|
5419
|
-
formControl.setValue([...array, value]);
|
|
5420
|
-
}
|
|
5421
|
-
}
|
|
5422
|
-
/**
|
|
5423
|
-
* @param {?} value
|
|
5424
|
-
* @return {?}
|
|
5425
|
-
*/
|
|
5426
|
-
isChecked(value) {
|
|
5427
|
-
/** @type {?} */
|
|
5428
|
-
const formControl = this.group.get(this.config.name);
|
|
5429
|
-
return formControl.value && formControl.value.includes(value);
|
|
5430
|
-
}
|
|
5431
|
-
/**
|
|
5432
|
-
* @private
|
|
5433
|
-
* @return {?}
|
|
5434
|
-
*/
|
|
5435
|
-
setColumns() {
|
|
5436
|
-
if (this.config.rows && this.config.rows > 1) {
|
|
5437
|
-
/** @type {?} */
|
|
5438
|
-
const array = [];
|
|
5439
|
-
for (let i = 0; i < this.items.length; i += this.config.rows) {
|
|
5440
|
-
/** @type {?} */
|
|
5441
|
-
const arrayChunk = this.items.slice(i, i + this.config.rows);
|
|
5442
|
-
array.push(arrayChunk);
|
|
5443
|
-
}
|
|
5444
|
-
return array;
|
|
5445
|
-
}
|
|
5446
|
-
else {
|
|
5447
|
-
return [this.items];
|
|
5448
|
-
}
|
|
5449
|
-
}
|
|
5450
4860
|
}
|
|
5451
4861
|
GovUkCheckboxesComponent.decorators = [
|
|
5452
4862
|
{ type: Component, args: [{
|
|
5453
4863
|
selector: 'xuilib-gov-uk-checkboxes',
|
|
5454
|
-
template: "<
|
|
5455
|
-
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}"]
|
|
4864
|
+
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>"
|
|
5456
4865
|
}] }
|
|
5457
4866
|
];
|
|
5458
4867
|
GovUkCheckboxesComponent.propDecorators = {
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
items: [{ type: Input }],
|
|
5462
|
-
errorMessage: [{ type: Input }]
|
|
4868
|
+
options: [{ type: Input }],
|
|
4869
|
+
errors: [{ type: Input }]
|
|
5463
4870
|
};
|
|
5464
4871
|
|
|
5465
4872
|
/**
|
|
@@ -5586,6 +4993,38 @@ GovUkErrorMessageComponent.propDecorators = {
|
|
|
5586
4993
|
errorMessage: [{ type: Input }]
|
|
5587
4994
|
};
|
|
5588
4995
|
|
|
4996
|
+
/**
|
|
4997
|
+
* @fileoverview added by tsickle
|
|
4998
|
+
* Generated from: lib/gov-ui/util/helpers/html-templates.helper.ts
|
|
4999
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
5000
|
+
*/
|
|
5001
|
+
/*
|
|
5002
|
+
* Helper Class
|
|
5003
|
+
* Used for dynamic templates manipulation
|
|
5004
|
+
* */
|
|
5005
|
+
class HtmlTemplatesHelper {
|
|
5006
|
+
/*
|
|
5007
|
+
* Sets described by string depending if
|
|
5008
|
+
* there is an error, error and hit or nothing
|
|
5009
|
+
* */
|
|
5010
|
+
/**
|
|
5011
|
+
* @param {?} errorMessage
|
|
5012
|
+
* @param {?} config
|
|
5013
|
+
* @return {?}
|
|
5014
|
+
*/
|
|
5015
|
+
static setDescribedBy(errorMessage, config) {
|
|
5016
|
+
if (!errorMessage) {
|
|
5017
|
+
return config.hint ? `${config.id}-hint` : null;
|
|
5018
|
+
}
|
|
5019
|
+
else if (errorMessage && errorMessage.isInvalid) {
|
|
5020
|
+
return config.hint ? `${config.id}-hint ${config.id}-error` : `${config.id}-error`;
|
|
5021
|
+
}
|
|
5022
|
+
else {
|
|
5023
|
+
return config.hint ? `${config.id}-hint` : null;
|
|
5024
|
+
}
|
|
5025
|
+
}
|
|
5026
|
+
}
|
|
5027
|
+
|
|
5589
5028
|
/**
|
|
5590
5029
|
* @fileoverview added by tsickle
|
|
5591
5030
|
* Generated from: lib/gov-ui/components/gov-uk-fieldset/gov-uk-fieldset.component.ts
|
|
@@ -5712,7 +5151,7 @@ class GovUkInputComponent {
|
|
|
5712
5151
|
* @return {?}
|
|
5713
5152
|
*/
|
|
5714
5153
|
ngOnInit() {
|
|
5715
|
-
this.config.classes =
|
|
5154
|
+
this.config.classes = 'govuk-label--m';
|
|
5716
5155
|
}
|
|
5717
5156
|
/**
|
|
5718
5157
|
* @return {?}
|
|
@@ -5724,7 +5163,7 @@ class GovUkInputComponent {
|
|
|
5724
5163
|
GovUkInputComponent.decorators = [
|
|
5725
5164
|
{ type: Component, args: [{
|
|
5726
5165
|
selector: 'xuilib-gov-uk-input',
|
|
5727
|
-
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 [
|
|
5166
|
+
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",
|
|
5728
5167
|
styles: [".gov-uk-input input:disabled{background:#b1b4b6}"]
|
|
5729
5168
|
}] }
|
|
5730
5169
|
];
|
|
@@ -5753,8 +5192,7 @@ class GovUkLabelComponent {
|
|
|
5753
5192
|
GovUkLabelComponent.decorators = [
|
|
5754
5193
|
{ type: Component, args: [{
|
|
5755
5194
|
selector: 'xuilib-gov-label',
|
|
5756
|
-
template: "<h1 *ngIf=\"config.isPageHeading else noHeading\">\n <label *ngIf=\"config.label\" [
|
|
5757
|
-
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}"]
|
|
5195
|
+
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>"
|
|
5758
5196
|
}] }
|
|
5759
5197
|
];
|
|
5760
5198
|
/** @nocollapse */
|
|
@@ -5850,7 +5288,7 @@ class GovUkSelectComponent {
|
|
|
5850
5288
|
GovUkSelectComponent.decorators = [
|
|
5851
5289
|
{ type: Component, args: [{
|
|
5852
5290
|
selector: 'xuilib-gov-select',
|
|
5853
|
-
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\"
|
|
5291
|
+
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>"
|
|
5854
5292
|
}] }
|
|
5855
5293
|
];
|
|
5856
5294
|
/** @nocollapse */
|
|
@@ -5939,26 +5377,27 @@ GovUkTextareaComponent.propDecorators = {
|
|
|
5939
5377
|
* Generated from: lib/gov-ui/components/hmcts-banner/hmcts-banner.component.ts
|
|
5940
5378
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
5941
5379
|
*/
|
|
5380
|
+
/*
|
|
5381
|
+
* Hmcts Banner
|
|
5382
|
+
* Responsible for displaying prominent message and related actions
|
|
5383
|
+
* @prop message to display
|
|
5384
|
+
* @prop type
|
|
5385
|
+
* */
|
|
5942
5386
|
class HmctsBannerComponent {
|
|
5943
|
-
constructor() {
|
|
5944
|
-
this.title = '';
|
|
5945
|
-
this.showMessageIcon = false;
|
|
5946
|
-
this.messageBoldText = false;
|
|
5947
|
-
}
|
|
5387
|
+
constructor() { }
|
|
5948
5388
|
}
|
|
5949
5389
|
HmctsBannerComponent.decorators = [
|
|
5950
5390
|
{ type: Component, args: [{
|
|
5951
5391
|
selector: 'xuilib-hmcts-banner',
|
|
5952
|
-
template: "<
|
|
5953
|
-
styles: ["
|
|
5392
|
+
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>",
|
|
5393
|
+
styles: [":host{display:block;width:100%}"]
|
|
5954
5394
|
}] }
|
|
5955
5395
|
];
|
|
5396
|
+
/** @nocollapse */
|
|
5397
|
+
HmctsBannerComponent.ctorParameters = () => [];
|
|
5956
5398
|
HmctsBannerComponent.propDecorators = {
|
|
5957
|
-
message: [{ type: Input }],
|
|
5958
5399
|
type: [{ type: Input }],
|
|
5959
|
-
|
|
5960
|
-
showMessageIcon: [{ type: Input }],
|
|
5961
|
-
messageBoldText: [{ type: Input }]
|
|
5400
|
+
message: [{ type: Input }]
|
|
5962
5401
|
};
|
|
5963
5402
|
|
|
5964
5403
|
/**
|
|
@@ -6105,7 +5544,7 @@ class HmctsMainWrapperComponent {
|
|
|
6105
5544
|
HmctsMainWrapperComponent.decorators = [
|
|
6106
5545
|
{ type: Component, args: [{
|
|
6107
5546
|
selector: 'xuilib-hmcts-main-wrapper',
|
|
6108
|
-
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\"
|
|
5547
|
+
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"
|
|
6109
5548
|
}] }
|
|
6110
5549
|
];
|
|
6111
5550
|
/** @nocollapse */
|
|
@@ -6245,26 +5684,6 @@ RemoveHostDirective.ctorParameters = () => [
|
|
|
6245
5684
|
{ type: ElementRef }
|
|
6246
5685
|
];
|
|
6247
5686
|
|
|
6248
|
-
/**
|
|
6249
|
-
* @fileoverview added by tsickle
|
|
6250
|
-
* Generated from: lib/pipes/capitalize.pipe.ts
|
|
6251
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
6252
|
-
*/
|
|
6253
|
-
class CapitalizePipe {
|
|
6254
|
-
/**
|
|
6255
|
-
* @param {?} value
|
|
6256
|
-
* @return {?}
|
|
6257
|
-
*/
|
|
6258
|
-
transform(value) {
|
|
6259
|
-
/** @type {?} */
|
|
6260
|
-
const lowerCaseString = value.toLowerCase();
|
|
6261
|
-
return lowerCaseString.charAt(0).toUpperCase() + lowerCaseString.slice(1);
|
|
6262
|
-
}
|
|
6263
|
-
}
|
|
6264
|
-
CapitalizePipe.decorators = [
|
|
6265
|
-
{ type: Pipe, args: [{ name: 'capitalize' },] }
|
|
6266
|
-
];
|
|
6267
|
-
|
|
6268
5687
|
/**
|
|
6269
5688
|
* @fileoverview added by tsickle
|
|
6270
5689
|
* Generated from: lib/exui-common-lib.module.ts
|
|
@@ -6303,7 +5722,6 @@ const COMMON_COMPONENTS = [
|
|
|
6303
5722
|
FindPersonComponent,
|
|
6304
5723
|
SearchJudicialsComponent,
|
|
6305
5724
|
FindLocationComponent,
|
|
6306
|
-
FindTaskNameComponent,
|
|
6307
5725
|
SearchLocationComponent,
|
|
6308
5726
|
FindServiceComponent,
|
|
6309
5727
|
SearchServiceComponent,
|
|
@@ -6335,10 +5753,6 @@ const GOV_UI_COMPONENTS = [
|
|
|
6335
5753
|
GovUkFileUploadComponent,
|
|
6336
5754
|
RemoveHostDirective
|
|
6337
5755
|
];
|
|
6338
|
-
/** @type {?} */
|
|
6339
|
-
const pipes = [
|
|
6340
|
-
CapitalizePipe
|
|
6341
|
-
];
|
|
6342
5756
|
const ɵ0 = windowProvider;
|
|
6343
5757
|
class ExuiCommonLibModule {
|
|
6344
5758
|
}
|
|
@@ -6346,8 +5760,7 @@ ExuiCommonLibModule.decorators = [
|
|
|
6346
5760
|
{ type: NgModule, args: [{
|
|
6347
5761
|
declarations: [
|
|
6348
5762
|
...COMMON_COMPONENTS,
|
|
6349
|
-
...GOV_UI_COMPONENTS
|
|
6350
|
-
...pipes
|
|
5763
|
+
...GOV_UI_COMPONENTS
|
|
6351
5764
|
],
|
|
6352
5765
|
imports: [
|
|
6353
5766
|
CommonModule,
|
|
@@ -6365,8 +5778,7 @@ ExuiCommonLibModule.decorators = [
|
|
|
6365
5778
|
exports: [
|
|
6366
5779
|
...COMMON_COMPONENTS,
|
|
6367
5780
|
...GOV_UI_COMPONENTS,
|
|
6368
|
-
PaginatePipe
|
|
6369
|
-
...pipes
|
|
5781
|
+
PaginatePipe
|
|
6370
5782
|
]
|
|
6371
5783
|
},] }
|
|
6372
5784
|
];
|
|
@@ -7075,19 +6487,20 @@ TimeoutNotificationsService.ctorParameters = () => [
|
|
|
7075
6487
|
*/
|
|
7076
6488
|
class RoleService {
|
|
7077
6489
|
constructor() {
|
|
7078
|
-
this.pRoles =
|
|
7079
|
-
|
|
7080
|
-
|
|
7081
|
-
|
|
7082
|
-
|
|
7083
|
-
|
|
6490
|
+
this.pRoles = [];
|
|
6491
|
+
}
|
|
6492
|
+
/**
|
|
6493
|
+
* @return {?}
|
|
6494
|
+
*/
|
|
6495
|
+
get roles() {
|
|
6496
|
+
return this.pRoles;
|
|
7084
6497
|
}
|
|
7085
6498
|
/**
|
|
7086
6499
|
* @param {?} roles
|
|
7087
6500
|
* @return {?}
|
|
7088
6501
|
*/
|
|
7089
6502
|
set roles(roles) {
|
|
7090
|
-
this.pRoles
|
|
6503
|
+
this.pRoles = roles;
|
|
7091
6504
|
}
|
|
7092
6505
|
}
|
|
7093
6506
|
RoleService.decorators = [
|
|
@@ -7123,31 +6536,25 @@ class RoleGuard {
|
|
|
7123
6536
|
* @return {?}
|
|
7124
6537
|
*/
|
|
7125
6538
|
canActivate(route) {
|
|
7126
|
-
|
|
7127
|
-
|
|
6539
|
+
/** @type {?} */
|
|
6540
|
+
const roles = ((/** @type {?} */ (route.data.needsRole)));
|
|
6541
|
+
/** @type {?} */
|
|
6542
|
+
const check = (/**
|
|
6543
|
+
* @param {?} roleRegEx
|
|
7128
6544
|
* @return {?}
|
|
7129
6545
|
*/
|
|
7130
|
-
|
|
7131
|
-
/** @type {?} */
|
|
7132
|
-
const canActivateRoles = ((/** @type {?} */ (route.data.needsRole)));
|
|
6546
|
+
(roleRegEx) => {
|
|
7133
6547
|
/** @type {?} */
|
|
7134
|
-
const
|
|
7135
|
-
|
|
6548
|
+
const regex = new RegExp(roleRegEx);
|
|
6549
|
+
return this.roleService.roles.some((/**
|
|
6550
|
+
* @param {?} role
|
|
7136
6551
|
* @return {?}
|
|
7137
6552
|
*/
|
|
7138
|
-
|
|
7139
|
-
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7143
|
-
* @return {?}
|
|
7144
|
-
*/
|
|
7145
|
-
role => regex.test(role)));
|
|
7146
|
-
});
|
|
7147
|
-
/** @type {?} */
|
|
7148
|
-
const match = route.data.roleMatching === RoleMatching.ALL ? canActivateRoles.every(check) : canActivateRoles.some(check);
|
|
7149
|
-
return match || this.router.parseUrl((/** @type {?} */ (route.data.noRoleMatchRedirect)));
|
|
7150
|
-
})));
|
|
6553
|
+
role => regex.test(role)));
|
|
6554
|
+
});
|
|
6555
|
+
/** @type {?} */
|
|
6556
|
+
const match = route.data.roleMatching === RoleMatching.ALL ? roles.every(check) : roles.some(check);
|
|
6557
|
+
return match || this.router.parseUrl((/** @type {?} */ (route.data.noRoleMatchRedirect)));
|
|
7151
6558
|
}
|
|
7152
6559
|
}
|
|
7153
6560
|
RoleGuard.decorators = [
|
|
@@ -7248,6 +6655,6 @@ LoadingService.decorators = [
|
|
|
7248
6655
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
7249
6656
|
*/
|
|
7250
6657
|
|
|
7251
|
-
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,
|
|
6658
|
+
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 };
|
|
7252
6659
|
|
|
7253
6660
|
//# sourceMappingURL=hmcts-rpx-xui-common-lib.js.map
|