@hmcts/rpx-xui-common-lib 2.1.3-angular-upgrade-11 → 2.1.6-angular-upgrade-11

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.
Files changed (48) hide show
  1. package/bundles/hmcts-rpx-xui-common-lib.umd.js +607 -392
  2. package/bundles/hmcts-rpx-xui-common-lib.umd.js.map +1 -1
  3. package/bundles/hmcts-rpx-xui-common-lib.umd.min.js +1 -1
  4. package/bundles/hmcts-rpx-xui-common-lib.umd.min.js.map +1 -1
  5. package/esm2015/hmcts-rpx-xui-common-lib.js +27 -26
  6. package/esm2015/lib/components/accessibility/accessibility.component.js +2 -2
  7. package/esm2015/lib/components/find-location/find-location.component.js +6 -2
  8. package/esm2015/lib/components/find-person/find-person.component.js +3 -3
  9. package/esm2015/lib/components/find-service/find-service.component.js +31 -0
  10. package/esm2015/lib/components/generic-filter/generic-filter.component.js +16 -10
  11. package/esm2015/lib/components/search-judicials/search-judicials.component.js +3 -3
  12. package/esm2015/lib/components/search-location/search-location.component.js +22 -3
  13. package/esm2015/lib/components/search-service/search-service.component.js +31 -0
  14. package/esm2015/lib/components/selected-case/selected-case.component.js +5 -7
  15. package/esm2015/lib/components/selected-case-confirm/selected-case-confirm.component.js +1 -1
  16. package/esm2015/lib/components/selected-case-list/selected-case-list.component.js +7 -3
  17. package/esm2015/lib/components/share-case/share-case.component.js +127 -13
  18. package/esm2015/lib/exui-common-lib.module.js +5 -17
  19. package/esm2015/lib/models/case-share.model.js +7 -2
  20. package/esm2015/lib/models/filter.model.js +1 -1
  21. package/esm2015/lib/models/index.js +2 -1
  22. package/esm2015/lib/models/location.model.js +7 -2
  23. package/esm2015/lib/models/person.model.js +3 -1
  24. package/esm2015/lib/services/case-sharing-state/case-sharing-state.service.js +28 -14
  25. package/esm2015/lib/services/find-person/find-person.service.js +3 -3
  26. package/esm2015/lib/services/locations/location.service.js +3 -3
  27. package/esm2015/lib/services/public-api.js +1 -5
  28. package/fesm2015/hmcts-rpx-xui-common-lib.js +525 -310
  29. package/fesm2015/hmcts-rpx-xui-common-lib.js.map +1 -1
  30. package/hmcts-rpx-xui-common-lib.d.ts +26 -25
  31. package/hmcts-rpx-xui-common-lib.metadata.json +1 -1
  32. package/lib/components/find-location/find-location.component.d.ts +3 -2
  33. package/lib/components/find-service/find-service.component.d.ts +14 -0
  34. package/lib/components/search-location/search-location.component.d.ts +5 -2
  35. package/lib/components/search-service/search-service.component.d.ts +13 -0
  36. package/lib/components/selected-case/selected-case.component.d.ts +1 -1
  37. package/lib/components/selected-case-list/selected-case-list.component.d.ts +1 -0
  38. package/lib/components/share-case/share-case.component.d.ts +37 -2
  39. package/lib/exui-common-lib.module.d.ts +0 -2
  40. package/lib/models/case-share.model.d.ts +5 -0
  41. package/lib/models/filter.model.d.ts +4 -1
  42. package/lib/models/index.d.ts +1 -0
  43. package/lib/models/location.model.d.ts +11 -0
  44. package/lib/models/person.model.d.ts +3 -0
  45. package/lib/services/case-sharing-state/case-sharing-state.service.d.ts +1 -1
  46. package/lib/services/locations/location.service.d.ts +2 -2
  47. package/lib/services/public-api.d.ts +0 -4
  48. package/package.json +4 -1
@@ -1,9 +1,9 @@
1
- import { EventEmitter } from '@angular/core';
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
2
  import { FormGroup } from '@angular/forms';
3
3
  import { FilterFieldConfig } from '../../models';
4
4
  import { LocationByEPIMMSModel } from '../../models/location.model';
5
5
  import { SearchLocationComponent } from '../search-location/search-location.component';
