@hmcts/ccd-case-ui-toolkit 6.19.4 → 6.19.5-case-file-view-document-upload-date

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 (60) hide show
  1. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js +418 -133
  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/shared/components/case-editor/case-editor.module.js +2 -2
  6. package/esm2015/lib/shared/components/create-case-filters/create-case-filters.component.js +3 -3
  7. package/esm2015/lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder-sort/case-file-view-folder-sort.component.js +6 -3
  8. package/esm2015/lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder.component.js +30 -20
  9. package/esm2015/lib/shared/components/palette/case-file-view/test-data/categories-and-documents-test-data.js +233 -0
  10. package/esm2015/lib/shared/components/palette/complex/read-complex-field-collection-table.component.js +2 -2
  11. package/esm2015/lib/shared/components/palette/document/write-document-field.component.js +20 -43
  12. package/esm2015/lib/shared/components/palette/judicial-user/write-judicial-user-field.component.js +16 -1
  13. package/esm2015/lib/shared/components/workbasket-filters/workbasket-filters.component.js +12 -1
  14. package/esm2015/lib/shared/domain/case-file-view/case-file-view-document.model.js +1 -1
  15. package/esm2015/lib/shared/domain/case-file-view/case-file-view-sort-columns.enum.js +6 -0
  16. package/esm2015/lib/shared/domain/case-file-view/document-tree-node/document-tree-node.model.js +39 -13
  17. package/esm2015/lib/shared/domain/case-file-view/index.js +3 -2
  18. package/esm2015/lib/shared/domain/index.js +10 -10
  19. package/esm2015/lib/shared/domain/search/sorting/sort-parameters.js +1 -1
  20. package/esm2015/lib/shared/domain/sort-order.enum.js +7 -0
  21. package/esm2015/lib/shared/pipes/search-result/sorting/sort-search-result.pipe.js +2 -2
  22. package/esm2015/lib/shared/services/case-file-view/case-file-view.service.js +12 -1
  23. package/fesm2015/hmcts-ccd-case-ui-toolkit.js +392 -111
  24. package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
  25. package/lib/shared/components/create-case-filters/create-case-filters.component.d.ts +1 -1
  26. package/lib/shared/components/create-case-filters/create-case-filters.component.d.ts.map +1 -1
  27. package/lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder-sort/case-file-view-folder-sort.component.d.ts +2 -2
  28. package/lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder-sort/case-file-view-folder-sort.component.d.ts.map +1 -1
  29. package/lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder.component.d.ts +2 -2
  30. package/lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder.component.d.ts.map +1 -1
  31. package/lib/shared/components/palette/case-file-view/test-data/categories-and-documents-test-data.d.ts +3 -0
  32. package/lib/shared/components/palette/case-file-view/test-data/categories-and-documents-test-data.d.ts.map +1 -0
  33. package/lib/shared/components/palette/complex/read-complex-field-collection-table.component.d.ts.map +1 -1
  34. package/lib/shared/components/palette/document/write-document-field.component.d.ts +4 -8
  35. package/lib/shared/components/palette/document/write-document-field.component.d.ts.map +1 -1
  36. package/lib/shared/components/palette/judicial-user/write-judicial-user-field.component.d.ts +5 -3
  37. package/lib/shared/components/palette/judicial-user/write-judicial-user-field.component.d.ts.map +1 -1
  38. package/lib/shared/components/workbasket-filters/workbasket-filters.component.d.ts +1 -1
  39. package/lib/shared/components/workbasket-filters/workbasket-filters.component.d.ts.map +1 -1
  40. package/lib/shared/domain/case-file-view/case-file-view-document.model.d.ts +1 -1
  41. package/lib/shared/domain/case-file-view/case-file-view-document.model.d.ts.map +1 -1
  42. package/lib/shared/domain/case-file-view/case-file-view-sort-columns.enum.d.ts +5 -0
  43. package/lib/shared/domain/case-file-view/case-file-view-sort-columns.enum.d.ts.map +1 -0
  44. package/lib/shared/domain/case-file-view/document-tree-node/document-tree-node.model.d.ts +4 -2
  45. package/lib/shared/domain/case-file-view/document-tree-node/document-tree-node.model.d.ts.map +1 -1
  46. package/lib/shared/domain/case-file-view/index.d.ts +2 -1
  47. package/lib/shared/domain/case-file-view/index.d.ts.map +1 -1
  48. package/lib/shared/domain/index.d.ts +9 -9
  49. package/lib/shared/domain/index.d.ts.map +1 -1
  50. package/lib/shared/domain/search/sorting/sort-parameters.d.ts +1 -1
  51. package/lib/shared/domain/search/sorting/sort-parameters.d.ts.map +1 -1
  52. package/lib/shared/domain/{search/sorting/sort-order.d.ts → sort-order.enum.d.ts} +1 -1
  53. package/lib/shared/domain/sort-order.enum.d.ts.map +1 -0
  54. package/lib/shared/services/case-file-view/case-file-view.service.d.ts.map +1 -1
  55. package/package.json +1 -1
  56. package/esm2015/lib/shared/components/palette/complex/sort-order.js +0 -7
  57. package/esm2015/lib/shared/domain/search/sorting/sort-order.js +0 -7
  58. package/lib/shared/components/palette/complex/sort-order.d.ts +0 -6
  59. package/lib/shared/components/palette/complex/sort-order.d.ts.map +0 -1
  60. package/lib/shared/domain/search/sorting/sort-order.d.ts.map +0 -1
@@ -3501,6 +3501,20 @@
3501
3501
  return Alert;
3502
3502
  }());
3503
3503
 
3504
+ // tslint:disable:variable-name
3505
+ var CaseDetails = /** @class */ (function () {
3506
+ function CaseDetails() {
3507
+ }
3508
+ return CaseDetails;
3509
+ }());
3510
+
3511
+ // tslint:disable:variable-name
3512
+ var CaseEventData = /** @class */ (function () {
3513
+ function CaseEventData() {
3514
+ }
3515
+ return CaseEventData;
3516
+ }());
3517
+
3504
3518
  var WizardPageField = /** @class */ (function () {
3505
3519
  function WizardPageField() {
3506
3520
  }
@@ -3920,6 +3934,20 @@
3920
3934
  return FormDocument;
3921
3935
  }());
3922
3936
 
3937
+ var DRAFT_PREFIX = 'DRAFT';
3938
+ var DRAFT_QUERY_PARAM = 'draft';
3939
+ var Draft = /** @class */ (function () {
3940
+ function Draft() {
3941
+ }
3942
+ Draft.stripDraftId = function (draftId) {
3943
+ return draftId.slice(DRAFT_PREFIX.length);
3944
+ };
3945
+ Draft.isDraft = function (id) {
3946
+ return String(id).startsWith(DRAFT_PREFIX);
3947
+ };
3948
+ return Draft;
3949
+ }());
3950
+
3923
3951
  var OrganisationConverter = /** @class */ (function () {
3924
3952
  function OrganisationConverter() {
3925
3953
  }
@@ -3965,6 +3993,12 @@
3965
3993
  }], null, null);
3966
3994
  })();
3967
3995
 
3996
+ var PaginationMetadata = /** @class */ (function () {
3997
+ function PaginationMetadata() {
3998
+ }
3999
+ return PaginationMetadata;
4000
+ }());
4001
+
3968
4002
  function hasRoles(profile) {
3969
4003
  if (profile.user && profile.user.idam && Array.isArray(profile.user.idam.roles)) {
3970
4004
  return profile.user.idam.roles.length > 0;
@@ -4023,20 +4057,6 @@
4023
4057
  __metadata("design:type", Array)
4024
4058
  ], SearchResultViewItem.prototype, "hydrated_case_fields", void 0);
4025
4059
 
4026
- var DRAFT_PREFIX = 'DRAFT';
4027
- var DRAFT_QUERY_PARAM = 'draft';
4028
- var Draft = /** @class */ (function () {
4029
- function Draft() {
4030
- }
4031
- Draft.stripDraftId = function (draftId) {
4032
- return draftId.slice(DRAFT_PREFIX.length);
4033
- };
4034
- Draft.isDraft = function (id) {
4035
- return String(id).startsWith(DRAFT_PREFIX);
4036
- };
4037
- return Draft;
4038
- }());
4039
-
4040
4060
  // @dynamic
