@hmcts/ccd-case-ui-toolkit 5.0.14-angular11-upgrade → 5.0.19-angular11-upgrade

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 (24) hide show
  1. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js +67 -39
  2. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js.map +1 -1
  3. package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js +1 -1
  4. package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js.map +1 -1
  5. package/esm2015/lib/case-ui-toolkit.module.js +15 -0
  6. package/esm2015/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.js +35 -22
  7. package/esm2015/lib/shared/components/event-start/event-guard/event-start.guard.js +14 -20
  8. package/esm2015/lib/shared/components/palette/datetime-picker/datetime-picker.component.js +2 -2
  9. package/esm2015/lib/shared/directives/conditional-show/services/conditional-show-registrar.service.js +1 -1
  10. package/esm2015/public-api.js +3 -1
  11. package/fesm2015/hmcts-ccd-case-ui-toolkit.js +60 -40
  12. package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
  13. package/lib/case-ui-toolkit.module.d.ts +7 -0
  14. package/lib/case-ui-toolkit.module.d.ts.map +1 -0
  15. package/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.d.ts +7 -4
  16. package/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.d.ts.map +1 -1
  17. package/lib/shared/components/event-start/event-guard/event-start.guard.d.ts.map +1 -1
  18. package/lib/shared/components/palette/datetime-picker/datetime-picker.component.d.ts +2 -3
  19. package/lib/shared/components/palette/datetime-picker/datetime-picker.component.d.ts.map +1 -1
  20. package/lib/shared/directives/conditional-show/services/conditional-show-registrar.service.d.ts +1 -1
  21. package/lib/shared/directives/conditional-show/services/conditional-show-registrar.service.d.ts.map +1 -1
  22. package/package.json +1 -1
  23. package/public-api.d.ts +2 -0
  24. package/public-api.d.ts.map +1 -1
@@ -22737,7 +22737,7 @@
22737
22737
  }
22738
22738
  }
