@valtimo/form-management 10.2.1 → 10.4.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/esm2020/lib/form-management-create/form-management-create.component.mjs +7 -4
- package/esm2020/lib/form-management-duplicate/form-management-duplicate.component.mjs +88 -0
- package/esm2020/lib/form-management-edit/form-management-edit.component.mjs +22 -11
- package/esm2020/lib/form-management.module.mjs +43 -5
- package/esm2020/lib/form-management.service.mjs +4 -1
- package/esm2020/lib/validators/no-duplicate-form.validator.mjs +7 -0
- package/fesm2015/valtimo-form-management.mjs +155 -20
- package/fesm2015/valtimo-form-management.mjs.map +1 -1
- package/fesm2020/valtimo-form-management.mjs +153 -20
- package/fesm2020/valtimo-form-management.mjs.map +1 -1
- package/lib/form-management-create/form-management-create.component.d.ts.map +1 -1
- package/lib/form-management-duplicate/form-management-duplicate.component.d.ts +25 -0
- package/lib/form-management-duplicate/form-management-duplicate.component.d.ts.map +1 -0
- package/lib/form-management-edit/form-management-edit.component.d.ts +5 -2
- package/lib/form-management-edit/form-management-edit.component.d.ts.map +1 -1
- package/lib/form-management.module.d.ts +10 -7
- package/lib/form-management.module.d.ts.map +1 -1
- package/lib/form-management.service.d.ts +1 -0
- package/lib/form-management.service.d.ts.map +1 -1
- package/lib/validators/no-duplicate-form.validator.d.ts +4 -0
- package/lib/validators/no-duplicate-form.validator.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Component, EventEmitter, ViewChild, Input, Output, ViewEncapsulation, NgModule } from '@angular/core';
|
|
2
|
+
import { Injectable, Component, Inject, EventEmitter, ViewChild, Input, Output, ViewEncapsulation, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common/http';
|
|
4
4
|
import * as i2 from '@valtimo/config';
|
|
5
5
|
import { ROLE_ADMIN } from '@valtimo/config';
|
|
6
6
|
import * as i3 from '@angular/router';
|
|
7
7
|
import { RouterModule } from '@angular/router';
|
|
8
8
|
import * as i4 from '@valtimo/components';
|
|
9
|
-
import { FormIoModule, WidgetModule, ListModule, DropzoneModule, ModalModule } from '@valtimo/components';
|
|
9
|
+
import { FormIoModule, WidgetModule, ListModule, DropzoneModule, ModalModule as ModalModule$2 } from '@valtimo/components';
|
|
10
10
|
import * as i2$1 from '@ngx-translate/core';
|
|
11
11
|
import { TranslateModule } from '@ngx-translate/core';
|
|
12
12
|
import { AuthGuardService } from '@valtimo/security';
|
|
13
13
|
import * as i2$2 from '@angular/forms';
|
|
14
|
-
import { FormControl, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
15
|
-
import { combineLatest, Subject, BehaviorSubject, Subscription } from 'rxjs';
|
|
14
|
+
import { FormControl, Validators, FormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
15
|
+
import { map, combineLatest, Subject, BehaviorSubject, Subscription } from 'rxjs';
|
|
16
16
|
import { take, first } from 'rxjs/operators';
|
|
17
17
|
import * as i5 from '@angular/common';
|
|
18
18
|
import { CommonModule } from '@angular/common';
|
|
19
|
-
import
|
|
19
|
+
import { BaseModal } from 'carbon-components-angular/modal';
|
|
20
|
+
import * as i1$1 from '@valtimo/user-interface';
|
|
21
|
+
import { ModalModule as ModalModule$1, InputModule, TitleModule, ButtonModule, FormModule } from '@valtimo/user-interface';
|
|
22
|
+
import * as i7 from 'carbon-components-angular';
|
|
23
|
+
import { ModalModule, InputModule as InputModule$1, PlaceholderModule, ButtonModule as ButtonModule$1 } from 'carbon-components-angular';
|
|
24
|
+
import * as i1$2 from '@valtimo/document';
|
|
20
25
|
import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
|
|
21
26
|
|
|
22
27
|
/*
|
|
@@ -43,6 +48,9 @@ class FormManagementService {
|
|
|
43
48
|
getFormDefinition(formDefinitionId) {
|
|
44
49
|
return this.http.get(`${this.valtimoApiConfig.endpointUri}v1/form-management/${formDefinitionId}`);
|
|
45
50
|
}
|
|
51
|
+
existsFormDefinition(formDefinitionName) {
|
|
52
|
+
return this.http.get(`${this.valtimoApiConfig.endpointUri}v1/form-management/exists/${formDefinitionName}`);
|
|
53
|
+
}
|
|
46
54
|
queryFormDefinitions(params) {
|
|
47
55
|
return this.http.get(`${this.valtimoApiConfig.endpointUri}v1/form-management`, {
|
|
48
56
|
observe: 'response',
|
|
@@ -158,6 +166,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
158
166
|
args: [{ selector: 'valtimo-form-management', 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 mr-1\"></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 mr-1\"></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", 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 */\n"] }]
|
|
159
167
|
}], ctorParameters: function () { return []; } });
|
|
160
168
|
|
|
169
|
+
function noDuplicateFormValidator(formManagementService) {
|
|
170
|
+
return (control) => formManagementService
|
|
171
|
+
.existsFormDefinition(control.value.toString())
|
|
172
|
+
.pipe(map((result) => (result ? { duplicate: true } : null)));
|
|
173
|
+
}
|
|
174
|
+
|
|
161
175
|
/*
|
|
162
176
|
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
163
177
|
*
|
|
@@ -186,7 +200,9 @@ class FormManagementCreateComponent {
|
|
|
186
200
|
}
|
|
187
201
|
ngOnInit() {
|
|
188
202
|
this.form = this.formBuilder.group({
|
|
189
|
-
name: new FormControl('', Validators.required
|
|
203
|
+
name: new FormControl('', Validators.required, [
|
|
204
|
+
noDuplicateFormValidator(this.formManagementService),
|
|
205
|
+
]),
|
|
190
206
|
});
|
|
191
207
|
}
|
|
192
208
|
reset() {
|
|
@@ -224,12 +240,85 @@ class FormManagementCreateComponent {
|
|
|
224
240
|
}
|
|
225
241
|
}
|
|
226
242
|
FormManagementCreateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementCreateComponent, deps: [{ token: FormManagementService }, { token: i2$2.FormBuilder }, { token: i3.Router }, { token: i4.AlertService }, { token: i3.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
227
|
-
FormManagementCreateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: FormManagementCreateComponent, selector: "valtimo-form-management-create", ngImport: i0, 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\">{{\n 'formManagement.name' | translate\n }}</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\">\n {{ 'formManagement.nameIsRequired' | translate }}\n </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]=\"'/
|
|
243
|
+
FormManagementCreateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: FormManagementCreateComponent, selector: "valtimo-form-management-create", ngImport: i0, 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\">{{\n 'formManagement.name' | translate\n }}</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\">\n {{ 'formManagement.nameIsRequired' | translate }}\n </div>\n <div *ngIf=\"formControls.name.errors.duplicate\">\n {{ 'formManagement.nameIsInUse' | translate }}\n </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]=\"'/form-management'\" class=\"btn btn-space btn-default\">{{\n 'formManagement.back' | translate\n }}</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 {{ 'formManagement.reset' | translate }}\n </button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">\n {{ 'formManagement.submit' | translate }}\n </button>\n </div>\n </div>\n </form>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n", 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 */\n"], dependencies: [{ kind: "directive", type: i3.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
|
|
228
244
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementCreateComponent, decorators: [{
|
|
229
245
|
type: Component,
|
|
230
|
-
args: [{ selector: 'valtimo-form-management-create', 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\">{{\n 'formManagement.name' | translate\n }}</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\">\n {{ 'formManagement.nameIsRequired' | translate }}\n </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]=\"'/
|
|
246
|
+
args: [{ selector: 'valtimo-form-management-create', 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\">{{\n 'formManagement.name' | translate\n }}</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\">\n {{ 'formManagement.nameIsRequired' | translate }}\n </div>\n <div *ngIf=\"formControls.name.errors.duplicate\">\n {{ 'formManagement.nameIsInUse' | translate }}\n </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]=\"'/form-management'\" class=\"btn btn-space btn-default\">{{\n 'formManagement.back' | translate\n }}</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 {{ 'formManagement.reset' | translate }}\n </button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">\n {{ 'formManagement.submit' | translate }}\n </button>\n </div>\n </div>\n </form>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n", 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 */\n"] }]
|
|
231
247
|
}], ctorParameters: function () { return [{ type: FormManagementService }, { type: i2$2.FormBuilder }, { type: i3.Router }, { type: i4.AlertService }, { type: i3.ActivatedRoute }]; } });
|
|
232
248
|
|
|
249
|
+
/*
|
|
250
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
251
|
+
*
|
|
252
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
253
|
+
* you may not use this file except in compliance with the License.
|
|
254
|
+
* You may obtain a copy of the License at
|
|
255
|
+
*
|
|
256
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
257
|
+
*
|
|
258
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
259
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
260
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
261
|
+
* See the License for the specific language governing permissions and
|
|
262
|
+
* limitations under the License.
|
|
263
|
+
*/
|
|
264
|
+
class FormManagementDuplicateComponent extends BaseModal {
|
|
265
|
+
constructor(formToDuplicate, modalService, formManagementService, alertService, route, router) {
|
|
266
|
+
super();
|
|
267
|
+
this.formToDuplicate = formToDuplicate;
|
|
268
|
+
this.modalService = modalService;
|
|
269
|
+
this.formManagementService = formManagementService;
|
|
270
|
+
this.alertService = alertService;
|
|
271
|
+
this.route = route;
|
|
272
|
+
this.router = router;
|
|
273
|
+
this.duplicateForm = new FormGroup({
|
|
274
|
+
duplicateFormName: new FormControl(this.getDefaultName(), Validators.compose([Validators.required]), [noDuplicateFormValidator(this.formManagementService)]),
|
|
275
|
+
});
|
|
276
|
+
this.duplicateForm.markAllAsTouched();
|
|
277
|
+
}
|
|
278
|
+
duplicate() {
|
|
279
|
+
const control = this.duplicateFormName;
|
|
280
|
+
const request = {
|
|
281
|
+
name: control.value.toString(),
|
|
282
|
+
formDefinition: JSON.stringify(this.formToDuplicate.formDefinition),
|
|
283
|
+
};
|
|
284
|
+
combineLatest([
|
|
285
|
+
this.formManagementService.createFormDefinition(request),
|
|
286
|
+
this.route.queryParams,
|
|
287
|
+
])
|
|
288
|
+
.pipe(take(1))
|
|
289
|
+
.subscribe(([formDefinition, params]) => {
|
|
290
|
+
this.alertService.success('Created new Form');
|
|
291
|
+
this.router
|
|
292
|
+
.navigateByUrl(`/form-management/edit/${formDefinition.id}`)
|
|
293
|
+
.then(function (result) {
|
|
294
|
+
window.location.reload();
|
|
295
|
+
});
|
|
296
|
+
}, err => {
|
|
297
|
+
if (err.toString().includes('Duplicate name')) {
|
|
298
|
+
control.setErrors({ duplicate: true });
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
control.setErrors({ incorrect: true });
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
get duplicateFormName() {
|
|
306
|
+
return this.duplicateForm.controls['duplicateFormName'];
|
|
307
|
+
}
|
|
308
|
+
getDefaultName() {
|
|
309
|
+
return this.formToDuplicate.name + '-duplicate';
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
FormManagementDuplicateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementDuplicateComponent, deps: [{ token: 'formToDuplicate' }, { token: i1$1.ModalService }, { token: FormManagementService }, { token: i4.AlertService }, { token: i3.ActivatedRoute }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
313
|
+
FormManagementDuplicateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: FormManagementDuplicateComponent, selector: "valtimo-form-management-duplicate-modal", usesInheritance: true, ngImport: i0, 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<ibm-modal [open]=\"open\" (overlaySelected)=\"closeModal()\" [formGroup]=\"duplicateForm\">\n <ibm-modal-header (closeSelect)=\"closeModal()\">{{\n 'formManagement.duplicate' | translate\n }}</ibm-modal-header>\n <section class=\"bx--modal-content p-2\">\n <ibm-label labelState=\"error\">\n {{ 'formManagement.name' | translate }}\n <input ibmText formControlName=\"duplicateFormName\" [invalid]=\"duplicateFormName.invalid\" />\n </ibm-label>\n <div\n *ngIf=\"duplicateFormName.invalid && (duplicateFormName.dirty || duplicateFormName.touched)\"\n class=\"bg-warning text-black mb-0 p-2 pl-3 pr-3\"\n role=\"alert\"\n >\n <div *ngIf=\"duplicateFormName.errors.required\">\n {{ 'formManagement.nameIsRequired' | translate }}\n </div>\n <div *ngIf=\"duplicateFormName.errors.duplicate\">\n {{ 'formManagement.nameIsInUse' | translate }}\n </div>\n </div>\n </section>\n <ibm-modal-footer>\n <button ibmButton=\"secondary\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n <button\n ibmButton=\"primary\"\n [attr.modal-primary-focus]=\"true\"\n modal-primary-focus\n (click)=\"duplicate()\"\n [disabled]=\"duplicateForm.invalid\"\n >\n {{ 'formManagement.submit' | translate }}\n </button>\n </ibm-modal-footer>\n</ibm-modal>\n", 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 */\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i7.Modal, selector: "ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i7.ModalHeader, selector: "ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i7.ModalFooter, selector: "ibm-modal-footer" }, { kind: "component", type: i7.Label, selector: "ibm-label", inputs: ["labelInputID", "disabled", "labelState", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i7.TextInput, selector: "[ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "directive", type: i7.Button, selector: "[ibmButton]", inputs: ["ibmButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
|
|
314
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementDuplicateComponent, decorators: [{
|
|
315
|
+
type: Component,
|
|
316
|
+
args: [{ selector: 'valtimo-form-management-duplicate-modal', 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<ibm-modal [open]=\"open\" (overlaySelected)=\"closeModal()\" [formGroup]=\"duplicateForm\">\n <ibm-modal-header (closeSelect)=\"closeModal()\">{{\n 'formManagement.duplicate' | translate\n }}</ibm-modal-header>\n <section class=\"bx--modal-content p-2\">\n <ibm-label labelState=\"error\">\n {{ 'formManagement.name' | translate }}\n <input ibmText formControlName=\"duplicateFormName\" [invalid]=\"duplicateFormName.invalid\" />\n </ibm-label>\n <div\n *ngIf=\"duplicateFormName.invalid && (duplicateFormName.dirty || duplicateFormName.touched)\"\n class=\"bg-warning text-black mb-0 p-2 pl-3 pr-3\"\n role=\"alert\"\n >\n <div *ngIf=\"duplicateFormName.errors.required\">\n {{ 'formManagement.nameIsRequired' | translate }}\n </div>\n <div *ngIf=\"duplicateFormName.errors.duplicate\">\n {{ 'formManagement.nameIsInUse' | translate }}\n </div>\n </div>\n </section>\n <ibm-modal-footer>\n <button ibmButton=\"secondary\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n <button\n ibmButton=\"primary\"\n [attr.modal-primary-focus]=\"true\"\n modal-primary-focus\n (click)=\"duplicate()\"\n [disabled]=\"duplicateForm.invalid\"\n >\n {{ 'formManagement.submit' | translate }}\n </button>\n </ibm-modal-footer>\n</ibm-modal>\n", 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 */\n"] }]
|
|
317
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
318
|
+
type: Inject,
|
|
319
|
+
args: ['formToDuplicate']
|
|
320
|
+
}] }, { type: i1$1.ModalService }, { type: FormManagementService }, { type: i4.AlertService }, { type: i3.ActivatedRoute }, { type: i3.Router }]; } });
|
|
321
|
+
|
|
233
322
|
/*
|
|
234
323
|
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
235
324
|
*
|
|
@@ -358,12 +447,12 @@ class FormManagementUploadComponent {
|
|
|
358
447
|
this.disabled$.next(false);
|
|
359
448
|
}
|
|
360
449
|
}
|
|
361
|
-
FormManagementUploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementUploadComponent, deps: [{ token: i1$
|
|
450
|
+
FormManagementUploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementUploadComponent, deps: [{ token: i1$2.DocumentService }, { token: i2$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
362
451
|
FormManagementUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: FormManagementUploadComponent, selector: "valtimo-form-management-upload", inputs: { show$: "show$" }, outputs: { definitionUploaded: "definitionUploaded" }, viewQueries: [{ propertyName: "modal", first: true, predicate: ["uploadFormDefinitionModal"], descendants: true }], ngImport: i0, 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-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 [maxFiles]=\"1\"\n ></valtimo-dropzone>\n </div>\n <div footer>\n <ng-container *ngIf=\"(jsonString$ | async) && (error$ | async) === ''; else disabledUpload\">\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 #disabledUpload>\n <button [disabled]=\"true\" class=\"btn btn-primary\">\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'Upload' | translate }}\n </button>\n</ng-template>\n", 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 */\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.DropzoneComponent, selector: "valtimo-dropzone", inputs: ["title", "hideTitle", "subtitle", "externalError$", "maxFileSize", "showMaxFileSize", "acceptedFiles", "clear$", "disabled", "hideFilePreview", "uploading", "camera", "maxFiles"], outputs: ["fileSelected"] }, { kind: "component", type: i4.ModalComponent, selector: "valtimo-modal", inputs: ["elementId", "title", "subtitle", "templateBelowSubtitle", "showFooter"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
|
|
363
452
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementUploadComponent, decorators: [{
|
|
364
453
|
type: Component,
|
|
365
454
|
args: [{ selector: 'valtimo-form-management-upload', 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-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 [maxFiles]=\"1\"\n ></valtimo-dropzone>\n </div>\n <div footer>\n <ng-container *ngIf=\"(jsonString$ | async) && (error$ | async) === ''; else disabledUpload\">\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 #disabledUpload>\n <button [disabled]=\"true\" class=\"btn btn-primary\">\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'Upload' | translate }}\n </button>\n</ng-template>\n", 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 */\n"] }]
|
|
366
|
-
}], ctorParameters: function () { return [{ type: i1$
|
|
455
|
+
}], ctorParameters: function () { return [{ type: i1$2.DocumentService }, { type: i2$1.TranslateService }]; }, propDecorators: { modal: [{
|
|
367
456
|
type: ViewChild,
|
|
368
457
|
args: ['uploadFormDefinitionModal']
|
|
369
458
|
}], show$: [{
|
|
@@ -388,11 +477,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
388
477
|
* limitations under the License.
|
|
389
478
|
*/
|
|
390
479
|
class FormManagementEditComponent {
|
|
391
|
-
constructor(formManagementService, alertService, route, router) {
|
|
480
|
+
constructor(formManagementService, alertService, route, router, modalService) {
|
|
392
481
|
this.formManagementService = formManagementService;
|
|
393
482
|
this.alertService = alertService;
|
|
394
483
|
this.route = route;
|
|
395
484
|
this.router = router;
|
|
485
|
+
this.modalService = modalService;
|
|
396
486
|
this.showModal$ = new BehaviorSubject(false);
|
|
397
487
|
this.reloading$ = new BehaviorSubject(false);
|
|
398
488
|
this.modifiedFormDefinition = null;
|
|
@@ -480,9 +570,17 @@ class FormManagementEditComponent {
|
|
|
480
570
|
window.URL.revokeObjectURL(link.href);
|
|
481
571
|
link.remove();
|
|
482
572
|
}
|
|
483
|
-
|
|
573
|
+
showUploadModal() {
|
|
484
574
|
this.showModal$.next(true);
|
|
485
575
|
}
|
|
576
|
+
showDuplicateModal() {
|
|
577
|
+
this.modalService.create({
|
|
578
|
+
component: FormManagementDuplicateComponent,
|
|
579
|
+
inputs: {
|
|
580
|
+
formToDuplicate: this.formDefinition,
|
|
581
|
+
},
|
|
582
|
+
});
|
|
583
|
+
}
|
|
486
584
|
setFormDefinition(formDefinition) {
|
|
487
585
|
this.reloading$.next(true);
|
|
488
586
|
const definition = JSON.parse(formDefinition);
|
|
@@ -496,17 +594,17 @@ class FormManagementEditComponent {
|
|
|
496
594
|
checkToOpenUploadModal() {
|
|
497
595
|
this.route.queryParams.pipe(take(1)).subscribe(params => {
|
|
498
596
|
if (params?.upload === 'true') {
|
|
499
|
-
this.
|
|
597
|
+
this.showUploadModal();
|
|
500
598
|
}
|
|
501
599
|
});
|
|
502
600
|
}
|
|
503
601
|
}
|
|
504
|
-
FormManagementEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementEditComponent, deps: [{ token: FormManagementService }, { token: i4.AlertService }, { token: i3.ActivatedRoute }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
505
|
-
FormManagementEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: FormManagementEditComponent, selector: "valtimo-form-management-edit", ngImport: i0, 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=\"icon mdi mdi-download mr-1\"></i>\n {{ 'Download' | translate }}\n </button>\n <button\n class=\"btn btn-secondary btn-space\"\n (click)=\"
|
|
602
|
+
FormManagementEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementEditComponent, deps: [{ token: FormManagementService }, { token: i4.AlertService }, { token: i3.ActivatedRoute }, { token: i3.Router }, { token: i7.ModalService }], target: i0.ɵɵFactoryTarget.Component });
|
|
603
|
+
FormManagementEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: FormManagementEditComponent, selector: "valtimo-form-management-edit", ngImport: i0, 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=\"icon mdi mdi-download mr-1\"></i>\n {{ 'Download' | translate }}\n </button>\n <button\n class=\"btn btn-secondary btn-space\"\n (click)=\"showUploadModal()\"\n [disabled]=\"formDefinition.readOnly\"\n >\n <i class=\"icon mdi mdi-upload mr-1\"></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=\"icon mdi mdi-delete mr-1\"></i>{{ 'formManagement.delete' | translate }}\n </button>\n <button\n class=\"btn btn-success btn-space\"\n (click)=\"modifyFormDefinition()\"\n [disabled]=\"formDefinition.readOnly\"\n >\n <i class=\"icon mdi mdi-upload mr-1\"></i>{{ 'formManagement.deploy' | translate }}\n </button>\n <button class=\"btn btn-secondary btn-space\" (click)=\"showDuplicateModal()\">\n <i class=\"icon mdi mdi-content-duplicate mr-1\"></i\n >{{ 'formManagement.duplicate' | translate }}\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\">{{\n 'formManagement.readOnly' | translate\n }}</span>\n </div>\n </h3>\n </div>\n <ng-container *ngIf=\"(reloading$ | async) === false\">\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\n<ibm-placeholder></ibm-placeholder>\n", 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 */.formbuilder .btn.formcomponent.drag-copy,.btn.formcomponent.gu-mirror{font-weight:400;background-color:silver;border-color:silver;color:#fff}.formbuilder .btn.formcomponent.drag-copy:hover,.formbuilder .btn.formcomponent.drag-copy:active,.btn.formcomponent.gu-mirror:hover,.btn.formcomponent.gu-mirror:active{box-shadow:none}.formbuilder .btn.formcomponent.drag-copy:active,.btn.formcomponent.gu-mirror:active{background-color:silver;border-color:silver}.formbuilder-header{padding-left:18px;padding-right:18px;font-size:18px;height:80px;border:1px solid #dee2e6;border-bottom:0}.formbuilder-header .formbuilder-title{margin-top:21px;margin-bottom:7px}.formbuilder-header .formbuilder-subtitle{margin-top:0;margin-bottom:12px}.formbuilder{background:white;padding:1rem;border:1px solid #dee2e6;margin-right:0!important;margin-left:0!important}.formbuilder .form-builder-panel .builder-group-button[aria-expanded=false],.formbuilder .form-builder-panel .builder-group-button[aria-expanded=\"\"]{color:#a9a9a9}.formbuilder .form-builder-panel .builder-group-button[aria-expanded=true]{color:#000}.formbuilder .drag-and-drop-alert{display:none}.formbuilder .formarea{padding:10px;border:solid 1px silver;background-color:#fff}.increase-size{font-size:1rem}\n"], dependencies: [{ kind: "component", type: i4.FormioBuilderComponent, selector: "valtimo-form-io-builder", inputs: ["form"], outputs: ["change"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i7.Placeholder, selector: "ibm-placeholder", inputs: ["id"] }, { kind: "component", type: FormManagementUploadComponent, selector: "valtimo-form-management-upload", inputs: ["show$"], outputs: ["definitionUploaded"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
506
604
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementEditComponent, decorators: [{
|
|
507
605
|
type: Component,
|
|
508
|
-
args: [{ selector: 'valtimo-form-management-edit', encapsulation: ViewEncapsulation.None, 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=\"icon mdi mdi-download mr-1\"></i>\n {{ 'Download' | translate }}\n </button>\n <button\n class=\"btn btn-secondary btn-space\"\n (click)=\"
|
|
509
|
-
}], ctorParameters: function () { return [{ type: FormManagementService }, { type: i4.AlertService }, { type: i3.ActivatedRoute }, { type: i3.Router }]; } });
|
|
606
|
+
args: [{ selector: 'valtimo-form-management-edit', encapsulation: ViewEncapsulation.None, 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=\"icon mdi mdi-download mr-1\"></i>\n {{ 'Download' | translate }}\n </button>\n <button\n class=\"btn btn-secondary btn-space\"\n (click)=\"showUploadModal()\"\n [disabled]=\"formDefinition.readOnly\"\n >\n <i class=\"icon mdi mdi-upload mr-1\"></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=\"icon mdi mdi-delete mr-1\"></i>{{ 'formManagement.delete' | translate }}\n </button>\n <button\n class=\"btn btn-success btn-space\"\n (click)=\"modifyFormDefinition()\"\n [disabled]=\"formDefinition.readOnly\"\n >\n <i class=\"icon mdi mdi-upload mr-1\"></i>{{ 'formManagement.deploy' | translate }}\n </button>\n <button class=\"btn btn-secondary btn-space\" (click)=\"showDuplicateModal()\">\n <i class=\"icon mdi mdi-content-duplicate mr-1\"></i\n >{{ 'formManagement.duplicate' | translate }}\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\">{{\n 'formManagement.readOnly' | translate\n }}</span>\n </div>\n </h3>\n </div>\n <ng-container *ngIf=\"(reloading$ | async) === false\">\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\n<ibm-placeholder></ibm-placeholder>\n", 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 */.formbuilder .btn.formcomponent.drag-copy,.btn.formcomponent.gu-mirror{font-weight:400;background-color:silver;border-color:silver;color:#fff}.formbuilder .btn.formcomponent.drag-copy:hover,.formbuilder .btn.formcomponent.drag-copy:active,.btn.formcomponent.gu-mirror:hover,.btn.formcomponent.gu-mirror:active{box-shadow:none}.formbuilder .btn.formcomponent.drag-copy:active,.btn.formcomponent.gu-mirror:active{background-color:silver;border-color:silver}.formbuilder-header{padding-left:18px;padding-right:18px;font-size:18px;height:80px;border:1px solid #dee2e6;border-bottom:0}.formbuilder-header .formbuilder-title{margin-top:21px;margin-bottom:7px}.formbuilder-header .formbuilder-subtitle{margin-top:0;margin-bottom:12px}.formbuilder{background:white;padding:1rem;border:1px solid #dee2e6;margin-right:0!important;margin-left:0!important}.formbuilder .form-builder-panel .builder-group-button[aria-expanded=false],.formbuilder .form-builder-panel .builder-group-button[aria-expanded=\"\"]{color:#a9a9a9}.formbuilder .form-builder-panel .builder-group-button[aria-expanded=true]{color:#000}.formbuilder .drag-and-drop-alert{display:none}.formbuilder .formarea{padding:10px;border:solid 1px silver;background-color:#fff}.increase-size{font-size:1rem}\n"] }]
|
|
607
|
+
}], ctorParameters: function () { return [{ type: FormManagementService }, { type: i4.AlertService }, { type: i3.ActivatedRoute }, { type: i3.Router }, { type: i7.ModalService }]; } });
|
|
510
608
|
|
|
511
609
|
/*
|
|
512
610
|
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
@@ -579,7 +677,8 @@ FormManagementModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", ve
|
|
|
579
677
|
FormManagementCreateComponent,
|
|
580
678
|
FormManagementListComponent,
|
|
581
679
|
FormManagementEditComponent,
|
|
582
|
-
FormManagementUploadComponent
|
|
680
|
+
FormManagementUploadComponent,
|
|
681
|
+
FormManagementDuplicateComponent], imports: [FormManagementRoutingModule,
|
|
583
682
|
FormIoModule,
|
|
584
683
|
CommonModule,
|
|
585
684
|
ReactiveFormsModule,
|
|
@@ -589,7 +688,18 @@ FormManagementModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", ve
|
|
|
589
688
|
TranslateModule,
|
|
590
689
|
NgbTooltipModule,
|
|
591
690
|
DropzoneModule,
|
|
592
|
-
ModalModule
|
|
691
|
+
ModalModule,
|
|
692
|
+
ModalModule$1,
|
|
693
|
+
ModalModule$2,
|
|
694
|
+
InputModule,
|
|
695
|
+
TitleModule,
|
|
696
|
+
ButtonModule,
|
|
697
|
+
InputModule$1,
|
|
698
|
+
FormModule,
|
|
699
|
+
ModalModule,
|
|
700
|
+
InputModule$1,
|
|
701
|
+
PlaceholderModule,
|
|
702
|
+
ButtonModule$1], exports: [FormManagementComponent] });
|
|
593
703
|
FormManagementModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementModule, imports: [FormManagementRoutingModule,
|
|
594
704
|
FormIoModule,
|
|
595
705
|
CommonModule,
|
|
@@ -600,7 +710,18 @@ FormManagementModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ve
|
|
|
600
710
|
TranslateModule,
|
|
601
711
|
NgbTooltipModule,
|
|
602
712
|
DropzoneModule,
|
|
603
|
-
ModalModule
|
|
713
|
+
ModalModule,
|
|
714
|
+
ModalModule$1,
|
|
715
|
+
ModalModule$2,
|
|
716
|
+
InputModule,
|
|
717
|
+
TitleModule,
|
|
718
|
+
ButtonModule,
|
|
719
|
+
InputModule$1,
|
|
720
|
+
FormModule,
|
|
721
|
+
ModalModule,
|
|
722
|
+
InputModule$1,
|
|
723
|
+
PlaceholderModule,
|
|
724
|
+
ButtonModule$1] });
|
|
604
725
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementModule, decorators: [{
|
|
605
726
|
type: NgModule,
|
|
606
727
|
args: [{
|
|
@@ -610,6 +731,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
610
731
|
FormManagementListComponent,
|
|
611
732
|
FormManagementEditComponent,
|
|
612
733
|
FormManagementUploadComponent,
|
|
734
|
+
FormManagementDuplicateComponent,
|
|
613
735
|
],
|
|
614
736
|
imports: [
|
|
615
737
|
FormManagementRoutingModule,
|
|
@@ -623,6 +745,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
623
745
|
NgbTooltipModule,
|
|
624
746
|
DropzoneModule,
|
|
625
747
|
ModalModule,
|
|
748
|
+
ModalModule$1,
|
|
749
|
+
ModalModule$2,
|
|
750
|
+
InputModule,
|
|
751
|
+
TitleModule,
|
|
752
|
+
ButtonModule,
|
|
753
|
+
InputModule$1,
|
|
754
|
+
FormModule,
|
|
755
|
+
ModalModule,
|
|
756
|
+
InputModule$1,
|
|
757
|
+
PlaceholderModule,
|
|
758
|
+
ButtonModule$1,
|
|
626
759
|
],
|
|
627
760
|
exports: [FormManagementComponent],
|
|
628
761
|
}]
|