@hmcts/ccd-case-ui-toolkit 7.0.22-upload-timestamp → 7.0.22

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.
@@ -13460,7 +13460,7 @@ class ReadComplexFieldComponent extends AbstractFieldReadComponent {
13460
13460
  this.paletteContext = PaletteContext;
13461
13461
  }
13462
13462
  ngOnInit() {
13463
- var _a, _b, _c;
13463
+ var _a, _b, _c, _d;
13464
13464
  super.ngOnInit();
13465
13465
  if (this.caseField.display_context_parameter) {
13466
13466
  this.context = PaletteContext.TABLE_VIEW;
@@ -13471,18 +13471,20 @@ class ReadComplexFieldComponent extends AbstractFieldReadComponent {
13471
13471
  this.context = PaletteContext.DEFAULT;
13472
13472
  }
13473
13473
  }
13474
- (_c = (_b = (_a = this.caseField) === null || _a === void 0 ? void 0 : _a.field_type) === null || _b === void 0 ? void 0 : _b.complex_fields) === null || _c === void 0 ? void 0 : _c.forEach((field) => {
13475
- var _a, _b, _c;
13476
- if (field === null || field === void 0 ? void 0 : field.isDynamic()) {
13477
- field.list_items = (_a = this.caseField.value[field.id]) === null || _a === void 0 ? void 0 : _a.list_items;
13478
- field.value = {
13479
- list_items: field.list_items,
13480
- value: ((_b = this.caseField.value[field.id]) === null || _b === void 0 ? void 0 : _b.value) && this.caseField.value[field.id].value.code ?
13481
- this.caseField.value[field.id].value.code :
13482
- (_c = this.caseField.value[field.id]) === null || _c === void 0 ? void 0 : _c.value
13483
- };
13484
- }
13485
- });
13474
+ if (((_a = this.caseField) === null || _a === void 0 ? void 0 : _a.field_type) && this.caseField.field_type.complex_fields) {
13475
+ (_d = (_c = (_b = this.caseField) === null || _b === void 0 ? void 0 : _b.field_type) === null || _c === void 0 ? void 0 : _c.complex_fields) === null || _d === void 0 ? void 0 : _d.forEach((field) => {
13476
+ var _a, _b, _c;
13477
+ if (field === null || field === void 0 ? void 0 : field.isDynamic()) {
13478
+ field.list_items = (_a = this.caseField.value[field.id]) === null || _a === void 0 ? void 0 : _a.list_items;
13479
+ field.value = {
13480
+ list_items: field.list_items,
13481
+ value: ((_b = this.caseField.value[field.id]) === null || _b === void 0 ? void 0 : _b.value) && this.caseField.value[field.id].value.code ?
13482
+ this.caseField.value[field.id].value.code :
13483
+ (_c = this.caseField.value[field.id]) === null || _c === void 0 ? void 0 : _c.value
13484
+ };
13485
+ }
13486
+ });
13487
+ }
13486
13488
  }
13487
13489
  }
13488
13490
  ReadComplexFieldComponent.ɵfac = /*@__PURE__*/ function () { let ɵReadComplexFieldComponent_BaseFactory; return function ReadComplexFieldComponent_Factory(t) { return (ɵReadComplexFieldComponent_BaseFactory || (ɵReadComplexFieldComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ReadComplexFieldComponent)))(t || ReadComplexFieldComponent); }; }();
@@ -14224,9 +14226,6 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
14224
14226
  if (documentHash) {
14225
14227
  this.uploadedDocument.get(WriteDocumentFieldComponent.DOCUMENT_HASH).setValue(documentHash);
14226
14228
  }
14227
- if (this.uploadedDocument.get(WriteDocumentFieldComponent.UPLOAD_TIMESTAMP)) {
14228
- this.uploadedDocument.removeControl(WriteDocumentFieldComponent.UPLOAD_TIMESTAMP);
14229
- }
14230
14229
  }
14231
14230
  createDocumentFormWithValidator(document) {
14232
14231
  let documentFormGroup = {
@@ -14234,9 +14233,6 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
14234
14233
  document_binary_url: new FormControl(document.document_binary_url, Validators.required),
14235
14234
  document_filename: new FormControl(document.document_filename, Validators.required)
14236
14235
  };
14237
- if (document.upload_timestamp && (typeof document.upload_timestamp === 'string')) {
14238
- documentFormGroup = Object.assign(Object.assign({}, documentFormGroup), { upload_timestamp: new FormControl(document.upload_timestamp) });
14239
- }
14240
14236
  documentFormGroup = this.secureModeOn ? Object.assign(Object.assign({}, documentFormGroup), { document_hash: new FormControl(document.document_hash) }) : documentFormGroup;
14241
14237
  this.uploadedDocument = this.registerControl(new FormGroup(documentFormGroup), true);
14242
14238
  }