22739
22739
  var CaseFullAccessViewComponent = /** @class */ (function () {
22740
- function CaseFullAccessViewComponent(ngZone, route, router, navigationNotifierService, orderService, activityPollingService, dialog, alertService, draftService, errorNotifierService, convertHrefToRouterService, location) {
22740
+ function CaseFullAccessViewComponent(ngZone, route, router, navigationNotifierService, orderService, activityPollingService, dialog, alertService, draftService, errorNotifierService, convertHrefToRouterService, location, crf) {
22741
22741
  this.ngZone = ngZone;
22742
22742
  this.route = route;
22743
22743
  this.router = router;
@@ -22750,6 +22750,7 @@
22750
22750
  this.errorNotifierService = errorNotifierService;
22751
22751
  this.convertHrefToRouterService = convertHrefToRouterService;
22752
22752
  this.location = location;
22753
+ this.crf = crf;
22753
22754
  this.hasPrint = true;
22754
22755
  this.hasEventSelector = true;
22755
22756
  this.prependedTabs = [];
@@ -22761,9 +22762,16 @@
22761
22762
  this.ignoreWarning = false;
22762
22763
  this.callbackErrorsSubject = new rxjs.Subject();
22763
22764
  }
22765
+ CaseFullAccessViewComponent.prototype.ngOnChanges = function (changes) {
22766
+ if (!changes.prependedTabs.firstChange) {
22767
+ this.init();
22768
+ this.crf.detectChanges();
22769
+ this.organiseTabPosition();
22770
+ }
22771
+ };
22764
22772
  CaseFullAccessViewComponent.prototype.ngOnInit = function () {
22765
22773
  var _this = this;
22766
- this.dialogConfig = initDialog();
22774
+ initDialog();
22767
22775
  this.init();
22768
22776
  this.callbackErrorsSubject.subscribe(function (errorEvent) {
22769
22777
  _this.error = errorEvent;
@@ -22786,20 +22794,19 @@
22786
22794
  return this.caseDetails.case_type.printEnabled;
22787
22795
  };
22788
22796
  CaseFullAccessViewComponent.prototype.ngOnDestroy = function () {
22789
- if (this.activitySubscription && this.activityPollingService.isEnabled) {
22790
- this.activitySubscription.unsubscribe();
22791
- }
22792
- if (this.callbackErrorsSubject) {
22793
- this.callbackErrorsSubject.unsubscribe();
22794
- }
22795
- if (!this.route.snapshot.data.case && this.caseSubscription) {
22796
- this.caseSubscription.unsubscribe();
22797
+ if (this.activityPollingService.isEnabled) {
22798
+ this.unsubscribe(this.activitySubscription);
22797
22799
  }
22798
- if (this.errorSubscription) {
22799
- this.errorSubscription.unsubscribe();
22800
+ if (!this.route.snapshot.data.case) {
22801
+ this.unsubscribe(this.caseSubscription);
22800
22802
  }
22801
- if (this.subscription) {
22802
- this.subscription.unsubscribe();
22803
+ this.unsubscribe(this.callbackErrorsSubject);
22804
+ this.unsubscribe(this.errorSubscription);
22805
+ this.unsubscribe(this.subscription);
22806
+ };
22807
+ CaseFullAccessViewComponent.prototype.unsubscribe = function (subscription) {
22808
+ if (subscription) {
22809
+ subscription.unsubscribe();
22803
22810
  }
22804
22811
  };
22805
22812
  CaseFullAccessViewComponent.prototype.postViewActivity = function () {
@@ -22870,16 +22877,19 @@
22870
22877
  && this.error.details.field_errors
22871
22878
  && this.error.details.field_errors.length);
22872
22879
  };
22873
- CaseFullAccessViewComponent.prototype.ngAfterViewInit = function () {
22880
+ CaseFullAccessViewComponent.prototype.organiseTabPosition = function () {
22874
22881
  var _this = this;
22875
22882
  var matTab;
22876
22883
  var url = this.location.path(true);
22877
22884
  var hashValue = url.substring(url.indexOf('#') + 1);
22878
- if (!url.includes('#')) {
22885
+ if (!url.includes('#') && !url.includes('roles-and-access') && !url.includes('tasks')) {
22879
22886
  var paths = url.split('/');
22880
22887
  // lastPath can be /caseId, or the tabs /tasks, /hearings etc.
22881
22888
  var lastPath_1 = decodeURIComponent(paths[paths.length - 1]);
22882
22889
  var foundTab_1 = null;
22890
+ if (!this.prependedTabs) {
22891
+ this.prependedTabs = [];
22892
+ }
22883
22893
  var additionalTabs = __spread(this.prependedTabs, this.appendedTabs);
22884
22894
  if (additionalTabs && additionalTabs.length) {
22885
22895
  foundTab_1 = additionalTabs.find(function (caseTab) { return caseTab.id.toLowerCase() === lastPath_1.toLowerCase(); });
@@ -22897,7 +22907,7 @@
22897
22907
  this.caseDetails.tabs.sort(function (aTab, bTab) { return aTab.order > bTab.order ? 1 : (bTab.order > aTab.order ? -1 : 0); });
22898
22908
  // preselect the 1st order of CCD predefined tabs
22899
22909
  var preSelectTab_1 = this.caseDetails.tabs[0];
22900
- this.router.navigate(['cases', 'case-details', this.caseDetails.case_id]).then(function () {
22910
+ this.router.navigate(['cases', 'case-details', this.caseDetails.case_id], { fragment: preSelectTab_1.label }).then(function () {
22901
22911
  matTab = _this.tabGroup._tabs.find(function (x) { return x.textLabel === preSelectTab_1.label; });
22902
22912
  _this.tabGroup.selectedIndex = matTab.position;
22903
22913
  });
@@ -22906,6 +22916,9 @@
22906
22916
  else {
22907
22917
  var regExp = new RegExp(CaseFullAccessViewComponent.UNICODE_SPACE, 'g');
22908
22918
  hashValue = hashValue.replace(regExp, CaseFullAccessViewComponent.EMPTY_SPACE);
22919
+ if (hashValue.includes('roles-and-access') || hashValue.includes('tasks')) {
22920
+ hashValue = hashValue.includes('roles-and-access') ? 'roles and access' : 'tasks';
22921
+ }
22909
22922
  matTab = this.tabGroup._tabs.find(function (x) { return x.textLabel.replace(CaseFullAccessViewComponent.EMPTY_SPACE, '').toLowerCase() ===
22910
22923
  hashValue.replace(CaseFullAccessViewComponent.EMPTY_SPACE, '').toLowerCase(); });
22911
22924
  if (matTab && matTab.position) {
@@ -22986,7 +22999,7 @@
22986
22999
  CaseFullAccessViewComponent.TRIGGER_TEXT_CONTINUE = 'Ignore Warning and Go';
22987
23000
  CaseFullAccessViewComponent.UNICODE_SPACE = '%20';
22988
23001
  CaseFullAccessViewComponent.EMPTY_SPACE = ' ';
22989
- CaseFullAccessViewComponent.ɵfac = function CaseFullAccessViewComponent_Factory(t) { return new (t || CaseFullAccessViewComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.NgZone), i0__namespace.ɵɵdirectiveInject(i1__namespace$1.ActivatedRoute), i0__namespace.ɵɵdirectiveInject(i1__namespace$1.Router), i0__namespace.ɵɵdirectiveInject(NavigationNotifierService), i0__namespace.ɵɵdirectiveInject(OrderService), i0__namespace.ɵɵdirectiveInject(ActivityPollingService), i0__namespace.ɵɵdirectiveInject(i1__namespace$5.MatDialog), i0__namespace.ɵɵdirectiveInject(AlertService), i0__namespace.ɵɵdirectiveInject(DraftService), i0__namespace.ɵɵdirectiveInject(ErrorNotifierService), i0__namespace.ɵɵdirectiveInject(ConvertHrefToRouterService), i0__namespace.ɵɵdirectiveInject(i1__namespace.Location)); };
23002
+ CaseFullAccessViewComponent.ɵfac = function CaseFullAccessViewComponent_Factory(t) { return new (t || CaseFullAccessViewComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.NgZone), i0__namespace.ɵɵdirectiveInject(i1__namespace$1.ActivatedRoute), i0__namespace.ɵɵdirectiveInject(i1__namespace$1.Router), i0__namespace.ɵɵdirectiveInject(NavigationNotifierService), i0__namespace.ɵɵdirectiveInject(OrderService), i0__namespace.ɵɵdirectiveInject(ActivityPollingService), i0__namespace.ɵɵdirectiveInject(i1__namespace$5.MatDialog), i0__namespace.ɵɵdirectiveInject(AlertService), i0__namespace.ɵɵdirectiveInject(DraftService), i0__namespace.ɵɵdirectiveInject(ErrorNotifierService), i0__namespace.ɵɵdirectiveInject(ConvertHrefToRouterService), i0__namespace.ɵɵdirectiveInject(i1__namespace.Location), i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef)); };
22990
23003
  CaseFullAccessViewComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CaseFullAccessViewComponent, selectors: [["ccd-case-full-access-view"]], viewQuery: function CaseFullAccessViewComponent_Query(rf, ctx) {
22991
23004
  if (rf & 1) {
22992
23005
  i0__namespace.ɵɵviewQuery(_c0$a, 1);
@@ -22995,7 +23008,7 @@
22995
23008
  var _t = void 0;
22996
23009
  i0__namespace.ɵɵqueryRefresh(_t = i0__namespace.ɵɵloadQuery()) && (ctx.tabGroup = _t.first);
22997
23010
  }
22998
- }, inputs: { hasPrint: "hasPrint", hasEventSelector: "hasEventSelector", caseDetails: "caseDetails", prependedTabs: "prependedTabs", appendedTabs: "appendedTabs" }, decls: 12, vars: 11, consts: [["class", "error-summary", "role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 4, "ngIf"], [3, "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject", "callbackErrorsContext"], [3, "caseId", "displayMode"], [1, "grid-row"], [1, "column-one-half"], [3, "caseDetails"], ["class", "case-viewer-controls", 4, "ngIf"], ["class", "column-one-half", 4, "ngIf"], [1, "column-full"], [4, "ngIf"], ["role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 1, "error-summary"], ["id", "edit-case-event_error-summary-heading", 1, "heading-h1", "error-summary-heading"], ["id", "edit-case-event_error-summary-body", 1, "govuk-error-summary__body"], ["href", "get-help", "target", "_blank"], ["id", "edit-case-event_error-summary-heading", 1, "heading-h2", "error-summary-heading"], ["class", "error-summary-list", 4, "ngIf"], [1, "error-summary-list"], [4, "ngFor", "ngForOf"], [1, "case-viewer-controls"], ["id", "case-viewer-control-print", "routerLink", "print", 1, "button", "button-secondary"], [3, "isDisabled", "triggers", "triggerText", "onTriggerChange", "onTriggerSubmit"], ["animationDuration", "0ms", 3, "disableRipple", "selectedTabChange"], ["tabGroup", ""], [3, "id", "label", 4, "ngFor", "ngForOf"], [3, "id", "label"], ["matTabContent", ""], ["aria-describedby", "case viewer table"], ["ccdLabelSubstitutor", "", 3, "caseField", "contextFields", "hidden"], [3, "ngSwitch"], [4, "ngSwitchCase"], ["class", "compound-field", 4, "ngSwitchCase"], [1, "case-viewer-label", "text-16"], [1, "text-16"], [3, "topLevelFormGroup", "caseField", "caseReference", "markdownUseHrefAsRouterLink"], [1, "compound-field"]], template: function CaseFullAccessViewComponent_Template(rf, ctx) {
23011
+ }, inputs: { hasPrint: "hasPrint", hasEventSelector: "hasEventSelector", caseDetails: "caseDetails", prependedTabs: "prependedTabs", appendedTabs: "appendedTabs" }, features: [i0__namespace.ɵɵNgOnChangesFeature], decls: 12, vars: 11, consts: [["class", "error-summary", "role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 4, "ngIf"], [3, "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject", "callbackErrorsContext"], [3, "caseId", "displayMode"], [1, "grid-row"], [1, "column-one-half"], [3, "caseDetails"], ["class", "case-viewer-controls", 4, "ngIf"], ["class", "column-one-half", 4, "ngIf"], [1, "column-full"], [4, "ngIf"], ["role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 1, "error-summary"], ["id", "edit-case-event_error-summary-heading", 1, "heading-h1", "error-summary-heading"], ["id", "edit-case-event_error-summary-body", 1, "govuk-error-summary__body"], ["href", "get-help", "target", "_blank"], ["id", "edit-case-event_error-summary-heading", 1, "heading-h2", "error-summary-heading"], ["class", "error-summary-list", 4, "ngIf"], [1, "error-summary-list"], [4, "ngFor", "ngForOf"], [1, "case-viewer-controls"], ["id", "case-viewer-control-print", "routerLink", "print", 1, "button", "button-secondary"], [3, "isDisabled", "triggers", "triggerText", "onTriggerChange", "onTriggerSubmit"], ["animationDuration", "0ms", 3, "disableRipple", "selectedTabChange"], ["tabGroup", ""], [3, "id", "label", 4, "ngFor", "ngForOf"], [3, "id", "label"], ["matTabContent", ""], ["aria-describedby", "case viewer table"], ["ccdLabelSubstitutor", "", 3, "caseField", "contextFields", "hidden"], [3, "ngSwitch"], [4, "ngSwitchCase"], ["class", "compound-field", 4, "ngSwitchCase"], [1, "case-viewer-label", "text-16"], [1, "text-16"], [3, "topLevelFormGroup", "caseField", "caseReference", "markdownUseHrefAsRouterLink"], [1, "compound-field"]], template: function CaseFullAccessViewComponent_Template(rf, ctx) {
22999
23012
  if (rf & 1) {
23000
23013
  i0__namespace.ɵɵtemplate(0, CaseFullAccessViewComponent_div_0_Template, 10, 0, "div", 0);
23001
23014
  i0__namespace.ɵɵtemplate(1, CaseFullAccessViewComponent_div_1_Template, 6, 2, "div", 0);
@@ -23042,7 +23055,7 @@
23042
23055
  templateUrl: './case-full-access-view.component.html',
23043
23056
  styleUrls: ['./case-full-access-view.component.scss']
23044
23057
  }]
23045
- }], function () { return [{ type: i0__namespace.NgZone }, { type: i1__namespace$1.ActivatedRoute }, { type: i1__namespace$1.Router }, { type: NavigationNotifierService }, { type: OrderService }, { type: ActivityPollingService }, { type: i1__namespace$5.MatDialog }, { type: AlertService }, { type: DraftService }, { type: ErrorNotifierService }, { type: ConvertHrefToRouterService }, { type: i1__namespace.Location }]; }, { hasPrint: [{
23058
+ }], function () { return [{ type: i0__namespace.NgZone }, { type: i1__namespace$1.ActivatedRoute }, { type: i1__namespace$1.Router }, { type: NavigationNotifierService }, { type: OrderService }, { type: ActivityPollingService }, { type: i1__namespace$5.MatDialog }, { type: AlertService }, { type: DraftService }, { type: ErrorNotifierService }, { type: ConvertHrefToRouterService }, { type: i1__namespace.Location }, { type: i0__namespace.ChangeDetectorRef }]; }, { hasPrint: [{
23046
23059
  type: i0.Input
23047
23060
  }], hasEventSelector: [{
23048
23061
  type: i0.Input
@@ -23862,28 +23875,22 @@
23862
23875
  }
23863
23876
  EventStartGuard.prototype.canActivate = function (route) {
23864
23877
  var _this = this;
23865
- // Checks must be performed only for Work Allocation 2
23866
- if (this.appConfig.getWorkAllocationApiUrl().toLowerCase() === 'workallocation2') {
23867
- var caseId_1 = route.params['cid'];
23868
- var eventId_1 = route.params['eid'];
23869
- var taskId_1 = route.queryParams['tid'];
23870
- // TODO: NavigationExtras should be used once Angular upgrade changes have been incorporated
23871
- var isComplete = route.queryParams['isComplete'];
23872
- var caseInfoStr = this.sessionStorageService.getItem('caseInfo');
23873
- if (caseInfoStr) {
23874
- var caseInfo = JSON.parse(caseInfoStr);
23875
- if (caseInfo && caseInfo.cid === caseId_1) {
23876
- if (isComplete) {
23877
- return rxjs.of(true);
23878
- }
23879
- return this.workAllocationService.getTasksByCaseIdAndEventId(eventId_1, caseId_1, caseInfo.caseType, caseInfo.jurisdiction).pipe(operators.switchMap(function (payload) { return _this.checkForTasks(payload, caseId_1, eventId_1, taskId_1); }));
23878
+ var caseId = route.params['cid'];
23879
+ var eventId = route.params['eid'];
23880
+ var taskId = route.queryParams['tid'];
23881
+ // TODO: NavigationExtras should be used once Angular upgrade changes have been incorporated
23882
+ var isComplete = route.queryParams['isComplete'];
23883
+ var caseInfoStr = this.sessionStorageService.getItem('caseInfo');
23884
+ if (caseInfoStr) {
23885
+ var caseInfo = JSON.parse(caseInfoStr);
23886
+ if (caseInfo && caseInfo.cid === caseId) {
23887
+ if (isComplete) {
23888
+ return rxjs.of(true);
23880
23889
  }
23890
+ return this.workAllocationService.getTasksByCaseIdAndEventId(eventId, caseId, caseInfo.caseType, caseInfo.jurisdiction).pipe(operators.switchMap(function (payload) { return _this.checkForTasks(payload, caseId, eventId, taskId); }));
23881
23891
  }
23882
23892
  }
23883
- else {
23884
- // Checks not required, return true by default for Work Allocation 1
23885
- return rxjs.of(true);
23886
- }
23893
+ return rxjs.of(false);
23887
23894
  };
23888
23895
  EventStartGuard.prototype.checkTaskInEventNotRequired = function (payload, caseId, taskId) {
23889
23896
  if (!payload || !payload.tasks) {
@@ -27600,10 +27607,29 @@
27600
27607
  return TestRouteSnapshotBuilder;
27601
27608
  }());
27602
27609
 
27610
+ var CaseUIToolkitModule = /** @class */ (function () {
27611
+ function CaseUIToolkitModule() {
27612
+ }
27613
+ return CaseUIToolkitModule;
27614
+ }());
27615
+ CaseUIToolkitModule.ɵfac = function CaseUIToolkitModule_Factory(t) { return new (t || CaseUIToolkitModule)(); };
27616
+ CaseUIToolkitModule.ɵmod = i0__namespace.ɵɵdefineNgModule({ type: CaseUIToolkitModule });
27617
+ CaseUIToolkitModule.ɵinj = i0__namespace.ɵɵdefineInjector({ imports: [[]] });
27618
+ (function () {
27619
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(CaseUIToolkitModule, [{
27620
+ type: i0.NgModule,
27621
+ args: [{
27622
+ imports: [],
27623
+ exports: []
27624
+ }]
27625
+ }], null, null);
27626
+ })();
27627
+
27603
27628
  /**
27604
27629
  * Generated bundle index. Do not edit.
27605
27630
  */
27606
27631
 
27632
+ exports.AbstractAppConfig = AbstractAppConfig;
27607
27633
  exports.AbstractFieldReadComponent = AbstractFieldReadComponent;
27608
27634
  exports.AbstractFieldWriteComponent = AbstractFieldWriteComponent;
27609
27635
  exports.Activity = Activity;
@@ -27641,6 +27667,7 @@
27641
27667
  exports.CaseEditPageComponent = CaseEditPageComponent;
27642
27668
  exports.CaseEditSubmitComponent = CaseEditSubmitComponent;
27643
27669
  exports.CaseEditWizardGuard = CaseEditWizardGuard;
27670
+ exports.CaseEditorConfig = CaseEditorConfig;
27644
27671
  exports.CaseEditorModule = CaseEditorModule;
27645
27672
  exports.CaseEvent = CaseEvent;
27646
27673
  exports.CaseEventData = CaseEventData;
@@ -27671,6 +27698,7 @@
27671
27698
  exports.CaseTimelineModule = CaseTimelineModule;
27672
27699
  exports.CaseType = CaseType;
27673
27700
  exports.CaseTypeLite = CaseTypeLite;
27701
+ exports.CaseUIToolkitModule = CaseUIToolkitModule;
27674
27702
  exports.CaseView = CaseView;
27675
27703
  exports.CaseViewComponent = CaseViewComponent;
27676
27704
  exports.CaseViewEvent = CaseViewEvent;