@valtimo/dossier 4.16.0 → 4.19.0

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 (29) hide show
  1. package/bundles/valtimo-dossier.umd.js +39 -6
  2. package/bundles/valtimo-dossier.umd.js.map +1 -1
  3. package/bundles/valtimo-dossier.umd.min.js +1 -1
  4. package/bundles/valtimo-dossier.umd.min.js.map +1 -1
  5. package/esm2015/lib/dossier-detail/dossier-detail.component.js +37 -4
  6. package/esm2015/lib/dossier-detail/tab/audit/audit.component.js +1 -1
  7. package/esm2015/lib/dossier-detail/tab/contact-moments/contact-moments.component.js +1 -1
  8. package/esm2015/lib/dossier-detail/tab/documents/documents.component.js +3 -3
  9. package/esm2015/lib/dossier-detail/tab/progress/progress.component.js +1 -1
  10. package/esm2015/lib/dossier-detail/tab/summary/summary.component.js +1 -1
  11. package/esm2015/lib/dossier-detail-tab-enum.js +1 -1
  12. package/esm2015/lib/dossier-list/dossier-list.component.js +2 -2
  13. package/esm2015/lib/dossier-process-start-modal/dossier-process-start-modal.component.js +1 -1
  14. package/esm2015/lib/dossier-routing.module.js +1 -1
  15. package/esm2015/lib/dossier-supporting-process-start-modal/dossier-supporting-process-start-modal.component.js +1 -1
  16. package/esm2015/lib/dossier-update/dossier-update.component.js +1 -1
  17. package/esm2015/lib/dossier.config.js +1 -1
  18. package/esm2015/lib/dossier.module.js +1 -1
  19. package/esm2015/lib/dossier.service.js +1 -1
  20. package/esm2015/lib/models/index.js +1 -1
  21. package/esm2015/lib/models/tabs.model.js +1 -1
  22. package/esm2015/lib/tab.service.js +1 -1
  23. package/esm2015/public_api.js +1 -1
  24. package/esm2015/valtimo-dossier.js +1 -1
  25. package/fesm2015/valtimo-dossier.js +37 -6
  26. package/fesm2015/valtimo-dossier.js.map +1 -1
  27. package/lib/dossier-detail/dossier-detail.component.d.ts +7 -1
  28. package/package.json +1 -1
  29. package/valtimo-dossier.metadata.json +1 -1
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/router"),require("@ngx-translate/core"),require("@valtimo/document"),require("moment"),require("rxjs"),require("@valtimo/config"),require("@angular/common"),require("@valtimo/process"),require("@valtimo/task"),require("@valtimo/form"),require("@valtimo/components"),require("@valtimo/security"),require("ngx-spinner"),require("ngx-toastr"),require("@valtimo/resource"),require("rxjs/operators"),require("@valtimo/contact-moment"),require("@ng-bootstrap/ng-bootstrap"),require("@valtimo/form-link"),require("ngx-logger"),require("@angular/forms"),require("@angular/common/http")):"function"==typeof define&&define.amd?define("@valtimo/dossier",["exports","@angular/core","@angular/router","@ngx-translate/core","@valtimo/document","moment","rxjs","@valtimo/config","@angular/common","@valtimo/process","@valtimo/task","@valtimo/form","@valtimo/components","@valtimo/security","ngx-spinner","ngx-toastr","@valtimo/resource","rxjs/operators","@valtimo/contact-moment","@ng-bootstrap/ng-bootstrap","@valtimo/form-link","ngx-logger","@angular/forms","@angular/common/http"],t):t(((e=e||self).valtimo=e.valtimo||{},e.valtimo.dossier={}),e.ng.core,e.ng.router,e.core$1,e.document,e.moment,e.rxjs,e.config,e.ng.common,e.process,e.task,e.form,e.components,e.security,e.ngxSpinner,e.ngxToastr,e.resource,e.rxjs.operators,e.contactMoment,e.ngBootstrap,e.formLink,e.ngxLogger,e.ng.forms,e.ng.common.http)}(this,(function(e,t,n,i,o,s,r,a,c,l,u,d,m,p,h,f,g,v,b,y,S,D,I,w){"use strict";var L=function(){function e(e,t,n,i,o,s){this._tabs=null,this._componentFactoryResolver=null,this._viewContainerRef=null,this._activeComponent=null,this._activeTab=null,this._translateService=null,this._tabs=e,this._componentFactoryResolver=t,this._viewContainerRef=n,this._translateService=i,this._router=o,this._location=s}return e.prototype.initial=function(e){var t;t=e?this._tabs.find((function(t){return t.name===e})):this._tabs[0]||null,this.load(t)},e.prototype.load=function(e){e!==this._activeTab&&(this._tabs.forEach((function(e){return e.deactivate()})),this.replaceView(e),this.replaceUrlState(e),this.setActive(e))},e.prototype.refreshView=function(){this.replaceView(this._activeTab)},e.prototype.replaceView=function(e){var t=this._componentFactoryResolver.resolveComponentFactory(e.component);this._viewContainerRef.clear(),null!==this._activeTab&&this._activeComponent.destroy(),this._activeComponent=this._viewContainerRef.createComponent(t)},e.prototype.replaceUrlState=function(e){var t=this._router.url.split("/");t.splice(t.length-1,1,e.name);var n=t.join("/");this._location.replaceState(n)},e.prototype.setActive=function(e){e.activate(),this._activeTab=e},Object.defineProperty(e.prototype,"tabs",{get:function(){return this._tabs},enumerable:!1,configurable:!0}),e.prototype.translateTabName=function(e){return this._translateService.instant("dossier.tabs."+e.name)},e}(),k=function(){function e(e,t,n){this._active=!1,this._name=e,this._sequence=t,this._component=n}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sequence",{get:function(){return this._sequence},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"component",{get:function(){return this._component},enumerable:!1,configurable:!0}),e.prototype.activate=function(){this._active=!0},e.prototype.deactivate=function(){this._active=!1},e.prototype.isActive=function(){return this._active},e}();Object.create;function N(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function x(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,s=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return r}var T;Object.create;(T=e.DefaultTabs||(e.DefaultTabs={})).summary="summary",T.progress="progress",T.audit="audit",T.documents="documents",T.contactMoments="contact-moments";var C=function(){function e(e){this.configService=e,this.definitions=e.config.definitions}return e.prototype.getImplementationEnvironmentDefinitions=function(e){return this.definitions.dossiers.find((function(t){return t.name===e}))},e.prototype.getDefinitionColumns=function(e){var t=this.configService.config;return t.customDefinitionTables[e]||t.defaultDefinitionTable},e.prototype.getInitialSortState=function(e){var t=e.find((function(e){return e.default}));return{isSorting:!1,state:{name:t?t.propertyName:e[0].propertyName,direction:"DESC"}}},e}();C.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new C(t.ɵɵinject(a.ConfigService))},token:C,providedIn:"root"}),C.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],C.ctorParameters=function(){return[{type:a.ConfigService}]},s.locale(localStorage.getItem("langKey")||"");var O=function(){function t(e,t,n,i,o){this.route=e,this.router=t,this.documentService=n,this.translateService=i,this.dossierService=o,this.documentDefinitionName="",this.showCreateDocument=!1,this.items=[],this.fields=[],this.processDefinitionListFields=[],this.processDocumentDefinitions=[],this.pagination={collectionSize:0,page:1,size:10,maxPaginationItemSize:5,sort:void 0},this.selectedProcessDocumentDefinition=null,this.modalListenerAdded=!1}return t.prototype.ngOnInit=function(){this.doInit(),this.routeEvent(this.router),this.modalListenerAdded=!1},t.prototype.ngOnDestroy=function(){this.routerSubscription.unsubscribe(),this.translationSubscription.unsubscribe()},t.prototype.paginationSet=function(){this.getData()},t.prototype.routeEvent=function(e){var t=this;this.routerSubscription=e.events.subscribe((function(e){e instanceof n.NavigationEnd&&(t.doInit(),t.getData())}))},t.prototype.doInit=function(){var e=this.route.snapshot.paramMap.get("documentDefinitionName")||"",t=this.dossierService.getDefinitionColumns(e);this.documentDefinitionName=e,this.initialSortState=this.dossierService.getInitialSortState(t),this.openTranslationSubscription(t)},t.prototype.openTranslationSubscription=function(e){var t=this;this.translationSubscription=r.combineLatest(e.map((function(e){return t.translateService.stream("fieldLabels."+e.translationKey)}))).subscribe((function(n){t.fields=e.map((function(e,t){return Object.assign({key:e.propertyName,label:n[t],sortable:e.sortable},e.viewType&&{viewType:e.viewType})}))}))},t.prototype.getData=function(){if(this.findDocumentDefinition(this.documentDefinitionName),this.hasCachedSearchRequest()){var e=this.getCachedSearch();this.globalSearchFilter=e.globalSearchFilter,this.sequence=e.sequence,this.createdBy=e.createdBy,this.findDocuments(e)}else this.doSearch();this.getAllAssociatedProcessDefinitions()},t.prototype.doSearch=function(){var e=this.buildDocumentSearchRequest();this.findDocuments(e)},t.prototype.findDocuments=function(e){var t=this;return this.documentService.getDocuments(e).subscribe((function(n){t.documents=n,t.transformDocuments(t.documents.content),t.pagination.collectionSize=t.documents.totalElements,t.storeSearch(e)}))},t.prototype.getAllAssociatedProcessDefinitions=function(){var e=this;this.documentService.findProcessDocumentDefinitions(this.documentDefinitionName).subscribe((function(t){e.processDocumentDefinitions=t.filter((function(e){return e.canInitializeDocument})),e.processDefinitionListFields=[{key:"processName",label:"Proces"}]}))},t.prototype.getCachedSearch=function(){var e=JSON.parse(this.getCachedDocumentSearchRequest());return new o.DocumentSearchRequestImpl(e.definitionName,this.pagination.page-1,this.pagination.size,e.sequence,e.createdBy,e.globalSearchFilter,e.sort)},t.prototype.buildDocumentSearchRequest=function(){return new o.DocumentSearchRequestImpl(this.documentDefinitionName,this.pagination.page-1,this.pagination.size,this.sequence,this.createdBy,this.globalSearchFilter,this.pagination.sort&&this.pagination.sort.isSorting?this.pagination.sort:this.initialSortState)},t.prototype.storeSearch=function(e){localStorage.setItem(this.getCachedKey(),JSON.stringify(e))},t.prototype.getCachedDocumentSearchRequest=function(){return localStorage.getItem(this.getCachedKey())||""},t.prototype.hasCachedSearchRequest=function(){return null!==localStorage.getItem(this.getCachedKey())},t.prototype.getCachedKey=function(){return"list-search-"+this.documentDefinitionName},t.prototype.rowClick=function(t){this.router.navigate(["/dossiers/"+this.documentDefinitionName+"/document/"+t.id+"/"+e.DefaultTabs.summary])},t.prototype.startDossier=function(){this.processDocumentDefinitions.length>1?$("#startProcess").modal("show"):(this.selectedProcessDocumentDefinition=this.processDocumentDefinitions[0],this.showStartProcessModal())},t.prototype.showStartProcessModal=function(){null!==this.selectedProcessDocumentDefinition&&(this.processStart.openModal(this.selectedProcessDocumentDefinition),this.selectedProcessDocumentDefinition=null)},t.prototype.selectProcess=function(e){var t=$("#startProcess");this.modalListenerAdded||(t.on("hidden.bs.modal",this.showStartProcessModal.bind(this)),this.modalListenerAdded=!0),this.selectedProcessDocumentDefinition=e,t.modal("hide")},t.prototype.findDocumentDefinition=function(e){var t=this;this.documentService.getDocumentDefinition(e).subscribe((function(e){t.schema=e.schema}))},t.prototype.transformDocuments=function(e){this.items=e.map((function(e){var t=e.content,n=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n}(e,["content"]);return Object.assign(Object.assign({},t),n)}))},t.prototype.paginationClicked=function(e){this.pagination.page=e,this.doSearch()},t.prototype.sortChanged=function(e){this.pagination.sort=e,this.doSearch()},t.prototype.getInitialSortState=function(){if(this.hasCachedSearchRequest()){var e=JSON.parse(this.getCachedDocumentSearchRequest());return e.sort?e.sort:this.initialSortState}return this.initialSortState},t}();O.decorators=[{type:t.Component,args:[{selector:"valtimo-dossier-list",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<ng-container *ngTemplateOutlet="sidebar"></ng-container>\n\n<div class="main-content pt-0">\n <div class="container-fluid">\n <div class="col-12 px-0 mb-5">\n <div>\n <div class="text-right mt-m3px mb-3">\n <button\n type="button"\n class="btn btn-space btn-primary mr-0"\n (click)="startDossier()"\n [ngbTooltip]="processDocumentDefinitions.length === 0 ? \'No action\' : null"\n placement="bottom"\n [disabled]="processDocumentDefinitions.length === 0"\n >\n {{ \'Start Dossier\' | translate }}\n </button>\n </div>\n\n <div\n class="modal fade"\n id="startProcess"\n tabindex="-1"\n role="dialog"\n aria-labelledby="startProcessLabel"\n aria-hidden="true"\n >\n <div class="modal-dialog modal-dialog-centered" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h3 class="modal-title" id="startProcessLabel">\n {{ \'dashboard.startProcess.title\' | translate }}\n </h3>\n <button type="button" class="close" data-dismiss="modal" aria-label="Close">\n <span aria-hidden="true">&times;</span>\n </button>\n </div>\n <div class="modal-body">\n <div class="table-responsive">\n <table class="table m-0">\n <tr\n *ngFor="let processDocumentDefinition of processDocumentDefinitions"\n (click)="selectProcess(processDocumentDefinition)"\n style="cursor: pointer"\n >\n <td>{{ processDocumentDefinition.processName }}</td>\n </tr>\n </table>\n </div>\n </div>\n <div class="modal-footer">\n <button type="button" class="btn btn-secondary" data-dismiss="modal">\n {{ \'cta.close\' | translate }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n <valtimo-widget>\n <valtimo-list\n [items]="items"\n [fields]="fields"\n (rowClicked)="rowClick($event)"\n [pagination]="pagination"\n [viewMode]="true"\n [header]="true"\n paginationIdentifier="dossierList"\n (paginationClicked)="paginationClicked($event)"\n (paginationSet)="paginationSet()"\n [initialSortState]="getInitialSortState()"\n (sortChanged)="sortChanged($event)"\n >\n <div header>\n <h3 class="list-header-title">\n {{ schema?.title }}\n <sup class="ml-1 badge badge-pill badge-primary">{{\n documents?.content.length || 0\n }}</sup>\n </h3>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </div>\n </div>\n <valtimo-dossier-process-start-modal #processStartModal></valtimo-dossier-process-start-modal>\n</div>\n\n<ng-template #sidebar>\n <valtimo-filter-sidebar>\n <h4 class="title">Search</h4>\n <div class="mb-4">\n <input\n type="text"\n class="form-control"\n placeholder="{{ \'dossier.forms.globalSearchPlaceHolder\' | translate }}"\n [(ngModel)]="globalSearchFilter"\n (blur)="doSearch()"\n (keyup.enter)="doSearch()"\n />\n </div>\n\n <div class="mb-4">\n <input\n type="number"\n class="form-control"\n placeholder="{{ \'dossier.forms.referenceNumberPlaceHolder\' | translate }}"\n [(ngModel)]="sequence"\n (blur)="doSearch()"\n (keyup.enter)="doSearch()"\n />\n </div>\n </valtimo-filter-sidebar>\n</ng-template>\n',styles:[""]}]}],O.ctorParameters=function(){return[{type:n.ActivatedRoute},{type:n.Router},{type:o.DocumentService},{type:i.TranslateService},{type:C}]},O.propDecorators={processStart:[{type:t.ViewChild,args:["processStartModal"]}]};var A=s;A.locale(localStorage.getItem("langKey")||""),A.defaultFormat="DD MMM YYYY HH:mm";var M=function(){function e(e,t,n,i,o,s,r,a,c){this.router=e,this.documentService=t,this.taskService=n,this.processService=i,this.el=o,this.renderer=s,this.route=r,this.formService=a,this.userProviderService=c,this.processDocumentInstances=[],this.tasks=[],this.formDefinition=null,this.roles=[],this.snapshot=this.route.snapshot.paramMap,this.documentDefinitionName=this.snapshot.get("documentDefinitionName")||"",this.documentId=this.snapshot.get("documentId")||"",this.options=new m.FormioOptionsImpl,this.options.disableAlerts=!0}return e.prototype.ngOnInit=function(){this.moment=A,this.init()},e.prototype.init=function(){var e=this;this.documentService.getDocument(this.documentId).subscribe((function(t){e.document=t})),this.formService.getFormDefinitionByNamePreFilled(this.documentDefinitionName+".summary",this.documentId).subscribe((function(t){e.formDefinition=t})),this.userProviderService.getUserSubject().subscribe((function(t){e.roles=t.roles,e.tasks=[],e.loadProcessDocumentInstances(e.documentId)}))},e.prototype.loadProcessDocumentInstances=function(e){var t=this;this.documentService.findProcessDocumentInstances(e).subscribe((function(e){t.processDocumentInstances=e,t.processDocumentInstances.forEach((function(e){t.loadProcessInstanceTasks(e.id.processInstanceId)}))}))},e.prototype.loadProcessInstanceTasks=function(e){var t=this;this.processService.getProcessInstanceTasks(e).subscribe((function(e){e.forEach((function(e){e.createdUnix=t.moment(e.created).unix(),e.created=t.moment(e.created).format("DD MMM YYYY HH:mm"),e.isLocked=function(){var n,i,o=!0;try{for(var s=N(e.identityLinks),r=s.next();!r.done;r=s.next()){var a=r.value;if("candidate"===a.type&&a.groupId&&t.roles.includes(a.groupId)){o=!1;break}}}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return o}})),t.tasks=t.tasks.concat(e),t.tasks.sort((function(e,t){return t.createdUnix-e.createdUnix}))}))},e.prototype.rowTaskClick=function(e){this.taskDetail.openTaskDetails(e)},e}();M.decorators=[{type:t.Component,args:[{selector:"valtimo-dossier-detail-tab-summary",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<div class="container-fluid">\n <div class="row py-4">\n <div class="col-sm-12 col-md-8 col-xl-9">\n <div *ngIf="document">\n <div *ngIf="formDefinition" class="summaryForm">\n <div class="mb-4">\n <valtimo-form-io [form]="formDefinition" [options]="options"></valtimo-form-io>\n </div>\n </div>\n </div>\n </div>\n\n \x3c!--Current user tasks right side--\x3e\n <div class="col-sm-12 col-md-4 col-xl-3">\n <h4 class="user-tasks-title">User tasks</h4>\n <ng-container *ngIf="!tasks.length">\n <valtimo-widget>\n <div class="p-3">\n <img class="float-left" src="assets/audit-2.png" height="25" />\n <span class="float-right">{{ \'summary.userTasksDoneState\' | translate }}</span>\n <div class="clearfix"></div>\n </div>\n </valtimo-widget>\n </ng-container>\n <ng-container *ngFor="let task of tasks">\n <valtimo-widget>\n <div\n class="p-3 clickable hoverable"\n (click)="rowTaskClick(task)"\n *ngIf="!task.isLocked()"\n >\n <span class="float-right badge badge-pill badge-primary">Open</span>\n <strong>{{ task.name }}</strong>\n <div>Created {{ task.created }}</div>\n </div>\n <div class="p-3 hoverable" *ngIf="task.isLocked()">\n <span\n class="float-right badge badge-pill badge-secondary bg-grey"\n ngbTooltip="{{ \'summary.taskLocked\' | translate }}"\n >\n <i class="icon mdi mdi-lock"></i>\n </span>\n <strong>{{ task.name }}</strong>\n <div>Created {{ task.created }}</div>\n </div>\n </valtimo-widget>\n </ng-container>\n <valtimo-task-detail-modal\n #taskDetail\n (formSubmit)="init()"\n (assignmentOfTaskChanged)="init()"\n ></valtimo-task-detail-modal>\n </div>\n </div>\n</div>\n',encapsulation:t.ViewEncapsulation.None,styles:['/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.hoverable:hover{background-color:#eee}.summaryForm .formio-component{margin-bottom:0!important}.summaryForm .formio-component div[ref=element] .form-control{background-color:#fff;border:0;font-size:13px;height:24px!important;margin:0;padding:0!important}.summaryForm .formio-field div[ref=element] .form-control{font-weight:400}.summaryForm .formio-value div[ref=element] .form-control{font-weight:700}.user-tasks-title{color:#000;font-weight:400;height:20px;margin-bottom:12px;margin-top:0}']}]}],M.ctorParameters=function(){return[{type:n.Router},{type:o.DocumentService},{type:u.TaskService},{type:l.ProcessService},{type:t.ElementRef},{type:t.Renderer2},{type:n.ActivatedRoute},{type:d.FormService},{type:p.UserProviderService}]},M.propDecorators={taskDetail:[{type:t.ViewChild,args:["taskDetail"]}]};var P=function(){function e(e,t){this.route=e,this.documentService=t;var n=this.route.snapshot.paramMap;this.documentId=n.get("documentId")||""}return e.prototype.ngOnInit=function(){var e=this;this.documentService.findProcessDocumentInstances(this.documentId).subscribe((function(t){e.processDocumentInstances=t,e.selectedProcessInstanceId=t[0].id.processInstanceId}))},e.prototype.loadProcessInstance=function(e){this.selectedProcessInstanceId=e},e}();P.decorators=[{type:t.Component,args:[{selector:"valtimo-dossier-detail-tab-progress",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<div class="full-height-tab-content" *ngIf="processDocumentInstances">\n <div class="col-3">\n <label><strong>Process</strong></label\n ><br />\n <select class="form-control" (change)="loadProcessInstance($event.target.value)">\n <option\n *ngFor="let processDocumentInstance of processDocumentInstances"\n [value]="processDocumentInstance.id.processInstanceId"\n [selected]="selectedProcessInstanceId === processDocumentInstance.id.processInstanceId"\n >\n {{ processDocumentInstance.processName }}\n </option>\n </select>\n </div>\n <valtimo-process-diagram\n [processInstanceId]="selectedProcessInstanceId"\n ></valtimo-process-diagram>\n</div>\n',styles:[".full-height-tab-content{height:calc(100vh - 380px);width:100%}"]}]}],P.ctorParameters=function(){return[{type:n.ActivatedRoute},{type:o.DocumentService}]};var R=s;R.locale(localStorage.getItem("langKey")||""),R.defaultFormat="DD MMM YYYY HH:mm";var F=function(){function e(e,n,i){this.route=e,this.documentService=n,this.spinnerService=i,this.paginationClicked=new t.EventEmitter,this.defaultAuditPage=0,this.spinnerService.show("auditSpinner");var o=this.route.snapshot.paramMap;this.documentId=o.get("documentId")||""}return e.getTranslationKey=function(e){var t=e.className.split(".");return"events."+t[t.length-1]},e.prototype.ngOnInit=function(){this.loadAuditPage(this.defaultAuditPage)},e.prototype.loadAuditPage=function(t){var n=this;this.documentService.getAuditLog(this.documentId,t).subscribe((function(t){var i=[];t.content.forEach((function(t){var n=R(t.metaData.occurredOn),o=n.fromNow();i.push(new m.TimelineItemImpl(n.format("DD MMM YYYY"),n.format("HH:mm"),t.metaData.user,o,e.getTranslationKey(t.auditEvent),t.auditEvent))})),n.timelineItems=i,n.spinnerService.hide("auditSpinner"),n.pagination=t,n.pagination.number+=1}))},e.prototype.onChangePagination=function(e){this.paginationClicked.emit(e),this.currentAuditPage=e-1,this.loadAuditPage(this.currentAuditPage)},e}();F.decorators=[{type:t.Component,args:[{selector:"valtimo-dossier-detail-tab-audit",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<div *ngIf="timelineItems">\n <valtimo-timeline [items]="timelineItems"></valtimo-timeline>\n</div>\n<valtimo-spinner\n [useBootstrapSpinner]="false"\n name="auditSpinner"\n bdColor="rgba(125, 125, 125, 0.35)"\n color="#264251"\n type="square-jelly-box"\n>\n</valtimo-spinner>\n<div\n class="pagination-holder audit-pagination bg-light px-4 pt-4 pb-2 overflow-auto row mr-0 ml-0"\n *ngIf="pagination && pagination.totalElements > pagination.size"\n>\n <div class="float-left page-count col-4">\n <strong>{{\n \'list.currentPage\' | translate: {current: pagination.number, total: pagination.totalPages}\n }}</strong>\n <br />\n {{\n pagination.totalElements === 1\n ? (\'list.showingResult\' | translate: {number: pagination.content.length})\n : (\'list.showingResults\'\n | translate: {number: pagination.content.length, total: pagination.totalElements})\n }}\n </div>\n <div class="col-8">\n <ngb-pagination\n *ngIf="pagination.totalElements > pagination.size"\n class="float-right"\n [collectionSize]="pagination.totalElements"\n [(page)]="pagination.number"\n [pageSize]="pagination.size"\n [maxSize]="pagination.size"\n [rotate]="true"\n (pageChange)="onChangePagination(pagination.number)"\n ></ngb-pagination>\n </div>\n</div>\n',styles:[".audit-pagination{border-top:1px solid #dee2e6;margin:0 -1.923rem -1.923rem!important}"]}]}],F.ctorParameters=function(){return[{type:n.ActivatedRoute},{type:o.DocumentService},{type:h.NgxSpinnerService}]},F.propDecorators={paginationClicked:[{type:t.Output}]};var E=function(){function e(e,t,n,i,o,s,a){var c,l,u=this;this.route=e,this.documentService=t,this.toastrService=n,this.uploadProviderService=i,this.downloadService=o,this.translateService=s,this.configService=a,this.maxFileSize=(null===(l=null===(c=this.configService)||void 0===c?void 0:c.config)||void 0===l?void 0:l.caseFileSizeUploadLimitMB)||5,this.refetch$=new r.BehaviorSubject(null),this.relatedFiles$=this.refetch$.pipe(v.switchMap((function(){return r.combineLatest([u.documentService.getDocument(u.documentId),u.translateService.stream("key")])})),v.map((function(e){var t=x(e,1)[0];return((null==t?void 0:t.relatedFiles)||[]).map((function(e){return Object.assign(Object.assign({},e),{createdBy:e.createdBy||u.translateService.instant("list.automaticallyGenerated")})}))||[]}))),this.fields=[{key:"fileName",label:"File name"},{key:"sizeInBytes",label:"Size in bytes"},{key:"createdOn",label:"Created on",viewType:"date"},{key:"createdBy",label:"Created by"}],this.actions=[{columnName:"",iconClass:"fas fa-external-link-alt",callback:this.downloadDocument.bind(this)},{columnName:"",iconClass:"fas fa-trash-alt",callback:this.removeRelatedFile.bind(this)}],this.uploading$=new r.BehaviorSubject(!1);var d=this.route.snapshot.paramMap;this.documentId=d.get("documentId")||"",this.documentDefinitionName=d.get("documentDefinitionName")||""}return e.prototype.ngOnInit=function(){this.refetchDocuments()},e.prototype.fileSelected=function(e){var t=this;this.uploading$.next(!0),this.uploadProviderService.uploadFile(e,this.documentDefinitionName).pipe(v.switchMap((function(e){return t.documentService.assignResource(t.documentId,e.data.resourceId)}))).subscribe((function(){t.toastrService.success("Successfully uploaded document to dossier"),t.refetchDocuments(),t.uploading$.next(!1)}),(function(){t.toastrService.error("Failed to upload document to dossier"),t.uploading$.next(!1)}))},e.prototype.downloadDocument=function(e){var t=this;this.uploadProviderService.getResource(e.fileId).subscribe((function(e){t.downloadService.downloadFile(e.url,e.resource.name)}))},e.prototype.removeRelatedFile=function(e){var t=this;this.documentService.removeResource(this.documentId,e.fileId).subscribe((function(){t.toastrService.success("Successfully removed document from dossier"),t.refetchDocuments()}),(function(){t.toastrService.error("Failed to remove document from dossier")}))},e.prototype.refetchDocuments=function(){this.refetch$.next(null)},e}();E.decorators=[{type:t.Component,args:[{selector:"valtimo-dossier-detail-tab-documents",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<valtimo-dropzone\n (fileSelected)="fileSelected($event)"\n [acceptedFiles]="null"\n [hideFilePreview]="true"\n [hideTitle]="true"\n [maxFileSize]="maxFileSize"\n [showMaxFileSize]="true"\n [camera]="false"\n [uploading]="uploading$ | async"\n></valtimo-dropzone>\n\n<valtimo-widget>\n <valtimo-list\n [fields]="fields"\n [items]="relatedFiles$ | async"\n [header]="true"\n [isSearchable]="true"\n [viewMode]="true"\n [actions]="actions"\n >\n <div header>\n <h3 class="list-header-title">{{ \'Related documents\' | translate }}</h3>\n <h5 class="list-header-description">\n {{ \'Overview of all documents in this dossier\' | translate }}\n </h5>\n </div>\n </valtimo-list>\n</valtimo-widget>\n',styles:[""]}]}],E.ctorParameters=function(){return[{type:n.ActivatedRoute},{type:o.DocumentService},{type:f.ToastrService},{type:g.UploadProviderService},{type:g.DownloadService},{type:i.TranslateService},{type:a.ConfigService}]};var U=new t.InjectionToken("TabMap"),q=new Map([[e.DefaultTabs.summary,M],[e.DefaultTabs.progress,P],[e.DefaultTabs.audit,F],[e.DefaultTabs.documents,E]]),j=function(){function e(e){var t=this;void 0===e&&(e=q),this.tabs=[],this.tabMap=e;var n=0;this.tabMap.forEach((function(e,i,o){t.tabs.push(new k(i,n,e)),n++}))}return e.prototype.getTabs=function(){return this.tabs},e}();j.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new j(t.ɵɵinject(U))},token:j,providedIn:"root"}),j.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],j.ctorParameters=function(){return[{type:Map,decorators:[{type:t.Inject,args:[U]}]}]};var Y=function(){function e(e,t,n,i,o,s,r,a){this.componentFactoryResolver=e,this.translateService=t,this.documentService=n,this.processService=i,this.route=o,this.router=s,this.location=r,this.tabService=a,this.document=null,this.tabLoader=null,this.processDefinitionListFields=[],this.processDocumentDefinitions=[],this.snapshot=this.route.snapshot.paramMap,this.documentDefinitionName=this.snapshot.get("documentDefinitionName")||"",this.documentId=this.snapshot.get("documentId")||""}return e.prototype.ngOnInit=function(){var e=this;this.tabLoader=new L(this.tabService.getTabs(),this.componentFactoryResolver,this.viewContainerRef,this.translateService,this.router,this.location),this.documentService.getDocumentDefinition(this.documentDefinitionName).subscribe((function(t){e.documentDefinitionNameTitle=t.schema.title})),this.initialTabName=this.snapshot.get("tab"),this.tabLoader.initial(this.initialTabName),this.getAllAssociatedProcessDefinitions()},e.prototype.getAllAssociatedProcessDefinitions=function(){var e=this;this.documentService.findProcessDocumentDefinitions(this.documentDefinitionName).subscribe((function(t){e.processDocumentDefinitions=t.filter((function(e){return e.startableByUser})),e.processDefinitionListFields=[{key:"processName",label:"Proces"}]}))},e.prototype.startProcess=function(e){this.supportingProcessStart.openModal(e,this.documentId)},e}();Y.decorators=[{type:t.Component,args:[{selector:"valtimo-dossier-detail",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<div class="main-content">\n <div class="container-fluid">\n <div class="col-12 px-0 mb-5">\n <valtimo-widget>\n <div class="card-header bg-light card-header-divider pb-5">\n {{ documentDefinitionNameTitle }}\n <div class="btn-group mt-m3px mb-3 float-right">\n <valtimo-extension\n module="dossier"\n page="dossier-detail"\n section="card-header"\n ></valtimo-extension>\n <div class="dropdown">\n <button\n class="btn btn-primary dropdown-toggle"\n type="button"\n id="startProcessDropdown"\n placement="bottom"\n [ngbTooltip]="processDocumentDefinitions.length === 0 ? \'No action\' : null"\n [disabled]="processDocumentDefinitions.length === 0"\n data-toggle="dropdown"\n aria-haspopup="true"\n aria-expanded="false"\n >\n <span>Start</span>\n <i class="pl-2 fas fa-caret-down"></i>\n </button>\n <div class="dropdown-menu dropdown-menu-right" aria-labelledby="startProcessDropdown">\n <button\n *ngFor="let processDocumentDefinition of processDocumentDefinitions"\n class="dropdown-item p"\n href="#"\n (click)="startProcess(processDocumentDefinition)"\n >\n {{ processDocumentDefinition.processName }}\n </button>\n </div>\n </div>\n </div>\n </div>\n <ul class="nav nav-tabs">\n <li class="nav-item" *ngFor="let tab of tabLoader.tabs">\n <a\n id="{{ tab.name }}-tab"\n class="nav-link clickable"\n [ngClass]="{active: tab.isActive()}"\n data-toggle="tab"\n (click)="tabLoader.load(tab)"\n >\n {{ tabLoader.translateTabName(tab) }}\n </a>\n </li>\n </ul>\n <div class="card-body bg-white p-5 position-relative tab-container">\n <ng-template #tabContainer>Loading...</ng-template>\n <div class="clearfix"></div>\n </div>\n </valtimo-widget>\n </div>\n <valtimo-dossier-supporting-process-start-modal\n (formSubmit)="tabLoader.refreshView()"\n #supportingProcessStartModal\n ></valtimo-dossier-supporting-process-start-modal>\n </div>\n</div>\n',styles:[".tab-container{min-height:300px}"]}]}],Y.ctorParameters=function(){return[{type:t.ComponentFactoryResolver},{type:i.TranslateService},{type:o.DocumentService},{type:l.ProcessService},{type:n.ActivatedRoute},{type:n.Router},{type:c.Location},{type:j}]},Y.propDecorators={viewContainerRef:[{type:t.ViewChild,args:["tabContainer",{read:t.ViewContainerRef,static:!0}]}],supportingProcessStart:[{type:t.ViewChild,args:["supportingProcessStartModal"]}]};var B=s;B.locale(localStorage.getItem("langKey")||"");var _=function(){function e(e,t,n){var i=this;this.contactMomentService=e,this.alertService=t,this.translateService=n,this.refetchContactMoments$=new r.BehaviorSubject(""),this.contactMoments$=this.refetchContactMoments$.pipe(v.switchMap((function(){return i.contactMomentService.getContactMoments()})),v.map((function(e){return e.map((function(e){var t=B(e.registratiedatum);return new m.TimelineItemImpl(t.format("DD MMM YYYY"),t.format("HH:mm"),e.medewerkerIdentificatie.achternaam,e.kanaal,e.tekst,null)}))}))),this.text$=new r.BehaviorSubject(""),this.channel$=new r.BehaviorSubject("MAIL"),this.requestData$=r.combineLatest([this.text$,this.channel$]),this.valid$=this.requestData$.pipe(v.map((function(e){var t=x(e,2),n=t[0],i=t[1];return!(!n||!i)}))),this.disabled$=new r.BehaviorSubject(!1)}return e.prototype.textChange=function(e){this.text$.next(e)},e.prototype.buttonClick=function(){this.modal.show()},e.prototype.saveNote=function(){var e=this;this.disable(),this.requestData$.pipe(v.take(1)).subscribe((function(t){var n=x(t,2),i=n[0],o=n[1];e.contactMomentService.saveContactMoment({kanaal:o,tekst:i}).subscribe((function(){e.alertService.success(e.translateService.instant("dossier.contactMoments.saveSuccess")),e.enable(),e.clear(),e.modal.hide(),e.refetchContactMoments()}),(function(){e.enable()}))}))},e.prototype.disable=function(){this.disabled$.next(!0)},e.prototype.enable=function(){this.disabled$.next(!1)},e.prototype.clear=function(){this.text$.next("")},e.prototype.refetchContactMoments=function(){this.refetchContactMoments$.next("")},e}();_.decorators=[{type:t.Component,args:[{selector:"valtimo-dossier-detail-tab-contact-moments",template:'\x3c!--\n ~ Copyright 2015-2021 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<div class="contact-moments-container">\n <ng-container *ngTemplateOutlet="buttons"></ng-container>\n <ng-container *ngTemplateOutlet="moments"></ng-container>\n</div>\n\n<valtimo-modal\n #contactMomentsNoteModal\n [title]="\'dossier.contactMoments.popupTitle\' | translate"\n [showFooter]="true"\n [elementId]="\'contact-moments-modal\'"\n>\n <div class="mt-2" body>\n <ng-container *ngTemplateOutlet="body"></ng-container>\n </div>\n <div footer>\n <ng-container *ngTemplateOutlet="footer"></ng-container>\n </div>\n</valtimo-modal>\n\n<ng-template #body>\n <form>\n <div class="form-group row">\n <label class="col-12 col-sm-3 col-form-label text-sm-right" for="body">\n {{ \'dossier.contactMoments.noteText\' | translate }}\n </label>\n <div class="col-12 col-sm-8 col-lg-6">\n <textarea\n [disabled]="disabled$ | async"\n class="form-control"\n id="body"\n name="body"\n [ngModel]="text$ | async"\n (ngModelChange)="textChange($event)"\n ></textarea>\n </div>\n </div>\n </form>\n</ng-template>\n\n<ng-template #footer>\n <button\n *ngIf="(disabled$ | async) === false; else loading"\n class="btn btn-primary"\n [disabled]="(valid$ | async) === false || (disabled$ | async)"\n (click)="saveNote()"\n >\n {{ \'dossier.contactMoments.saveButtonText\' | translate }}\n </button>\n</ng-template>\n\n<ng-template #loading>\n <valtimo-spinner [noMarginTop]="true"></valtimo-spinner>\n</ng-template>\n\n<ng-template #buttons>\n <div class="btn-group mt-m3px mb-3 button-container">\n <button class="btn btn-primary btn-space" (click)="buttonClick()">\n <i class="icon mdi mdi-calendar-note"></i>\n &nbsp;{{ \'dossier.contactMoments.makeNoteButton\' | translate }}\n </button>\n </div>\n</ng-template>\n\n<ng-template #moments>\n <div *ngIf="contactMoments$ | async as contactMoments; else loading">\n <valtimo-timeline [items]="contactMoments"></valtimo-timeline>\n </div>\n</ng-template>\n',styles:['/*!\n * Copyright 2015-2021 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.contact-moments-container{display:flex;flex-direction:column}.button-container{align-self:flex-end;display:inline}']}]}],_.ctorParameters=function(){return[{type:b.ContactMomentService},{type:m.AlertService},{type:i.TranslateService}]},_.propDecorators={modal:[{type:t.ViewChild,args:["contactMomentsNoteModal"]}]};var V=s;V.locale(localStorage.getItem("langKey")||"");var K=function(){function e(e,t,n,i,o,s){this.taskService=e,this.documentService=t,this.route=n,this.toastr=i,this.location=o,this.customDefinitions={};var r=this.route.snapshot.paramMap;this.documentDefinitionName=r.get("documentDefinitionName")||"",this.documentId=r.get("documentId")||"",this.taskId=r.get("taskId")||"",this.implementationDefinitions=s.getImplementationEnvironmentDefinitions(this.documentDefinitionName),this.loadDocumentDefinition(this.documentDefinitionName),this.loadDocument(this.documentId)}return e.prototype.ngOnInit=function(){this.getTask(this.taskId),this.implementationDefinitions.definitions.detail.summary&&(this.customDefinitions=this.implementationDefinitions.definitions.detail.summary)},e.prototype.loadDocumentDefinition=function(e){var t=this;this.documentService.getDocumentDefinition(e).subscribe((function(e){t.schema=e.schema}))},e.prototype.loadDocument=function(e){var t=this;this.documentService.getDocument(e).subscribe((function(e){t.document=e}))},e.prototype.getTask=function(e){var t=this;this.taskService.getTask(e).subscribe((function(e){t.task=e,t.task.task.created=V(t.task.task.created).format("DD MMM YYYY HH:mm"),t.page={title:t.task.task.name,subtitle:"Created "+V(t.task.task.created).fromNow()}}))},e.prototype.reset=function(){this.loadDocument(this.documentId)},e.prototype.back=function(){this.location.back()},e.prototype.save=function(){var e=this,t={documentId:this.document.id,content:this.document.content,versionBasedOn:this.document.version};this.documentService.modifyDocument(t).subscribe((function(t){e.document=t.document,e.toastr.success("Document aangepast"),e.location.back()}))},e.prototype.submit=function(e){var t=this,n=Object.assign({},this.document.content,e),i={request:{documentId:this.document.id,content:n,versionBasedOn:this.document.version},taskId:this.task.task.id};this.documentService.modifyDocumentAndCompleteTask(i).subscribe((function(e){t.toastr.success(t.task.task.name+" has successfully been completed"),t.location.back()}))},e.prototype.returnZero=function(){return 0},e}();K.decorators=[{type:t.Component,args:[{selector:"valtimo-dossier-update",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<div class="main-content">\n <div class="container-fluid">\n <div class="col-12 px-0 mb-5">\n <valtimo-widget [title]="page?.title" [subtitle]="page?.subtitle" [divider]="true">\n <div class="card-body">\n \x3c!--view with custom definitions--\x3e\n <div *ngIf="this.customDefinitions">\n <div\n class="mb-4"\n *ngFor="let definition of this.customDefinitions | keyvalue: returnZero"\n ></div>\n <div class="row pt-3 mt-1">\n <div class="col-sm-12">\n <div class="text-right">\n <button\n class="btn btn-space btn-default float-left"\n type="button"\n (click)="back()"\n id="back-button"\n >\n Back\n </button>\n <button\n class="btn btn-space btn-secondary"\n type="button"\n (click)="reset()"\n id="reset-button"\n >\n Reset\n </button>\n <button\n class="btn btn-space btn-primary"\n type="button"\n (click)="save()"\n id="save-button"\n >\n Save\n </button>\n <button\n class="btn btn-space btn-primary"\n type="submit"\n (click)="submit({})"\n id="submit-button"\n >\n Submit\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <valtimo-camunda-form\n *ngIf="task?.formFields && !this.customDefinitions"\n (submitted)="submit($event)"\n [formFields]="task.formFields"\n [componentName]="task.formLocation"\n ></valtimo-camunda-form>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n',styles:[""]}]}],K.ctorParameters=function(){return[{type:u.TaskService},{type:o.DocumentService},{type:n.ActivatedRoute},{type:f.ToastrService},{type:c.Location},{type:C}]};var H={title:"Dossiers",roles:[a.ROLE_USER]},W={title:"Dossiers",parentPath:"dossiers/:documentDefinitionName",roles:[a.ROLE_USER]},z={title:"Task details",parentPath:"dossiers/:documentDefinitionName/document/:documentId/:tab",roles:[a.ROLE_USER]},G=[{path:"dossiers/:documentDefinitionName",component:O,canActivate:[p.AuthGuardService],data:H},{path:"dossiers/:documentDefinitionName/document/:documentId/:tab",component:Y,canActivate:[p.AuthGuardService],data:W},{path:"dossiers/:documentDefinitionName/document/:documentId/:tab/tasks/:taskId",component:K,canActivate:[p.AuthGuardService],data:z}],J=function(){};J.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.RouterModule.forChild(G)],exports:[n.RouterModule]}]}];var Z=function(){function e(e,t,n,i,o,s,r){this.route=e,this.router=t,this.processService=n,this.documentService=i,this.formLinkService=o,this.userProviderService=s,this.logger=r}return e.prototype.ngOnInit=function(){this.isUserAdmin()},e.prototype.loadFormDefinition=function(){var e=this;this.formDefinition=null,this.formLinkService.getStartEventFormDefinitionByProcessDefinitionKey(this.processDefinitionKey).subscribe((function(t){e.formAssociation=t.formAssociation;var n=e.formAssociation.formLink.className.split(".");switch(n[n.length-1]){case"BpmnElementFormIdLink":e.formDefinition=t,e.modal.show();break;case"BpmnElementUrlLink":var i=e.router.serializeUrl(e.router.createUrlTree([t.formAssociation.formLink.url]));window.open(i,"_blank");break;case"BpmnElementAngularStateUrlLink":e.router.navigate([t.formAssociation.formLink.url]);break;default:e.logger.fatal("Unsupported class name")}}),(function(t){e.modal.show()}))},e.prototype.gotoFormLinkScreen=function(){this.modal.hide(),this.router.navigate(["form-links"],{queryParams:{process:this.processDefinitionKey}})},Object.defineProperty(e.prototype,"modalTitle",{get:function(){return"Start - "+this.processName},enumerable:!1,configurable:!0}),e.prototype.openModal=function(e){this.processDefinitionKey=e.id.processDefinitionKey,this.documentDefinitionName=e.id.documentDefinitionId.name,this.processName=e.processName,this.options=new m.FormioOptionsImpl,this.options.disableAlerts=!0;this.options.setHooks((function(e,t){t(null,e)})),this.loadFormDefinition()},e.prototype.onSubmit=function(e){var t=this;this.formioSubmission=e,this.formLinkService.onSubmit(this.processDefinitionKey,this.formAssociation.formLink.id,e.data).subscribe((function(e){t.modal.hide(),t.router.navigate(["dossiers",t.documentDefinitionName,"document",e.documentId,"summary"])}),(function(e){t.form.showErrors(e)}))},e.prototype.isUserAdmin=function(){var e=this;this.userProviderService.getUserSubject().subscribe((function(t){e.isAdmin=t.roles.includes("ROLE_ADMIN")}),(function(t){e.logger.error("Failed to retrieve user identity",t),e.isAdmin=!1}))},e}();Z.decorators=[{type:t.Component,args:[{selector:"valtimo-dossier-process-start-modal",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<valtimo-modal #processStartModal elementId="processStartModal" [title]="modalTitle">\n <div body *ngIf="formDefinition">\n <valtimo-form-io #form [form]="formDefinition" [options]="options" (submit)="onSubmit($event)">\n </valtimo-form-io>\n </div>\n <div body *ngIf="!formDefinition && isAdmin">\n <div\n class="bg-warning text-black mb-0 p-3 text-center"\n [translate]="\'formManagement.noFormDefinitionFoundAdmin\'"\n ></div>\n <div class="mb-0 mt-4 p-3 text-center">\n <button\n class="btn btn-secondary btn-space"\n type="button"\n (click)="gotoFormLinkScreen()"\n id="form-link-button"\n >\n {{ \'formManagement.gotoFormLinksButton\' | translate }}\n </button>\n </div>\n </div>\n <div body *ngIf="!formDefinition && !isAdmin">\n <div\n class="bg-warning text-black mb-0 p-3 text-center"\n [translate]="\'formManagement.noFormDefinitionFoundUser\'"\n ></div>\n </div>\n</valtimo-modal>\n',encapsulation:t.ViewEncapsulation.None,styles:['/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */#processStartModal .formio-component-submit{text-align:right}']}]}],Z.ctorParameters=function(){return[{type:n.ActivatedRoute},{type:n.Router},{type:l.ProcessService},{type:o.DocumentService},{type:S.FormLinkService},{type:p.UserProviderService},{type:D.NGXLogger}]},Z.propDecorators={form:[{type:t.ViewChild,args:["form",{static:!1}]}],modal:[{type:t.ViewChild,args:["processStartModal",{static:!1}]}]};var X=function(){function e(e,n,i,o,s,r){this.route=e,this.router=n,this.processService=i,this.documentService=o,this.formLinkService=s,this.logger=r,this.formSubmit=new t.EventEmitter}return e.prototype.loadFormDefinition=function(){var e=this;this.formDefinition=null,this.formLinkService.getStartEventFormDefinitionByProcessDefinitionKey(this.processDefinitionKey).subscribe((function(t){e.formAssociation=t.formAssociation;var n=e.formAssociation.formLink.className.split(".");switch(n[n.length-1]){case"BpmnElementFormIdLink":e.formDefinition=t,e.documentService.getDocument(e.documentId).subscribe((function(t){e.submission={data:t.content}}),(function(){return r.noop()})),e.modal.show();break;case"BpmnElementUrlLink":var i=e.router.serializeUrl(e.router.createUrlTree([t.formAssociation.formLink.url]));window.open(i,"_blank");break;case"BpmnElementAngularStateUrlLink":e.route.params.pipe(v.take(1)).subscribe((function(n){var i=null==n?void 0:n.documentId;e.router.navigate([t.formAssociation.formLink.url],{state:Object.assign({},i&&{documentId:i})})}));break;default:e.logger.fatal("Unsupported class name")}}),(function(t){e.modal.show()}))},Object.defineProperty(e.prototype,"modalTitle",{get:function(){return"Start - "+this.processName},enumerable:!1,configurable:!0}),e.prototype.openModal=function(e,t){this.documentId=t,this.documentDefinitionName=e.id.documentDefinitionId.name,this.processDefinitionKey=e.id.processDefinitionKey,this.processName=e.processName,this.options=new m.FormioOptionsImpl,this.options.disableAlerts=!0;this.options.setHooks((function(e,t){t(null,e)})),this.loadFormDefinition()},e.prototype.onSubmit=function(e){var t=this;this.formioSubmission=e,this.formLinkService.onSubmit(this.processDefinitionKey,this.formAssociation.formLink.id,e.data,this.documentId).subscribe((function(e){t.modal.hide(),t.formSubmit.emit()}),(function(e){t.form.showErrors(e)}))},e.prototype.gotoFormLinkScreen=function(){this.modal.hide(),this.router.navigate(["form-links"],{queryParams:{process:this.processDefinitionKey}})},e}();X.decorators=[{type:t.Component,args:[{selector:"valtimo-dossier-supporting-process-start-modal",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<valtimo-modal\n #supportingProcessStartModal\n elementId="supportingProcessStartModal"\n [title]="modalTitle"\n>\n <div body *ngIf="formDefinition">\n <valtimo-form-io\n #form\n [submission]="submission"\n [form]="formDefinition"\n [options]="options"\n (submit)="onSubmit($event)"\n >\n </valtimo-form-io>\n </div>\n <div body *ngIf="!formDefinition">\n <div\n class="bg-warning text-black mb-0 p-3 text-center"\n [translate]="\'formManagement.noFormDefinitionFound\'"\n ></div>\n <div class="mb-0 mt-4 p-3 text-center">\n <button\n class="btn btn-secondary btn-space"\n type="button"\n (click)="gotoFormLinkScreen()"\n id="form-link-button"\n >\n {{ \'formManagement.gotoFormLinksButton\' | translate }}\n </button>\n </div>\n </div>\n</valtimo-modal>\n',encapsulation:t.ViewEncapsulation.None,styles:['/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */#supportingProcessStartModal .formio-component-submit{text-align:right}']}]}],X.ctorParameters=function(){return[{type:n.ActivatedRoute},{type:n.Router},{type:l.ProcessService},{type:o.DocumentService},{type:S.FormLinkService},{type:D.NGXLogger}]},X.propDecorators={form:[{type:t.ViewChild,args:["form",{static:!1}]}],modal:[{type:t.ViewChild,args:["supportingProcessStartModal",{static:!1}]}],formSubmit:[{type:t.Output}]};var Q=a.HttpLoaderFactory,ee=function(){function e(){}return e.forRoot=function(n){return{ngModule:e,providers:[C,j,{provide:U,useFactory:n},{provide:t.ANALYZE_FOR_ENTRY_COMPONENTS,useValue:Array.from(n().values()),multi:!0}]}},e}();ee.decorators=[{type:t.NgModule,args:[{declarations:[O,Y,M,P,F,E,_,K,Z,X],imports:[c.CommonModule,J,m.ListModule,m.WidgetModule,m.BpmnJsDiagramModule,m.TimelineModule,m.CamundaFormModule,l.ProcessModule,m.FilterSidebarModule,y.NgbButtonsModule,m.DataListModule,I.FormsModule,d.FormModule,m.FormIoModule,m.ModalModule,m.SpinnerModule,i.TranslateModule.forRoot({loader:{provide:i.TranslateLoader,useFactory:Q,deps:[w.HttpClient]}}),u.TaskModule,m.ModalModule,y.NgbTooltipModule,m.UploaderModule,m.DropzoneModule,y.NgbPaginationModule,a.ConfigModule],exports:[O,Y],entryComponents:[M,P,F,E,_]}]}],e.DEFAULT_TABS=q,e.DossierDetailComponent=Y,e.DossierDetailTabAuditComponent=F,e.DossierDetailTabContactMomentsComponent=_,e.DossierDetailTabDocumentsComponent=E,e.DossierDetailTabProgressComponent=P,e.DossierDetailTabSummaryComponent=M,e.DossierListComponent=O,e.DossierModule=ee,e.DossierService=C,e.TAB_MAP=U,e.TabImpl=k,e.TabLoaderImpl=L,e.TabService=j,e.ɵ0=Q,e.ɵa=K,e.ɵb=Z,e.ɵc=X,e.ɵd=J,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/router"),require("@ngx-translate/core"),require("@valtimo/document"),require("moment"),require("rxjs"),require("@valtimo/config"),require("@angular/common"),require("@valtimo/process"),require("@valtimo/task"),require("@valtimo/form"),require("@valtimo/components"),require("@valtimo/security"),require("ngx-spinner"),require("ngx-toastr"),require("@valtimo/resource"),require("rxjs/operators"),require("@valtimo/contact-moment"),require("@ng-bootstrap/ng-bootstrap"),require("@valtimo/form-link"),require("ngx-logger"),require("@angular/forms"),require("@angular/common/http")):"function"==typeof define&&define.amd?define("@valtimo/dossier",["exports","@angular/core","@angular/router","@ngx-translate/core","@valtimo/document","moment","rxjs","@valtimo/config","@angular/common","@valtimo/process","@valtimo/task","@valtimo/form","@valtimo/components","@valtimo/security","ngx-spinner","ngx-toastr","@valtimo/resource","rxjs/operators","@valtimo/contact-moment","@ng-bootstrap/ng-bootstrap","@valtimo/form-link","ngx-logger","@angular/forms","@angular/common/http"],t):t(((e=e||self).valtimo=e.valtimo||{},e.valtimo.dossier={}),e.ng.core,e.ng.router,e.core$1,e.document,e.moment,e.rxjs,e.config,e.ng.common,e.process,e.task,e.form,e.components,e.security,e.ngxSpinner,e.ngxToastr,e.resource,e.rxjs.operators,e.contactMoment,e.ngBootstrap,e.formLink,e.ngxLogger,e.ng.forms,e.ng.common.http)}(this,(function(e,t,n,i,o,s,r,a,c,l,u,d,m,p,h,f,g,v,b,y,S,D,I,w){"use strict";var L=function(){function e(e,t,n,i,o,s){this._tabs=null,this._componentFactoryResolver=null,this._viewContainerRef=null,this._activeComponent=null,this._activeTab=null,this._translateService=null,this._tabs=e,this._componentFactoryResolver=t,this._viewContainerRef=n,this._translateService=i,this._router=o,this._location=s}return e.prototype.initial=function(e){var t;t=e?this._tabs.find((function(t){return t.name===e})):this._tabs[0]||null,this.load(t)},e.prototype.load=function(e){e!==this._activeTab&&(this._tabs.forEach((function(e){return e.deactivate()})),this.replaceView(e),this.replaceUrlState(e),this.setActive(e))},e.prototype.refreshView=function(){this.replaceView(this._activeTab)},e.prototype.replaceView=function(e){var t=this._componentFactoryResolver.resolveComponentFactory(e.component);this._viewContainerRef.clear(),null!==this._activeTab&&this._activeComponent.destroy(),this._activeComponent=this._viewContainerRef.createComponent(t)},e.prototype.replaceUrlState=function(e){var t=this._router.url.split("/");t.splice(t.length-1,1,e.name);var n=t.join("/");this._location.replaceState(n)},e.prototype.setActive=function(e){e.activate(),this._activeTab=e},Object.defineProperty(e.prototype,"tabs",{get:function(){return this._tabs},enumerable:!1,configurable:!0}),e.prototype.translateTabName=function(e){return this._translateService.instant("dossier.tabs."+e.name)},e}(),k=function(){function e(e,t,n){this._active=!1,this._name=e,this._sequence=t,this._component=n}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sequence",{get:function(){return this._sequence},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"component",{get:function(){return this._component},enumerable:!1,configurable:!0}),e.prototype.activate=function(){this._active=!0},e.prototype.deactivate=function(){this._active=!1},e.prototype.isActive=function(){return this._active},e}();Object.create;function x(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function N(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,s=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return r}var T;Object.create;(T=e.DefaultTabs||(e.DefaultTabs={})).summary="summary",T.progress="progress",T.audit="audit",T.documents="documents",T.contactMoments="contact-moments";var C=function(){function e(e){this.configService=e,this.definitions=e.config.definitions}return e.prototype.getImplementationEnvironmentDefinitions=function(e){return this.definitions.dossiers.find((function(t){return t.name===e}))},e.prototype.getDefinitionColumns=function(e){var t=this.configService.config;return t.customDefinitionTables[e]||t.defaultDefinitionTable},e.prototype.getInitialSortState=function(e){var t=e.find((function(e){return e.default}));return{isSorting:!1,state:{name:t?t.propertyName:e[0].propertyName,direction:"DESC"}}},e}();C.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new C(t.ɵɵinject(a.ConfigService))},token:C,providedIn:"root"}),C.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],C.ctorParameters=function(){return[{type:a.ConfigService}]},s.locale(localStorage.getItem("langKey")||"");var O=function(){function t(e,t,n,i,o){this.route=e,this.router=t,this.documentService=n,this.translateService=i,this.dossierService=o,this.documentDefinitionName="",this.showCreateDocument=!1,this.items=[],this.fields=[],this.processDefinitionListFields=[],this.processDocumentDefinitions=[],this.pagination={collectionSize:0,page:1,size:10,maxPaginationItemSize:5,sort:void 0},this.selectedProcessDocumentDefinition=null,this.modalListenerAdded=!1}return t.prototype.ngOnInit=function(){this.doInit(),this.routeEvent(this.router),this.modalListenerAdded=!1},t.prototype.ngOnDestroy=function(){this.routerSubscription.unsubscribe(),this.translationSubscription.unsubscribe()},t.prototype.paginationSet=function(){this.getData()},t.prototype.routeEvent=function(e){var t=this;this.routerSubscription=e.events.subscribe((function(e){e instanceof n.NavigationEnd&&(t.doInit(),t.getData())}))},t.prototype.doInit=function(){var e=this.route.snapshot.paramMap.get("documentDefinitionName")||"",t=this.dossierService.getDefinitionColumns(e);this.documentDefinitionName=e,this.initialSortState=this.dossierService.getInitialSortState(t),this.openTranslationSubscription(t)},t.prototype.openTranslationSubscription=function(e){var t=this;this.translationSubscription=r.combineLatest(e.map((function(e){return t.translateService.stream("fieldLabels."+e.translationKey)}))).subscribe((function(n){t.fields=e.map((function(e,t){return Object.assign({key:e.propertyName,label:n[t],sortable:e.sortable},e.viewType&&{viewType:e.viewType})}))}))},t.prototype.getData=function(){if(this.findDocumentDefinition(this.documentDefinitionName),this.hasCachedSearchRequest()){var e=this.getCachedSearch();this.globalSearchFilter=e.globalSearchFilter,this.sequence=e.sequence,this.createdBy=e.createdBy,this.findDocuments(e)}else this.doSearch();this.getAllAssociatedProcessDefinitions()},t.prototype.doSearch=function(){var e=this.buildDocumentSearchRequest();this.findDocuments(e)},t.prototype.findDocuments=function(e){var t=this;return this.documentService.getDocuments(e).subscribe((function(n){t.documents=n,t.transformDocuments(t.documents.content),t.pagination.collectionSize=t.documents.totalElements,t.storeSearch(e)}))},t.prototype.getAllAssociatedProcessDefinitions=function(){var e=this;this.documentService.findProcessDocumentDefinitions(this.documentDefinitionName).subscribe((function(t){e.processDocumentDefinitions=t.filter((function(e){return e.canInitializeDocument})),e.processDefinitionListFields=[{key:"processName",label:"Proces"}]}))},t.prototype.getCachedSearch=function(){var e=JSON.parse(this.getCachedDocumentSearchRequest());return new o.DocumentSearchRequestImpl(e.definitionName,this.pagination.page-1,this.pagination.size,e.sequence,e.createdBy,e.globalSearchFilter,e.sort)},t.prototype.buildDocumentSearchRequest=function(){return new o.DocumentSearchRequestImpl(this.documentDefinitionName,this.pagination.page-1,this.pagination.size,this.sequence,this.createdBy,this.globalSearchFilter,this.pagination.sort&&this.pagination.sort.isSorting?this.pagination.sort:this.initialSortState)},t.prototype.storeSearch=function(e){localStorage.setItem(this.getCachedKey(),JSON.stringify(e))},t.prototype.getCachedDocumentSearchRequest=function(){return localStorage.getItem(this.getCachedKey())||""},t.prototype.hasCachedSearchRequest=function(){return null!==localStorage.getItem(this.getCachedKey())},t.prototype.getCachedKey=function(){return"list-search-"+this.documentDefinitionName},t.prototype.rowClick=function(t){this.router.navigate(["/dossiers/"+this.documentDefinitionName+"/document/"+t.id+"/"+e.DefaultTabs.summary])},t.prototype.startDossier=function(){this.processDocumentDefinitions.length>1?$("#startProcess").modal("show"):(this.selectedProcessDocumentDefinition=this.processDocumentDefinitions[0],this.showStartProcessModal())},t.prototype.showStartProcessModal=function(){null!==this.selectedProcessDocumentDefinition&&(this.processStart.openModal(this.selectedProcessDocumentDefinition),this.selectedProcessDocumentDefinition=null)},t.prototype.selectProcess=function(e){var t=$("#startProcess");this.modalListenerAdded||(t.on("hidden.bs.modal",this.showStartProcessModal.bind(this)),this.modalListenerAdded=!0),this.selectedProcessDocumentDefinition=e,t.modal("hide")},t.prototype.findDocumentDefinition=function(e){var t=this;this.documentService.getDocumentDefinition(e).subscribe((function(e){t.schema=e.schema}))},t.prototype.transformDocuments=function(e){this.items=e.map((function(e){var t=e.content,n=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n}(e,["content"]);return Object.assign(Object.assign({},t),n)}))},t.prototype.paginationClicked=function(e){this.pagination.page=e,this.doSearch()},t.prototype.sortChanged=function(e){this.pagination.sort=e,this.doSearch()},t.prototype.getInitialSortState=function(){if(this.hasCachedSearchRequest()){var e=JSON.parse(this.getCachedDocumentSearchRequest());return e.sort?e.sort:this.initialSortState}return this.initialSortState},t}();O.decorators=[{type:t.Component,args:[{selector:"valtimo-dossier-list",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<ng-container *ngTemplateOutlet="sidebar"></ng-container>\n\n<div class="main-content pt-0">\n <div class="container-fluid">\n <div class="col-12 px-0 mb-5">\n <div>\n <div class="text-right mt-m3px mb-3">\n <button\n type="button"\n class="btn btn-space btn-primary mr-0"\n (click)="startDossier()"\n [ngbTooltip]="processDocumentDefinitions.length === 0 ? \'No action\' : null"\n placement="bottom"\n [disabled]="processDocumentDefinitions.length === 0"\n >\n <i class="icon mdi mdi-plus mr-1"></i>\n {{ \'Start Dossier\' | translate }}\n </button>\n </div>\n\n <div\n class="modal fade"\n id="startProcess"\n tabindex="-1"\n role="dialog"\n aria-labelledby="startProcessLabel"\n aria-hidden="true"\n >\n <div class="modal-dialog modal-dialog-centered" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h3 class="modal-title" id="startProcessLabel">\n {{ \'dashboard.startProcess.title\' | translate }}\n </h3>\n <button type="button" class="close" data-dismiss="modal" aria-label="Close">\n <span aria-hidden="true">&times;</span>\n </button>\n </div>\n <div class="modal-body">\n <div class="table-responsive">\n <table class="table m-0">\n <tr\n *ngFor="let processDocumentDefinition of processDocumentDefinitions"\n (click)="selectProcess(processDocumentDefinition)"\n style="cursor: pointer"\n >\n <td>{{ processDocumentDefinition.processName }}</td>\n </tr>\n </table>\n </div>\n </div>\n <div class="modal-footer">\n <button type="button" class="btn btn-secondary" data-dismiss="modal">\n {{ \'cta.close\' | translate }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n <valtimo-widget>\n <valtimo-list\n [items]="items"\n [fields]="fields"\n (rowClicked)="rowClick($event)"\n [pagination]="pagination"\n [viewMode]="true"\n [header]="true"\n paginationIdentifier="dossierList"\n (paginationClicked)="paginationClicked($event)"\n (paginationSet)="paginationSet()"\n [initialSortState]="getInitialSortState()"\n (sortChanged)="sortChanged($event)"\n >\n <div header>\n <h3 class="list-header-title">\n {{ schema?.title }}\n <sup class="ml-1 badge badge-pill badge-primary">{{\n documents?.content.length || 0\n }}</sup>\n </h3>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </div>\n </div>\n <valtimo-dossier-process-start-modal #processStartModal></valtimo-dossier-process-start-modal>\n</div>\n\n<ng-template #sidebar>\n <valtimo-filter-sidebar>\n <h4 class="title">Search</h4>\n <div class="mb-4">\n <input\n type="text"\n class="form-control"\n placeholder="{{ \'dossier.forms.globalSearchPlaceHolder\' | translate }}"\n [(ngModel)]="globalSearchFilter"\n (blur)="doSearch()"\n (keyup.enter)="doSearch()"\n />\n </div>\n\n <div class="mb-4">\n <input\n type="number"\n class="form-control"\n placeholder="{{ \'dossier.forms.referenceNumberPlaceHolder\' | translate }}"\n [(ngModel)]="sequence"\n (blur)="doSearch()"\n (keyup.enter)="doSearch()"\n />\n </div>\n </valtimo-filter-sidebar>\n</ng-template>\n',styles:[""]}]}],O.ctorParameters=function(){return[{type:n.ActivatedRoute},{type:n.Router},{type:o.DocumentService},{type:i.TranslateService},{type:C}]},O.propDecorators={processStart:[{type:t.ViewChild,args:["processStartModal"]}]};var P=s;P.locale(localStorage.getItem("langKey")||""),P.defaultFormat="DD MMM YYYY HH:mm";var M=function(){function e(e,t,n,i,o,s,r,a,c){this.router=e,this.documentService=t,this.taskService=n,this.processService=i,this.el=o,this.renderer=s,this.route=r,this.formService=a,this.userProviderService=c,this.processDocumentInstances=[],this.tasks=[],this.formDefinition=null,this.roles=[],this.snapshot=this.route.snapshot.paramMap,this.documentDefinitionName=this.snapshot.get("documentDefinitionName")||"",this.documentId=this.snapshot.get("documentId")||"",this.options=new m.FormioOptionsImpl,this.options.disableAlerts=!0}return e.prototype.ngOnInit=function(){this.moment=P,this.init()},e.prototype.init=function(){var e=this;this.documentService.getDocument(this.documentId).subscribe((function(t){e.document=t})),this.formService.getFormDefinitionByNamePreFilled(this.documentDefinitionName+".summary",this.documentId).subscribe((function(t){e.formDefinition=t})),this.userProviderService.getUserSubject().subscribe((function(t){e.roles=t.roles,e.tasks=[],e.loadProcessDocumentInstances(e.documentId)}))},e.prototype.loadProcessDocumentInstances=function(e){var t=this;this.documentService.findProcessDocumentInstances(e).subscribe((function(e){t.processDocumentInstances=e,t.processDocumentInstances.forEach((function(e){t.loadProcessInstanceTasks(e.id.processInstanceId)}))}))},e.prototype.loadProcessInstanceTasks=function(e){var t=this;this.processService.getProcessInstanceTasks(e).subscribe((function(e){e.forEach((function(e){e.createdUnix=t.moment(e.created).unix(),e.created=t.moment(e.created).format("DD MMM YYYY HH:mm"),e.isLocked=function(){var n,i,o=!0;try{for(var s=x(e.identityLinks),r=s.next();!r.done;r=s.next()){var a=r.value;if("candidate"===a.type&&a.groupId&&t.roles.includes(a.groupId)){o=!1;break}}}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return o}})),t.tasks=t.tasks.concat(e),t.tasks.sort((function(e,t){return t.createdUnix-e.createdUnix}))}))},e.prototype.rowTaskClick=function(e){this.taskDetail.openTaskDetails(e)},e}();M.decorators=[{type:t.Component,args:[{selector:"valtimo-dossier-detail-tab-summary",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<div class="container-fluid">\n <div class="row py-4">\n <div class="col-sm-12 col-md-8 col-xl-9">\n <div *ngIf="document">\n <div *ngIf="formDefinition" class="summaryForm">\n <div class="mb-4">\n <valtimo-form-io [form]="formDefinition" [options]="options"></valtimo-form-io>\n </div>\n </div>\n </div>\n </div>\n\n \x3c!--Current user tasks right side--\x3e\n <div class="col-sm-12 col-md-4 col-xl-3">\n <h4 class="user-tasks-title">User tasks</h4>\n <ng-container *ngIf="!tasks.length">\n <valtimo-widget>\n <div class="p-3">\n <img class="float-left" src="assets/audit-2.png" height="25" />\n <span class="float-right">{{ \'summary.userTasksDoneState\' | translate }}</span>\n <div class="clearfix"></div>\n </div>\n </valtimo-widget>\n </ng-container>\n <ng-container *ngFor="let task of tasks">\n <valtimo-widget>\n <div\n class="p-3 clickable hoverable"\n (click)="rowTaskClick(task)"\n *ngIf="!task.isLocked()"\n >\n <span class="float-right badge badge-pill badge-primary">Open</span>\n <strong>{{ task.name }}</strong>\n <div>Created {{ task.created }}</div>\n </div>\n <div class="p-3 hoverable" *ngIf="task.isLocked()">\n <span\n class="float-right badge badge-pill badge-secondary bg-grey"\n ngbTooltip="{{ \'summary.taskLocked\' | translate }}"\n >\n <i class="icon mdi mdi-lock"></i>\n </span>\n <strong>{{ task.name }}</strong>\n <div>Created {{ task.created }}</div>\n </div>\n </valtimo-widget>\n </ng-container>\n <valtimo-task-detail-modal\n #taskDetail\n (formSubmit)="init()"\n (assignmentOfTaskChanged)="init()"\n ></valtimo-task-detail-modal>\n </div>\n </div>\n</div>\n',encapsulation:t.ViewEncapsulation.None,styles:['/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.hoverable:hover{background-color:#eee}.summaryForm .formio-component{margin-bottom:0!important}.summaryForm .formio-component div[ref=element] .form-control{background-color:#fff;border:0;font-size:13px;height:24px!important;margin:0;padding:0!important}.summaryForm .formio-field div[ref=element] .form-control{font-weight:400}.summaryForm .formio-value div[ref=element] .form-control{font-weight:700}.user-tasks-title{color:#000;font-weight:400;height:20px;margin-bottom:12px;margin-top:0}']}]}],M.ctorParameters=function(){return[{type:n.Router},{type:o.DocumentService},{type:u.TaskService},{type:l.ProcessService},{type:t.ElementRef},{type:t.Renderer2},{type:n.ActivatedRoute},{type:d.FormService},{type:p.UserProviderService}]},M.propDecorators={taskDetail:[{type:t.ViewChild,args:["taskDetail"]}]};var A=function(){function e(e,t){this.route=e,this.documentService=t;var n=this.route.snapshot.paramMap;this.documentId=n.get("documentId")||""}return e.prototype.ngOnInit=function(){var e=this;this.documentService.findProcessDocumentInstances(this.documentId).subscribe((function(t){e.processDocumentInstances=t,e.selectedProcessInstanceId=t[0].id.processInstanceId}))},e.prototype.loadProcessInstance=function(e){this.selectedProcessInstanceId=e},e}();A.decorators=[{type:t.Component,args:[{selector:"valtimo-dossier-detail-tab-progress",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<div class="full-height-tab-content" *ngIf="processDocumentInstances">\n <div class="col-3">\n <label><strong>Process</strong></label\n ><br />\n <select class="form-control" (change)="loadProcessInstance($event.target.value)">\n <option\n *ngFor="let processDocumentInstance of processDocumentInstances"\n [value]="processDocumentInstance.id.processInstanceId"\n [selected]="selectedProcessInstanceId === processDocumentInstance.id.processInstanceId"\n >\n {{ processDocumentInstance.processName }}\n </option>\n </select>\n </div>\n <valtimo-process-diagram\n [processInstanceId]="selectedProcessInstanceId"\n ></valtimo-process-diagram>\n</div>\n',styles:[".full-height-tab-content{height:calc(100vh - 380px);width:100%}"]}]}],A.ctorParameters=function(){return[{type:n.ActivatedRoute},{type:o.DocumentService}]};var R=s;R.locale(localStorage.getItem("langKey")||""),R.defaultFormat="DD MMM YYYY HH:mm";var F=function(){function e(e,n,i){this.route=e,this.documentService=n,this.spinnerService=i,this.paginationClicked=new t.EventEmitter,this.defaultAuditPage=0,this.spinnerService.show("auditSpinner");var o=this.route.snapshot.paramMap;this.documentId=o.get("documentId")||""}return e.getTranslationKey=function(e){var t=e.className.split(".");return"events."+t[t.length-1]},e.prototype.ngOnInit=function(){this.loadAuditPage(this.defaultAuditPage)},e.prototype.loadAuditPage=function(t){var n=this;this.documentService.getAuditLog(this.documentId,t).subscribe((function(t){var i=[];t.content.forEach((function(t){var n=R(t.metaData.occurredOn),o=n.fromNow();i.push(new m.TimelineItemImpl(n.format("DD MMM YYYY"),n.format("HH:mm"),t.metaData.user,o,e.getTranslationKey(t.auditEvent),t.auditEvent))})),n.timelineItems=i,n.spinnerService.hide("auditSpinner"),n.pagination=t,n.pagination.number+=1}))},e.prototype.onChangePagination=function(e){this.paginationClicked.emit(e),this.currentAuditPage=e-1,this.loadAuditPage(this.currentAuditPage)},e}();F.decorators=[{type:t.Component,args:[{selector:"valtimo-dossier-detail-tab-audit",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<div *ngIf="timelineItems">\n <valtimo-timeline [items]="timelineItems"></valtimo-timeline>\n</div>\n<valtimo-spinner\n [useBootstrapSpinner]="false"\n name="auditSpinner"\n bdColor="rgba(125, 125, 125, 0.35)"\n color="#264251"\n type="square-jelly-box"\n>\n</valtimo-spinner>\n<div\n class="pagination-holder audit-pagination bg-light px-4 pt-4 pb-2 overflow-auto row mr-0 ml-0"\n *ngIf="pagination && pagination.totalElements > pagination.size"\n>\n <div class="float-left page-count col-4">\n <strong>{{\n \'list.currentPage\' | translate: {current: pagination.number, total: pagination.totalPages}\n }}</strong>\n <br />\n {{\n pagination.totalElements === 1\n ? (\'list.showingResult\' | translate: {number: pagination.content.length})\n : (\'list.showingResults\'\n | translate: {number: pagination.content.length, total: pagination.totalElements})\n }}\n </div>\n <div class="col-8">\n <ngb-pagination\n *ngIf="pagination.totalElements > pagination.size"\n class="float-right"\n [collectionSize]="pagination.totalElements"\n [(page)]="pagination.number"\n [pageSize]="pagination.size"\n [maxSize]="pagination.size"\n [rotate]="true"\n (pageChange)="onChangePagination(pagination.number)"\n ></ngb-pagination>\n </div>\n</div>\n',styles:[".audit-pagination{border-top:1px solid #dee2e6;margin:0 -1.923rem -1.923rem!important}"]}]}],F.ctorParameters=function(){return[{type:n.ActivatedRoute},{type:o.DocumentService},{type:h.NgxSpinnerService}]},F.propDecorators={paginationClicked:[{type:t.Output}]};var E=function(){function e(e,t,n,i,o,s,a){var c,l,u=this;this.route=e,this.documentService=t,this.toastrService=n,this.uploadProviderService=i,this.downloadService=o,this.translateService=s,this.configService=a,this.maxFileSize=(null===(l=null===(c=this.configService)||void 0===c?void 0:c.config)||void 0===l?void 0:l.caseFileSizeUploadLimitMB)||5,this.refetch$=new r.BehaviorSubject(null),this.relatedFiles$=this.refetch$.pipe(v.switchMap((function(){return r.combineLatest([u.documentService.getDocument(u.documentId),u.translateService.stream("key")])})),v.map((function(e){var t=N(e,1)[0];return((null==t?void 0:t.relatedFiles)||[]).map((function(e){return Object.assign(Object.assign({},e),{createdBy:e.createdBy||u.translateService.instant("list.automaticallyGenerated")})}))||[]}))),this.fields=[{key:"fileName",label:"File name"},{key:"sizeInBytes",label:"Size in bytes"},{key:"createdOn",label:"Created on",viewType:"date"},{key:"createdBy",label:"Created by"}],this.actions=[{columnName:"",iconClass:"mdi mdi-open-in-new",callback:this.downloadDocument.bind(this)},{columnName:"",iconClass:"mdi mdi-delete",callback:this.removeRelatedFile.bind(this)}],this.uploading$=new r.BehaviorSubject(!1);var d=this.route.snapshot.paramMap;this.documentId=d.get("documentId")||"",this.documentDefinitionName=d.get("documentDefinitionName")||""}return e.prototype.ngOnInit=function(){this.refetchDocuments()},e.prototype.fileSelected=function(e){var t=this;this.uploading$.next(!0),this.uploadProviderService.uploadFile(e,this.documentDefinitionName).pipe(v.switchMap((function(e){return t.documentService.assignResource(t.documentId,e.data.resourceId)}))).subscribe((function(){t.toastrService.success("Successfully uploaded document to dossier"),t.refetchDocuments(),t.uploading$.next(!1)}),(function(){t.toastrService.error("Failed to upload document to dossier"),t.uploading$.next(!1)}))},e.prototype.downloadDocument=function(e){var t=this;this.uploadProviderService.getResource(e.fileId).subscribe((function(e){t.downloadService.downloadFile(e.url,e.resource.name)}))},e.prototype.removeRelatedFile=function(e){var t=this;this.documentService.removeResource(this.documentId,e.fileId).subscribe((function(){t.toastrService.success("Successfully removed document from dossier"),t.refetchDocuments()}),(function(){t.toastrService.error("Failed to remove document from dossier")}))},e.prototype.refetchDocuments=function(){this.refetch$.next(null)},e}();E.decorators=[{type:t.Component,args:[{selector:"valtimo-dossier-detail-tab-documents",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<valtimo-dropzone\n (fileSelected)="fileSelected($event)"\n [acceptedFiles]="null"\n [hideFilePreview]="true"\n [hideTitle]="true"\n [maxFileSize]="maxFileSize"\n [showMaxFileSize]="true"\n [camera]="false"\n [uploading]="uploading$ | async"\n></valtimo-dropzone>\n\n<valtimo-widget>\n <valtimo-list\n [fields]="fields"\n [items]="relatedFiles$ | async"\n [header]="true"\n [isSearchable]="true"\n [viewMode]="true"\n [actions]="actions"\n >\n <div header>\n <h3 class="list-header-title">{{ \'Related documents\' | translate }}</h3>\n <h5 class="list-header-description">\n {{ \'Overview of all documents in this dossier\' | translate }}\n </h5>\n </div>\n </valtimo-list>\n</valtimo-widget>\n',styles:[""]}]}],E.ctorParameters=function(){return[{type:n.ActivatedRoute},{type:o.DocumentService},{type:f.ToastrService},{type:g.UploadProviderService},{type:g.DownloadService},{type:i.TranslateService},{type:a.ConfigService}]};var U=new t.InjectionToken("TabMap"),q=new Map([[e.DefaultTabs.summary,M],[e.DefaultTabs.progress,A],[e.DefaultTabs.audit,F],[e.DefaultTabs.documents,E]]),j=function(){function e(e){var t=this;void 0===e&&(e=q),this.tabs=[],this.tabMap=e;var n=0;this.tabMap.forEach((function(e,i,o){t.tabs.push(new k(i,n,e)),n++}))}return e.prototype.getTabs=function(){return this.tabs},e}();j.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new j(t.ɵɵinject(U))},token:j,providedIn:"root"}),j.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],j.ctorParameters=function(){return[{type:Map,decorators:[{type:t.Inject,args:[U]}]}]};var Y=function(){function e(e,t,n,i,o,s,r,a,c){this.componentFactoryResolver=e,this.translateService=t,this.documentService=n,this.processService=i,this.route=o,this.router=s,this.location=r,this.tabService=a,this.configService=c,this.document=null,this.tabLoader=null,this.processDefinitionListFields=[],this.processDocumentDefinitions=[],this.customDossierHeaderItems=[],this.snapshot=this.route.snapshot.paramMap,this.documentDefinitionName=this.snapshot.get("documentDefinitionName")||"",this.documentId=this.snapshot.get("documentId")||""}return e.prototype.ngOnInit=function(){var e=this;this.tabLoader=new L(this.tabService.getTabs(),this.componentFactoryResolver,this.viewContainerRef,this.translateService,this.router,this.location),this.documentService.getDocumentDefinition(this.documentDefinitionName).subscribe((function(t){e.documentDefinitionNameTitle=t.schema.title})),this.getCustomDossierHeader(),this.initialTabName=this.snapshot.get("tab"),this.tabLoader.initial(this.initialTabName),this.getAllAssociatedProcessDefinitions()},e.prototype.getAllAssociatedProcessDefinitions=function(){var e=this;this.documentService.findProcessDocumentDefinitions(this.documentDefinitionName).subscribe((function(t){e.processDocumentDefinitions=t.filter((function(e){return e.startableByUser})),e.processDefinitionListFields=[{key:"processName",label:"Proces"}]}))},e.prototype.startProcess=function(e){this.supportingProcessStart.openModal(e,this.documentId)},e.prototype.getCustomDossierHeader=function(){var e,t=this;(null===(e=this.configService.config.customDossierHeader)||void 0===e?void 0:e.hasOwnProperty(this.documentDefinitionName.toLowerCase()))&&this.documentService.getDocument(this.documentId).subscribe((function(e){var n;t.document=e,null===(n=t.configService.config.customDossierHeader[t.documentDefinitionName.toLowerCase()])||void 0===n||n.forEach((function(e){return t.getCustomDossierHeaderItem(e)}))}))},e.prototype.getCustomDossierHeaderItem=function(e){var t,n=this;this.customDossierHeaderItems.push({label:e.labelTranslationKey||"",columnSize:e.columnSize||3,textSize:e.textSize||"md",customClass:e.customClass||"",value:null===(t=e.propertyPaths)||void 0===t?void 0:t.reduce((function(t,i){return t+n.getStringFromDocumentPath(e,i)}),"")})},e.prototype.getStringFromDocumentPath=function(e,t){var n=e.propertyPaths.indexOf(t)>0?" ":"",i=t.split(".").reduce((function(e,t){return e[t]}),this.document.content)||e.noValueText||"";return n+(new RegExp("(T\\d\\d:\\d\\d:\\d\\d[+-])").test(i)?s(i).format("DD-MM-YYYY"):i)},e}();Y.decorators=[{type:t.Component,args:[{selector:"valtimo-dossier-detail",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<div class="main-content">\n <div class="container-fluid">\n <div class="col-12 px-0 mb-5">\n <valtimo-widget>\n <div class="card-header bg-light card-header-divider pb-2">\n <div class="row">\n <div class="col">\n <div class="row" *ngIf="customDossierHeaderItems.length > 0; else defaultTitle">\n <span\n class="mb-0 mt-0 pb-2 align-self-end col-xl-{{ item.columnSize }} col-lg-{{\n item.columnSize * 2\n }} {{ item.customClass }}"\n [ngClass]="{\n h1: item.textSize === \'xl\',\n h2: item.textSize === \'lg\',\n h3: item.textSize === \'md\',\n h4: item.textSize === \'sm\',\n h5: item.textSize === \'xs\'\n }"\n *ngFor="let item of customDossierHeaderItems"\n >\n <span *ngIf="item.label != \'\'">{{ item.label | translate }}</span>\n <span *ngIf="item.label != \'\' && item.value != \'\' && item.value != null">: </span>\n <strong>{{ item.value }}</strong>\n </span>\n </div>\n <ng-template #defaultTitle>\n {{ documentDefinitionNameTitle }}\n </ng-template>\n </div>\n <div class="btn-group mt-m3px mb-3 col-auto">\n <valtimo-extension\n module="dossier"\n page="dossier-detail"\n section="card-header"\n ></valtimo-extension>\n <div class="dropdown">\n <button\n class="btn btn-primary dropdown-toggle"\n type="button"\n id="startProcessDropdown"\n placement="bottom"\n [ngbTooltip]="processDocumentDefinitions.length === 0 ? \'No action\' : null"\n [disabled]="processDocumentDefinitions.length === 0"\n data-toggle="dropdown"\n aria-haspopup="true"\n aria-expanded="false"\n >\n <span>Start</span>\n <i class="ml-1 mdi mdi-chevron-down"></i>\n </button>\n <div\n class="dropdown-menu dropdown-menu-right"\n aria-labelledby="startProcessDropdown"\n >\n <button\n *ngFor="let processDocumentDefinition of processDocumentDefinitions"\n class="dropdown-item p"\n href="#"\n (click)="startProcess(processDocumentDefinition)"\n >\n {{ processDocumentDefinition.processName }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n <ul class="nav nav-tabs">\n <li class="nav-item" *ngFor="let tab of tabLoader.tabs">\n <a\n id="{{ tab.name }}-tab"\n class="nav-link clickable"\n [ngClass]="{active: tab.isActive()}"\n data-toggle="tab"\n (click)="tabLoader.load(tab)"\n >\n {{ tabLoader.translateTabName(tab) }}\n </a>\n </li>\n </ul>\n <div class="card-body bg-white p-5 position-relative tab-container">\n <ng-template #tabContainer>Loading...</ng-template>\n <div class="clearfix"></div>\n </div>\n </valtimo-widget>\n </div>\n <valtimo-dossier-supporting-process-start-modal\n (formSubmit)="tabLoader.refreshView()"\n #supportingProcessStartModal\n ></valtimo-dossier-supporting-process-start-modal>\n </div>\n</div>\n',styles:[".tab-container{min-height:300px}"]}]}],Y.ctorParameters=function(){return[{type:t.ComponentFactoryResolver},{type:i.TranslateService},{type:o.DocumentService},{type:l.ProcessService},{type:n.ActivatedRoute},{type:n.Router},{type:c.Location},{type:j},{type:a.ConfigService}]},Y.propDecorators={viewContainerRef:[{type:t.ViewChild,args:["tabContainer",{read:t.ViewContainerRef,static:!0}]}],supportingProcessStart:[{type:t.ViewChild,args:["supportingProcessStartModal"]}]};var B=s;B.locale(localStorage.getItem("langKey")||"");var _=function(){function e(e,t,n){var i=this;this.contactMomentService=e,this.alertService=t,this.translateService=n,this.refetchContactMoments$=new r.BehaviorSubject(""),this.contactMoments$=this.refetchContactMoments$.pipe(v.switchMap((function(){return i.contactMomentService.getContactMoments()})),v.map((function(e){return e.map((function(e){var t=B(e.registratiedatum);return new m.TimelineItemImpl(t.format("DD MMM YYYY"),t.format("HH:mm"),e.medewerkerIdentificatie.achternaam,e.kanaal,e.tekst,null)}))}))),this.text$=new r.BehaviorSubject(""),this.channel$=new r.BehaviorSubject("MAIL"),this.requestData$=r.combineLatest([this.text$,this.channel$]),this.valid$=this.requestData$.pipe(v.map((function(e){var t=N(e,2),n=t[0],i=t[1];return!(!n||!i)}))),this.disabled$=new r.BehaviorSubject(!1)}return e.prototype.textChange=function(e){this.text$.next(e)},e.prototype.buttonClick=function(){this.modal.show()},e.prototype.saveNote=function(){var e=this;this.disable(),this.requestData$.pipe(v.take(1)).subscribe((function(t){var n=N(t,2),i=n[0],o=n[1];e.contactMomentService.saveContactMoment({kanaal:o,tekst:i}).subscribe((function(){e.alertService.success(e.translateService.instant("dossier.contactMoments.saveSuccess")),e.enable(),e.clear(),e.modal.hide(),e.refetchContactMoments()}),(function(){e.enable()}))}))},e.prototype.disable=function(){this.disabled$.next(!0)},e.prototype.enable=function(){this.disabled$.next(!1)},e.prototype.clear=function(){this.text$.next("")},e.prototype.refetchContactMoments=function(){this.refetchContactMoments$.next("")},e}();_.decorators=[{type:t.Component,args:[{selector:"valtimo-dossier-detail-tab-contact-moments",template:'\x3c!--\n ~ Copyright 2015-2021 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<div class="contact-moments-container">\n <ng-container *ngTemplateOutlet="buttons"></ng-container>\n <ng-container *ngTemplateOutlet="moments"></ng-container>\n</div>\n\n<valtimo-modal\n #contactMomentsNoteModal\n [title]="\'dossier.contactMoments.popupTitle\' | translate"\n [showFooter]="true"\n [elementId]="\'contact-moments-modal\'"\n>\n <div class="mt-2" body>\n <ng-container *ngTemplateOutlet="body"></ng-container>\n </div>\n <div footer>\n <ng-container *ngTemplateOutlet="footer"></ng-container>\n </div>\n</valtimo-modal>\n\n<ng-template #body>\n <form>\n <div class="form-group row">\n <label class="col-12 col-sm-3 col-form-label text-sm-right" for="body">\n {{ \'dossier.contactMoments.noteText\' | translate }}\n </label>\n <div class="col-12 col-sm-8 col-lg-6">\n <textarea\n [disabled]="disabled$ | async"\n class="form-control"\n id="body"\n name="body"\n [ngModel]="text$ | async"\n (ngModelChange)="textChange($event)"\n ></textarea>\n </div>\n </div>\n </form>\n</ng-template>\n\n<ng-template #footer>\n <button\n *ngIf="(disabled$ | async) === false; else loading"\n class="btn btn-primary"\n [disabled]="(valid$ | async) === false || (disabled$ | async)"\n (click)="saveNote()"\n >\n {{ \'dossier.contactMoments.saveButtonText\' | translate }}\n </button>\n</ng-template>\n\n<ng-template #loading>\n <valtimo-spinner [noMarginTop]="true"></valtimo-spinner>\n</ng-template>\n\n<ng-template #buttons>\n <div class="btn-group mt-m3px mb-3 button-container">\n <button class="btn btn-primary btn-space" (click)="buttonClick()">\n <i class="icon mdi mdi-calendar-note"></i>\n &nbsp;{{ \'dossier.contactMoments.makeNoteButton\' | translate }}\n </button>\n </div>\n</ng-template>\n\n<ng-template #moments>\n <div *ngIf="contactMoments$ | async as contactMoments; else loading">\n <valtimo-timeline [items]="contactMoments"></valtimo-timeline>\n </div>\n</ng-template>\n',styles:['/*!\n * Copyright 2015-2021 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.contact-moments-container{display:flex;flex-direction:column}.button-container{align-self:flex-end;display:inline}']}]}],_.ctorParameters=function(){return[{type:b.ContactMomentService},{type:m.AlertService},{type:i.TranslateService}]},_.propDecorators={modal:[{type:t.ViewChild,args:["contactMomentsNoteModal"]}]};var V=s;V.locale(localStorage.getItem("langKey")||"");var H=function(){function e(e,t,n,i,o,s){this.taskService=e,this.documentService=t,this.route=n,this.toastr=i,this.location=o,this.customDefinitions={};var r=this.route.snapshot.paramMap;this.documentDefinitionName=r.get("documentDefinitionName")||"",this.documentId=r.get("documentId")||"",this.taskId=r.get("taskId")||"",this.implementationDefinitions=s.getImplementationEnvironmentDefinitions(this.documentDefinitionName),this.loadDocumentDefinition(this.documentDefinitionName),this.loadDocument(this.documentId)}return e.prototype.ngOnInit=function(){this.getTask(this.taskId),this.implementationDefinitions.definitions.detail.summary&&(this.customDefinitions=this.implementationDefinitions.definitions.detail.summary)},e.prototype.loadDocumentDefinition=function(e){var t=this;this.documentService.getDocumentDefinition(e).subscribe((function(e){t.schema=e.schema}))},e.prototype.loadDocument=function(e){var t=this;this.documentService.getDocument(e).subscribe((function(e){t.document=e}))},e.prototype.getTask=function(e){var t=this;this.taskService.getTask(e).subscribe((function(e){t.task=e,t.task.task.created=V(t.task.task.created).format("DD MMM YYYY HH:mm"),t.page={title:t.task.task.name,subtitle:"Created "+V(t.task.task.created).fromNow()}}))},e.prototype.reset=function(){this.loadDocument(this.documentId)},e.prototype.back=function(){this.location.back()},e.prototype.save=function(){var e=this,t={documentId:this.document.id,content:this.document.content,versionBasedOn:this.document.version};this.documentService.modifyDocument(t).subscribe((function(t){e.document=t.document,e.toastr.success("Document aangepast"),e.location.back()}))},e.prototype.submit=function(e){var t=this,n=Object.assign({},this.document.content,e),i={request:{documentId:this.document.id,content:n,versionBasedOn:this.document.version},taskId:this.task.task.id};this.documentService.modifyDocumentAndCompleteTask(i).subscribe((function(e){t.toastr.success(t.task.task.name+" has successfully been completed"),t.location.back()}))},e.prototype.returnZero=function(){return 0},e}();H.decorators=[{type:t.Component,args:[{selector:"valtimo-dossier-update",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<div class="main-content">\n <div class="container-fluid">\n <div class="col-12 px-0 mb-5">\n <valtimo-widget [title]="page?.title" [subtitle]="page?.subtitle" [divider]="true">\n <div class="card-body">\n \x3c!--view with custom definitions--\x3e\n <div *ngIf="this.customDefinitions">\n <div\n class="mb-4"\n *ngFor="let definition of this.customDefinitions | keyvalue: returnZero"\n ></div>\n <div class="row pt-3 mt-1">\n <div class="col-sm-12">\n <div class="text-right">\n <button\n class="btn btn-space btn-default float-left"\n type="button"\n (click)="back()"\n id="back-button"\n >\n Back\n </button>\n <button\n class="btn btn-space btn-secondary"\n type="button"\n (click)="reset()"\n id="reset-button"\n >\n Reset\n </button>\n <button\n class="btn btn-space btn-primary"\n type="button"\n (click)="save()"\n id="save-button"\n >\n Save\n </button>\n <button\n class="btn btn-space btn-primary"\n type="submit"\n (click)="submit({})"\n id="submit-button"\n >\n Submit\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <valtimo-camunda-form\n *ngIf="task?.formFields && !this.customDefinitions"\n (submitted)="submit($event)"\n [formFields]="task.formFields"\n [componentName]="task.formLocation"\n ></valtimo-camunda-form>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n',styles:[""]}]}],H.ctorParameters=function(){return[{type:u.TaskService},{type:o.DocumentService},{type:n.ActivatedRoute},{type:f.ToastrService},{type:c.Location},{type:C}]};var K={title:"Dossiers",roles:[a.ROLE_USER]},z={title:"Dossiers",parentPath:"dossiers/:documentDefinitionName",roles:[a.ROLE_USER]},W={title:"Task details",parentPath:"dossiers/:documentDefinitionName/document/:documentId/:tab",roles:[a.ROLE_USER]},G=[{path:"dossiers/:documentDefinitionName",component:O,canActivate:[p.AuthGuardService],data:K},{path:"dossiers/:documentDefinitionName/document/:documentId/:tab",component:Y,canActivate:[p.AuthGuardService],data:z},{path:"dossiers/:documentDefinitionName/document/:documentId/:tab/tasks/:taskId",component:H,canActivate:[p.AuthGuardService],data:W}],J=function(){};J.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.RouterModule.forChild(G)],exports:[n.RouterModule]}]}];var Z=function(){function e(e,t,n,i,o,s,r){this.route=e,this.router=t,this.processService=n,this.documentService=i,this.formLinkService=o,this.userProviderService=s,this.logger=r}return e.prototype.ngOnInit=function(){this.isUserAdmin()},e.prototype.loadFormDefinition=function(){var e=this;this.formDefinition=null,this.formLinkService.getStartEventFormDefinitionByProcessDefinitionKey(this.processDefinitionKey).subscribe((function(t){e.formAssociation=t.formAssociation;var n=e.formAssociation.formLink.className.split(".");switch(n[n.length-1]){case"BpmnElementFormIdLink":e.formDefinition=t,e.modal.show();break;case"BpmnElementUrlLink":var i=e.router.serializeUrl(e.router.createUrlTree([t.formAssociation.formLink.url]));window.open(i,"_blank");break;case"BpmnElementAngularStateUrlLink":e.router.navigate([t.formAssociation.formLink.url]);break;default:e.logger.fatal("Unsupported class name")}}),(function(t){e.modal.show()}))},e.prototype.gotoFormLinkScreen=function(){this.modal.hide(),this.router.navigate(["form-links"],{queryParams:{process:this.processDefinitionKey}})},Object.defineProperty(e.prototype,"modalTitle",{get:function(){return"Start - "+this.processName},enumerable:!1,configurable:!0}),e.prototype.openModal=function(e){this.processDefinitionKey=e.id.processDefinitionKey,this.documentDefinitionName=e.id.documentDefinitionId.name,this.processName=e.processName,this.options=new m.FormioOptionsImpl,this.options.disableAlerts=!0;this.options.setHooks((function(e,t){t(null,e)})),this.loadFormDefinition()},e.prototype.onSubmit=function(e){var t=this;this.formioSubmission=e,this.formLinkService.onSubmit(this.processDefinitionKey,this.formAssociation.formLink.id,e.data).subscribe((function(e){t.modal.hide(),t.router.navigate(["dossiers",t.documentDefinitionName,"document",e.documentId,"summary"])}),(function(e){t.form.showErrors(e)}))},e.prototype.isUserAdmin=function(){var e=this;this.userProviderService.getUserSubject().subscribe((function(t){e.isAdmin=t.roles.includes("ROLE_ADMIN")}),(function(t){e.logger.error("Failed to retrieve user identity",t),e.isAdmin=!1}))},e}();Z.decorators=[{type:t.Component,args:[{selector:"valtimo-dossier-process-start-modal",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<valtimo-modal #processStartModal elementId="processStartModal" [title]="modalTitle">\n <div body *ngIf="formDefinition">\n <valtimo-form-io #form [form]="formDefinition" [options]="options" (submit)="onSubmit($event)">\n </valtimo-form-io>\n </div>\n <div body *ngIf="!formDefinition && isAdmin">\n <div\n class="bg-warning text-black mb-0 p-3 text-center"\n [translate]="\'formManagement.noFormDefinitionFoundAdmin\'"\n ></div>\n <div class="mb-0 mt-4 p-3 text-center">\n <button\n class="btn btn-secondary btn-space"\n type="button"\n (click)="gotoFormLinkScreen()"\n id="form-link-button"\n >\n {{ \'formManagement.gotoFormLinksButton\' | translate }}\n </button>\n </div>\n </div>\n <div body *ngIf="!formDefinition && !isAdmin">\n <div\n class="bg-warning text-black mb-0 p-3 text-center"\n [translate]="\'formManagement.noFormDefinitionFoundUser\'"\n ></div>\n </div>\n</valtimo-modal>\n',encapsulation:t.ViewEncapsulation.None,styles:['/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */#processStartModal .formio-component-submit{text-align:right}']}]}],Z.ctorParameters=function(){return[{type:n.ActivatedRoute},{type:n.Router},{type:l.ProcessService},{type:o.DocumentService},{type:S.FormLinkService},{type:p.UserProviderService},{type:D.NGXLogger}]},Z.propDecorators={form:[{type:t.ViewChild,args:["form",{static:!1}]}],modal:[{type:t.ViewChild,args:["processStartModal",{static:!1}]}]};var X=function(){function e(e,n,i,o,s,r){this.route=e,this.router=n,this.processService=i,this.documentService=o,this.formLinkService=s,this.logger=r,this.formSubmit=new t.EventEmitter}return e.prototype.loadFormDefinition=function(){var e=this;this.formDefinition=null,this.formLinkService.getStartEventFormDefinitionByProcessDefinitionKey(this.processDefinitionKey).subscribe((function(t){e.formAssociation=t.formAssociation;var n=e.formAssociation.formLink.className.split(".");switch(n[n.length-1]){case"BpmnElementFormIdLink":e.formDefinition=t,e.documentService.getDocument(e.documentId).subscribe((function(t){e.submission={data:t.content}}),(function(){return r.noop()})),e.modal.show();break;case"BpmnElementUrlLink":var i=e.router.serializeUrl(e.router.createUrlTree([t.formAssociation.formLink.url]));window.open(i,"_blank");break;case"BpmnElementAngularStateUrlLink":e.route.params.pipe(v.take(1)).subscribe((function(n){var i=null==n?void 0:n.documentId;e.router.navigate([t.formAssociation.formLink.url],{state:Object.assign({},i&&{documentId:i})})}));break;default:e.logger.fatal("Unsupported class name")}}),(function(t){e.modal.show()}))},Object.defineProperty(e.prototype,"modalTitle",{get:function(){return"Start - "+this.processName},enumerable:!1,configurable:!0}),e.prototype.openModal=function(e,t){this.documentId=t,this.documentDefinitionName=e.id.documentDefinitionId.name,this.processDefinitionKey=e.id.processDefinitionKey,this.processName=e.processName,this.options=new m.FormioOptionsImpl,this.options.disableAlerts=!0;this.options.setHooks((function(e,t){t(null,e)})),this.loadFormDefinition()},e.prototype.onSubmit=function(e){var t=this;this.formioSubmission=e,this.formLinkService.onSubmit(this.processDefinitionKey,this.formAssociation.formLink.id,e.data,this.documentId).subscribe((function(e){t.modal.hide(),t.formSubmit.emit()}),(function(e){t.form.showErrors(e)}))},e.prototype.gotoFormLinkScreen=function(){this.modal.hide(),this.router.navigate(["form-links"],{queryParams:{process:this.processDefinitionKey}})},e}();X.decorators=[{type:t.Component,args:[{selector:"valtimo-dossier-supporting-process-start-modal",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<valtimo-modal\n #supportingProcessStartModal\n elementId="supportingProcessStartModal"\n [title]="modalTitle"\n>\n <div body *ngIf="formDefinition">\n <valtimo-form-io\n #form\n [submission]="submission"\n [form]="formDefinition"\n [options]="options"\n (submit)="onSubmit($event)"\n >\n </valtimo-form-io>\n </div>\n <div body *ngIf="!formDefinition">\n <div\n class="bg-warning text-black mb-0 p-3 text-center"\n [translate]="\'formManagement.noFormDefinitionFound\'"\n ></div>\n <div class="mb-0 mt-4 p-3 text-center">\n <button\n class="btn btn-secondary btn-space"\n type="button"\n (click)="gotoFormLinkScreen()"\n id="form-link-button"\n >\n {{ \'formManagement.gotoFormLinksButton\' | translate }}\n </button>\n </div>\n </div>\n</valtimo-modal>\n',encapsulation:t.ViewEncapsulation.None,styles:['/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */#supportingProcessStartModal .formio-component-submit{text-align:right}']}]}],X.ctorParameters=function(){return[{type:n.ActivatedRoute},{type:n.Router},{type:l.ProcessService},{type:o.DocumentService},{type:S.FormLinkService},{type:D.NGXLogger}]},X.propDecorators={form:[{type:t.ViewChild,args:["form",{static:!1}]}],modal:[{type:t.ViewChild,args:["supportingProcessStartModal",{static:!1}]}],formSubmit:[{type:t.Output}]};var Q=a.HttpLoaderFactory,ee=function(){function e(){}return e.forRoot=function(n){return{ngModule:e,providers:[C,j,{provide:U,useFactory:n},{provide:t.ANALYZE_FOR_ENTRY_COMPONENTS,useValue:Array.from(n().values()),multi:!0}]}},e}();ee.decorators=[{type:t.NgModule,args:[{declarations:[O,Y,M,A,F,E,_,H,Z,X],imports:[c.CommonModule,J,m.ListModule,m.WidgetModule,m.BpmnJsDiagramModule,m.TimelineModule,m.CamundaFormModule,l.ProcessModule,m.FilterSidebarModule,y.NgbButtonsModule,m.DataListModule,I.FormsModule,d.FormModule,m.FormIoModule,m.ModalModule,m.SpinnerModule,i.TranslateModule.forRoot({loader:{provide:i.TranslateLoader,useFactory:Q,deps:[w.HttpClient]}}),u.TaskModule,m.ModalModule,y.NgbTooltipModule,m.UploaderModule,m.DropzoneModule,y.NgbPaginationModule,a.ConfigModule],exports:[O,Y],entryComponents:[M,A,F,E,_]}]}],e.DEFAULT_TABS=q,e.DossierDetailComponent=Y,e.DossierDetailTabAuditComponent=F,e.DossierDetailTabContactMomentsComponent=_,e.DossierDetailTabDocumentsComponent=E,e.DossierDetailTabProgressComponent=A,e.DossierDetailTabSummaryComponent=M,e.DossierListComponent=O,e.DossierModule=ee,e.DossierService=C,e.TAB_MAP=U,e.TabImpl=k,e.TabLoaderImpl=L,e.TabService=j,e.ɵ0=Q,e.ɵa=H,e.ɵb=Z,e.ɵc=X,e.ɵd=J,Object.defineProperty(e,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=valtimo-dossier.umd.min.js.map