4041
4061
  var SearchResultView = /** @class */ (function () {
4042
4062
  function SearchResultView() {
@@ -4057,19 +4077,20 @@
4057
4077
  __metadata("design:type", Array)
4058
4078
  ], SearchResultView.prototype, "results", void 0);
4059
4079
 
4060
- // tslint:disable:variable-name
4061
- var CaseDetails = /** @class */ (function () {
4062
- function CaseDetails() {
4080
+ var SortParameters = /** @class */ (function () {
4081
+ function SortParameters(comparator, sortOrder) {
4082
+ this.comparator = comparator;
4083
+ this.sortOrder = sortOrder;
4063
4084
  }
4064
- return CaseDetails;
4085
+ return SortParameters;
4065
4086
  }());
4066
4087
 
4067
- // tslint:disable:variable-name
4068
- var CaseEventData = /** @class */ (function () {
4069
- function CaseEventData() {
4070
- }
4071
- return CaseEventData;
4072
- }());
4088
+ exports.SortOrder = void 0;
4089
+ (function (SortOrder) {
4090
+ SortOrder[SortOrder["ASCENDING"] = 0] = "ASCENDING";
4091
+ SortOrder[SortOrder["DESCENDING"] = 1] = "DESCENDING";
4092
+ SortOrder[SortOrder["UNSORTED"] = 2] = "UNSORTED";
4093
+ })(exports.SortOrder || (exports.SortOrder = {}));
4073
4094
 
4074
4095
  var WorkbasketInputModel = /** @class */ (function () {
4075
4096
  function WorkbasketInputModel() {
@@ -4082,27 +4103,6 @@
4082
4103
  return WorkbasketInput;
4083
4104
  }());
4084
4105
 
4085
- var PaginationMetadata = /** @class */ (function () {
4086
- function PaginationMetadata() {
4087
- }
4088
- return PaginationMetadata;
4089
- }());
4090
-
4091
- exports.SortOrder = void 0;
4092
- (function (SortOrder) {
4093
- SortOrder[SortOrder["ASCENDING"] = 0] = "ASCENDING";
4094
- SortOrder[SortOrder["DESCENDING"] = 1] = "DESCENDING";
4095
- SortOrder[SortOrder["UNSORTED"] = 2] = "UNSORTED";
4096
- })(exports.SortOrder || (exports.SortOrder = {}));
4097
-
4098
- var SortParameters = /** @class */ (function () {
4099
- function SortParameters(comparator, sortOrder) {
4100
- this.comparator = comparator;
4101
- this.sortOrder = sortOrder;
4102
- }
4103
- return SortParameters;
4104
- }());
4105
-
4106
4106
  // @dynamic
4107
4107
  var FieldsUtils = /** @class */ (function () {
4108
4108
  function FieldsUtils() {
@@ -7275,6 +7275,239 @@
7275
7275
  }], function () { return [{ type: i1__namespace$1.Router }, { type: i1__namespace.RpxTranslationService }]; }, null);
7276
7276
  })();
7277
7277
 
7278
+ var categoriesAndDocumentsTestData = {
7279
+ case_version: 1,
7280
+ categories: [
7281
+ {
7282
+ category_id: 'Beers',
7283
+ category_name: 'Beers',
7284
+ category_order: 1,
7285
+ documents: [
7286
+ {
7287
+ document_url: '/test',
7288
+ document_filename: 'Lager encyclopedia',
7289
+ document_binary_url: '/test/binary',
7290
+ attribute_path: '',
7291
+ upload_timestamp: new Date(2023, 4, 11),
7292
+ content_type: ''
7293
+ },
7294
+ {
7295
+ document_url: '/test',
7296
+ document_filename: 'Beers encyclopedia',
7297
+ document_binary_url: '/test/binary',
7298
+ attribute_path: '',
7299
+ upload_timestamp: new Date(2023, 3, 14),
7300
+ content_type: ''
7301
+ },
7302
+ {
7303
+ document_url: '/test',
7304
+ document_filename: 'Ale encyclopedia',
7305
+ document_binary_url: '/test/binary',
7306
+ attribute_path: '',
7307
+ upload_timestamp: new Date(2023, 2, 12),
7308
+ content_type: ''
7309
+ }
7310
+ ],
7311
+ sub_categories: [
7312
+ {
7313
+ category_id: 'BeersBitters',
7314
+ category_name: 'Bitters',
7315
+ category_order: 1,
7316
+ documents: [],
7317
+ sub_categories: []
7318
+ },
7319
+ {
7320
+ category_id: 'BeersAmerican',
7321
+ category_name: 'American',
7322
+ category_order: 2,
7323
+ documents: [],
7324
+ sub_categories: []
7325
+ },
7326
+ {
7327
+ category_id: 'BeersAsian',
7328
+ category_name: 'Asian',
7329
+ category_order: 3,
7330
+ documents: [],
7331
+ sub_categories: []
7332
+ }
7333
+ ]
7334
+ },
7335
+ {
7336
+ category_id: 'Wines',
7337
+ category_name: 'Wines',
7338
+ category_order: 2,
7339
+ documents: [],
7340
+ sub_categories: [
7341
+ {
7342
+ category_id: 'WinesFrench',
7343
+ category_name: 'French',
7344
+ category_order: 1,
7345
+ documents: [],
7346
+ sub_categories: []
7347
+ },
7348
+ {
7349
+ category_id: 'WinesItalian',
7350
+ category_name: 'Italian',
7351
+ category_order: 2,
7352
+ documents: [
7353
+ {
7354
+ document_url: '/red-wine',
7355
+ document_filename: 'Details about red wine',
7356
+ document_binary_url: '/test/binary',
7357
+ attribute_path: '',
7358
+ upload_timestamp: null,
7359
+ content_type: ''
7360
+ },
7361
+ {
7362
+ document_url: '/white-wine',
7363
+ document_filename: 'Details about white wine',
7364
+ document_binary_url: '/test/binary',
7365
+ attribute_path: '',
7366
+ upload_timestamp: new Date(2023, 1, 10),
7367
+ content_type: ''
7368
+ },
7369
+ {
7370
+ document_url: '/prosecco',
7371
+ document_filename: 'Details about Prosecco',
7372
+ document_binary_url: '/test/binary',
7373
+ attribute_path: '',
7374
+ upload_timestamp: new Date(2023, 3, 12),
7375
+ content_type: ''
7376
+ },
7377
+ {
7378
+ document_url: '/pinot-grigio',
7379
+ document_filename: 'Details about Pinot Grigio',
7380
+ document_binary_url: '/test/binary',
7381
+ attribute_path: '',
7382
+ upload_timestamp: new Date(2023, 2, 16),
7383
+ content_type: ''
7384
+ }
7385
+ ],
7386
+ sub_categories: []
7387
+ }
7388
+ ]
7389
+ },
7390
+ {
7391
+ category_id: 'Spirits',
7392
+ category_name: 'Spirits',
7393
+ category_order: 3,
7394
+ documents: [],
7395
+ sub_categories: [
7396
+ {
7397
+ category_id: 'SpiritsWhisky',
7398
+ category_name: 'Scotch whisky',
7399
+ category_order: 1,
7400
+ documents: [],
7401
+ sub_categories: [
7402
+ {
7403
+ category_id: 'WhiskyHighland',
7404
+ category_name: 'Highland',
7405
+ category_order: 1,
7406
+ documents: [],
7407
+ sub_categories: [
7408
+ {
7409
+ category_id: 'WhiskyHighland1',
7410
+ category_name: 'Highland 1',
7411
+ category_order: 1,
7412
+ documents: [],
7413
+ sub_categories: []
7414
+ }
7415
+ ]
7416
+ },
7417
+ {
7418
+ category_id: 'WhiskyLowland',
7419
+ category_name: 'Lowland',
7420
+ category_order: 2,
7421
+ documents: [],
7422
+ sub_categories: [
7423
+ {
7424
+ category_id: 'WhiskyLowland1',
7425
+ category_name: 'Lowland 1',
7426
+ category_order: 1,
7427
+ documents: [
7428
+ {
7429
+ document_url: '/test',
7430
+ document_filename: 'Details about Whisky Lowland 1',
7431
+ document_binary_url: '/test/binary',
7432
+ attribute_path: '',
7433
+ upload_timestamp: new Date(2022, 5, 21),
7434
+ content_type: ''
7435
+ }
7436
+ ],
7437
+ sub_categories: []
7438
+ },
7439
+ {
7440
+ category_id: 'WhiskyLowland2',
7441
+ category_name: 'Lowland 2',
7442
+ category_order: 2,
7443
+ documents: [],
7444
+ sub_categories: []
7445
+ }
7446
+ ]
7447
+ },
7448
+ {
7449
+ category_id: 'WhiskyIslay',
7450
+ category_name: 'Islay',
7451
+ category_order: 3,
7452
+ documents: [
7453
+ {
7454
+ document_url: '/test',
7455
+ document_filename: 'Details about Whisky Islay',
7456
+ document_binary_url: '/test/binary',
7457
+ attribute_path: '',
7458
+ upload_timestamp: new Date(2022, 10, 4),
7459
+ content_type: ''
7460
+ },
7461
+ {
7462
+ document_url: '/test',
7463
+ document_filename: 'More information about Whisky Islay',
7464
+ document_binary_url: '/test/binary',
7465
+ attribute_path: '',
7466
+ upload_timestamp: new Date(2022, 11, 28),
7467
+ content_type: ''
7468
+ }
7469
+ ],
7470
+ sub_categories: []
7471
+ },
7472
+ {
7473
+ category_id: 'WhiskySpeyside',
7474
+ category_name: 'Speyside',
7475
+ category_order: 4,
7476
+ documents: [],
7477
+ sub_categories: []
7478
+ },
7479
+ {
7480
+ category_id: 'WhiskyCampbeltown',
7481
+ category_name: 'Campbeltown',
7482
+ category_order: 5,
7483
+ documents: [],
7484
+ sub_categories: []
7485
+ }
7486
+ ]
7487
+ }
7488
+ ]
7489
+ }
7490
+ ],
7491
+ uncategorised_documents: [
7492
+ {
7493
+ document_url: '/uncategorised-document-1',
7494
+ document_filename: 'Uncategorised document 1',
7495
+ document_binary_url: '/test/binary',
7496
+ attribute_path: '',
7497
+ upload_timestamp: new Date(2022, 10, 17),
7498
+ content_type: ''
7499
+ },
7500
+ {
7501
+ document_url: '/uncategorised-document-2',
7502
+ document_filename: 'Uncategorised document 2',
7503
+ document_binary_url: '/test/binary',
7504
+ attribute_path: '',
7505
+ upload_timestamp: new Date(2023, 1, 23),
7506
+ content_type: ''
7507
+ }
7508
+ ]
7509
+ };
7510
+
7278
7511
  var CaseFileViewService = /** @class */ (function () {
7279
7512
  function CaseFileViewService(http, appConfig) {
7280
7513
  this.http = http;
@@ -7287,6 +7520,16 @@
7287
7520
  * @returns An `Observable` of the `CategoriesAndDocuments` for the case
7288
7521
  */
7289
7522
  CaseFileViewService.prototype.getCategoriesAndDocuments = function (caseRef) {
7523
+ // Case file view v1.1 epic - https://tools.hmcts.net/jira/browse/EUI-7807
7524
+ // Display upload_timestamp - https://tools.hmcts.net/jira/browse/EUI-7819
7525
+ // Sort by upload_timestamp - https://tools.hmcts.net/jira/browse/EUI-7812
7526
+ // The property upload_timestamp is not available as it is not yet implemented by CCD
7527
+ // Using this case reference '1666863124102280' to return the mock data with upload_timestamp
7528
+ // The below 'if' statement should be removed once the upload_timestamp property is made available by CCD
7529
+ // https://tools.hmcts.net/jira/browse/EUI-8129
7530
+ if (caseRef === '1666863124102280') {
7531
+ return rxjs.of(categoriesAndDocumentsTestData);
7532
+ }
7290
7533
  var url = this.appConfig.getCategoriesAndDocumentsUrl();
7291
7534
  if (url) {
7292
7535
  url += "/" + caseRef;
@@ -14635,19 +14878,18 @@
14635
14878
  var _c1$k = function (a0) { return { "form-group-error bottom-30": a0 }; };
14636
14879
  var WriteDocumentFieldComponent = /** @class */ (function (_super) {
14637
14880
  __extends(WriteDocumentFieldComponent, _super);
14638
- function WriteDocumentFieldComponent(appConfig, caseNotifier, documentManagement, dialog, fileUploadStateService, jurisdictionService) {
14881
+ function WriteDocumentFieldComponent(appConfig, caseNotifier, documentManagement, dialog, fileUploadStateService) {
14639
14882
  var _this = _super.call(this) || this;
14640
14883
  _this.appConfig = appConfig;
14641
14884
  _this.caseNotifier = caseNotifier;
14642
14885
  _this.documentManagement = documentManagement;
14643
14886
  _this.dialog = dialog;
14644
14887
  _this.fileUploadStateService = fileUploadStateService;
14645
- _this.jurisdictionService = jurisdictionService;
14646
14888
  _this.valid = true;
14647
14889
  return _this;
14648
14890
  }
14649
14891
  WriteDocumentFieldComponent.prototype.clickout = function (event) {
14650
- // Capturing the event of the associated ElementRef <input type="file" #fileInpu
14892
+ // Capturing the event of of the associated ElementRef <input type="file" #fileInpu
14651
14893
  if (this.fileInput.nativeElement.contains(event.target)) {
14652
14894
  this.clickInsideTheDocument = true;
14653
14895
  }
@@ -14657,10 +14899,6 @@
14657
14899
  };
14658
14900
  WriteDocumentFieldComponent.prototype.ngOnInit = function () {
14659
14901
  this.secureModeOn = this.appConfig.getDocumentSecureMode();
14660
- console.info('writeDocumentField.ngInit: secure mode = ' + this.secureModeOn);
14661
- if (this.secureModeOn) {
14662
- this.subscribeToCaseDetails();
14663
- }
14664
14902
  this.dialogConfig = initDialog();
14665
14903
  // EUI-3403. The field was not being registered when there was no value and the field
14666
14904
  // itself was not mandatory, which meant that show_conditions would not be evaluated.
@@ -14673,6 +14911,9 @@
14673
14911
  else {
14674
14912
  this.createDocumentForm(document);
14675
14913
  }
14914
+ if (this.appConfig.getDocumentSecureMode()) {
14915
+ this.subscribeToCaseDetails();
14916
+ }
14676
14917
  };
14677
14918
  WriteDocumentFieldComponent.prototype.ngOnDestroy = function () {
14678
14919
  if (this.fileUploadSubscription) {
@@ -14681,11 +14922,8 @@
14681
14922
  if (this.dialogSubscription) {
14682
14923
  this.dialogSubscription.unsubscribe();
14683
14924
  }
14684
- if (this.caseNotifierSubscription) {
14685
- this.caseNotifierSubscription.unsubscribe();
14686
- }
14687
- if (this.jurisdictionSubs) {
14688
- this.jurisdictionSubs.unsubscribe();
14925
+ if (this.caseEventSubscription) {
14926
+ this.caseEventSubscription.unsubscribe();
14689
14927
  }
14690
14928
  };
14691
14929
  WriteDocumentFieldComponent.prototype.isUploadInProgress = function () {
@@ -14737,9 +14975,7 @@
14737
14975
  WriteDocumentFieldComponent.prototype.triggerReplace = function () {
14738
14976
  if (this.confirmReplaceResult === 'Replace') {
14739
14977
  this.openFileDialog();
14740
- return true;
14741
14978
  }
14742
- return false;
14743
14979
  };
14744
14980
  WriteDocumentFieldComponent.prototype.getUploadedFileName = function () {
14745
14981
  if (this.uploadedDocument) {
@@ -14774,30 +15010,11 @@
14774
15010
  _this.triggerReplace();
14775
15011
  });
14776
15012
  };
14777
- // Depending on the context, we can get the case type and jurisdiction from different sources
14778
- // If we are running an event, the caseNotifier will have the current case
14779
- // If we are creating a case, the case doesn't exist yet, so the caseNotifier can't help
14780
- // Instead we can use the eventTrigger to get the case type, and the jurisdiction service to
14781
- // get the currently selected jurisdiction
14782
15013
  WriteDocumentFieldComponent.prototype.subscribeToCaseDetails = function () {
14783
15014
  var _this = this;
14784
- this.caseNotifierSubscription = this.caseNotifier.caseView.subscribe({
15015
+ this.caseEventSubscription = this.caseNotifier.caseView.subscribe({
14785
15016
  next: function (caseDetails) {
14786
- var _a, _b;
14787
- _this.caseTypeId = caseDetails === null || caseDetails === void 0 ? void 0 : caseDetails.case_id;
14788
- _this.jurisdictionId = (_b = (_a = caseDetails === null || caseDetails === void 0 ? void 0 : caseDetails.case_type) === null || _a === void 0 ? void 0 : _a.jurisdiction) === null || _b === void 0 ? void 0 : _b.id;
14789
- console.info("caseNotifier.next: caseType=" + _this.caseTypeId + " juris=" + _this.jurisdictionId);
14790
- }
14791
- });
14792
- this.jurisdictionSubs = this.jurisdictionService.selectedJurisdictionBS.subscribe({
14793
- next: function (jurisdiction) {
14794
- if (jurisdiction) {
14795
- _this.jurisdictionId = jurisdiction.id;
14796
- if (jurisdiction.currentCaseType) {
14797
- _this.caseTypeId = jurisdiction.currentCaseType.id;
14798
- }
14799
- }
14800
- console.info("selectedJurisdiction.next: caseType=" + _this.caseTypeId + " juris=" + _this.jurisdictionId);
15017
+ _this.caseDetails = caseDetails;
14801
15018
  }
14802
15019
  });
14803
15020
  };
@@ -14861,8 +15078,13 @@
14861
15078
  documentUpload.append('files', selectedFile, selectedFile.name);
14862
15079
  documentUpload.append('classification', 'PUBLIC');
14863
15080
  if (this.appConfig.getDocumentSecureMode()) {
14864
- var caseTypeId = this.caseTypeId ? this.caseTypeId : null;
14865
- var caseTypeJurisdictionId = this.jurisdictionId ? this.jurisdictionId : null;
15081
+ var caseTypeId = this.caseDetails &&
15082
+ this.caseDetails.case_type &&
15083
+ this.caseDetails.case_type.id ? this.caseDetails.case_type.id : null;
15084
+ var caseTypeJurisdictionId = this.caseDetails &&
15085
+ this.caseDetails.case_type &&
15086
+ this.caseDetails.case_type.jurisdiction &&
15087
+ this.caseDetails.case_type.jurisdiction.id ? this.caseDetails.case_type.jurisdiction.id : null;
14866
15088
  documentUpload.append('caseTypeId', caseTypeId);
14867
15089
  documentUpload.append('jurisdictionId', caseTypeJurisdictionId);
14868
15090
  }
@@ -14910,7 +15132,7 @@
14910
15132
  WriteDocumentFieldComponent.UPLOAD_ERROR_FILE_REQUIRED = 'File required';
14911
15133
  WriteDocumentFieldComponent.UPLOAD_ERROR_NOT_AVAILABLE = 'Document upload facility is not available at the moment';
14912
15134
  WriteDocumentFieldComponent.UPLOAD_WAITING_FILE_STATUS = 'Uploading...';
14913
- WriteDocumentFieldComponent.ɵfac = function WriteDocumentFieldComponent_Factory(t) { return new (t || WriteDocumentFieldComponent)(i0__namespace.ɵɵdirectiveInject(AbstractAppConfig), i0__namespace.ɵɵdirectiveInject(CaseNotifier), i0__namespace.ɵɵdirectiveInject(DocumentManagementService), i0__namespace.ɵɵdirectiveInject(i1__namespace$3.MatDialog), i0__namespace.ɵɵdirectiveInject(FileUploadStateService), i0__namespace.ɵɵdirectiveInject(JurisdictionService)); };
15135
+ WriteDocumentFieldComponent.ɵfac = function WriteDocumentFieldComponent_Factory(t) { return new (t || WriteDocumentFieldComponent)(i0__namespace.ɵɵdirectiveInject(AbstractAppConfig), i0__namespace.ɵɵdirectiveInject(CaseNotifier), i0__namespace.ɵɵdirectiveInject(DocumentManagementService), i0__namespace.ɵɵdirectiveInject(i1__namespace$3.MatDialog), i0__namespace.ɵɵdirectiveInject(FileUploadStateService)); };
14914
15136
  WriteDocumentFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: WriteDocumentFieldComponent, selectors: [["ccd-write-document-field"]], viewQuery: function WriteDocumentFieldComponent_Query(rf, ctx) {
14915
15137
  if (rf & 1) {
14916
15138
  i0__namespace.ɵɵviewQuery(_c0$N, 1);
@@ -14988,7 +15210,7 @@
14988
15210
  selector: 'ccd-write-document-field',
14989
15211
  templateUrl: './write-document-field.html'
14990
15212
  }]
14991
- }], function () { return [{ type: AbstractAppConfig }, { type: CaseNotifier }, { type: DocumentManagementService }, { type: i1__namespace$3.MatDialog }, { type: FileUploadStateService }, { type: JurisdictionService }]; }, { fileInput: [{
15213
+ }], function () { return [{ type: AbstractAppConfig }, { type: CaseNotifier }, { type: DocumentManagementService }, { type: i1__namespace$3.MatDialog }, { type: FileUploadStateService }]; }, { fileInput: [{
14992
15214
  type: i0.ViewChild,
14993
15215
  args: ['fileInput', { static: false }]
14994
15216
  }], clickout: [{
@@ -16425,12 +16647,24 @@
16425
16647
  }
16426
16648
  };
16427
16649
  WriteJudicialUserFieldComponent.prototype.setJurisdictionAndCaseType = function () {
16650
+ var _this = this;
16428
16651
  var caseInfoStr = this.sessionStorageService.getItem('caseInfo');
16429
16652
  if (caseInfoStr) {
16430
16653
  var caseInfo = JSON.parse(caseInfoStr);
16431
16654
  this.jurisdiction = caseInfo === null || caseInfo === void 0 ? void 0 : caseInfo.jurisdiction;
16432
16655
  this.caseType = caseInfo === null || caseInfo === void 0 ? void 0 : caseInfo.caseType;
16433
16656
  }
16657
+ else {
16658
+ // If there is no case info, attempt to get the current jurisdiction and case type via the JurisdictionService
16659
+ this.jurisdictionSubscription = this.jurisdictionService.selectedJurisdictionBS.subscribe(function (jurisdiction) {
16660
+ if (jurisdiction) {
16661
+ _this.jurisdiction = jurisdiction.id;
16662
+ if (jurisdiction.currentCaseType) {
16663
+ _this.caseType = jurisdiction.currentCaseType.id;
16664
+ }
16665
+ }
16666
+ });
16667
+ }
16434
16668
  };
16435
16669
  WriteJudicialUserFieldComponent.prototype.displayJudicialUser = function (judicialUser) {
16436
16670
  return judicialUser
@@ -16476,6 +16710,10 @@
16476
16710
  this.judicialUserControl.setValidators(i2$1.Validators.required);
16477
16711
  }
16478
16712
  };
16713
+ WriteJudicialUserFieldComponent.prototype.ngOnDestroy = function () {
16714
+ var _a;
16715
+ (_a = this.jurisdictionSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
16716
+ };
16479
16717
  return WriteJudicialUserFieldComponent;
16480
16718
  }(WriteComplexFieldComponent));
16481
16719
  WriteJudicialUserFieldComponent.ɵfac = function WriteJudicialUserFieldComponent_Factory(t) { return new (t || WriteJudicialUserFieldComponent)(i0__namespace.ɵɵdirectiveInject(JurisdictionService), i0__namespace.ɵɵdirectiveInject(SessionStorageService), i0__namespace.ɵɵdirectiveInject(CaseFlagRefdataService), i0__namespace.ɵɵdirectiveInject(IsCompoundPipe), i0__namespace.ɵɵdirectiveInject(FormValidatorsService)); };
@@ -21912,6 +22150,12 @@
21912
22150
  }] });
21913
22151
  })();
21914
22152
 
22153
+ var CaseFileViewSortColumns;
22154
+ (function (CaseFileViewSortColumns) {
22155
+ CaseFileViewSortColumns[CaseFileViewSortColumns["DOCUMENT_NAME"] = 0] = "DOCUMENT_NAME";
22156
+ CaseFileViewSortColumns[CaseFileViewSortColumns["DOCUMENT_UPLOAD_TIMESTAMP"] = 1] = "DOCUMENT_UPLOAD_TIMESTAMP";
22157
+ })(CaseFileViewSortColumns || (CaseFileViewSortColumns = {}));
22158
+
21915
22159
  var CaseFileViewFolderSortComponent = /** @class */ (function () {
21916
22160
  function CaseFileViewFolderSortComponent() {
21917
22161
  var _this = this;
@@ -21919,8 +22163,10 @@
21919
22163
  this.sortAscending = new i0.EventEmitter();
21920
22164
  this.sortDescending = new i0.EventEmitter();
21921
22165
  this.overlayMenuItems = [
21922
- { actionText: 'A to Z ascending', iconSrc: '/assets/img/sort/sort-down-arrow.svg', actionFn: function () { return _this.sortAscending.emit(); } },
21923
- { actionText: 'Z to A descending', iconSrc: '/assets/img/sort/sort-up-arrow.svg', actionFn: function () { return _this.sortDescending.emit(); } },
22166
+ { actionText: 'A to Z ascending', iconSrc: '/assets/img/sort/sort-down-arrow.svg', actionFn: function () { return _this.sortAscending.emit(CaseFileViewSortColumns.DOCUMENT_NAME); } },
22167
+ { actionText: 'Z to A descending', iconSrc: '/assets/img/sort/sort-up-arrow.svg', actionFn: function () { return _this.sortDescending.emit(CaseFileViewSortColumns.DOCUMENT_NAME); } },
22168
+ { actionText: 'Recent first', iconSrc: '/assets/img/sort/sort-down-arrow.svg', actionFn: function () { return _this.sortDescending.emit(CaseFileViewSortColumns.DOCUMENT_UPLOAD_TIMESTAMP); } },
22169
+ { actionText: 'Oldest first', iconSrc: '/assets/img/sort/sort-up-arrow.svg', actionFn: function () { return _this.sortAscending.emit(CaseFileViewSortColumns.DOCUMENT_UPLOAD_TIMESTAMP); } },
21924
22170
  ];
21925
22171
  }
21926
22172
  return CaseFileViewFolderSortComponent;
@@ -22004,48 +22250,56 @@
22004
22250
  enumerable: false,
22005
22251
  configurable: true
22006
22252
  });
22007
- DocumentTreeNode.prototype.sortChildrenAscending = function () {
22253
+ DocumentTreeNode.prototype.sortChildrenAscending = function (column, sortOrder) {
22254
+ var _this = this;
22008
22255
  var _a, _b;
22009
22256
  var sortAscending = function () {
22010
22257
  return function (a, b) {
22011
- var nameA = a.name.toUpperCase();
22012
- var nameB = b.name.toUpperCase();
22258
+ var nodeA = _this.getNodeToSort(a, column, sortOrder);
22259
+ var nodeB = _this.getNodeToSort(b, column, sortOrder);
22013
22260
  if (a.type === DocumentTreeNodeType.FOLDER || b.type === DocumentTreeNodeType.FOLDER) {
22014
22261
  return 0;
22015
22262
  }
22016
- if (nameA < nameB) {
22263
+ if (!nodeA || !nodeB) {
22264
+ return 0;
22265
+ }
22266
+ if (nodeA < nodeB) {
22017
22267
  return -1;
22018
22268
  }
22019
- if (nameA > nameB) {
22269
+ if (nodeA > nodeB) {
22020
22270
  return 1;
22021
22271
  }
22022
22272
  };
22023
22273
  };
22024
22274
  (_a = this.children) === null || _a === void 0 ? void 0 : _a.sort(sortAscending());
22025
22275
  (_b = this.children) === null || _b === void 0 ? void 0 : _b.forEach(function (childNodes) {
22026
- childNodes.sortChildrenAscending();
22276
+ childNodes.sortChildrenAscending(column, sortOrder);
22027
22277
  });
22028
22278
  };
22029
- DocumentTreeNode.prototype.sortChildrenDescending = function () {
22279
+ DocumentTreeNode.prototype.sortChildrenDescending = function (column, sortOrder) {
22280
+ var _this = this;
22030
22281
  var _a, _b;
22031
22282
  var sortDescending = function () {
22032
22283
  return function (a, b) {
22033
- var nameA = a.name.toUpperCase();
22034
- var nameB = b.name.toUpperCase();
22284
+ var nodeA = _this.getNodeToSort(a, column, sortOrder);
22285
+ var nodeB = _this.getNodeToSort(b, column, sortOrder);
22035
22286
  if (a.type === DocumentTreeNodeType.FOLDER || b.type === DocumentTreeNodeType.FOLDER) {
22036
22287
  return 0;
22037
22288
  }
22038
- if (nameA > nameB) {
22289
+ if (!nodeA || !nodeB) {
22290
+ return 0;
22291
+ }
22292
+ if (nodeA > nodeB) {
22039
22293
  return -1;
22040
22294
  }
22041
- if (nameA < nameB) {
22295
+ if (nodeA < nodeB) {
22042
22296
  return 1;
22043
22297
  }
22044
22298
  };
22045
22299
  };
22046
22300
  (_a = this.children) === null || _a === void 0 ? void 0 : _a.sort(sortDescending());
22047
22301
  (_b = this.children) === null || _b === void 0 ? void 0 : _b.forEach(function (childNodes) {
22048
- childNodes.sortChildrenDescending();
22302
+ childNodes.sortChildrenDescending(column, sortOrder);
22049
22303
  });
22050
22304
  };
22051
22305
  Object.defineProperty(DocumentTreeNode.prototype, "flattenedAll", {
@@ -22071,6 +22325,24 @@
22071
22325
  enumerable: false,
22072
22326
  configurable: true
22073
22327
  });
22328
+ DocumentTreeNode.prototype.getNodeToSort = function (node, column, sortOrder) {
22329
+ if (column === CaseFileViewSortColumns.DOCUMENT_NAME) {
22330
+ return (node === null || node === void 0 ? void 0 : node.name) ? node.name.toUpperCase()
22331
+ : '';
22332
+ }
22333
+ if (column === CaseFileViewSortColumns.DOCUMENT_UPLOAD_TIMESTAMP) {
22334
+ if (node === null || node === void 0 ? void 0 : node.upload_timestamp) {
22335
+ return new Date(node.upload_timestamp);
22336
+ }
22337
+ if (sortOrder === exports.SortOrder.ASCENDING) {
22338
+ return new Date(9999, 12, 31);
22339
+ }
22340
+ if (sortOrder === exports.SortOrder.DESCENDING) {
22341
+ return new Date(1111, 1, 1);
22342
+ }
22343
+ }
22344
+ return '';
22345
+ };
22074
22346
  return DocumentTreeNode;
22075
22347
  }());
22076
22348
  __decorate([
@@ -22101,10 +22373,14 @@
22101
22373
  i0__namespace.ɵɵelementEnd();
22102
22374
  i0__namespace.ɵɵelementStart(4, "span", 16);
22103
22375
  i0__namespace.ɵɵtext(5);
22376
+ i0__namespace.ɵɵelement(6, "br");
22377
+ i0__namespace.ɵɵelementStart(7, "span", 17);
22378
+ i0__namespace.ɵɵtext(8);
22104
22379
  i0__namespace.ɵɵelementEnd();
22105
- i0__namespace.ɵɵelementStart(6, "div", 17);
22106
- i0__namespace.ɵɵelementStart(7, "ccd-case-file-view-folder-document-actions", 18);
22107
- i0__namespace.ɵɵlistener("changeFolderAction", function CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template_ccd_case_file_view_folder_document_actions_changeFolderAction_7_listener() { i0__namespace.ɵɵrestoreView(_r6_1); var node_r4 = ctx.$implicit; var ctx_r7 = i0__namespace.ɵɵnextContext(2); return ctx_r7.triggerDocumentAction("changeFolder", node_r4); })("openInANewTabAction", function CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template_ccd_case_file_view_folder_document_actions_openInANewTabAction_7_listener() { i0__namespace.ɵɵrestoreView(_r6_1); var node_r4 = ctx.$implicit; var ctx_r8 = i0__namespace.ɵɵnextContext(2); return ctx_r8.triggerDocumentAction("openInANewTab", node_r4); })("downloadAction", function CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template_ccd_case_file_view_folder_document_actions_downloadAction_7_listener() { i0__namespace.ɵɵrestoreView(_r6_1); var node_r4 = ctx.$implicit; var ctx_r9 = i0__namespace.ɵɵnextContext(2); return ctx_r9.triggerDocumentAction("download", node_r4); })("printAction", function CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template_ccd_case_file_view_folder_document_actions_printAction_7_listener() { i0__namespace.ɵɵrestoreView(_r6_1); var node_r4 = ctx.$implicit; var ctx_r10 = i0__namespace.ɵɵnextContext(2); return ctx_r10.triggerDocumentAction("print", node_r4); });
22380
+ i0__namespace.ɵɵelementEnd();
22381
+ i0__namespace.ɵɵelementStart(9, "div", 18);
22382
+ i0__namespace.ɵɵelementStart(10, "ccd-case-file-view-folder-document-actions", 19);
22383
+ i0__namespace.ɵɵlistener("changeFolderAction", function CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template_ccd_case_file_view_folder_document_actions_changeFolderAction_10_listener() { i0__namespace.ɵɵrestoreView(_r6_1); var node_r4 = ctx.$implicit; var ctx_r7 = i0__namespace.ɵɵnextContext(2); return ctx_r7.triggerDocumentAction("changeFolder", node_r4); })("openInANewTabAction", function CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template_ccd_case_file_view_folder_document_actions_openInANewTabAction_10_listener() { i0__namespace.ɵɵrestoreView(_r6_1); var node_r4 = ctx.$implicit; var ctx_r8 = i0__namespace.ɵɵnextContext(2); return ctx_r8.triggerDocumentAction("openInANewTab", node_r4); })("downloadAction", function CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template_ccd_case_file_view_folder_document_actions_downloadAction_10_listener() { i0__namespace.ɵɵrestoreView(_r6_1); var node_r4 = ctx.$implicit; var ctx_r9 = i0__namespace.ɵɵnextContext(2); return ctx_r9.triggerDocumentAction("download", node_r4); })("printAction", function CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template_ccd_case_file_view_folder_document_actions_printAction_10_listener() { i0__namespace.ɵɵrestoreView(_r6_1); var node_r4 = ctx.$implicit; var ctx_r10 = i0__namespace.ɵɵnextContext(2); return ctx_r10.triggerDocumentAction("print", node_r4); });
22108
22384
  i0__namespace.ɵɵelementEnd();
22109
22385
  i0__namespace.ɵɵelementEnd();
22110
22386
  i0__namespace.ɵɵelementEnd();
@@ -22116,27 +22392,29 @@
22116
22392
  i0__namespace.ɵɵadvance(1);
22117
22393
  i0__namespace.ɵɵclassProp("node--selected", (ctx_r2.selectedNodeItem == null ? null : ctx_r2.selectedNodeItem.name) === node_r4.name);
22118
22394
  i0__namespace.ɵɵadvance(4);
22119
- i0__namespace.ɵɵtextInterpolate(node_r4.name);
22395
+ i0__namespace.ɵɵtextInterpolate1(" ", node_r4.name, " ");
22396
+ i0__namespace.ɵɵadvance(3);
22397
+ i0__namespace.ɵɵtextInterpolate(node_r4.upload_timestamp);
22120
22398
  i0__namespace.ɵɵadvance(2);
22121
22399
  i0__namespace.ɵɵproperty("allowMoving", ctx_r2.allowMoving);
22122
22400
  }
22123
22401
  }
22124
22402
  function CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_5_Template(rf, ctx) {
22125
22403
  if (rf & 1) {
22126
- i0__namespace.ɵɵelementStart(0, "cdk-nested-tree-node", 19);
22127
- i0__namespace.ɵɵelementStart(1, "button", 20);
22128
- i0__namespace.ɵɵelementStart(2, "div", 21);
22129
- i0__namespace.ɵɵelement(3, "img", 22);
22130
- i0__namespace.ɵɵelementStart(4, "span", 23);
22404
+ i0__namespace.ɵɵelementStart(0, "cdk-nested-tree-node", 20);
22405
+ i0__namespace.ɵɵelementStart(1, "button", 21);
22406
+ i0__namespace.ɵɵelementStart(2, "div", 22);
22407
+ i0__namespace.ɵɵelement(3, "img", 23);
22408
+ i0__namespace.ɵɵelementStart(4, "span", 24);
22131
22409
  i0__namespace.ɵɵtext(5);
22132
22410
  i0__namespace.ɵɵelementEnd();
22133
22411
  i0__namespace.ɵɵelementEnd();
22134
- i0__namespace.ɵɵelementStart(6, "span", 24);
22412
+ i0__namespace.ɵɵelementStart(6, "span", 25);
22135
22413
  i0__namespace.ɵɵtext(7);
22136
22414
  i0__namespace.ɵɵelementEnd();
22137
22415
  i0__namespace.ɵɵelementEnd();
22138
22416
  i0__namespace.ɵɵelementStart(8, "div");
22139
- i0__namespace.ɵɵelementContainer(9, 25);
22417
+ i0__namespace.ɵɵelementContainer(9, 26);
22140
22418
  i0__namespace.ɵɵelementEnd();
22141
22419
  i0__namespace.ɵɵelementEnd();
22142
22420
  }
@@ -22161,7 +22439,7 @@
22161
22439
  i0__namespace.ɵɵtemplate(1, CaseFileViewFolderComponent_div_8_div_1_Template, 2, 0, "div", 8);
22162
22440
  i0__namespace.ɵɵelementStart(2, "div");
22163
22441
  i0__namespace.ɵɵelementStart(3, "cdk-tree", 9);
22164
- i0__namespace.ɵɵtemplate(4, CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template, 8, 4, "cdk-nested-tree-node", 10);
22442
+ i0__namespace.ɵɵtemplate(4, CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template, 11, 5, "cdk-nested-tree-node", 10);
22165
22443
  i0__namespace.ɵɵtemplate(5, CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_5_Template, 10, 6, "cdk-nested-tree-node", 11);
22166
22444
  i0__namespace.ɵɵelementEnd();
22167
22445
  i0__namespace.ɵɵelementEnd();
@@ -22256,6 +22534,7 @@
22256
22534
  documentTreeNode.document_filename = document.document_filename;
22257
22535
  documentTreeNode.document_binary_url = document.document_binary_url;
22258
22536
  documentTreeNode.attribute_path = document.attribute_path;
22537
+ documentTreeNode.upload_timestamp = document.upload_timestamp ? moment__namespace(document.upload_timestamp).format('DD MMM YYYY') : '';
22259
22538
  documentsToReturn.push(documentTreeNode);
22260
22539
  });
22261
22540
  return documentsToReturn;
@@ -22269,6 +22548,7 @@
22269
22548
  documentTreeNode.document_filename = document.document_filename;
22270
22549
  documentTreeNode.document_binary_url = document.document_binary_url;
22271
22550
  documentTreeNode.attribute_path = document.attribute_path;
22551
+ documentTreeNode.upload_timestamp = document.upload_timestamp ? moment__namespace(document.upload_timestamp).format('DD MMM YYYY') : '';
22272
22552
  documents.push(documentTreeNode);
22273
22553
  });
22274
22554
  var uncategorisedNode = new DocumentTreeNode();
@@ -22323,16 +22603,16 @@
22323
22603
  return;
22324
22604
  }
22325
22605
  };
22326
- CaseFileViewFolderComponent.prototype.sortDataSourceAscAlphabetically = function () {
22606
+ CaseFileViewFolderComponent.prototype.sortDataSourceAscending = function (column) {
22327
22607
  var sortedData = this.nestedDataSource.map(function (item) {
22328
- item.sortChildrenAscending();
22608
+ item.sortChildrenAscending(column, exports.SortOrder.ASCENDING);
22329
22609
  return item;
22330
22610
  });
22331
22611
  this.updateNodeData(sortedData);
22332
22612
  };
22333
- CaseFileViewFolderComponent.prototype.sortDataSourceDescAlphabetically = function () {
22613
+ CaseFileViewFolderComponent.prototype.sortDataSourceDescending = function (column) {
22334
22614
  var sortedData = this.nestedDataSource.map(function (item) {
22335
- item.sortChildrenDescending();
22615
+ item.sortChildrenDescending(column, exports.SortOrder.DESCENDING);
22336
22616
  return item;
22337
22617
  });
22338
22618
  this.updateNodeData(sortedData);
@@ -22393,7 +22673,7 @@
22393
22673
  CaseFileViewFolderComponent.DOCUMENT_SEARCH_FORM_CONTROL_NAME = 'documentSearchFormControl';
22394
22674
  CaseFileViewFolderComponent.MINIMUM_SEARCH_CHARACTERS = 1;
22395
22675
  CaseFileViewFolderComponent.ɵfac = function CaseFileViewFolderComponent_Factory(t) { return new (t || CaseFileViewFolderComponent)(i0__namespace.ɵɵdirectiveInject(WindowService), i0__namespace.ɵɵdirectiveInject(i1__namespace$1.Router), i0__namespace.ɵɵdirectiveInject(DocumentManagementService), i0__namespace.ɵɵdirectiveInject(i1__namespace$3.MatDialog)); };
22396
- CaseFileViewFolderComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CaseFileViewFolderComponent, selectors: [["ccd-case-file-view-folder"]], inputs: { categoriesAndDocuments: "categoriesAndDocuments", allowMoving: "allowMoving" }, outputs: { clickedDocument: "clickedDocument", moveDocument: "moveDocument" }, decls: 9, vars: 3, consts: [[1, "document-filter-container"], [1, "form-group", "document-filter", 3, "formGroup"], ["type", "search", "id", "document-search", "name", "documentSearchFormControl", "formControlName", "documentSearchFormControl", "placeholder", "Search by document name", 1, "form-control", "document-search"], [1, "document-folders-header"], [1, "document-folders-header__title"], [3, "sortAscending", "sortDescending"], ["class", "document-tree-container", 4, "ngIf"], [1, "document-tree-container"], [4, "ngIf"], [3, "dataSource", "treeControl"], ["class", "document-tree-container__node document-tree-container__node--document", 4, "cdkTreeNodeDef"], ["class", "document-tree-container__node document-tree-container__folder", 4, "cdkTreeNodeDef", "cdkTreeNodeDefWhen"], [1, "document-tree-container__node", "document-tree-container__node--document"], [1, "node", 3, "click"], ["disabled", "", 1, "node__icon"], ["src", "/assets/img/case-file-view/case-file-view-document.svg", "alt", "Document icon", 1, "node__iconImg"], [1, "node__name", "node-name-document"], [1, "node__document-options"], [3, "allowMoving", "changeFolderAction", "openInANewTabAction", "downloadAction", "printAction"], [1, "document-tree-container__node", "document-tree-container__folder"], ["cdkTreeNodeToggle", "", 1, "node"], [1, "node__icon"], ["alt", "Folder icon", 1, "node__iconImg", 3, "src"], [1, "node__count"], [1, "node__name", "node__name--folder"], ["cdkTreeNodeOutlet", ""]], template: function CaseFileViewFolderComponent_Template(rf, ctx) {
22676
+ CaseFileViewFolderComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CaseFileViewFolderComponent, selectors: [["ccd-case-file-view-folder"]], inputs: { categoriesAndDocuments: "categoriesAndDocuments", allowMoving: "allowMoving" }, outputs: { clickedDocument: "clickedDocument", moveDocument: "moveDocument" }, decls: 9, vars: 3, consts: [[1, "document-filter-container"], [1, "form-group", "document-filter", 3, "formGroup"], ["type", "search", "id", "document-search", "name", "documentSearchFormControl", "formControlName", "documentSearchFormControl", "placeholder", "Search by document name", 1, "form-control", "document-search"], [1, "document-folders-header"], [1, "document-folders-header__title"], [3, "sortAscending", "sortDescending"], ["class", "document-tree-container", 4, "ngIf"], [1, "document-tree-container"], [4, "ngIf"], [3, "dataSource", "treeControl"], ["class", "document-tree-container__node document-tree-container__node--document", 4, "cdkTreeNodeDef"], ["class", "document-tree-container__node document-tree-container__folder", 4, "cdkTreeNodeDef", "cdkTreeNodeDefWhen"], [1, "document-tree-container__node", "document-tree-container__node--document"], [1, "node", 3, "click"], ["disabled", "", 1, "node__icon"], ["src", "/assets/img/case-file-view/case-file-view-document.svg", "alt", "Document icon", 1, "node__iconImg"], [1, "node__name", "node-name-document"], [1, "node__document-upload-timestamp"], [1, "node__document-options"], [3, "allowMoving", "changeFolderAction", "openInANewTabAction", "downloadAction", "printAction"], [1, "document-tree-container__node", "document-tree-container__folder"], ["cdkTreeNodeToggle", "", 1, "node"], [1, "node__icon"], ["alt", "Folder icon", 1, "node__iconImg", 3, "src"], [1, "node__count"], [1, "node__name", "node__name--folder"], ["cdkTreeNodeOutlet", ""]], template: function CaseFileViewFolderComponent_Template(rf, ctx) {
22397
22677
  if (rf & 1) {
22398
22678
  i0__namespace.ɵɵelementStart(0, "div", 0);
22399
22679
  i0__namespace.ɵɵelementStart(1, "div", 1);
@@ -22406,7 +22686,7 @@
22406
22686
  i0__namespace.ɵɵelementEnd();
22407
22687
  i0__namespace.ɵɵelementStart(6, "div");
22408
22688
  i0__namespace.ɵɵelementStart(7, "ccd-case-file-view-folder-sort", 5);
22409
- i0__namespace.ɵɵlistener("sortAscending", function CaseFileViewFolderComponent_Template_ccd_case_file_view_folder_sort_sortAscending_7_listener() { return ctx.sortDataSourceAscAlphabetically(); })("sortDescending", function CaseFileViewFolderComponent_Template_ccd_case_file_view_folder_sort_sortDescending_7_listener() { return ctx.sortDataSourceDescAlphabetically(); });
22689
+ i0__namespace.ɵɵlistener("sortAscending", function CaseFileViewFolderComponent_Template_ccd_case_file_view_folder_sort_sortAscending_7_listener($event) { return ctx.sortDataSourceAscending($event); })("sortDescending", function CaseFileViewFolderComponent_Template_ccd_case_file_view_folder_sort_sortDescending_7_listener($event) { return ctx.sortDataSourceDescending($event); });
22410
22690
  i0__namespace.ɵɵelementEnd();
22411
22691
  i0__namespace.ɵɵelementEnd();
22412
22692
  i0__namespace.ɵɵelementEnd();
@@ -22420,7 +22700,7 @@
22420
22700
  i0__namespace.ɵɵadvance(3);
22421
22701
  i0__namespace.ɵɵproperty("ngIf", ctx.documentTreeData);
22422
22702
  }
22423
- }, directives: [i2__namespace$1.NgControlStatusGroup, i2__namespace$1.FormGroupDirective, i2__namespace$1.DefaultValueAccessor, i2__namespace$1.NgControlStatus, i2__namespace$1.FormControlName, CaseFileViewFolderSortComponent, i2__namespace.NgIf, i7__namespace.CdkTree, i7__namespace.CdkTreeNodeDef, i7__namespace.CdkNestedTreeNode, CaseFileViewFolderDocumentActionsComponent, i7__namespace.CdkTreeNodeToggle, i7__namespace.CdkTreeNodeOutlet], styles: ["[_nghost-%COMP%]{display:flex;height:100%;flex-direction:column}[_nghost-%COMP%] .document-tree-container[_ngcontent-%COMP%]{flex:1 0}.document-filter-container[_ngcontent-%COMP%]{border-bottom:2px solid #c9c9c9}.document-filter-container[_ngcontent-%COMP%] .document-filter[_ngcontent-%COMP%]{padding:10px}.document-filter-container[_ngcontent-%COMP%] .document-filter[_ngcontent-%COMP%] .document-search[_ngcontent-%COMP%]{background:url(/assets/images/icon-search-black.svg) no-repeat 100% #fff;background-position-x:calc(100% - 4px);padding-right:30px;width:100%}.document-filter-container[_ngcontent-%COMP%] .documents-title[_ngcontent-%COMP%]{height:30%;margin-left:8px;font-weight:700}.document-tree-container[_ngcontent-%COMP%]{padding:4px;overflow-x:hidden;overflow-y:scroll}.document-tree-container__node[_ngcontent-%COMP%]{display:block}.document-tree-container__node[_ngcontent-%COMP%] .document-tree-container__node[_ngcontent-%COMP%]{padding-left:40px}.document-tree-container[_ngcontent-%COMP%] .document-tree-invisible[_ngcontent-%COMP%]{display:none}.document-tree-container[_ngcontent-%COMP%]::-webkit-scrollbar{width:7px}.document-tree-container[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border:4px solid transparent;background-clip:padding-box;border-radius:9999px;background-color:#aaa}.document-tree-container[_ngcontent-%COMP%]::-webkit-scrollbar-button{display:none}.document-tree-container[_ngcontent-%COMP%]::-webkit-scrollbar-track-piece{background:#eee}.document-tree-container[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#ccc}.document-folders-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;border-bottom:2px solid #c9c9c9;padding:10px}.document-folders-header__title[_ngcontent-%COMP%]{font-weight:700}.node[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;padding:6px;background:none;border:0;cursor:pointer;white-space:nowrap}.node--selected[_ngcontent-%COMP%]{background:#fff2cc}.node__icon[_ngcontent-%COMP%]{position:relative;display:inline-block}.node__count[_ngcontent-%COMP%]{color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:.875rem;padding-top:4px}.node__iconImg[_ngcontent-%COMP%]{display:block;height:30px;width:30px}.node__name[_ngcontent-%COMP%]{margin-left:6px;font-size:1rem;overflow:hidden;text-overflow:ellipsis}.node__document-options[_ngcontent-%COMP%]{margin-left:auto;margin-right:0}"] });
22703
+ }, directives: [i2__namespace$1.NgControlStatusGroup, i2__namespace$1.FormGroupDirective, i2__namespace$1.DefaultValueAccessor, i2__namespace$1.NgControlStatus, i2__namespace$1.FormControlName, CaseFileViewFolderSortComponent, i2__namespace.NgIf, i7__namespace.CdkTree, i7__namespace.CdkTreeNodeDef, i7__namespace.CdkNestedTreeNode, CaseFileViewFolderDocumentActionsComponent, i7__namespace.CdkTreeNodeToggle, i7__namespace.CdkTreeNodeOutlet], styles: ["[_nghost-%COMP%]{display:flex;height:100%;flex-direction:column}[_nghost-%COMP%] .document-tree-container[_ngcontent-%COMP%]{flex:1 0}.document-filter-container[_ngcontent-%COMP%]{border-bottom:2px solid #c9c9c9}.document-filter-container[_ngcontent-%COMP%] .document-filter[_ngcontent-%COMP%]{padding:10px}.document-filter-container[_ngcontent-%COMP%] .document-filter[_ngcontent-%COMP%] .document-search[_ngcontent-%COMP%]{background:url(/assets/images/icon-search-black.svg) no-repeat 100% #fff;background-position-x:calc(100% - 4px);padding-right:30px;width:100%}.document-filter-container[_ngcontent-%COMP%] .documents-title[_ngcontent-%COMP%]{height:30%;margin-left:8px;font-weight:700}.document-tree-container[_ngcontent-%COMP%]{padding:4px;overflow-x:hidden;overflow-y:scroll}.document-tree-container__node[_ngcontent-%COMP%]{display:block}.document-tree-container__node[_ngcontent-%COMP%] .document-tree-container__node[_ngcontent-%COMP%]{padding-left:40px}.document-tree-container[_ngcontent-%COMP%] .document-tree-invisible[_ngcontent-%COMP%]{display:none}.document-tree-container[_ngcontent-%COMP%]::-webkit-scrollbar{width:7px}.document-tree-container[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border:4px solid transparent;background-clip:padding-box;border-radius:9999px;background-color:#aaa}.document-tree-container[_ngcontent-%COMP%]::-webkit-scrollbar-button{display:none}.document-tree-container[_ngcontent-%COMP%]::-webkit-scrollbar-track-piece{background:#eee}.document-tree-container[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#ccc}.document-folders-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;border-bottom:2px solid #c9c9c9;padding:10px}.document-folders-header__title[_ngcontent-%COMP%]{font-weight:700}.node[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;padding:10px;background:none;border:0;cursor:pointer;white-space:nowrap}.node--selected[_ngcontent-%COMP%]{background:#fff2cc}.node__icon[_ngcontent-%COMP%]{position:relative;display:inline-block}.node__count[_ngcontent-%COMP%]{color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:.875rem;padding-top:4px}.node__iconImg[_ngcontent-%COMP%]{display:block;height:30px;width:30px}.node__name[_ngcontent-%COMP%]{margin-left:6px;font-size:1rem;overflow:hidden;text-overflow:ellipsis}.node__document-options[_ngcontent-%COMP%]{margin-left:auto;margin-right:0}.node__document-upload-timestamp[_ngcontent-%COMP%]{font-size:.8rem;float:left;padding-left:10px}"] });
22424
22704
  (function () {
22425
22705
  (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(CaseFileViewFolderComponent, [{
22426
22706
  type: i0.Component,
@@ -24335,13 +24615,6 @@
24335
24615
  }] });
24336
24616
  })();
24337
24617
 
24338
- var SortOrder;
24339
- (function (SortOrder) {
24340
- SortOrder[SortOrder["ASCENDING"] = 0] = "ASCENDING";
24341
- SortOrder[SortOrder["DESCENDING"] = 1] = "DESCENDING";
24342
- SortOrder[SortOrder["UNSORTED"] = 2] = "UNSORTED";
24343
- })(SortOrder || (SortOrder = {}));
24344
-
24345
24618
  function ReadComplexFieldCollectionTableComponent_th_10_Template(rf, ctx) {
24346
24619
  if (rf & 1) {
24347
24620
  var _r4_1 = i0__namespace.ɵɵgetCurrentView();
@@ -24615,7 +24888,7 @@
24615
24888
  return _this;
24616
24889
  }
24617
24890
  ReadComplexFieldCollectionTableComponent.isSortAscending = function (column) {
24618
- return !(column.sortOrder === SortOrder.UNSORTED || column.sortOrder === SortOrder.DESCENDING);
24891
+ return !(column.sortOrder === exports.SortOrder.UNSORTED || column.sortOrder === exports.SortOrder.DESCENDING);
24619
24892
  };
24620
24893
  ReadComplexFieldCollectionTableComponent.prototype.ngOnInit = function () {
24621
24894
  _super.prototype.ngOnInit.call(this);
@@ -24673,19 +24946,19 @@
24673
24946
  });
24674
24947
  };
24675
24948
  ReadComplexFieldCollectionTableComponent.prototype.sortRowsByColumns = function (column) {
24676
- var shouldSortInAscendingOrder = this.columnsHorizontalLabel[column].sortOrder === SortOrder.UNSORTED
24677
- || this.columnsHorizontalLabel[column].sortOrder === SortOrder.DESCENDING;
24949
+ var shouldSortInAscendingOrder = this.columnsHorizontalLabel[column].sortOrder === exports.SortOrder.UNSORTED
24950
+ || this.columnsHorizontalLabel[column].sortOrder === exports.SortOrder.DESCENDING;
24678
24951
  // tslint:disable-next-line:switch-default
24679
24952
  switch (this.columnsHorizontalLabel[column].type.type) {
24680
24953
  case 'Number':
24681
24954
  case 'MoneyGBP': {
24682
24955
  if (shouldSortInAscendingOrder) {
24683
24956
  this.rows.sort(function (a, b) { return a[column] - b[column]; });
24684
- this.columnsHorizontalLabel[column].sortOrder = SortOrder.ASCENDING;
24957
+ this.columnsHorizontalLabel[column].sortOrder = exports.SortOrder.ASCENDING;
24685
24958
  }
24686
24959
  else {
24687
24960
  this.rows.sort(function (a, b) { return b[column] - a[column]; });
24688
- this.columnsHorizontalLabel[column].sortOrder = SortOrder.DESCENDING;
24961
+ this.columnsHorizontalLabel[column].sortOrder = exports.SortOrder.DESCENDING;
24689
24962
  }
24690
24963
  break;
24691
24964
  }
@@ -24702,11 +24975,11 @@
24702
24975
  {
24703
24976
  if (shouldSortInAscendingOrder) {
24704
24977
  this.rows.sort(function (a, b) { return a[column] < b[column] ? -1 : a[column] > b[column] ? 1 : 0; });
24705
- this.columnsHorizontalLabel[column].sortOrder = SortOrder.ASCENDING;
24978
+ this.columnsHorizontalLabel[column].sortOrder = exports.SortOrder.ASCENDING;
24706
24979
  }
24707
24980
  else {
24708
24981
  this.rows.sort(function (a, b) { return a[column] < b[column] ? 1 : a[column] > b[column] ? -1 : 0; });
24709
- this.columnsHorizontalLabel[column].sortOrder = SortOrder.DESCENDING;
24982
+ this.columnsHorizontalLabel[column].sortOrder = exports.SortOrder.DESCENDING;
24710
24983
  }
24711
24984
  }
24712
24985
  break;
@@ -24722,7 +24995,7 @@
24722
24995
  var id = _c.value;
24723
24996
  var trimmedId = id.trim();
24724
24997
  labelsHorizontal[trimmedId] = allLabels[trimmedId];
24725
- labelsHorizontal[trimmedId].sortOrder = SortOrder.UNSORTED;
24998
+ labelsHorizontal[trimmedId].sortOrder = exports.SortOrder.UNSORTED;
24726
24999
  delete labelsVertical[trimmedId];
24727
25000
  }
24728
25001
  }
@@ -26641,7 +26914,7 @@
26641
26914
  }
26642
26915
  return searchResults.sort(function (a, b) {
26643
26916
  return sortParameters.comparator.compare(a, b)
26644
- * (sortParameters.sortOrder === SortOrder.DESCENDING ? 1 : -1);
26917
+ * (sortParameters.sortOrder === exports.SortOrder.DESCENDING ? 1 : -1);
26645
26918
  });
26646
26919
  };
26647
26920
  return SortSearchResultPipe;
@@ -29820,6 +30093,7 @@
29820
30093
  });
