@hmcts/rpx-xui-common-lib 3.2.12-multiple-role-categories → 3.2.12-pofcc-156
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
|
|
1545
1544
|
var PersonRole;
|
|
1546
1545
|
(function (PersonRole) {
|
|
1547
1546
|
PersonRole["JUDICIAL"] = "Judicial";
|
|
1548
1547
|
PersonRole["LEGAL_OPERATIONS"] = "Legal Ops";
|
|
1549
1548
|
PersonRole["ADMIN"] = "Admin";
|
|
1550
1549
|
PersonRole["CTSC"] = "CTSC";
|
|
1550
|
+
PersonRole["ENFORCEMENT"] = "Enforcement";
|
|
1551
1551
|
PersonRole["ALL"] = "All";
|
|
1552
1552
|
})(PersonRole || (PersonRole = {}));
|
|
1553
1553
|
// Role categories used in application
|
|
@@ -1559,8 +1559,38 @@ var RoleCategory;
|
|
|
1559
1559
|
RoleCategory["CTSC"] = "CTSC";
|
|
1560
1560
|
RoleCategory["PROFESSIONAL"] = "PROFESSIONAL";
|
|
1561
1561
|
RoleCategory["CITIZEN"] = "CITIZEN";
|
|
1562
|
+
RoleCategory["ENFORCEMENT"] = "ENFORCEMENT";
|
|
1562
1563
|
RoleCategory["ALL"] = "ALL";
|
|
1563
1564
|
})(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(roleCategory) {
|
|
1584
|
+
if (roleCategory === RoleCategory.LEGAL_OPERATIONS) {
|
|
1585
|
+
return PersonRole.LEGAL_OPERATIONS;
|
|
1586
|
+
}
|
|
1587
|
+
else if (roleCategory === RoleCategory.ENFORCEMENT) {
|
|
1588
|
+
return PersonRole.ENFORCEMENT;
|
|
1589
|
+
}
|
|
1590
|
+
else {
|
|
1591
|
+
return PersonRole.ADMIN;
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1564
1594
|
|
|
1565
1595
|
var AddressType;
|
|
1566
1596
|
(function (AddressType) {
|
|
@@ -2398,8 +2428,6 @@ class FindAPersonService {
|
|
|
2398
2428
|
constructor(http, sessionStorageService) {
|
|
2399
2429
|
this.http = http;
|
|
2400
2430
|
this.sessionStorageService = sessionStorageService;
|
|
2401
|
-
// userId set as empty string as there is no exists check and was type warning
|
|
2402
|
-
this.userId = '';
|
|
2403
2431
|
this.assignedUser = [];
|
|
2404
2432
|
}
|
|
2405
2433
|
find(searchOptions) {
|
|
@@ -2436,30 +2464,17 @@ class FindAPersonService {
|
|
|
2436
2464
|
email: caseworker.email,
|
|
2437
2465
|
name: `${caseworker.firstName} ${caseworker.lastName}`,
|
|
2438
2466
|
id: caseworker.idamId,
|
|
2439
|
-
|
|
2440
|
-
// For more specific domain we need service specific role category (or other technique)
|
|
2441
|
-
domain: this.setDomain(caseworker)
|
|
2467
|
+
domain: getPersonRole(caseworker.roleCategory)
|
|
2442
2468
|
// knownAs can be added if required
|
|
2443
2469
|
};
|
|
2444
|
-
if (caseworker.
|
|
2470
|
+
if (caseworker.roleCategory === roleCategory || roleCategory === RoleCategory.ALL || caseworker.idamId === this.userId) {
|
|
2445
2471
|
people.push(thisPerson);
|
|
2446
2472
|
}
|
|
2447
2473
|
});
|
|
2448
2474
|
return people;
|
|
2449
2475
|
}
|
|
2450
2476
|
searchInCaseworkers(caseworkers, searchOptions) {
|
|
2451
|
-
|
|
2452
|
-
if (!(searchOptions.userRole === PersonRole.ALL)) {
|
|
2453
|
-
if (searchOptions.userRole === PersonRole.LEGAL_OPERATIONS) {
|
|
2454
|
-
roleCategory = RoleCategory.LEGAL_OPERATIONS;
|
|
2455
|
-
}
|
|
2456
|
-
else if (searchOptions.userRole === PersonRole.ADMIN) {
|
|
2457
|
-
roleCategory = RoleCategory.ADMIN;
|
|
2458
|
-
}
|
|
2459
|
-
else if (searchOptions.userRole === PersonRole.CTSC) {
|
|
2460
|
-
roleCategory = RoleCategory.CTSC;
|
|
2461
|
-
}
|
|
2462
|
-
}
|
|
2477
|
+
const roleCategory = getRoleCategory(searchOptions.userRole);
|
|
2463
2478
|
const searchTerm = searchOptions && searchOptions.searchTerm ? searchOptions.searchTerm.toLowerCase() : '';
|
|
2464
2479
|
const people = caseworkers ? this.mapCaseworkers(caseworkers, roleCategory) : [];
|
|
2465
2480
|
const finalPeopleList = people.filter((person) => person && person.name && person.name.toLowerCase().includes(searchTerm));
|
|
@@ -2471,19 +2486,33 @@ class FindAPersonService {
|
|
|
2471
2486
|
searchJudicial(value, serviceId) {
|
|
2472
2487
|
return this.http.post('api/prd/judicial/getJudicialUsersSearch', { searchString: value, serviceCode: serviceId });
|
|
2473
2488
|
}
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2489
|
+
findByPersonRole(searchTerm, personRole, selectedPersons, services, userIncluded, assignedUser) {
|
|
2490
|
+
switch (personRole) {
|
|
2491
|
+
case PersonRole.JUDICIAL: {
|
|
2492
|
+
return this.findJudicialOrCTSCPeople(searchTerm, personRole, services, userIncluded, assignedUser).pipe(map((persons) => {
|
|
2493
|
+
const ids = selectedPersons.map(({ id }) => id);
|
|
2494
|
+
return persons.filter(({ id }) => !ids.includes(id));
|
|
2495
|
+
}));
|
|
2496
|
+
}
|
|
2497
|
+
case PersonRole.ALL: {
|
|
2498
|
+
return zip(this.findJudicialOrCTSCPeople(searchTerm, personRole, services, userIncluded, assignedUser), this.findCaseworkersOrAdminsOrCtsc(searchTerm, personRole, services, userIncluded, assignedUser)).pipe(map((separatePeople) => separatePeople[0].concat(separatePeople[1])));
|
|
2499
|
+
}
|
|
2500
|
+
case PersonRole.CTSC:
|
|
2501
|
+
case PersonRole.LEGAL_OPERATIONS:
|
|
2502
|
+
case PersonRole.ADMIN:
|
|
2503
|
+
case PersonRole.ENFORCEMENT: {
|
|
2504
|
+
return this.findCaseworkersOrAdminsOrCtsc(searchTerm, personRole, services, userIncluded, assignedUser);
|
|
2505
|
+
}
|
|
2506
|
+
default: {
|
|
2507
|
+
return of([]);
|
|
2508
|
+
}
|
|
2484
2509
|
}
|
|
2485
|
-
|
|
2486
|
-
|
|
2510
|
+
}
|
|
2511
|
+
findJudicialOrCTSCPeople(searchTerm, personRole, services, userIncluded, assignedUser) {
|
|
2512
|
+
return this.find({ searchTerm, userRole: personRole, services: [services], userIncluded: userIncluded, assignedUser: assignedUser });
|
|
2513
|
+
}
|
|
2514
|
+
findCaseworkersOrAdminsOrCtsc(searchTerm, personRole, services, userIncluded, assignedUser) {
|
|
2515
|
+
return this.findCaseworkers({ searchTerm, userRole: personRole, services: [services], userIncluded: userIncluded, assignedUser: assignedUser });
|
|
2487
2516
|
}
|
|
2488
2517
|
static { this.ɵfac = function FindAPersonService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FindAPersonService)(i0.ɵɵinject(i1$2.HttpClient), i0.ɵɵinject(SessionStorageService)); }; }
|
|
2489
2518
|
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: FindAPersonService, factory: FindAPersonService.ɵfac, providedIn: 'root' }); }
|
|
@@ -2598,28 +2627,8 @@ class FindPersonComponent {
|
|
|
2598
2627
|
});
|
|
2599
2628
|
}
|
|
2600
2629
|
filter(searchTerm) {
|
|
2601
|
-
const findJudicialOrCTSCPeople = this.findPersonService.find({ searchTerm, userRole: this.domain, services: [this.services], userIncluded: this.userIncluded, assignedUser: this.assignedUser });
|
|
2602
|
-
const findCaseworkersOrAdminsOrCtsc = this.findPersonService.findCaseworkers({ searchTerm, userRole: this.domain, services: [this.services], userIncluded: this.userIncluded, assignedUser: this.assignedUser });
|
|
2603
2630
|
if (searchTerm && searchTerm.length > this.minSearchCharacters) {
|
|
2604
|
-
|
|
2605
|
-
case PersonRole.JUDICIAL: {
|
|
2606
|
-
return findJudicialOrCTSCPeople.pipe(map((persons) => {
|
|
2607
|
-
const ids = this.selectedPersons.map(({ id }) => id);
|
|
2608
|
-
return persons.filter(({ id }) => !ids.includes(id));
|
|
2609
|
-
}));
|
|
2610
|
-
}
|
|
2611
|
-
case PersonRole.ALL: {
|
|
2612
|
-
return zip(findJudicialOrCTSCPeople, findCaseworkersOrAdminsOrCtsc).pipe(map((separatePeople) => separatePeople[0].concat(separatePeople[1])));
|
|
2613
|
-
}
|
|
2614
|
-
case PersonRole.CTSC:
|
|
2615
|
-
case PersonRole.LEGAL_OPERATIONS:
|
|
2616
|
-
case PersonRole.ADMIN: {
|
|
2617
|
-
return findCaseworkersOrAdminsOrCtsc;
|
|
2618
|
-
}
|
|
2619
|
-
default: {
|
|
2620
|
-
return of([]);
|
|
2621
|
-
}
|
|
2622
|
-
}
|
|
2631
|
+
return this.findPersonService.findByPersonRole(searchTerm, this.domain, this.selectedPersons, this.services, this.userIncluded, this.assignedUser);
|
|
2623
2632
|
}
|
|
2624
2633
|
return of([]);
|
|
2625
2634
|
}
|
|
@@ -2631,6 +2640,7 @@ class FindPersonComponent {
|
|
|
2631
2640
|
if (!selectedPerson) {
|
|
2632
2641
|
return '';
|
|
2633
2642
|
}
|
|
2643
|
+
// The judiciary people contain a different object which has a fullName property
|
|
2634
2644
|
if (selectedPerson.domain === PersonRole.JUDICIAL && selectedPerson.fullName) {
|
|
2635
2645
|
return `${selectedPerson.fullName} (${selectedPerson.email})`;
|
|
2636
2646
|
}
|
|
@@ -10768,5 +10778,5 @@ function radioGroupValidator() {
|
|
|
10768
10778
|
* Generated bundle index. Do not edit.
|
|
10769
10779
|
*/
|
|
10770
10780
|
|
|
10771
|
-
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 };
|
|
10781
|
+
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, getPersonRole, getRoleCategory, radioGroupValidator, windowProvider, windowToken };
|
|
10772
10782
|
//# sourceMappingURL=hmcts-rpx-xui-common-lib.mjs.map
|