@hmcts/ccd-case-ui-toolkit 5.0.25-case-file-view-move-document → 5.0.25-case-file-view-move-document-beta2

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 (30) hide show
  1. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js +183 -20
  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/palette/case-file-view/case-file-view-field-read.component.js +72 -0
  6. package/esm2015/lib/shared/components/palette/case-file-view/case-file-view-field.component.js +12 -8
  7. package/esm2015/lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder-document-actions/case-file-view-folder-document-actions.component.js +11 -5
  8. package/esm2015/lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder.component.js +7 -3
  9. package/esm2015/lib/shared/components/palette/case-file-view/components/case-file-view-folder-selector/case-file-view-folder-selector.component.js +35 -3
  10. package/esm2015/lib/shared/components/palette/case-file-view/index.js +2 -1
  11. package/esm2015/lib/shared/components/palette/palette.module.js +14 -5
  12. package/esm2015/lib/shared/components/palette/palette.service.js +6 -5
  13. package/fesm2015/hmcts-ccd-case-ui-toolkit.js +143 -21
  14. package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
  15. package/lib/shared/components/palette/case-file-view/case-file-view-field-read.component.d.ts +8 -0
  16. package/lib/shared/components/palette/case-file-view/case-file-view-field-read.component.d.ts.map +1 -0
  17. package/lib/shared/components/palette/case-file-view/case-file-view-field.component.d.ts +4 -2
  18. package/lib/shared/components/palette/case-file-view/case-file-view-field.component.d.ts.map +1 -1
  19. package/lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder-document-actions/case-file-view-folder-document-actions.component.d.ts +5 -3
  20. package/lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder-document-actions/case-file-view-folder-document-actions.component.d.ts.map +1 -1
  21. package/lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder.component.d.ts +2 -1
  22. package/lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder.component.d.ts.map +1 -1
  23. package/lib/shared/components/palette/case-file-view/components/case-file-view-folder-selector/case-file-view-folder-selector.component.d.ts +5 -1
  24. package/lib/shared/components/palette/case-file-view/components/case-file-view-folder-selector/case-file-view-folder-selector.component.d.ts.map +1 -1
  25. package/lib/shared/components/palette/case-file-view/index.d.ts +1 -0
  26. package/lib/shared/components/palette/case-file-view/index.d.ts.map +1 -1
  27. package/lib/shared/components/palette/palette.module.d.ts +32 -30
  28. package/lib/shared/components/palette/palette.module.d.ts.map +1 -1
  29. package/lib/shared/components/palette/palette.service.d.ts.map +1 -1
  30. package/package.json +1 -1
@@ -11661,17 +11661,19 @@
11661
11661
  if (rf & 2) {
11662
11662
  var ctx_r1 = i0__namespace.ɵɵnextContext();
11663
11663
  i0__namespace.ɵɵadvance(5);
11664
- i0__namespace.ɵɵproperty("categoriesAndDocuments", ctx_r1.categoriesAndDocuments$);
11664
+ i0__namespace.ɵɵproperty("categoriesAndDocuments", ctx_r1.categoriesAndDocuments$)("allowMoving", ctx_r1.allowMoving);
11665
11665
  i0__namespace.ɵɵadvance(3);
11666
11666
  i0__namespace.ɵɵproperty("ngIf", ctx_r1.currentDocument);
11667
11667
  }
11668
11668
  }
