@hmcts/rpx-xui-common-lib 3.2.16-pofcc-156 → 3.2.17-4454-1
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.
|
@@ -1541,13 +1541,13 @@ var BookingCheckType;
|
|
|
1541
1541
|
BookingCheckType["POSSIBLE_BOOKINGS"] = "POSSIBLE_BOOKINGS";
|
|
1542
1542
|
})(BookingCheckType || (BookingCheckType = {}));
|
|
1543
1543
|
|
|
1544
|
+
// used as settings for filters and components
|
|
1544
1545
|
var PersonRole;
|
|
1545
1546
|
(function (PersonRole) {
|
|
1546
1547
|
PersonRole["JUDICIAL"] = "Judicial";
|
|
1547
1548
|
PersonRole["LEGAL_OPERATIONS"] = "Legal Ops";
|
|
1548
1549
|
PersonRole["ADMIN"] = "Admin";
|
|
1549
1550
|
PersonRole["CTSC"] = "CTSC";
|
|
1550
|
-
PersonRole["ENFORCEMENT"] = "Enforcement";
|
|
1551
1551
|
PersonRole["ALL"] = "All";
|
|
1552
1552
|
})(PersonRole || (PersonRole = {}));
|
|
1553
1553
|
// Role categories used in application
|
|
@@ -1559,43 +1559,8 @@ var RoleCategory;
|
|
|
1559
1559
|
RoleCategory["CTSC"] = "CTSC";
|
|
1560
1560
|
RoleCategory["PROFESSIONAL"] = "PROFESSIONAL";
|
|
1561
1561
|
RoleCategory["CITIZEN"] = "CITIZEN";
|
|
1562
|
-
RoleCategory["ENFORCEMENT"] = "ENFORCEMENT";
|
|
1563
1562
|
RoleCategory["ALL"] = "ALL";
|
|
1564
1563
|
})(RoleCategory || (RoleCategory = {}));
|
|
1565
|
-
function getRoleCategory(personRole) {
|
|
1566
|
-
let roleCategory = RoleCategory.ALL;
|
|
1567
|
-
if (!(personRole === PersonRole.ALL)) {
|
|
1568
|
-
if (personRole === PersonRole.LEGAL_OPERATIONS) {
|
|
1569
|
-
roleCategory = RoleCategory.LEGAL_OPERATIONS;
|
|
1570
|
-
}
|
|
1571
|
-
else if (personRole === PersonRole.ADMIN) {
|
|
1572
|
-
roleCategory = RoleCategory.ADMIN;
|
|
1573
|
-
}
|
|
1574
|
-
else if (personRole === PersonRole.CTSC) {
|
|
1575
|
-
roleCategory = RoleCategory.CTSC;
|
|
1576
|
-
}
|
|
1577
|
-
else if (personRole === PersonRole.ENFORCEMENT) {
|
|
1578
|
-
roleCategory = RoleCategory.ENFORCEMENT;
|
|
1579
|
-
}
|
|
1580
|
-
}
|
|
1581
|
-
return roleCategory;
|
|
1582
|
-
}
|
|
1583
|
-
function getPersonRole(roleCategories) {
|
|
1584
|
-
if (roleCategories.includes(RoleCategory.ADMIN)) {
|
|
1585
|
-
return PersonRole.ADMIN;
|
|
1586
|
-
}
|
|
1587
|
-
if (roleCategories.includes(RoleCategory.CTSC)) {
|
|
1588
|
-
return PersonRole.CTSC;
|
|
1589
|
-
}
|
|
1590
|
-
if (roleCategories.includes(RoleCategory.LEGAL_OPERATIONS)) {
|
|
1591
|
-
return PersonRole.LEGAL_OPERATIONS;
|
|
1592
|
-
}
|
|
1593
|
-
if (roleCategories.includes(RoleCategory.ENFORCEMENT)) {
|
|
1594
|
-
return PersonRole.ENFORCEMENT;
|
|
1595
|
-
}
|
|
1596
|
-
// return default role if no match found
|
|
1597
|
-
return PersonRole.LEGAL_OPERATIONS;
|
|
1598
|
-
}
|
|
1599
1564
|
|
|
1600
1565
|
var AddressType;
|
|
1601
1566
|
(function (AddressType) {
|
|
@@ -2187,8 +2152,6 @@ class FilterService {
|
|
|
2187
2152
|
persist(setting, persistence) {
|
|
2188
2153
|
switch (persistence) {
|
|
2189
2154
|
case 'local':
|
|
2190
|
-
this.persistLocal(setting);
|
|
2191
|
-
break;
|
|
2192
2155
|
case 'session':
|
|
2193
2156
|
this.persistSession(setting);
|
|
2194
2157
|
break;
|
|
@@ -2202,23 +2165,12 @@ class FilterService {
|
|
|
2202
2165
|
if (this.filterSettings[id]) {
|
|
2203
2166
|
return this.filterSettings[id];
|
|
2204
2167
|
}
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
if (localStorage.getItem(id)) {
|
|
2209
|
-
if (this.isSameUser(id)) {
|
|
2210
|
-
return JSON.parse(window.localStorage.getItem(id));
|
|
2211
|
-
}
|
|
2212
|
-
else {
|
|
2213
|
-
return null;
|
|
2214
|
-
}
|
|
2168
|
+
const storedSetting = sessionStorage.getItem(id);
|
|
2169
|
+
if (storedSetting) {
|
|
2170
|
+
return JSON.parse(storedSetting);
|
|
2215
2171
|
}
|
|
2216
2172
|
return null;
|
|
2217
2173
|
}
|
|
2218
|
-
isSameUser(id) {
|
|
2219
|
-
const filterSetting = JSON.parse(window.localStorage.getItem(id));
|
|
2220
|
-
return !!filterSetting.idamId && filterSetting.idamId === this.getUserId();
|
|
2221
|
-
}
|
|
2222
2174
|
getStream(id) {
|
|
2223
2175
|
if (!this.streams[id]) {
|
|
2224
2176
|
this.streams[id] = new BehaviorSubject(this.get(id));
|
|
@@ -2227,7 +2179,6 @@ class FilterService {
|
|
|
2227
2179
|
}
|
|
2228
2180
|
clearSessionAndLocalPersistance(id) {
|
|
2229
2181
|
sessionStorage.removeItem(id);
|
|
2230
|
-
localStorage.removeItem(id);
|
|
2231
2182
|
if (this.filterSettings[id] !== undefined) {
|
|
2232
2183
|
this.filterSettings[id] = null;
|
|
2233
2184
|
}
|
|
@@ -2235,10 +2186,6 @@ class FilterService {
|
|
|
2235
2186
|
this.streams[id].next(null);
|
|
2236
2187
|
}
|
|
2237
2188
|
}
|
|
2238
|
-
persistLocal(setting) {
|
|
2239
|
-
setting.idamId = this.getUserId();
|
|
2240
|
-
window.localStorage.setItem(setting.id, JSON.stringify(setting));
|
|
2241
|
-
}
|
|
2242
2189
|
persistSession(setting) {
|
|
2243
2190
|
sessionStorage.setItem(setting.id, JSON.stringify(setting));
|
|
2244
2191
|
}
|
|
@@ -2473,8 +2420,7 @@ class FindAPersonService {
|
|
|
2473
2420
|
id: caseworker.idamId,
|
|
2474
2421
|
// EXUI-4758 - If user has admin role, set domain to admin
|
|
2475
2422
|
// For more specific domain we need service specific role category (or other technique)
|
|
2476
|
-
|
|
2477
|
-
domain: getPersonRole(caseworker.roleCategories)
|
|
2423
|
+
domain: this.setDomain(caseworker)
|
|
2478
2424
|
// knownAs can be added if required
|
|
2479
2425
|
};
|
|
2480
2426
|
if (caseworker.roleCategories.includes(roleCategory) || roleCategory === RoleCategory.ALL || caseworker.idamId === this.userId) {
|
|
@@ -2484,7 +2430,18 @@ class FindAPersonService {
|
|
|
2484
2430
|
return people;
|
|
2485
2431
|
}
|
|
2486
2432
|
searchInCaseworkers(caseworkers, searchOptions) {
|
|
2487
|
-
|
|
2433
|
+
let roleCategory = RoleCategory.ALL;
|
|
2434
|
+
if (!(searchOptions.userRole === PersonRole.ALL)) {
|
|
2435
|
+
if (searchOptions.userRole === PersonRole.LEGAL_OPERATIONS) {
|
|
2436
|
+
roleCategory = RoleCategory.LEGAL_OPERATIONS;
|
|
2437
|
+
}
|
|
2438
|
+
else if (searchOptions.userRole === PersonRole.ADMIN) {
|
|
2439
|
+
roleCategory = RoleCategory.ADMIN;
|
|
2440
|
+
}
|
|
2441
|
+
else if (searchOptions.userRole === PersonRole.CTSC) {
|
|
2442
|
+
roleCategory = RoleCategory.CTSC;
|
|
2443
|
+
}
|
|
2444
|
+
}
|
|
2488
2445
|
const searchTerm = searchOptions && searchOptions.searchTerm ? searchOptions.searchTerm.toLowerCase() : '';
|
|
2489
2446
|
const people = caseworkers ? this.mapCaseworkers(caseworkers, roleCategory) : [];
|
|
2490
2447
|
const finalPeopleList = people.filter((person) => person && person.name && person.name.toLowerCase().includes(searchTerm));
|
|
@@ -2496,33 +2453,19 @@ class FindAPersonService {
|
|
|
2496
2453
|
searchJudicial(value, serviceId) {
|
|
2497
2454
|
return this.http.post('api/prd/judicial/getJudicialUsersSearch', { searchString: value, serviceCode: serviceId });
|
|
2498
2455
|
}
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
const ids = selectedPersons.map(({ id }) => id);
|
|
2504
|
-
return persons.filter(({ id }) => !ids.includes(id));
|
|
2505
|
-
}));
|
|
2506
|
-
}
|
|
2507
|
-
case PersonRole.ALL: {
|
|
2508
|
-
return zip(this.findJudicialOrCTSCPeople(searchTerm, personRole, services, userIncluded, assignedUser), this.findCaseworkersOrAdminsOrCtsc(searchTerm, personRole, services, userIncluded, assignedUser)).pipe(map((separatePeople) => separatePeople[0].concat(separatePeople[1])));
|
|
2509
|
-
}
|
|
2510
|
-
case PersonRole.CTSC:
|
|
2511
|
-
case PersonRole.LEGAL_OPERATIONS:
|
|
2512
|
-
case PersonRole.ADMIN:
|
|
2513
|
-
case PersonRole.ENFORCEMENT: {
|
|
2514
|
-
return this.findCaseworkersOrAdminsOrCtsc(searchTerm, personRole, services, userIncluded, assignedUser);
|
|
2515
|
-
}
|
|
2516
|
-
default: {
|
|
2517
|
-
return of([]);
|
|
2518
|
-
}
|
|
2456
|
+
// Note: Domain only used internally to set the PersonRole for the Person object
|
|
2457
|
+
setDomain(caseworker) {
|
|
2458
|
+
if (caseworker.roleCategories.includes(RoleCategory.ADMIN)) {
|
|
2459
|
+
return PersonRole.ADMIN;
|
|
2519
2460
|
}
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2461
|
+
if (caseworker.roleCategories.includes(RoleCategory.CTSC)) {
|
|
2462
|
+
return PersonRole.CTSC;
|
|
2463
|
+
}
|
|
2464
|
+
if (caseworker.roleCategories.includes(RoleCategory.LEGAL_OPERATIONS)) {
|
|
2465
|
+
return PersonRole.LEGAL_OPERATIONS;
|
|
2466
|
+
}
|
|
2467
|
+
// return default role if no match found
|
|
2468
|
+
return PersonRole.LEGAL_OPERATIONS;
|
|
2526
2469
|
}
|
|
2527
2470
|
static { this.ɵfac = function FindAPersonService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FindAPersonService)(i0.ɵɵinject(i1$2.HttpClient), i0.ɵɵinject(SessionStorageService)); }; }
|
|
2528
2471
|
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: FindAPersonService, factory: FindAPersonService.ɵfac, providedIn: 'root' }); }
|
|
@@ -2637,8 +2580,28 @@ class FindPersonComponent {
|
|
|
2637
2580
|
});
|
|
2638
2581
|
}
|
|
2639
2582
|
filter(searchTerm) {
|
|
2583
|
+
const findJudicialOrCTSCPeople = this.findPersonService.find({ searchTerm, userRole: this.domain, services: [this.services], userIncluded: this.userIncluded, assignedUser: this.assignedUser });
|
|
2584
|
+
const findCaseworkersOrAdminsOrCtsc = this.findPersonService.findCaseworkers({ searchTerm, userRole: this.domain, services: [this.services], userIncluded: this.userIncluded, assignedUser: this.assignedUser });
|
|
2640
2585
|
if (searchTerm && searchTerm.length > this.minSearchCharacters) {
|
|
2641
|
-
|
|
2586
|
+
switch (this.domain) {
|
|
2587
|
+
case PersonRole.JUDICIAL: {
|
|
2588
|
+
return findJudicialOrCTSCPeople.pipe(map((persons) => {
|
|
2589
|
+
const ids = this.selectedPersons.map(({ id }) => id);
|
|
2590
|
+
return persons.filter(({ id }) => !ids.includes(id));
|
|
2591
|
+
}));
|
|
2592
|
+
}
|
|
2593
|
+
case PersonRole.ALL: {
|
|
2594
|
+
return zip(findJudicialOrCTSCPeople, findCaseworkersOrAdminsOrCtsc).pipe(map((separatePeople) => separatePeople[0].concat(separatePeople[1])));
|
|
2595
|
+
}
|
|
2596
|
+
case PersonRole.CTSC:
|
|
2597
|
+
case PersonRole.LEGAL_OPERATIONS:
|
|
2598
|
+
case PersonRole.ADMIN: {
|
|
2599
|
+
return findCaseworkersOrAdminsOrCtsc;
|
|
2600
|
+
}
|
|
2601
|
+
default: {
|
|
2602
|
+
return of([]);
|
|
2603
|
+
}
|
|
2604
|
+
}
|
|
2642
2605
|
}
|
|
2643
2606
|
return of([]);
|
|
2644
2607
|
}
|
|
@@ -2650,7 +2613,6 @@ class FindPersonComponent {
|
|
|
2650
2613
|
if (!selectedPerson) {
|
|
2651
2614
|
return '';
|
|
2652
2615
|
}
|
|
2653
|
-
// The judiciary people contain a different object which has a fullName property
|
|
2654
2616
|
if (selectedPerson.domain === PersonRole.JUDICIAL && selectedPerson.fullName) {
|
|
2655
2617
|
return `${selectedPerson.fullName} (${selectedPerson.email})`;
|
|
2656
2618
|
}
|
|
@@ -10788,5 +10750,5 @@ function radioGroupValidator() {
|
|
|
10788
10750
|
* Generated bundle index. Do not edit.
|
|
10789
10751
|
*/
|
|
10790
10752
|
|
|
10791
|
-
export { AccessibilityComponent, AddressMessageEnum, AddressModel, AddressOption, AddressService, AnonymousFeatureUser, BadgeColour, BookingCheckType, COMMON_COMPONENTS, CapitalizePipe, CheckboxListComponent, ContactDetailsComponent, CookieBannerComponent, CookieService, DateBadgeColour, DueDateComponent, ExuiCommonLibModule, ExuiPageWrapperComponent, FeatureToggleDirective, FeatureToggleGuard, FeatureToggleService, FilterService, FindLocationComponent, FindPersonComponent, FindServiceComponent, FindTaskNameComponent, FindWorkTypeComponent, GOV_UI_COMPONENTS, GenericFilterComponent, GoogleAnalyticsService, GoogleTagManagerService, GovUiService, GovUkCheckboxComponent, GovUkCheckboxesComponent, GovUkDateComponent, GovUkErrorMessageComponent, GovUkFieldsetComponent, GovUkFileUploadComponent, GovUkFormGroupWrapperComponent, GovUkInputComponent, GovUkLabelComponent, GovUkRadioComponent, GovUkRadiosComponent, GovUkSelectComponent, GovUkTextareaComponent, GovukTableColumnConfig, GovukTableComponent, HasLoadingState, HmctsBannerComponent, HmctsErrorSummaryComponent, HmctsIdentityBarComponent, HmctsMainWrapperComponent, HmctsPaginationComponent, HmctsPrimaryNavigationComponent, HmctsSessionDialogComponent, HmctsSubNavigationComponent, InviteUserFormComponent, InviteUserPermissionComponent, LaunchDarklyService, LetContext, LetDirective, LoadingService, LoadingSpinnerComponent, LocationService, LoggedInFeatureUser, ManageSessionServices, PaginationComponent, PersonRole, RadioFilterFieldConfig, RefDataService, RemoveHostDirective, RoleCategory, RoleGuard, RoleMatching, RoleService, SECONDS_IN_A_DAY, SearchJudicialsComponent, SearchLocationComponent, SearchServiceComponent, SearchVenueComponent, SearchWorkTypeComponent, SelectedCaseComponent, SelectedCaseConfirmComponent, SelectedCaseListComponent, ServiceMessageComponent, ServiceMessagesComponent, ShareCaseComponent, ShareCaseConfirmComponent, SharedCaseErrorMessages, TabComponent, TaskService, TcConfirmComponent, TcDisplayHtmlComponent, TcDisplayPlainComponent, TermsAndConditionsComponent, TimeoutNotificationsService, UserDetailsComponent, UserListComponent, UserSelectComponent, WriteAddressFieldComponent, WriteAddressInputsComponent, checkboxesBeCheckedValidator, dateValidator,
|
|
10753
|
+
export { AccessibilityComponent, AddressMessageEnum, AddressModel, AddressOption, AddressService, AnonymousFeatureUser, BadgeColour, BookingCheckType, COMMON_COMPONENTS, CapitalizePipe, CheckboxListComponent, ContactDetailsComponent, CookieBannerComponent, CookieService, DateBadgeColour, DueDateComponent, ExuiCommonLibModule, ExuiPageWrapperComponent, FeatureToggleDirective, FeatureToggleGuard, FeatureToggleService, FilterService, FindLocationComponent, FindPersonComponent, FindServiceComponent, FindTaskNameComponent, FindWorkTypeComponent, GOV_UI_COMPONENTS, GenericFilterComponent, GoogleAnalyticsService, GoogleTagManagerService, GovUiService, GovUkCheckboxComponent, GovUkCheckboxesComponent, GovUkDateComponent, GovUkErrorMessageComponent, GovUkFieldsetComponent, GovUkFileUploadComponent, GovUkFormGroupWrapperComponent, GovUkInputComponent, GovUkLabelComponent, GovUkRadioComponent, GovUkRadiosComponent, GovUkSelectComponent, GovUkTextareaComponent, GovukTableColumnConfig, GovukTableComponent, HasLoadingState, HmctsBannerComponent, HmctsErrorSummaryComponent, HmctsIdentityBarComponent, HmctsMainWrapperComponent, HmctsPaginationComponent, HmctsPrimaryNavigationComponent, HmctsSessionDialogComponent, HmctsSubNavigationComponent, InviteUserFormComponent, InviteUserPermissionComponent, LaunchDarklyService, LetContext, LetDirective, LoadingService, LoadingSpinnerComponent, LocationService, LoggedInFeatureUser, ManageSessionServices, PaginationComponent, PersonRole, RadioFilterFieldConfig, RefDataService, RemoveHostDirective, RoleCategory, RoleGuard, RoleMatching, RoleService, SECONDS_IN_A_DAY, SearchJudicialsComponent, SearchLocationComponent, SearchServiceComponent, SearchVenueComponent, SearchWorkTypeComponent, SelectedCaseComponent, SelectedCaseConfirmComponent, SelectedCaseListComponent, ServiceMessageComponent, ServiceMessagesComponent, ShareCaseComponent, ShareCaseConfirmComponent, SharedCaseErrorMessages, TabComponent, TaskService, TcConfirmComponent, TcDisplayHtmlComponent, TcDisplayPlainComponent, TermsAndConditionsComponent, TimeoutNotificationsService, UserDetailsComponent, UserListComponent, UserSelectComponent, WriteAddressFieldComponent, WriteAddressInputsComponent, checkboxesBeCheckedValidator, dateValidator, radioGroupValidator, windowProvider, windowToken };
|
|
10792
10754
|
//# sourceMappingURL=hmcts-rpx-xui-common-lib.mjs.map
|