@valtimo/form-management 4.15.3-next-main.15 → 4.15.3-next-main.16

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.
@@ -38,7 +38,10 @@ class FormManagementService {
38
38
  return this.http.get(`${this.valtimoApiConfig.endpointUri}form-management/${formDefinitionId}`);
39
39
  }
40
40
  queryFormDefinitions(params) {
41
- return this.http.get(`${this.valtimoApiConfig.endpointUri}form-management`, { observe: 'response', params: params });
41
+ return this.http.get(`${this.valtimoApiConfig.endpointUri}form-management`, {
42
+ observe: 'response',
43
+ params: params,
44
+ });
42
45
  }
43
46
  createFormDefinition(request) {
44
47
  return this.http.post(`${this.valtimoApiConfig.endpointUri}form-management`, request);
@@ -53,7 +56,7 @@ class FormManagementService {
53
56
  FormManagementService.ɵprov = ɵɵdefineInjectable({ factory: function FormManagementService_Factory() { return new FormManagementService(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: FormManagementService, providedIn: "root" });
54
57
  FormManagementService.decorators = [
55
58
  { type: Injectable, args: [{
56
- providedIn: 'root'
59
+ providedIn: 'root',
57
60
  },] }
58
61
  ];
59
62
  FormManagementService.ctorParameters = () => [
@@ -77,15 +80,13 @@ FormManagementService.ctorParameters = () => [
77
80
  * limitations under the License.
78
81
  */
79
82
  class FormManagementComponent {
80
- constructor() {
81
- }
82
- ngOnInit() {
83
- }
83
+ constructor() { }
84
+ ngOnInit() { }
84
85
  }
85
86
  FormManagementComponent.decorators = [
86
87
  { type: Component, args: [{
87
88
  selector: 'valtimo-form-management',
88
- template: "<!--\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 -->\n\n<div class=\"main-content pt-0\">\n <div class=\"container-fluid\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3\">\n <button [routerLink]=\"'create'\" [queryParams]=\"{'upload': 'true'}\" class=\"btn btn-secondary btn-space\">\n <i class=\"icon mdi mdi-upload\"></i>&nbsp;\n {{ 'Upload' | translate }}\n </button>\n <button [routerLink]=\"'create'\" class=\"btn btn-primary btn-space mr-0\">\n <i class=\"icon mdi mdi-plus\"></i> &nbsp;\n <span>{{ 'Create new Form' | translate }}</span>\n </button>\n </div>\n </div>\n <valtimo-widget>\n <valtimo-form-management-list></valtimo-form-management-list>\n </valtimo-widget>\n </div>\n</div>\n",
89
+ template: "<!--\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 -->\n\n<div class=\"main-content pt-0\">\n <div class=\"container-fluid\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3\">\n <button\n [routerLink]=\"'create'\"\n [queryParams]=\"{upload: 'true'}\"\n class=\"btn btn-secondary btn-space\"\n >\n <i class=\"icon mdi mdi-upload\"></i>&nbsp;\n {{ 'Upload' | translate }}\n </button>\n <button [routerLink]=\"'create'\" class=\"btn btn-primary btn-space mr-0\">\n <i class=\"icon mdi mdi-plus\"></i> &nbsp;\n <span>{{ 'Create new Form' | translate }}</span>\n </button>\n </div>\n </div>\n <valtimo-widget>\n <valtimo-form-management-list></valtimo-form-management-list>\n </valtimo-widget>\n </div>\n</div>\n",
89
90
  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 */"]
90
91
  },] }
91
92
  ];
@@ -119,29 +120,34 @@ class FormManagementCreateComponent {
119
120
  }
120
121
  ngOnInit() {
121
122
  this.form = this.formBuilder.group({
122
- name: new FormControl('', Validators.required)
123
+ name: new FormControl('', Validators.required),
123
124
  });
124
125
  }
125
126
  reset() {
126
127
  this.form.setValue({
127
- name: ''
128
+ name: '',
128
129
  });
129
130
  }
130
131
  createFormDefinition() {
131
132
  const emptyForm = {
132
133
  display: 'form',
133
- components: []
134
+ components: [],
134
135
  };
135
136
  const request = {
136
137
  name: this.form.value.name,
137
- formDefinition: JSON.stringify(emptyForm)
138
+ formDefinition: JSON.stringify(emptyForm),
138
139
  };
139
- combineLatest([this.formManagementService.createFormDefinition(request), this.route.queryParams])
140
+ combineLatest([
141
+ this.formManagementService.createFormDefinition(request),
142
+ this.route.queryParams,
143
+ ])
140
144
  .pipe(take(1))
141
145
  .subscribe(([formDefinition, params]) => {
142
146
  this.alertService.success('Created new Form');
143
147
  if ((params === null || params === void 0 ? void 0 : params.upload) === 'true') {
144
- this.router.navigate(['/form-management/edit', formDefinition.id], { queryParams: { upload: 'true' } });
148
+ this.router.navigate(['/form-management/edit', formDefinition.id], {
149
+ queryParams: { upload: 'true' },
150
+ });
145
151
  }
146
152
  else {
147
153
  this.router.navigate(['/form-management/edit', formDefinition.id]);
@@ -154,7 +160,7 @@ class FormManagementCreateComponent {
154
160
  FormManagementCreateComponent.decorators = [
155
161
  { type: Component, args: [{
156
162
  selector: 'valtimo-form-management-create',
157
- template: "<!--\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 -->\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=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"createFormDefinition()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"name\">Name</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input type=\"text\" id=\"name\" formControlName=\"name\"\n class=\"form-control\" placeholder=\"Form definition name\"\n [ngClass]=\"{'is-valid': formControls.name.touched && formControls.name.valid, 'is-invalid': formControls.name.touched && formControls.name.errors}\"\n required/>\n <div *ngIf=\"formControls.name.touched && formControls.name.errors\"\n class=\"invalid-feedback\">\n <div *ngIf=\"formControls.name.errors.required\">Name is required</div>\n </div>\n </div>\n </div>\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'/forms'\" class=\"btn btn-space btn-default\">Back</a>\n </div>\n <div class=\"col-12 col-sm-6 text-right\">\n <button class=\"btn btn-space btn-secondary\" type=\"button\" (click)=\"reset()\">Reset\n </button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n",
163
+ template: "<!--\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 -->\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=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"createFormDefinition()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"name\">Name</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"name\"\n formControlName=\"name\"\n class=\"form-control\"\n placeholder=\"Form definition name\"\n [ngClass]=\"{\n 'is-valid': formControls.name.touched && formControls.name.valid,\n 'is-invalid': formControls.name.touched && formControls.name.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.name.touched && formControls.name.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.name.errors.required\">Name is required</div>\n </div>\n </div>\n </div>\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'/forms'\" class=\"btn btn-space btn-default\">Back</a>\n </div>\n <div class=\"col-12 col-sm-6 text-right\">\n <button class=\"btn btn-space btn-secondary\" type=\"button\" (click)=\"reset()\">\n Reset\n </button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n",
158
164
  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 */"]
159
165
  },] }
160
166
  ];
@@ -210,11 +216,13 @@ class FormManagementEditComponent {
210
216
  });
211
217
  }
212
218
  modifyFormDefinition() {
213
- const form = JSON.stringify(this.modifiedFormDefinition != null ? this.modifiedFormDefinition : this.formDefinition.formDefinition);
219
+ const form = JSON.stringify(this.modifiedFormDefinition != null
220
+ ? this.modifiedFormDefinition
221
+ : this.formDefinition.formDefinition);
214
222
  const request = {
215
223
  id: this.formDefinition.id,
216
224
  name: this.formDefinition.name,
217
- formDefinition: form
225
+ formDefinition: form,
218
226
  };
219
227
  this.formManagementService.modifyFormDefinition(request).subscribe(() => {
220
228
  this.router.navigate(['/form-management']);
@@ -235,16 +243,17 @@ class FormManagementEditComponent {
235
243
  {
236
244
  label: 'Cancel',
237
245
  class: 'btn btn-default',
238
- value: false
246
+ value: false,
239
247
  },
240
248
  {
241
249
  label: 'Delete',
242
250
  class: 'btn btn-primary',
243
- value: true
244
- }
251
+ value: true,
252
+ },
245
253
  ];
246
254
  this.alertService.notification(mssg, confirmations);
247
- this.alertSub = this.alertService.getAlertConfirmChangeEmitter()
255
+ this.alertSub = this.alertService
256
+ .getAlertConfirmChangeEmitter()
248
257
  .pipe(first())
249
258
  .subscribe(alert => {
250
259
  if (alert.confirm === true) {
@@ -284,8 +293,7 @@ class FormManagementEditComponent {
284
293
  this.reloading$.next(false);
285
294
  }
286
295
  checkToOpenUploadModal() {
287
- this.route.queryParams.pipe(take(1))
288
- .subscribe((params) => {
296
+ this.route.queryParams.pipe(take(1)).subscribe(params => {
289
297
  if ((params === null || params === void 0 ? void 0 : params.upload) === 'true') {
290
298
  this.showModal();
291
299
  }
@@ -295,7 +303,7 @@ class FormManagementEditComponent {
295
303
  FormManagementEditComponent.decorators = [
296
304
  { type: Component, args: [{
297
305
  selector: 'valtimo-form-management-edit',
298
- template: "<!--\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 -->\n\n<div class=\"main-content pt-0\">\n <div class=\"container-fluid\" *ngIf=\"formDefinition\">\n <div class=\"btn-group mt-m3px mb-3 float-right\">\n <button class='btn btn-primary btn-space' (click)=\"downloadFormDefinition()\">\n <i class=\"fa fa-save\"></i>\n {{ 'Download' | translate }}\n </button>\n <button class=\"btn btn-secondary btn-space\" (click)=\"showModal()\" [disabled]=\"formDefinition.readOnly\">\n <i class=\"icon mdi mdi-upload\"></i>&nbsp;\n {{ 'Upload' | translate }}\n </button>\n <button class='btn btn-danger btn-space' (click)=\"delete()\" [disabled]=\"formDefinition.readOnly\">\n <i class=\"fa fa-trash\"></i>&nbsp;Delete\n </button>\n <button class='btn btn-success btn-space' (click)=\"modifyFormDefinition()\" [disabled]=\"formDefinition.readOnly\">\n <i class=\"fa fa-upload\"></i>&nbsp;Deploy\n </button>\n </div>\n <div class=\"clearfix\"></div>\n <div class=\"bg-light formbuilder-header overflow-auto\">\n <h3 class=\"formbuilder-title\">{{formDefinition.name}}\n <div *ngIf=\"formDefinition.readOnly\" class=\"pull-right\">\n <span class=\"badge badge-pill badge-info increase-size\">Read-only</span>\n </div>\n </h3>\n </div>\n <ng-container *ngIf=\"!(reloading$ | async)\">\n <valtimo-form-io-builder [form]=\"formDefinition.formDefinition\" (change)=\"formBuilderChanged($event)\"></valtimo-form-io-builder>\n </ng-container>\n </div>\n</div>\n\n<valtimo-form-management-upload\n [show$]=\"showModal$\"\n (definitionUploaded)=\"setFormDefinition($event)\"\n></valtimo-form-management-upload>\n",
306
+ template: "<!--\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 -->\n\n<div class=\"main-content pt-0\">\n <div class=\"container-fluid\" *ngIf=\"formDefinition\">\n <div class=\"btn-group mt-m3px mb-3 float-right\">\n <button class=\"btn btn-primary btn-space\" (click)=\"downloadFormDefinition()\">\n <i class=\"fa fa-save\"></i>\n {{ 'Download' | translate }}\n </button>\n <button\n class=\"btn btn-secondary btn-space\"\n (click)=\"showModal()\"\n [disabled]=\"formDefinition.readOnly\"\n >\n <i class=\"icon mdi mdi-upload\"></i>&nbsp;\n {{ 'Upload' | translate }}\n </button>\n <button\n class=\"btn btn-danger btn-space\"\n (click)=\"delete()\"\n [disabled]=\"formDefinition.readOnly\"\n >\n <i class=\"fa fa-trash\"></i>&nbsp;Delete\n </button>\n <button\n class=\"btn btn-success btn-space\"\n (click)=\"modifyFormDefinition()\"\n [disabled]=\"formDefinition.readOnly\"\n >\n <i class=\"fa fa-upload\"></i>&nbsp;Deploy\n </button>\n </div>\n <div class=\"clearfix\"></div>\n <div class=\"bg-light formbuilder-header overflow-auto\">\n <h3 class=\"formbuilder-title\">\n {{ formDefinition.name }}\n <div *ngIf=\"formDefinition.readOnly\" class=\"pull-right\">\n <span class=\"badge badge-pill badge-info increase-size\">Read-only</span>\n </div>\n </h3>\n </div>\n <ng-container *ngIf=\"!(reloading$ | async)\">\n <valtimo-form-io-builder\n [form]=\"formDefinition.formDefinition\"\n (change)=\"formBuilderChanged($event)\"\n ></valtimo-form-io-builder>\n </ng-container>\n </div>\n</div>\n\n<valtimo-form-management-upload\n [show$]=\"showModal$\"\n (definitionUploaded)=\"setFormDefinition($event)\"\n></valtimo-form-management-upload>\n",
299
307
  encapsulation: ViewEncapsulation.None,
300
308
  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 */.btn.formcomponent.gu-mirror,.formbuilder .btn.formcomponent.drag-copy{background-color:silver;border-color:silver;color:#fff;font-weight:400}.btn.formcomponent.gu-mirror:active,.btn.formcomponent.gu-mirror:hover,.formbuilder .btn.formcomponent.drag-copy:active,.formbuilder .btn.formcomponent.drag-copy:hover{box-shadow:none}.btn.formcomponent.gu-mirror:active,.formbuilder .btn.formcomponent.drag-copy:active{background-color:silver;border-color:silver}.formbuilder-header{border:1px solid #dee2e6;border-bottom:0;font-size:18px;height:80px;padding-left:18px;padding-right:18px}.formbuilder-header .formbuilder-title{margin-bottom:7px;margin-top:21px}.formbuilder-header .formbuilder-subtitle{margin-bottom:12px;margin-top:0}.formbuilder{background:#fff;border:1px solid #dee2e6;margin-left:0!important;margin-right:0!important;padding:1rem}.formbuilder .form-builder-panel .builder-group-button[aria-expanded=\"\"],.formbuilder .form-builder-panel .builder-group-button[aria-expanded=false]{color:#a9a9a9}.formbuilder .form-builder-panel .builder-group-button[aria-expanded=true]{color:#000}.formbuilder .drag-and-drop-alert{display:none}.formbuilder .formarea{background-color:#fff;border:1px solid silver;padding:10px}.increase-size{font-size:1rem}"]
301
309
  },] }
@@ -328,32 +336,28 @@ const routes = [
328
336
  path: 'form-management',
329
337
  component: FormManagementComponent,
330
338
  canActivate: [AuthGuardService],
331
- data: ɵ0
339
+ data: ɵ0,
332
340
  },
333
341
  {
334
342
  path: 'form-management/create',
335
343
  component: FormManagementCreateComponent,
336
344
  canActivate: [AuthGuardService],
337
- data: ɵ1
345
+ data: ɵ1,
338
346
  },
339
347
  {
340
348
  path: 'form-management/edit/:id',
341
349
  component: FormManagementEditComponent,
342
350
  canActivate: [AuthGuardService],
343
- data: ɵ2
344
- }
351
+ data: ɵ2,
352
+ },
345
353
  ];
346
354
  class FormManagementRoutingModule {
347
355
  }
348
356
  FormManagementRoutingModule.decorators = [
349
357
  { type: NgModule, args: [{
350
- imports: [
351
- RouterModule.forChild(routes)
352
- ],
353
- exports: [
354
- RouterModule
355
- ],
356
- declarations: []
358
+ imports: [RouterModule.forChild(routes)],
359
+ exports: [RouterModule],
360
+ declarations: [],
357
361
  },] }
358
362
  ];
359
363
 
@@ -379,13 +383,13 @@ class FormManagementListComponent {
379
383
  this.formDefinitions = [];
380
384
  this.formDefinitionFields = [
381
385
  { key: 'name', label: 'Name' },
382
- { key: 'readOnly', label: 'Read-only' }
386
+ { key: 'readOnly', label: 'Read-only' },
383
387
  ];
384
388
  this.pagination = {
385
389
  collectionSize: 0,
386
390
  page: 1,
387
391
  size: 10,
388
- maxPaginationItemSize: 5
392
+ maxPaginationItemSize: 5,
389
393
  };
390
394
  this.pageParam = 0;
391
395
  }
@@ -393,8 +397,7 @@ class FormManagementListComponent {
393
397
  this.pageParam = page - 1;
394
398
  this.loadFormDefinitions();
395
399
  }
396
- ngOnInit() {
397
- }
400
+ ngOnInit() { }
398
401
  paginationSet() {
399
402
  this.loadFormDefinitions();
400
403
  }
@@ -403,7 +406,7 @@ class FormManagementListComponent {
403
406
  if (searchTerm) {
404
407
  params['searchTerm'] = searchTerm;
405
408
  }
406
- this.formManagementService.queryFormDefinitions(params).subscribe((results) => {
409
+ this.formManagementService.queryFormDefinitions(params).subscribe(results => {
407
410
  this.pagination.collectionSize = results.body.totalElements;
408
411
  this.formDefinitions = results.body.content;
409
412
  });
@@ -418,7 +421,7 @@ class FormManagementListComponent {
418
421
  FormManagementListComponent.decorators = [
419
422
  { type: Component, args: [{
420
423
  selector: 'valtimo-form-management-list',
421
- template: "<!--\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 -->\n\n<valtimo-list [items]=\"formDefinitions\"\n [fields]=\"formDefinitionFields\"\n [viewMode]=\"true\"\n [isSearchable]=\"true\"\n [pagination]=\"pagination\"\n paginationIdentifier=\"formManagementList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet()\"\n (rowClicked)=\"editFormDefinition($event)\"\n [header]=\"true\"\n (search)=\"searchTermEntered($event)\"\n>\n <div header>\n <h3 class=\"list-header-title\">{{ 'Forms' | translate }}</h3>\n <h5 class=\"list-header-description\">{{ 'Overview of all Forms' | translate }}</h5>\n </div>\n</valtimo-list>\n",
424
+ template: "<!--\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 -->\n\n<valtimo-list\n [items]=\"formDefinitions\"\n [fields]=\"formDefinitionFields\"\n [viewMode]=\"true\"\n [isSearchable]=\"true\"\n [pagination]=\"pagination\"\n paginationIdentifier=\"formManagementList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet()\"\n (rowClicked)=\"editFormDefinition($event)\"\n [header]=\"true\"\n (search)=\"searchTermEntered($event)\"\n>\n <div header>\n <h3 class=\"list-header-title\">{{ 'Forms' | translate }}</h3>\n <h5 class=\"list-header-description\">{{ 'Overview of all Forms' | translate }}</h5>\n </div>\n</valtimo-list>\n",
422
425
  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 */"]
423
426
  },] }
424
427
  ];
@@ -468,9 +471,7 @@ class FormManagementUploadComponent {
468
471
  }
469
472
  uploadDefinition() {
470
473
  this.disable();
471
- this.jsonString$
472
- .pipe(take(1))
473
- .subscribe((definition) => {
474
+ this.jsonString$.pipe(take(1)).subscribe(definition => {
474
475
  this.closeErrorSubscription();
475
476
  this.clearError();
476
477
  this.enable();
@@ -557,7 +558,7 @@ class FormManagementUploadComponent {
557
558
  FormManagementUploadComponent.decorators = [
558
559
  { type: Component, args: [{
559
560
  selector: 'valtimo-form-management-upload',
560
- template: "<valtimo-modal #uploadFormDefinitionModal [title]=\"'uploadFormDefinition' | translate\" showFooter=\"true\">\n <div class=\"mt-2\" body>\n <valtimo-dropzone\n [clear$]=\"clear$\"\n (fileSelected)=\"setFile($event)\"\n [disabled]=\"disabled$ | async\"\n [subtitle]=\"'dropzone.formJsonDocDef' | translate\"\n [externalError$]=\"error$\"\n ></valtimo-dropzone>\n </div>\n <div footer>\n <ng-container *ngIf=\"(jsonString$ | async) && !(error$ | async); else pleaseSelect\">\n <button [disabled]=\"disabled$ | async\" class=\"btn btn-primary\" (click)=\"uploadDefinition()\">\n {{ 'Upload' | translate }}\n </button>\n </ng-container>\n </div>\n</valtimo-modal>\n\n<ng-template #pleaseSelect>\n <button class=\"btn btn-primary\" [disabled]=\"true\">\n {{ 'Select a document definition' | translate }}\n </button>\n</ng-template>\n",
561
+ template: "<valtimo-modal\n #uploadFormDefinitionModal\n [title]=\"'uploadFormDefinition' | translate\"\n showFooter=\"true\"\n>\n <div class=\"mt-2\" body>\n <valtimo-dropzone\n [clear$]=\"clear$\"\n (fileSelected)=\"setFile($event)\"\n [disabled]=\"disabled$ | async\"\n [subtitle]=\"'dropzone.formJsonDocDef' | translate\"\n [externalError$]=\"error$\"\n ></valtimo-dropzone>\n </div>\n <div footer>\n <ng-container *ngIf=\"(jsonString$ | async) && !(error$ | async); else pleaseSelect\">\n <button [disabled]=\"disabled$ | async\" class=\"btn btn-primary\" (click)=\"uploadDefinition()\">\n {{ 'Upload' | translate }}\n </button>\n </ng-container>\n </div>\n</valtimo-modal>\n\n<ng-template #pleaseSelect>\n <button class=\"btn btn-primary\" [disabled]=\"true\">\n {{ 'Select a document definition' | translate }}\n </button>\n</ng-template>\n",
561
562
  styles: [""]
562
563
  },] }
563
564
  ];
@@ -595,7 +596,7 @@ FormManagementModule.decorators = [
595
596
  FormManagementCreateComponent,
596
597
  FormManagementListComponent,
597
598
  FormManagementEditComponent,
598
- FormManagementUploadComponent
599
+ FormManagementUploadComponent,
599
600
  ],
600
601
  imports: [
601
602
  FormManagementRoutingModule,
@@ -608,9 +609,9 @@ FormManagementModule.decorators = [
608
609
  TranslateModule,
609
610
  NgbTooltipModule,
610
611
  DropzoneModule,
611
- ModalModule
612
+ ModalModule,
612
613
  ],
613
- exports: [FormManagementComponent]
614
+ exports: [FormManagementComponent],
614
615
  },] }
615
616
  ];
616
617
 
@@ -1 +1 @@
1
- {"version":3,"file":"valtimo-form-management.js","sources":["../../../../projects/valtimo/form-management/src/lib/form-management.service.ts","../../../../projects/valtimo/form-management/src/lib/form-management.component.ts","../../../../projects/valtimo/form-management/src/lib/form-management-create/form-management-create.component.ts","../../../../projects/valtimo/form-management/src/lib/form-management-edit/form-management-edit.component.ts","../../../../projects/valtimo/form-management/src/lib/form-management-routing.module.ts","../../../../projects/valtimo/form-management/src/lib/form-management-list/form-management-list.component.ts","../../../../projects/valtimo/form-management/src/lib/form-management-upload/form-management-upload.component.ts","../../../../projects/valtimo/form-management/src/lib/form-management.module.ts","../../../../projects/valtimo/form-management/src/public-api.ts","../../../../projects/valtimo/form-management/src/valtimo-form-management.ts"],"sourcesContent":["/*\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 */\n\nimport {Injectable} from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {CreateFormDefinitionRequest, FormDefinition, ModifyFormDefinitionRequest} from '@valtimo/contract';\nimport {Observable} from 'rxjs';\nimport {ConfigService} from '@valtimo/config';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class FormManagementService {\n\n private valtimoApiConfig: any;\n\n constructor(\n private http: HttpClient,\n private configService: ConfigService\n ) {\n this.valtimoApiConfig = configService.config.valtimoApi;\n }\n\n getFormDefinition(formDefinitionId: string): Observable<FormDefinition> {\n return this.http.get<FormDefinition>(`${this.valtimoApiConfig.endpointUri}form-management/${formDefinitionId}`);\n }\n\n queryFormDefinitions(params?: any): Observable<any> {\n return this.http.get(`${this.valtimoApiConfig.endpointUri}form-management`, {observe: 'response', params: params});\n }\n\n createFormDefinition(request: CreateFormDefinitionRequest): Observable<FormDefinition> {\n return this.http.post<FormDefinition>(`${this.valtimoApiConfig.endpointUri}form-management`, request);\n }\n\n modifyFormDefinition(request: ModifyFormDefinitionRequest): Observable<FormDefinition> {\n return this.http.put<FormDefinition>(`${this.valtimoApiConfig.endpointUri}form-management`, request);\n }\n\n deleteFormDefinition(formDefinitionId: string): Observable<void> {\n return this.http.delete<void>(`${this.valtimoApiConfig.endpointUri}form-management/${formDefinitionId}`);\n }\n\n}\n","/*\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 */\n\nimport {Component, OnInit} from '@angular/core';\n\n@Component({\n selector: 'valtimo-form-management',\n templateUrl: './form-management.component.html',\n styleUrls: ['./form-management.component.scss']\n})\nexport class FormManagementComponent implements OnInit {\n\n constructor() {\n }\n\n ngOnInit() {\n }\n}\n","/*\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 */\n\nimport {Component, OnInit} from '@angular/core';\nimport {FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms';\nimport {ActivatedRoute, Router} from '@angular/router';\nimport {AlertService} from '@valtimo/components';\nimport {FormManagementService} from '../form-management.service';\nimport {CreateFormDefinitionRequest} from '@valtimo/contract';\nimport {combineLatest} from 'rxjs';\nimport {take} from 'rxjs/operators';\n\n@Component({\n selector: 'valtimo-form-management-create',\n templateUrl: './form-management-create.component.html',\n styleUrls: ['./form-management-create.component.scss']\n})\nexport class FormManagementCreateComponent implements OnInit {\n\n public form: FormGroup;\n\n constructor(\n private formManagementService: FormManagementService,\n private formBuilder: FormBuilder,\n private router: Router,\n private alertService: AlertService,\n private route: ActivatedRoute\n ) {\n }\n\n get formControls() {\n return this.form.controls;\n }\n\n ngOnInit() {\n this.form = this.formBuilder.group({\n name: new FormControl('', Validators.required)\n });\n }\n\n reset() {\n this.form.setValue({\n name: ''\n });\n }\n\n createFormDefinition() {\n const emptyForm = {\n display: 'form',\n components: []\n };\n const request: CreateFormDefinitionRequest = {\n name: this.form.value.name,\n formDefinition: JSON.stringify(emptyForm)\n };\n combineLatest([this.formManagementService.createFormDefinition(request), this.route.queryParams])\n .pipe(take(1))\n .subscribe(([formDefinition, params]) => {\n this.alertService.success('Created new Form');\n\n if (params?.upload === 'true') {\n this.router.navigate(['/form-management/edit', formDefinition.id], {queryParams: {upload: 'true'}});\n } else {\n this.router.navigate(['/form-management/edit', formDefinition.id]);\n }\n }, err => {\n this.alertService.error('Error creating new Form');\n });\n }\n\n}\n","/*\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 */\n\nimport {Component, OnDestroy, OnInit, ViewEncapsulation} from '@angular/core';\nimport {FormManagementService} from '../form-management.service';\nimport {AlertService} from '@valtimo/components';\nimport {FormDefinition, ModifyFormDefinitionRequest} from '@valtimo/contract';\nimport {ActivatedRoute, Router} from '@angular/router';\nimport {first, take} from 'rxjs/operators';\nimport {BehaviorSubject, Subscription} from 'rxjs';\nimport {FormioForm} from 'angular-formio';\n\n@Component({\n selector: 'valtimo-form-management-edit',\n templateUrl: './form-management-edit.component.html',\n styleUrls: ['./form-management-edit.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class FormManagementEditComponent implements OnInit, OnDestroy {\n\n readonly showModal$ = new BehaviorSubject<boolean>(false);\n readonly reloading$ = new BehaviorSubject<boolean>(false);\n public modifiedFormDefinition: FormioForm = null;\n public formDefinition: FormDefinition | null = null;\n private alertSub: Subscription = Subscription.EMPTY;\n private formDefinitionId: string | null = null;\n\n constructor(\n private formManagementService: FormManagementService,\n private alertService: AlertService,\n private route: ActivatedRoute,\n private router: Router\n ) {\n }\n\n ngOnInit() {\n this.loadFormDefinition();\n this.checkToOpenUploadModal();\n }\n\n ngOnDestroy() {\n this.alertSub.unsubscribe();\n }\n\n loadFormDefinition() {\n this.formDefinitionId = this.route.snapshot.paramMap.get('id');\n this.formManagementService.getFormDefinition(this.formDefinitionId).subscribe(formDefinition => {\n this.formDefinition = formDefinition;\n }, () => {\n this.alertService.error('Error retrieving Form Definition');\n });\n }\n\n modifyFormDefinition() {\n const form = JSON.stringify(\n this.modifiedFormDefinition != null ? this.modifiedFormDefinition : this.formDefinition.formDefinition\n );\n const request: ModifyFormDefinitionRequest = {\n id: this.formDefinition.id,\n name: this.formDefinition.name,\n formDefinition: form\n };\n this.formManagementService.modifyFormDefinition(request).subscribe(() => {\n this.router.navigate(['/form-management']);\n this.alertService.success('Form deployed');\n }, err => {\n this.alertService.error('Error deploying Form');\n });\n }\n\n public formBuilderChanged(event) {\n this.modifiedFormDefinition = event.form;\n }\n\n public delete() {\n if (!this.alertSub.closed) {\n return;\n }\n const mssg = 'Delete Form?';\n const confirmations = [\n {\n label: 'Cancel',\n class: 'btn btn-default',\n value: false\n },\n {\n label: 'Delete',\n class: 'btn btn-primary',\n value: true\n }\n ];\n this.alertService.notification(mssg, confirmations);\n this.alertSub = this.alertService.getAlertConfirmChangeEmitter()\n .pipe(first())\n .subscribe(alert => {\n if (alert.confirm === true) {\n this.deleteFormDefinition();\n }\n });\n }\n\n deleteFormDefinition() {\n this.formManagementService.deleteFormDefinition(this.formDefinition.id).subscribe(() => {\n this.router.navigate(['/form-management']);\n this.alertService.success('Form deleted');\n }, err => {\n this.alertService.error('Error deleting Form');\n });\n }\n\n downloadFormDefinition() {\n const file = new Blob([JSON.stringify(this.formDefinition)], {type: 'text/json'});\n const link = document.createElement('a');\n link.download = `form_${this.formDefinition.name}.json`;\n link.href = window.URL.createObjectURL(file);\n link.click();\n window.URL.revokeObjectURL(link.href);\n link.remove();\n }\n\n showModal() {\n this.showModal$.next(true);\n }\n\n setFormDefinition(formDefinition: any) {\n this.reloading$.next(true);\n\n const definition = JSON.parse(formDefinition);\n const components = definition?.formDefinition?.components;\n const currentDefinition = this.modifiedFormDefinition || this.formDefinition.formDefinition;\n const newDefinition = {...currentDefinition, ...(components && {components})};\n\n this.modifiedFormDefinition = newDefinition;\n this.formDefinition.formDefinition = newDefinition;\n\n this.reloading$.next(false);\n }\n\n private checkToOpenUploadModal(): void {\n this.route.queryParams.pipe(take(1))\n .subscribe((params) => {\n if (params?.upload === 'true') {\n this.showModal();\n }\n });\n }\n}\n","/*\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 */\n\nimport {NgModule} from '@angular/core';\nimport {RouterModule, Routes} from '@angular/router';\nimport {FormManagementComponent} from './form-management.component';\nimport {AuthGuardService} from '@valtimo/security';\nimport {FormManagementCreateComponent} from './form-management-create/form-management-create.component';\nimport {FormManagementEditComponent} from './form-management-edit/form-management-edit.component';\nimport {ROLE_ADMIN} from '@valtimo/contract';\n\nconst routes: Routes = [\n {\n path: 'form-management',\n component: FormManagementComponent,\n canActivate: [AuthGuardService],\n data: {title: 'Form management', roles: [ROLE_ADMIN]}\n },\n {\n path: 'form-management/create',\n component: FormManagementCreateComponent,\n canActivate: [AuthGuardService],\n data: {title: 'Create new Form', roles: [ROLE_ADMIN]}\n },\n {\n path: 'form-management/edit/:id',\n component: FormManagementEditComponent,\n canActivate: [AuthGuardService],\n data: {title: 'Form Builder', roles: [ROLE_ADMIN]}\n }\n];\n\n@NgModule({\n imports: [\n RouterModule.forChild(routes)\n ],\n exports: [\n RouterModule\n ],\n declarations: []\n})\nexport class FormManagementRoutingModule {\n}\n","/*\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 */\n\nimport {Component, OnInit} from '@angular/core';\nimport {FormDefinition} from '@valtimo/contract';\nimport {FormManagementService} from '../form-management.service';\nimport {Router} from '@angular/router';\n\n@Component({\n selector: 'valtimo-form-management-list',\n templateUrl: './form-management-list.component.html',\n styleUrls: ['./form-management-list.component.scss']\n})\nexport class FormManagementListComponent implements OnInit {\n\n public formDefinitions: FormDefinition[] = [];\n public formDefinitionFields: any[] = [\n {key: 'name', label: 'Name'},\n {key: 'readOnly', label: 'Read-only'}\n ];\n public pagination = {\n collectionSize: 0,\n page: 1,\n size: 10,\n maxPaginationItemSize: 5\n };\n public pageParam = 0;\n\n public paginationClicked(page) {\n this.pageParam = page - 1;\n this.loadFormDefinitions();\n }\n\n constructor(\n private formManagementService: FormManagementService,\n private router: Router\n ) {\n }\n\n ngOnInit() {\n }\n\n paginationSet() {\n this.loadFormDefinitions();\n }\n\n loadFormDefinitions(searchTerm?: string) {\n const params = {page: this.pageParam, size: this.pagination.size};\n if (searchTerm) {\n params['searchTerm'] = searchTerm;\n }\n this.formManagementService.queryFormDefinitions(params).subscribe((results) => {\n this.pagination.collectionSize = results.body.totalElements;\n this.formDefinitions = results.body.content;\n });\n }\n\n editFormDefinition(formDefinition: FormDefinition) {\n this.router.navigate(['/form-management/edit', formDefinition.id]);\n }\n\n searchTermEntered(searchTerm: string) {\n this.loadFormDefinitions(searchTerm);\n }\n\n}\n","/*\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 */\n\nimport {AfterViewInit, Component, EventEmitter, Input, OnDestroy, Output, ViewChild} from '@angular/core';\nimport {TranslateService} from '@ngx-translate/core';\nimport {ModalComponent} from '@valtimo/components';\nimport {DocumentService} from '@valtimo/document';\nimport {BehaviorSubject, Observable, Subject, Subscription} from 'rxjs';\nimport {take} from 'rxjs/operators';\n\n@Component({\n selector: 'valtimo-form-management-upload',\n templateUrl: './form-management-upload.component.html',\n styleUrls: ['./form-management-upload.component.scss']\n})\nexport class FormManagementUploadComponent implements AfterViewInit, OnDestroy {\n @ViewChild('uploadFormDefinitionModal') modal: ModalComponent;\n\n @Input() show$: Observable<boolean>;\n @Output() definitionUploaded: EventEmitter<any> = new EventEmitter();\n\n readonly clear$ = new Subject();\n readonly jsonString$ = new BehaviorSubject<string>('');\n readonly error$ = new BehaviorSubject<string>('');\n readonly disabled$ = new BehaviorSubject<boolean>(false);\n\n private showSubscription: Subscription;\n private fileSubscription: Subscription;\n private errorSubscription: Subscription;\n\n private readonly file$ = new BehaviorSubject<File>(undefined);\n\n constructor(\n private readonly documentService: DocumentService,\n private readonly translateService: TranslateService,\n ) {\n }\n\n ngAfterViewInit(): void {\n this.openShowSubscription();\n this.openFileSubscription();\n }\n\n ngOnDestroy(): void {\n this.showSubscription.unsubscribe();\n this.fileSubscription.unsubscribe();\n this.closeErrorSubscription();\n }\n\n setFile(file: File): void {\n this.clearError();\n this.file$.next(file);\n }\n\n uploadDefinition(): void {\n this.disable();\n\n this.jsonString$\n .pipe(\n take(1)\n )\n .subscribe((definition) => {\n this.closeErrorSubscription();\n this.clearError();\n this.enable();\n this.hideModal();\n this.definitionUploaded.emit(definition);\n });\n }\n\n private openErrorSubscription(errorCode: string): void {\n this.closeErrorSubscription();\n this.errorSubscription = this.translateService.stream(errorCode).subscribe(error => {\n this.error$.next(error);\n });\n }\n\n private closeErrorSubscription(): void {\n if (this.errorSubscription) {\n this.errorSubscription.unsubscribe();\n }\n }\n\n private clearError(): void {\n this.error$.next('');\n }\n\n private openFileSubscription(): void {\n this.fileSubscription = this.file$.subscribe(file => {\n if (file) {\n const reader = new FileReader();\n\n reader.onloadend = () => {\n const result = reader.result.toString();\n if (this.stringIsValidJson(result)) {\n this.jsonString$.next(result);\n }\n };\n\n reader.readAsText(file);\n } else {\n this.clearJsonString();\n }\n });\n }\n\n private openShowSubscription(): void {\n this.showSubscription = this.show$.subscribe(show => {\n if (show) {\n this.showModal();\n } else {\n this.hideModal();\n }\n\n this.clearJsonString();\n this.clearError();\n this.clearDropzone();\n });\n }\n\n private clearJsonString(): void {\n this.jsonString$.next('');\n }\n\n private clearDropzone(): void {\n this.clear$.next();\n }\n\n private showModal(): void {\n this.modal.show();\n }\n\n private hideModal(): void {\n this.modal.hide();\n }\n\n private stringIsValidJson(string: string) {\n try {\n // tslint:disable-next-line\n JSON.parse(string)?.formDefinition?.components;\n } catch (e) {\n this.clearDropzone();\n this.openErrorSubscription('dropzone.error.invalidFormDef');\n return false;\n }\n return true;\n }\n\n private disable(): void {\n this.disabled$.next(true);\n }\n\n private enable(): void {\n this.disabled$.next(false);\n }\n}\n","/*\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 */\n\nimport {NgModule} from '@angular/core';\nimport {FormManagementComponent} from './form-management.component';\nimport {FormManagementRoutingModule} from './form-management-routing.module';\nimport {DropzoneModule, FormIoModule, ListModule, ModalModule, WidgetModule} from '@valtimo/components';\nimport {CommonModule} from '@angular/common';\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\nimport {FormManagementCreateComponent} from './form-management-create/form-management-create.component';\nimport {FormManagementListComponent} from './form-management-list/form-management-list.component';\nimport {FormManagementEditComponent} from './form-management-edit/form-management-edit.component';\nimport {TranslateModule} from '@ngx-translate/core';\nimport {NgbTooltipModule} from '@ng-bootstrap/ng-bootstrap';\nimport {FormManagementUploadComponent} from './form-management-upload/form-management-upload.component';\n\n@NgModule({\n declarations: [\n FormManagementComponent,\n FormManagementCreateComponent,\n FormManagementListComponent,\n FormManagementEditComponent,\n FormManagementUploadComponent\n ],\n imports: [\n FormManagementRoutingModule,\n FormIoModule,\n CommonModule,\n ReactiveFormsModule,\n FormsModule,\n WidgetModule,\n ListModule,\n TranslateModule,\n NgbTooltipModule,\n DropzoneModule,\n ModalModule\n ],\n exports: [FormManagementComponent]\n})\nexport class FormManagementModule {\n\n}\n","/*\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 */\n\n/*\n * Public API Surface of form-management\n */\n\nexport * from './lib/form-management.service';\nexport * from './lib/form-management.component';\nexport * from './lib/form-management.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {FormManagementCreateComponent as ɵa} from './lib/form-management-create/form-management-create.component';\nexport {FormManagementEditComponent as ɵc} from './lib/form-management-edit/form-management-edit.component';\nexport {FormManagementListComponent as ɵb} from './lib/form-management-list/form-management-list.component';\nexport {FormManagementRoutingModule as ɵe} from './lib/form-management-routing.module';\nexport {FormManagementUploadComponent as ɵd} from './lib/form-management-upload/form-management-upload.component';"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;MAyBa,qBAAqB;IAIhC,YACU,IAAgB,EAChB,aAA4B;QAD5B,SAAI,GAAJ,IAAI,CAAY;QAChB,kBAAa,GAAb,aAAa,CAAe;QAEpC,IAAI,CAAC,gBAAgB,GAAG,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC;KACzD;IAED,iBAAiB,CAAC,gBAAwB;QACxC,OAAO,IAAI,CAAC,IA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AAI,EAAE,CAAC;KACnB;IAEO,iBAAiB,CAAC,MAAc;;QACtC,IAAI;;YAEF,YAAA,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,cAAc,0CAAE,UAAU,CAAC;SAChD;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,aAAa,EAAE,CAAC;YACrB,IAAI,CAAC,qBAAqB,CAAC,+BAA+B,CAAC,CAAC;YAC5D,OAAO,KAAK,CAAC;SACd;QACD,OAAO,IAAI,CAAC;KACb;IAEO,OAAO;QACb,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAC3B;IAEO,MAAM;QACZ,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KAC5B;;;YAhJF,SAAS,SAAC;gBACT,QAAQ,EAAE,gCAAgC;gBAC1C,q6BAAsD;;aAEvD;;;YARO,eAAe;YAFf,gBAAgB;;;oBAYrB,SAAS,SAAC,2BAA2B;oBAErC,KAAK;iCACL,MAAM;;;AChCT;;;;;;;;;;;;;;;MAoDa,oBAAoB;;;YAvBhC,QAAQ,SAAC;gBACR,YAAY,EAAE;oBACZ,uBAAuB;oBACvB,6BAA6B;oBAC7B,2BAA2B;oBAC3B,2BAA2B;oBAC3B,6BAA6B;iBAC9B;gBACD,OAAO,EAAE;oBACP,2BAA2B;oBAC3B,YAAY;oBACZ,YAAY;oBACZ,mBAAmB;oBACnB,WAAW;oBACX,YAAY;oBACZ,UAAU;oBACV,eAAe;oBACf,gBAAgB;oBAChB,cAAc;oBACd,WAAW;iBACZ;gBACD,OAAO,EAAE,CAAC,uBAAuB,CAAC;aACnC;;;ACnDD;;;;;;;;;;;;;;;;ACAA;;;;;;"}
1
+ {"version":3,"file":"valtimo-form-management.js","sources":["../../../../projects/valtimo/form-management/src/lib/form-management.service.ts","../../../../projects/valtimo/form-management/src/lib/form-management.component.ts","../../../../projects/valtimo/form-management/src/lib/form-management-create/form-management-create.component.ts","../../../../projects/valtimo/form-management/src/lib/form-management-edit/form-management-edit.component.ts","../../../../projects/valtimo/form-management/src/lib/form-management-routing.module.ts","../../../../projects/valtimo/form-management/src/lib/form-management-list/form-management-list.component.ts","../../../../projects/valtimo/form-management/src/lib/form-management-upload/form-management-upload.component.ts","../../../../projects/valtimo/form-management/src/lib/form-management.module.ts","../../../../projects/valtimo/form-management/src/public-api.ts","../../../../projects/valtimo/form-management/src/valtimo-form-management.ts"],"sourcesContent":["/*\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 */\n\nimport {Injectable} from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {\n CreateFormDefinitionRequest,\n FormDefinition,\n ModifyFormDefinitionRequest,\n} from '@valtimo/contract';\nimport {Observable} from 'rxjs';\nimport {ConfigService} from '@valtimo/config';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class FormManagementService {\n private valtimoApiConfig: any;\n\n constructor(private http: HttpClient, private configService: ConfigService) {\n this.valtimoApiConfig = configService.config.valtimoApi;\n }\n\n getFormDefinition(formDefinitionId: string): Observable<FormDefinition> {\n return this.http.get<FormDefinition>(\n `${this.valtimoApiConfig.endpointUri}form-management/${formDefinitionId}`\n );\n }\n\n queryFormDefinitions(params?: any): Observable<any> {\n return this.http.get(`${this.valtimoApiConfig.endpointUri}form-management`, {\n observe: 'response',\n params: params,\n });\n }\n\n createFormDefinition(request: CreateFormDefinitionRequest): Observable<FormDefinition> {\n return this.http.post<FormDefinition>(\n `${this.valtimoApiConfig.endpointUri}form-management`,\n request\n );\n }\n\n modifyFormDefinition(request: ModifyFormDefinitionRequest): Observable<FormDefinition> {\n return this.http.put<FormDefinition>(\n `${this.valtimoApiConfig.endpointUri}form-management`,\n request\n );\n }\n\n deleteFormDefinition(formDefinitionId: string): Observable<void> {\n return this.http.delete<void>(\n `${this.valtimoApiConfig.endpointUri}form-management/${formDefinitionId}`\n );\n }\n}\n","/*\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 */\n\nimport {Component, OnInit} from '@angular/core';\n\n@Component({\n selector: 'valtimo-form-management',\n templateUrl: './form-management.component.html',\n styleUrls: ['./form-management.component.scss'],\n})\nexport class FormManagementComponent implements OnInit {\n constructor() {}\n\n ngOnInit() {}\n}\n","/*\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 */\n\nimport {Component, OnInit} from '@angular/core';\nimport {FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms';\nimport {ActivatedRoute, Router} from '@angular/router';\nimport {AlertService} from '@valtimo/components';\nimport {FormManagementService} from '../form-management.service';\nimport {CreateFormDefinitionRequest} from '@valtimo/contract';\nimport {combineLatest} from 'rxjs';\nimport {take} from 'rxjs/operators';\n\n@Component({\n selector: 'valtimo-form-management-create',\n templateUrl: './form-management-create.component.html',\n styleUrls: ['./form-management-create.component.scss'],\n})\nexport class FormManagementCreateComponent implements OnInit {\n public form: FormGroup;\n\n constructor(\n private formManagementService: FormManagementService,\n private formBuilder: FormBuilder,\n private router: Router,\n private alertService: AlertService,\n private route: ActivatedRoute\n ) {}\n\n get formControls() {\n return this.form.controls;\n }\n\n ngOnInit() {\n this.form = this.formBuilder.group({\n name: new FormControl('', Validators.required),\n });\n }\n\n reset() {\n this.form.setValue({\n name: '',\n });\n }\n\n createFormDefinition() {\n const emptyForm = {\n display: 'form',\n components: [],\n };\n const request: CreateFormDefinitionRequest = {\n name: this.form.value.name,\n formDefinition: JSON.stringify(emptyForm),\n };\n combineLatest([\n this.formManagementService.createFormDefinition(request),\n this.route.queryParams,\n ])\n .pipe(take(1))\n .subscribe(\n ([formDefinition, params]) => {\n this.alertService.success('Created new Form');\n\n if (params?.upload === 'true') {\n this.router.navigate(['/form-management/edit', formDefinition.id], {\n queryParams: {upload: 'true'},\n });\n } else {\n this.router.navigate(['/form-management/edit', formDefinition.id]);\n }\n },\n err => {\n this.alertService.error('Error creating new Form');\n }\n );\n }\n}\n","/*\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 */\n\nimport {Component, OnDestroy, OnInit, ViewEncapsulation} from '@angular/core';\nimport {FormManagementService} from '../form-management.service';\nimport {AlertService} from '@valtimo/components';\nimport {FormDefinition, ModifyFormDefinitionRequest} from '@valtimo/contract';\nimport {ActivatedRoute, Router} from '@angular/router';\nimport {first, take} from 'rxjs/operators';\nimport {BehaviorSubject, Subscription} from 'rxjs';\nimport {FormioForm} from 'angular-formio';\n\n@Component({\n selector: 'valtimo-form-management-edit',\n templateUrl: './form-management-edit.component.html',\n styleUrls: ['./form-management-edit.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class FormManagementEditComponent implements OnInit, OnDestroy {\n readonly showModal$ = new BehaviorSubject<boolean>(false);\n readonly reloading$ = new BehaviorSubject<boolean>(false);\n public modifiedFormDefinition: FormioForm = null;\n public formDefinition: FormDefinition | null = null;\n private alertSub: Subscription = Subscription.EMPTY;\n private formDefinitionId: string | null = null;\n\n constructor(\n private formManagementService: FormManagementService,\n private alertService: AlertService,\n private route: ActivatedRoute,\n private router: Router\n ) {}\n\n ngOnInit() {\n this.loadFormDefinition();\n this.checkToOpenUploadModal();\n }\n\n ngOnDestroy() {\n this.alertSub.unsubscribe();\n }\n\n loadFormDefinition() {\n this.formDefinitionId = this.route.snapshot.paramMap.get('id');\n this.formManagementService.getFormDefinition(this.formDefinitionId).subscribe(\n formDefinition => {\n this.formDefinition = formDefinition;\n },\n () => {\n this.alertService.error('Error retrieving Form Definition');\n }\n );\n }\n\n modifyFormDefinition() {\n const form = JSON.stringify(\n this.modifiedFormDefinition != null\n ? this.modifiedFormDefinition\n : this.formDefinition.formDefinition\n );\n const request: ModifyFormDefinitionRequest = {\n id: this.formDefinition.id,\n name: this.formDefinition.name,\n formDefinition: form,\n };\n this.formManagementService.modifyFormDefinition(request).subscribe(\n () => {\n this.router.navigate(['/form-management']);\n this.alertService.success('Form deployed');\n },\n err => {\n this.alertService.error('Error deploying Form');\n }\n );\n }\n\n public formBuilderChanged(event) {\n this.modifiedFormDefinition = event.form;\n }\n\n public delete() {\n if (!this.alertSub.closed) {\n return;\n }\n const mssg = 'Delete Form?';\n const confirmations = [\n {\n label: 'Cancel',\n class: 'btn btn-default',\n value: false,\n },\n {\n label: 'Delete',\n class: 'btn btn-primary',\n value: true,\n },\n ];\n this.alertService.notification(mssg, confirmations);\n this.alertSub = this.alertService\n .getAlertConfirmChangeEmitter()\n .pipe(first())\n .subscribe(alert => {\n if (alert.confirm === true) {\n this.deleteFormDefinition();\n }\n });\n }\n\n deleteFormDefinition() {\n this.formManagementService.deleteFormDefinition(this.formDefinition.id).subscribe(\n () => {\n this.router.navigate(['/form-management']);\n this.alertService.success('Form deleted');\n },\n err => {\n this.alertService.error('Error deleting Form');\n }\n );\n }\n\n downloadFormDefinition() {\n const file = new Blob([JSON.stringify(this.formDefinition)], {type: 'text/json'});\n const link = document.createElement('a');\n link.download = `form_${this.formDefinition.name}.json`;\n link.href = window.URL.createObjectURL(file);\n link.click();\n window.URL.revokeObjectURL(link.href);\n link.remove();\n }\n\n showModal() {\n this.showModal$.next(true);\n }\n\n setFormDefinition(formDefinition: any) {\n this.reloading$.next(true);\n\n const definition = JSON.parse(formDefinition);\n const components = definition?.formDefinition?.components;\n const currentDefinition = this.modifiedFormDefinition || this.formDefinition.formDefinition;\n const newDefinition = {...currentDefinition, ...(components && {components})};\n\n this.modifiedFormDefinition = newDefinition;\n this.formDefinition.formDefinition = newDefinition;\n\n this.reloading$.next(false);\n }\n\n private checkToOpenUploadModal(): void {\n this.route.queryParams.pipe(take(1)).subscribe(params => {\n if (params?.upload === 'true') {\n this.showModal();\n }\n });\n }\n}\n","/*\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 */\n\nimport {NgModule} from '@angular/core';\nimport {RouterModule, Routes} from '@angular/router';\nimport {FormManagementComponent} from './form-management.component';\nimport {AuthGuardService} from '@valtimo/security';\nimport {FormManagementCreateComponent} from './form-management-create/form-management-create.component';\nimport {FormManagementEditComponent} from './form-management-edit/form-management-edit.component';\nimport {ROLE_ADMIN} from '@valtimo/contract';\n\nconst routes: Routes = [\n {\n path: 'form-management',\n component: FormManagementComponent,\n canActivate: [AuthGuardService],\n data: {title: 'Form management', roles: [ROLE_ADMIN]},\n },\n {\n path: 'form-management/create',\n component: FormManagementCreateComponent,\n canActivate: [AuthGuardService],\n data: {title: 'Create new Form', roles: [ROLE_ADMIN]},\n },\n {\n path: 'form-management/edit/:id',\n component: FormManagementEditComponent,\n canActivate: [AuthGuardService],\n data: {title: 'Form Builder', roles: [ROLE_ADMIN]},\n },\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n declarations: [],\n})\nexport class FormManagementRoutingModule {}\n","/*\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 */\n\nimport {Component, OnInit} from '@angular/core';\nimport {FormDefinition} from '@valtimo/contract';\nimport {FormManagementService} from '../form-management.service';\nimport {Router} from '@angular/router';\n\n@Component({\n selector: 'valtimo-form-management-list',\n templateUrl: './form-management-list.component.html',\n styleUrls: ['./form-management-list.component.scss'],\n})\nexport class FormManagementListComponent implements OnInit {\n public formDefinitions: FormDefinition[] = [];\n public formDefinitionFields: any[] = [\n {key: 'name', label: 'Name'},\n {key: 'readOnly', label: 'Read-only'},\n ];\n public pagination = {\n collectionSize: 0,\n page: 1,\n size: 10,\n maxPaginationItemSize: 5,\n };\n public pageParam = 0;\n\n public paginationClicked(page) {\n this.pageParam = page - 1;\n this.loadFormDefinitions();\n }\n\n constructor(private formManagementService: FormManagementService, private router: Router) {}\n\n ngOnInit() {}\n\n paginationSet() {\n this.loadFormDefinitions();\n }\n\n loadFormDefinitions(searchTerm?: string) {\n const params = {page: this.pageParam, size: this.pagination.size};\n if (searchTerm) {\n params['searchTerm'] = searchTerm;\n }\n this.formManagementService.queryFormDefinitions(params).subscribe(results => {\n this.pagination.collectionSize = results.body.totalElements;\n this.formDefinitions = results.body.content;\n });\n }\n\n editFormDefinition(formDefinition: FormDefinition) {\n this.router.navigate(['/form-management/edit', formDefinition.id]);\n }\n\n searchTermEntered(searchTerm: string) {\n this.loadFormDefinitions(searchTerm);\n }\n}\n","/*\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 */\n\nimport {\n AfterViewInit,\n Component,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n ViewChild,\n} from '@angular/core';\nimport {TranslateService} from '@ngx-translate/core';\nimport {ModalComponent} from '@valtimo/components';\nimport {DocumentService} from '@valtimo/document';\nimport {BehaviorSubject, Observable, Subject, Subscription} from 'rxjs';\nimport {take} from 'rxjs/operators';\n\n@Component({\n selector: 'valtimo-form-management-upload',\n templateUrl: './form-management-upload.component.html',\n styleUrls: ['./form-management-upload.component.scss'],\n})\nexport class FormManagementUploadComponent implements AfterViewInit, OnDestroy {\n @ViewChild('uploadFormDefinitionModal') modal: ModalComponent;\n\n @Input() show$: Observable<boolean>;\n @Output() definitionUploaded: EventEmitter<any> = new EventEmitter();\n\n readonly clear$ = new Subject();\n readonly jsonString$ = new BehaviorSubject<string>('');\n readonly error$ = new BehaviorSubject<string>('');\n readonly disabled$ = new BehaviorSubject<boolean>(false);\n\n private showSubscription: Subscription;\n private fileSubscription: Subscription;\n private errorSubscription: Subscription;\n\n private readonly file$ = new BehaviorSubject<File>(undefined);\n\n constructor(\n private readonly documentService: DocumentService,\n private readonly translateService: TranslateService\n ) {}\n\n ngAfterViewInit(): void {\n this.openShowSubscription();\n this.openFileSubscription();\n }\n\n ngOnDestroy(): void {\n this.showSubscription.unsubscribe();\n this.fileSubscription.unsubscribe();\n this.closeErrorSubscription();\n }\n\n setFile(file: File): void {\n this.clearError();\n this.file$.next(file);\n }\n\n uploadDefinition(): void {\n this.disable();\n\n this.jsonString$.pipe(take(1)).subscribe(definition => {\n this.closeErrorSubscription();\n this.clearError();\n this.enable();\n this.hideModal();\n this.definitionUploaded.emit(definition);\n });\n }\n\n private openErrorSubscription(errorCode: string): void {\n this.closeErrorSubscription();\n this.errorSubscription = this.translateService.stream(errorCode).subscribe(error => {\n this.error$.next(error);\n });\n }\n\n private closeErrorSubscription(): void {\n if (this.errorSubscription) {\n this.errorSubscription.unsubscribe();\n }\n }\n\n private clearError(): void {\n this.error$.next('');\n }\n\n private openFileSubscription(): void {\n this.fileSubscription = this.file$.subscribe(file => {\n if (file) {\n const reader = new FileReader();\n\n reader.onloadend = () => {\n const result = reader.result.toString();\n if (this.stringIsValidJson(result)) {\n this.jsonString$.next(result);\n }\n };\n\n reader.readAsText(file);\n } else {\n this.clearJsonString();\n }\n });\n }\n\n private openShowSubscription(): void {\n this.showSubscription = this.show$.subscribe(show => {\n if (show) {\n this.showModal();\n } else {\n this.hideModal();\n }\n\n this.clearJsonString();\n this.clearError();\n this.clearDropzone();\n });\n }\n\n private clearJsonString(): void {\n this.jsonString$.next('');\n }\n\n private clearDropzone(): void {\n this.clear$.next();\n }\n\n private showModal(): void {\n this.modal.show();\n }\n\n private hideModal(): void {\n this.modal.hide();\n }\n\n private stringIsValidJson(string: string) {\n try {\n // tslint:disable-next-line\n JSON.parse(string)?.formDefinition?.components;\n } catch (e) {\n this.clearDropzone();\n this.openErrorSubscription('dropzone.error.invalidFormDef');\n return false;\n }\n return true;\n }\n\n private disable(): void {\n this.disabled$.next(true);\n }\n\n private enable(): void {\n this.disabled$.next(false);\n }\n}\n","/*\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 */\n\nimport {NgModule} from '@angular/core';\nimport {FormManagementComponent} from './form-management.component';\nimport {FormManagementRoutingModule} from './form-management-routing.module';\nimport {\n DropzoneModule,\n FormIoModule,\n ListModule,\n ModalModule,\n WidgetModule,\n} from '@valtimo/components';\nimport {CommonModule} from '@angular/common';\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\nimport {FormManagementCreateComponent} from './form-management-create/form-management-create.component';\nimport {FormManagementListComponent} from './form-management-list/form-management-list.component';\nimport {FormManagementEditComponent} from './form-management-edit/form-management-edit.component';\nimport {TranslateModule} from '@ngx-translate/core';\nimport {NgbTooltipModule} from '@ng-bootstrap/ng-bootstrap';\nimport {FormManagementUploadComponent} from './form-management-upload/form-management-upload.component';\n\n@NgModule({\n declarations: [\n FormManagementComponent,\n FormManagementCreateComponent,\n FormManagementListComponent,\n FormManagementEditComponent,\n FormManagementUploadComponent,\n ],\n imports: [\n FormManagementRoutingModule,\n FormIoModule,\n CommonModule,\n ReactiveFormsModule,\n FormsModule,\n WidgetModule,\n ListModule,\n TranslateModule,\n NgbTooltipModule,\n DropzoneModule,\n ModalModule,\n ],\n exports: [FormManagementComponent],\n})\nexport class FormManagementModule {}\n","/*\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 */\n\n/*\n * Public API Surface of form-management\n */\n\nexport * from './lib/form-management.service';\nexport * from './lib/form-management.component';\nexport * from './lib/form-management.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {FormManagementCreateComponent as ɵa} from './lib/form-management-create/form-management-create.component';\nexport {FormManagementEditComponent as ɵc} from './lib/form-management-edit/form-management-edit.component';\nexport {FormManagementListComponent as ɵb} from './lib/form-management-list/form-management-list.component';\nexport {FormManagementRoutingModule as ɵe} from './lib/form-management-routing.module';\nexport {FormManagementUploadComponent as ɵd} from './lib/form-management-upload/form-management-upload.component';"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;MA6Ba,qBAAqB;IAGhC,YAAoB,IAAgB,EAAU,aAA4B;QAAtD,SAAI,GAAJ,IAAI,CAAY;QAAU,kBAAa,GAAb,aAAa,CAAe;QACxE,IAAI,CAAC,gBAAgB,GAAG,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC;KACzD;IAED,iBAAiB,CAAC,gBAAwB;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAClB,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,mBAAmB,gBAAgB,EAAE,CAC1E,CAAC;KACH;IAED,oBAAoB,CAAC,MAAY;QAC/B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,iBAAiB,EAAE;YAC1E,OAAO,EAAE,UAAU;YACnB,MAAM,EAAE,MAAM;SACf,CAAC,CAA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AC;KACb;IAEO,OAAO;QACb,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAC3B;IAEO,MAAM;QACZ,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KAC5B;;;YA3IF,SAAS,SAAC;gBACT,QAAQ,EAAE,gCAAgC;gBAC1C,k5BAAsD;;aAEvD;;;YARO,eAAe;YAFf,gBAAgB;;;oBAYrB,SAAS,SAAC,2BAA2B;oBAErC,KAAK;iCACL,MAAM;;;ACxCT;;;;;;;;;;;;;;;MA0Da,oBAAoB;;;YAvBhC,QAAQ,SAAC;gBACR,YAAY,EAAE;oBACZ,uBAAuB;oBACvB,6BAA6B;oBAC7B,2BAA2B;oBAC3B,2BAA2B;oBAC3B,6BAA6B;iBAC9B;gBACD,OAAO,EAAE;oBACP,2BAA2B;oBAC3B,YAAY;oBACZ,YAAY;oBACZ,mBAAmB;oBACnB,WAAW;oBACX,YAAY;oBACZ,UAAU;oBACV,eAAe;oBACf,gBAAgB;oBAChB,cAAc;oBACd,WAAW;iBACZ;gBACD,OAAO,EAAE,CAAC,uBAAuB,CAAC;aACnC;;;ACzDD;;;;;;;;;;;;;;;;ACAA;;;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@valtimo/form-management",
3
3
  "license": "EUPL-1.2",
4
- "version": "4.15.3-next-main.15",
4
+ "version": "4.15.3-next-main.16",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^10.0.11",
7
7
  "@angular/core": "^10.0.11"