11669
11669
  var CaseFileViewFieldComponent = /** @class */ (function () {
11670
- function CaseFileViewFieldComponent(elementRef, route, caseFileViewService, documentManagementService) {
11670
+ function CaseFileViewFieldComponent(elementRef, route, caseFileViewService, documentManagementService, loadingService) {
11671
11671
  this.elementRef = elementRef;
11672
11672
  this.route = route;
11673
11673
  this.caseFileViewService = caseFileViewService;
11674
11674
  this.documentManagementService = documentManagementService;
11675
+ this.loadingService = loadingService;
11676
+ this.allowMoving = true;
11675
11677
  this.getCategoriesAndDocumentsError = false;
11676
11678
  }
11677
11679
  CaseFileViewFieldComponent.prototype.ngOnInit = function () {
@@ -11715,9 +11717,12 @@
11715
11717
  this.currentDocument = JSON.parse(mediaViewerInfo);
11716
11718
  };
11717
11719
  CaseFileViewFieldComponent.prototype.moveDocument = function (data) {
11720
+ var _this = this;
11718
11721
  var cid = this.route.snapshot.paramMap.get(CaseFileViewFieldComponent.PARAM_CASE_ID);
11722
+ var loadingToken = this.loadingService.register();
11719
11723
  this.caseFileViewService.updateDocumentCategory(cid, this.caseVersion, data.document.attribute_path, data.newCategory).subscribe(function (_) {
11720
11724
  location.reload();
11725
+ _this.loadingService.unregister(loadingToken);
11721
11726
  });
11722
11727
  };
11723
11728
  CaseFileViewFieldComponent.prototype.ngOnDestroy = function () {
@@ -11728,11 +11733,11 @@
11728
11733
  return CaseFileViewFieldComponent;
11729
11734
  }());
11730
11735
  CaseFileViewFieldComponent.PARAM_CASE_ID = 'cid';
11731
- CaseFileViewFieldComponent.ɵfac = function CaseFileViewFieldComponent_Factory(t) { return new (t || CaseFileViewFieldComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.ElementRef), i0__namespace.ɵɵdirectiveInject(i1__namespace$1.ActivatedRoute), i0__namespace.ɵɵdirectiveInject(CaseFileViewService), i0__namespace.ɵɵdirectiveInject(DocumentManagementService)); };
11732
- CaseFileViewFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CaseFileViewFieldComponent, selectors: [["ccd-case-file-view-field"]], decls: 2, vars: 2, consts: [["class", "govuk-grid-column-two-thirds", 4, "ngIf"], [4, "ngIf"], [1, "govuk-grid-column-two-thirds"], [1, "govuk-heading-xl"], [1, "govuk-body"], [1, "govuk-heading-l"], ["id", "case-file-view", 1, "govuk-form-group"], [1, "document-tree-container"], [1, "document-tree-container__tree", 3, "categoriesAndDocuments", "clickedDocument", "moveDocument"], [1, "slider"], [1, "media-viewer-container"], [3, "url", "downloadFileName", "showToolbar", "contentType", "enableAnnotations", "enableRedactions"]], template: function CaseFileViewFieldComponent_Template(rf, ctx) {
11736
+ CaseFileViewFieldComponent.ɵfac = function CaseFileViewFieldComponent_Factory(t) { return new (t || CaseFileViewFieldComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.ElementRef), i0__namespace.ɵɵdirectiveInject(i1__namespace$1.ActivatedRoute), i0__namespace.ɵɵdirectiveInject(CaseFileViewService), i0__namespace.ɵɵdirectiveInject(DocumentManagementService), i0__namespace.ɵɵdirectiveInject(LoadingService)); };
11737
+ CaseFileViewFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CaseFileViewFieldComponent, selectors: [["ccd-case-file-view-field"]], decls: 2, vars: 2, consts: [["class", "govuk-grid-column-two-thirds", 4, "ngIf"], [4, "ngIf"], [1, "govuk-grid-column-two-thirds"], [1, "govuk-heading-xl"], [1, "govuk-body"], [1, "govuk-heading-l"], ["id", "case-file-view", 1, "govuk-form-group"], [1, "document-tree-container"], [1, "document-tree-container__tree", 3, "categoriesAndDocuments", "allowMoving", "clickedDocument", "moveDocument"], [1, "slider"], [1, "media-viewer-container"], [3, "url", "downloadFileName", "showToolbar", "contentType", "enableAnnotations", "enableRedactions"]], template: function CaseFileViewFieldComponent_Template(rf, ctx) {
11733
11738
  if (rf & 1) {
11734
11739
  i0__namespace.ɵɵtemplate(0, CaseFileViewFieldComponent_div_0_Template, 5, 0, "div", 0);
11735
- i0__namespace.ɵɵtemplate(1, CaseFileViewFieldComponent_div_1_Template, 9, 2, "div", 1);
11740
+ i0__namespace.ɵɵtemplate(1, CaseFileViewFieldComponent_div_1_Template, 9, 3, "div", 1);
11736
11741
  }
11737
11742
  if (rf & 2) {
11738
11743
  i0__namespace.ɵɵproperty("ngIf", ctx.getCategoriesAndDocumentsError);
@@ -11748,7 +11753,92 @@
11748
11753
  templateUrl: './case-file-view-field.component.html',
11749
11754
  styleUrls: ['./case-file-view-field.component.scss'],
11750
11755
  }]
11751
- }], function () { return [{ type: i0__namespace.ElementRef }, { type: i1__namespace$1.ActivatedRoute }, { type: CaseFileViewService }, { type: DocumentManagementService }]; }, null);
11756
+ }], function () { return [{ type: i0__namespace.ElementRef }, { type: i1__namespace$1.ActivatedRoute }, { type: CaseFileViewService }, { type: DocumentManagementService }, { type: LoadingService }]; }, null);
11757
+ })();
11758
+
11759
+ function CaseFileViewFieldReadComponent_div_0_Template(rf, ctx) {
11760
+ if (rf & 1) {
11761
+ i0__namespace.ɵɵelementStart(0, "div", 2);
11762
+ i0__namespace.ɵɵelementStart(1, "h1", 3);
11763
+ i0__namespace.ɵɵtext(2, "Sorry, there is a problem with the service");
11764
+ i0__namespace.ɵɵelementEnd();
11765
+ i0__namespace.ɵɵelementStart(3, "p", 4);
11766
+ i0__namespace.ɵɵtext(4, "Try again later.");
11767
+ i0__namespace.ɵɵelementEnd();
11768
+ i0__namespace.ɵɵelementEnd();
11769
+ }
11770
+ }
11771
+ function CaseFileViewFieldReadComponent_div_1_ng_container_8_Template(rf, ctx) {
11772
+ if (rf & 1) {
11773
+ i0__namespace.ɵɵelementContainerStart(0);
11774
+ i0__namespace.ɵɵelement(1, "mv-media-viewer", 11);
11775
+ i0__namespace.ɵɵelementContainerEnd();
11776
+ }
11777
+ if (rf & 2) {
11778
+ var ctx_r2 = i0__namespace.ɵɵnextContext(2);
11779
+ i0__namespace.ɵɵadvance(1);
11780
+ i0__namespace.ɵɵproperty("url", ctx_r2.currentDocument.document_binary_url)("downloadFileName", ctx_r2.currentDocument.document_filename)("showToolbar", true)("contentType", ctx_r2.currentDocument.content_type)("enableAnnotations", true)("enableRedactions", true);
11781
+ }
11782
+ }
11783
+ function CaseFileViewFieldReadComponent_div_1_Template(rf, ctx) {
11784
+ if (rf & 1) {
11785
+ var _r4_1 = i0__namespace.ɵɵgetCurrentView();
11786
+ i0__namespace.ɵɵelementStart(0, "div");
11787
+ i0__namespace.ɵɵelementStart(1, "h2", 5);
11788
+ i0__namespace.ɵɵtext(2, "Case file");
11789
+ i0__namespace.ɵɵelementEnd();
11790
+ i0__namespace.ɵɵelementStart(3, "div", 6);
11791
+ i0__namespace.ɵɵelementStart(4, "div", 7);
11792
+ i0__namespace.ɵɵelementStart(5, "ccd-case-file-view-folder", 8);
11793
+ i0__namespace.ɵɵlistener("clickedDocument", function CaseFileViewFieldReadComponent_div_1_Template_ccd_case_file_view_folder_clickedDocument_5_listener($event) { i0__namespace.ɵɵrestoreView(_r4_1); var ctx_r3 = i0__namespace.ɵɵnextContext(); return ctx_r3.setMediaViewerFile($event); })("moveDocument", function CaseFileViewFieldReadComponent_div_1_Template_ccd_case_file_view_folder_moveDocument_5_listener($event) { i0__namespace.ɵɵrestoreView(_r4_1); var ctx_r5 = i0__namespace.ɵɵnextContext(); return ctx_r5.moveDocument($event); });
11794
+ i0__namespace.ɵɵelementEnd();
11795
+ i0__namespace.ɵɵelementEnd();
11796
+ i0__namespace.ɵɵelement(6, "div", 9);
11797
+ i0__namespace.ɵɵelementStart(7, "div", 10);
11798
+ i0__namespace.ɵɵtemplate(8, CaseFileViewFieldReadComponent_div_1_ng_container_8_Template, 2, 6, "ng-container", 1);
11799
+ i0__namespace.ɵɵelementEnd();
11800
+ i0__namespace.ɵɵelementEnd();
11801
+ i0__namespace.ɵɵelementEnd();
11802
+ }
11803
+ if (rf & 2) {
11804
+ var ctx_r1 = i0__namespace.ɵɵnextContext();
11805
+ i0__namespace.ɵɵadvance(5);
11806
+ i0__namespace.ɵɵproperty("categoriesAndDocuments", ctx_r1.categoriesAndDocuments$)("allowMoving", ctx_r1.allowMoving);
11807
+ i0__namespace.ɵɵadvance(3);
11808
+ i0__namespace.ɵɵproperty("ngIf", ctx_r1.currentDocument);
11809
+ }
11810
+ }
11811
+ var CaseFileViewFieldReadComponent = /** @class */ (function (_super) {
11812
+ __extends(CaseFileViewFieldReadComponent, _super);
11813
+ function CaseFileViewFieldReadComponent() {
11814
+ var _this = _super.apply(this, __spread(arguments)) || this;
11815
+ _this.allowMoving = true;
11816
+ return _this;
11817
+ }
11818
+ return CaseFileViewFieldReadComponent;
11819
+ }(CaseFileViewFieldComponent));
11820
+ CaseFileViewFieldReadComponent.ɵfac = function CaseFileViewFieldReadComponent_Factory(t) { return ɵCaseFileViewFieldReadComponent_BaseFactory(t || CaseFileViewFieldReadComponent); };
11821
+ CaseFileViewFieldReadComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CaseFileViewFieldReadComponent, selectors: [["ccd-case-file-view-field"]], features: [i0__namespace.ɵɵInheritDefinitionFeature], decls: 2, vars: 2, consts: [["class", "govuk-grid-column-two-thirds", 4, "ngIf"], [4, "ngIf"], [1, "govuk-grid-column-two-thirds"], [1, "govuk-heading-xl"], [1, "govuk-body"], [1, "govuk-heading-l"], ["id", "case-file-view", 1, "govuk-form-group"], [1, "document-tree-container"], [1, "document-tree-container__tree", 3, "categoriesAndDocuments", "allowMoving", "clickedDocument", "moveDocument"], [1, "slider"], [1, "media-viewer-container"], [3, "url", "downloadFileName", "showToolbar", "contentType", "enableAnnotations", "enableRedactions"]], template: function CaseFileViewFieldReadComponent_Template(rf, ctx) {
11822
+ if (rf & 1) {
11823
+ i0__namespace.ɵɵtemplate(0, CaseFileViewFieldReadComponent_div_0_Template, 5, 0, "div", 0);
11824
+ i0__namespace.ɵɵtemplate(1, CaseFileViewFieldReadComponent_div_1_Template, 9, 3, "div", 1);
11825
+ }
11826
+ if (rf & 2) {
11827
+ i0__namespace.ɵɵproperty("ngIf", ctx.getCategoriesAndDocumentsError);
11828
+ i0__namespace.ɵɵadvance(1);
11829
+ i0__namespace.ɵɵproperty("ngIf", !ctx.getCategoriesAndDocumentsError);
11830
+ }
11831
+ }, styles: ["#case-file-view[_ngcontent-%COMP%]{display:flex;border:2px solid #c9c9c9;height:100vh;position:relative}#case-file-view[_ngcontent-%COMP%] .document-tree-container[_ngcontent-%COMP%]{background-color:#faf8f8;width:30%;min-height:400px;min-width:10%}#case-file-view[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:.2%;background-color:#6b6b6b}#case-file-view[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]:focus, #case-file-view[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]:hover{cursor:col-resize}#case-file-view[_ngcontent-%COMP%] .media-viewer-container[_ngcontent-%COMP%]{background-color:#dee0e2;flex:1 1 0;overflow:hidden}"] });
11832
+ var ɵCaseFileViewFieldReadComponent_BaseFactory = /*@__PURE__*/ i0__namespace.ɵɵgetInheritedFactory(CaseFileViewFieldReadComponent);
11833
+ (function () {
11834
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(CaseFileViewFieldReadComponent, [{
11835
+ type: i0.Component,
11836
+ args: [{
11837
+ selector: 'ccd-case-file-view-field',
11838
+ templateUrl: './case-file-view-field.component.html',
11839
+ styleUrls: ['./case-file-view-field.component.scss'],
11840
+ }]
11841
+ }], null, null);
11752
11842
  })();
