@valtimo/form-view-model 12.6.1 → 12.8.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/esm2022/lib/components/form-view-model/form-view-model.component.mjs +154 -107
- package/esm2022/lib/services/view-model.service.mjs +8 -5
- package/fesm2022/valtimo-form-view-model.mjs +161 -112
- package/fesm2022/valtimo-form-view-model.mjs.map +1 -1
- package/lib/components/form-view-model/form-view-model.component.d.ts +23 -8
- package/lib/components/form-view-model/form-view-model.component.d.ts.map +1 -1
- package/lib/services/view-model.service.d.ts +4 -4
- package/lib/services/view-model.service.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { Injectable } from '@angular/core';
|
|
17
16
|
import { HttpHeaders } from '@angular/common/http';
|
|
17
|
+
import { Injectable } from '@angular/core';
|
|
18
18
|
import { BaseApiService } from '@valtimo/config';
|
|
19
19
|
import { InterceptorSkip } from '@valtimo/security';
|
|
20
20
|
import * as i0 from "@angular/core";
|
|
@@ -56,33 +56,36 @@ export class ViewModelService extends BaseApiService {
|
|
|
56
56
|
headers: new HttpHeaders().set(InterceptorSkip, '400'),
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
getViewModelForStartForm(formName, processDefinitionKey) {
|
|
59
|
+
getViewModelForStartForm(formName, processDefinitionKey, documentId = null) {
|
|
60
60
|
return this.httpClient.get(this.getApiUrl('/v1/form/view-model/start-form'), {
|
|
61
61
|
params: {
|
|
62
62
|
formName,
|
|
63
63
|
processDefinitionKey,
|
|
64
|
+
...(!!documentId && { documentId }),
|
|
64
65
|
},
|
|
65
66
|
headers: new HttpHeaders().set(InterceptorSkip, '400'),
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
|
-
updateViewModelForStartForm(formName, processDefinitionKey, viewModel, page, isWizard) {
|
|
69
|
+
updateViewModelForStartForm(formName, processDefinitionKey, documentId, viewModel, page, isWizard) {
|
|
69
70
|
const params = {
|
|
70
71
|
formName,
|
|
71
72
|
processDefinitionKey,
|
|
72
73
|
isWizard,
|
|
73
74
|
...(!isNaN(page) && { page }),
|
|
75
|
+
...(!!documentId && { documentId }),
|
|
74
76
|
};
|
|
75
77
|
return this.httpClient.post(this.getApiUrl(`/v1/form/view-model/start-form`), viewModel, {
|
|
76
78
|
params,
|
|
77
79
|
headers: new HttpHeaders().set(InterceptorSkip, '400'),
|
|
78
80
|
});
|
|
79
81
|
}
|
|
80
|
-
submitViewModelForStartForm(formName, processDefinitionKey, documentDefinitionName, viewModel) {
|
|
82
|
+
submitViewModelForStartForm(formName, processDefinitionKey, documentId, documentDefinitionName, viewModel) {
|
|
81
83
|
return this.httpClient.post(this.getApiUrl(`/v1/form/view-model/submit/start-form`), viewModel, {
|
|
82
84
|
params: {
|
|
83
85
|
formName,
|
|
84
86
|
processDefinitionKey,
|
|
85
87
|
documentDefinitionName,
|
|
88
|
+
...(!!documentId && { documentId }),
|
|
86
89
|
},
|
|
87
90
|
headers: new HttpHeaders().set(InterceptorSkip, '400'),
|
|
88
91
|
});
|
|
@@ -94,4 +97,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
94
97
|
type: Injectable,
|
|
95
98
|
args: [{ providedIn: 'root' }]
|
|
96
99
|
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.ConfigService }] });
|
|
97
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
100
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmlldy1tb2RlbC5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdmFsdGltby9mb3JtLXZpZXctbW9kZWwvc3JjL2xpYi9zZXJ2aWNlcy92aWV3LW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ge2RvY3VtZW50SWR9KSxcbiAgICAgICAgfSxcbiAgICAgICAgaGVhZGVyczogbmV3IEh0dHBIZWFkZXJzKCkuc2V0KEludGVyY2VwdG9yU2tpcCwgJzQwMCcpLFxuICAgICAgfVxuICAgICk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, EventEmitter,
|
|
2
|
+
import { Injectable, EventEmitter, Output, Input, ViewChild, Component, NgModule } from '@angular/core';
|
|
3
3
|
import moment from 'moment';
|
|
4
|
-
import { BehaviorSubject,
|
|
4
|
+
import { BehaviorSubject, Subject, combineLatest, filter, take, switchMap, tap } from 'rxjs';
|
|
5
5
|
import * as i5 from '@formio/angular';
|
|
6
6
|
import { FormioModule } from '@formio/angular';
|
|
7
7
|
import { map, distinctUntilChanged } from 'rxjs/operators';
|
|
8
8
|
import { deepmerge } from 'deepmerge-ts';
|
|
9
|
+
import * as i1 from '@angular/common/http';
|
|
10
|
+
import { HttpHeaders, HttpErrorResponse } from '@angular/common/http';
|
|
9
11
|
import * as i4 from '@angular/common';
|
|
10
12
|
import { CommonModule } from '@angular/common';
|
|
11
|
-
import * as
|
|
12
|
-
import {
|
|
13
|
+
import * as i6 from 'carbon-components-angular';
|
|
14
|
+
import { LayerModule } from 'carbon-components-angular';
|
|
13
15
|
import * as i2 from '@valtimo/config';
|
|
14
16
|
import { BaseApiService, FORM_VIEW_MODEL_TOKEN } from '@valtimo/config';
|
|
15
17
|
import { InterceptorSkip } from '@valtimo/security';
|
|
@@ -67,33 +69,36 @@ class ViewModelService extends BaseApiService {
|
|
|
67
69
|
headers: new HttpHeaders().set(InterceptorSkip, '400'),
|
|
68
70
|
});
|
|
69
71
|
}
|
|
70
|
-
getViewModelForStartForm(formName, processDefinitionKey) {
|
|
72
|
+
getViewModelForStartForm(formName, processDefinitionKey, documentId = null) {
|
|
71
73
|
return this.httpClient.get(this.getApiUrl('/v1/form/view-model/start-form'), {
|
|
72
74
|
params: {
|
|
73
75
|
formName,
|
|
74
76
|
processDefinitionKey,
|
|
77
|
+
...(!!documentId && { documentId }),
|
|
75
78
|
},
|
|
76
79
|
headers: new HttpHeaders().set(InterceptorSkip, '400'),
|
|
77
80
|
});
|
|
78
81
|
}
|
|
79
|
-
updateViewModelForStartForm(formName, processDefinitionKey, viewModel, page, isWizard) {
|
|
82
|
+
updateViewModelForStartForm(formName, processDefinitionKey, documentId, viewModel, page, isWizard) {
|
|
80
83
|
const params = {
|
|
81
84
|
formName,
|
|
82
85
|
processDefinitionKey,
|
|
83
86
|
isWizard,
|
|
84
87
|
...(!isNaN(page) && { page }),
|
|
88
|
+
...(!!documentId && { documentId }),
|
|
85
89
|
};
|
|
86
90
|
return this.httpClient.post(this.getApiUrl(`/v1/form/view-model/start-form`), viewModel, {
|
|
87
91
|
params,
|
|
88
92
|
headers: new HttpHeaders().set(InterceptorSkip, '400'),
|
|
89
93
|
});
|
|
90
94
|
}
|
|
91
|
-
submitViewModelForStartForm(formName, processDefinitionKey, documentDefinitionName, viewModel) {
|
|
95
|
+
submitViewModelForStartForm(formName, processDefinitionKey, documentId, documentDefinitionName, viewModel) {
|
|
92
96
|
return this.httpClient.post(this.getApiUrl(`/v1/form/view-model/submit/start-form`), viewModel, {
|
|
93
97
|
params: {
|
|
94
98
|
formName,
|
|
95
99
|
processDefinitionKey,
|
|
96
100
|
documentDefinitionName,
|
|
101
|
+
...(!!documentId && { documentId }),
|
|
97
102
|
},
|
|
98
103
|
headers: new HttpHeaders().set(InterceptorSkip, '400'),
|
|
99
104
|
});
|
|
@@ -150,6 +155,8 @@ class FormViewModelComponent {
|
|
|
150
155
|
const form = {
|
|
151
156
|
loadInitialViewModel: () => instance.loadInitialViewModel(),
|
|
152
157
|
updateViewModel: () => instance.updateViewModel(),
|
|
158
|
+
loadInitialStartFormViewModel: () => instance.loadInitialViewModelForStartForm(),
|
|
159
|
+
updateViewStartFormModel: () => instance.updateViewModelForStartForm(),
|
|
153
160
|
...formValue,
|
|
154
161
|
};
|
|
155
162
|
this.form$.next(form);
|
|
@@ -163,6 +170,9 @@ class FormViewModelComponent {
|
|
|
163
170
|
set isStartForm(isStartFormValue) {
|
|
164
171
|
this.isStartForm$.next(isStartFormValue);
|
|
165
172
|
}
|
|
173
|
+
set documentId(documentId) {
|
|
174
|
+
this.documentId$.next(documentId);
|
|
175
|
+
}
|
|
166
176
|
set processDefinitionKey(processDefinitionKeyValue) {
|
|
167
177
|
this.processDefinitionKey$.next(processDefinitionKeyValue);
|
|
168
178
|
}
|
|
@@ -174,23 +184,27 @@ class FormViewModelComponent {
|
|
|
174
184
|
this.translateService = translateService;
|
|
175
185
|
this.stateService = stateService;
|
|
176
186
|
this.formSubmit = new EventEmitter();
|
|
177
|
-
this.errors = [];
|
|
178
187
|
this.refreshForm = new EventEmitter();
|
|
179
188
|
this._preventNextPage = false;
|
|
180
189
|
this._preventPreviousPage = false;
|
|
181
190
|
this._isWizard = false;
|
|
191
|
+
this.pendingUpdateSubscription = null;
|
|
182
192
|
this.submission$ = new BehaviorSubject({});
|
|
183
193
|
this.form$ = new BehaviorSubject(undefined);
|
|
184
194
|
this.formName$ = new BehaviorSubject(undefined);
|
|
195
|
+
this.formErrors$ = new BehaviorSubject([]);
|
|
185
196
|
this.options$ = new BehaviorSubject(undefined);
|
|
186
197
|
this.taskInstanceId$ = new BehaviorSubject(undefined);
|
|
187
198
|
this.tokenSetInLocalStorage$ = new BehaviorSubject(false);
|
|
188
199
|
this.change$ = new BehaviorSubject(null);
|
|
189
|
-
this.blur$ = new
|
|
200
|
+
this.blur$ = new Subject();
|
|
201
|
+
this.focus$ = new BehaviorSubject(null);
|
|
190
202
|
this.loading$ = new BehaviorSubject(true);
|
|
191
203
|
this.isStartForm$ = new BehaviorSubject(false);
|
|
204
|
+
this.documentId$ = new BehaviorSubject(null);
|
|
192
205
|
this.processDefinitionKey$ = new BehaviorSubject(undefined);
|
|
193
206
|
this.documentDefinitionName$ = new BehaviorSubject(undefined);
|
|
207
|
+
this.updateForm = new Subject();
|
|
194
208
|
this.currentLanguage$ = this.translateService.stream('key').pipe(map(() => this.translateService.currentLang), distinctUntilChanged());
|
|
195
209
|
this._overrideOptions$ = new BehaviorSubject({
|
|
196
210
|
hooks: {
|
|
@@ -198,21 +212,24 @@ class FormViewModelComponent {
|
|
|
198
212
|
},
|
|
199
213
|
});
|
|
200
214
|
this.formioOptions$ = combineLatest([
|
|
201
|
-
this.currentLanguage$,
|
|
202
215
|
this.options$,
|
|
203
216
|
this._overrideOptions$,
|
|
204
|
-
]).pipe(map(([
|
|
217
|
+
]).pipe(map(([options, overrideOptions]) => {
|
|
218
|
+
return deepmerge(options, overrideOptions);
|
|
219
|
+
}));
|
|
220
|
+
this.renderOptions$ = combineLatest([this.currentLanguage$]).pipe(map(([language]) => {
|
|
205
221
|
const formioTranslations = this.translateService.instant('formioTranslations');
|
|
206
|
-
|
|
207
|
-
...options,
|
|
222
|
+
return {
|
|
208
223
|
language,
|
|
209
|
-
...(formioTranslations === 'object'
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
224
|
+
...(typeof formioTranslations === 'object'
|
|
225
|
+
? {
|
|
226
|
+
language,
|
|
227
|
+
i18n: {
|
|
228
|
+
[language]: this.stateService.flattenTranslationsObject(formioTranslations),
|
|
229
|
+
},
|
|
230
|
+
}
|
|
231
|
+
: {}),
|
|
214
232
|
};
|
|
215
|
-
return deepmerge(defaultOptions, overrideOptions);
|
|
216
233
|
}));
|
|
217
234
|
}
|
|
218
235
|
ngOnInit() {
|
|
@@ -222,71 +239,112 @@ class FormViewModelComponent {
|
|
|
222
239
|
else {
|
|
223
240
|
this.loadInitialViewModel();
|
|
224
241
|
}
|
|
242
|
+
this.focusSubscription = this.focus$
|
|
243
|
+
.pipe(filter(e => {
|
|
244
|
+
// We only want to handle blur events after entering an input
|
|
245
|
+
return !!e && e.target instanceof HTMLInputElement;
|
|
246
|
+
}))
|
|
247
|
+
.subscribe(() => {
|
|
248
|
+
this.pendingUpdateSubscription?.unsubscribe();
|
|
249
|
+
this.blurSubscription?.unsubscribe();
|
|
250
|
+
this.blurSubscription = this.blur$
|
|
251
|
+
.pipe(filter(e => {
|
|
252
|
+
// Filter out events where relatedTarget is not null.
|
|
253
|
+
// The relatedTarget will be null when no new input is focused.
|
|
254
|
+
return !e.relatedTarget;
|
|
255
|
+
}))
|
|
256
|
+
.subscribe(() => {
|
|
257
|
+
this.blurSubscription?.unsubscribe();
|
|
258
|
+
this.setWaitCursor(true);
|
|
259
|
+
this.updateForm.next(true);
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
this.updateSubscription = this.updateForm.subscribe(() => {
|
|
263
|
+
if (this.isStartForm$.value) {
|
|
264
|
+
this.updateViewModelForStartForm();
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
this.updateViewModel();
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
ngOnDestroy() {
|
|
272
|
+
this.blurSubscription?.unsubscribe();
|
|
273
|
+
this.focusSubscription?.unsubscribe();
|
|
274
|
+
this.updateSubscription?.unsubscribe();
|
|
275
|
+
this.pendingUpdateSubscription?.unsubscribe();
|
|
276
|
+
this.setWaitCursor(false);
|
|
225
277
|
}
|
|
226
278
|
beforeSubmitHook(instance) {
|
|
227
279
|
return (submission, callback) => instance.beforeSubmit(submission, callback);
|
|
228
280
|
}
|
|
229
281
|
beforeSubmit(submission, callback) {
|
|
282
|
+
this.pendingUpdateSubscription?.unsubscribe();
|
|
283
|
+
this.setWaitCursor(false);
|
|
230
284
|
combineLatest([
|
|
231
285
|
this.formName$,
|
|
232
286
|
this.taskInstanceId$,
|
|
233
287
|
this.processDefinitionKey$,
|
|
234
288
|
this.documentDefinitionName$,
|
|
235
289
|
this.isStartForm$,
|
|
290
|
+
this.documentId$,
|
|
236
291
|
])
|
|
237
|
-
.pipe(take(1), switchMap(([formName, taskInstanceId, processDefinitionKey, documentDefinitionName, isStartForm,]) => isStartForm
|
|
292
|
+
.pipe(take(1), switchMap(([formName, taskInstanceId, processDefinitionKey, documentDefinitionName, isStartForm, documentId,]) => isStartForm
|
|
238
293
|
? this.viewModelService
|
|
239
|
-
.submitViewModelForStartForm(formName, processDefinitionKey, documentDefinitionName, submission.data)
|
|
240
|
-
.pipe(take(1), switchMap(response => {
|
|
241
|
-
callback(null, submission);
|
|
242
|
-
return of(response);
|
|
243
|
-
}), catchError(error => {
|
|
244
|
-
this.handleFormError(error);
|
|
245
|
-
callback({ message: ' ', component: null }, null);
|
|
246
|
-
return EMPTY; // return an empty observable to complete the stream
|
|
247
|
-
}))
|
|
294
|
+
.submitViewModelForStartForm(formName, processDefinitionKey, documentId, documentDefinitionName, submission.data)
|
|
248
295
|
: this.viewModelService
|
|
249
|
-
.submitViewModel(formName, taskInstanceId, submission.data)
|
|
250
|
-
|
|
296
|
+
.submitViewModel(formName, taskInstanceId, submission.data)))
|
|
297
|
+
.subscribe({
|
|
298
|
+
next: _ => {
|
|
251
299
|
callback(null, submission);
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
this.
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
300
|
+
},
|
|
301
|
+
error: err => {
|
|
302
|
+
this.handleSubmissionError(err, callback);
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
handleSubmissionError(error, callback) {
|
|
307
|
+
callback({ message: '', component: null, silent: true }, null);
|
|
308
|
+
if (error instanceof HttpErrorResponse) {
|
|
309
|
+
this.handleFormError(error);
|
|
310
|
+
}
|
|
259
311
|
}
|
|
260
312
|
handleFormError(error) {
|
|
261
313
|
const formInstance = this.formio.formio;
|
|
262
|
-
this.
|
|
263
|
-
if (error.error
|
|
314
|
+
this.formErrors$.next([]);
|
|
315
|
+
if (error.error?.componentErrors) {
|
|
316
|
+
const errors = [];
|
|
264
317
|
error.error.componentErrors.forEach(componentError => {
|
|
265
318
|
const component = formInstance.getComponent(componentError.component);
|
|
266
319
|
if (component == null) {
|
|
267
|
-
|
|
320
|
+
errors.push(componentError.message);
|
|
268
321
|
}
|
|
269
322
|
else {
|
|
270
|
-
|
|
323
|
+
// `true` makes the error dirty, setting the css class properly
|
|
324
|
+
component.setCustomValidity(componentError.message, true);
|
|
271
325
|
}
|
|
272
326
|
});
|
|
327
|
+
this.formErrors$.next(errors);
|
|
273
328
|
}
|
|
274
|
-
else {
|
|
329
|
+
else if (error.error?.error) {
|
|
275
330
|
const component = formInstance.getComponent(error.error?.component);
|
|
276
331
|
if (component == null) {
|
|
277
|
-
this.
|
|
332
|
+
this.formErrors$.next([error.error.error]);
|
|
278
333
|
}
|
|
279
334
|
else {
|
|
280
|
-
|
|
335
|
+
// `true` makes the error dirty, setting the css class properly
|
|
336
|
+
component.setCustomValidity(error.error.error, true);
|
|
281
337
|
}
|
|
282
338
|
}
|
|
283
339
|
}
|
|
284
340
|
onSubmit(submission) {
|
|
285
341
|
this.formSubmit.next(submission);
|
|
286
342
|
}
|
|
343
|
+
onFocus($event) {
|
|
344
|
+
this.focus$.next($event);
|
|
345
|
+
}
|
|
287
346
|
onBlur(blurEvent) {
|
|
288
347
|
this.blur$.next(blurEvent);
|
|
289
|
-
this.handleChanges();
|
|
290
348
|
}
|
|
291
349
|
onChange(object) {
|
|
292
350
|
if (object.data) {
|
|
@@ -296,12 +354,12 @@ class FormViewModelComponent {
|
|
|
296
354
|
onNextPage() {
|
|
297
355
|
this._preventNextPage = true;
|
|
298
356
|
this.formio.formio.setPage(this.formio.formio.page - 1);
|
|
299
|
-
this.
|
|
357
|
+
this.updateForm.next(true);
|
|
300
358
|
}
|
|
301
359
|
onPreviousPage() {
|
|
302
360
|
this._preventPreviousPage = true;
|
|
303
361
|
this.formio.formio.setPage(this.formio.formio.page + 1);
|
|
304
|
-
this.
|
|
362
|
+
this.updateForm.next(true);
|
|
305
363
|
}
|
|
306
364
|
handlePageChange() {
|
|
307
365
|
if (this._preventNextPage) {
|
|
@@ -324,36 +382,11 @@ class FormViewModelComponent {
|
|
|
324
382
|
}))))
|
|
325
383
|
.subscribe();
|
|
326
384
|
}
|
|
327
|
-
updateViewModel() {
|
|
328
|
-
this.loading$
|
|
329
|
-
.pipe(take(1), switchMap(updating => {
|
|
330
|
-
if (!updating) {
|
|
331
|
-
this.loading$.next(true);
|
|
332
|
-
return combineLatest([this.formName$, this.taskInstanceId$, this.change$]).pipe(take(1), switchMap(([formName, taskInstanceId, change]) => this.viewModelService
|
|
333
|
-
.updateViewModel(formName, taskInstanceId, change.data, this.formio.formio.page, this._isWizard)
|
|
334
|
-
.pipe(tap({
|
|
335
|
-
next: viewModel => {
|
|
336
|
-
const submission = this.submission$.value;
|
|
337
|
-
submission.data = viewModel;
|
|
338
|
-
this.submission$.next(submission);
|
|
339
|
-
this.handlePageChange();
|
|
340
|
-
this.refreshForm.emit({ submission: submission });
|
|
341
|
-
this.loading$.next(false);
|
|
342
|
-
this.errors = [];
|
|
343
|
-
},
|
|
344
|
-
error: error => {
|
|
345
|
-
this.loading$.next(false);
|
|
346
|
-
this.handleFormError(error);
|
|
347
|
-
},
|
|
348
|
-
}))));
|
|
349
|
-
}
|
|
350
|
-
return of(null); // Fallback to return an observable if updating is true
|
|
351
|
-
}))
|
|
352
|
-
.subscribe();
|
|
353
|
-
}
|
|
354
385
|
loadInitialViewModelForStartForm() {
|
|
355
|
-
combineLatest([this.formName$, this.processDefinitionKey$])
|
|
356
|
-
.pipe(take(1), switchMap(([formName, processDefinitionKey]) => this.viewModelService
|
|
386
|
+
combineLatest([this.formName$, this.processDefinitionKey$, this.documentId$])
|
|
387
|
+
.pipe(take(1), switchMap(([formName, processDefinitionKey, documentId]) => this.viewModelService
|
|
388
|
+
.getViewModelForStartForm(formName, processDefinitionKey, documentId)
|
|
389
|
+
.pipe(tap(viewModel => {
|
|
357
390
|
this.submission$.next({ data: viewModel });
|
|
358
391
|
this.change$.pipe(take(1)).subscribe(() => {
|
|
359
392
|
this.loading$.next(false);
|
|
@@ -362,49 +395,63 @@ class FormViewModelComponent {
|
|
|
362
395
|
}))))
|
|
363
396
|
.subscribe();
|
|
364
397
|
}
|
|
398
|
+
updateViewModel() {
|
|
399
|
+
this.pendingUpdateSubscription?.unsubscribe();
|
|
400
|
+
this.pendingUpdateSubscription = combineLatest([
|
|
401
|
+
this.formName$,
|
|
402
|
+
this.taskInstanceId$,
|
|
403
|
+
this.change$,
|
|
404
|
+
])
|
|
405
|
+
.pipe(take(1), switchMap(([formName, taskInstanceId, change]) => this.viewModelService
|
|
406
|
+
.updateViewModel(formName, taskInstanceId, change.data, this.formio.formio.page, this._isWizard)
|
|
407
|
+
.pipe(tap({
|
|
408
|
+
next: viewModel => this.handleViewModelUpdate(viewModel),
|
|
409
|
+
error: error => this.handleViewModelUpdateError(error),
|
|
410
|
+
}))))
|
|
411
|
+
.subscribe();
|
|
412
|
+
}
|
|
365
413
|
updateViewModelForStartForm() {
|
|
366
|
-
this.
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
this.loading$.next(false);
|
|
380
|
-
this.errors = [];
|
|
381
|
-
},
|
|
382
|
-
error: error => {
|
|
383
|
-
this.loading$.next(false);
|
|
384
|
-
this.handleFormError(error);
|
|
385
|
-
},
|
|
386
|
-
}))));
|
|
387
|
-
}
|
|
388
|
-
return of(null); // Fallback to return an observable if updating is true
|
|
389
|
-
}))
|
|
414
|
+
this.pendingUpdateSubscription?.unsubscribe();
|
|
415
|
+
this.pendingUpdateSubscription = combineLatest([
|
|
416
|
+
this.formName$,
|
|
417
|
+
this.processDefinitionKey$,
|
|
418
|
+
this.change$,
|
|
419
|
+
this.documentId$,
|
|
420
|
+
])
|
|
421
|
+
.pipe(take(1), switchMap(([formName, processDefinitionKey, change, documentId]) => this.viewModelService
|
|
422
|
+
.updateViewModelForStartForm(formName, processDefinitionKey, documentId, change.data, this.formio.formio.page, this._isWizard)
|
|
423
|
+
.pipe(tap({
|
|
424
|
+
next: viewModel => this.handleViewModelUpdate(viewModel),
|
|
425
|
+
error: error => this.handleViewModelUpdateError(error),
|
|
426
|
+
}))))
|
|
390
427
|
.subscribe();
|
|
391
428
|
}
|
|
392
|
-
|
|
393
|
-
this.
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
429
|
+
handleViewModelUpdate(viewModel) {
|
|
430
|
+
const submission = this.submission$.value;
|
|
431
|
+
submission.data = viewModel;
|
|
432
|
+
this.submission$.next(submission);
|
|
433
|
+
this.handlePageChange();
|
|
434
|
+
this.refreshForm.emit({ submission });
|
|
435
|
+
this.pendingUpdateSubscription?.unsubscribe();
|
|
436
|
+
this.pendingUpdateSubscription = null;
|
|
437
|
+
this.formErrors$.next([]);
|
|
438
|
+
this.setWaitCursor(false);
|
|
439
|
+
}
|
|
440
|
+
handleViewModelUpdateError(error) {
|
|
441
|
+
this.pendingUpdateSubscription?.unsubscribe();
|
|
442
|
+
this.pendingUpdateSubscription = null;
|
|
443
|
+
this.handleFormError(error);
|
|
444
|
+
this.setWaitCursor(false);
|
|
445
|
+
}
|
|
446
|
+
setWaitCursor(enabled) {
|
|
447
|
+
document.body.style.cursor = enabled ? 'wait' : 'auto';
|
|
401
448
|
}
|
|
402
449
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormViewModelComponent, deps: [{ token: ViewModelService }, { token: i2$1.TranslateService }, { token: i3.FormIoStateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
403
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FormViewModelComponent, isStandalone: true, selector: "valtimo-form-view-model", inputs: { options: "options", submission: "submission", form: "form", formName: "formName", taskInstanceId: "taskInstanceId", isStartForm: "isStartForm", processDefinitionKey: "processDefinitionKey", documentDefinitionName: "documentDefinitionName" }, outputs: { formSubmit: "formSubmit" }, viewQueries: [{ propertyName: "formio", first: true, predicate: ["formio"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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\n class=\"form-container formio-carbon\"\n *ngIf=\"{\n submission: submission$ | async,\n form: form$ | async,\n tokenSetInLocalStorage: tokenSetInLocalStorage$ | async,\n formioOptions: formioOptions$ | async,\n loading: loading$ | async,\n } as obs\"\n>\n <div *ngIf=\"obs.loading\" class=\"overlay\">\n <div class=\"spinner\">\n <i class=\"fa fa-spinner fa-spin\"></i>\n </div>\n </div>\n\n <div *ngIf=\"errors.length > 0\" class=\"alert alert-danger pt-5 pb-5 mb-2\">\n <ol>\n <li *ngFor=\"let error of errors\" class=\"pl-2\">\n {{ error }}\n </li>\n </ol>\n </div>\n\n <formio\n #formio\n [submission]=\"obs.submission\"\n [form]=\"obs.form\"\n [options]=\"obs.formioOptions\"\n [refresh]=\"refreshForm\"\n (submit)=\"onSubmit($event)\"\n (change)=\"onChange($event)\"\n (focusout)=\"onBlur($event)\"\n (nextPage)=\"onNextPage()\"\n (prevPage)=\"onPreviousPage()\"\n ></formio>\n</div>\n", styles: [".form-container{position:relative}.overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#fffc;z-index:1000;display:flex;justify-content:center;align-items:center;pointer-events:all}.spinner{font-size:3rem;color:#007bff}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: FormioModule }, { kind: "component", type: i5.FormioComponent, selector: "formio" }] }); }
|
|
450
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FormViewModelComponent, isStandalone: true, selector: "valtimo-form-view-model", inputs: { options: "options", submission: "submission", form: "form", formName: "formName", taskInstanceId: "taskInstanceId", isStartForm: "isStartForm", documentId: "documentId", processDefinitionKey: "processDefinitionKey", documentDefinitionName: "documentDefinitionName" }, outputs: { formSubmit: "formSubmit" }, viewQueries: [{ propertyName: "formio", first: true, predicate: ["formio"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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\n class=\"form-container formio-carbon\"\n cdsLayer=\"1.0\"\n *ngIf=\"{\n submission: submission$ | async,\n form: form$ | async,\n tokenSetInLocalStorage: tokenSetInLocalStorage$ | async,\n formioOptions: formioOptions$ | async,\n loading: loading$ | async,\n errors: formErrors$ | async,\n renderOptions: renderOptions$ | async,\n } as obs\"\n>\n <div *ngIf=\"obs.loading\" class=\"overlay\">\n <div class=\"spinner\">\n <i class=\"fa fa-spinner fa-spin\"></i>\n </div>\n </div>\n\n <div *ngIf=\"obs.errors.length > 0\" class=\"alert alert-danger pt-5 pb-5 mb-2\">\n <ol>\n <li *ngFor=\"let error of obs.errors\" class=\"pl-2\">\n {{ error }}\n </li>\n </ol>\n </div>\n\n <formio\n #formio\n [submission]=\"obs.submission\"\n [form]=\"obs.form\"\n [options]=\"obs.formioOptions\"\n [renderOptions]=\"obs.renderOptions\"\n [refresh]=\"refreshForm\"\n (submit)=\"onSubmit($event)\"\n (change)=\"onChange($event)\"\n (focusin)=\"onFocus($event)\"\n (focusout)=\"onBlur($event)\"\n (nextPage)=\"onNextPage()\"\n (prevPage)=\"onPreviousPage()\"\n ></formio>\n</div>\n", styles: [".form-container{position:relative}.overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#fffc;z-index:1000;display:flex;justify-content:center;align-items:center;pointer-events:all}.spinner{font-size:3rem;color:#007bff}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: FormioModule }, { kind: "component", type: i5.FormioComponent, selector: "formio" }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i6.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }] }); }
|
|
404
451
|
}
|
|
405
452
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormViewModelComponent, decorators: [{
|
|
406
453
|
type: Component,
|
|
407
|
-
args: [{ selector: 'valtimo-form-view-model', standalone: true, imports: [CommonModule, FormioModule], template: "<!--\n ~ Copyright 2015-2024 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\n class=\"form-container formio-carbon\"\n *ngIf=\"{\n submission: submission$ | async,\n form: form$ | async,\n tokenSetInLocalStorage: tokenSetInLocalStorage$ | async,\n formioOptions: formioOptions$ | async,\n loading: loading$ | async,\n } as obs\"\n>\n <div *ngIf=\"obs.loading\" class=\"overlay\">\n <div class=\"spinner\">\n <i class=\"fa fa-spinner fa-spin\"></i>\n </div>\n </div>\n\n <div *ngIf=\"errors.length > 0\" class=\"alert alert-danger pt-5 pb-5 mb-2\">\n <ol>\n <li *ngFor=\"let error of errors\" class=\"pl-2\">\n {{ error }}\n </li>\n </ol>\n </div>\n\n <formio\n #formio\n [submission]=\"obs.submission\"\n [form]=\"obs.form\"\n [options]=\"obs.formioOptions\"\n [refresh]=\"refreshForm\"\n (submit)=\"onSubmit($event)\"\n (change)=\"onChange($event)\"\n (focusout)=\"onBlur($event)\"\n (nextPage)=\"onNextPage()\"\n (prevPage)=\"onPreviousPage()\"\n ></formio>\n</div>\n", styles: [".form-container{position:relative}.overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#fffc;z-index:1000;display:flex;justify-content:center;align-items:center;pointer-events:all}.spinner{font-size:3rem;color:#007bff}\n"] }]
|
|
454
|
+
args: [{ selector: 'valtimo-form-view-model', standalone: true, imports: [CommonModule, FormioModule, LayerModule], template: "<!--\n ~ Copyright 2015-2024 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\n class=\"form-container formio-carbon\"\n cdsLayer=\"1.0\"\n *ngIf=\"{\n submission: submission$ | async,\n form: form$ | async,\n tokenSetInLocalStorage: tokenSetInLocalStorage$ | async,\n formioOptions: formioOptions$ | async,\n loading: loading$ | async,\n errors: formErrors$ | async,\n renderOptions: renderOptions$ | async,\n } as obs\"\n>\n <div *ngIf=\"obs.loading\" class=\"overlay\">\n <div class=\"spinner\">\n <i class=\"fa fa-spinner fa-spin\"></i>\n </div>\n </div>\n\n <div *ngIf=\"obs.errors.length > 0\" class=\"alert alert-danger pt-5 pb-5 mb-2\">\n <ol>\n <li *ngFor=\"let error of obs.errors\" class=\"pl-2\">\n {{ error }}\n </li>\n </ol>\n </div>\n\n <formio\n #formio\n [submission]=\"obs.submission\"\n [form]=\"obs.form\"\n [options]=\"obs.formioOptions\"\n [renderOptions]=\"obs.renderOptions\"\n [refresh]=\"refreshForm\"\n (submit)=\"onSubmit($event)\"\n (change)=\"onChange($event)\"\n (focusin)=\"onFocus($event)\"\n (focusout)=\"onBlur($event)\"\n (nextPage)=\"onNextPage()\"\n (prevPage)=\"onPreviousPage()\"\n ></formio>\n</div>\n", styles: [".form-container{position:relative}.overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#fffc;z-index:1000;display:flex;justify-content:center;align-items:center;pointer-events:all}.spinner{font-size:3rem;color:#007bff}\n"] }]
|
|
408
455
|
}], ctorParameters: () => [{ type: ViewModelService }, { type: i2$1.TranslateService }, { type: i3.FormIoStateService }], propDecorators: { formio: [{
|
|
409
456
|
type: ViewChild,
|
|
410
457
|
args: ['formio']
|
|
@@ -420,6 +467,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
420
467
|
type: Input
|
|
421
468
|
}], isStartForm: [{
|
|
422
469
|
type: Input
|
|
470
|
+
}], documentId: [{
|
|
471
|
+
type: Input
|
|
423
472
|
}], processDefinitionKey: [{
|
|
424
473
|
type: Input
|
|
425
474
|
}], documentDefinitionName: [{
|