@hmcts/ccd-case-ui-toolkit 4.8.4-rc.7 → 4.9.0-hearing-rc1

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/dist/index.umd.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @hmcts/ccd-case-ui-toolkit - Case UI Toolkit
3
- * @version v4.8.4-rc.7
3
+ * @version v4.9.0-hearing-rc1
4
4
  * @link undefined
5
5
  * @license MIT
6
6
  */
@@ -19966,6 +19966,7 @@ var CaseHeaderComponent = /** @class */ (function () {
19966
19966
  this.caseTitle = new domain_1.CaseField();
19967
19967
  if (!this.isDraft() && this.caseDetails.state.title_display) {
19968
19968
  this.caseTitle.label = this.caseDetails.state.title_display;
19969
+ this.label = this.caseTitle.label;
19969
19970
  this.caseFields = this.getCaseFields();
19970
19971
  }
19971
19972
  };
@@ -21508,16 +21509,35 @@ var CaseFullAccessViewComponent = /** @class */ (function () {
21508
21509
  var matTab;
21509
21510
  var url = this.location.path(true);
21510
21511
  var hashValue = url.substring(url.indexOf('#') + 1);
21511
- // if we have prepended tabs route to one of the prepended tabs
21512
- if (!url.includes('#') && this.prependedTabs && this.prependedTabs.length) {
21512
+ if (!url.includes('#')) {
21513
21513
  var paths = url.split('/');
21514
- var tabName_1 = decodeURIComponent(paths[paths.length - 1]);
21515
- var selectedTab_1 = this.prependedTabs.find(function (caseTab) { return caseTab.id.toLowerCase() === tabName_1.toLowerCase(); });
21516
- var tab = selectedTab_1 ? selectedTab_1.id : 'tasks';
21517
- this.router.navigate(['cases', 'case-details', this.caseDetails.case_id, tab]).then(function () {
21518
- matTab = _this.tabGroup._tabs.find(function (x) { return x.textLabel === selectedTab_1.label; });
21519
- _this.tabGroup.selectedIndex = matTab.position;
21520
- });
21514
+ // lastPath can be /caseId, or the tabs /tasks, /hearings etc.
21515
+ var lastPath_1 = decodeURIComponent(paths[paths.length - 1]);
21516
+ var foundTab_1 = null;
21517
+ var additionalTabs = this.prependedTabs.concat(this.appendedTabs);
21518
+ if (additionalTabs && additionalTabs.length) {
21519
+ foundTab_1 = additionalTabs.find(function (caseTab) { return caseTab.id.toLowerCase() === lastPath_1.toLowerCase(); });
21520
+ }
21521
+ // found tasks or hearing tab
21522
+ if (foundTab_1) {
21523
+ this.router.navigate(['cases', 'case-details', this.caseDetails.case_id, foundTab_1.id]).then(function () {
21524
+ matTab = _this.tabGroup._tabs.find(function (x) { return x.textLabel === foundTab_1.label; });
21525
+ if (matTab && matTab.position) {
21526
+ _this.tabGroup.selectedIndex = matTab.position;
21527
+ }
21528
+ });
21529
+ // last path is caseId
21530
+ }
21531
+ else {
21532
+ // sort with the order of CCD predefined tabs
21533
+ this.caseDetails.tabs.sort(function (aTab, bTab) { return aTab.order > bTab.order ? 1 : (bTab.order > aTab.order ? -1 : 0); });
21534
+ // preselect the 1st order of CCD predefined tabs
21535
+ var preSelectTab_1 = this.caseDetails.tabs[0];
21536
+ this.router.navigate(['cases', 'case-details', this.caseDetails.case_id]).then(function () {
21537
+ matTab = _this.tabGroup._tabs.find(function (x) { return x.textLabel === preSelectTab_1.label; });
21538
+ _this.tabGroup.selectedIndex = matTab.position;
21539
+ });
21540
+ }
21521
21541
  }
21522
21542
  else {
21523
21543
  var regExp = new RegExp(CaseFullAccessViewComponent_1.UNICODE_SPACE, 'g');
@@ -33741,16 +33761,18 @@ var WorkbasketFiltersComponent = /** @class */ (function () {
33741
33761
  var formGroupLS = JSON.parse(this.windowService.getLocalStorage(FORM_GROUP_VAL_LOC_STORAGE));
33742
33762
  // Form group local storage is available and contains regionList property
33743
33763
  if (util_1.isDefined(formGroupLS) && formGroupLS.hasOwnProperty(REGION_LIST_AND_FRC_FILTER)) {
33744
- // If regionList value does not match between local storage and form group
33745
- // then the filter value has been changed and we need to clear the old filter values
33746
- if (formGroupLS[REGION_LIST_AND_FRC_FILTER] !== this.formGroup.get(REGION_LIST_AND_FRC_FILTER).value) {
33747
- for (var key in formGroupLS) {
33748
- if (formGroupLS.hasOwnProperty(key)) {
33749
- var value = formGroupLS[key];
33750
- // Clear the filter form group control values if it has a value in local storage
33751
- // The regionList form group control value should be ignored as it always contain the latest value
33752
- if (key !== REGION_LIST_AND_FRC_FILTER && value != null) {
33753
- this.formGroup.get(key).setValue(null);
33764
+ if (this.formGroup.get(REGION_LIST_AND_FRC_FILTER)) {
33765
+ // If regionList value does not match between local storage and form group
33766
+ // then the filter value has been changed and we need to clear the old filter values
33767
+ if (formGroupLS[REGION_LIST_AND_FRC_FILTER] !== this.formGroup.get(REGION_LIST_AND_FRC_FILTER).value) {
33768
+ for (var key in formGroupLS) {
33769
+ if (formGroupLS.hasOwnProperty(key)) {
33770
+ var value = formGroupLS[key];
33771
+ // Clear the filter form group control values if it has a value in local storage
33772
+ // The regionList form group control value should be ignored as it always contain the latest value
33773
+ if (key !== REGION_LIST_AND_FRC_FILTER && value != null) {
33774
+ this.formGroup.get(key).setValue(null);
33775
+ }
33754
33776
  }
33755
33777
  }
33756
33778
  }
@@ -69216,7 +69238,7 @@ module.exports = "<div *ngIf=\"isDataLoaded()\">\n <ccd-case-edit [submit]=\"
69216
69238
  /***/ 59541:
69217
69239
  /***/ ((module) => {
69218
69240
 
69219
- module.exports = "<h1 *ngIf=\"!caseTitle.label\" class=\"heading-h1\">#{{ caseDetails.case_id | ccdCaseReference}}</h1>\n\n<div *ngIf=\"caseTitle.label\" class=\"case-title\">\n <ccd-label-field [caseField]=\"caseTitle\" [caseFields]=\"caseFields\"></ccd-label-field>\n</div>\n"
69241
+ module.exports = "<h1 *ngIf=\"!label\" class=\"heading-h1\">#{{ caseDetails.case_id | ccdCaseReference}}</h1>\n\n<div *ngIf=\"label\" class=\"case-title\">\n <ccd-label-field [caseField]=\"caseTitle\" [caseFields]=\"caseFields\"></ccd-label-field>\n</div>\n"
69220
69242
 
69221
69243
  /***/ }),
69222
69244