@@ -14246,9 +14242,6 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
14246
14242
  document_binary_url: new FormControl(document.document_binary_url),
14247
14243
  document_filename: new FormControl(document.document_filename)
14248
14244
  };
14249
- if (document.upload_timestamp && (typeof document.upload_timestamp === 'string')) {
14250
- documentFormGroup = Object.assign(Object.assign({}, documentFormGroup), { upload_timestamp: new FormControl(document.upload_timestamp) });
14251
- }
14252
14245
  documentFormGroup = this.secureModeOn ? Object.assign(Object.assign({}, documentFormGroup), { document_hash: new FormControl(document.document_hash) }) : documentFormGroup;
14253
14246
  this.uploadedDocument = this.registerControl(new FormGroup(documentFormGroup), true);
14254
14247
  }
@@ -14321,7 +14314,6 @@ WriteDocumentFieldComponent.DOCUMENT_URL = 'document_url';
14321
14314
  WriteDocumentFieldComponent.DOCUMENT_BINARY_URL = 'document_binary_url';
14322
14315
  WriteDocumentFieldComponent.DOCUMENT_FILENAME = 'document_filename';
14323
14316
  WriteDocumentFieldComponent.DOCUMENT_HASH = 'document_hash';
14324
- WriteDocumentFieldComponent.UPLOAD_TIMESTAMP = 'upload_timestamp';
14325
14317
  WriteDocumentFieldComponent.UPLOAD_ERROR_FILE_REQUIRED = 'File required';
14326
14318
  WriteDocumentFieldComponent.UPLOAD_ERROR_NOT_AVAILABLE = 'Document upload facility is not available at the moment';
14327
14319
  WriteDocumentFieldComponent.UPLOAD_WAITING_FILE_STATUS = 'Uploading...';
@@ -14395,7 +14387,7 @@ WriteDocumentFieldComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type:
14395
14387
 
14396
14388
  class DynamicListPipe {
14397
14389
  transform(value, items) {
14398
- const item = items.find(i => i.code === value);
14390
+ const item = items === null || items === void 0 ? void 0 : items.find(i => i.code === value);
14399
14391
  return item ? item.label : DynamicListPipe.EMPTY;
14400
14392
  }
14401
14393
  }
@@ -32225,29 +32217,29 @@ function CaseHistoryComponent_div_0_Template(rf, ctx) {
32225
32217
  i0.ɵɵadvance(6);
32226
32218
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(15, 19, "Date"));
32227
32219
  i0.ɵɵadvance(3);
32228
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(18, 21, ctx_r0.caseHistory.event.timestamp));
32220
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(18, 21, ctx_r0.caseHistory.event.timestamp, "local"));
32229
32221
  i0.ɵɵadvance(4);
32230
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(22, 23, "Author"));
32222
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(22, 24, "Author"));
32231
32223
  i0.ɵɵadvance(3);
32232
- i0.ɵɵtextInterpolate2("", i0.ɵɵpipeBind1(25, 25, ctx_r0.caseHistory.event.user_first_name), " ", i0.ɵɵpipeBind1(26, 27, ctx_r0.caseHistory.event.user_last_name), "");
32224
+ i0.ɵɵtextInterpolate2("", i0.ɵɵpipeBind1(25, 26, ctx_r0.caseHistory.event.user_first_name), " ", i0.ɵɵpipeBind1(26, 28, ctx_r0.caseHistory.event.user_last_name), "");
32233
32225
  i0.ɵɵadvance(5);
32234
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(30, 29, "End state"));
32226
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(30, 30, "End state"));
32235
32227
  i0.ɵɵadvance(3);
32236
32228
  i0.ɵɵtextInterpolate(ctx_r0.caseHistory.event.state_name);
32237
32229
  i0.ɵɵadvance(3);
32238
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(36, 31, "Event"));
32230
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(36, 32, "Event"));
32239
32231
  i0.ɵɵadvance(3);
32240
32232
  i0.ɵɵtextInterpolate(ctx_r0.caseHistory.event.event_name);
32241
32233
  i0.ɵɵadvance(3);
32242
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(42, 33, "Summary"));
32234
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(42, 34, "Summary"));
32243
32235
  i0.ɵɵadvance(3);
32244
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(45, 35, ctx_r0.caseHistory.event.summary));
32236
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(45, 36, ctx_r0.caseHistory.event.summary));
32245
32237
  i0.ɵɵadvance(4);
32246
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(49, 37, "Comment"));
32238
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(49, 38, "Comment"));
32247
32239
  i0.ɵɵadvance(3);
32248
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(52, 39, ctx_r0.caseHistory.event.comment));
32240
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(52, 40, ctx_r0.caseHistory.event.comment));
32249
32241
  i0.ɵɵadvance(4);