11753
11843
 
11754
11844
  exports.AddCommentsErrorMessage = void 0;
@@ -17307,7 +17397,7 @@
17307
17397
  var PaletteService = /** @class */ (function () {
17308
17398
  function PaletteService() {
17309
17399
  this.componentLauncherRegistry = {
17310
- CaseFileView: CaseFileViewFieldComponent
17400
+ CaseFileView: [CaseFileViewFieldComponent, CaseFileViewFieldReadComponent]
17311
17401
  };
17312
17402
  }
17313
17403
  PaletteService.prototype.getFieldComponentClass = function (caseField, write) {
@@ -17369,19 +17459,19 @@
17369
17459
  case 'WaysToPay':
17370
17460
  return WaysToPayFieldComponent;
17371
17461
  case 'ComponentLauncher':
17372
- return this.getComponentLauncherComponent(caseField);
17462
+ return this.getComponentLauncherComponent(caseField, write);
17373
17463
  case 'FlagLauncher':
17374
17464
  return write ? WriteCaseFlagFieldComponent : ReadCaseFlagFieldComponent;
17375
17465
  default:
17376
17466
  return UnsupportedFieldComponent;
17377
17467
  }
17378
17468
  };
17379
- PaletteService.prototype.getComponentLauncherComponent = function (caseField) {
17469
+ PaletteService.prototype.getComponentLauncherComponent = function (caseField, write) {
17380
17470
  // Extract the value passed for #ARGUMENT(...) in the CaseField display_context_parameter and return the matching
17381
17471
  // component from the componentLauncherRegistry
17382
17472
  var argumentValue = caseField.display_context_parameter.match(/#ARGUMENT\((.*?)\)/)[1];
17383
17473
  if (argumentValue && this.componentLauncherRegistry.hasOwnProperty(argumentValue)) {
17384
- return this.componentLauncherRegistry[argumentValue];
17474
+ return this.componentLauncherRegistry[argumentValue][write ? 0 : 1];
17385
17475
  }
17386
17476
  return UnsupportedFieldComponent;
17387
17477
  };
@@ -17720,7 +17810,7 @@
17720
17810
  var _r12_1 = i0__namespace.ɵɵgetCurrentView();
17721
17811
  i0__namespace.ɵɵelementStart(0, "div", 9);
17722
17812
  i0__namespace.ɵɵelementStart(1, "input", 10);
17723
- i0__namespace.ɵɵlistener("change", function CaseFileViewFolderSelectorComponent_ng_template_12_Template_input_change_1_listener($event) { i0__namespace.ɵɵrestoreView(_r12_1); var ctx_r11 = i0__namespace.ɵɵnextContext(); return ctx_r11.handleChange($event); });
17813
+ i0__namespace.ɵɵlistener("click", function CaseFileViewFolderSelectorComponent_ng_template_12_Template_input_click_1_listener($event) { i0__namespace.ɵɵrestoreView(_r12_1); var ctx_r11 = i0__namespace.ɵɵnextContext(); return ctx_r11.handleChange($event); });
17724
17814
  i0__namespace.ɵɵelementEnd();
17725
17815
  i0__namespace.ɵɵelementStart(2, "label", 11);
17726
17816
  i0__namespace.ɵɵelement(3, "img", 12);
@@ -17751,9 +17841,21 @@
17751
17841
  this.selected = '';
17752
17842
  this.currentCategories = __spread(this.data.categories);
17753
17843
  }
17844
+ CaseFileViewFolderSelectorComponent.prototype.ngAfterViewInit = function () {
17845
+ var path = this.findPath();
17846
+ path.forEach(function (p) { return document.getElementById(p).checked = true; });
17847
+ };
17754
17848
  CaseFileViewFolderSelectorComponent.prototype.handleChange = function (evt) {
17755
17849
  if (evt.target.checked) {
17756
17850
  this.select(evt.target.id);
17851
+ // get level of this checkbox so we can clear all lower levels
17852
+ var level = parseInt(evt.target.name.split('-')[1], 10) + 1;
17853
+ var nodes = document.getElementsByName("level-" + level);
17854
+ while (nodes.length > 0) {
17855
+ nodes.forEach(function (node) { return node.checked = false; });
17856
+ level += 1;
17857
+ nodes = document.getElementsByName("level-" + level);
17858
+ }
17757
17859
  }
17758
17860
  };
17759
17861
  CaseFileViewFolderSelectorComponent.prototype.select = function (categoryId) {
@@ -17765,10 +17867,52 @@
17765
17867
  CaseFileViewFolderSelectorComponent.prototype.save = function () {
17766
17868
  this.dialogRef.close(this.selected.length > 0 ? this.selected : null);
17767
17869
  };
17870
+ CaseFileViewFolderSelectorComponent.prototype.findPath = function () {
17871
+ var e_1, _a;
17872
+ try {
17873
+ for (var _b = __values(this.data.categories), _c = _b.next(); !_c.done; _c = _b.next()) {
17874
+ var c = _c.value;
17875
+ var r = this.containsDocument(c, this.data.document);
17876
+ if (r) {
17877
+ return r;
17878
+ }
17879
+ }
17880
+ }
17881
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
17882
+ finally {
17883
+ try {
17884
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
17885
+ }
17886
+ finally { if (e_1) throw e_1.error; }
17887
+ }
17888
+ };
17889
+ CaseFileViewFolderSelectorComponent.prototype.containsDocument = function (cat, document) {
17890
+ var e_2, _a;
17891
+ if (cat.documents.findIndex(function (doc) { return doc.document_binary_url === document.document_binary_url; }) > -1) {
17892
+ return [cat.category_id];
17893
+ }
17894
+ try {
17895
+ for (var _b = __values(cat.sub_categories), _c = _b.next(); !_c.done; _c = _b.next()) {
17896
+ var c = _c.value;
17897
+ var r = this.containsDocument(c, document);
17898
+ if (r) {
17899
+ return __spread([cat.category_id], r);
17900
+ }
17901
+ }
17902
+ }
17903
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
17904
+ finally {
17905
+ try {
17906
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
17907
+ }
17908
+ finally { if (e_2) throw e_2.error; }
17909
+ }
17910
+ return null;
17911
+ };
17768
17912
  return CaseFileViewFolderSelectorComponent;
17769
17913
  }());
17770
17914
  CaseFileViewFolderSelectorComponent.ɵfac = function CaseFileViewFolderSelectorComponent_Factory(t) { return new (t || CaseFileViewFolderSelectorComponent)(i0__namespace.ɵɵdirectiveInject(i1__namespace$3.MatDialogRef), i0__namespace.ɵɵdirectiveInject(i1$3.MAT_DIALOG_DATA)); };
17771
- CaseFileViewFolderSelectorComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CaseFileViewFolderSelectorComponent, selectors: [["xui-case-file-view-folder-selector"]], decls: 14, vars: 2, consts: [[1, "govuk-heading-l"], [1, "folders", "govuk-radios", "govuk-radios--conditional"], [4, "ngFor", "ngForOf"], [1, "govuk-button-group"], ["type", "button", 1, "button", "button-primary", 3, "click"], [1, "cancel", 3, "click"], [1, "close", 3, "click"], ["folder", ""], [4, "ngTemplateOutlet", "ngTemplateOutletContext"], [1, "folder", "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "name", "id", "change"], [1, "govuk-label", "govuk-radios__label", 3, "for"], ["src", "/assets/images/folder.png", "alt", "Folder icon", 1, "iconImg"]], template: function CaseFileViewFolderSelectorComponent_Template(rf, ctx) {
17915
+ CaseFileViewFolderSelectorComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CaseFileViewFolderSelectorComponent, selectors: [["xui-case-file-view-folder-selector"]], decls: 14, vars: 2, consts: [[1, "govuk-heading-l"], [1, "folders", "govuk-radios", "govuk-radios--conditional"], [4, "ngFor", "ngForOf"], [1, "govuk-button-group"], ["type", "button", 1, "button", "button-primary", 3, "click"], [1, "cancel", 3, "click"], [1, "close", 3, "click"], ["folder", ""], [4, "ngTemplateOutlet", "ngTemplateOutletContext"], [1, "folder", "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "name", "id", "click"], [1, "govuk-label", "govuk-radios__label", 3, "for"], ["src", "/assets/images/folder.png", "alt", "Folder icon", 1, "iconImg"]], template: function CaseFileViewFolderSelectorComponent_Template(rf, ctx) {
17772
17916
  if (rf & 1) {
17773
17917
  i0__namespace.ɵɵelementStart(0, "h2", 0);
17774
17918
  i0__namespace.ɵɵtext(1, "Move File");
@@ -17940,16 +18084,21 @@
17940
18084
  this.downloadAction = new i0.EventEmitter();
17941
18085
  this.printAction = new i0.EventEmitter();
17942
18086
  this.overlayMenuItems = [
17943
- { actionText: 'Change folder', iconSrc: '/assets/img/case-file-view/document-menu/open_with.svg', actionFn: function () { return _this.changeFolderAction.emit(); } },
17944
18087
  { actionText: 'Open in a new tab', iconSrc: '/assets/img/case-file-view/document-menu/open_in_new.svg', actionFn: function () { return _this.openInANewTabAction.emit(); } },
17945
18088
  { actionText: 'Download', iconSrc: '/assets/img/case-file-view/document-menu/download.svg', actionFn: function () { return _this.downloadAction.emit(); } },
17946
18089
  { actionText: 'Print', iconSrc: '/assets/img/case-file-view/document-menu/print.svg', actionFn: function () { return _this.printAction.emit(); } },
17947
18090
  ];
17948
18091
  }
18092
+ CaseFileViewFolderDocumentActionsComponent.prototype.ngOnInit = function () {
18093
+ var _this = this;
18094
+ if (this.allowMoving) {
18095
+ this.overlayMenuItems.unshift({ actionText: 'Change folder', iconSrc: '/assets/img/case-file-view/document-menu/open_with.svg', actionFn: function () { return _this.changeFolderAction.emit(); } });
18096
+ }
18097
+ };
17949
18098
  return CaseFileViewFolderDocumentActionsComponent;
17950
18099
  }());
17951
18100
  CaseFileViewFolderDocumentActionsComponent.ɵfac = function CaseFileViewFolderDocumentActionsComponent_Factory(t) { return new (t || CaseFileViewFolderDocumentActionsComponent)(); };
17952
- CaseFileViewFolderDocumentActionsComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CaseFileViewFolderDocumentActionsComponent, selectors: [["ccd-case-file-view-folder-document-actions"]], outputs: { changeFolderAction: "changeFolderAction", openInANewTabAction: "openInANewTabAction", downloadAction: "downloadAction", printAction: "printAction" }, decls: 3, vars: 2, consts: [[3, "menuItems", "isOpen", "isOpenChange"], ["trigger", ""], ["src", "/assets/img/case-file-view/document-menu/more_vert.svg", "alt", "More document options", 1, "actions-trigger-icon"]], template: function CaseFileViewFolderDocumentActionsComponent_Template(rf, ctx) {
18101
+ CaseFileViewFolderDocumentActionsComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CaseFileViewFolderDocumentActionsComponent, selectors: [["ccd-case-file-view-folder-document-actions"]], inputs: { allowMoving: "allowMoving" }, outputs: { changeFolderAction: "changeFolderAction", openInANewTabAction: "openInANewTabAction", downloadAction: "downloadAction", printAction: "printAction" }, decls: 3, vars: 2, consts: [[3, "menuItems", "isOpen", "isOpenChange"], ["trigger", ""], ["src", "/assets/img/case-file-view/document-menu/more_vert.svg", "alt", "More document options", 1, "actions-trigger-icon"]], template: function CaseFileViewFolderDocumentActionsComponent_Template(rf, ctx) {
17953
18102
  if (rf & 1) {
17954
18103
  i0__namespace.ɵɵelementStart(0, "ccd-case-file-view-overlay-menu", 0);
17955
18104
  i0__namespace.ɵɵlistener("isOpenChange", function CaseFileViewFolderDocumentActionsComponent_Template_ccd_case_file_view_overlay_menu_isOpenChange_0_listener($event) { return ctx.isOpen = $event; });
@@ -17970,7 +18119,9 @@
17970
18119
  templateUrl: './case-file-view-folder-document-actions.component.html',
17971
18120
  styleUrls: ['./case-file-view-folder-document-actions.component.scss']
17972
18121
  }]
17973
- }], function () { return []; }, { changeFolderAction: [{
18122
+ }], function () { return []; }, { allowMoving: [{
18123
+ type: i0.Input
18124
+ }], changeFolderAction: [{
17974
18125
  type: i0.Output
17975
18126
  }], openInANewTabAction: [{
17976
18127
  type: i0.Output
@@ -18185,6 +18336,8 @@
18185
18336
  i0__namespace.ɵɵclassProp("node--selected", (ctx_r2.selectedNodeItem == null ? null : ctx_r2.selectedNodeItem.name) === node_r4.name);
18186
18337
  i0__namespace.ɵɵadvance(4);
18187
18338
  i0__namespace.ɵɵtextInterpolate(node_r4.name);
18339
+ i0__namespace.ɵɵadvance(2);
18340
+ i0__namespace.ɵɵproperty("allowMoving", ctx_r2.allowMoving);
18188
18341
  }
18189
18342
  }
18190
18343
  function CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_5_Template(rf, ctx) {
@@ -18227,7 +18380,7 @@
18227
18380
  i0__namespace.ɵɵtemplate(1, CaseFileViewFolderComponent_div_8_div_1_Template, 2, 0, "div", 8);
18228
18381
  i0__namespace.ɵɵelementStart(2, "div");
18229
18382
  i0__namespace.ɵɵelementStart(3, "cdk-tree", 9);
18230
- i0__namespace.ɵɵtemplate(4, CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template, 8, 3, "cdk-nested-tree-node", 10);
18383
+ i0__namespace.ɵɵtemplate(4, CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template, 8, 4, "cdk-nested-tree-node", 10);
18231
18384
  i0__namespace.ɵɵtemplate(5, CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_5_Template, 10, 6, "cdk-nested-tree-node", 11);
18232
18385
  i0__namespace.ɵɵelementEnd();
18233
18386
  i0__namespace.ɵɵelementEnd();
@@ -18460,7 +18613,7 @@
18460
18613
  CaseFileViewFolderComponent.DOCUMENT_SEARCH_FORM_CONTROL_NAME = 'documentSearchFormControl';
18461
18614
  CaseFileViewFolderComponent.MINIMUM_SEARCH_CHARACTERS = 3;
18462
18615
  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)); };
18463
- CaseFileViewFolderComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CaseFileViewFolderComponent, selectors: [["ccd-case-file-view-folder"]], inputs: { categoriesAndDocuments: "categoriesAndDocuments" }, 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, "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) {
18616
+ 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) {
18464
18617
  if (rf & 1) {
18465
18618
  i0__namespace.ɵɵelementStart(0, "div", 0);
18466
18619
  i0__namespace.ɵɵelementStart(1, "div", 1);
@@ -18498,6 +18651,8 @@
18498
18651
  }]
18499
18652
  }], function () { return [{ type: WindowService }, { type: i1__namespace$1.Router }, { type: DocumentManagementService }, { type: i1__namespace$3.MatDialog }]; }, { categoriesAndDocuments: [{
18500
18653
  type: i0.Input
18654
+ }], allowMoving: [{
18655
+ type: i0.Input
18501
18656
  }], clickedDocument: [{
18502
18657
  type: i0.Output
18503
18658
  }], moveDocument: [{
@@ -22204,6 +22359,7 @@
22204
22359
  WriteCollectionFieldComponent,
22205
22360
  // ComponentLauncher web components
22206
22361
  CaseFileViewFieldComponent,
22362
+ CaseFileViewFieldReadComponent,
22207
22363
  CaseFileViewFolderComponent,
22208
22364
  CaseFileViewFolderSortComponent,
22209
22365
  CaseFileViewOverlayMenuComponent,
@@ -22255,7 +22411,8 @@
22255
22411
  i3.PaymentLibModule,
22256
22412
  i2$1.ScrollToModule.forRoot(),
22257
22413
  i1$3.MatDialogModule,
22258
- i11.MediaViewerModule
22414
+ i11.MediaViewerModule,
22415
+ LoadingModule
22259
22416
  ], i4.NgxMatDatetimePickerModule,
22260
22417
  i4.NgxMatNativeDateModule,
22261
22418
  i4.NgxMatTimepickerModule,
@@ -22348,6 +22505,7 @@
22348
22505
  WriteCollectionFieldComponent,
22349
22506
  // ComponentLauncher web components
22350
22507
  CaseFileViewFieldComponent,
22508
+ CaseFileViewFieldReadComponent,
22351
22509
  CaseFileViewFolderComponent,
22352
22510
  CaseFileViewFolderSortComponent,
22353
22511
  CaseFileViewOverlayMenuComponent,
@@ -22376,7 +22534,8 @@
22376
22534
  i7.CdkTreeModule,
22377
22535
  i1$4.OverlayModule,
22378
22536
  i3.PaymentLibModule, i2__namespace$1.ScrollToModule, i1$3.MatDialogModule,
22379
- i11.MediaViewerModule], exports: [i4.NgxMatDatetimePickerModule,
22537
+ i11.MediaViewerModule,
22538
+ LoadingModule], exports: [i4.NgxMatDatetimePickerModule,
22380
22539
  i4.NgxMatNativeDateModule,
22381
22540
  i4.NgxMatTimepickerModule,
22382
22541
  TabsModule,
@@ -22454,6 +22613,7 @@
22454
22613
  WriteCollectionFieldComponent,
22455
22614
  // ComponentLauncher web components
22456
22615
  CaseFileViewFieldComponent,
22616
+ CaseFileViewFieldReadComponent,
22457
22617
  CaseFileViewFolderComponent,
22458
22618
  CaseFileViewFolderSortComponent,
22459
22619
  CaseFileViewOverlayMenuComponent,
@@ -22491,7 +22651,8 @@
22491
22651
  i3.PaymentLibModule,
22492
22652
  i2$1.ScrollToModule.forRoot(),
22493
22653
  i1$3.MatDialogModule,
22494
- i11.MediaViewerModule
22654
+ i11.MediaViewerModule,
22655
+ LoadingModule
22495
22656
  ],
22496
22657
  declarations: __spread([
22497
22658
  FixedListPipe,
@@ -22567,6 +22728,7 @@
22567
22728
  i0__namespace.ɵɵsetComponentScope(
22568
22729
  // ComponentLauncher web components
22569
22730
  CaseFileViewFieldComponent, [i1__namespace.NgIf, CaseFileViewFolderComponent, i11__namespace.ɵcs], []);
22731
+ i0__namespace.ɵɵsetComponentScope(CaseFileViewFieldReadComponent, [i1__namespace.NgIf, CaseFileViewFolderComponent, i11__namespace.ɵcs], []);
22570
22732
 
22571
22733
  var Confirmation = /** @class */ (function () {
22572
22734
  function Confirmation(caseId, status, header, body) {
@@ -32272,6 +32434,7 @@
32272
32434
  exports.CaseField = CaseField;
32273
32435
  exports.CaseFieldService = CaseFieldService;
32274
32436
  exports.CaseFileViewFieldComponent = CaseFileViewFieldComponent;
32437
+ exports.CaseFileViewFieldReadComponent = CaseFileViewFieldReadComponent;
32275
32438
  exports.CaseFileViewFolderComponent = CaseFileViewFolderComponent;
32276
32439
  exports.CaseFileViewFolderDocumentActionsComponent = CaseFileViewFolderDocumentActionsComponent;
32277
32440
  exports.CaseFileViewFolderSelectorComponent = CaseFileViewFolderSelectorComponent;