@hmcts/rpx-xui-common-lib 1.6.7-generic-filter-show-cancel-button → 1.6.7-hide-assigned-user
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 +540 -448
- package/bundles/hmcts-rpx-xui-common-lib.umd.js.map +1 -1
- package/bundles/hmcts-rpx-xui-common-lib.umd.min.js +1 -1
- package/bundles/hmcts-rpx-xui-common-lib.umd.min.js.map +1 -1
- package/esm2015/lib/components/find-location/find-location.component.js +111 -47
- package/esm2015/lib/components/find-person/find-person.component.js +74 -62
- package/esm2015/lib/components/generic-filter/generic-filter-utils.js +2 -2
- package/esm2015/lib/components/generic-filter/generic-filter.component.js +59 -44
- package/esm2015/lib/components/search-location/search-location.component.js +60 -66
- package/esm2015/lib/exui-common-lib.module.js +4 -3
- package/esm2015/lib/models/filter.model.js +9 -1
- package/esm2015/lib/models/location.model.js +24 -24
- package/esm2015/lib/models/search-options.model.js +3 -1
- package/esm2015/lib/services/find-person/find-person.service.js +14 -5
- package/esm2015/lib/services/locations/location.service.js +2 -2
- package/esm5/lib/components/find-location/find-location.component.js +139 -67
- package/esm5/lib/components/find-person/find-person.component.js +76 -70
- package/esm5/lib/components/generic-filter/generic-filter-utils.js +2 -2
- package/esm5/lib/components/generic-filter/generic-filter.component.js +108 -73
- package/esm5/lib/components/search-location/search-location.component.js +66 -74
- package/esm5/lib/exui-common-lib.module.js +4 -3
- package/esm5/lib/models/filter.model.js +9 -1
- package/esm5/lib/models/location.model.js +24 -24
- package/esm5/lib/models/search-options.model.js +3 -1
- package/esm5/lib/services/find-person/find-person.service.js +14 -5
- package/esm5/lib/services/locations/location.service.js +4 -4
- package/fesm2015/hmcts-rpx-xui-common-lib.js +357 -286
- package/fesm2015/hmcts-rpx-xui-common-lib.js.map +1 -1
- package/fesm5/hmcts-rpx-xui-common-lib.js +466 -375
- package/fesm5/hmcts-rpx-xui-common-lib.js.map +1 -1
- package/hmcts-rpx-xui-common-lib.metadata.json +1 -1
- package/lib/components/find-location/find-location.component.d.ts +17 -11
- package/lib/components/find-person/find-person.component.d.ts +12 -13
- package/lib/components/generic-filter/generic-filter-utils.d.ts +2 -2
- package/lib/components/generic-filter/generic-filter.component.d.ts +2 -3
- package/lib/components/search-location/search-location.component.d.ts +14 -13
- package/lib/models/filter.model.d.ts +4 -0
- package/lib/models/location.model.d.ts +3 -3
- package/lib/models/search-options.model.d.ts +1 -0
- package/lib/services/find-person/find-person.service.d.ts +2 -2
- package/lib/services/locations/location.service.d.ts +3 -3
- package/package.json +1 -1
|
@@ -839,7 +839,7 @@
|
|
|
839
839
|
* @param {?} values
|
|
840
840
|
* @return {?}
|
|
841
841
|
*/
|
|
842
|
-
function
|
|
842
|
+
function getValues(options, values) {
|
|
843
843
|
return options.reduce(( /**
|
|
844
844
|
* @param {?} acc
|
|
845
845
|
* @param {?} option
|
|
@@ -1069,7 +1069,7 @@
|
|
|
1069
1069
|
* @param {?} form
|
|
1070
1070
|
* @return {?}
|
|
1071
1071
|
*/
|
|
1072
|
-
GenericFilterComponent.prototype.
|
|
1072
|
+
GenericFilterComponent.prototype.fieldChanged =
|
|
1073
1073
|
// when domain changes ensure that person field is reset
|
|
1074
1074
|
/**
|
|
1075
1075
|
* @param {?} field
|
|
@@ -1077,48 +1077,28 @@
|
|
|
1077
1077
|
* @return {?}
|
|
1078
1078
|
*/
|
|
1079
1079
|
function (field, form) {
|
|
1080
|
+
var e_1, _a;
|
|
1080
1081
|
// TODO - Do similar with jurisdiction/service for caseworkers by services
|
|
1081
|
-
if (field.
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1082
|
+
if (field.changeResetFields && field.changeResetFields.length) {
|
|
1083
|
+
try {
|
|
1084
|
+
for (var _b = __values(field.changeResetFields), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1085
|
+
var resetField = _c.value;
|
|
1086
|
+
this.resetField(resetField, form);
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
catch (e_1_1) {
|
|
1090
|
+
e_1 = { error: e_1_1 };
|
|
1091
|
+
}
|
|
1092
|
+
finally {
|
|
1093
|
+
try {
|
|
1094
|
+
if (_c && !_c.done && (_a = _b.return))
|
|
1095
|
+
_a.call(_b);
|
|
1096
|
+
}
|
|
1097
|
+
finally {
|
|
1098
|
+
if (e_1)
|
|
1099
|
+
throw e_1.error;
|
|
1100
|
+
}
|
|
1089
1101
|
}
|
|
1090
|
-
this.removePersonField(field);
|
|
1091
|
-
}
|
|
1092
|
-
};
|
|
1093
|
-
/**
|
|
1094
|
-
* @param {?} field
|
|
1095
|
-
* @return {?}
|
|
1096
|
-
*/
|
|
1097
|
-
GenericFilterComponent.prototype.radiosChanged = /**
|
|
1098
|
-
* @param {?} field
|
|
1099
|
-
* @return {?}
|
|
1100
|
-
*/
|
|
1101
|
-
function (field) {
|
|
1102
|
-
if (field.findPersonField) {
|
|
1103
|
-
this.form.get('findPersonControl').setValue(null);
|
|
1104
|
-
this.removePersonField(field);
|
|
1105
|
-
}
|
|
1106
|
-
};
|
|
1107
|
-
/**
|
|
1108
|
-
* @param {?} field
|
|
1109
|
-
* @return {?}
|
|
1110
|
-
*/
|
|
1111
|
-
GenericFilterComponent.prototype.removePersonField = /**
|
|
1112
|
-
* @param {?} field
|
|
1113
|
-
* @return {?}
|
|
1114
|
-
*/
|
|
1115
|
-
function (field) {
|
|
1116
|
-
if (this.form.get(field.findPersonField)) {
|
|
1117
|
-
this.form.get(field.findPersonField).get('domain').setValue(null);
|
|
1118
|
-
this.form.get(field.findPersonField).get('email').setValue(null);
|
|
1119
|
-
this.form.get(field.findPersonField).get('id').setValue(null);
|
|
1120
|
-
this.form.get(field.findPersonField).get('name').setValue(null);
|
|
1121
|
-
this.form.get(field.findPersonField).get('knownAs').setValue(null);
|
|
1122
1102
|
}
|
|
1123
1103
|
};
|
|
1124
1104
|
/**
|
|
@@ -1136,6 +1116,7 @@
|
|
|
1136
1116
|
var settings = __assign({}, this.settings, { reset: true });
|
|
1137
1117
|
this.filterService.persist(settings, this.config.persistence);
|
|
1138
1118
|
this.filterService.givenErrors.next(null);
|
|
1119
|
+
this.submitted = false;
|
|
1139
1120
|
};
|
|
1140
1121
|
/**
|
|
1141
1122
|
* @param {?} values
|
|
@@ -1148,19 +1129,28 @@
|
|
|
1148
1129
|
* @return {?}
|
|
1149
1130
|
*/
|
|
1150
1131
|
function (values, field) {
|
|
1151
|
-
var
|
|
1132
|
+
var e_2, _a;
|
|
1133
|
+
console.log('updatePersonControls', values, field);
|
|
1152
1134
|
/** @type {?} */
|
|
1153
|
-
var keys
|
|
1135
|
+
var keys;
|
|
1136
|
+
if (!values) {
|
|
1137
|
+
keys = Object.keys(this.form.get(field.name).value);
|
|
1138
|
+
}
|
|
1139
|
+
else {
|
|
1140
|
+
keys = Object.keys(values);
|
|
1141
|
+
}
|
|
1154
1142
|
try {
|
|
1155
1143
|
for (var keys_1 = __values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) {
|
|
1156
1144
|
var key = keys_1_1.value;
|
|
1157
1145
|
if (this.form.get(field.name) && this.form.get(field.name).get(key)) {
|
|
1158
|
-
|
|
1146
|
+
/** @type {?} */
|
|
1147
|
+
var value = values && values[key] ? values[key] : null;
|
|
1148
|
+
this.form.get(field.name).get(key).patchValue(value);
|
|
1159
1149
|
}
|
|
1160
1150
|
}
|
|
1161
1151
|
}
|
|
1162
|
-
catch (
|
|
1163
|
-
|
|
1152
|
+
catch (e_2_1) {
|
|
1153
|
+
e_2 = { error: e_2_1 };
|
|
1164
1154
|
}
|
|
1165
1155
|
finally {
|
|
1166
1156
|
try {
|
|
@@ -1168,8 +1158,8 @@
|
|
|
1168
1158
|
_a.call(keys_1);
|
|
1169
1159
|
}
|
|
1170
1160
|
finally {
|
|
1171
|
-
if (
|
|
1172
|
-
throw
|
|
1161
|
+
if (e_2)
|
|
1162
|
+
throw e_2.error;
|
|
1173
1163
|
}
|
|
1174
1164
|
}
|
|
1175
1165
|
};
|
|
@@ -1252,6 +1242,61 @@
|
|
|
1252
1242
|
}
|
|
1253
1243
|
}));
|
|
1254
1244
|
};
|
|
1245
|
+
/**
|
|
1246
|
+
* @private
|
|
1247
|
+
* @param {?} resetField
|
|
1248
|
+
* @param {?} form
|
|
1249
|
+
* @return {?}
|
|
1250
|
+
*/
|
|
1251
|
+
GenericFilterComponent.prototype.resetField = /**
|
|
1252
|
+
* @private
|
|
1253
|
+
* @param {?} resetField
|
|
1254
|
+
* @param {?} form
|
|
1255
|
+
* @return {?}
|
|
1256
|
+
*/
|
|
1257
|
+
function (resetField, form) {
|
|
1258
|
+
var e_3, _a;
|
|
1259
|
+
/** @type {?} */
|
|
1260
|
+
var control = form.get(resetField);
|
|
1261
|
+
/** @type {?} */
|
|
1262
|
+
var defaultValue = this.config.cancelSetting.fields.find(( /**
|
|
1263
|
+
* @param {?} f
|
|
1264
|
+
* @return {?}
|
|
1265
|
+
*/function (f) { return f.name === resetField; }));
|
|
1266
|
+
if (control instanceof forms.FormArray) {
|
|
1267
|
+
for (var i = 0; i < control.length; i++) {
|
|
1268
|
+
control.removeAt(i);
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
else if (control instanceof forms.FormGroup) {
|
|
1272
|
+
/** @type {?} */
|
|
1273
|
+
var keys = Object.keys(control.value);
|
|
1274
|
+
try {
|
|
1275
|
+
for (var keys_2 = __values(keys), keys_2_1 = keys_2.next(); !keys_2_1.done; keys_2_1 = keys_2.next()) {
|
|
1276
|
+
var key = keys_2_1.value;
|
|
1277
|
+
this.resetField(key, control);
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
catch (e_3_1) {
|
|
1281
|
+
e_3 = { error: e_3_1 };
|
|
1282
|
+
}
|
|
1283
|
+
finally {
|
|
1284
|
+
try {
|
|
1285
|
+
if (keys_2_1 && !keys_2_1.done && (_a = keys_2.return))
|
|
1286
|
+
_a.call(keys_2);
|
|
1287
|
+
}
|
|
1288
|
+
finally {
|
|
1289
|
+
if (e_3)
|
|
1290
|
+
throw e_3.error;
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
else if (control instanceof forms.FormControl) {
|
|
1295
|
+
/** @type {?} */
|
|
1296
|
+
var value = defaultValue && defaultValue.value && defaultValue.value.length ? defaultValue.value[0] : null;
|
|
1297
|
+
control.setValue(value);
|
|
1298
|
+
}
|
|
1299
|
+
};
|
|
1255
1300
|
/**
|
|
1256
1301
|
* @private
|
|
1257
1302
|
* @param {?} filter
|
|
@@ -1299,7 +1344,7 @@
|
|
|
1299
1344
|
* @return {?}
|
|
1300
1345
|
*/
|
|
1301
1346
|
function (config, settings, reset) {
|
|
1302
|
-
var
|
|
1347
|
+
var e_4, _a;
|
|
1303
1348
|
/** @type {?} */
|
|
1304
1349
|
var findPersonControl = this.form ? this.form.get('findPersonControl') : null;
|
|
1305
1350
|
this.form = this.fb.group({});
|
|
@@ -1361,7 +1406,7 @@
|
|
|
1361
1406
|
}
|
|
1362
1407
|
// if field updates find person component set the initial domain
|
|
1363
1408
|
if (field.findPersonField) {
|
|
1364
|
-
this_1.
|
|
1409
|
+
this_1.fieldChanged(field, this_1.form);
|
|
1365
1410
|
}
|
|
1366
1411
|
}
|
|
1367
1412
|
};
|
|
@@ -1372,8 +1417,8 @@
|
|
|
1372
1417
|
_loop_1(field);
|
|
1373
1418
|
}
|
|
1374
1419
|
}
|
|
1375
|
-
catch (
|
|
1376
|
-
|
|
1420
|
+
catch (e_4_1) {
|
|
1421
|
+
e_4 = { error: e_4_1 };
|
|
1377
1422
|
}
|
|
1378
1423
|
finally {
|
|
1379
1424
|
try {
|
|
@@ -1381,8 +1426,8 @@
|
|
|
1381
1426
|
_a.call(_b);
|
|
1382
1427
|
}
|
|
1383
1428
|
finally {
|
|
1384
|
-
if (
|
|
1385
|
-
throw
|
|
1429
|
+
if (e_4)
|
|
1430
|
+
throw e_4.error;
|
|
1386
1431
|
}
|
|
1387
1432
|
}
|
|
1388
1433
|
};
|
|
@@ -1399,7 +1444,7 @@
|
|
|
1399
1444
|
* @return {?}
|
|
1400
1445
|
*/
|
|
1401
1446
|
function (field, settings) {
|
|
1402
|
-
var
|
|
1447
|
+
var e_5, _a;
|
|
1403
1448
|
/** @type {?} */
|
|
1404
1449
|
var validators = GenericFilterComponent.addFormValidators(field);
|
|
1405
1450
|
/** @type {?} */
|
|
@@ -1429,8 +1474,8 @@
|
|
|
1429
1474
|
_loop_2(option);
|
|
1430
1475
|
}
|
|
1431
1476
|
}
|
|
1432
|
-
catch (
|
|
1433
|
-
|
|
1477
|
+
catch (e_5_1) {
|
|
1478
|
+
e_5 = { error: e_5_1 };
|
|
1434
1479
|
}
|
|
1435
1480
|
finally {
|
|
1436
1481
|
try {
|
|
@@ -1438,8 +1483,8 @@
|
|
|
1438
1483
|
_a.call(_b);
|
|
1439
1484
|
}
|
|
1440
1485
|
finally {
|
|
1441
|
-
if (
|
|
1442
|
-
throw
|
|
1486
|
+
if (e_5)
|
|
1487
|
+
throw e_5.error;
|
|
1443
1488
|
}
|
|
1444
1489
|
}
|
|
1445
1490
|
return formArray;
|
|
@@ -1457,7 +1502,7 @@
|
|
|
1457
1502
|
* @return {?}
|
|
1458
1503
|
*/
|
|
1459
1504
|
function (field, settings) {
|
|
1460
|
-
var
|
|
1505
|
+
var e_6, _a;
|
|
1461
1506
|
/** @type {?} */
|
|
1462
1507
|
var validators = GenericFilterComponent.addFormValidators(field);
|
|
1463
1508
|
/** @type {?} */
|
|
@@ -1469,23 +1514,25 @@
|
|
|
1469
1514
|
* @param {?} f
|
|
1470
1515
|
* @return {?}
|
|
1471
1516
|
*/function (f) { return f.name === field.name; }));
|
|
1472
|
-
|
|
1473
|
-
for (var _b = __values(defaultValues.value), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1474
|
-
var defaultValue = _c.value;
|
|
1475
|
-
formArray.push(new forms.FormControl(defaultValue));
|
|
1476
|
-
}
|
|
1477
|
-
}
|
|
1478
|
-
catch (e_4_1) {
|
|
1479
|
-
e_4 = { error: e_4_1 };
|
|
1480
|
-
}
|
|
1481
|
-
finally {
|
|
1517
|
+
if (defaultValues) {
|
|
1482
1518
|
try {
|
|
1483
|
-
|
|
1484
|
-
|
|
1519
|
+
for (var _b = __values(defaultValues.value), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1520
|
+
var defaultValue = _c.value;
|
|
1521
|
+
formArray.push(new forms.FormControl(defaultValue));
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
catch (e_6_1) {
|
|
1525
|
+
e_6 = { error: e_6_1 };
|
|
1485
1526
|
}
|
|
1486
1527
|
finally {
|
|
1487
|
-
|
|
1488
|
-
|
|
1528
|
+
try {
|
|
1529
|
+
if (_c && !_c.done && (_a = _b.return))
|
|
1530
|
+
_a.call(_b);
|
|
1531
|
+
}
|
|
1532
|
+
finally {
|
|
1533
|
+
if (e_6)
|
|
1534
|
+
throw e_6.error;
|
|
1535
|
+
}
|
|
1489
1536
|
}
|
|
1490
1537
|
}
|
|
1491
1538
|
}
|
|
@@ -1520,7 +1567,7 @@
|
|
|
1520
1567
|
return { value: values, name: name };
|
|
1521
1568
|
}
|
|
1522
1569
|
else {
|
|
1523
|
-
return { value:
|
|
1570
|
+
return { value: getValues(field.options, values), name: name };
|
|
1524
1571
|
}
|
|
1525
1572
|
}
|
|
1526
1573
|
else {
|
|
@@ -1539,7 +1586,7 @@
|
|
|
1539
1586
|
* @return {?}
|
|
1540
1587
|
*/
|
|
1541
1588
|
function (form) {
|
|
1542
|
-
var
|
|
1589
|
+
var e_7, _a;
|
|
1543
1590
|
/** @type {?} */
|
|
1544
1591
|
var errors = [];
|
|
1545
1592
|
try {
|
|
@@ -1555,8 +1602,8 @@
|
|
|
1555
1602
|
}
|
|
1556
1603
|
}
|
|
1557
1604
|
}
|
|
1558
|
-
catch (
|
|
1559
|
-
|
|
1605
|
+
catch (e_7_1) {
|
|
1606
|
+
e_7 = { error: e_7_1 };
|
|
1560
1607
|
}
|
|
1561
1608
|
finally {
|
|
1562
1609
|
try {
|
|
@@ -1564,8 +1611,8 @@
|
|
|
1564
1611
|
_a.call(_b);
|
|
1565
1612
|
}
|
|
1566
1613
|
finally {
|
|
1567
|
-
if (
|
|
1568
|
-
throw
|
|
1614
|
+
if (e_7)
|
|
1615
|
+
throw e_7.error;
|
|
1569
1616
|
}
|
|
1570
1617
|
}
|
|
1571
1618
|
if (errors.length) {
|
|
@@ -1575,7 +1622,7 @@
|
|
|
1575
1622
|
GenericFilterComponent.decorators = [
|
|
1576
1623
|
{ type: i0.Component, args: [{
|
|
1577
1624
|
selector: 'xuilib-generic-filter',
|
|
1578
|
-
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)=\"
|
|
1625
|
+
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 [submitted]=\"submitted\"\n [disabled]=\"disabled(field, form)\"\n [domain]=\"form.get(field.domainField)?.value\"\n [findPersonGroup]=\"form\"\n [selectedPerson]=\"form.get(field.name)?.value?.email\"\n [userIncluded]=\"false\"\n ></xuilib-find-person>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-location'\">\n <xuilib-find-location [form]=\"form\"\n [fields]=\"config.fields\"\n [title]=\"field.title\"\n [enableAddLocationButton]=\"field.enableAddLocationButton\"\n [disabled]=\"disabled(field, form)\"\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 </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",
|
|
1579
1626
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1580
1627
|
encapsulation: i0.ViewEncapsulation.None,
|
|
1581
1628
|
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}"]
|
|
@@ -3667,253 +3714,335 @@
|
|
|
3667
3714
|
|
|
3668
3715
|
/**
|
|
3669
3716
|
* @fileoverview added by tsickle
|
|
3670
|
-
* Generated from: lib/
|
|
3717
|
+
* Generated from: lib/services/locations/location.service.ts
|
|
3671
3718
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3672
3719
|
*/
|
|
3673
|
-
var
|
|
3674
|
-
function
|
|
3675
|
-
this.
|
|
3720
|
+
var LocationService = /** @class */ (function () {
|
|
3721
|
+
function LocationService(http) {
|
|
3722
|
+
this.http = http;
|
|
3723
|
+
}
|
|
3724
|
+
/**
|
|
3725
|
+
* @description getAllLocations from service Ids/location type/search term
|
|
3726
|
+
* @param serviceIds: SSCS | SSCS,IA split with ','
|
|
3727
|
+
* @param locationType: optional | hearing | case_management
|
|
3728
|
+
* @param searchTerm: any search term for postcode | site name | venue name |court name | court address etc.
|
|
3729
|
+
* @return Observable<LocationByEPIMMSModel[]>: Array of locationModel in Observable
|
|
3730
|
+
*/
|
|
3731
|
+
/**
|
|
3732
|
+
* \@description getAllLocations from service Ids/location type/search term
|
|
3733
|
+
* @param {?} serviceIds
|
|
3734
|
+
* @param {?} locationType
|
|
3735
|
+
* @param {?} searchTerm
|
|
3736
|
+
* @return {?} Observable<LocationByEPIMMSModel[]>: Array of locationModel in Observable
|
|
3737
|
+
*/
|
|
3738
|
+
LocationService.prototype.getAllLocations = /**
|
|
3739
|
+
* \@description getAllLocations from service Ids/location type/search term
|
|
3740
|
+
* @param {?} serviceIds
|
|
3741
|
+
* @param {?} locationType
|
|
3742
|
+
* @param {?} searchTerm
|
|
3743
|
+
* @return {?} Observable<LocationByEPIMMSModel[]>: Array of locationModel in Observable
|
|
3744
|
+
*/
|
|
3745
|
+
function (serviceIds, locationType, searchTerm) {
|
|
3746
|
+
return this.http.get("api/locations/getLocations?serviceIds=" + serviceIds + "&locationType=" + locationType + "&searchTerm=" + searchTerm);
|
|
3747
|
+
};
|
|
3748
|
+
LocationService.decorators = [
|
|
3749
|
+
{ type: i0.Injectable, args: [{
|
|
3750
|
+
providedIn: 'root'
|
|
3751
|
+
},] }
|
|
3752
|
+
];
|
|
3753
|
+
/** @nocollapse */
|
|
3754
|
+
LocationService.ctorParameters = function () {
|
|
3755
|
+
return [
|
|
3756
|
+
{ type: i1.HttpClient }
|
|
3757
|
+
];
|
|
3758
|
+
};
|
|
3759
|
+
/** @nocollapse */ LocationService.ngInjectableDef = i0.defineInjectable({ factory: function LocationService_Factory() { return new LocationService(i0.inject(i1.HttpClient)); }, token: LocationService, providedIn: "root" });
|
|
3760
|
+
return LocationService;
|
|
3761
|
+
}());
|
|
3762
|
+
|
|
3763
|
+
/**
|
|
3764
|
+
* @fileoverview added by tsickle
|
|
3765
|
+
* Generated from: lib/components/search-location/search-location.component.ts
|
|
3766
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3767
|
+
*/
|
|
3768
|
+
var SearchLocationComponent = /** @class */ (function () {
|
|
3769
|
+
function SearchLocationComponent(locationService, fb, cd) {
|
|
3770
|
+
this.locationService = locationService;
|
|
3771
|
+
this.fb = fb;
|
|
3772
|
+
this.cd = cd;
|
|
3773
|
+
this.disabled = null;
|
|
3774
|
+
this.singleMode = false;
|
|
3775
|
+
this.locationType = '';
|
|
3776
|
+
this.serviceIds = '';
|
|
3676
3777
|
this.submitted = true;
|
|
3778
|
+
this.delay = 500;
|
|
3779
|
+
this.showAutocomplete = false;
|
|
3677
3780
|
this.locations = [];
|
|
3678
|
-
this.
|
|
3679
|
-
this.
|
|
3680
|
-
this.
|
|
3781
|
+
this.locationSelected = new i0.EventEmitter();
|
|
3782
|
+
this.locationInputChanged = new i0.EventEmitter();
|
|
3783
|
+
this.minSearchCharacters = 3;
|
|
3784
|
+
this.term = '';
|
|
3785
|
+
this.pSelectedLocations = [];
|
|
3786
|
+
this.pReset = true;
|
|
3787
|
+
this.form = this.fb.group({
|
|
3788
|
+
searchTerm: ['']
|
|
3789
|
+
});
|
|
3681
3790
|
}
|
|
3682
|
-
Object.defineProperty(
|
|
3791
|
+
Object.defineProperty(SearchLocationComponent.prototype, "reset", {
|
|
3683
3792
|
get: /**
|
|
3684
3793
|
* @return {?}
|
|
3685
3794
|
*/ function () {
|
|
3686
|
-
return this.
|
|
3795
|
+
return this.pReset;
|
|
3687
3796
|
},
|
|
3688
3797
|
set: /**
|
|
3689
3798
|
* @param {?} value
|
|
3690
3799
|
* @return {?}
|
|
3691
3800
|
*/ function (value) {
|
|
3692
|
-
|
|
3693
|
-
this.
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3801
|
+
this.pReset = value;
|
|
3802
|
+
this.resetSearchTerm();
|
|
3803
|
+
},
|
|
3804
|
+
enumerable: true,
|
|
3805
|
+
configurable: true
|
|
3806
|
+
});
|
|
3807
|
+
Object.defineProperty(SearchLocationComponent.prototype, "selectedLocations", {
|
|
3808
|
+
get: /**
|
|
3809
|
+
* @return {?}
|
|
3810
|
+
*/ function () {
|
|
3811
|
+
return this.pSelectedLocations;
|
|
3812
|
+
},
|
|
3813
|
+
set: /**
|
|
3814
|
+
* @param {?} value
|
|
3815
|
+
* @return {?}
|
|
3816
|
+
*/ function (value) {
|
|
3817
|
+
this.pSelectedLocations = value;
|
|
3705
3818
|
},
|
|
3706
3819
|
enumerable: true,
|
|
3707
3820
|
configurable: true
|
|
3708
3821
|
});
|
|
3709
3822
|
/**
|
|
3710
|
-
* @private
|
|
3711
|
-
* @param {?} selectedLocations
|
|
3712
|
-
* @param {?} formArray
|
|
3713
3823
|
* @return {?}
|
|
3714
3824
|
*/
|
|
3715
|
-
|
|
3716
|
-
* @private
|
|
3717
|
-
* @param {?} selectedLocations
|
|
3718
|
-
* @param {?} formArray
|
|
3825
|
+
SearchLocationComponent.prototype.ngOnInit = /**
|
|
3719
3826
|
* @return {?}
|
|
3720
3827
|
*/
|
|
3721
|
-
function (
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
formArray.push(new forms.FormControl(location_1));
|
|
3727
|
-
}
|
|
3728
|
-
}
|
|
3729
|
-
catch (e_1_1) {
|
|
3730
|
-
e_1 = { error: e_1_1 };
|
|
3731
|
-
}
|
|
3732
|
-
finally {
|
|
3733
|
-
try {
|
|
3734
|
-
if (selectedLocations_1_1 && !selectedLocations_1_1.done && (_a = selectedLocations_1.return))
|
|
3735
|
-
_a.call(selectedLocations_1);
|
|
3736
|
-
}
|
|
3737
|
-
finally {
|
|
3738
|
-
if (e_1)
|
|
3739
|
-
throw e_1.error;
|
|
3740
|
-
}
|
|
3828
|
+
function () {
|
|
3829
|
+
if (this.singleMode && this.selectedLocations.length > 0) {
|
|
3830
|
+
/** @type {?} */
|
|
3831
|
+
var location_1 = this.selectedLocations[0];
|
|
3832
|
+
this.form.controls.searchTerm.patchValue(location_1.venue_name, { emitEvent: false, onlySelf: true });
|
|
3741
3833
|
}
|
|
3742
|
-
|
|
3834
|
+
this.search();
|
|
3743
3835
|
};
|
|
3744
3836
|
/**
|
|
3837
|
+
* @param {?} term
|
|
3745
3838
|
* @return {?}
|
|
3746
3839
|
*/
|
|
3747
|
-
|
|
3840
|
+
SearchLocationComponent.prototype.filter = /**
|
|
3841
|
+
* @param {?} term
|
|
3748
3842
|
* @return {?}
|
|
3749
3843
|
*/
|
|
3750
|
-
function () {
|
|
3751
|
-
|
|
3844
|
+
function (term) {
|
|
3845
|
+
var _this = this;
|
|
3846
|
+
this.getLocations(term).pipe(operators.map(( /**
|
|
3847
|
+
* @param {?} locations
|
|
3848
|
+
* @return {?}
|
|
3849
|
+
*/function (locations) { return _this.removeSelectedLocations(locations); })));
|
|
3752
3850
|
};
|
|
3753
3851
|
/**
|
|
3852
|
+
* @param {?} location
|
|
3754
3853
|
* @return {?}
|
|
3755
3854
|
*/
|
|
3756
|
-
|
|
3757
|
-
* @
|
|
3855
|
+
SearchLocationComponent.prototype.onSelectionChange = /**
|
|
3856
|
+
* @param {?} location
|
|
3857
|
+
* @return {?}
|
|
3758
3858
|
*/
|
|
3759
|
-
function () {
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
var locationsForm = this.locationsForm;
|
|
3763
|
-
this.selectedLocations = ( /** @type {?} */(this.locationsForm.value));
|
|
3764
|
-
/** @type {?} */
|
|
3765
|
-
var formArray = ( /** @type {?} */(this.form.get(this.field.name)));
|
|
3766
|
-
/** @type {?} */
|
|
3767
|
-
var lastSavedValue = this.selectedLocations[this.selectedLocations.length - 1];
|
|
3768
|
-
FindLocationComponent.initForm([lastSavedValue], formArray);
|
|
3769
|
-
locationsForm.at(this.selectedLocations.length - 1).setValue(null);
|
|
3770
|
-
}
|
|
3771
|
-
this.locations = [];
|
|
3859
|
+
function (location) {
|
|
3860
|
+
this.form.controls.searchTerm.patchValue(location.venue_name, { emitEvent: false, onlySelf: true });
|
|
3861
|
+
this.locationSelected.emit(location);
|
|
3772
3862
|
};
|
|
3773
3863
|
/**
|
|
3774
|
-
* @param {?} location
|
|
3775
3864
|
* @return {?}
|
|
3776
3865
|
*/
|
|
3777
|
-
|
|
3778
|
-
* @param {?} location
|
|
3866
|
+
SearchLocationComponent.prototype.search = /**
|
|
3779
3867
|
* @return {?}
|
|
3780
3868
|
*/
|
|
3781
|
-
function (
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3869
|
+
function () {
|
|
3870
|
+
var _this = this;
|
|
3871
|
+
this.form.controls.searchTerm.valueChanges
|
|
3872
|
+
.pipe(operators.tap(( /**
|
|
3873
|
+
* @param {?} term
|
|
3874
|
+
* @return {?}
|
|
3875
|
+
*/function (term) { return _this.locationInputChanged.next(term); })), operators.tap(( /**
|
|
3876
|
+
* @return {?}
|
|
3877
|
+
*/function () { return _this.locations = []; })), operators.tap(( /**
|
|
3878
|
+
* @param {?} term
|
|
3879
|
+
* @return {?}
|
|
3880
|
+
*/function (term) { return _this.term = term; })), operators.filter(( /**
|
|
3881
|
+
* @param {?} term
|
|
3882
|
+
* @return {?}
|
|
3883
|
+
*/function (term) { return !!term && term.length >= _this.minSearchCharacters; })), operators.debounceTime(this.delay), operators.mergeMap(( /**
|
|
3884
|
+
* @param {?} value
|
|
3885
|
+
* @return {?}
|
|
3886
|
+
*/function (value) { return _this.getLocations(value); })), operators.map(( /**
|
|
3887
|
+
* @param {?} locations
|
|
3888
|
+
* @return {?}
|
|
3889
|
+
*/function (locations) { return _this.removeSelectedLocations(locations); }))).subscribe(( /**
|
|
3890
|
+
* @param {?} locations
|
|
3891
|
+
* @return {?}
|
|
3892
|
+
*/function (locations) {
|
|
3893
|
+
_this.locations = locations;
|
|
3894
|
+
_this.cd.markForCheck();
|
|
3895
|
+
if (locations.length === 1 && _this.term === locations[0].venue_name && !_this.singleMode) {
|
|
3896
|
+
_this.locationSelected.emit(locations[0]);
|
|
3897
|
+
_this.showAutocomplete = false;
|
|
3898
|
+
return;
|
|
3796
3899
|
}
|
|
3797
|
-
|
|
3900
|
+
_this.showAutocomplete = true;
|
|
3901
|
+
}));
|
|
3798
3902
|
};
|
|
3799
3903
|
/**
|
|
3800
|
-
* @param {?}
|
|
3904
|
+
* @param {?} term
|
|
3801
3905
|
* @return {?}
|
|
3802
3906
|
*/
|
|
3803
|
-
|
|
3804
|
-
* @param {?}
|
|
3907
|
+
SearchLocationComponent.prototype.getLocations = /**
|
|
3908
|
+
* @param {?} term
|
|
3805
3909
|
* @return {?}
|
|
3806
3910
|
*/
|
|
3807
|
-
function (
|
|
3808
|
-
|
|
3809
|
-
this.locations = __spread(this.locations, [location]);
|
|
3810
|
-
}
|
|
3911
|
+
function (term) {
|
|
3912
|
+
return this.locationService.getAllLocations(this.serviceIds, this.locationType, term);
|
|
3811
3913
|
};
|
|
3812
|
-
FindLocationComponent.decorators = [
|
|
3813
|
-
{ type: i0.Component, args: [{
|
|
3814
|
-
selector: 'xuilib-find-location',
|
|
3815
|
-
template: "<div class=\"location-picker-custom\">\n <div class=\"search-location\">\n <div>\n <label id=\"input-selected-location-label\">Search for a location by name</label>\n </div>\n <exui-search-location class=\"search-location\"\n (locationSelected)=\"onLocationSelected($event)\"\n [selectedLocations]=\"selectedLocations\"\n [control]=\"locationsForm\"\n [locations]=\"locations\"\n [delay]=\"300\"\n [disabled]=false\n [serviceIds]=\"serviceIds\"\n [locationType]=\"'case-management'\"></exui-search-location>\n <a href=\"javascript:void(0)\" (click)=\"addLocation()\" class=\"govuk-button\" data-module=\"govuk-button\">\n Add location\n </a>\n </div>\n <ul *ngIf=\"selectedLocations.length\" class=\"hmcts-filter-tags selection-container\">\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.court_name }}\n </a>\n </li>\n </ul>\n</div>\n",
|
|
3816
|
-
styles: [""]
|
|
3817
|
-
}] }
|
|
3818
|
-
];
|
|
3819
|
-
FindLocationComponent.propDecorators = {
|
|
3820
|
-
selectedLocations: [{ type: i0.Input }],
|
|
3821
|
-
submitted: [{ type: i0.Input }],
|
|
3822
|
-
form: [{ type: i0.Input }],
|
|
3823
|
-
field: [{ type: i0.Input }],
|
|
3824
|
-
fields: [{ type: i0.Input }],
|
|
3825
|
-
services: [{ type: i0.Input }]
|
|
3826
|
-
};
|
|
3827
|
-
return FindLocationComponent;
|
|
3828
|
-
}());
|
|
3829
|
-
|
|
3830
|
-
/**
|
|
3831
|
-
* @fileoverview added by tsickle
|
|
3832
|
-
* Generated from: lib/services/locations/location.service.ts
|
|
3833
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3834
|
-
*/
|
|
3835
|
-
var LocationService = /** @class */ (function () {
|
|
3836
|
-
function LocationService(http) {
|
|
3837
|
-
this.http = http;
|
|
3838
|
-
}
|
|
3839
3914
|
/**
|
|
3840
|
-
* @
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
* @
|
|
3844
|
-
* @return Observable<LocationByEPIMSModel[]>: Array of locationModel in Observable
|
|
3915
|
+
* @return {?}
|
|
3916
|
+
*/
|
|
3917
|
+
SearchLocationComponent.prototype.resetSearchTerm = /**
|
|
3918
|
+
* @return {?}
|
|
3845
3919
|
*/
|
|
3920
|
+
function () {
|
|
3921
|
+
this.form.controls.searchTerm.patchValue('', { emitEvent: false, onlySelf: true });
|
|
3922
|
+
};
|
|
3846
3923
|
/**
|
|
3847
|
-
*
|
|
3848
|
-
* @param {?}
|
|
3849
|
-
* @
|
|
3850
|
-
* @param {?} searchTerm
|
|
3851
|
-
* @return {?} Observable<LocationByEPIMSModel[]>: Array of locationModel in Observable
|
|
3924
|
+
* @private
|
|
3925
|
+
* @param {?} locations
|
|
3926
|
+
* @return {?}
|
|
3852
3927
|
*/
|
|
3853
|
-
|
|
3854
|
-
*
|
|
3855
|
-
* @param {?}
|
|
3856
|
-
* @
|
|
3857
|
-
* @param {?} searchTerm
|
|
3858
|
-
* @return {?} Observable<LocationByEPIMSModel[]>: Array of locationModel in Observable
|
|
3928
|
+
SearchLocationComponent.prototype.removeSelectedLocations = /**
|
|
3929
|
+
* @private
|
|
3930
|
+
* @param {?} locations
|
|
3931
|
+
* @return {?}
|
|
3859
3932
|
*/
|
|
3860
|
-
function (
|
|
3861
|
-
|
|
3933
|
+
function (locations) {
|
|
3934
|
+
var _this = this;
|
|
3935
|
+
if (this.singleMode) {
|
|
3936
|
+
return locations;
|
|
3937
|
+
}
|
|
3938
|
+
return locations.filter(( /**
|
|
3939
|
+
* @param {?} location
|
|
3940
|
+
* @return {?}
|
|
3941
|
+
*/function (location) {
|
|
3942
|
+
return !_this.selectedLocations.map(( /**
|
|
3943
|
+
* @param {?} selectedLocation
|
|
3944
|
+
* @return {?}
|
|
3945
|
+
*/function (selectedLocation) { return selectedLocation.epimms_id; })).includes(location.epimms_id) && location.venue_name;
|
|
3946
|
+
}));
|
|
3862
3947
|
};
|
|
3863
|
-
|
|
3864
|
-
{ type: i0.
|
|
3865
|
-
|
|
3866
|
-
|
|
3948
|
+
SearchLocationComponent.decorators = [
|
|
3949
|
+
{ type: i0.Component, args: [{
|
|
3950
|
+
selector: 'exui-search-location',
|
|
3951
|
+
template: "<div class=\"auto-complete-container\">\n <input\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.venue_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",
|
|
3952
|
+
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}"]
|
|
3953
|
+
}] }
|
|
3867
3954
|
];
|
|
3868
3955
|
/** @nocollapse */
|
|
3869
|
-
|
|
3956
|
+
SearchLocationComponent.ctorParameters = function () {
|
|
3870
3957
|
return [
|
|
3871
|
-
{ type:
|
|
3958
|
+
{ type: LocationService },
|
|
3959
|
+
{ type: forms.FormBuilder },
|
|
3960
|
+
{ type: i0.ChangeDetectorRef }
|
|
3872
3961
|
];
|
|
3873
3962
|
};
|
|
3874
|
-
|
|
3875
|
-
|
|
3963
|
+
SearchLocationComponent.propDecorators = {
|
|
3964
|
+
control: [{ type: i0.Input }],
|
|
3965
|
+
disabled: [{ type: i0.Input }],
|
|
3966
|
+
singleMode: [{ type: i0.Input }],
|
|
3967
|
+
locationType: [{ type: i0.Input }],
|
|
3968
|
+
serviceIds: [{ type: i0.Input }],
|
|
3969
|
+
submitted: [{ type: i0.Input }],
|
|
3970
|
+
delay: [{ type: i0.Input }],
|
|
3971
|
+
form: [{ type: i0.Input }],
|
|
3972
|
+
showAutocomplete: [{ type: i0.Input }],
|
|
3973
|
+
locations: [{ type: i0.Input }],
|
|
3974
|
+
locationSelected: [{ type: i0.Output }],
|
|
3975
|
+
locationInputChanged: [{ type: i0.Output }],
|
|
3976
|
+
reset: [{ type: i0.Input }],
|
|
3977
|
+
selectedLocations: [{ type: i0.Input }]
|
|
3978
|
+
};
|
|
3979
|
+
return SearchLocationComponent;
|
|
3876
3980
|
}());
|
|
3877
3981
|
|
|
3878
3982
|
/**
|
|
3879
3983
|
* @fileoverview added by tsickle
|
|
3880
|
-
* Generated from: lib/components/
|
|
3984
|
+
* Generated from: lib/components/find-location/find-location.component.ts
|
|
3881
3985
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3882
3986
|
*/
|
|
3883
|
-
var
|
|
3884
|
-
function
|
|
3885
|
-
this.
|
|
3886
|
-
this.fb = fb;
|
|
3887
|
-
this.cd = cd;
|
|
3888
|
-
this.disabled = null;
|
|
3889
|
-
this.locationType = '';
|
|
3890
|
-
this.serviceIds = '';
|
|
3987
|
+
var FindLocationComponent = /** @class */ (function () {
|
|
3988
|
+
function FindLocationComponent() {
|
|
3989
|
+
this.selectedLocations = [];
|
|
3891
3990
|
this.submitted = true;
|
|
3892
|
-
this.
|
|
3893
|
-
this.
|
|
3991
|
+
this.enableAddLocationButton = true;
|
|
3992
|
+
this.title = 'Search for a location by name';
|
|
3894
3993
|
this.locations = [];
|
|
3895
|
-
this.
|
|
3896
|
-
this.
|
|
3897
|
-
this.
|
|
3898
|
-
this.
|
|
3899
|
-
this.pSelectedLocations = [];
|
|
3900
|
-
this.findLocationFormGroup = this.fb.group({
|
|
3901
|
-
findLocationFormControl: [null],
|
|
3902
|
-
locationSelectedFormControl: [null]
|
|
3903
|
-
});
|
|
3994
|
+
this.tempSelectedLocation = null;
|
|
3995
|
+
this.serviceIds = 'SSCS,IA';
|
|
3996
|
+
this.pServices = [];
|
|
3997
|
+
this.pDisabled = false;
|
|
3904
3998
|
}
|
|
3905
|
-
Object.defineProperty(
|
|
3999
|
+
Object.defineProperty(FindLocationComponent.prototype, "disabled", {
|
|
3906
4000
|
get: /**
|
|
3907
4001
|
* @return {?}
|
|
3908
4002
|
*/ function () {
|
|
3909
|
-
return this.
|
|
4003
|
+
return this.pDisabled;
|
|
3910
4004
|
},
|
|
3911
4005
|
set: /**
|
|
3912
4006
|
* @param {?} value
|
|
3913
4007
|
* @return {?}
|
|
3914
4008
|
*/ function (value) {
|
|
3915
|
-
|
|
3916
|
-
|
|
4009
|
+
if (value) {
|
|
4010
|
+
this.searchLocationComponent.resetSearchTerm();
|
|
4011
|
+
this.removeSelectedValues();
|
|
4012
|
+
}
|
|
4013
|
+
this.pDisabled = value;
|
|
4014
|
+
},
|
|
4015
|
+
enumerable: true,
|
|
4016
|
+
configurable: true
|
|
4017
|
+
});
|
|
4018
|
+
Object.defineProperty(FindLocationComponent.prototype, "services", {
|
|
4019
|
+
get: /**
|
|
4020
|
+
* @return {?}
|
|
4021
|
+
*/ function () {
|
|
4022
|
+
return this.pServices;
|
|
4023
|
+
},
|
|
4024
|
+
set: /**
|
|
4025
|
+
* @param {?} value
|
|
4026
|
+
* @return {?}
|
|
4027
|
+
*/ function (value) {
|
|
4028
|
+
var _this = this;
|
|
4029
|
+
this.pServices = value;
|
|
4030
|
+
/** @type {?} */
|
|
4031
|
+
var field = this.fields.find(( /**
|
|
4032
|
+
* @param {?} f
|
|
4033
|
+
* @return {?}
|
|
4034
|
+
*/function (f) { return f.name === _this.field.findLocationField; }));
|
|
4035
|
+
if (field) {
|
|
4036
|
+
if (typeof value === 'string') {
|
|
4037
|
+
this.serviceIds = value;
|
|
4038
|
+
}
|
|
4039
|
+
else {
|
|
4040
|
+
this.serviceIds = getValues(field.options, value).filter(( /**
|
|
4041
|
+
* @param {?} x
|
|
4042
|
+
* @return {?}
|
|
4043
|
+
*/function (x) { return x !== 'services_all'; })).join(',');
|
|
4044
|
+
}
|
|
4045
|
+
}
|
|
3917
4046
|
},
|
|
3918
4047
|
enumerable: true,
|
|
3919
4048
|
configurable: true
|
|
@@ -3921,194 +4050,152 @@
|
|
|
3921
4050
|
/**
|
|
3922
4051
|
* @return {?}
|
|
3923
4052
|
*/
|
|
3924
|
-
|
|
4053
|
+
FindLocationComponent.prototype.addLocation = /**
|
|
3925
4054
|
* @return {?}
|
|
3926
4055
|
*/
|
|
3927
4056
|
function () {
|
|
3928
|
-
this.
|
|
4057
|
+
if (this.tempSelectedLocation) {
|
|
4058
|
+
this.selectedLocations = __spread(this.selectedLocations, [this.tempSelectedLocation]);
|
|
4059
|
+
this.addSelectedLocationsToForm([this.tempSelectedLocation]);
|
|
4060
|
+
this.tempSelectedLocation = null;
|
|
4061
|
+
this.locations = [];
|
|
4062
|
+
this.searchLocationComponent.resetSearchTerm();
|
|
4063
|
+
}
|
|
3929
4064
|
};
|
|
3930
4065
|
/**
|
|
4066
|
+
* @param {?} location
|
|
3931
4067
|
* @return {?}
|
|
3932
4068
|
*/
|
|
3933
|
-
|
|
4069
|
+
FindLocationComponent.prototype.removeLocation = /**
|
|
4070
|
+
* @param {?} location
|
|
3934
4071
|
* @return {?}
|
|
3935
4072
|
*/
|
|
3936
|
-
function () {
|
|
3937
|
-
if (
|
|
3938
|
-
|
|
3939
|
-
|
|
4073
|
+
function (location) {
|
|
4074
|
+
if (location.epimms_id) {
|
|
4075
|
+
this.selectedLocations = this.selectedLocations.filter(( /**
|
|
4076
|
+
* @param {?} selectedLocation
|
|
4077
|
+
* @return {?}
|
|
4078
|
+
*/function (selectedLocation) { return selectedLocation.epimms_id !== location.epimms_id; }));
|
|
4079
|
+
/** @type {?} */
|
|
4080
|
+
var formArray = ( /** @type {?} */(this.form.get(this.field.name)));
|
|
4081
|
+
/** @type {?} */
|
|
4082
|
+
var index = (( /** @type {?} */(formArray.value))).findIndex(( /**
|
|
4083
|
+
* @param {?} selectedLocation
|
|
4084
|
+
* @return {?}
|
|
4085
|
+
*/function (selectedLocation) { return selectedLocation.epimms_id === location.epimms_id; }));
|
|
4086
|
+
if (index > -1) {
|
|
4087
|
+
formArray.removeAt(index);
|
|
3940
4088
|
}
|
|
3941
4089
|
}
|
|
3942
|
-
this.search();
|
|
3943
|
-
};
|
|
3944
|
-
/**
|
|
3945
|
-
* @return {?}
|
|
3946
|
-
*/
|
|
3947
|
-
SearchLocationComponent.prototype.onKeyDown = /**
|
|
3948
|
-
* @return {?}
|
|
3949
|
-
*/
|
|
3950
|
-
function () {
|
|
3951
|
-
this.locationSelected.emit();
|
|
3952
4090
|
};
|
|
3953
4091
|
/**
|
|
3954
4092
|
* @param {?} term
|
|
3955
4093
|
* @return {?}
|
|
3956
4094
|
*/
|
|
3957
|
-
|
|
4095
|
+
FindLocationComponent.prototype.onInputChanged = /**
|
|
3958
4096
|
* @param {?} term
|
|
3959
4097
|
* @return {?}
|
|
3960
4098
|
*/
|
|
3961
4099
|
function (term) {
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
*/function (locations) { return _this.removeSelectedLocations(locations); })));
|
|
4100
|
+
// if the filter is in single mode clear the selected locations
|
|
4101
|
+
if (typeof term === 'string' && this.field.maxSelected === 1) {
|
|
4102
|
+
this.removeSelectedValues();
|
|
4103
|
+
}
|
|
3967
4104
|
};
|
|
3968
4105
|
/**
|
|
3969
|
-
* @param {
|
|
4106
|
+
* @param {?} location
|
|
3970
4107
|
* @return {?}
|
|
3971
4108
|
*/
|
|
3972
|
-
|
|
3973
|
-
* @param {
|
|
4109
|
+
FindLocationComponent.prototype.onLocationSelected = /**
|
|
4110
|
+
* @param {?} location
|
|
3974
4111
|
* @return {?}
|
|
3975
4112
|
*/
|
|
3976
|
-
function (
|
|
3977
|
-
if (this.
|
|
3978
|
-
|
|
4113
|
+
function (location) {
|
|
4114
|
+
if (this.field.maxSelected === 1) {
|
|
4115
|
+
this.removeSelectedValues();
|
|
4116
|
+
this.addSelectedLocationsToForm([location]);
|
|
3979
4117
|
}
|
|
3980
4118
|
else {
|
|
3981
|
-
this.
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
/**
|
|
3988
|
-
* @return {?}
|
|
3989
|
-
*/
|
|
3990
|
-
SearchLocationComponent.prototype.search = /**
|
|
3991
|
-
* @return {?}
|
|
3992
|
-
*/
|
|
3993
|
-
function () {
|
|
3994
|
-
var _this = this;
|
|
3995
|
-
this.findLocationFormGroup.controls.findLocationFormControl.valueChanges
|
|
3996
|
-
.pipe(operators.tap(( /**
|
|
3997
|
-
* @return {?}
|
|
3998
|
-
*/function () { return _this.locations = []; })), operators.tap(( /**
|
|
3999
|
-
* @return {?}
|
|
4000
|
-
*/function () { return _this.showAutocomplete = false; })), operators.tap(( /**
|
|
4001
|
-
* @param {?} term
|
|
4002
|
-
* @return {?}
|
|
4003
|
-
*/function (term) { return _this.term = term; })), operators.filter(( /**
|
|
4004
|
-
* @param {?} term
|
|
4005
|
-
* @return {?}
|
|
4006
|
-
*/function (term) { return !!term && term.length >= _this.minSearchCharacters; })), operators.debounceTime(this.delay), operators.mergeMap(( /**
|
|
4007
|
-
* @param {?} value
|
|
4008
|
-
* @return {?}
|
|
4009
|
-
*/function (value) { return _this.getLocations(value); })), operators.map(( /**
|
|
4010
|
-
* @param {?} locations
|
|
4011
|
-
* @return {?}
|
|
4012
|
-
*/function (locations) { return _this.removeSelectedLocations(locations); }))).subscribe(( /**
|
|
4013
|
-
* @param {?} locations
|
|
4014
|
-
* @return {?}
|
|
4015
|
-
*/function (locations) {
|
|
4016
|
-
_this.locations = locations;
|
|
4017
|
-
_this.cd.markForCheck();
|
|
4018
|
-
if (locations.length === 1 && _this.term === locations[0].court_name) {
|
|
4019
|
-
if (_this.findLocationFormGroup.controls.locationSelectedFormControl instanceof forms.FormGroup) {
|
|
4020
|
-
_this.findLocationFormGroup.controls.locationSelectedFormControl.setValue(locations[0]);
|
|
4021
|
-
_this.locationSelected.emit(locations[0]);
|
|
4022
|
-
_this.showAutocomplete = false;
|
|
4023
|
-
return;
|
|
4119
|
+
if (!this.selectedLocations.find(( /**
|
|
4120
|
+
* @param {?} x
|
|
4121
|
+
* @return {?}
|
|
4122
|
+
*/function (x) { return x.epimms_id === location.epimms_id; }))) {
|
|
4123
|
+
if (location.epimms_id) {
|
|
4124
|
+
this.tempSelectedLocation = location;
|
|
4024
4125
|
}
|
|
4025
4126
|
}
|
|
4026
|
-
|
|
4027
|
-
}));
|
|
4028
|
-
};
|
|
4029
|
-
/**
|
|
4030
|
-
* @param {?} term
|
|
4031
|
-
* @return {?}
|
|
4032
|
-
*/
|
|
4033
|
-
SearchLocationComponent.prototype.getLocations = /**
|
|
4034
|
-
* @param {?} term
|
|
4035
|
-
* @return {?}
|
|
4036
|
-
*/
|
|
4037
|
-
function (term) {
|
|
4038
|
-
return this.locationService.getAllLocations(this.serviceIds, this.locationType, term);
|
|
4127
|
+
}
|
|
4039
4128
|
};
|
|
4040
4129
|
/**
|
|
4130
|
+
* @private
|
|
4041
4131
|
* @return {?}
|
|
4042
4132
|
*/
|
|
4043
|
-
|
|
4133
|
+
FindLocationComponent.prototype.removeSelectedValues = /**
|
|
4134
|
+
* @private
|
|
4044
4135
|
* @return {?}
|
|
4045
4136
|
*/
|
|
4046
4137
|
function () {
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
/** @type {?} */
|
|
4052
|
-
var value = formArray.value[formArray.length - 1];
|
|
4053
|
-
return value ? formArray.value[formArray.length - 1].court_name : null;
|
|
4054
|
-
}
|
|
4055
|
-
}
|
|
4056
|
-
else {
|
|
4057
|
-
return this.findLocationFormGroup && this.findLocationFormGroup.controls && this.findLocationFormGroup.controls.locationSelectedFormControl.value ?
|
|
4058
|
-
(( /** @type {?} */(this.findLocationFormGroup.controls.locationSelectedFormControl.value))).court_name : '';
|
|
4138
|
+
/** @type {?} */
|
|
4139
|
+
var formArray = ( /** @type {?} */(this.form.get(this.field.name)));
|
|
4140
|
+
for (var i = 0; i < formArray.length; i++) {
|
|
4141
|
+
formArray.removeAt(i);
|
|
4059
4142
|
}
|
|
4143
|
+
this.selectedLocations = [];
|
|
4060
4144
|
};
|
|
4061
4145
|
/**
|
|
4062
4146
|
* @private
|
|
4063
4147
|
* @param {?} locations
|
|
4064
4148
|
* @return {?}
|
|
4065
4149
|
*/
|
|
4066
|
-
|
|
4150
|
+
FindLocationComponent.prototype.addSelectedLocationsToForm = /**
|
|
4067
4151
|
* @private
|
|
4068
4152
|
* @param {?} locations
|
|
4069
4153
|
* @return {?}
|
|
4070
4154
|
*/
|
|
4071
4155
|
function (locations) {
|
|
4072
|
-
var
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4156
|
+
var e_1, _a;
|
|
4157
|
+
/** @type {?} */
|
|
4158
|
+
var formArray = ( /** @type {?} */(this.form.get(this.field.name)));
|
|
4159
|
+
try {
|
|
4160
|
+
for (var locations_1 = __values(locations), locations_1_1 = locations_1.next(); !locations_1_1.done; locations_1_1 = locations_1.next()) {
|
|
4161
|
+
var location_1 = locations_1_1.value;
|
|
4162
|
+
formArray.push(new forms.FormControl(location_1));
|
|
4163
|
+
}
|
|
4164
|
+
}
|
|
4165
|
+
catch (e_1_1) {
|
|
4166
|
+
e_1 = { error: e_1_1 };
|
|
4167
|
+
}
|
|
4168
|
+
finally {
|
|
4169
|
+
try {
|
|
4170
|
+
if (locations_1_1 && !locations_1_1.done && (_a = locations_1.return))
|
|
4171
|
+
_a.call(locations_1);
|
|
4172
|
+
}
|
|
4173
|
+
finally {
|
|
4174
|
+
if (e_1)
|
|
4175
|
+
throw e_1.error;
|
|
4176
|
+
}
|
|
4177
|
+
}
|
|
4082
4178
|
};
|
|
4083
|
-
|
|
4179
|
+
FindLocationComponent.decorators = [
|
|
4084
4180
|
{ type: i0.Component, args: [{
|
|
4085
|
-
selector: '
|
|
4086
|
-
template: "<div class=\"
|
|
4087
|
-
styles: ["
|
|
4181
|
+
selector: 'xuilib-find-location',
|
|
4182
|
+
template: "<div class=\"location-picker-custom\">\n <div class=\"search-location\">\n <div>\n <label id=\"input-selected-location-label\" *ngIf=\"title\">{{title}}</label>\n </div>\n <exui-search-location class=\"search-location\"\n [locations]=\"locations\"\n [selectedLocations]=\"selectedLocations\"\n [singleMode]=\"field.maxSelected === 1\"\n [delay]=\"300\"\n [disabled]=\"disabled\"\n [serviceIds]=\"serviceIds\"\n (locationInputChanged)=\"onInputChanged($event)\"\n (locationSelected)=\"onLocationSelected($event)\"\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.venue_name }}\n </a>\n </li>\n </ul>\n</div>\n",
|
|
4183
|
+
styles: [""]
|
|
4088
4184
|
}] }
|
|
4089
4185
|
];
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
return [
|
|
4093
|
-
{ type: LocationService },
|
|
4094
|
-
{ type: forms.FormBuilder },
|
|
4095
|
-
{ type: i0.ChangeDetectorRef }
|
|
4096
|
-
];
|
|
4097
|
-
};
|
|
4098
|
-
SearchLocationComponent.propDecorators = {
|
|
4099
|
-
control: [{ type: i0.Input }],
|
|
4100
|
-
disabled: [{ type: i0.Input }],
|
|
4101
|
-
locationType: [{ type: i0.Input }],
|
|
4102
|
-
serviceIds: [{ type: i0.Input }],
|
|
4186
|
+
FindLocationComponent.propDecorators = {
|
|
4187
|
+
selectedLocations: [{ type: i0.Input }],
|
|
4103
4188
|
submitted: [{ type: i0.Input }],
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4189
|
+
enableAddLocationButton: [{ type: i0.Input }],
|
|
4190
|
+
form: [{ type: i0.Input }],
|
|
4191
|
+
field: [{ type: i0.Input }],
|
|
4192
|
+
fields: [{ type: i0.Input }],
|
|
4193
|
+
title: [{ type: i0.Input }],
|
|
4194
|
+
searchLocationComponent: [{ type: i0.ViewChild, args: [SearchLocationComponent,] }],
|
|
4195
|
+
disabled: [{ type: i0.Input }],
|
|
4196
|
+
services: [{ type: i0.Input }]
|
|
4110
4197
|
};
|
|
4111
|
-
return
|
|
4198
|
+
return FindLocationComponent;
|
|
4112
4199
|
}());
|
|
4113
4200
|
|
|
4114
4201
|
/**
|
|
@@ -4563,7 +4650,8 @@
|
|
|
4563
4650
|
var userInfo = JSON.parse(userInfoStr);
|
|
4564
4651
|
this.userId = userInfo.id ? userInfo.id : userInfo.uid;
|
|
4565
4652
|
}
|
|
4566
|
-
|
|
4653
|
+
this.assignedUser = searchOptions.assignedUser ? searchOptions.assignedUser : null;
|
|
4654
|
+
return this.http.post('/workallocation2/findPerson', { searchOptions: searchOptions, userId: this.userId, assignedUser: this.assignedUser });
|
|
4567
4655
|
};
|
|
4568
4656
|
/**
|
|
4569
4657
|
* @param {?} searchOptions
|
|
@@ -4582,6 +4670,7 @@
|
|
|
4582
4670
|
var userInfo = JSON.parse(userInfoStr);
|
|
4583
4671
|
this.userId = userInfo.id ? userInfo.id : userInfo.uid;
|
|
4584
4672
|
}
|
|
4673
|
+
this.assignedUser = searchOptions.assignedUser ? searchOptions.assignedUser : null;
|
|
4585
4674
|
/** @type {?} */
|
|
4586
4675
|
var fullServices = searchOptions.services;
|
|
4587
4676
|
/** @type {?} */
|
|
@@ -4689,10 +4778,14 @@
|
|
|
4689
4778
|
* @param {?} person
|
|
4690
4779
|
* @return {?}
|
|
4691
4780
|
*/function (person) { return person && person.name && person.name.toLowerCase().includes(searchTerm); }));
|
|
4692
|
-
return searchOptions.userIncluded ? finalPeopleList
|
|
4781
|
+
return searchOptions.userIncluded ? finalPeopleList.filter(( /**
|
|
4693
4782
|
* @param {?} person
|
|
4694
4783
|
* @return {?}
|
|
4695
|
-
*/function (person) { return person && person.id !== _this.
|
|
4784
|
+
*/function (person) { return person && person.id !== _this.assignedUser; }))
|
|
4785
|
+
: finalPeopleList.filter(( /**
|
|
4786
|
+
* @param {?} person
|
|
4787
|
+
* @return {?}
|
|
4788
|
+
*/function (person) { return person && person.id !== _this.userId && person.id !== _this.assignedUser; }));
|
|
4696
4789
|
};
|
|
4697
4790
|
FindAPersonService.caseworkersKey = 'caseworkers';
|
|
4698
4791
|
FindAPersonService.decorators = [
|
|
@@ -4717,68 +4810,75 @@
|
|
|
4717
4810
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4718
4811
|
*/
|
|
4719
4812
|
var FindPersonComponent = /** @class */ (function () {
|
|
4720
|
-
function FindPersonComponent(findPersonService) {
|
|
4813
|
+
function FindPersonComponent(findPersonService, cd) {
|
|
4721
4814
|
this.findPersonService = findPersonService;
|
|
4815
|
+
this.cd = cd;
|
|
4722
4816
|
this.personSelected = new i0.EventEmitter();
|
|
4723
4817
|
this.boldTitle = 'Find the person';
|
|
4724
4818
|
this.subTitle = 'Type the name of the person and select them.';
|
|
4725
4819
|
this.domain = PersonRole.ALL;
|
|
4820
|
+
this.findPersonGroup = new forms.FormGroup({});
|
|
4726
4821
|
this.submitted = true;
|
|
4727
|
-
this.disabled = null;
|
|
4728
4822
|
this.userIncluded = false;
|
|
4729
4823
|
this.placeholderContent = '';
|
|
4730
|
-
this.isNoResultsShown =
|
|
4824
|
+
this.isNoResultsShown = true;
|
|
4731
4825
|
this.showUpdatedColor = false;
|
|
4732
4826
|
this.selectedPersons = [];
|
|
4733
4827
|
this.errorMessage = 'You must select a name';
|
|
4734
4828
|
this.idValue = '';
|
|
4735
4829
|
this.services = ['IA'];
|
|
4736
|
-
this.
|
|
4830
|
+
this.disabled = null;
|
|
4737
4831
|
this.showAutocomplete = false;
|
|
4738
|
-
this.
|
|
4739
|
-
this.choosenPerson = ( /** @type {?} */({}));
|
|
4740
|
-
this.findPersonControl = new forms.FormControl();
|
|
4832
|
+
this.filteredOptions = [];
|
|
4741
4833
|
this.minSearchCharacters = 2;
|
|
4742
4834
|
}
|
|
4743
4835
|
/**
|
|
4744
4836
|
* @return {?}
|
|
4745
4837
|
*/
|
|
4746
|
-
FindPersonComponent.prototype.
|
|
4838
|
+
FindPersonComponent.prototype.ngOnDestroy = /**
|
|
4747
4839
|
* @return {?}
|
|
4748
4840
|
*/
|
|
4749
4841
|
function () {
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
this.findPersonGroup = new forms.FormGroup({});
|
|
4753
|
-
}
|
|
4754
|
-
else {
|
|
4755
|
-
this.findPersonGroup.addControl('findPersonControl', this.findPersonControl);
|
|
4842
|
+
if (this.sub) {
|
|
4843
|
+
this.sub.unsubscribe();
|
|
4756
4844
|
}
|
|
4757
|
-
this.filteredOptions = this.findPersonControl.valueChanges.pipe(operators.startWith(''), operators.switchMap(( /**
|
|
4758
|
-
* @param {?} searchTerm
|
|
4759
|
-
* @return {?}
|
|
4760
|
-
*/function (searchTerm) {
|
|
4761
|
-
return _this.filter(searchTerm || '');
|
|
4762
|
-
})));
|
|
4763
|
-
this.findPersonControl.setValue(this.selectedPerson);
|
|
4764
4845
|
};
|
|
4765
4846
|
/**
|
|
4766
|
-
* @param {?} changes
|
|
4767
4847
|
* @return {?}
|
|
4768
4848
|
*/
|
|
4769
|
-
FindPersonComponent.prototype.
|
|
4770
|
-
* @param {?} changes
|
|
4849
|
+
FindPersonComponent.prototype.ngOnInit = /**
|
|
4771
4850
|
* @return {?}
|
|
4772
4851
|
*/
|
|
4773
|
-
function (
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4852
|
+
function () {
|
|
4853
|
+
var _this = this;
|
|
4854
|
+
this.findPersonControl = new forms.FormControl(this.selectedPerson);
|
|
4855
|
+
this.findPersonGroup.addControl('findPersonControl', this.findPersonControl);
|
|
4856
|
+
this.sub = this.findPersonControl.valueChanges.pipe(operators.tap(( /**
|
|
4857
|
+
* @return {?}
|
|
4858
|
+
*/function () { return _this.showAutocomplete = false; })), operators.tap(( /**
|
|
4859
|
+
* @return {?}
|
|
4860
|
+
*/function () { return _this.filteredOptions = []; })), operators.debounceTime(300), operators.tap(( /**
|
|
4861
|
+
* @param {?} searchTerm
|
|
4862
|
+
* @return {?}
|
|
4863
|
+
*/function (searchTerm) { return typeof searchTerm === 'string' ? _this.personSelected.emit(null) : void 0; })), operators.filter(( /**
|
|
4864
|
+
* @param {?} searchTerm
|
|
4865
|
+
* @return {?}
|
|
4866
|
+
*/function (searchTerm) { return searchTerm && searchTerm.length > _this.minSearchCharacters; })), operators.switchMap(( /**
|
|
4867
|
+
* @param {?} searchTerm
|
|
4868
|
+
* @return {?}
|
|
4869
|
+
*/function (searchTerm) {
|
|
4870
|
+
return _this.filter(searchTerm).pipe(operators.tap(( /**
|
|
4871
|
+
* @return {?}
|
|
4872
|
+
*/function () { return _this.showAutocomplete = true; })), operators.catchError(( /**
|
|
4873
|
+
* @return {?}
|
|
4874
|
+
*/function () { return _this.filteredOptions = []; })));
|
|
4875
|
+
}))).subscribe(( /**
|
|
4876
|
+
* @param {?} people
|
|
4877
|
+
* @return {?}
|
|
4878
|
+
*/function (people) {
|
|
4879
|
+
_this.filteredOptions = people;
|
|
4880
|
+
_this.cd.detectChanges();
|
|
4881
|
+
}));
|
|
4782
4882
|
};
|
|
4783
4883
|
/**
|
|
4784
4884
|
* @param {?} searchTerm
|
|
@@ -4791,9 +4891,9 @@
|
|
|
4791
4891
|
function (searchTerm) {
|
|
4792
4892
|
var _this = this;
|
|
4793
4893
|
/** @type {?} */
|
|
4794
|
-
var findJudicialPeople = this.findPersonService.find({ searchTerm: searchTerm, userRole: this.domain, services: this.services });
|
|
4894
|
+
var findJudicialPeople = this.findPersonService.find({ searchTerm: searchTerm, userRole: this.domain, services: this.services, userIncluded: this.userIncluded, assignedUser: this.assignedUser });
|
|
4795
4895
|
/** @type {?} */
|
|
4796
|
-
var findCaseworkersOrAdmins = this.findPersonService.findCaseworkers({ searchTerm: searchTerm, userRole: this.domain, services: this.services });
|
|
4896
|
+
var findCaseworkersOrAdmins = this.findPersonService.findCaseworkers({ searchTerm: searchTerm, userRole: this.domain, services: this.services, userIncluded: this.userIncluded, assignedUser: this.assignedUser });
|
|
4797
4897
|
if (searchTerm && searchTerm.length > this.minSearchCharacters) {
|
|
4798
4898
|
switch (this.domain) {
|
|
4799
4899
|
case PersonRole.JUDICIAL: {
|
|
@@ -4829,37 +4929,23 @@
|
|
|
4829
4929
|
return findCaseworkersOrAdmins;
|
|
4830
4930
|
}
|
|
4831
4931
|
default: {
|
|
4832
|
-
return rxjs.of();
|
|
4932
|
+
return rxjs.of([]);
|
|
4833
4933
|
}
|
|
4834
4934
|
}
|
|
4835
4935
|
}
|
|
4836
|
-
return rxjs.of();
|
|
4936
|
+
return rxjs.of([]);
|
|
4837
4937
|
};
|
|
4838
4938
|
/**
|
|
4839
|
-
* @param {
|
|
4939
|
+
* @param {?} selectedPerson
|
|
4840
4940
|
* @return {?}
|
|
4841
4941
|
*/
|
|
4842
4942
|
FindPersonComponent.prototype.onSelectionChange = /**
|
|
4843
|
-
* @param {
|
|
4943
|
+
* @param {?} selectedPerson
|
|
4844
4944
|
* @return {?}
|
|
4845
4945
|
*/
|
|
4846
4946
|
function (selectedPerson) {
|
|
4847
|
-
this.isPersonSelectionCompleted = true;
|
|
4848
|
-
this.choosenPerson = selectedPerson;
|
|
4849
4947
|
this.personSelected.emit(selectedPerson);
|
|
4850
|
-
|
|
4851
|
-
/**
|
|
4852
|
-
* @param {?} currentValue
|
|
4853
|
-
* @return {?}
|
|
4854
|
-
*/
|
|
4855
|
-
FindPersonComponent.prototype.updatedVal = /**
|
|
4856
|
-
* @param {?} currentValue
|
|
4857
|
-
* @return {?}
|
|
4858
|
-
*/
|
|
4859
|
-
function (currentValue) {
|
|
4860
|
-
this.currentInputValue = currentValue;
|
|
4861
|
-
this.showAutocomplete = !!currentValue && (currentValue.length > this.minSearchCharacters);
|
|
4862
|
-
this.isPersonSelectionCompleted = (this.getDisplayName(this.choosenPerson) === currentValue) ? true : false;
|
|
4948
|
+
this.findPersonControl.setValue(this.getDisplayName(selectedPerson), { emitEvent: false, onlySelf: true });
|
|
4863
4949
|
};
|
|
4864
4950
|
/**
|
|
4865
4951
|
* @param {?} selectedPerson
|
|
@@ -4870,6 +4956,9 @@
|
|
|
4870
4956
|
* @return {?}
|
|
4871
4957
|
*/
|
|
4872
4958
|
function (selectedPerson) {
|
|
4959
|
+
if (!selectedPerson) {
|
|
4960
|
+
return '';
|
|
4961
|
+
}
|
|
4873
4962
|
if (selectedPerson.domain === PersonRole.JUDICIAL && selectedPerson.knownAs) {
|
|
4874
4963
|
return selectedPerson.knownAs + "(" + selectedPerson.email + ")";
|
|
4875
4964
|
}
|
|
@@ -4878,14 +4967,15 @@
|
|
|
4878
4967
|
FindPersonComponent.decorators = [
|
|
4879
4968
|
{ type: i0.Component, args: [{
|
|
4880
4969
|
selector: 'xuilib-find-person',
|
|
4881
|
-
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':
|
|
4970
|
+
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 <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",
|
|
4882
4971
|
styles: [".mat-option:hover{background:#2596be}.mat-option.select-option:hover{background:#1d70b8;color:#fff}.hide-autocomplete{display:none}"]
|
|
4883
4972
|
}] }
|
|
4884
4973
|
];
|
|
4885
4974
|
/** @nocollapse */
|
|
4886
4975
|
FindPersonComponent.ctorParameters = function () {
|
|
4887
4976
|
return [
|
|
4888
|
-
{ type: FindAPersonService }
|
|
4977
|
+
{ type: FindAPersonService },
|
|
4978
|
+
{ type: i0.ChangeDetectorRef }
|
|
4889
4979
|
];
|
|
4890
4980
|
};
|
|
4891
4981
|
FindPersonComponent.propDecorators = {
|
|
@@ -4897,15 +4987,16 @@
|
|
|
4897
4987
|
findPersonGroup: [{ type: i0.Input }],
|
|
4898
4988
|
selectedPerson: [{ type: i0.Input }],
|
|
4899
4989
|
submitted: [{ type: i0.Input }],
|
|
4900
|
-
disabled: [{ type: i0.Input }],
|
|
4901
4990
|
userIncluded: [{ type: i0.Input }],
|
|
4991
|
+
assignedUser: [{ type: i0.Input }],
|
|
4902
4992
|
placeholderContent: [{ type: i0.Input }],
|
|
4903
4993
|
isNoResultsShown: [{ type: i0.Input }],
|
|
4904
4994
|
showUpdatedColor: [{ type: i0.Input }],
|
|
4905
4995
|
selectedPersons: [{ type: i0.Input }],
|
|
4906
4996
|
errorMessage: [{ type: i0.Input }],
|
|
4907
4997
|
idValue: [{ type: i0.Input }],
|
|
4908
|
-
services: [{ type: i0.Input }]
|
|
4998
|
+
services: [{ type: i0.Input }],
|
|
4999
|
+
disabled: [{ type: i0.Input }]
|
|
4909
5000
|
};
|
|
4910
5001
|
return FindPersonComponent;
|
|
4911
5002
|
}());
|
|
@@ -5986,7 +6077,8 @@
|
|
|
5986
6077
|
forms.ReactiveFormsModule,
|
|
5987
6078
|
i2$2.RouterModule.forChild([]),
|
|
5988
6079
|
autocomplete.MatAutocompleteModule,
|
|
5989
|
-
material.MatTabsModule
|
|
6080
|
+
material.MatTabsModule,
|
|
6081
|
+
material.MatInputModule
|
|
5990
6082
|
],
|
|
5991
6083
|
providers: [
|
|
5992
6084
|
{ provide: windowToken, useFactory: ɵ0 }
|