32250
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(56, 41, "Case Details"));
32242
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(56, 42, "Case Details"));
32251
32243
  i0.ɵɵadvance(2);
32252
32244
  i0.ɵɵproperty("ngForOf", ctx_r0.tabs);
32253
32245
  }
@@ -32303,7 +32295,7 @@ CaseHistoryComponent.ERROR_MESSAGE = 'No case history to show';
32303
32295
  CaseHistoryComponent.ɵfac = function CaseHistoryComponent_Factory(t) { return new (t || CaseHistoryComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(CaseHistoryService)); };
32304
32296
  CaseHistoryComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseHistoryComponent, selectors: [["ccd-case-history"]], inputs: { event: "event" }, decls: 1, vars: 1, consts: [[4, "ngIf"], [1, "grid-row"], [1, "column-full"], [3, "caseDetails"], [1, "heading-h2"], ["aria-describedby", "event details table", 1, "EventDetails"], [4, "ngFor", "ngForOf"], [1, "caseHistorySection"], [1, "heading-h3"], [1, "CaseHistory", 3, "id"], ["ccdLabelSubstitutor", "", 3, "caseField", "contextFields", "hidden"], [3, "ngSwitch"], [4, "ngSwitchCase"], ["class", "compound-field", 4, "ngSwitchCase"], ["id", "case-viewer-label-header"], [1, "case-viewer-label"], [3, "caseField", "caseReference"], [1, "compound-field"], ["colspan", "2"]], template: function CaseHistoryComponent_Template(rf, ctx) {
32305
32297
  if (rf & 1) {
32306
- i0.ɵɵtemplate(0, CaseHistoryComponent_div_0_Template, 58, 43, "div", 0);
32298
+ i0.ɵɵtemplate(0, CaseHistoryComponent_div_0_Template, 58, 44, "div", 0);
32307
32299
  }
32308
32300
  if (rf & 2) {
32309
32301
  i0.ɵɵproperty("ngIf", ctx.isDataLoaded());
@@ -32312,7 +32304,7 @@ CaseHistoryComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseHi
32312
32304
  (function () {
32313
32305
  (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseHistoryComponent, [{
32314
32306
  type: Component,
32315
- args: [{ selector: 'ccd-case-history', template: "<div *ngIf=\"isDataLoaded()\">\n <div class=\"grid-row\">\n <div class=\"column-full\">\n <ccd-case-header [caseDetails]=\"caseDetails\"></ccd-case-header>\n </div>\n </div>\n <div class=\"grid-row\">\n <div class=\"column-full\">\n <div>\n <h2 class=\"heading-h2\">{{'Event Details' | rpxTranslate}}</h2>\n <table class=\"EventDetails\" aria-describedby=\"event details table\">\n <tbody>\n <tr>\n <th>{{'Date' | rpxTranslate}}</th>\n <td>{{caseHistory.event.timestamp | ccdDate}}</td>\n </tr>\n <tr>\n <th>{{'Author' | rpxTranslate}}</th>\n <td>{{caseHistory.event.user_first_name | titlecase}} {{caseHistory.event.user_last_name | uppercase}}</td>\n </tr>\n <tr>\n <th>{{'End state' | rpxTranslate}}</th>\n <td>{{caseHistory.event.state_name}}</td>\n </tr>\n <tr>\n <th>{{'Event' | rpxTranslate}}</th>\n <td>{{caseHistory.event.event_name}}</td>\n </tr>\n <tr>\n <th>{{'Summary' | rpxTranslate}}</th>\n <td>{{caseHistory.event.summary | ccdDash}}</td>\n </tr>\n <tr>\n <th>{{'Comment' | rpxTranslate}}</th>\n <td>{{caseHistory.event.comment | ccdDash}}</td>\n </tr>\n </tbody>\n </table>\n </div>\n <div>\n <h2 class=\"heading-h2\">{{'Case Details' | rpxTranslate}}</h2>\n <ng-container *ngFor=\"let tab of tabs\">\n <div class=\"caseHistorySection\">\n <h3 class=\"heading-h3\">{{tab.label}}</h3>\n <table class=\"CaseHistory\" id=\"{{tab.id}}\" [attr.aria-describedby]=\"'case history table' | rpxTranslate\">\n <ng-container *ngFor=\"let field of tab | ccdTabFields | ccdReadFieldsFilter:false :undefined :true\">\n <div ccdLabelSubstitutor [caseField]=\"field\" [contextFields]=\"tab.fields\" [hidden]=\"field.hidden\">\n <ng-container [ngSwitch]=\"!(field | ccdIsCompound)\">\n <tr *ngSwitchCase=\"true\">\n <th id=\"case-viewer-label-header\">\n <div class=\"case-viewer-label\">{{field.label}}</div>\n </th>\n <td>\n <ccd-field-read [caseField]=\"field\" [caseReference]=\"caseHistory.case_id\"></ccd-field-read>\n </td>\n </tr>\n <tr *ngSwitchCase=\"false\" class=\"compound-field\">\n <td colspan=\"2\">\n <ccd-field-read [caseField]=\"field\" [caseReference]=\"caseHistory.case_id\"></ccd-field-read>\n </td>\n </tr>\n </ng-container>\n </div>\n </ng-container>\n </table>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n</div>\n", styles: [".CaseHistory th,.CaseHistory td{border-bottom:none}.caseHistorySection{margin-top:40px}.EventDetails th,.EventDetails td{border-bottom:none}th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}.case-viewer-controls{margin-top:47px;margin-bottom:20px}ccd-case-header{float:left;margin-right:10px}ccd-event-trigger{float:right}.case-viewer-label{min-width:300px;white-space:normal}\n"] }]
32307
+ args: [{ selector: 'ccd-case-history', template: "<div *ngIf=\"isDataLoaded()\">\n <div class=\"grid-row\">\n <div class=\"column-full\">\n <ccd-case-header [caseDetails]=\"caseDetails\"></ccd-case-header>\n </div>\n </div>\n <div class=\"grid-row\">\n <div class=\"column-full\">\n <div>\n <h2 class=\"heading-h2\">{{'Event Details' | rpxTranslate}}</h2>\n <table class=\"EventDetails\" aria-describedby=\"event details table\">\n <tbody>\n <tr>\n <th>{{'Date' | rpxTranslate}}</th>\n <td>{{caseHistory.event.timestamp | ccdDate : 'local'}}</td>\n </tr>\n <tr>\n <th>{{'Author' | rpxTranslate}}</th>\n <td>{{caseHistory.event.user_first_name | titlecase}} {{caseHistory.event.user_last_name | uppercase}}</td>\n </tr>\n <tr>\n <th>{{'End state' | rpxTranslate}}</th>\n <td>{{caseHistory.event.state_name}}</td>\n </tr>\n <tr>\n <th>{{'Event' | rpxTranslate}}</th>\n <td>{{caseHistory.event.event_name}}</td>\n </tr>\n <tr>\n <th>{{'Summary' | rpxTranslate}}</th>\n <td>{{caseHistory.event.summary | ccdDash}}</td>\n </tr>\n <tr>\n <th>{{'Comment' | rpxTranslate}}</th>\n <td>{{caseHistory.event.comment | ccdDash}}</td>\n </tr>\n </tbody>\n </table>\n </div>\n <div>\n <h2 class=\"heading-h2\">{{'Case Details' | rpxTranslate}}</h2>\n <ng-container *ngFor=\"let tab of tabs\">\n <div class=\"caseHistorySection\">\n <h3 class=\"heading-h3\">{{tab.label}}</h3>\n <table class=\"CaseHistory\" id=\"{{tab.id}}\" [attr.aria-describedby]=\"'case history table' | rpxTranslate\">\n <ng-container *ngFor=\"let field of tab | ccdTabFields | ccdReadFieldsFilter:false :undefined :true\">\n <div ccdLabelSubstitutor [caseField]=\"field\" [contextFields]=\"tab.fields\" [hidden]=\"field.hidden\">\n <ng-container [ngSwitch]=\"!(field | ccdIsCompound)\">\n <tr *ngSwitchCase=\"true\">\n <th id=\"case-viewer-label-header\">\n <div class=\"case-viewer-label\">{{field.label}}</div>\n </th>\n <td>\n <ccd-field-read [caseField]=\"field\" [caseReference]=\"caseHistory.case_id\"></ccd-field-read>\n </td>\n </tr>\n <tr *ngSwitchCase=\"false\" class=\"compound-field\">\n <td colspan=\"2\">\n <ccd-field-read [caseField]=\"field\" [caseReference]=\"caseHistory.case_id\"></ccd-field-read>\n </td>\n </tr>\n </ng-container>\n </div>\n </ng-container>\n </table>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n</div>\n", styles: [".CaseHistory th,.CaseHistory td{border-bottom:none}.caseHistorySection{margin-top:40px}.EventDetails th,.EventDetails td{border-bottom:none}th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}.case-viewer-controls{margin-top:47px;margin-bottom:20px}ccd-case-header{float:left;margin-right:10px}ccd-event-trigger{float:right}.case-viewer-label{min-width:300px;white-space:normal}\n"] }]
32316
32308
  }], function () { return [{ type: i1$1.ActivatedRoute }, { type: AlertService }, { type: OrderService }, { type: CaseNotifier }, { type: CaseHistoryService }]; }, { event: [{
32317
32309
  type: Input
32318
32310
  }] });