6
- export declare class FindLocationComponent {
6
+ export declare class FindLocationComponent implements OnInit {
7
7
  locationFieldChanged: EventEmitter<void>;
8
8
  selectedLocations: LocationByEPIMMSModel[];
9
9
  submitted: boolean;
@@ -23,6 +23,7 @@ export declare class FindLocationComponent {
23
23
  set disabled(value: boolean);
24
24
  get services(): string[];
25
25
  set services(value: string[]);
26
+ ngOnInit(): void;
26
27
  addLocation(): void;
27
28
  removeLocation(location: LocationByEPIMMSModel): void;
28
29
  onInputChanged(term: string): void;
@@ -0,0 +1,14 @@
1
+ import { FormGroup } from '@angular/forms';
2
+ import { FilterFieldConfig } from '../../models';
3
+ export declare class FindServiceComponent {
4
+ field: FilterFieldConfig;
5
+ fields: FilterFieldConfig[];
6
+ serviceTitle: string;
7
+ form: FormGroup;
8
+ services: any;
9
+ selectedServices: any;
10
+ disabled: any;
11
+ enableAddServiceButton: boolean;
12
+ disableInputField: boolean;
13
+ addService(): void;
14
+ }
@@ -1,10 +1,12 @@
1
1
  import { ChangeDetectorRef, EventEmitter, OnInit } from '@angular/core';
2
2
  import { AbstractControl, FormBuilder, FormGroup } from '@angular/forms';
3
3
  import { Observable } from 'rxjs';
4
- import { LocationByEPIMMSModel } from '../../models/location.model';
4
+ import { BookingCheckType, LocationByEPIMMSModel } from '../../models';
5
5
  import { LocationService } from '../../services/locations/location.service';
6
+ import { SessionStorageService } from '../../services/session-storage/session-storage.service';
6
7
  export declare class SearchLocationComponent implements OnInit {
7
8
  private readonly locationService;
9
+ private readonly sessionStorageService;
8
10
  private readonly fb;
9
11
  private readonly cd;
10
12
  control: AbstractControl;
@@ -17,6 +19,7 @@ export declare class SearchLocationComponent implements OnInit {
17
19
  form: FormGroup;
18
20
  showAutocomplete: boolean;
19
21
  locations: LocationByEPIMMSModel[];
22
+ bookingCheck: BookingCheckType;
20
23
  locationSelected: EventEmitter<LocationByEPIMMSModel>;
21
24
  locationInputChanged: EventEmitter<string>;
22
25
  searchLocationChanged: EventEmitter<void>;
@@ -24,7 +27,7 @@ export declare class SearchLocationComponent implements OnInit {
24
27
  term: string;
25
28
  private pSelectedLocations;
26
29
  private pReset;
27
- constructor(locationService: LocationService, fb: FormBuilder, cd: ChangeDetectorRef);
30
+ constructor(locationService: LocationService, sessionStorageService: SessionStorageService, fb: FormBuilder, cd: ChangeDetectorRef);
28
31
  get reset(): boolean;
29
32
  set reset(value: boolean);
30
33
  get selectedLocations(): any[];
@@ -0,0 +1,13 @@
1
+ import { FormGroup } from '@angular/forms';
2
+ export declare class SearchServiceComponent {
3
+ services: any;
4
+ selectedServices: any;
5
+ disabled: any;
6
+ delay: any;
7
+ form: FormGroup;
8
+ showAutocomplete: boolean;
9
+ readonly minSearchCharacters = 3;
10
+ term: string;
11
+ onInput(): void;
12
+ onSelectionChange(): void;
13
+ }
@@ -9,6 +9,7 @@ export declare class SelectedCaseComponent implements OnInit, OnChanges {
9
9
  selectedUser: UserDetails;
10
10
  opened: boolean;
11
11
  removeUserFromCaseToggleOn: boolean;
12
+ caseCount: number;
12
13
  unselect: EventEmitter<SharedCase>;
13
14
  synchronizeStore: EventEmitter<any>;
14
15
  shareCases: SharedCase[];
@@ -17,7 +18,6 @@ export declare class SelectedCaseComponent implements OnInit, OnChanges {
17
18
  constructor(stateService: CaseSharingStateService);
18
19
  ngOnInit(): void;
19
20
  ngOnChanges(changes: SimpleChanges): void;
20
- onUnselect(): void;
21
21
  onDeselect(c: SharedCase): void;
22
22
  trackByUserId(user: UserDetails): string;
23
23
  canRemove(caseId: string, user: UserDetails): Observable<boolean>;
@@ -5,6 +5,7 @@ import { CaseSharingStateService } from '../../services/case-sharing-state/case-
5
5
  export declare class SelectedCaseListComponent implements OnInit {
6
6
  private readonly stateService;
7
7
  shareCases: SharedCase[];
8
+ caseCount: number;
8
9
  shareCases$: Observable<SharedCase[]>;
9
10
  removeUserFromCaseToggleOn: boolean;
10
11
  toConfirm: boolean;
@@ -1,26 +1,61 @@
1
1
  import { EventEmitter, OnInit } from '@angular/core';
2
+ import { Router } from '@angular/router';
2
3
  import { Observable } from 'rxjs';
4
+ import { ErrorMessagesModel, GovUiConfigModel } from '../../gov-ui/models';
3
5
  import { SharedCase } from '../../models/case-share.model';
4
6
  import { UserDetails } from '../../models/user-details.model';
5
7
  import { CaseSharingStateService } from '../../services/case-sharing-state/case-sharing-state.service';
6
8
  export declare class ShareCaseComponent implements OnInit {
7
9
  private readonly stateService;
10
+ private readonly router;
8
11
  shareCases: SharedCase[];
12
+ selectedCasesErrorMessageConfig: GovUiConfigModel;
13
+ continueAllowed: boolean;
14
+ assignedUsers: UserDetails[];
15
+ selectedUserToRemove: UserDetails;
9
16
  removeUserFromCaseToggleOn: boolean;
10
17
  shareCases$: Observable<SharedCase[]>;
11
18
  users: UserDetails[];
12
19
  confirmLink: string;
20
+ cancelLink: string;
21
+ addUserLabel: string;
22
+ showRemoveUsers: boolean;
23
+ fnTitle: string;
24
+ title: string;
13
25
  unselect: EventEmitter<SharedCase>;
14
26
  synchronizeStore: EventEmitter<any>;
15
27
  private selectedUser;
16
28
  private readonly userSelect;
17
- constructor(stateService: CaseSharingStateService);
29
+ validationErrors: {
30
+ id: string;
31
+ message: string;
32
+ }[];
33
+ shareCaseErrorMessage: ErrorMessagesModel;
34
+ constructor(stateService: CaseSharingStateService, router: Router);
18
35
  ngOnInit(): void;
19
36
  onUnselect(c: SharedCase): void;
20
37
  onSynchronizeStore(event: any): void;
21
38
  onSelectedUser(user: UserDetails): void;
22
39
  addUser(): void;
40
+ removeUser(): void;
23
41
  isDisabledAdd(): boolean;
24
- isDisabledContinue(): boolean;
42
+ /**
43
+ * Function originally used to set disabled state of "Continue" button, now called by the button click handler to
44
+ * control whether navigation to the confirmation page is allowed. It is prevented if no changes have been made
45
+ */
46
+ setContinueAllowed(): void;
25
47
  onDeselect(sharedCase: SharedCase): void;
48
+ onContinue(): void;
49
+ /**
50
+ * Gets a unique list of all users that have been assigned, or are pending assigment to, at least one case
51
+ * @param sharedCases The list of shared cases from which to get users these are shared with, or are to be shared with
52
+ */
53
+ getAssignedUsers(sharedCases: SharedCase[]): void;
54
+ /**
55
+ * Checks if any shared cases have been left unassigned. This occurs if a shared case has a number of pending
56
+ * unshares equal to the number of current shares, and there are no pending shares.
57
+ * @param sharedCases The array of shared cases to check
58
+ * @returns `true` if at least one case has the condition described above; `false` otherwise
59
+ */
60
+ hasCasesLeftUnassigned(sharedCases: SharedCase[]): boolean;
26
61
  }
@@ -27,9 +27,7 @@ import { HmctsPaginationComponent } from './gov-ui/components/hmcts-pagination/h
27
27
  import { HmctsPrimaryNavigationComponent } from './gov-ui/components/hmcts-primary-navigation/hmcts-primary-navigation.component';
28
28
  import { HmctsSubNavigationComponent } from './gov-ui/components/hmcts-sub-navigation/hmcts-sub-navigation.component';
29
29
  import { RemoveHostDirective } from './gov-ui/directives/remove-host.directive';
30
- import { CaseSharingStateService, CookieService, FilterService, FindAPersonService, GoogleAnalyticsService, GoogleTagManagerService, LaunchDarklyService, LoadingService, LocationService, ManageSessionServices, SessionStorageService, TimeoutNotificationsService } from './services';
31
30
  export declare const COMMON_COMPONENTS: (typeof AccessibilityComponent | typeof GenericFilterComponent | typeof SelectedCaseConfirmComponent | typeof SelectedCaseListComponent | typeof SelectedCaseComponent | typeof ServiceMessagesComponent | typeof ShareCaseConfirmComponent | typeof ShareCaseComponent | typeof CookieBannerComponent | typeof SearchLocationComponent | typeof SearchVenueComponent | typeof SearchJudicialsComponent | typeof FindPersonComponent | typeof FeatureToggleDirective | typeof LetDirective)[];
32
31
  export declare const GOV_UI_COMPONENTS: (typeof HmctsIdentityBarComponent | typeof HmctsPaginationComponent | typeof HmctsSubNavigationComponent | typeof HmctsPrimaryNavigationComponent | typeof HmctsErrorSummaryComponent | typeof HmctsMainWrapperComponent | typeof HmctsBannerComponent | typeof GovukTableComponent | typeof GovUkFormGroupWrapperComponent | typeof GovUkLabelComponent | typeof GovUkErrorMessageComponent | typeof GovUkCheckboxesComponent | typeof GovUkRadioComponent | typeof RemoveHostDirective)[];
33
- export declare const COMMON_SERVICES: (typeof FilterService | typeof CaseSharingStateService | typeof CookieService | typeof LocationService | typeof SessionStorageService | typeof FindAPersonService | typeof LaunchDarklyService | typeof GoogleAnalyticsService | typeof GoogleTagManagerService | typeof ManageSessionServices | typeof TimeoutNotificationsService | typeof LoadingService)[];
34
32
  export declare class ExuiCommonLibModule {
35
33
  }
@@ -8,3 +8,8 @@ export interface SharedCase {
8
8
  pendingShares?: UserDetails[];
9
9
  pendingUnshares?: UserDetails[];
10
10
  }
11
+ export declare enum SharedCaseErrorMessages {
12
+ OneCaseMustBeSelected = "At least one case must be selected",
13
+ NoChangesRequested = "You have not requested any changes to case sharing",
14
+ OnePersonMustBeAssigned = "At least one person must be assigned to each case"
15
+ }
@@ -1,5 +1,6 @@
1
+ import { BookingCheckType } from './location.model';
1
2
  import { PersonRole } from './person.model';
2
- export declare type FilterFieldType = 'checkbox' | 'radio' | 'select' | 'find-person' | 'find-location' | 'checkbox-large';
3
+ export declare type FilterFieldType = 'checkbox' | 'radio' | 'select' | 'find-person' | 'find-location' | 'checkbox-large' | 'find-service';
3
4
  export declare type FilterPersistence = 'local' | 'session' | 'memory';
4
5
  export interface FilterConfig {
5
6
  id: string;
@@ -27,6 +28,7 @@ export interface FilterFieldConfig {
27
28
  lineBreakBefore?: boolean;
28
29
  showCondition?: string;
29
30
  enableCondition?: string;
31
+ enableAddButton?: boolean;
30
32
  enableAddLocationButton?: boolean;
31
33
  changeResetFields?: string[];
32
34
  findPersonField?: string;
@@ -40,6 +42,7 @@ export interface FilterFieldConfig {
40
42
  subTitle?: string;
41
43
  locationTitle?: string;
42
44
  radioSelectionChange?: string;
45
+ bookingCheckType?: BookingCheckType;
43
46
  }
44
47
  export interface FilterSetting {
45
48
  id: string;
@@ -3,6 +3,7 @@ export * from './contact-details.model';
3
3
  export * from './due-date.model';
4
4
  export * from './feature-user';
5
5
  export * from './idle-config.model';
6
+ export * from './location.model';
6
7
  export * from './pagination.model';
7
8
  export * from './person.model';
8
9
  export * from './public_api';
@@ -47,3 +47,14 @@ export interface LocationByEPIMMSModel {
47
47
  is_case_management_location: string;
48
48
  is_hearing_location: string;
49
49
  }
50
+ export interface LocationsByService {
51
+ service?: string;
52
+ serviceCode?: string;
53
+ bookable?: boolean;
54
+ locations: Location[];
55
+ }
56
+ export declare enum BookingCheckType {
57
+ NO_CHECK = "NO_CHECK",
58
+ BOOKINGS_AND_BASE = "BOOKINGS_AND_BASE",
59
+ POSSIBLE_BOOKINGS = "POSSIBLE_BOOKINGS"
60
+ }
@@ -4,6 +4,7 @@ export interface Person {
4
4
  email?: string;
5
5
  domain: string;
6
6
  knownAs?: string;
7
+ fullName?: string;
7
8
  }
8
9
  export interface JudicialUserModel {
9
10
  emailId: string;
@@ -33,11 +34,13 @@ export declare enum PersonRole {
33
34
  JUDICIAL = "Judicial",
34
35
  CASEWORKER = "Legal Ops",
35
36
  ADMIN = "Admin",
37
+ CTSC = "CTSC User",
36
38
  ALL = "All"
37
39
  }
38
40
  export declare enum RoleCategory {
39
41
  JUDICIAL = "JUDICIAL",
40
42
  CASEWORKER = "LEGAL_OPERATIONS",
41
43
  ADMIN = "ADMIN",
44
+ CTSC = "CTSC",
42
45
  ALL = "ALL"
43
46
  }
@@ -8,7 +8,7 @@ export declare class CaseSharingStateService {
8
8
  setCases(cases: SharedCase[]): void;
9
9
  getCases(): SharedCase[];
10
10
  requestShare(user: UserDetails): SharedCase[];
11
- requestUnshare(caseId: string, user: UserDetails): void;
11
+ requestUnshare(user: UserDetails, caseId?: string): SharedCase[];
12
12
  requestCancel(caseId: string, user: UserDetails): void;
13
13
  removeCase(caseId: string): void;
14
14
  userHasAccess(c: SharedCase, user: UserDetails): boolean;
@@ -1,6 +1,6 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
2
  import { Observable } from 'rxjs';
3
- import { LocationByEPIMMSModel } from '../../models/location.model';
3
+ import { LocationByEPIMMSModel, LocationsByService } from '../../models/location.model';
4
4
  export declare class LocationService {
5
5
  private readonly http;
6
6
  constructor(http: HttpClient);
@@ -11,7 +11,7 @@ export declare class LocationService {
11
11
  * @param searchTerm: any search term for postcode | site name | venue name |court name | court address etc.
12
12
  * @return Observable<LocationByEPIMMSModel[]>: Array of locationModel in Observable
13
13
  */
14
- getAllLocations(serviceIds: string, locationType: string, searchTerm: string): Observable<LocationByEPIMMSModel[]>;
14
+ getAllLocations(serviceIds: string, locationType: string, searchTerm: string, userLocations: LocationsByService[], bookingLocations: string[]): Observable<LocationByEPIMMSModel[]>;
15
15
  /**
16
16
  * @description searchLocations from service Ids/location type/search term
17
17
  * @param serviceIds: BBA3 | BBA3,BFA1 split with ','
@@ -1,4 +1,3 @@
1
- export * from './case-sharing-state/case-sharing-state.service';
2
1
  export * from './feature-toggle/feature-toggle.guard';
3
2
  export * from './feature-toggle/feature-toggle.service';
4
3
  export * from './feature-toggle/launch-darkly.service';
@@ -10,7 +9,4 @@ export * from './role-guard/role.guard';
10
9
  export * from './role-guard/role.service';
11
10
  export * from './cookie/cookie.service';
12
11
  export * from './loading/loading.service';
13
- export * from './locations/location.service';
14
12
  export * from './filter/filter.service';
15
- export * from './find-person/find-person.service';
16
- export * from './session-storage/session-storage.service';
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@hmcts/rpx-xui-common-lib",
3
- "version": "2.1.3-angular-upgrade-11",
3
+ "version": "2.1.6-angular-upgrade-11",
4
4
  "peerDependencies": {
5
5
  "launchdarkly-js-client-sdk": "^2.15.2",
6
6
  "ngx-pagination": "^3.2.1"
7
7
  },
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
8
11
  "license": "MIT",
9
12
  "repository": "https://github.com/hmcts/rpx-xui-common-lib.git",
10
13
  "description": "Angular web component for EXUI common library - xui-common-lib",