@valtimo/form-management 4.15.3-next-main.14 → 4.16.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.
- package/README.md +14 -6
- package/bundles/valtimo-form-management.umd.js +124 -61
- package/bundles/valtimo-form-management.umd.js.map +1 -1
- package/bundles/valtimo-form-management.umd.min.js +1 -1
- package/bundles/valtimo-form-management.umd.min.js.map +1 -1
- package/esm2015/lib/form-management-create/form-management-create.component.js +13 -8
- package/esm2015/lib/form-management-edit/form-management-edit.component.js +12 -10
- package/esm2015/lib/form-management-list/form-management-list.component.js +6 -7
- package/esm2015/lib/form-management-routing.module.js +9 -13
- package/esm2015/lib/form-management-upload/form-management-upload.component.js +4 -6
- package/esm2015/lib/form-management.component.js +4 -6
- package/esm2015/lib/form-management.module.js +5 -5
- package/esm2015/lib/form-management.service.js +6 -3
- package/esm2015/lib/models/form-definition.model.js +25 -0
- package/esm2015/lib/models/index.js +19 -0
- package/esm2015/public-api.js +2 -1
- package/esm2015/valtimo-form-management.js +1 -1
- package/fesm2015/valtimo-form-management.js +93 -50
- package/fesm2015/valtimo-form-management.js.map +1 -1
- package/lib/form-management-edit/form-management-edit.component.d.ts +1 -1
- package/lib/form-management-list/form-management-list.component.d.ts +1 -1
- package/lib/form-management.service.d.ts +1 -1
- package/lib/models/form-definition.model.d.ts +17 -0
- package/lib/models/index.d.ts +1 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/valtimo-form-management.metadata.json +1 -1
package/README.md
CHANGED
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
# FormManagement
|
|
2
2
|
|
|
3
|
-
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version
|
|
3
|
+
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version
|
|
4
|
+
8.2.14.
|
|
4
5
|
|
|
5
6
|
## Code scaffolding
|
|
6
7
|
|
|
7
|
-
Run `ng generate component component-name --project form-management` to generate a new component.
|
|
8
|
-
|
|
8
|
+
Run `ng generate component component-name --project form-management` to generate a new component.
|
|
9
|
+
You can also use
|
|
10
|
+
`ng generate directive|pipe|service|class|guard|interface|enum|module --project form-management`.
|
|
11
|
+
|
|
12
|
+
> Note: Don't forget to add `--project form-management` or else it will be added to the default
|
|
13
|
+
> project in your `angular.json` file.
|
|
9
14
|
|
|
10
15
|
## Build
|
|
11
16
|
|
|
12
|
-
Run `ng build form-management` to build the project. The build artifacts will be stored in the
|
|
17
|
+
Run `ng build form-management` to build the project. The build artifacts will be stored in the
|
|
18
|
+
`dist/` directory.
|
|
13
19
|
|
|
14
20
|
## Publishing
|
|
15
21
|
|
|
16
|
-
After building your library with `ng build form-management`, go to the dist folder
|
|
22
|
+
After building your library with `ng build form-management`, go to the dist folder
|
|
23
|
+
`cd dist/form-management` and run `npm publish`.
|
|
17
24
|
|
|
18
25
|
## Running unit tests
|
|
19
26
|
|
|
@@ -21,4 +28,5 @@ Run `ng test form-management` to execute the unit tests via [Karma](https://karm
|
|
|
21
28
|
|
|
22
29
|
## Further help
|
|
23
30
|
|
|
24
|
-
To get more help on the Angular CLI use `ng help` or go check out the
|
|
31
|
+
To get more help on the Angular CLI use `ng help` or go check out the
|
|
32
|
+
[Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('@valtimo/config'), require('@angular/router'), require('@valtimo/security'), require('@angular/forms'), require('@valtimo/components'), require('rxjs'), require('rxjs/operators'), require('@
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@valtimo/form-management', ['exports', '@angular/core', '@angular/common/http', '@valtimo/config', '@angular/router', '@valtimo/security', '@angular/forms', '@valtimo/components', 'rxjs', 'rxjs/operators', '@
|
|
4
|
-
(global = global || self, factory((global.valtimo = global.valtimo || {}, global.valtimo['form-management'] = {}), global.ng.core, global.ng.common.http, global.config, global.ng.router, global.security, global.ng.forms, global.components, global.rxjs, global.rxjs.operators, global.
|
|
5
|
-
}(this, (function (exports, i0, i1, i2, router, security, forms, components, rxjs, operators,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('@valtimo/config'), require('@angular/router'), require('@valtimo/security'), require('@angular/forms'), require('@valtimo/components'), require('rxjs'), require('rxjs/operators'), require('@angular/common'), require('@ngx-translate/core'), require('@ng-bootstrap/ng-bootstrap'), require('@valtimo/document')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@valtimo/form-management', ['exports', '@angular/core', '@angular/common/http', '@valtimo/config', '@angular/router', '@valtimo/security', '@angular/forms', '@valtimo/components', 'rxjs', 'rxjs/operators', '@angular/common', '@ngx-translate/core', '@ng-bootstrap/ng-bootstrap', '@valtimo/document'], factory) :
|
|
4
|
+
(global = global || self, factory((global.valtimo = global.valtimo || {}, global.valtimo['form-management'] = {}), global.ng.core, global.ng.common.http, global.config, global.ng.router, global.security, global.ng.forms, global.components, global.rxjs, global.rxjs.operators, global.ng.common, global.core$1, global.ngBootstrap, global.document$1));
|
|
5
|
+
}(this, (function (exports, i0, i1, i2, router, security, forms, components, rxjs, operators, common, core, ngBootstrap, document$1) { 'use strict';
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
@@ -29,7 +29,10 @@
|
|
|
29
29
|
return this.http.get(this.valtimoApiConfig.endpointUri + "form-management/" + formDefinitionId);
|
|
30
30
|
};
|
|
31
31
|
FormManagementService.prototype.queryFormDefinitions = function (params) {
|
|
32
|
-
return this.http.get(this.valtimoApiConfig.endpointUri + "form-management", {
|
|
32
|
+
return this.http.get(this.valtimoApiConfig.endpointUri + "form-management", {
|
|
33
|
+
observe: 'response',
|
|
34
|
+
params: params,
|
|
35
|
+
});
|
|
33
36
|
};
|
|
34
37
|
FormManagementService.prototype.createFormDefinition = function (request) {
|
|
35
38
|
return this.http.post(this.valtimoApiConfig.endpointUri + "form-management", request);
|
|
@@ -45,7 +48,7 @@
|
|
|
45
48
|
FormManagementService.ɵprov = i0.ɵɵdefineInjectable({ factory: function FormManagementService_Factory() { return new FormManagementService(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(i2.ConfigService)); }, token: FormManagementService, providedIn: "root" });
|
|
46
49
|
FormManagementService.decorators = [
|
|
47
50
|
{ type: i0.Injectable, args: [{
|
|
48
|
-
providedIn: 'root'
|
|
51
|
+
providedIn: 'root',
|
|
49
52
|
},] }
|
|
50
53
|
];
|
|
51
54
|
FormManagementService.ctorParameters = function () { return [
|
|
@@ -71,14 +74,13 @@
|
|
|
71
74
|
var FormManagementComponent = /** @class */ (function () {
|
|
72
75
|
function FormManagementComponent() {
|
|
73
76
|
}
|
|
74
|
-
FormManagementComponent.prototype.ngOnInit = function () {
|
|
75
|
-
};
|
|
77
|
+
FormManagementComponent.prototype.ngOnInit = function () { };
|
|
76
78
|
return FormManagementComponent;
|
|
77
79
|
}());
|
|
78
80
|
FormManagementComponent.decorators = [
|
|
79
81
|
{ type: i0.Component, args: [{
|
|
80
82
|
selector: 'valtimo-form-management',
|
|
81
|
-
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
|
|
83
|
+
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> \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> \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",
|
|
82
84
|
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 */"]
|
|
83
85
|
},] }
|
|
84
86
|
];
|
|
@@ -108,6 +110,8 @@
|
|
|
108
110
|
return extendStatics(d, b);
|
|
109
111
|
};
|
|
110
112
|
function __extends(d, b) {
|
|
113
|
+
if (typeof b !== "function" && b !== null)
|
|
114
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
111
115
|
extendStatics(d, b);
|
|
112
116
|
function __() { this.constructor = d; }
|
|
113
117
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -293,11 +297,13 @@
|
|
|
293
297
|
}
|
|
294
298
|
return ar;
|
|
295
299
|
}
|
|
300
|
+
/** @deprecated */
|
|
296
301
|
function __spread() {
|
|
297
302
|
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
298
303
|
ar = ar.concat(__read(arguments[i]));
|
|
299
304
|
return ar;
|
|
300
305
|
}
|
|
306
|
+
/** @deprecated */
|
|
301
307
|
function __spreadArrays() {
|
|
302
308
|
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
303
309
|
s += arguments[i].length;
|
|
@@ -306,7 +312,17 @@
|
|
|
306
312
|
r[k] = a[j];
|
|
307
313
|
return r;
|
|
308
314
|
}
|
|
309
|
-
|
|
315
|
+
function __spreadArray(to, from, pack) {
|
|
316
|
+
if (pack || arguments.length === 2)
|
|
317
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
318
|
+
if (ar || !(i in from)) {
|
|
319
|
+
if (!ar)
|
|
320
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
321
|
+
ar[i] = from[i];
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
325
|
+
}
|
|
310
326
|
function __await(v) {
|
|
311
327
|
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
312
328
|
}
|
|
@@ -371,18 +387,21 @@
|
|
|
371
387
|
function __importDefault(mod) {
|
|
372
388
|
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
373
389
|
}
|
|
374
|
-
function __classPrivateFieldGet(receiver,
|
|
375
|
-
if (!
|
|
376
|
-
throw new TypeError("
|
|
377
|
-
|
|
378
|
-
|
|
390
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
391
|
+
if (kind === "a" && !f)
|
|
392
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
393
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
394
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
395
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
379
396
|
}
|
|
380
|
-
function __classPrivateFieldSet(receiver,
|
|
381
|
-
if (
|
|
382
|
-
throw new TypeError("
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
397
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
398
|
+
if (kind === "m")
|
|
399
|
+
throw new TypeError("Private method is not writable");
|
|
400
|
+
if (kind === "a" && !f)
|
|
401
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
402
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
403
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
404
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
386
405
|
}
|
|
387
406
|
|
|
388
407
|
var FormManagementCreateComponent = /** @class */ (function () {
|
|
@@ -402,31 +421,36 @@
|
|
|
402
421
|
});
|
|
403
422
|
FormManagementCreateComponent.prototype.ngOnInit = function () {
|
|
404
423
|
this.form = this.formBuilder.group({
|
|
405
|
-
name: new forms.FormControl('', forms.Validators.required)
|
|
424
|
+
name: new forms.FormControl('', forms.Validators.required),
|
|
406
425
|
});
|
|
407
426
|
};
|
|
408
427
|
FormManagementCreateComponent.prototype.reset = function () {
|
|
409
428
|
this.form.setValue({
|
|
410
|
-
name: ''
|
|
429
|
+
name: '',
|
|
411
430
|
});
|
|
412
431
|
};
|
|
413
432
|
FormManagementCreateComponent.prototype.createFormDefinition = function () {
|
|
414
433
|
var _this = this;
|
|
415
434
|
var emptyForm = {
|
|
416
435
|
display: 'form',
|
|
417
|
-
components: []
|
|
436
|
+
components: [],
|
|
418
437
|
};
|
|
419
438
|
var request = {
|
|
420
439
|
name: this.form.value.name,
|
|
421
|
-
formDefinition: JSON.stringify(emptyForm)
|
|
440
|
+
formDefinition: JSON.stringify(emptyForm),
|
|
422
441
|
};
|
|
423
|
-
rxjs.combineLatest([
|
|
442
|
+
rxjs.combineLatest([
|
|
443
|
+
this.formManagementService.createFormDefinition(request),
|
|
444
|
+
this.route.queryParams,
|
|
445
|
+
])
|
|
424
446
|
.pipe(operators.take(1))
|
|
425
447
|
.subscribe(function (_a) {
|
|
426
448
|
var _b = __read(_a, 2), formDefinition = _b[0], params = _b[1];
|
|
427
449
|
_this.alertService.success('Created new Form');
|
|
428
450
|
if ((params === null || params === void 0 ? void 0 : params.upload) === 'true') {
|
|
429
|
-
_this.router.navigate(['/form-management/edit', formDefinition.id], {
|
|
451
|
+
_this.router.navigate(['/form-management/edit', formDefinition.id], {
|
|
452
|
+
queryParams: { upload: 'true' },
|
|
453
|
+
});
|
|
430
454
|
}
|
|
431
455
|
else {
|
|
432
456
|
_this.router.navigate(['/form-management/edit', formDefinition.id]);
|
|
@@ -440,7 +464,7 @@
|
|
|
440
464
|
FormManagementCreateComponent.decorators = [
|
|
441
465
|
{ type: i0.Component, args: [{
|
|
442
466
|
selector: 'valtimo-form-management-create',
|
|
443
|
-
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
|
|
467
|
+
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",
|
|
444
468
|
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 */"]
|
|
445
469
|
},] }
|
|
446
470
|
];
|
|
@@ -498,11 +522,13 @@
|
|
|
498
522
|
};
|
|
499
523
|
FormManagementEditComponent.prototype.modifyFormDefinition = function () {
|
|
500
524
|
var _this = this;
|
|
501
|
-
var form = JSON.stringify(this.modifiedFormDefinition != null
|
|
525
|
+
var form = JSON.stringify(this.modifiedFormDefinition != null
|
|
526
|
+
? this.modifiedFormDefinition
|
|
527
|
+
: this.formDefinition.formDefinition);
|
|
502
528
|
var request = {
|
|
503
529
|
id: this.formDefinition.id,
|
|
504
530
|
name: this.formDefinition.name,
|
|
505
|
-
formDefinition: form
|
|
531
|
+
formDefinition: form,
|
|
506
532
|
};
|
|
507
533
|
this.formManagementService.modifyFormDefinition(request).subscribe(function () {
|
|
508
534
|
_this.router.navigate(['/form-management']);
|
|
@@ -524,16 +550,17 @@
|
|
|
524
550
|
{
|
|
525
551
|
label: 'Cancel',
|
|
526
552
|
class: 'btn btn-default',
|
|
527
|
-
value: false
|
|
553
|
+
value: false,
|
|
528
554
|
},
|
|
529
555
|
{
|
|
530
556
|
label: 'Delete',
|
|
531
557
|
class: 'btn btn-primary',
|
|
532
|
-
value: true
|
|
533
|
-
}
|
|
558
|
+
value: true,
|
|
559
|
+
},
|
|
534
560
|
];
|
|
535
561
|
this.alertService.notification(mssg, confirmations);
|
|
536
|
-
this.alertSub = this.alertService
|
|
562
|
+
this.alertSub = this.alertService
|
|
563
|
+
.getAlertConfirmChangeEmitter()
|
|
537
564
|
.pipe(operators.first())
|
|
538
565
|
.subscribe(function (alert) {
|
|
539
566
|
if (alert.confirm === true) {
|
|
@@ -575,8 +602,7 @@
|
|
|
575
602
|
};
|
|
576
603
|
FormManagementEditComponent.prototype.checkToOpenUploadModal = function () {
|
|
577
604
|
var _this = this;
|
|
578
|
-
this.route.queryParams.pipe(operators.take(1))
|
|
579
|
-
.subscribe(function (params) {
|
|
605
|
+
this.route.queryParams.pipe(operators.take(1)).subscribe(function (params) {
|
|
580
606
|
if ((params === null || params === void 0 ? void 0 : params.upload) === 'true') {
|
|
581
607
|
_this.showModal();
|
|
582
608
|
}
|
|
@@ -587,7 +613,7 @@
|
|
|
587
613
|
FormManagementEditComponent.decorators = [
|
|
588
614
|
{ type: i0.Component, args: [{
|
|
589
615
|
selector: 'valtimo-form-management-edit',
|
|
590
|
-
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
|
|
616
|
+
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> \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> 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> 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",
|
|
591
617
|
encapsulation: i0.ViewEncapsulation.None,
|
|
592
618
|
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}"]
|
|
593
619
|
},] }
|
|
@@ -614,26 +640,26 @@
|
|
|
614
640
|
* See the License for the specific language governing permissions and
|
|
615
641
|
* limitations under the License.
|
|
616
642
|
*/
|
|
617
|
-
var ɵ0 = { title: 'Form management', roles: [
|
|
643
|
+
var ɵ0 = { title: 'Form management', roles: [i2.ROLE_ADMIN] }, ɵ1 = { title: 'Create new Form', roles: [i2.ROLE_ADMIN] }, ɵ2 = { title: 'Form Builder', roles: [i2.ROLE_ADMIN] };
|
|
618
644
|
var routes = [
|
|
619
645
|
{
|
|
620
646
|
path: 'form-management',
|
|
621
647
|
component: FormManagementComponent,
|
|
622
648
|
canActivate: [security.AuthGuardService],
|
|
623
|
-
data: ɵ0
|
|
649
|
+
data: ɵ0,
|
|
624
650
|
},
|
|
625
651
|
{
|
|
626
652
|
path: 'form-management/create',
|
|
627
653
|
component: FormManagementCreateComponent,
|
|
628
654
|
canActivate: [security.AuthGuardService],
|
|
629
|
-
data: ɵ1
|
|
655
|
+
data: ɵ1,
|
|
630
656
|
},
|
|
631
657
|
{
|
|
632
658
|
path: 'form-management/edit/:id',
|
|
633
659
|
component: FormManagementEditComponent,
|
|
634
660
|
canActivate: [security.AuthGuardService],
|
|
635
|
-
data: ɵ2
|
|
636
|
-
}
|
|
661
|
+
data: ɵ2,
|
|
662
|
+
},
|
|
637
663
|
];
|
|
638
664
|
var FormManagementRoutingModule = /** @class */ (function () {
|
|
639
665
|
function FormManagementRoutingModule() {
|
|
@@ -642,13 +668,9 @@
|
|
|
642
668
|
}());
|
|
643
669
|
FormManagementRoutingModule.decorators = [
|
|
644
670
|
{ type: i0.NgModule, args: [{
|
|
645
|
-
imports: [
|
|
646
|
-
|
|
647
|
-
],
|
|
648
|
-
exports: [
|
|
649
|
-
router.RouterModule
|
|
650
|
-
],
|
|
651
|
-
declarations: []
|
|
671
|
+
imports: [router.RouterModule.forChild(routes)],
|
|
672
|
+
exports: [router.RouterModule],
|
|
673
|
+
declarations: [],
|
|
652
674
|
},] }
|
|
653
675
|
];
|
|
654
676
|
|
|
@@ -674,13 +696,13 @@
|
|
|
674
696
|
this.formDefinitions = [];
|
|
675
697
|
this.formDefinitionFields = [
|
|
676
698
|
{ key: 'name', label: 'Name' },
|
|
677
|
-
{ key: 'readOnly', label: 'Read-only' }
|
|
699
|
+
{ key: 'readOnly', label: 'Read-only' },
|
|
678
700
|
];
|
|
679
701
|
this.pagination = {
|
|
680
702
|
collectionSize: 0,
|
|
681
703
|
page: 1,
|
|
682
704
|
size: 10,
|
|
683
|
-
maxPaginationItemSize: 5
|
|
705
|
+
maxPaginationItemSize: 5,
|
|
684
706
|
};
|
|
685
707
|
this.pageParam = 0;
|
|
686
708
|
}
|
|
@@ -688,8 +710,7 @@
|
|
|
688
710
|
this.pageParam = page - 1;
|
|
689
711
|
this.loadFormDefinitions();
|
|
690
712
|
};
|
|
691
|
-
FormManagementListComponent.prototype.ngOnInit = function () {
|
|
692
|
-
};
|
|
713
|
+
FormManagementListComponent.prototype.ngOnInit = function () { };
|
|
693
714
|
FormManagementListComponent.prototype.paginationSet = function () {
|
|
694
715
|
this.loadFormDefinitions();
|
|
695
716
|
};
|
|
@@ -715,7 +736,7 @@
|
|
|
715
736
|
FormManagementListComponent.decorators = [
|
|
716
737
|
{ type: i0.Component, args: [{
|
|
717
738
|
selector: 'valtimo-form-management-list',
|
|
718
|
-
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
|
|
739
|
+
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",
|
|
719
740
|
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 */"]
|
|
720
741
|
},] }
|
|
721
742
|
];
|
|
@@ -766,9 +787,7 @@
|
|
|
766
787
|
FormManagementUploadComponent.prototype.uploadDefinition = function () {
|
|
767
788
|
var _this = this;
|
|
768
789
|
this.disable();
|
|
769
|
-
this.jsonString
|
|
770
|
-
.pipe(operators.take(1))
|
|
771
|
-
.subscribe(function (definition) {
|
|
790
|
+
this.jsonString$.pipe(operators.take(1)).subscribe(function (definition) {
|
|
772
791
|
_this.closeErrorSubscription();
|
|
773
792
|
_this.clearError();
|
|
774
793
|
_this.enable();
|
|
@@ -859,7 +878,7 @@
|
|
|
859
878
|
FormManagementUploadComponent.decorators = [
|
|
860
879
|
{ type: i0.Component, args: [{
|
|
861
880
|
selector: 'valtimo-form-management-upload',
|
|
862
|
-
template: "<valtimo-modal
|
|
881
|
+
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",
|
|
863
882
|
styles: [""]
|
|
864
883
|
},] }
|
|
865
884
|
];
|
|
@@ -900,7 +919,7 @@
|
|
|
900
919
|
FormManagementCreateComponent,
|
|
901
920
|
FormManagementListComponent,
|
|
902
921
|
FormManagementEditComponent,
|
|
903
|
-
FormManagementUploadComponent
|
|
922
|
+
FormManagementUploadComponent,
|
|
904
923
|
],
|
|
905
924
|
imports: [
|
|
906
925
|
FormManagementRoutingModule,
|
|
@@ -913,12 +932,55 @@
|
|
|
913
932
|
core.TranslateModule,
|
|
914
933
|
ngBootstrap.NgbTooltipModule,
|
|
915
934
|
components.DropzoneModule,
|
|
916
|
-
components.ModalModule
|
|
935
|
+
components.ModalModule,
|
|
917
936
|
],
|
|
918
|
-
exports: [FormManagementComponent]
|
|
937
|
+
exports: [FormManagementComponent],
|
|
919
938
|
},] }
|
|
920
939
|
];
|
|
921
940
|
|
|
941
|
+
/*
|
|
942
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
943
|
+
*
|
|
944
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
945
|
+
* you may not use this file except in compliance with the License.
|
|
946
|
+
* You may obtain a copy of the License at
|
|
947
|
+
*
|
|
948
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
949
|
+
*
|
|
950
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
951
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
952
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
953
|
+
* See the License for the specific language governing permissions and
|
|
954
|
+
* limitations under the License.
|
|
955
|
+
*/
|
|
956
|
+
function compareFormDefinitions(fd1, fd2) {
|
|
957
|
+
if (fd1 === null && fd2 === null) {
|
|
958
|
+
return true;
|
|
959
|
+
}
|
|
960
|
+
if (fd1 === null || fd2 === null) {
|
|
961
|
+
return false;
|
|
962
|
+
}
|
|
963
|
+
return fd1.id === fd2.id;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
/*
|
|
967
|
+
*
|
|
968
|
+
* * Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
969
|
+
* *
|
|
970
|
+
* * Licensed under EUPL, Version 1.2 (the "License");
|
|
971
|
+
* * you may not use this file except in compliance with the License.
|
|
972
|
+
* * You may obtain a copy of the License at
|
|
973
|
+
* *
|
|
974
|
+
* * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
975
|
+
* *
|
|
976
|
+
* * Unless required by applicable law or agreed to in writing, software
|
|
977
|
+
* * distributed under the License is distributed on an "AS IS" basis,
|
|
978
|
+
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
979
|
+
* * See the License for the specific language governing permissions and
|
|
980
|
+
* * limitations under the License.
|
|
981
|
+
*
|
|
982
|
+
*/
|
|
983
|
+
|
|
922
984
|
/*
|
|
923
985
|
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
924
986
|
*
|
|
@@ -942,6 +1004,7 @@
|
|
|
942
1004
|
exports.FormManagementComponent = FormManagementComponent;
|
|
943
1005
|
exports.FormManagementModule = FormManagementModule;
|
|
944
1006
|
exports.FormManagementService = FormManagementService;
|
|
1007
|
+
exports.compareFormDefinitions = compareFormDefinitions;
|
|
945
1008
|
exports.ɵa = FormManagementCreateComponent;
|
|
946
1009
|
exports.ɵb = FormManagementListComponent;
|
|
947
1010
|
exports.ɵc = FormManagementEditComponent;
|