29821
30094
  };
29822
30095
  WorkbasketFiltersComponent.prototype.apply = function (init) {
30096
+ var _this = this;
29823
30097
  // Save filters as query parameters for current route
29824
30098
  var queryParams = {};
29825
30099
  if (this.selected.jurisdiction) {
@@ -29851,9 +30125,20 @@
29851
30125
  if (init) {
29852
30126
  this.windowService.setLocalStorage(SAVED_QUERY_PARAM_LOC_STORAGE, JSON.stringify(queryParams));
29853
30127
  if (Object.keys(this.formGroup.controls).length > 0) {
30128
+ // Find all "special case" JudicialUser FormControl keys and remove the corresponding values from the
30129
+ // FormGroup value because these values are not intended to be stored and subsequently passed as query string
30130
+ // parameters when calling searchCases API endpoint
30131
+ var judicialUserControlValuesToRemove = Object.keys(this.formGroup.controls).filter(function (key) { return key.endsWith('_judicialUserControl'); });
30132
+ judicialUserControlValuesToRemove.forEach(function (controlKey) { return delete _this.formGroup.value[controlKey]; });
29854
30133
  this.windowService.setLocalStorage(FORM_GROUP_VAL_LOC_STORAGE, JSON.stringify(this.formGroup.value));
29855
30134
  }
29856
30135
  }
30136
+ // Announce selected jurisdiction via JurisdictionService
30137
+ if (this.selected.jurisdiction) {
30138
+ // Set the selected case type as the current case type of the selected jurisdiction
30139
+ this.selected.jurisdiction.currentCaseType = this.selected.caseType;
30140
+ this.jurisdictionService.announceSelectedJurisdiction(this.selected.jurisdiction);
30141
+ }
29857
30142
  // Apply filters
29858
30143
  this.onApply.emit({ selected: this.selected, queryParams: queryParams });
29859
30144
  this.setFocusToTop();