@valtimo/process-link 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +32 -0
  2. package/esm2022/lib/components/choose-process-link-type/choose-process-link-type.component.mjs +38 -0
  3. package/esm2022/lib/components/choose-process-link-type/index.mjs +17 -0
  4. package/esm2022/lib/components/form-flow/form-flow.component.mjs +117 -0
  5. package/esm2022/lib/components/form-flow-configuration-container/form-flow-configuration-container.component.mjs +107 -0
  6. package/esm2022/lib/components/form-flow-configuration-container/index.mjs +17 -0
  7. package/esm2022/lib/components/form-link-process-diagram/form-link-process-diagram.component.mjs +150 -0
  8. package/esm2022/lib/components/plugin-action-configuration/plugin-action-configuration.component.mjs +126 -0
  9. package/esm2022/lib/components/process-link/process-link.component.mjs +69 -0
  10. package/esm2022/lib/components/process-link-modal/process-link-modal.component.mjs +79 -0
  11. package/esm2022/lib/components/select-form/index.mjs +17 -0
  12. package/esm2022/lib/components/select-form/select-form.component.mjs +121 -0
  13. package/esm2022/lib/components/select-form-flow/index.mjs +17 -0
  14. package/esm2022/lib/components/select-form-flow/select-form-flow.component.mjs +120 -0
  15. package/esm2022/lib/components/select-plugin-action/select-plugin-action.component.mjs +75 -0
  16. package/esm2022/lib/components/select-plugin-configuration/select-plugin-configuration.component.mjs +75 -0
  17. package/esm2022/lib/constants/index.mjs +17 -0
  18. package/esm2022/lib/constants/injection-tokens.mjs +19 -0
  19. package/esm2022/lib/models/form-flow.model.mjs +17 -0
  20. package/esm2022/lib/models/form-link.model.mjs +17 -0
  21. package/esm2022/lib/models/index.mjs +19 -0
  22. package/esm2022/lib/models/process-link.model.mjs +17 -0
  23. package/esm2022/lib/process-link-routing.module.mjs +44 -0
  24. package/esm2022/lib/process-link.module.mjs +169 -0
  25. package/esm2022/lib/services/form-flow-component.service.mjs +44 -0
  26. package/esm2022/lib/services/form-flow.service.mjs +53 -0
  27. package/esm2022/lib/services/index.mjs +23 -0
  28. package/esm2022/lib/services/plugin-state.service.mjs +90 -0
  29. package/esm2022/lib/services/process-link-button.service.mjs +106 -0
  30. package/esm2022/lib/services/process-link-state.service.mjs +143 -0
  31. package/esm2022/lib/services/process-link-step.service.mjs +235 -0
  32. package/esm2022/lib/services/process-link.service.mjs +89 -0
  33. package/esm2022/public-api.mjs +31 -0
  34. package/esm2022/valtimo-process-link.mjs +5 -0
  35. package/fesm2022/valtimo-process-link.mjs +2119 -0
  36. package/fesm2022/valtimo-process-link.mjs.map +1 -0
  37. package/index.d.ts +6 -0
  38. package/lib/components/choose-process-link-type/choose-process-link-type.component.d.ts +11 -0
  39. package/lib/components/choose-process-link-type/choose-process-link-type.component.d.ts.map +1 -0
  40. package/lib/components/choose-process-link-type/index.d.ts +2 -0
  41. package/lib/components/choose-process-link-type/index.d.ts.map +1 -0
  42. package/lib/components/form-flow/form-flow.component.d.ts +33 -0
  43. package/lib/components/form-flow/form-flow.component.d.ts.map +1 -0
  44. package/lib/components/form-flow-configuration-container/form-flow-configuration-container.component.d.ts +30 -0
  45. package/lib/components/form-flow-configuration-container/form-flow-configuration-container.component.d.ts.map +1 -0
  46. package/lib/components/form-flow-configuration-container/index.d.ts +2 -0
  47. package/lib/components/form-flow-configuration-container/index.d.ts.map +1 -0
  48. package/lib/components/form-link-process-diagram/form-link-process-diagram.component.d.ts +34 -0
  49. package/lib/components/form-link-process-diagram/form-link-process-diagram.component.d.ts.map +1 -0
  50. package/lib/components/plugin-action-configuration/plugin-action-configuration.component.d.ts +33 -0
  51. package/lib/components/plugin-action-configuration/plugin-action-configuration.component.d.ts.map +1 -0
  52. package/lib/components/process-link/process-link.component.d.ts +14 -0
  53. package/lib/components/process-link/process-link.component.d.ts.map +1 -0
  54. package/lib/components/process-link-modal/process-link-modal.component.d.ts +30 -0
  55. package/lib/components/process-link-modal/process-link-modal.component.d.ts.map +1 -0
  56. package/lib/components/select-form/index.d.ts +2 -0
  57. package/lib/components/select-form/index.d.ts.map +1 -0
  58. package/lib/components/select-form/select-form.component.d.ts +29 -0
  59. package/lib/components/select-form/select-form.component.d.ts.map +1 -0
  60. package/lib/components/select-form-flow/index.d.ts +2 -0
  61. package/lib/components/select-form-flow/index.d.ts.map +1 -0
  62. package/lib/components/select-form-flow/select-form-flow.component.d.ts +28 -0
  63. package/lib/components/select-form-flow/select-form-flow.component.d.ts.map +1 -0
  64. package/lib/components/select-plugin-action/select-plugin-action.component.d.ts +29 -0
  65. package/lib/components/select-plugin-action/select-plugin-action.component.d.ts.map +1 -0
  66. package/lib/components/select-plugin-configuration/select-plugin-configuration.component.d.ts +29 -0
  67. package/lib/components/select-plugin-configuration/select-plugin-configuration.component.d.ts.map +1 -0
  68. package/lib/constants/index.d.ts +2 -0
  69. package/lib/constants/index.d.ts.map +1 -0
  70. package/lib/constants/injection-tokens.d.ts +5 -0
  71. package/lib/constants/injection-tokens.d.ts.map +1 -0
  72. package/lib/models/form-flow.model.d.ts +18 -0
  73. package/lib/models/form-flow.model.d.ts.map +1 -0
  74. package/lib/models/form-link.model.d.ts +46 -0
  75. package/lib/models/form-link.model.d.ts.map +1 -0
  76. package/lib/models/index.d.ts +4 -0
  77. package/lib/models/index.d.ts.map +1 -0
  78. package/lib/models/process-link.model.d.ts +65 -0
  79. package/lib/models/process-link.model.d.ts.map +1 -0
  80. package/lib/process-link-routing.module.d.ts +8 -0
  81. package/lib/process-link-routing.module.d.ts.map +1 -0
  82. package/lib/process-link.module.d.ts +25 -0
  83. package/lib/process-link.module.d.ts.map +1 -0
  84. package/lib/services/form-flow-component.service.d.ts +13 -0
  85. package/lib/services/form-flow-component.service.d.ts.map +1 -0
  86. package/lib/services/form-flow.service.d.ts +20 -0
  87. package/lib/services/form-flow.service.d.ts.map +1 -0
  88. package/lib/services/index.d.ts +8 -0
  89. package/lib/services/index.d.ts.map +1 -0
  90. package/lib/services/plugin-state.service.d.ts +29 -0
  91. package/lib/services/plugin-state.service.d.ts.map +1 -0
  92. package/lib/services/process-link-button.service.d.ts +37 -0
  93. package/lib/services/process-link-button.service.d.ts.map +1 -0
  94. package/lib/services/process-link-state.service.d.ts +48 -0
  95. package/lib/services/process-link-state.service.d.ts.map +1 -0
  96. package/lib/services/process-link-step.service.d.ts +41 -0
  97. package/lib/services/process-link-step.service.d.ts.map +1 -0
  98. package/lib/services/process-link.service.d.ts +20 -0
  99. package/lib/services/process-link.service.d.ts.map +1 -0
  100. package/package.json +26 -0
  101. package/public-api.d.ts +13 -0
  102. package/public-api.d.ts.map +1 -0
  103. package/valtimo-process-link.d.ts.map +1 -0
@@ -0,0 +1,2119 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, InjectionToken, Inject, Component, EventEmitter, Output, ViewChild, NgModule, ViewContainerRef, Input } from '@angular/core';
3
+ import * as i1 from '@angular/common/http';
4
+ import { HttpParams, HttpHeaders } from '@angular/common/http';
5
+ import * as i2 from '@valtimo/config';
6
+ import { ROLE_ADMIN } from '@valtimo/config';
7
+ import { map, take, switchMap as switchMap$1, tap as tap$1 } from 'rxjs/operators';
8
+ import { BehaviorSubject, Subject, switchMap, of, combineLatest, filter, map as map$1, Subscription, tap } from 'rxjs';
9
+ import * as i1$1 from '@valtimo/plugin';
10
+ import { PluginTranslatePipeModule, PluginConfigurationContainerModule } from '@valtimo/plugin';
11
+ import * as i6 from '@ngx-translate/core';
12
+ import { TranslateModule } from '@ngx-translate/core';
13
+ import * as i2$1 from '@angular/common';
14
+ import { CommonModule } from '@angular/common';
15
+ import * as i3 from 'carbon-components-angular';
16
+ import { ModalModule as ModalModule$1, ProgressIndicatorModule, ButtonModule as ButtonModule$1, IconModule, ComboBoxModule, InputModule, LoadingModule, StructuredListModule, TilesModule, SelectModule } from 'carbon-components-angular';
17
+ import BpmnJS from 'bpmn-js/dist/bpmn-navigated-viewer.production.min.js';
18
+ import * as i1$2 from '@valtimo/process';
19
+ import * as i2$2 from '@angular/router';
20
+ import { RouterModule } from '@angular/router';
21
+ import * as i2$3 from '@valtimo/components';
22
+ import { FormioOptionsImpl, ModalModule, SearchableDropdownSelectModule, StepperModule, VModalModule, VCardModule, ParagraphModule, ButtonModule, TitleModule, TooltipModule, TooltipIconModule, FormIoModule, ValtimoCdsModalDirectiveModule, RenderInPageHeaderDirectiveModule } from '@valtimo/components';
23
+ import * as i5 from '@angular/forms';
24
+ import { FormsModule } from '@angular/forms';
25
+ import { AuthGuardService } from '@valtimo/security';
26
+ import * as i1$3 from '@valtimo/form';
27
+ import * as i5$1 from 'carbon-components-angular/dropdown';
28
+
29
+ /*
30
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
31
+ *
32
+ * Licensed under EUPL, Version 1.2 (the "License");
33
+ * you may not use this file except in compliance with the License.
34
+ * You may obtain a copy of the License at
35
+ *
36
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
37
+ *
38
+ * Unless required by applicable law or agreed to in writing, software
39
+ * distributed under the License is distributed on an "AS IS" basis,
40
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41
+ * See the License for the specific language governing permissions and
42
+ * limitations under the License.
43
+ */
44
+ class FormFlowService {
45
+ constructor(http, configService) {
46
+ this.http = http;
47
+ this.configService = configService;
48
+ this.valtimoEndpointUri = configService.config.valtimoApi.endpointUri;
49
+ }
50
+ getFormFlowDefinitions() {
51
+ return this.http.get(`${this.valtimoEndpointUri}v1/form-flow/definition`);
52
+ }
53
+ createInstanceForNewProcess(processDefinitionKey, request) {
54
+ return this.http.post(`${this.valtimoEndpointUri}v1/process-definition/${processDefinitionKey}/form-flow`, request);
55
+ }
56
+ getFormFlowStep(formFlowInstanceId) {
57
+ return this.http.get(`${this.valtimoEndpointUri}v1/form-flow/instance/${formFlowInstanceId}`);
58
+ }
59
+ submitStep(formFlowInstanceId, stepInstanceId, submissionData) {
60
+ return this.http.post(`${this.valtimoEndpointUri}v1/form-flow/instance/${formFlowInstanceId}/step/instance/${stepInstanceId}`, submissionData);
61
+ }
62
+ back(formFlowInstanceId, submissionData) {
63
+ return this.http.post(`${this.valtimoEndpointUri}v1/form-flow/instance/${formFlowInstanceId}/back`, submissionData);
64
+ }
65
+ save(formFlowInstanceId, submissionData) {
66
+ return this.http.post(`${this.valtimoEndpointUri}v1/form-flow/instance/${formFlowInstanceId}/save`, submissionData);
67
+ }
68
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormFlowService, deps: [{ token: i1.HttpClient }, { token: i2.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
69
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormFlowService, providedIn: 'root' }); }
70
+ }
71
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormFlowService, decorators: [{
72
+ type: Injectable,
73
+ args: [{
74
+ providedIn: 'root',
75
+ }]
76
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.ConfigService }] });
77
+
78
+ /*
79
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
80
+ *
81
+ * Licensed under EUPL, Version 1.2 (the "License");
82
+ * you may not use this file except in compliance with the License.
83
+ * You may obtain a copy of the License at
84
+ *
85
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
86
+ *
87
+ * Unless required by applicable law or agreed to in writing, software
88
+ * distributed under the License is distributed on an "AS IS" basis,
89
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
90
+ * See the License for the specific language governing permissions and
91
+ * limitations under the License.
92
+ */
93
+ class ProcessLinkService {
94
+ constructor(configService, http) {
95
+ this.configService = configService;
96
+ this.http = http;
97
+ this.VALTIMO_ENDPOINT_URI = configService.config.valtimoApi.endpointUri;
98
+ }
99
+ getProcessLink(getProcessLinkRequest) {
100
+ const params = new HttpParams()
101
+ .set('activityId', getProcessLinkRequest.activityId)
102
+ .set('processDefinitionId', getProcessLinkRequest.processDefinitionId);
103
+ return this.http.get(`${this.VALTIMO_ENDPOINT_URI}v1/process-link`, {
104
+ params,
105
+ });
106
+ }
107
+ updateProcessLink(updateProcessLinkRequest) {
108
+ const pluginUpdateRequest = updateProcessLinkRequest;
109
+ if (pluginUpdateRequest.actionProperties) {
110
+ Object.keys(pluginUpdateRequest.actionProperties).forEach(key => {
111
+ if (pluginUpdateRequest.actionProperties[key] === '') {
112
+ pluginUpdateRequest.actionProperties[key] = null;
113
+ }
114
+ });
115
+ }
116
+ return this.http.put(`${this.VALTIMO_ENDPOINT_URI}v1/process-link`, updateProcessLinkRequest);
117
+ }
118
+ saveProcessLink(saveProcessLinkRequest) {
119
+ const pluginProcessLinkCreateRequest = saveProcessLinkRequest;
120
+ if (pluginProcessLinkCreateRequest.actionProperties) {
121
+ Object.keys(pluginProcessLinkCreateRequest.actionProperties).forEach(key => {
122
+ if (pluginProcessLinkCreateRequest.actionProperties[key] === '') {
123
+ pluginProcessLinkCreateRequest.actionProperties[key] = null;
124
+ }
125
+ });
126
+ }
127
+ return this.http.post(`${this.VALTIMO_ENDPOINT_URI}v1/process-link`, saveProcessLinkRequest);
128
+ }
129
+ deleteProcessLink(id) {
130
+ return this.http.delete(`${this.VALTIMO_ENDPOINT_URI}v1/process-link/${id}`);
131
+ }
132
+ getProcessLinkCandidates(activityType) {
133
+ return this.http.get(`${this.VALTIMO_ENDPOINT_URI}v1/process-link/types?activityType=${activityType}`);
134
+ }
135
+ submitForm(processLinkId, formData, documentId, taskInstanceId, documentDefinitionName) {
136
+ let params = new HttpParams();
137
+ if (documentId) {
138
+ params = params.set('documentId', documentId);
139
+ }
140
+ if (taskInstanceId) {
141
+ params = params.set('taskInstanceId', taskInstanceId);
142
+ }
143
+ if (documentDefinitionName) {
144
+ params = params.set('documentDefinitionName', documentDefinitionName);
145
+ }
146
+ const httpOptions = {
147
+ headers: new HttpHeaders().set('Content-Type', 'application/json'),
148
+ params,
149
+ };
150
+ return this.http.post(`${this.VALTIMO_ENDPOINT_URI}v1/process-link/${processLinkId}/form/submission`, formData, httpOptions);
151
+ }
152
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkService, deps: [{ token: i2.ConfigService }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
153
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkService, providedIn: 'root' }); }
154
+ }
155
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkService, decorators: [{
156
+ type: Injectable,
157
+ args: [{
158
+ providedIn: 'root',
159
+ }]
160
+ }], ctorParameters: () => [{ type: i2.ConfigService }, { type: i1.HttpClient }] });
161
+
162
+ /*
163
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
164
+ *
165
+ * Licensed under EUPL, Version 1.2 (the "License");
166
+ * you may not use this file except in compliance with the License.
167
+ * You may obtain a copy of the License at
168
+ *
169
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
170
+ *
171
+ * Unless required by applicable law or agreed to in writing, software
172
+ * distributed under the License is distributed on an "AS IS" basis,
173
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
174
+ * See the License for the specific language governing permissions and
175
+ * limitations under the License.
176
+ */
177
+ class PluginStateService {
178
+ constructor(pluginManagementService, pluginService) {
179
+ this.pluginManagementService = pluginManagementService;
180
+ this.pluginService = pluginService;
181
+ this._selectedPluginDefinition$ = new BehaviorSubject(undefined);
182
+ this._selectedPluginConfiguration$ = new BehaviorSubject(undefined);
183
+ this._selectedPluginFunction$ = new BehaviorSubject(undefined);
184
+ this._save$ = new Subject();
185
+ this._selectedProcessLink$ = new BehaviorSubject(undefined);
186
+ }
187
+ get selectedPluginDefinition$() {
188
+ return this._selectedPluginDefinition$.asObservable();
189
+ }
190
+ get selectedPluginConfiguration$() {
191
+ return this._selectedPluginConfiguration$.asObservable();
192
+ }
193
+ get selectedPluginFunction$() {
194
+ return this._selectedPluginFunction$.asObservable();
195
+ }
196
+ get save$() {
197
+ return this._save$.asObservable();
198
+ }
199
+ get functionKey$() {
200
+ return this._selectedProcessLink$.pipe(switchMap(processLink => !processLink
201
+ ? this._selectedPluginFunction$.pipe(map(pluginFunction => pluginFunction?.key))
202
+ : of(processLink?.pluginActionDefinitionKey)));
203
+ }
204
+ get pluginDefinitionKey$() {
205
+ return this._selectedProcessLink$.pipe(switchMap(selectedProcesLink => !selectedProcesLink
206
+ ? this._selectedPluginConfiguration$.pipe(map(configuration => configuration?.pluginDefinition.key))
207
+ : combineLatest([
208
+ this._selectedProcessLink$,
209
+ this.pluginService.pluginSpecifications$,
210
+ ]).pipe(map(([processLink, pluginSpecifications]) => {
211
+ const pluginSpecification = pluginSpecifications.find(specification => {
212
+ const functionKeys = specification?.functionConfigurationComponents &&
213
+ Object.keys(specification.functionConfigurationComponents);
214
+ return functionKeys?.includes(processLink?.pluginActionDefinitionKey);
215
+ });
216
+ return pluginSpecification?.pluginId;
217
+ }))));
218
+ }
219
+ selectPluginDefinition(definition) {
220
+ this._selectedPluginDefinition$.next(definition);
221
+ }
222
+ selectPluginConfiguration(configuration) {
223
+ this._selectedPluginConfiguration$.next(configuration);
224
+ }
225
+ selectPluginFunction(pluginFunction) {
226
+ this._selectedPluginFunction$.next(pluginFunction);
227
+ }
228
+ selectProcessLink(processLink) {
229
+ this._selectedProcessLink$.next(processLink);
230
+ }
231
+ deselectProcessLink() {
232
+ this._selectedProcessLink$.next(undefined);
233
+ }
234
+ save() {
235
+ this._save$.next(null);
236
+ }
237
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: PluginStateService, deps: [{ token: i1$1.PluginManagementService }, { token: i1$1.PluginService }], target: i0.ɵɵFactoryTarget.Injectable }); }
238
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: PluginStateService, providedIn: 'root' }); }
239
+ }
240
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: PluginStateService, decorators: [{
241
+ type: Injectable,
242
+ args: [{
243
+ providedIn: 'root',
244
+ }]
245
+ }], ctorParameters: () => [{ type: i1$1.PluginManagementService }, { type: i1$1.PluginService }] });
246
+
247
+ /*
248
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
249
+ *
250
+ * Licensed under EUPL, Version 1.2 (the "License");
251
+ * you may not use this file except in compliance with the License.
252
+ * You may obtain a copy of the License at
253
+ *
254
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
255
+ *
256
+ * Unless required by applicable law or agreed to in writing, software
257
+ * distributed under the License is distributed on an "AS IS" basis,
258
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
259
+ * See the License for the specific language governing permissions and
260
+ * limitations under the License.
261
+ */
262
+ class ProcessLinkButtonService {
263
+ constructor() {
264
+ this._showSaveButton$ = new BehaviorSubject(false);
265
+ this._enableSaveButton$ = new BehaviorSubject(false);
266
+ this._enableNextButton$ = new BehaviorSubject(false);
267
+ this._showBackButton$ = new BehaviorSubject(false);
268
+ this._showNextButton$ = new BehaviorSubject(false);
269
+ this._backButtonClick$ = new Subject();
270
+ this._saveButtonClick$ = new Subject();
271
+ this._nextButtonClick$ = new Subject();
272
+ }
273
+ get showSaveButton$() {
274
+ return this._showSaveButton$.asObservable();
275
+ }
276
+ get enableSaveButton$() {
277
+ return this._enableSaveButton$.asObservable();
278
+ }
279
+ get showNextButton$() {
280
+ return this._showNextButton$.asObservable();
281
+ }
282
+ get enableNextButton$() {
283
+ return this._enableNextButton$.asObservable();
284
+ }
285
+ get showBackButton$() {
286
+ return this._showBackButton$.asObservable();
287
+ }
288
+ get backButtonClick$() {
289
+ return this._backButtonClick$.asObservable();
290
+ }
291
+ get saveButtonClick$() {
292
+ return this._saveButtonClick$.asObservable();
293
+ }
294
+ get nextButtonClick$() {
295
+ return this._nextButtonClick$.asObservable();
296
+ }
297
+ showSaveButton() {
298
+ this._showSaveButton$.next(true);
299
+ }
300
+ hideSaveButton() {
301
+ this._showSaveButton$.next(false);
302
+ }
303
+ showNextButton() {
304
+ this._showNextButton$.next(true);
305
+ }
306
+ hideNextButton() {
307
+ this._showNextButton$.next(false);
308
+ }
309
+ enableNextButton() {
310
+ this._enableNextButton$.next(true);
311
+ }
312
+ disableNextButton() {
313
+ this._enableNextButton$.next(false);
314
+ }
315
+ enableSaveButton() {
316
+ this._enableSaveButton$.next(true);
317
+ }
318
+ disableSaveButton() {
319
+ this._enableSaveButton$.next(false);
320
+ }
321
+ showBackButton() {
322
+ this._showBackButton$.next(true);
323
+ }
324
+ hideBackButton() {
325
+ this._showBackButton$.next(false);
326
+ }
327
+ clickBackButton() {
328
+ this._backButtonClick$.next(null);
329
+ }
330
+ clickSaveButton() {
331
+ this._saveButtonClick$.next(null);
332
+ }
333
+ clickNextButton() {
334
+ this._nextButtonClick$.next(null);
335
+ }
336
+ resetButtons() {
337
+ this.disableSaveButton();
338
+ this.hideBackButton();
339
+ this.hideSaveButton();
340
+ this.hideNextButton();
341
+ this.disableNextButton();
342
+ }
343
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkButtonService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
344
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkButtonService }); }
345
+ }
346
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkButtonService, decorators: [{
347
+ type: Injectable
348
+ }] });
349
+
350
+ /*
351
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
352
+ *
353
+ * Licensed under EUPL, Version 1.2 (the "License");
354
+ * you may not use this file except in compliance with the License.
355
+ * You may obtain a copy of the License at
356
+ *
357
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
358
+ *
359
+ * Unless required by applicable law or agreed to in writing, software
360
+ * distributed under the License is distributed on an "AS IS" basis,
361
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
362
+ * See the License for the specific language governing permissions and
363
+ * limitations under the License.
364
+ */
365
+ class ProcessLinkStepService {
366
+ get steps$() {
367
+ return combineLatest([
368
+ this._steps$,
369
+ this._disableSteps$,
370
+ this.translateService.stream('key'),
371
+ ]).pipe(filter(([steps]) => !!steps), map$1(([steps, disableSteps]) => steps.map(step => ({
372
+ ...step,
373
+ disabled: disableSteps,
374
+ label: this.translateService.instant(`processLinkSteps.${step.label}`),
375
+ ...(step.secondaryLabel && {
376
+ secondaryLabel: this.translateService.instant(step.secondaryLabel),
377
+ }),
378
+ }))));
379
+ }
380
+ get currentStepIndex$() {
381
+ return this._currentStepIndex$.asObservable();
382
+ }
383
+ get currentStepId$() {
384
+ return combineLatest([this._steps$, this.currentStepIndex$]).pipe(filter(([steps, currentStepIndex]) => !!steps && typeof currentStepIndex === 'number'), map$1(([steps, currentStepIndex]) => steps.length > 0 ? steps[currentStepIndex]?.label : ''));
385
+ }
386
+ get hasOneProcessLinkType$() {
387
+ return this._hasOneProcessLinkType$.asObservable();
388
+ }
389
+ constructor(translateService, buttonService, pluginStateService, pluginTranslateService) {
390
+ this.translateService = translateService;
391
+ this.buttonService = buttonService;
392
+ this.pluginStateService = pluginStateService;
393
+ this.pluginTranslateService = pluginTranslateService;
394
+ this._steps$ = new BehaviorSubject(undefined);
395
+ this._currentStepIndex$ = new BehaviorSubject(0);
396
+ this._disableSteps$ = new BehaviorSubject(false);
397
+ this._hasOneProcessLinkType$ = new BehaviorSubject(false);
398
+ }
399
+ reset() {
400
+ this._currentStepIndex$.next(0);
401
+ this._steps$.next([]);
402
+ }
403
+ setInitialSteps(availableProcessLinkTypes) {
404
+ if (availableProcessLinkTypes.length > 1) {
405
+ this.setChoiceSteps();
406
+ }
407
+ }
408
+ setFormSteps() {
409
+ this._steps$.next([
410
+ { label: 'chooseProcessLinkType', secondaryLabel: 'processLinkType.form' },
411
+ { label: 'selectForm' },
412
+ ]);
413
+ this._currentStepIndex$.next(1);
414
+ }
415
+ setSingleFormStep() {
416
+ this._steps$.next([{ label: 'selectForm' }]);
417
+ this._currentStepIndex$.next(0);
418
+ }
419
+ setFormFlowSteps() {
420
+ this._steps$.next([
421
+ { label: 'chooseProcessLinkType', secondaryLabel: 'processLinkType.form-flow' },
422
+ { label: 'selectFormFlow' },
423
+ ]);
424
+ this._currentStepIndex$.next(1);
425
+ }
426
+ setSingleFormFlowStep() {
427
+ this._steps$.next([{ label: 'selectFormFlow' }]);
428
+ this._currentStepIndex$.next(0);
429
+ }
430
+ setChoosePluginConfigurationSteps() {
431
+ this._steps$.next([
432
+ { label: 'chooseProcessLinkType', secondaryLabel: 'processLinkType.plugin' },
433
+ { label: 'choosePluginConfiguration' },
434
+ { label: 'choosePluginAction', disabled: true },
435
+ { label: 'configurePluginAction', disabled: true },
436
+ ]);
437
+ this._currentStepIndex$.next(1);
438
+ }
439
+ setSingleChoosePluginConfigurationSteps() {
440
+ this._steps$.next([
441
+ { label: 'choosePluginConfiguration' },
442
+ { label: 'choosePluginAction', disabled: true },
443
+ { label: 'configurePluginAction', disabled: true },
444
+ ]);
445
+ this._currentStepIndex$.next(0);
446
+ }
447
+ setChoosePluginActionSteps() {
448
+ combineLatest([
449
+ this._hasOneProcessLinkType$,
450
+ this.pluginStateService.selectedPluginConfiguration$,
451
+ ])
452
+ .pipe(take(1))
453
+ .subscribe(([hasOneType, selectedConfiguration]) => {
454
+ if (hasOneType) {
455
+ this._steps$.next([
456
+ { label: 'choosePluginConfiguration', secondaryLabel: selectedConfiguration.title },
457
+ { label: 'choosePluginAction' },
458
+ { label: 'configurePluginAction', disabled: true },
459
+ ]);
460
+ this._currentStepIndex$.next(1);
461
+ this.buttonService.showNextButton();
462
+ this.buttonService.showBackButton();
463
+ this.buttonService.hideSaveButton();
464
+ this.buttonService.disableNextButton();
465
+ }
466
+ else {
467
+ this._steps$.next([
468
+ { label: 'chooseProcessLinkType', secondaryLabel: 'processLinkType.plugin' },
469
+ { label: 'choosePluginConfiguration', secondaryLabel: selectedConfiguration.title },
470
+ { label: 'choosePluginAction' },
471
+ { label: 'configurePluginAction', disabled: true },
472
+ ]);
473
+ this._currentStepIndex$.next(2);
474
+ this.buttonService.showNextButton();
475
+ this.buttonService.showBackButton();
476
+ this.buttonService.hideSaveButton();
477
+ this.buttonService.disableNextButton();
478
+ }
479
+ });
480
+ }
481
+ setConfigurePluginActionSteps() {
482
+ combineLatest([
483
+ this._hasOneProcessLinkType$,
484
+ this.pluginStateService.selectedPluginConfiguration$,
485
+ this.pluginStateService.selectedPluginFunction$,
486
+ ])
487
+ .pipe(take(1))
488
+ .subscribe(([hasOneType, selectedConfiguration, selectedFunction]) => {
489
+ const selectedFunctionTranslation = this.pluginTranslateService.instant(selectedFunction.key, selectedConfiguration.pluginDefinition.key);
490
+ if (hasOneType) {
491
+ this._steps$.next([
492
+ { label: 'choosePluginConfiguration', secondaryLabel: selectedConfiguration.title },
493
+ { label: 'choosePluginAction', secondaryLabel: selectedFunctionTranslation },
494
+ { label: 'configurePluginAction' },
495
+ ]);
496
+ this._currentStepIndex$.next(2);
497
+ this.buttonService.hideNextButton();
498
+ this.buttonService.showSaveButton();
499
+ }
500
+ else {
501
+ this._steps$.next([
502
+ { label: 'chooseProcessLinkType', secondaryLabel: 'processLinkType.plugin' },
503
+ { label: 'choosePluginConfiguration', secondaryLabel: selectedConfiguration.title },
504
+ { label: 'choosePluginAction', secondaryLabel: selectedFunctionTranslation },
505
+ { label: 'configurePluginAction' },
506
+ ]);
507
+ this._currentStepIndex$.next(3);
508
+ this.buttonService.hideNextButton();
509
+ this.buttonService.showSaveButton();
510
+ }
511
+ });
512
+ }
513
+ disableSteps() {
514
+ this._disableSteps$.next(true);
515
+ }
516
+ enableSteps() {
517
+ this._disableSteps$.next(false);
518
+ }
519
+ setHasOneProcessLinkType(hasOne) {
520
+ this._hasOneProcessLinkType$.next(hasOne);
521
+ }
522
+ setProcessLinkTypeSteps(processLinkTypeId, hasOneOption) {
523
+ switch (processLinkTypeId) {
524
+ case 'form':
525
+ if (hasOneOption) {
526
+ this.setSingleFormStep();
527
+ this.buttonService.hideSaveButton();
528
+ this.buttonService.hideBackButton();
529
+ }
530
+ else {
531
+ this.setFormSteps();
532
+ this.buttonService.showSaveButton();
533
+ this.buttonService.showBackButton();
534
+ }
535
+ break;
536
+ case 'form-flow':
537
+ if (hasOneOption) {
538
+ this.setSingleFormFlowStep();
539
+ this.buttonService.hideSaveButton();
540
+ this.buttonService.hideBackButton();
541
+ }
542
+ else {
543
+ this.setFormFlowSteps();
544
+ this.buttonService.showSaveButton();
545
+ this.buttonService.showBackButton();
546
+ }
547
+ break;
548
+ case 'plugin':
549
+ if (hasOneOption) {
550
+ this.setSingleChoosePluginConfigurationSteps();
551
+ this.buttonService.hideBackButton();
552
+ this.buttonService.showNextButton();
553
+ }
554
+ else {
555
+ this.setChoosePluginConfigurationSteps();
556
+ this.buttonService.showBackButton();
557
+ this.buttonService.showNextButton();
558
+ }
559
+ break;
560
+ }
561
+ }
562
+ setChoiceSteps() {
563
+ this._steps$.next([
564
+ { label: 'chooseProcessLinkType' },
565
+ { label: 'empty', disabled: true },
566
+ { label: 'empty', disabled: true },
567
+ ]);
568
+ this._currentStepIndex$.next(0);
569
+ }
570
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkStepService, deps: [{ token: i6.TranslateService }, { token: ProcessLinkButtonService }, { token: PluginStateService }, { token: i1$1.PluginTranslationService }], target: i0.ɵɵFactoryTarget.Injectable }); }
571
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkStepService }); }
572
+ }
573
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkStepService, decorators: [{
574
+ type: Injectable
575
+ }], ctorParameters: () => [{ type: i6.TranslateService }, { type: ProcessLinkButtonService }, { type: PluginStateService }, { type: i1$1.PluginTranslationService }] });
576
+
577
+ /*
578
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
579
+ *
580
+ * Licensed under EUPL, Version 1.2 (the "License");
581
+ * you may not use this file except in compliance with the License.
582
+ * You may obtain a copy of the License at
583
+ *
584
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
585
+ *
586
+ * Unless required by applicable law or agreed to in writing, software
587
+ * distributed under the License is distributed on an "AS IS" basis,
588
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
589
+ * See the License for the specific language governing permissions and
590
+ * limitations under the License.
591
+ */
592
+ class ProcessLinkStateService {
593
+ get showModal$() {
594
+ return this._showModal$.asObservable();
595
+ }
596
+ get elementName$() {
597
+ return this._elementName$.asObservable();
598
+ }
599
+ get availableProcessLinkTypes$() {
600
+ return this._availableProcessLinkTypes$.asObservable();
601
+ }
602
+ get hideProgressIndicator$() {
603
+ return this._availableProcessLinkTypes$
604
+ .asObservable()
605
+ .pipe(map$1(availableTypes => Array.isArray(availableTypes) &&
606
+ availableTypes.length === 1 &&
607
+ (availableTypes[0]?.processLinkType === 'form' ||
608
+ availableTypes[0]?.processLinkType === 'form-flow')));
609
+ }
610
+ get selectedProcessLinkTypeId$() {
611
+ return this._selectedProcessLinkTypeId$.asObservable();
612
+ }
613
+ get saving$() {
614
+ return this._saving$.asObservable();
615
+ }
616
+ get modalParams$() {
617
+ return this._modalParams$.asObservable();
618
+ }
619
+ get selectedProcessLink$() {
620
+ return this._selectedProcessLink$.asObservable();
621
+ }
622
+ get typeOfSelectedProcessLink$() {
623
+ return this.selectedProcessLink$.pipe(map$1(processLink => processLink?.processLinkType || ''));
624
+ }
625
+ constructor(processLinkStepService, buttonService, pluginStateService) {
626
+ this.processLinkStepService = processLinkStepService;
627
+ this.buttonService = buttonService;
628
+ this.pluginStateService = pluginStateService;
629
+ this._showModal$ = new BehaviorSubject(false);
630
+ this._availableProcessLinkTypes$ = new BehaviorSubject([]);
631
+ this._elementName$ = new BehaviorSubject('');
632
+ this._selectedProcessLinkTypeId$ = new BehaviorSubject('');
633
+ this._saving$ = new BehaviorSubject(false);
634
+ this._modalParams$ = new BehaviorSubject(undefined);
635
+ this._selectedProcessLink$ = new BehaviorSubject(undefined);
636
+ this.openAvailableProcessLinkTypesSubscription();
637
+ }
638
+ ngOnDestroy() {
639
+ this._availableProcessLinkTypesSubscription?.unsubscribe();
640
+ }
641
+ setAvailableProcessLinkTypes(processLinkTypes) {
642
+ const hasOneOption = processLinkTypes.length === 1;
643
+ this._availableProcessLinkTypes$.next(processLinkTypes);
644
+ this.processLinkStepService.setHasOneProcessLinkType(hasOneOption);
645
+ if (hasOneOption) {
646
+ this.selectProcessLinkType(processLinkTypes[0].processLinkType, hasOneOption);
647
+ }
648
+ }
649
+ setElementName(name) {
650
+ this._elementName$.next(name);
651
+ }
652
+ showModal() {
653
+ this._showModal$.next(true);
654
+ }
655
+ closeModal() {
656
+ this._showModal$.next(false);
657
+ setTimeout(() => {
658
+ this.reset();
659
+ }, 240);
660
+ }
661
+ selectProcessLinkType(processLinkTypeId, hasOneOption) {
662
+ this._selectedProcessLinkTypeId$.next(processLinkTypeId);
663
+ this.processLinkStepService.setProcessLinkTypeSteps(processLinkTypeId, hasOneOption);
664
+ }
665
+ clearSelectedProcessLinkType() {
666
+ this._selectedProcessLinkTypeId$.next('');
667
+ }
668
+ startSaving() {
669
+ this._saving$.next(true);
670
+ this.processLinkStepService.disableSteps();
671
+ }
672
+ stopSaving() {
673
+ this._saving$.next(false);
674
+ this.processLinkStepService.enableSteps();
675
+ }
676
+ setInitial() {
677
+ const availableTypes = this._availableProcessLinkTypes$.getValue();
678
+ this.buttonService.resetButtons();
679
+ this.processLinkStepService.setInitialSteps(availableTypes);
680
+ }
681
+ setModalParams(params) {
682
+ this._modalParams$.next(params);
683
+ }
684
+ selectProcessLink(processLink) {
685
+ this._selectedProcessLink$.next(processLink);
686
+ this.pluginStateService.selectProcessLink(processLink);
687
+ }
688
+ deselectProcessLink() {
689
+ this._selectedProcessLink$.next(undefined);
690
+ this.pluginStateService.deselectProcessLink();
691
+ }
692
+ openAvailableProcessLinkTypesSubscription() {
693
+ this._availableProcessLinkTypesSubscription = this._availableProcessLinkTypes$.subscribe(availableProcessLinkTypes => {
694
+ if (availableProcessLinkTypes.length > 1) {
695
+ this.setInitial();
696
+ }
697
+ });
698
+ }
699
+ reset() {
700
+ this.setAvailableProcessLinkTypes([]);
701
+ this.processLinkStepService.reset();
702
+ this.stopSaving();
703
+ this.buttonService.resetButtons();
704
+ this.clearSelectedProcessLinkType();
705
+ this.deselectProcessLink();
706
+ }
707
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkStateService, deps: [{ token: ProcessLinkStepService }, { token: ProcessLinkButtonService }, { token: PluginStateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
708
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkStateService }); }
709
+ }
710
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkStateService, decorators: [{
711
+ type: Injectable
712
+ }], ctorParameters: () => [{ type: ProcessLinkStepService }, { type: ProcessLinkButtonService }, { type: PluginStateService }] });
713
+
714
+ /*
715
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
716
+ *
717
+ * Licensed under EUPL, Version 1.2 (the "License");
718
+ * you may not use this file except in compliance with the License.
719
+ * You may obtain a copy of the License at
720
+ *
721
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
722
+ *
723
+ * Unless required by applicable law or agreed to in writing, software
724
+ * distributed under the License is distributed on an "AS IS" basis,
725
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
726
+ * See the License for the specific language governing permissions and
727
+ * limitations under the License.
728
+ */
729
+ const FORM_FLOW_COMPONENT_TOKEN = new InjectionToken('Supported form-flow Angular components', { factory: () => [] });
730
+
731
+ /*
732
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
733
+ *
734
+ * Licensed under EUPL, Version 1.2 (the "License");
735
+ * you may not use this file except in compliance with the License.
736
+ * You may obtain a copy of the License at
737
+ *
738
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
739
+ *
740
+ * Unless required by applicable law or agreed to in writing, software
741
+ * distributed under the License is distributed on an "AS IS" basis,
742
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
743
+ * See the License for the specific language governing permissions and
744
+ * limitations under the License.
745
+ */
746
+
747
+ /*
748
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
749
+ *
750
+ * Licensed under EUPL, Version 1.2 (the "License");
751
+ * you may not use this file except in compliance with the License.
752
+ * You may obtain a copy of the License at
753
+ *
754
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
755
+ *
756
+ * Unless required by applicable law or agreed to in writing, software
757
+ * distributed under the License is distributed on an "AS IS" basis,
758
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
759
+ * See the License for the specific language governing permissions and
760
+ * limitations under the License.
761
+ */
762
+ class FormFlowComponentService {
763
+ get supportedComponents$() {
764
+ return this._supportedComponents$.pipe(filter(components => !!components));
765
+ }
766
+ constructor(supportedCustomComponents) {
767
+ this.supportedCustomComponents = supportedCustomComponents;
768
+ this._supportedComponents$ = new BehaviorSubject(null);
769
+ this.setSupportedComponents(supportedCustomComponents);
770
+ }
771
+ setSupportedComponents(supportedComponents) {
772
+ this._supportedComponents$.next(supportedComponents);
773
+ }
774
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormFlowComponentService, deps: [{ token: FORM_FLOW_COMPONENT_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
775
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormFlowComponentService, providedIn: 'root' }); }
776
+ }
777
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormFlowComponentService, decorators: [{
778
+ type: Injectable,
779
+ args: [{
780
+ providedIn: 'root',
781
+ }]
782
+ }], ctorParameters: () => [{ type: Array, decorators: [{
783
+ type: Inject,
784
+ args: [FORM_FLOW_COMPONENT_TOKEN]
785
+ }] }] });
786
+
787
+ /*
788
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
789
+ *
790
+ * Licensed under EUPL, Version 1.2 (the "License");
791
+ * you may not use this file except in compliance with the License.
792
+ * You may obtain a copy of the License at
793
+ *
794
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
795
+ *
796
+ * Unless required by applicable law or agreed to in writing, software
797
+ * distributed under the License is distributed on an "AS IS" basis,
798
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
799
+ * See the License for the specific language governing permissions and
800
+ * limitations under the License.
801
+ */
802
+
803
+ /*
804
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
805
+ *
806
+ * Licensed under EUPL, Version 1.2 (the "License");
807
+ * you may not use this file except in compliance with the License.
808
+ * You may obtain a copy of the License at
809
+ *
810
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
811
+ *
812
+ * Unless required by applicable law or agreed to in writing, software
813
+ * distributed under the License is distributed on an "AS IS" basis,
814
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
815
+ * See the License for the specific language governing permissions and
816
+ * limitations under the License.
817
+ */
818
+ class SelectPluginConfigurationComponent {
819
+ constructor(pluginManagementService, pluginStateService, pluginService, stateService, buttonService, stepService) {
820
+ this.pluginManagementService = pluginManagementService;
821
+ this.pluginStateService = pluginStateService;
822
+ this.pluginService = pluginService;
823
+ this.stateService = stateService;
824
+ this.buttonService = buttonService;
825
+ this.stepService = stepService;
826
+ this.pluginConfigurations$ = this.stateService.modalParams$.pipe(switchMap$1(modalData => combineLatest([
827
+ modalData?.element?.type
828
+ ? this.pluginManagementService.getAllPluginConfigurationsWithLogos(modalData?.element?.activityListenerType)
829
+ : of(undefined),
830
+ this.pluginService.availablePluginIds$,
831
+ ]).pipe(map(([pluginConfigurations, availablePluginIds]) => pluginConfigurations?.filter(configuration => availablePluginIds.includes(configuration.pluginDefinition.key))))));
832
+ this.selectedPluginConfiguration$ = this.pluginStateService.selectedPluginConfiguration$;
833
+ this._subscriptions = new Subscription();
834
+ }
835
+ ngOnInit() {
836
+ this.openBackButtonSubscription();
837
+ this.openNextButtonSubscription();
838
+ }
839
+ ngOnDestroy() {
840
+ this._subscriptions.unsubscribe();
841
+ }
842
+ selected(event) {
843
+ this.selectConfiguration(event.value);
844
+ this.buttonService.enableNextButton();
845
+ }
846
+ selectConfiguration(configuration) {
847
+ this.pluginStateService.selectPluginDefinition({ key: configuration.pluginDefinition.key });
848
+ this.pluginStateService.selectPluginConfiguration(configuration);
849
+ }
850
+ openBackButtonSubscription() {
851
+ this._subscriptions.add(this.buttonService.backButtonClick$.subscribe(() => {
852
+ this.stateService.setInitial();
853
+ }));
854
+ }
855
+ openNextButtonSubscription() {
856
+ this._subscriptions.add(this.buttonService.nextButtonClick$.subscribe(() => {
857
+ this.stepService.setChoosePluginActionSteps();
858
+ }));
859
+ }
860
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: SelectPluginConfigurationComponent, deps: [{ token: i1$1.PluginManagementService }, { token: PluginStateService }, { token: i1$1.PluginService }, { token: ProcessLinkStateService }, { token: ProcessLinkButtonService }, { token: ProcessLinkStepService }], target: i0.ɵɵFactoryTarget.Component }); }
861
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: SelectPluginConfigurationComponent, selector: "valtimo-select-plugin-configuration", 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<ng-container *ngIf=\"pluginConfigurations$ | async as pluginConfigurations; else loading\">\n <p class=\"step-description\">\n {{ 'processLinkConfiguration.choosePluginConfigurationDescription' | translate }}\n </p>\n <div class=\"list-container\">\n <cds-structured-list (selected)=\"selected($event)\" selection=\"true\">\n <cds-list-header>\n <cds-list-column nowrap=\"true\"></cds-list-column>\n <cds-list-column nowrap=\"true\">{{\n 'pluginManagement.labels.configurationName' | translate\n }}</cds-list-column>\n <cds-list-column>{{\n 'processLinkConfiguration.pluginDescription' | translate\n }}</cds-list-column>\n </cds-list-header>\n <cds-list-row\n *ngFor=\"let pluginConfiguration of pluginConfigurations\"\n [value]=\"pluginConfiguration\"\n >\n <cds-list-column>\n <div *ngIf=\"pluginConfiguration.pluginLogoBase64\">\n <img\n [src]=\"pluginConfiguration.pluginLogoBase64\"\n [title]=\"'title' | pluginTranslate: pluginConfiguration.pluginDefinition.key | async\"\n class=\"plugin-configuration-logo\"\n /></div\n ></cds-list-column>\n <cds-list-column>{{ pluginConfiguration.title }}</cds-list-column>\n <cds-list-column>\n {{ 'description' | pluginTranslate: pluginConfiguration.pluginDefinition.key | async }}\n </cds-list-column>\n </cds-list-row>\n </cds-structured-list>\n </div>\n</ng-container>\n\n<ng-template #loading>\n <div class=\"loading-container\">\n <cds-loading></cds-loading>\n </div>\n</ng-template>\n", styles: [".btn-back{position:absolute}.cards-container{display:flex;flex-flow:row wrap;width:100%}.card{width:calc(33.3% - 20px);margin-right:30px}.card:nth-child(3n+3){margin-right:0}.card-header{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.plugin-configuration-logo{object-fit:contain;height:60px;width:100%;margin-bottom:-.5rem}.loading-container{display:flex;justify-content:center;margin-top:40px;flex-direction:row}.list-container{margin-top:32px;margin-bottom:32px}::ng-deep .list-container .cds--structured-list-td{vertical-align:top}\n/*!\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"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "component", type: i3.StructuredList, selector: "cds-structured-list, ibm-structured-list", inputs: ["selection", "flushed", "condensed", "name", "skeleton"], outputs: ["selected"] }, { kind: "component", type: i3.ListRow, selector: "cds-list-row, ibm-list-row", inputs: ["selected", "label", "value"], outputs: ["change"] }, { kind: "component", type: i3.ListHeader, selector: "cds-list-header, ibm-list-header", inputs: ["skeleton"] }, { kind: "component", type: i3.ListColumn, selector: "cds-list-column, ibm-list-column", inputs: ["skeleton", "nowrap"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1$1.PluginTranslatePipe, name: "pluginTranslate" }] }); }
862
+ }
863
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: SelectPluginConfigurationComponent, decorators: [{
864
+ type: Component,
865
+ args: [{ selector: 'valtimo-select-plugin-configuration', 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<ng-container *ngIf=\"pluginConfigurations$ | async as pluginConfigurations; else loading\">\n <p class=\"step-description\">\n {{ 'processLinkConfiguration.choosePluginConfigurationDescription' | translate }}\n </p>\n <div class=\"list-container\">\n <cds-structured-list (selected)=\"selected($event)\" selection=\"true\">\n <cds-list-header>\n <cds-list-column nowrap=\"true\"></cds-list-column>\n <cds-list-column nowrap=\"true\">{{\n 'pluginManagement.labels.configurationName' | translate\n }}</cds-list-column>\n <cds-list-column>{{\n 'processLinkConfiguration.pluginDescription' | translate\n }}</cds-list-column>\n </cds-list-header>\n <cds-list-row\n *ngFor=\"let pluginConfiguration of pluginConfigurations\"\n [value]=\"pluginConfiguration\"\n >\n <cds-list-column>\n <div *ngIf=\"pluginConfiguration.pluginLogoBase64\">\n <img\n [src]=\"pluginConfiguration.pluginLogoBase64\"\n [title]=\"'title' | pluginTranslate: pluginConfiguration.pluginDefinition.key | async\"\n class=\"plugin-configuration-logo\"\n /></div\n ></cds-list-column>\n <cds-list-column>{{ pluginConfiguration.title }}</cds-list-column>\n <cds-list-column>\n {{ 'description' | pluginTranslate: pluginConfiguration.pluginDefinition.key | async }}\n </cds-list-column>\n </cds-list-row>\n </cds-structured-list>\n </div>\n</ng-container>\n\n<ng-template #loading>\n <div class=\"loading-container\">\n <cds-loading></cds-loading>\n </div>\n</ng-template>\n", styles: [".btn-back{position:absolute}.cards-container{display:flex;flex-flow:row wrap;width:100%}.card{width:calc(33.3% - 20px);margin-right:30px}.card:nth-child(3n+3){margin-right:0}.card-header{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.plugin-configuration-logo{object-fit:contain;height:60px;width:100%;margin-bottom:-.5rem}.loading-container{display:flex;justify-content:center;margin-top:40px;flex-direction:row}.list-container{margin-top:32px;margin-bottom:32px}::ng-deep .list-container .cds--structured-list-td{vertical-align:top}\n/*!\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"] }]
866
+ }], ctorParameters: () => [{ type: i1$1.PluginManagementService }, { type: PluginStateService }, { type: i1$1.PluginService }, { type: ProcessLinkStateService }, { type: ProcessLinkButtonService }, { type: ProcessLinkStepService }] });
867
+
868
+ /*
869
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
870
+ *
871
+ * Licensed under EUPL, Version 1.2 (the "License");
872
+ * you may not use this file except in compliance with the License.
873
+ * You may obtain a copy of the License at
874
+ *
875
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
876
+ *
877
+ * Unless required by applicable law or agreed to in writing, software
878
+ * distributed under the License is distributed on an "AS IS" basis,
879
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
880
+ * See the License for the specific language governing permissions and
881
+ * limitations under the License.
882
+ */
883
+ class SelectPluginActionComponent {
884
+ constructor(buttonService, pluginManagementService, stateService, stepService) {
885
+ this.buttonService = buttonService;
886
+ this.pluginManagementService = pluginManagementService;
887
+ this.stateService = stateService;
888
+ this.stepService = stepService;
889
+ this.pluginFunctions$ = this.stateService.selectedPluginDefinition$.pipe(switchMap$1(selectedDefinition => selectedDefinition
890
+ ? this.pluginManagementService.getPluginFunctions(selectedDefinition.key)
891
+ : of(undefined)));
892
+ this.selectedPluginDefinition$ = this.stateService.selectedPluginDefinition$;
893
+ this.selectedPluginFunction$ = this.stateService.selectedPluginFunction$;
894
+ this._subscriptions = new Subscription();
895
+ }
896
+ ngOnInit() {
897
+ this.openBackButtonSubscription();
898
+ this.openNextButtonSubscription();
899
+ }
900
+ ngOnDestroy() {
901
+ this._subscriptions.unsubscribe();
902
+ }
903
+ selectFunction(pluginFunction) {
904
+ this.stateService.selectPluginFunction(pluginFunction);
905
+ }
906
+ selected(event) {
907
+ this.selectFunction(JSON.parse(event.value));
908
+ this.buttonService.enableNextButton();
909
+ }
910
+ stringify(object) {
911
+ return JSON.stringify(object);
912
+ }
913
+ openBackButtonSubscription() {
914
+ this.buttonService.backButtonClick$
915
+ .pipe(switchMap$1(() => this.stepService.hasOneProcessLinkType$), take(1))
916
+ .subscribe((hasOneOption) => {
917
+ this.stepService.setProcessLinkTypeSteps('plugin', hasOneOption);
918
+ });
919
+ }
920
+ openNextButtonSubscription() {
921
+ this._subscriptions.add(this.buttonService.nextButtonClick$.subscribe(() => {
922
+ this.stepService.setConfigurePluginActionSteps();
923
+ }));
924
+ }
925
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: SelectPluginActionComponent, deps: [{ token: ProcessLinkButtonService }, { token: i1$1.PluginManagementService }, { token: PluginStateService }, { token: ProcessLinkStepService }], target: i0.ɵɵFactoryTarget.Component }); }
926
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: SelectPluginActionComponent, selector: "valtimo-select-plugin-action", 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<ng-container *ngIf=\"pluginFunctions$ | async as pluginFunctions; else loading\">\n <div class=\"choose-plugin-action\" *ngIf=\"pluginFunctions?.length > 0\">\n <p class=\"step-description\">\n {{ 'processLinkConfiguration.choosePluginActionDescription' | translate }}\n </p>\n <div class=\"action-tiles\">\n <cds-tile-group\n [multiple]=\"false\"\n *ngIf=\"{selectedPluginDefinition: selectedPluginDefinition$ | async} as obs\"\n (selected)=\"selected($event)\"\n >\n <cds-selection-tile\n *ngFor=\"let pluginFunction of pluginFunctions\"\n [value]=\"stringify(pluginFunction)\"\n [selected]=\"false\"\n >{{\n pluginFunction.key | pluginTranslate: obs.selectedPluginDefinition.key | async\n }}</cds-selection-tile\n >\n </cds-tile-group>\n </div>\n </div>\n <ng-container *ngIf=\"!pluginFunctions || pluginFunctions?.length === 0\">\n <ng-container *ngTemplateOutlet=\"noPluginFunctionsTemplate\"> </ng-container>\n </ng-container>\n</ng-container>\n\n<ng-template #noPluginFunctionsTemplate>\n <p class=\"step-description\">\n {{ 'processLink.noPluginFunctions' | translate }}\n </p>\n</ng-template>\n\n<ng-template #loading>\n <div class=\"loading-container\">\n <cds-loading></cds-loading>\n </div>\n</ng-template>\n", styles: [".btn-back{position:absolute}.cards-container{display:flex;flex-flow:row wrap;width:100%}.card{width:calc(33.3% - 20px);margin-right:30px}.card:nth-child(3n+3){margin-right:0}.card-header{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.loading-container{display:flex;justify-content:center;margin-top:40px;flex-direction:row}.action-tiles{margin-top:24px;width:calc(100% + 8px);margin-left:-8px}::ng-deep .choose-plugin-action cds-selection-tile{display:flex;width:calc(33.3% - 8px)}::ng-deep .choose-plugin-action .cds--tile{width:100%}::ng-deep .choose-plugin-action cds-tile-group fieldset{display:flex;flex-direction:row;flex-wrap:wrap}::ng-deep .choose-plugin-action cds-selection-tile{margin-left:8px}::ng-deep .choose-plugin-action cds-selection-tile:nth-child(n+4){margin-top:8px}::ng-deep .action-tiles .cds--tile{background-color:var(--cds-layer-02, #ffffff)}::ng-deep .action-tiles .cds--tile:hover{background:var(--cds-layer-hover)}\n/*!\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"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "component", type: i3.SelectionTile, selector: "cds-selection-tile, ibm-selection-tile", inputs: ["theme", "id", "selected", "value", "disabled"], outputs: ["change"] }, { kind: "component", type: i3.TileGroup, selector: "cds-tile-group, ibm-tile-group", inputs: ["name", "multiple", "legend"], outputs: ["selected"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1$1.PluginTranslatePipe, name: "pluginTranslate" }] }); }
927
+ }
928
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: SelectPluginActionComponent, decorators: [{
929
+ type: Component,
930
+ args: [{ selector: 'valtimo-select-plugin-action', 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<ng-container *ngIf=\"pluginFunctions$ | async as pluginFunctions; else loading\">\n <div class=\"choose-plugin-action\" *ngIf=\"pluginFunctions?.length > 0\">\n <p class=\"step-description\">\n {{ 'processLinkConfiguration.choosePluginActionDescription' | translate }}\n </p>\n <div class=\"action-tiles\">\n <cds-tile-group\n [multiple]=\"false\"\n *ngIf=\"{selectedPluginDefinition: selectedPluginDefinition$ | async} as obs\"\n (selected)=\"selected($event)\"\n >\n <cds-selection-tile\n *ngFor=\"let pluginFunction of pluginFunctions\"\n [value]=\"stringify(pluginFunction)\"\n [selected]=\"false\"\n >{{\n pluginFunction.key | pluginTranslate: obs.selectedPluginDefinition.key | async\n }}</cds-selection-tile\n >\n </cds-tile-group>\n </div>\n </div>\n <ng-container *ngIf=\"!pluginFunctions || pluginFunctions?.length === 0\">\n <ng-container *ngTemplateOutlet=\"noPluginFunctionsTemplate\"> </ng-container>\n </ng-container>\n</ng-container>\n\n<ng-template #noPluginFunctionsTemplate>\n <p class=\"step-description\">\n {{ 'processLink.noPluginFunctions' | translate }}\n </p>\n</ng-template>\n\n<ng-template #loading>\n <div class=\"loading-container\">\n <cds-loading></cds-loading>\n </div>\n</ng-template>\n", styles: [".btn-back{position:absolute}.cards-container{display:flex;flex-flow:row wrap;width:100%}.card{width:calc(33.3% - 20px);margin-right:30px}.card:nth-child(3n+3){margin-right:0}.card-header{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.loading-container{display:flex;justify-content:center;margin-top:40px;flex-direction:row}.action-tiles{margin-top:24px;width:calc(100% + 8px);margin-left:-8px}::ng-deep .choose-plugin-action cds-selection-tile{display:flex;width:calc(33.3% - 8px)}::ng-deep .choose-plugin-action .cds--tile{width:100%}::ng-deep .choose-plugin-action cds-tile-group fieldset{display:flex;flex-direction:row;flex-wrap:wrap}::ng-deep .choose-plugin-action cds-selection-tile{margin-left:8px}::ng-deep .choose-plugin-action cds-selection-tile:nth-child(n+4){margin-top:8px}::ng-deep .action-tiles .cds--tile{background-color:var(--cds-layer-02, #ffffff)}::ng-deep .action-tiles .cds--tile:hover{background:var(--cds-layer-hover)}\n/*!\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"] }]
931
+ }], ctorParameters: () => [{ type: ProcessLinkButtonService }, { type: i1$1.PluginManagementService }, { type: PluginStateService }, { type: ProcessLinkStepService }] });
932
+
933
+ /*
934
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
935
+ *
936
+ * Licensed under EUPL, Version 1.2 (the "License");
937
+ * you may not use this file except in compliance with the License.
938
+ * You may obtain a copy of the License at
939
+ *
940
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
941
+ *
942
+ * Unless required by applicable law or agreed to in writing, software
943
+ * distributed under the License is distributed on an "AS IS" basis,
944
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
945
+ * See the License for the specific language governing permissions and
946
+ * limitations under the License.
947
+ */
948
+ class PluginActionConfigurationComponent {
949
+ constructor(stateService, pluginStateService, buttonService, stepService, processLinkService) {
950
+ this.stateService = stateService;
951
+ this.pluginStateService = pluginStateService;
952
+ this.buttonService = buttonService;
953
+ this.stepService = stepService;
954
+ this.processLinkService = processLinkService;
955
+ this.valid = new EventEmitter();
956
+ this.configuration = new EventEmitter();
957
+ this.pluginDefinitionKey$ = this.pluginStateService.pluginDefinitionKey$;
958
+ this.functionKey$ = this.pluginStateService.functionKey$;
959
+ this.save$ = this.pluginStateService.save$;
960
+ this.saving$ = this.stateService.saving$;
961
+ this.prefillConfiguration$ = this.stateService.selectedProcessLink$.pipe(map(processLink => (processLink ? processLink?.actionProperties : undefined)));
962
+ this._subscriptions = new Subscription();
963
+ }
964
+ ngOnInit() {
965
+ this.openBackButtonSubscription();
966
+ this.openSaveButtonSubscription();
967
+ }
968
+ ngOnDestroy() {
969
+ this._subscriptions.unsubscribe();
970
+ }
971
+ onValid(valid) {
972
+ if (valid) {
973
+ this.buttonService.enableSaveButton();
974
+ }
975
+ else {
976
+ this.buttonService.disableSaveButton();
977
+ }
978
+ }
979
+ onConfiguration(configuration) {
980
+ this.stateService.startSaving();
981
+ this.stateService.selectedProcessLink$.pipe(take(1)).subscribe(selectedProcessLink => {
982
+ if (selectedProcessLink) {
983
+ this.updateProcessLink(configuration);
984
+ }
985
+ else {
986
+ this.saveNewProcessLink(configuration);
987
+ }
988
+ });
989
+ }
990
+ updateProcessLink(configuration) {
991
+ this.stateService.selectedProcessLink$.pipe(take(1)).subscribe(selectedProcessLink => {
992
+ const updateProcessLinkRequest = {
993
+ id: selectedProcessLink.id,
994
+ pluginConfigurationId: selectedProcessLink.pluginConfigurationId,
995
+ pluginActionDefinitionKey: selectedProcessLink.pluginActionDefinitionKey,
996
+ actionProperties: configuration,
997
+ };
998
+ this.processLinkService.updateProcessLink(updateProcessLinkRequest).subscribe(() => {
999
+ this.stateService.closeModal();
1000
+ }, () => {
1001
+ this.stateService.stopSaving();
1002
+ });
1003
+ });
1004
+ }
1005
+ saveNewProcessLink(configuration) {
1006
+ combineLatest([
1007
+ this.stateService.modalParams$,
1008
+ this.pluginStateService.selectedPluginConfiguration$,
1009
+ this.pluginStateService.selectedPluginFunction$,
1010
+ this.stateService.selectedProcessLinkTypeId$,
1011
+ ])
1012
+ .pipe(take(1))
1013
+ .subscribe(([modalData, selectedConfiguration, selectedFunction, selectedProcessLinkTypeId]) => {
1014
+ const processLinkRequest = {
1015
+ actionProperties: configuration,
1016
+ activityId: modalData?.element?.id,
1017
+ activityType: modalData?.element?.activityListenerType,
1018
+ pluginConfigurationId: selectedConfiguration.id,
1019
+ processDefinitionId: modalData?.processDefinitionId,
1020
+ pluginActionDefinitionKey: selectedFunction.key,
1021
+ processLinkType: selectedProcessLinkTypeId,
1022
+ };
1023
+ this.processLinkService.saveProcessLink(processLinkRequest).subscribe(response => {
1024
+ this.stateService.closeModal();
1025
+ }, () => {
1026
+ this.stateService.stopSaving();
1027
+ });
1028
+ });
1029
+ }
1030
+ openBackButtonSubscription() {
1031
+ this._subscriptions.add(this.buttonService.backButtonClick$.subscribe(() => {
1032
+ this.stepService.setChoosePluginActionSteps();
1033
+ }));
1034
+ }
1035
+ openSaveButtonSubscription() {
1036
+ this._subscriptions.add(this.buttonService.saveButtonClick$.subscribe(() => {
1037
+ this.pluginStateService.save();
1038
+ }));
1039
+ }
1040
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: PluginActionConfigurationComponent, deps: [{ token: ProcessLinkStateService }, { token: PluginStateService }, { token: ProcessLinkButtonService }, { token: ProcessLinkStepService }, { token: ProcessLinkService }], target: i0.ɵɵFactoryTarget.Component }); }
1041
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: PluginActionConfigurationComponent, selector: "valtimo-plugin-action-configuration", outputs: { valid: "valid", configuration: "configuration" }, 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<valtimo-plugin-configuration-container\n [pluginDefinitionKey]=\"pluginDefinitionKey$ | async\"\n [functionKey]=\"functionKey$ | async\"\n [save$]=\"save$\"\n [disabled$]=\"saving$\"\n [prefillConfiguration$]=\"prefillConfiguration$\"\n (valid)=\"onValid($event)\"\n (configuration)=\"onConfiguration($event)\"\n type=\"function\"\n></valtimo-plugin-configuration-container>\n", styles: ["/*!\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"], dependencies: [{ kind: "component", type: i1$1.PluginConfigurationContainerComponent, selector: "valtimo-plugin-configuration-container", inputs: ["type", "pluginDefinitionKey", "functionKey", "save$", "disabled$", "prefillConfiguration$"], outputs: ["valid", "configuration"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }] }); }
1042
+ }
1043
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: PluginActionConfigurationComponent, decorators: [{
1044
+ type: Component,
1045
+ args: [{ selector: 'valtimo-plugin-action-configuration', 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<valtimo-plugin-configuration-container\n [pluginDefinitionKey]=\"pluginDefinitionKey$ | async\"\n [functionKey]=\"functionKey$ | async\"\n [save$]=\"save$\"\n [disabled$]=\"saving$\"\n [prefillConfiguration$]=\"prefillConfiguration$\"\n (valid)=\"onValid($event)\"\n (configuration)=\"onConfiguration($event)\"\n type=\"function\"\n></valtimo-plugin-configuration-container>\n", styles: ["/*!\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"] }]
1046
+ }], ctorParameters: () => [{ type: ProcessLinkStateService }, { type: PluginStateService }, { type: ProcessLinkButtonService }, { type: ProcessLinkStepService }, { type: ProcessLinkService }], propDecorators: { valid: [{
1047
+ type: Output
1048
+ }], configuration: [{
1049
+ type: Output
1050
+ }] } });
1051
+
1052
+ /*
1053
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
1054
+ *
1055
+ * Licensed under EUPL, Version 1.2 (the "License");
1056
+ * you may not use this file except in compliance with the License.
1057
+ * You may obtain a copy of the License at
1058
+ *
1059
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1060
+ *
1061
+ * Unless required by applicable law or agreed to in writing, software
1062
+ * distributed under the License is distributed on an "AS IS" basis,
1063
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1064
+ * See the License for the specific language governing permissions and
1065
+ * limitations under the License.
1066
+ */
1067
+ class FormLinkProcessDiagramComponent {
1068
+ constructor(processService, route, pageTitleService) {
1069
+ this.processService = processService;
1070
+ this.route = route;
1071
+ this.pageTitleService = pageTitleService;
1072
+ this.bpmnElementModalOpen = new EventEmitter();
1073
+ this.bpmnElementModalClose = new EventEmitter();
1074
+ this.callbacksAdded = false;
1075
+ }
1076
+ ngOnInit() {
1077
+ this.pageTitleService.disableReset();
1078
+ combineLatest([this.route.queryParams, this.processService.getProcessDefinitions()])
1079
+ .pipe(map(([queryParams, processDefinitions]) => ({ queryParams, processDefinitions })))
1080
+ .subscribe(response => {
1081
+ this.processDefinitions = response.processDefinitions;
1082
+ if (response.queryParams.process) {
1083
+ this.processDefinitionKey = response.queryParams.process;
1084
+ this.loadProcessDefinitionFromKey(this.processDefinitionKey);
1085
+ this.bpmnElementModalOpen.emit({
1086
+ element: {
1087
+ id: 'start-event',
1088
+ type: 'bpmn:StartEvent',
1089
+ },
1090
+ processDefinitionKey: this.processDefinitionKey,
1091
+ processDefinitionId: this.processDefinitionId,
1092
+ });
1093
+ }
1094
+ if (!this.processDefinitionKey && response.processDefinitions.length !== 0) {
1095
+ this.processDefinitionKey = response.processDefinitions[0].key;
1096
+ this.loadProcessDefinitionFromKey(this.processDefinitionKey);
1097
+ }
1098
+ });
1099
+ this.bpmnJS = new BpmnJS();
1100
+ this.bpmnJS.on('import.done', ({ error }) => {
1101
+ if (!error) {
1102
+ const canvas = this.bpmnJS.get('canvas');
1103
+ const eventBus = this.bpmnJS.get('eventBus');
1104
+ canvas.zoom('fit-viewport', 'auto');
1105
+ if (this.processDefinitionVersions && !this.callbacksAdded) {
1106
+ eventBus.on('element.click', e => {
1107
+ let activityListenerType = e.element.businessObject.$type;
1108
+ if (activityListenerType === 'bpmn:UserTask') {
1109
+ activityListenerType += ':create';
1110
+ }
1111
+ else {
1112
+ activityListenerType += ':start';
1113
+ }
1114
+ this.bpmnElementModalOpen.emit({
1115
+ element: {
1116
+ id: e.element.businessObject.id,
1117
+ type: e.element.businessObject.$type,
1118
+ activityListenerType,
1119
+ name: e.element?.businessObject?.name,
1120
+ },
1121
+ processDefinitionKey: this.processDefinitionKey,
1122
+ processDefinitionId: this.processDefinitionId,
1123
+ });
1124
+ });
1125
+ this.callbacksAdded = true;
1126
+ }
1127
+ }
1128
+ });
1129
+ }
1130
+ ngOnDestroy() {
1131
+ this.bpmnElementModalClose.emit();
1132
+ if (this.bpmnJS) {
1133
+ this.bpmnJS.destroy();
1134
+ }
1135
+ this.pageTitleService.enableReset();
1136
+ }
1137
+ loadProcessDefinition(processDefinitionKey) {
1138
+ this.processService
1139
+ .getProcessDefinition(processDefinitionKey)
1140
+ .subscribe((processDefinition) => {
1141
+ this.processDefinitionId = processDefinition.id;
1142
+ this.version = processDefinition.version;
1143
+ this.loadProcessDefinitionXml(processDefinition.id);
1144
+ });
1145
+ }
1146
+ loadProcessDefinitionVersions(processDefinitionKey) {
1147
+ this.processService
1148
+ .getProcessDefinitionVersions(processDefinitionKey)
1149
+ .subscribe((processDefinitionVersions) => {
1150
+ this.processDefinitionVersions = processDefinitionVersions;
1151
+ });
1152
+ }
1153
+ loadProcessDefinitionFromKey(processDefinitionKey) {
1154
+ this.loadProcessDefinitionVersions(processDefinitionKey);
1155
+ this.loadProcessDefinition(processDefinitionKey);
1156
+ }
1157
+ loadProcessDefinitionXml(processDefinitionId) {
1158
+ this.processService.getProcessDefinitionXml(processDefinitionId).subscribe(response => {
1159
+ this.processDiagram = response;
1160
+ this.bpmnJS.importXML(this.processDiagram.bpmn20Xml);
1161
+ this.bpmnJS.attachTo(this.el.nativeElement);
1162
+ });
1163
+ }
1164
+ setProcessDefinitionKey(processDefinitionKey) {
1165
+ this.processDefinitionKey = processDefinitionKey;
1166
+ this.loadProcessDefinitionFromKey(this.processDefinitionKey);
1167
+ }
1168
+ setProcessDefinitionVersion(version) {
1169
+ const processDefinitionId = this.processDefinitionVersions.find(definition => definition.version === +version)?.id;
1170
+ if (processDefinitionId) {
1171
+ this.processDefinitionId = processDefinitionId;
1172
+ this.loadProcessDefinitionXml(this.processDefinitionId);
1173
+ }
1174
+ this.version = +version;
1175
+ }
1176
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormLinkProcessDiagramComponent, deps: [{ token: i1$2.ProcessService }, { token: i2$2.ActivatedRoute }, { token: i2$3.PageTitleService }], target: i0.ɵɵFactoryTarget.Component }); }
1177
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: FormLinkProcessDiagramComponent, selector: "valtimo-form-link-process-diagram", outputs: { bpmnElementModalOpen: "bpmnElementModalOpen", bpmnElementModalClose: "bpmnElementModalClose" }, viewQueries: [{ propertyName: "el", first: true, predicate: ["ref"], 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 class=\"container-fluid\">\n <div class=\"row p-4 bg-white\">\n <div class=\"col\">\n <div #ref class=\"diagram-container\"></div>\n </div>\n </div>\n</div>\n<div class=\"p-4 text-center legenda-holder\">\n <span>Click on a User Task to specify a form definition for that User Task.</span>\n</div>\n\n<ng-container renderInPageHeader [fullWidth]=\"true\">\n <ng-template>\n <div class=\"form-link-dossier-actions\">\n <cds-select [label]=\"'Process'\" (change)=\"setProcessDefinitionKey($event.target.value)\"\n ><option\n *ngFor=\"let processDefinition of processDefinitions\"\n [value]=\"processDefinition.key\"\n [selected]=\"processDefinitionKey === processDefinition.key\"\n >\n {{ processDefinition.name }}\n </option>\n </cds-select>\n <cds-select [label]=\"'Version'\" (change)=\"setProcessDefinitionVersion($event.target.value)\">\n <option\n *ngFor=\"let processDefinitionVersion of processDefinitionVersions\"\n [value]=\"processDefinitionVersion.version\"\n [selected]=\"processDefinitionVersion.version === version\"\n >\n {{ processDefinitionVersion.version }}\n </option>\n </cds-select>\n </div>\n </ng-template>\n</ng-container>\n", styles: [".diagram-container-switch-holder{width:100%;z-index:1000}.diagram-container{height:58vh}.container-fluid{border:1px solid #dee2e6}.options{border-bottom:1px solid #dee2e6}.form-link-dossier-actions{display:flex;flex-direction:row;gap:8px}\n/*!\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"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i5.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2$3.RenderInPageHeaderDirective, selector: "[renderInPageHeader]", inputs: ["fullWidth"] }, { kind: "component", type: i3.Select, selector: "cds-select, ibm-select", inputs: ["display", "label", "helperText", "invalidText", "warn", "warnText", "id", "size", "disabled", "skeleton", "invalid", "theme", "ariaLabel", "value"], outputs: ["valueChange"] }, { kind: "directive", type: i3.Option, selector: "option" }] }); }
1178
+ }
1179
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormLinkProcessDiagramComponent, decorators: [{
1180
+ type: Component,
1181
+ args: [{ selector: 'valtimo-form-link-process-diagram', 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 class=\"container-fluid\">\n <div class=\"row p-4 bg-white\">\n <div class=\"col\">\n <div #ref class=\"diagram-container\"></div>\n </div>\n </div>\n</div>\n<div class=\"p-4 text-center legenda-holder\">\n <span>Click on a User Task to specify a form definition for that User Task.</span>\n</div>\n\n<ng-container renderInPageHeader [fullWidth]=\"true\">\n <ng-template>\n <div class=\"form-link-dossier-actions\">\n <cds-select [label]=\"'Process'\" (change)=\"setProcessDefinitionKey($event.target.value)\"\n ><option\n *ngFor=\"let processDefinition of processDefinitions\"\n [value]=\"processDefinition.key\"\n [selected]=\"processDefinitionKey === processDefinition.key\"\n >\n {{ processDefinition.name }}\n </option>\n </cds-select>\n <cds-select [label]=\"'Version'\" (change)=\"setProcessDefinitionVersion($event.target.value)\">\n <option\n *ngFor=\"let processDefinitionVersion of processDefinitionVersions\"\n [value]=\"processDefinitionVersion.version\"\n [selected]=\"processDefinitionVersion.version === version\"\n >\n {{ processDefinitionVersion.version }}\n </option>\n </cds-select>\n </div>\n </ng-template>\n</ng-container>\n", styles: [".diagram-container-switch-holder{width:100%;z-index:1000}.diagram-container{height:58vh}.container-fluid{border:1px solid #dee2e6}.options{border-bottom:1px solid #dee2e6}.form-link-dossier-actions{display:flex;flex-direction:row;gap:8px}\n/*!\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"] }]
1182
+ }], ctorParameters: () => [{ type: i1$2.ProcessService }, { type: i2$2.ActivatedRoute }, { type: i2$3.PageTitleService }], propDecorators: { el: [{
1183
+ type: ViewChild,
1184
+ args: ['ref']
1185
+ }], bpmnElementModalOpen: [{
1186
+ type: Output
1187
+ }], bpmnElementModalClose: [{
1188
+ type: Output
1189
+ }] } });
1190
+
1191
+ /*
1192
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
1193
+ *
1194
+ * Licensed under EUPL, Version 1.2 (the "License");
1195
+ * you may not use this file except in compliance with the License.
1196
+ * You may obtain a copy of the License at
1197
+ *
1198
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1199
+ *
1200
+ * Unless required by applicable law or agreed to in writing, software
1201
+ * distributed under the License is distributed on an "AS IS" basis,
1202
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1203
+ * See the License for the specific language governing permissions and
1204
+ * limitations under the License.
1205
+ */
1206
+ class ChooseProcessLinkTypeComponent {
1207
+ constructor(processLinkStateService) {
1208
+ this.processLinkStateService = processLinkStateService;
1209
+ this.availableProcessLinkTypes$ = this.processLinkStateService.availableProcessLinkTypes$;
1210
+ }
1211
+ selectProcessLinkType(processLinkTypeId) {
1212
+ this.processLinkStateService.selectProcessLinkType(processLinkTypeId);
1213
+ }
1214
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ChooseProcessLinkTypeComponent, deps: [{ token: ProcessLinkStateService }], target: i0.ɵɵFactoryTarget.Component }); }
1215
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: ChooseProcessLinkTypeComponent, selector: "valtimo-choose-process-link-type", 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<ng-container\n *ngIf=\"{\n availableProcessLinkTypes: availableProcessLinkTypes$ | async\n } as obs\"\n>\n <p class=\"step-description\">\n {{ 'processLinkConfiguration.chooseProcessLinkTypeDescription' | translate }}\n </p>\n <div class=\"process-link-grid\">\n <div\n class=\"process-link-item\"\n *ngFor=\"let availableProcessLinkType of obs.availableProcessLinkTypes\"\n >\n <ng-container *ngIf=\"availableProcessLinkType.processLinkType as processLinkTypeId\">\n <button\n (click)=\"selectProcessLinkType(processLinkTypeId)\"\n cdsButton=\"secondary\"\n size=\"xl\"\n class=\"process-link-type-button\"\n [disabled]=\"!availableProcessLinkType.enabled\"\n [vTooltip]=\"'processLinkTypeDisabledTooltip.' + processLinkTypeId | translate\"\n [onBottom]=\"true\"\n [tooltipDisabled]=\"availableProcessLinkType.enabled\"\n >\n {{ 'processLinkType.' + processLinkTypeId | translate }}\n <svg\n *ngIf=\"processLinkTypeId === 'plugin'\"\n class=\"cds--btn__icon\"\n cdsIcon=\"link\"\n size=\"16\"\n ></svg>\n <svg\n *ngIf=\"processLinkTypeId === 'form'\"\n class=\"cds--btn__icon\"\n cdsIcon=\"receipt\"\n size=\"16\"\n ></svg>\n <svg\n *ngIf=\"processLinkTypeId === 'form-flow'\"\n class=\"cds--btn__icon\"\n cdsIcon=\"flow--data\"\n size=\"16\"\n ></svg>\n </button>\n </ng-container>\n </div>\n </div>\n</ng-container>\n", styles: [".process-link-type-button{width:100%}.process-link-grid{margin-top:24px;display:flex;justify-content:flex-start;width:100%;flex-wrap:wrap;gap:8px}.process-link-item{flex-basis:calc(33.3% - 5.3333333333px)}\n/*!\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"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i3.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "directive", type: i2$3.TooltipDirective, selector: "[vTooltip]", inputs: ["vTooltip", "onBottom", "tooltipDisabled"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
1216
+ }
1217
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ChooseProcessLinkTypeComponent, decorators: [{
1218
+ type: Component,
1219
+ args: [{ selector: 'valtimo-choose-process-link-type', 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<ng-container\n *ngIf=\"{\n availableProcessLinkTypes: availableProcessLinkTypes$ | async\n } as obs\"\n>\n <p class=\"step-description\">\n {{ 'processLinkConfiguration.chooseProcessLinkTypeDescription' | translate }}\n </p>\n <div class=\"process-link-grid\">\n <div\n class=\"process-link-item\"\n *ngFor=\"let availableProcessLinkType of obs.availableProcessLinkTypes\"\n >\n <ng-container *ngIf=\"availableProcessLinkType.processLinkType as processLinkTypeId\">\n <button\n (click)=\"selectProcessLinkType(processLinkTypeId)\"\n cdsButton=\"secondary\"\n size=\"xl\"\n class=\"process-link-type-button\"\n [disabled]=\"!availableProcessLinkType.enabled\"\n [vTooltip]=\"'processLinkTypeDisabledTooltip.' + processLinkTypeId | translate\"\n [onBottom]=\"true\"\n [tooltipDisabled]=\"availableProcessLinkType.enabled\"\n >\n {{ 'processLinkType.' + processLinkTypeId | translate }}\n <svg\n *ngIf=\"processLinkTypeId === 'plugin'\"\n class=\"cds--btn__icon\"\n cdsIcon=\"link\"\n size=\"16\"\n ></svg>\n <svg\n *ngIf=\"processLinkTypeId === 'form'\"\n class=\"cds--btn__icon\"\n cdsIcon=\"receipt\"\n size=\"16\"\n ></svg>\n <svg\n *ngIf=\"processLinkTypeId === 'form-flow'\"\n class=\"cds--btn__icon\"\n cdsIcon=\"flow--data\"\n size=\"16\"\n ></svg>\n </button>\n </ng-container>\n </div>\n </div>\n</ng-container>\n", styles: [".process-link-type-button{width:100%}.process-link-grid{margin-top:24px;display:flex;justify-content:flex-start;width:100%;flex-wrap:wrap;gap:8px}.process-link-item{flex-basis:calc(33.3% - 5.3333333333px)}\n/*!\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"] }]
1220
+ }], ctorParameters: () => [{ type: ProcessLinkStateService }] });
1221
+
1222
+ /*
1223
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
1224
+ *
1225
+ * Licensed under EUPL, Version 1.2 (the "License");
1226
+ * you may not use this file except in compliance with the License.
1227
+ * You may obtain a copy of the License at
1228
+ *
1229
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1230
+ *
1231
+ * Unless required by applicable law or agreed to in writing, software
1232
+ * distributed under the License is distributed on an "AS IS" basis,
1233
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1234
+ * See the License for the specific language governing permissions and
1235
+ * limitations under the License.
1236
+ */
1237
+ class SelectFormComponent {
1238
+ constructor(formService, stateService, processLinkService, buttonService) {
1239
+ this.formService = formService;
1240
+ this.stateService = stateService;
1241
+ this.processLinkService = processLinkService;
1242
+ this.buttonService = buttonService;
1243
+ this.saving$ = this.stateService.saving$;
1244
+ this.formDefinitions$ = this.formService.getAllFormDefinitions();
1245
+ this.formDefinitionListItems$ = combineLatest([this.stateService.selectedProcessLink$, this.formDefinitions$]).pipe(map$1(([selectedProcessLink, formDefinitions]) => formDefinitions.map(definition => ({
1246
+ content: definition.name,
1247
+ id: definition.id,
1248
+ selected: selectedProcessLink
1249
+ ? selectedProcessLink.formDefinitionId === definition.id
1250
+ : false,
1251
+ }))), tap(formDefinitionListItems => {
1252
+ const selectedItem = formDefinitionListItems.find(item => item.selected);
1253
+ if (selectedItem) {
1254
+ this.selectFormDefinition(selectedItem);
1255
+ }
1256
+ }));
1257
+ this._subscriptions = new Subscription();
1258
+ }
1259
+ ngOnInit() {
1260
+ this.openBackButtonSubscription();
1261
+ this.openSaveButtonSubscription();
1262
+ }
1263
+ ngOnDestroy() {
1264
+ this._subscriptions.unsubscribe();
1265
+ }
1266
+ selectFormDefinition(formDefinition) {
1267
+ if (typeof formDefinition === 'object' && formDefinition.id) {
1268
+ this._selectedFormDefinition = formDefinition;
1269
+ this.buttonService.enableSaveButton();
1270
+ }
1271
+ else {
1272
+ this._selectedFormDefinition = null;
1273
+ this.buttonService.disableSaveButton();
1274
+ }
1275
+ }
1276
+ openBackButtonSubscription() {
1277
+ this._subscriptions.add(this.buttonService.backButtonClick$.subscribe(() => {
1278
+ this.stateService.setInitial();
1279
+ }));
1280
+ }
1281
+ openSaveButtonSubscription() {
1282
+ this._subscriptions.add(this.buttonService.saveButtonClick$.subscribe(() => {
1283
+ this.stateService.startSaving();
1284
+ this.saveProcessLink();
1285
+ }));
1286
+ }
1287
+ saveProcessLink() {
1288
+ this.stateService.selectedProcessLink$.pipe(take(1)).subscribe(selectedProcessLink => {
1289
+ if (selectedProcessLink) {
1290
+ this.updateProcessLink();
1291
+ }
1292
+ else {
1293
+ this.saveNewProcessLink();
1294
+ }
1295
+ });
1296
+ }
1297
+ updateProcessLink() {
1298
+ this.stateService.selectedProcessLink$.pipe(take(1)).subscribe(selectedProcessLink => {
1299
+ const updateProcessLinkRequest = {
1300
+ id: selectedProcessLink.id,
1301
+ formDefinitionId: this._selectedFormDefinition.id,
1302
+ };
1303
+ this.processLinkService.updateProcessLink(updateProcessLinkRequest).subscribe(() => {
1304
+ this.stateService.closeModal();
1305
+ }, () => {
1306
+ this.stateService.stopSaving();
1307
+ });
1308
+ });
1309
+ }
1310
+ saveNewProcessLink() {
1311
+ combineLatest([this.stateService.modalParams$, this.stateService.selectedProcessLinkTypeId$])
1312
+ .pipe(take(1), switchMap(([modalParams, processLinkTypeId]) => this.processLinkService.saveProcessLink({
1313
+ formDefinitionId: this._selectedFormDefinition.id,
1314
+ activityType: modalParams.element.activityListenerType,
1315
+ processDefinitionId: modalParams.processDefinitionId,
1316
+ processLinkType: processLinkTypeId,
1317
+ activityId: modalParams.element.id,
1318
+ })))
1319
+ .subscribe(() => {
1320
+ this.stateService.closeModal();
1321
+ }, () => {
1322
+ this.stateService.stopSaving();
1323
+ });
1324
+ }
1325
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: SelectFormComponent, deps: [{ token: i1$3.FormService }, { token: ProcessLinkStateService }, { token: ProcessLinkService }, { token: ProcessLinkButtonService }], target: i0.ɵɵFactoryTarget.Component }); }
1326
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: SelectFormComponent, selector: "valtimo-select-form", 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<ng-container\n *ngIf=\"{\n formDefinitions: formDefinitionListItems$ | async,\n saving: saving$ | async\n } as obs\"\n>\n <p class=\"step-description\">\n {{ 'processLinkConfiguration.chooseFormDescription' | translate }}\n </p>\n <div class=\"select-form\">\n <cds-combo-box\n [appendInline]=\"true\"\n [disabled]=\"!obs.formDefinitions || obs.saving\"\n [items]=\"obs.formDefinitions || []\"\n [placeholder]=\"'interface.typeToSearch' | translate\"\n (selected)=\"selectFormDefinition($event)\"\n [label]=\"'processLinkSteps.selectForm' | translate\"\n ><cds-dropdown-list></cds-dropdown-list\n ></cds-combo-box>\n </div>\n</ng-container>\n", styles: [".label-with-tooltip{display:flex;align-items:center}.select-form{display:flex;flex-direction:column;width:100%;margin-top:24px}\n/*!\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"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.ComboBox, selector: "cds-combo-box, ibm-combo-box", inputs: ["placeholder", "openMenuAria", "closeMenuAria", "clearSelectionsTitle", "clearSelectionsAria", "clearSelectionTitle", "clearSelectionAria", "id", "items", "type", "size", "itemValueKey", "label", "helperText", "appendInline", "invalid", "invalidText", "warn", "warnText", "maxLength", "theme", "selectionFeedback", "autocomplete", "dropUp", "disabled"], outputs: ["selected", "submit", "close", "search", "clear"] }, { kind: "component", type: i5$1.DropdownList, selector: "cds-dropdown-list, ibm-dropdown-list", inputs: ["ariaLabel", "items", "listTpl", "type", "showTitles"], outputs: ["select", "scroll", "blurIntent"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
1327
+ }
1328
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: SelectFormComponent, decorators: [{
1329
+ type: Component,
1330
+ args: [{ selector: 'valtimo-select-form', 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<ng-container\n *ngIf=\"{\n formDefinitions: formDefinitionListItems$ | async,\n saving: saving$ | async\n } as obs\"\n>\n <p class=\"step-description\">\n {{ 'processLinkConfiguration.chooseFormDescription' | translate }}\n </p>\n <div class=\"select-form\">\n <cds-combo-box\n [appendInline]=\"true\"\n [disabled]=\"!obs.formDefinitions || obs.saving\"\n [items]=\"obs.formDefinitions || []\"\n [placeholder]=\"'interface.typeToSearch' | translate\"\n (selected)=\"selectFormDefinition($event)\"\n [label]=\"'processLinkSteps.selectForm' | translate\"\n ><cds-dropdown-list></cds-dropdown-list\n ></cds-combo-box>\n </div>\n</ng-container>\n", styles: [".label-with-tooltip{display:flex;align-items:center}.select-form{display:flex;flex-direction:column;width:100%;margin-top:24px}\n/*!\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"] }]
1331
+ }], ctorParameters: () => [{ type: i1$3.FormService }, { type: ProcessLinkStateService }, { type: ProcessLinkService }, { type: ProcessLinkButtonService }] });
1332
+
1333
+ /*
1334
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
1335
+ *
1336
+ * Licensed under EUPL, Version 1.2 (the "License");
1337
+ * you may not use this file except in compliance with the License.
1338
+ * You may obtain a copy of the License at
1339
+ *
1340
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1341
+ *
1342
+ * Unless required by applicable law or agreed to in writing, software
1343
+ * distributed under the License is distributed on an "AS IS" basis,
1344
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1345
+ * See the License for the specific language governing permissions and
1346
+ * limitations under the License.
1347
+ */
1348
+ class SelectFormFlowComponent {
1349
+ constructor(formFlowService, stateService, processLinkService, buttonService) {
1350
+ this.formFlowService = formFlowService;
1351
+ this.stateService = stateService;
1352
+ this.processLinkService = processLinkService;
1353
+ this.buttonService = buttonService;
1354
+ this.saving$ = this.stateService.saving$;
1355
+ this.formFlowDefinitions$ = this.formFlowService.getFormFlowDefinitions();
1356
+ this.formFlowDefinitionListItems$ = combineLatest([this.stateService.selectedProcessLink$, this.formFlowDefinitions$]).pipe(map$1(([selectedProcessLink, formFlowDefinitions]) => formFlowDefinitions.map(definition => ({
1357
+ content: definition.name,
1358
+ id: definition.id,
1359
+ selected: selectedProcessLink
1360
+ ? selectedProcessLink.formFlowDefinitionId === definition.id
1361
+ : false,
1362
+ }))), tap(formFlowDefinitionListItems => {
1363
+ const selectedItem = formFlowDefinitionListItems.find(item => item.selected);
1364
+ if (selectedItem) {
1365
+ this.selectFormFlowDefinition(selectedItem);
1366
+ }
1367
+ }));
1368
+ this._subscriptions = new Subscription();
1369
+ }
1370
+ ngOnInit() {
1371
+ this.openBackButtonSubscription();
1372
+ this.openSaveButtonSubscription();
1373
+ }
1374
+ ngOnDestroy() {
1375
+ this._subscriptions.unsubscribe();
1376
+ }
1377
+ selectFormFlowDefinition(formFlowDefinition) {
1378
+ if (typeof formFlowDefinition === 'object' && formFlowDefinition.id) {
1379
+ this._selectedFormFlowDefinition = formFlowDefinition;
1380
+ this.buttonService.enableSaveButton();
1381
+ }
1382
+ else {
1383
+ this._selectedFormFlowDefinition = null;
1384
+ this.buttonService.disableSaveButton();
1385
+ }
1386
+ }
1387
+ openBackButtonSubscription() {
1388
+ this._subscriptions.add(this.buttonService.backButtonClick$.subscribe(() => {
1389
+ this.stateService.setInitial();
1390
+ }));
1391
+ }
1392
+ openSaveButtonSubscription() {
1393
+ this._subscriptions.add(this.buttonService.saveButtonClick$.subscribe(() => {
1394
+ this.stateService.startSaving();
1395
+ this.saveFormFlowLink();
1396
+ }));
1397
+ }
1398
+ saveFormFlowLink() {
1399
+ this.stateService.selectedProcessLink$.pipe(take(1)).subscribe(selectedProcessLink => {
1400
+ if (selectedProcessLink) {
1401
+ this.updateProcessLink();
1402
+ }
1403
+ else {
1404
+ this.saveNewProcessLink();
1405
+ }
1406
+ });
1407
+ }
1408
+ updateProcessLink() {
1409
+ this.stateService.selectedProcessLink$.pipe(take(1)).subscribe(selectedProcessLink => {
1410
+ const updateProcessLinkRequest = {
1411
+ id: selectedProcessLink.id,
1412
+ formFlowDefinitionId: this._selectedFormFlowDefinition.id,
1413
+ };
1414
+ this.processLinkService.updateProcessLink(updateProcessLinkRequest).subscribe(() => {
1415
+ this.stateService.closeModal();
1416
+ }, () => {
1417
+ this.stateService.stopSaving();
1418
+ });
1419
+ });
1420
+ }
1421
+ saveNewProcessLink() {
1422
+ combineLatest([this.stateService.modalParams$, this.stateService.selectedProcessLinkTypeId$])
1423
+ .pipe(take(1), switchMap(([modalParams, processLinkTypeId]) => this.processLinkService.saveProcessLink({
1424
+ formFlowDefinitionId: this._selectedFormFlowDefinition.id,
1425
+ activityType: modalParams.element.activityListenerType,
1426
+ processDefinitionId: modalParams.processDefinitionId,
1427
+ processLinkType: processLinkTypeId,
1428
+ activityId: modalParams.element.id,
1429
+ })))
1430
+ .subscribe(() => {
1431
+ this.stateService.closeModal();
1432
+ }, () => {
1433
+ this.stateService.stopSaving();
1434
+ });
1435
+ }
1436
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: SelectFormFlowComponent, deps: [{ token: FormFlowService }, { token: ProcessLinkStateService }, { token: ProcessLinkService }, { token: ProcessLinkButtonService }], target: i0.ɵɵFactoryTarget.Component }); }
1437
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: SelectFormFlowComponent, selector: "valtimo-select-form-flow", 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<ng-container\n *ngIf=\"{\n formFlowDefinitions: formFlowDefinitionListItems$ | async,\n saving: saving$ | async\n } as obs\"\n>\n <p class=\"step-description\">\n {{ 'processLinkConfiguration.chooseFormFlowDescription' | translate }}\n </p>\n <div class=\"select-form-flow\">\n <cds-combo-box\n [appendInline]=\"true\"\n [disabled]=\"!obs.formFlowDefinitions || obs.saving\"\n [items]=\"obs.formFlowDefinitions || []\"\n [placeholder]=\"'interface.typeToSearch' | translate\"\n (selected)=\"selectFormFlowDefinition($event)\"\n [label]=\"'processLinkSteps.selectFormFlow' | translate\"\n ><cds-dropdown-list></cds-dropdown-list\n ></cds-combo-box>\n </div>\n</ng-container>\n", styles: [".label-with-tooltip{display:flex;align-items:center}.select-form-flow{display:flex;flex-direction:column;width:100%;margin-top:24px}\n/*!\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"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.ComboBox, selector: "cds-combo-box, ibm-combo-box", inputs: ["placeholder", "openMenuAria", "closeMenuAria", "clearSelectionsTitle", "clearSelectionsAria", "clearSelectionTitle", "clearSelectionAria", "id", "items", "type", "size", "itemValueKey", "label", "helperText", "appendInline", "invalid", "invalidText", "warn", "warnText", "maxLength", "theme", "selectionFeedback", "autocomplete", "dropUp", "disabled"], outputs: ["selected", "submit", "close", "search", "clear"] }, { kind: "component", type: i5$1.DropdownList, selector: "cds-dropdown-list, ibm-dropdown-list", inputs: ["ariaLabel", "items", "listTpl", "type", "showTitles"], outputs: ["select", "scroll", "blurIntent"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
1438
+ }
1439
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: SelectFormFlowComponent, decorators: [{
1440
+ type: Component,
1441
+ args: [{ selector: 'valtimo-select-form-flow', 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<ng-container\n *ngIf=\"{\n formFlowDefinitions: formFlowDefinitionListItems$ | async,\n saving: saving$ | async\n } as obs\"\n>\n <p class=\"step-description\">\n {{ 'processLinkConfiguration.chooseFormFlowDescription' | translate }}\n </p>\n <div class=\"select-form-flow\">\n <cds-combo-box\n [appendInline]=\"true\"\n [disabled]=\"!obs.formFlowDefinitions || obs.saving\"\n [items]=\"obs.formFlowDefinitions || []\"\n [placeholder]=\"'interface.typeToSearch' | translate\"\n (selected)=\"selectFormFlowDefinition($event)\"\n [label]=\"'processLinkSteps.selectFormFlow' | translate\"\n ><cds-dropdown-list></cds-dropdown-list\n ></cds-combo-box>\n </div>\n</ng-container>\n", styles: [".label-with-tooltip{display:flex;align-items:center}.select-form-flow{display:flex;flex-direction:column;width:100%;margin-top:24px}\n/*!\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"] }]
1442
+ }], ctorParameters: () => [{ type: FormFlowService }, { type: ProcessLinkStateService }, { type: ProcessLinkService }, { type: ProcessLinkButtonService }] });
1443
+
1444
+ /*
1445
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
1446
+ *
1447
+ * Licensed under EUPL, Version 1.2 (the "License");
1448
+ * you may not use this file except in compliance with the License.
1449
+ * You may obtain a copy of the License at
1450
+ *
1451
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1452
+ *
1453
+ * Unless required by applicable law or agreed to in writing, software
1454
+ * distributed under the License is distributed on an "AS IS" basis,
1455
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1456
+ * See the License for the specific language governing permissions and
1457
+ * limitations under the License.
1458
+ */
1459
+ class ProcessLinkModalComponent {
1460
+ constructor(stateService, stepService, buttonService, processLinkService) {
1461
+ this.stateService = stateService;
1462
+ this.stepService = stepService;
1463
+ this.buttonService = buttonService;
1464
+ this.processLinkService = processLinkService;
1465
+ this.showModal$ = this.stateService.showModal$;
1466
+ this.processStepName$ = this.stateService.elementName$;
1467
+ this.steps$ = this.stepService.steps$;
1468
+ this.currentStepIndex$ = this.stepService.currentStepIndex$;
1469
+ this.currentStepId$ = this.stepService.currentStepId$;
1470
+ this.showSaveButton$ = this.buttonService.showSaveButton$;
1471
+ this.enableSaveButton$ = this.buttonService.enableSaveButton$;
1472
+ this.showBackButton$ = this.buttonService.showBackButton$;
1473
+ this.showNextButton$ = this.buttonService.showNextButton$;
1474
+ this.enableNextButton$ = this.buttonService.enableNextButton$;
1475
+ this.hideProgressIndicator$ = this.stateService.hideProgressIndicator$;
1476
+ this.saving$ = this.stateService.saving$;
1477
+ this.typeOfSelectedProcessLink$ = this.stateService.typeOfSelectedProcessLink$;
1478
+ }
1479
+ closeModal() {
1480
+ this.stateService.closeModal();
1481
+ }
1482
+ backButtonClick() {
1483
+ this.buttonService.clickBackButton();
1484
+ }
1485
+ saveButtonClick() {
1486
+ this.buttonService.clickSaveButton();
1487
+ }
1488
+ nextButtonClick() {
1489
+ this.buttonService.clickNextButton();
1490
+ }
1491
+ unlinkButtonClick() {
1492
+ this.stateService.startSaving();
1493
+ this.stateService.selectedProcessLink$.pipe(take(1)).subscribe(selectedProcessLink => {
1494
+ this.processLinkService.deleteProcessLink(selectedProcessLink.id).subscribe(() => {
1495
+ this.stateService.closeModal();
1496
+ }, () => {
1497
+ this.stateService.stopSaving();
1498
+ });
1499
+ });
1500
+ }
1501
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkModalComponent, deps: [{ token: ProcessLinkStateService }, { token: ProcessLinkStepService }, { token: ProcessLinkButtonService }, { token: ProcessLinkService }], target: i0.ɵɵFactoryTarget.Component }); }
1502
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: ProcessLinkModalComponent, selector: "valtimo-process-link-modal", 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=\"process-link-modal-container\"\n *ngIf=\"{\n showModal: showModal$ | async,\n processStepName: processStepName$ | async,\n steps: steps$ | async,\n currentStepIndex: currentStepIndex$ | async,\n currentStepId: currentStepId$ | async,\n showSaveButton: showSaveButton$ | async,\n enableSaveButton: enableSaveButton$ | async,\n showBackButton: showBackButton$ | async,\n showNextButton: showNextButton$ | async,\n enableNextButton: enableNextButton$ | async,\n saving: saving$ | async,\n hideProgressIndicator: hideProgressIndicator$ | async,\n typeOfSelectedProgressLink: typeOfSelectedProcessLink$ | async\n } as obs\"\n>\n <cds-modal valtimoCdsModal [open]=\"obs.showModal\" size=\"lg\">\n <cds-modal-header (closeSelect)=\"closeModal()\">\n <h2 cdsModalHeaderLabel>{{ 'processLinkConfiguration.configureStep' | translate }}</h2>\n <h3 cdsModalHeaderHeading>\n {{\n 'processLinkConfiguration.modalTitle'\n | translate: {processStepName: obs.processStepName || '-'}\n }}\n </h3>\n <div class=\"process-link-progress\" *ngIf=\"!obs.typeOfSelectedProgressLink\">\n <ng-container *ngTemplateOutlet=\"progressIndicator; context: {obs: obs}\"></ng-container>\n </div>\n </cds-modal-header>\n <section cdsModalContent>\n <ng-container *ngTemplateOutlet=\"stepContent; context: {obs: obs}\"></ng-container>\n </section>\n <ng-template *ngTemplateOutlet=\"footer; context: {obs: obs}\"></ng-template>\n </cds-modal>\n</div>\n\n<ng-template #progressIndicator let-obs=\"obs\">\n <cds-progress-indicator\n *ngIf=\"obs.steps && !obs.hideProgressIndicator\"\n [steps]=\"obs.steps\"\n [current]=\"obs.currentStepIndex\"\n spacing=\"equal\"\n ></cds-progress-indicator>\n</ng-template>\n\n<ng-template #stepContent let-obs=\"obs\">\n <div class=\"cds-loading-container\" *ngIf=\"obs.saving\">\n <cds-loading></cds-loading>\n </div>\n <div [ngClass]=\"{hidden: obs.saving}\">\n <ng-container>\n <ng-container *ngIf=\"obs.currentStepId === 'chooseProcessLinkType'\">\n <valtimo-choose-process-link-type></valtimo-choose-process-link-type>\n </ng-container>\n <ng-container\n *ngIf=\"obs.currentStepId === 'selectForm' || obs.typeOfSelectedProgressLink === 'form'\"\n >\n <valtimo-select-form></valtimo-select-form>\n </ng-container>\n <ng-container\n *ngIf=\"\n obs.currentStepId === 'selectFormFlow' || obs.typeOfSelectedProgressLink === 'form-flow'\n \"\n >\n <valtimo-select-form-flow></valtimo-select-form-flow>\n </ng-container>\n <ng-container *ngIf=\"obs.currentStepId === 'choosePluginConfiguration'\">\n <valtimo-select-plugin-configuration></valtimo-select-plugin-configuration>\n </ng-container>\n <ng-container *ngIf=\"obs.currentStepId === 'choosePluginAction'\">\n <valtimo-select-plugin-action></valtimo-select-plugin-action>\n </ng-container>\n <ng-container\n *ngIf=\"\n obs.currentStepId === 'configurePluginAction' ||\n obs.typeOfSelectedProgressLink === 'plugin'\n \"\n >\n <valtimo-plugin-action-configuration></valtimo-plugin-action-configuration>\n </ng-container>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #footer let-obs=\"obs\">\n <cds-modal-footer *ngIf=\"!obs.saving\">\n <div class=\"cancel-button\">\n <button cdsButton=\"ghost\" (click)=\"closeModal()\" [disabled]=\"obs.disabled\">\n {{ 'processLinkConfiguration.cancel' | translate }}\n </button>\n </div>\n <div class=\"navigation-buttons\">\n <button\n *ngIf=\"obs.showBackButton && !obs.saving\"\n cdsButton=\"secondary\"\n (click)=\"backButtonClick()\"\n >\n {{ 'processLinkConfiguration.back' | translate }}\n </button>\n <button\n cdsButton=\"primary\"\n *ngIf=\"obs.showNextButton && !obs.saving\"\n [disabled]=\"obs.enableNextButton === false\"\n (click)=\"nextButtonClick()\"\n >\n {{ 'processLinkConfiguration.next' | translate }}\n </button>\n <button\n cdsButton=\"danger--primary\"\n *ngIf=\"obs.typeOfSelectedProgressLink\"\n (click)=\"unlinkButtonClick()\"\n >\n {{ 'processLinkConfiguration.unlink' | translate }}\n </button>\n <button\n cdsButton=\"primary\"\n *ngIf=\"(obs.showSaveButton && !obs.saving) || obs.typeOfSelectedProgressLink\"\n [disabled]=\"obs.enableSaveButton === false\"\n (click)=\"saveButtonClick()\"\n >\n {{ 'processLinkConfiguration.complete' | translate }}\n </button>\n </div>\n </cds-modal-footer>\n</ng-template>\n", styles: ["::ng-deep .process-link-modal-container .cds--modal-container{max-width:960px;min-height:70%}::ng-deep .process-link-modal-container .cds--modal-footer{justify-content:space-between}.cds-loading-container{position:absolute;top:50px;padding-bottom:50px;left:0;width:100%;height:calc(100% - 50px);display:flex;justify-content:center;align-items:center;background:var(--cds-layer);z-index:99;box-sizing:border-box}.navigation-buttons{justify-content:flex-end}.navigation-buttons,.cancel-button{max-width:50%;display:flex;flex-direction:row;flex-grow:1}.navigation-buttons button,.cancel-button button{min-width:50%}.cancel-button{max-width:25%}.cancel-button button{min-width:100%}.process-link-progress{width:100%;margin-top:32px;margin-bottom:40px}.hidden{visibility:hidden}\n/*!\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"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i3.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i3.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i3.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i3.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "directive", type: i3.ModalHeaderLabel, selector: "[cdsModalHeaderLabel], [ibmModalHeaderLabel]" }, { kind: "component", type: i3.ProgressIndicator, selector: "cds-progress-indicator, ibm-progress-indicator", inputs: ["current", "steps", "translations", "orientation", "skeleton", "spacing"], outputs: ["stepSelected"] }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "component", type: i3.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "directive", type: i2$3.ValtimoCdsModalDirective, selector: "[valtimoCdsModal]" }, { kind: "component", type: SelectPluginConfigurationComponent, selector: "valtimo-select-plugin-configuration" }, { kind: "component", type: SelectPluginActionComponent, selector: "valtimo-select-plugin-action" }, { kind: "component", type: PluginActionConfigurationComponent, selector: "valtimo-plugin-action-configuration", outputs: ["valid", "configuration"] }, { kind: "component", type: ChooseProcessLinkTypeComponent, selector: "valtimo-choose-process-link-type" }, { kind: "component", type: SelectFormComponent, selector: "valtimo-select-form" }, { kind: "component", type: SelectFormFlowComponent, selector: "valtimo-select-form-flow" }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
1503
+ }
1504
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkModalComponent, decorators: [{
1505
+ type: Component,
1506
+ args: [{ selector: 'valtimo-process-link-modal', 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=\"process-link-modal-container\"\n *ngIf=\"{\n showModal: showModal$ | async,\n processStepName: processStepName$ | async,\n steps: steps$ | async,\n currentStepIndex: currentStepIndex$ | async,\n currentStepId: currentStepId$ | async,\n showSaveButton: showSaveButton$ | async,\n enableSaveButton: enableSaveButton$ | async,\n showBackButton: showBackButton$ | async,\n showNextButton: showNextButton$ | async,\n enableNextButton: enableNextButton$ | async,\n saving: saving$ | async,\n hideProgressIndicator: hideProgressIndicator$ | async,\n typeOfSelectedProgressLink: typeOfSelectedProcessLink$ | async\n } as obs\"\n>\n <cds-modal valtimoCdsModal [open]=\"obs.showModal\" size=\"lg\">\n <cds-modal-header (closeSelect)=\"closeModal()\">\n <h2 cdsModalHeaderLabel>{{ 'processLinkConfiguration.configureStep' | translate }}</h2>\n <h3 cdsModalHeaderHeading>\n {{\n 'processLinkConfiguration.modalTitle'\n | translate: {processStepName: obs.processStepName || '-'}\n }}\n </h3>\n <div class=\"process-link-progress\" *ngIf=\"!obs.typeOfSelectedProgressLink\">\n <ng-container *ngTemplateOutlet=\"progressIndicator; context: {obs: obs}\"></ng-container>\n </div>\n </cds-modal-header>\n <section cdsModalContent>\n <ng-container *ngTemplateOutlet=\"stepContent; context: {obs: obs}\"></ng-container>\n </section>\n <ng-template *ngTemplateOutlet=\"footer; context: {obs: obs}\"></ng-template>\n </cds-modal>\n</div>\n\n<ng-template #progressIndicator let-obs=\"obs\">\n <cds-progress-indicator\n *ngIf=\"obs.steps && !obs.hideProgressIndicator\"\n [steps]=\"obs.steps\"\n [current]=\"obs.currentStepIndex\"\n spacing=\"equal\"\n ></cds-progress-indicator>\n</ng-template>\n\n<ng-template #stepContent let-obs=\"obs\">\n <div class=\"cds-loading-container\" *ngIf=\"obs.saving\">\n <cds-loading></cds-loading>\n </div>\n <div [ngClass]=\"{hidden: obs.saving}\">\n <ng-container>\n <ng-container *ngIf=\"obs.currentStepId === 'chooseProcessLinkType'\">\n <valtimo-choose-process-link-type></valtimo-choose-process-link-type>\n </ng-container>\n <ng-container\n *ngIf=\"obs.currentStepId === 'selectForm' || obs.typeOfSelectedProgressLink === 'form'\"\n >\n <valtimo-select-form></valtimo-select-form>\n </ng-container>\n <ng-container\n *ngIf=\"\n obs.currentStepId === 'selectFormFlow' || obs.typeOfSelectedProgressLink === 'form-flow'\n \"\n >\n <valtimo-select-form-flow></valtimo-select-form-flow>\n </ng-container>\n <ng-container *ngIf=\"obs.currentStepId === 'choosePluginConfiguration'\">\n <valtimo-select-plugin-configuration></valtimo-select-plugin-configuration>\n </ng-container>\n <ng-container *ngIf=\"obs.currentStepId === 'choosePluginAction'\">\n <valtimo-select-plugin-action></valtimo-select-plugin-action>\n </ng-container>\n <ng-container\n *ngIf=\"\n obs.currentStepId === 'configurePluginAction' ||\n obs.typeOfSelectedProgressLink === 'plugin'\n \"\n >\n <valtimo-plugin-action-configuration></valtimo-plugin-action-configuration>\n </ng-container>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #footer let-obs=\"obs\">\n <cds-modal-footer *ngIf=\"!obs.saving\">\n <div class=\"cancel-button\">\n <button cdsButton=\"ghost\" (click)=\"closeModal()\" [disabled]=\"obs.disabled\">\n {{ 'processLinkConfiguration.cancel' | translate }}\n </button>\n </div>\n <div class=\"navigation-buttons\">\n <button\n *ngIf=\"obs.showBackButton && !obs.saving\"\n cdsButton=\"secondary\"\n (click)=\"backButtonClick()\"\n >\n {{ 'processLinkConfiguration.back' | translate }}\n </button>\n <button\n cdsButton=\"primary\"\n *ngIf=\"obs.showNextButton && !obs.saving\"\n [disabled]=\"obs.enableNextButton === false\"\n (click)=\"nextButtonClick()\"\n >\n {{ 'processLinkConfiguration.next' | translate }}\n </button>\n <button\n cdsButton=\"danger--primary\"\n *ngIf=\"obs.typeOfSelectedProgressLink\"\n (click)=\"unlinkButtonClick()\"\n >\n {{ 'processLinkConfiguration.unlink' | translate }}\n </button>\n <button\n cdsButton=\"primary\"\n *ngIf=\"(obs.showSaveButton && !obs.saving) || obs.typeOfSelectedProgressLink\"\n [disabled]=\"obs.enableSaveButton === false\"\n (click)=\"saveButtonClick()\"\n >\n {{ 'processLinkConfiguration.complete' | translate }}\n </button>\n </div>\n </cds-modal-footer>\n</ng-template>\n", styles: ["::ng-deep .process-link-modal-container .cds--modal-container{max-width:960px;min-height:70%}::ng-deep .process-link-modal-container .cds--modal-footer{justify-content:space-between}.cds-loading-container{position:absolute;top:50px;padding-bottom:50px;left:0;width:100%;height:calc(100% - 50px);display:flex;justify-content:center;align-items:center;background:var(--cds-layer);z-index:99;box-sizing:border-box}.navigation-buttons{justify-content:flex-end}.navigation-buttons,.cancel-button{max-width:50%;display:flex;flex-direction:row;flex-grow:1}.navigation-buttons button,.cancel-button button{min-width:50%}.cancel-button{max-width:25%}.cancel-button button{min-width:100%}.process-link-progress{width:100%;margin-top:32px;margin-bottom:40px}.hidden{visibility:hidden}\n/*!\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"] }]
1507
+ }], ctorParameters: () => [{ type: ProcessLinkStateService }, { type: ProcessLinkStepService }, { type: ProcessLinkButtonService }, { type: ProcessLinkService }] });
1508
+
1509
+ /*
1510
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
1511
+ *
1512
+ * Licensed under EUPL, Version 1.2 (the "License");
1513
+ * you may not use this file except in compliance with the License.
1514
+ * You may obtain a copy of the License at
1515
+ *
1516
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1517
+ *
1518
+ * Unless required by applicable law or agreed to in writing, software
1519
+ * distributed under the License is distributed on an "AS IS" basis,
1520
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1521
+ * See the License for the specific language governing permissions and
1522
+ * limitations under the License.
1523
+ */
1524
+ class ProcessLinkComponent {
1525
+ constructor(processLinkService, stateService, modalService) {
1526
+ this.processLinkService = processLinkService;
1527
+ this.stateService = stateService;
1528
+ this.modalService = modalService;
1529
+ }
1530
+ openModal(params) {
1531
+ const activityType = params?.element?.activityListenerType;
1532
+ this.modalService.setModalData(params);
1533
+ if (activityType) {
1534
+ this.processLinkService
1535
+ .getProcessLink({
1536
+ activityId: params.element.id,
1537
+ processDefinitionId: params.processDefinitionId,
1538
+ })
1539
+ .pipe(switchMap(processLinks => {
1540
+ if (processLinks.length > 0) {
1541
+ return of({ processLink: processLinks[0] });
1542
+ }
1543
+ return this.processLinkService.getProcessLinkCandidates(activityType);
1544
+ }), tap(res => {
1545
+ const result = res;
1546
+ const processLink = result.processLink;
1547
+ this.stateService.setModalParams(params);
1548
+ this.stateService.setElementName(params?.element?.name);
1549
+ if (processLink) {
1550
+ this.stateService.selectProcessLink(processLink);
1551
+ }
1552
+ else {
1553
+ this.stateService.setAvailableProcessLinkTypes(result);
1554
+ }
1555
+ if (result?.length > 0 || processLink) {
1556
+ this.stateService.showModal();
1557
+ }
1558
+ }))
1559
+ .subscribe();
1560
+ }
1561
+ }
1562
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkComponent, deps: [{ token: ProcessLinkService }, { token: ProcessLinkStateService }, { token: i2$3.ModalService }], target: i0.ɵɵFactoryTarget.Component }); }
1563
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: ProcessLinkComponent, selector: "valtimo-process-link", providers: [ProcessLinkStateService, ProcessLinkStepService, ProcessLinkButtonService], 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 class=\"main-content\">\n <div class=\"container-fluid\">\n <valtimo-form-link-process-diagram\n (bpmnElementModalOpen)=\"openModal($event)\"\n ></valtimo-form-link-process-diagram>\n </div>\n</div>\n\n<valtimo-process-link-modal></valtimo-process-link-modal>\n", styles: ["/*!\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"], dependencies: [{ kind: "component", type: FormLinkProcessDiagramComponent, selector: "valtimo-form-link-process-diagram", outputs: ["bpmnElementModalOpen", "bpmnElementModalClose"] }, { kind: "component", type: ProcessLinkModalComponent, selector: "valtimo-process-link-modal" }] }); }
1564
+ }
1565
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkComponent, decorators: [{
1566
+ type: Component,
1567
+ args: [{ selector: 'valtimo-process-link', providers: [ProcessLinkStateService, ProcessLinkStepService, ProcessLinkButtonService], 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 class=\"main-content\">\n <div class=\"container-fluid\">\n <valtimo-form-link-process-diagram\n (bpmnElementModalOpen)=\"openModal($event)\"\n ></valtimo-form-link-process-diagram>\n </div>\n</div>\n\n<valtimo-process-link-modal></valtimo-process-link-modal>\n", styles: ["/*!\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"] }]
1568
+ }], ctorParameters: () => [{ type: ProcessLinkService }, { type: ProcessLinkStateService }, { type: i2$3.ModalService }] });
1569
+
1570
+ /*
1571
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
1572
+ *
1573
+ * Licensed under EUPL, Version 1.2 (the "License");
1574
+ * you may not use this file except in compliance with the License.
1575
+ * You may obtain a copy of the License at
1576
+ *
1577
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1578
+ *
1579
+ * Unless required by applicable law or agreed to in writing, software
1580
+ * distributed under the License is distributed on an "AS IS" basis,
1581
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1582
+ * See the License for the specific language governing permissions and
1583
+ * limitations under the License.
1584
+ */
1585
+ const routes = [
1586
+ {
1587
+ path: 'process-links',
1588
+ component: ProcessLinkComponent,
1589
+ canActivate: [AuthGuardService],
1590
+ data: { title: 'Process links', roles: [ROLE_ADMIN] },
1591
+ },
1592
+ ];
1593
+ class ProcessLinkRoutingModule {
1594
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1595
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkRoutingModule, imports: [i2$2.RouterModule], exports: [RouterModule] }); }
1596
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkRoutingModule, imports: [RouterModule.forRoot(routes), RouterModule] }); }
1597
+ }
1598
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkRoutingModule, decorators: [{
1599
+ type: NgModule,
1600
+ args: [{
1601
+ imports: [RouterModule.forRoot(routes)],
1602
+ exports: [RouterModule],
1603
+ declarations: [],
1604
+ }]
1605
+ }] });
1606
+
1607
+ /*
1608
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
1609
+ *
1610
+ * Licensed under EUPL, Version 1.2 (the "License");
1611
+ * you may not use this file except in compliance with the License.
1612
+ * You may obtain a copy of the License at
1613
+ *
1614
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1615
+ *
1616
+ * Unless required by applicable law or agreed to in writing, software
1617
+ * distributed under the License is distributed on an "AS IS" basis,
1618
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1619
+ * See the License for the specific language governing permissions and
1620
+ * limitations under the License.
1621
+ */
1622
+
1623
+ /*
1624
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
1625
+ *
1626
+ * Licensed under EUPL, Version 1.2 (the "License");
1627
+ * you may not use this file except in compliance with the License.
1628
+ * You may obtain a copy of the License at
1629
+ *
1630
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1631
+ *
1632
+ * Unless required by applicable law or agreed to in writing, software
1633
+ * distributed under the License is distributed on an "AS IS" basis,
1634
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1635
+ * See the License for the specific language governing permissions and
1636
+ * limitations under the License.
1637
+ */
1638
+
1639
+ /*
1640
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
1641
+ *
1642
+ * Licensed under EUPL, Version 1.2 (the "License");
1643
+ * you may not use this file except in compliance with the License.
1644
+ * You may obtain a copy of the License at
1645
+ *
1646
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1647
+ *
1648
+ * Unless required by applicable law or agreed to in writing, software
1649
+ * distributed under the License is distributed on an "AS IS" basis,
1650
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1651
+ * See the License for the specific language governing permissions and
1652
+ * limitations under the License.
1653
+ */
1654
+ class FormFlowConfigurationContainerComponent {
1655
+ set disabled(disabledValue) {
1656
+ this._disabled$.next(disabledValue);
1657
+ }
1658
+ set componentId(value) {
1659
+ this._componentId$.next(value);
1660
+ }
1661
+ set formFlowInstanceId(value) {
1662
+ this._formFlowInstanceId$.next(value);
1663
+ }
1664
+ constructor(formFlowComponentService) {
1665
+ this.formFlowComponentService = formFlowComponentService;
1666
+ this.changeEvent = new EventEmitter();
1667
+ this.submitEvent = new EventEmitter();
1668
+ this._subscriptions = new Subscription();
1669
+ this._componentRef$ = new BehaviorSubject(undefined);
1670
+ this._disabled$ = new BehaviorSubject(false);
1671
+ this._componentId$ = new BehaviorSubject('');
1672
+ this._formFlowInstanceId$ = new BehaviorSubject('');
1673
+ }
1674
+ ngOnInit() {
1675
+ this.openConfigurationComponentSubscription();
1676
+ this.openComponentInstanceSubscription();
1677
+ this.openDisabledSubscription();
1678
+ }
1679
+ ngOnDestroy() {
1680
+ this._subscriptions.unsubscribe();
1681
+ }
1682
+ openConfigurationComponentSubscription() {
1683
+ this._subscriptions.add(combineLatest([this.formFlowComponentService.supportedComponents$, this._componentId$])
1684
+ .pipe(tap$1(([supportedComponents, componentId]) => {
1685
+ const configurationComponent = supportedComponents.find(component => component.id === componentId);
1686
+ this._dynamicContainer.clear();
1687
+ if (configurationComponent) {
1688
+ const componentRef = this._dynamicContainer.createComponent(configurationComponent.component);
1689
+ this._componentRef$.next(componentRef);
1690
+ }
1691
+ }))
1692
+ .subscribe());
1693
+ }
1694
+ openComponentInstanceSubscription() {
1695
+ this._subscriptions.add(combineLatest([this._componentRef$, this._formFlowInstanceId$]).subscribe(([ref, formFlowInstanceId]) => {
1696
+ const instance = ref?.instance;
1697
+ this._submitSubscription?.unsubscribe();
1698
+ this._changeSubscription?.unsubscribe();
1699
+ if (instance) {
1700
+ if (formFlowInstanceId) {
1701
+ instance.formFlowInstanceId = formFlowInstanceId;
1702
+ }
1703
+ this._changeSubscription = instance.changeEvent.subscribe(change => {
1704
+ this.changeEvent.emit(change);
1705
+ });
1706
+ this._submitSubscription = instance.submitEvent.subscribe(submit => {
1707
+ this.submitEvent.emit(submit);
1708
+ });
1709
+ }
1710
+ }));
1711
+ }
1712
+ openDisabledSubscription() {
1713
+ this._subscriptions.add(combineLatest([this._componentRef$, this._disabled$]).subscribe(([ref, disabled]) => {
1714
+ const instance = ref?.instance;
1715
+ if (instance) {
1716
+ instance.disabled = disabled;
1717
+ }
1718
+ }));
1719
+ }
1720
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormFlowConfigurationContainerComponent, deps: [{ token: FormFlowComponentService }], target: i0.ɵɵFactoryTarget.Component }); }
1721
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: FormFlowConfigurationContainerComponent, selector: "valtimo-form-flow-configuration-container", inputs: { disabled: "disabled", componentId: "componentId", formFlowInstanceId: "formFlowInstanceId" }, outputs: { changeEvent: "changeEvent", submitEvent: "submitEvent" }, viewQueries: [{ propertyName: "_dynamicContainer", first: true, predicate: ["formFlowConfigurationComponent"], descendants: true, read: ViewContainerRef, static: 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<ng-template #formFlowConfigurationComponent></ng-template>\n" }); }
1722
+ }
1723
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormFlowConfigurationContainerComponent, decorators: [{
1724
+ type: Component,
1725
+ args: [{ selector: 'valtimo-form-flow-configuration-container', 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<ng-template #formFlowConfigurationComponent></ng-template>\n" }]
1726
+ }], ctorParameters: () => [{ type: FormFlowComponentService }], propDecorators: { _dynamicContainer: [{
1727
+ type: ViewChild,
1728
+ args: ['formFlowConfigurationComponent', { static: true, read: ViewContainerRef }]
1729
+ }], disabled: [{
1730
+ type: Input
1731
+ }], componentId: [{
1732
+ type: Input
1733
+ }], formFlowInstanceId: [{
1734
+ type: Input
1735
+ }], changeEvent: [{
1736
+ type: Output
1737
+ }], submitEvent: [{
1738
+ type: Output
1739
+ }] } });
1740
+
1741
+ /*
1742
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
1743
+ *
1744
+ * Licensed under EUPL, Version 1.2 (the "License");
1745
+ * you may not use this file except in compliance with the License.
1746
+ * You may obtain a copy of the License at
1747
+ *
1748
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1749
+ *
1750
+ * Unless required by applicable law or agreed to in writing, software
1751
+ * distributed under the License is distributed on an "AS IS" basis,
1752
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1753
+ * See the License for the specific language governing permissions and
1754
+ * limitations under the License.
1755
+ */
1756
+ class FormFlowComponent {
1757
+ constructor(formFlowService, modalService) {
1758
+ this.formFlowService = formFlowService;
1759
+ this.modalService = modalService;
1760
+ this.formIoFormData = new BehaviorSubject(null);
1761
+ this.formFlowComplete = new EventEmitter();
1762
+ this.disabled$ = new BehaviorSubject(false);
1763
+ this.formFlowStepType$ = new BehaviorSubject(null);
1764
+ this.FormFlowCustomComponentId$ = new BehaviorSubject('');
1765
+ this.formioOptions = new FormioOptionsImpl();
1766
+ this.formioOptions.disableAlerts = true;
1767
+ }
1768
+ ngOnInit() {
1769
+ this.getFormFlowStep();
1770
+ }
1771
+ onChange(event) {
1772
+ if (event?.data) {
1773
+ this.formIoFormData.next(event.data);
1774
+ }
1775
+ }
1776
+ onSubmit(submission) {
1777
+ this.disable();
1778
+ if (submission.data) {
1779
+ this.formIoFormData.next(submission.data);
1780
+ }
1781
+ if (submission.data.submit) {
1782
+ this.formFlowService
1783
+ .submitStep(this.formFlowInstanceId, this.formFlowStepInstanceId, this.formIoFormData.getValue())
1784
+ .subscribe((result) => this.handleFormFlowStep(result), errors => {
1785
+ this.form?.showErrors(errors);
1786
+ this.enable();
1787
+ });
1788
+ }
1789
+ else if (submission.data['back']) {
1790
+ this.formFlowService.back(this.formFlowInstanceId, submission.data).subscribe((result) => this.handleFormFlowStep(result), errors => {
1791
+ this.form?.showErrors(errors);
1792
+ this.enable();
1793
+ });
1794
+ }
1795
+ }
1796
+ saveData() {
1797
+ const formIoFormDataValue = this.formIoFormData.getValue();
1798
+ if (formIoFormDataValue && this.formFlowInstanceId) {
1799
+ this.formFlowService.save(this.formFlowInstanceId, formIoFormDataValue).subscribe(() => null, errors => this.form.showErrors(errors));
1800
+ }
1801
+ }
1802
+ getFormFlowStep() {
1803
+ this.formFlowService
1804
+ .getFormFlowStep(this.formFlowInstanceId)
1805
+ .subscribe((result) => {
1806
+ this.handleFormFlowStep(result);
1807
+ });
1808
+ }
1809
+ handleFormFlowStep(formFlowInstance) {
1810
+ if (formFlowInstance.step === null) {
1811
+ this.formFlowStepType$.next(null);
1812
+ this.FormFlowCustomComponentId$.next('');
1813
+ this.formFlowInstanceId = null;
1814
+ this.formFlowStepInstanceId = null;
1815
+ this.formFlowComplete.emit(null);
1816
+ }
1817
+ else {
1818
+ this.modalService.scrollToTop();
1819
+ this.formFlowStepType$.next(formFlowInstance.step.type);
1820
+ this.FormFlowCustomComponentId$.next(formFlowInstance?.step?.typeProperties?.id || '');
1821
+ this.formFlowInstanceId = formFlowInstance.id;
1822
+ this.formFlowStepInstanceId = formFlowInstance.step.id;
1823
+ this.formDefinition = formFlowInstance.step.typeProperties.definition;
1824
+ }
1825
+ this.enable();
1826
+ }
1827
+ disable() {
1828
+ this.disabled$.next(true);
1829
+ }
1830
+ enable() {
1831
+ this.disabled$.next(false);
1832
+ }
1833
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormFlowComponent, deps: [{ token: FormFlowService }, { token: i2$3.ValtimoModalService }], target: i0.ɵɵFactoryTarget.Component }); }
1834
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: FormFlowComponent, selector: "valtimo-form-flow", inputs: { formIoFormData: "formIoFormData", formFlowInstanceId: "formFlowInstanceId" }, outputs: { formFlowComplete: "formFlowComplete" }, viewQueries: [{ propertyName: "form", first: true, predicate: ["form"], 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 <div body *ngIf=\"formDefinition && (formFlowStepType$ | async) === 'form'\">\n <valtimo-form-io\n #form\n [form]=\"formDefinition\"\n (submit)=\"onSubmit($event)\"\n (change)=\"onChange($event)\"\n [options]=\"formioOptions\"\n ></valtimo-form-io>\n </div>\n <div body *ngIf=\"(formFlowStepType$ | async) === 'custom-component'\">\n <valtimo-form-flow-configuration-container\n [componentId]=\"FormFlowCustomComponentId$ | async\"\n [formFlowInstanceId]=\"formFlowInstanceId\"\n [disabled]=\"disabled$ | async\"\n (submitEvent)=\"onSubmit($event)\"\n (changeEvent)=\"onChange($event)\"\n >\n </valtimo-form-flow-configuration-container>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$3.FormioComponent, selector: "valtimo-form-io", inputs: ["options", "submission", "form", "readOnly", "formRefresh$"], outputs: ["submit", "change"] }, { kind: "component", type: FormFlowConfigurationContainerComponent, selector: "valtimo-form-flow-configuration-container", inputs: ["disabled", "componentId", "formFlowInstanceId"], outputs: ["changeEvent", "submitEvent"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }] }); }
1835
+ }
1836
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormFlowComponent, decorators: [{
1837
+ type: Component,
1838
+ args: [{ selector: 'valtimo-form-flow', 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 <div body *ngIf=\"formDefinition && (formFlowStepType$ | async) === 'form'\">\n <valtimo-form-io\n #form\n [form]=\"formDefinition\"\n (submit)=\"onSubmit($event)\"\n (change)=\"onChange($event)\"\n [options]=\"formioOptions\"\n ></valtimo-form-io>\n </div>\n <div body *ngIf=\"(formFlowStepType$ | async) === 'custom-component'\">\n <valtimo-form-flow-configuration-container\n [componentId]=\"FormFlowCustomComponentId$ | async\"\n [formFlowInstanceId]=\"formFlowInstanceId\"\n [disabled]=\"disabled$ | async\"\n (submitEvent)=\"onSubmit($event)\"\n (changeEvent)=\"onChange($event)\"\n >\n </valtimo-form-flow-configuration-container>\n </div>\n</div>\n" }]
1839
+ }], ctorParameters: () => [{ type: FormFlowService }, { type: i2$3.ValtimoModalService }], propDecorators: { form: [{
1840
+ type: ViewChild,
1841
+ args: ['form']
1842
+ }], formIoFormData: [{
1843
+ type: Input
1844
+ }], formFlowInstanceId: [{
1845
+ type: Input
1846
+ }], formFlowComplete: [{
1847
+ type: Output
1848
+ }] } });
1849
+
1850
+ /*
1851
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
1852
+ *
1853
+ * Licensed under EUPL, Version 1.2 (the "License");
1854
+ * you may not use this file except in compliance with the License.
1855
+ * You may obtain a copy of the License at
1856
+ *
1857
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1858
+ *
1859
+ * Unless required by applicable law or agreed to in writing, software
1860
+ * distributed under the License is distributed on an "AS IS" basis,
1861
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1862
+ * See the License for the specific language governing permissions and
1863
+ * limitations under the License.
1864
+ */
1865
+
1866
+ /*
1867
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
1868
+ *
1869
+ * Licensed under EUPL, Version 1.2 (the "License");
1870
+ * you may not use this file except in compliance with the License.
1871
+ * You may obtain a copy of the License at
1872
+ *
1873
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1874
+ *
1875
+ * Unless required by applicable law or agreed to in writing, software
1876
+ * distributed under the License is distributed on an "AS IS" basis,
1877
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1878
+ * See the License for the specific language governing permissions and
1879
+ * limitations under the License.
1880
+ */
1881
+
1882
+ /*
1883
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
1884
+ *
1885
+ * Licensed under EUPL, Version 1.2 (the "License");
1886
+ * you may not use this file except in compliance with the License.
1887
+ * You may obtain a copy of the License at
1888
+ *
1889
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1890
+ *
1891
+ * Unless required by applicable law or agreed to in writing, software
1892
+ * distributed under the License is distributed on an "AS IS" basis,
1893
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1894
+ * See the License for the specific language governing permissions and
1895
+ * limitations under the License.
1896
+ */
1897
+ class ProcessLinkModule {
1898
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1899
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkModule, declarations: [ProcessLinkComponent,
1900
+ FormLinkProcessDiagramComponent,
1901
+ SelectPluginConfigurationComponent,
1902
+ SelectPluginActionComponent,
1903
+ PluginActionConfigurationComponent,
1904
+ ProcessLinkModalComponent,
1905
+ ChooseProcessLinkTypeComponent,
1906
+ SelectFormComponent,
1907
+ FormFlowComponent,
1908
+ SelectFormFlowComponent,
1909
+ FormFlowConfigurationContainerComponent], imports: [CommonModule,
1910
+ ProcessLinkRoutingModule,
1911
+ FormsModule,
1912
+ ModalModule,
1913
+ SearchableDropdownSelectModule,
1914
+ TranslateModule,
1915
+ StepperModule,
1916
+ VModalModule,
1917
+ VCardModule,
1918
+ PluginTranslatePipeModule,
1919
+ ParagraphModule,
1920
+ PluginConfigurationContainerModule,
1921
+ ButtonModule,
1922
+ TitleModule,
1923
+ ModalModule$1,
1924
+ ProgressIndicatorModule,
1925
+ ButtonModule$1,
1926
+ IconModule,
1927
+ TooltipModule,
1928
+ ComboBoxModule,
1929
+ InputModule,
1930
+ TooltipIconModule,
1931
+ LoadingModule,
1932
+ FormIoModule,
1933
+ ValtimoCdsModalDirectiveModule,
1934
+ StructuredListModule,
1935
+ TilesModule,
1936
+ RenderInPageHeaderDirectiveModule,
1937
+ SelectModule], exports: [ProcessLinkComponent,
1938
+ SelectPluginConfigurationComponent,
1939
+ SelectPluginActionComponent,
1940
+ PluginActionConfigurationComponent,
1941
+ ProcessLinkModalComponent,
1942
+ FormFlowComponent] }); }
1943
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkModule, imports: [CommonModule,
1944
+ ProcessLinkRoutingModule,
1945
+ FormsModule,
1946
+ ModalModule,
1947
+ SearchableDropdownSelectModule,
1948
+ TranslateModule,
1949
+ StepperModule,
1950
+ VModalModule,
1951
+ VCardModule,
1952
+ PluginTranslatePipeModule,
1953
+ ParagraphModule,
1954
+ PluginConfigurationContainerModule,
1955
+ ButtonModule,
1956
+ TitleModule,
1957
+ ModalModule$1,
1958
+ ProgressIndicatorModule,
1959
+ ButtonModule$1,
1960
+ IconModule,
1961
+ TooltipModule,
1962
+ ComboBoxModule,
1963
+ InputModule,
1964
+ TooltipIconModule,
1965
+ LoadingModule,
1966
+ FormIoModule,
1967
+ ValtimoCdsModalDirectiveModule,
1968
+ StructuredListModule,
1969
+ TilesModule,
1970
+ RenderInPageHeaderDirectiveModule,
1971
+ SelectModule] }); }
1972
+ }
1973
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProcessLinkModule, decorators: [{
1974
+ type: NgModule,
1975
+ args: [{
1976
+ declarations: [
1977
+ ProcessLinkComponent,
1978
+ FormLinkProcessDiagramComponent,
1979
+ SelectPluginConfigurationComponent,
1980
+ SelectPluginActionComponent,
1981
+ PluginActionConfigurationComponent,
1982
+ ProcessLinkModalComponent,
1983
+ ChooseProcessLinkTypeComponent,
1984
+ SelectFormComponent,
1985
+ FormFlowComponent,
1986
+ SelectFormFlowComponent,
1987
+ FormFlowConfigurationContainerComponent,
1988
+ ],
1989
+ imports: [
1990
+ CommonModule,
1991
+ ProcessLinkRoutingModule,
1992
+ FormsModule,
1993
+ ModalModule,
1994
+ SearchableDropdownSelectModule,
1995
+ TranslateModule,
1996
+ StepperModule,
1997
+ VModalModule,
1998
+ VCardModule,
1999
+ PluginTranslatePipeModule,
2000
+ ParagraphModule,
2001
+ PluginConfigurationContainerModule,
2002
+ ButtonModule,
2003
+ TitleModule,
2004
+ ModalModule$1,
2005
+ ProgressIndicatorModule,
2006
+ ButtonModule$1,
2007
+ IconModule,
2008
+ TooltipModule,
2009
+ ComboBoxModule,
2010
+ InputModule,
2011
+ TooltipIconModule,
2012
+ LoadingModule,
2013
+ FormIoModule,
2014
+ ValtimoCdsModalDirectiveModule,
2015
+ StructuredListModule,
2016
+ TilesModule,
2017
+ RenderInPageHeaderDirectiveModule,
2018
+ SelectModule,
2019
+ ],
2020
+ exports: [
2021
+ ProcessLinkComponent,
2022
+ SelectPluginConfigurationComponent,
2023
+ SelectPluginActionComponent,
2024
+ PluginActionConfigurationComponent,
2025
+ ProcessLinkModalComponent,
2026
+ FormFlowComponent,
2027
+ ],
2028
+ }]
2029
+ }] });
2030
+
2031
+ /*
2032
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
2033
+ *
2034
+ * Licensed under EUPL, Version 1.2 (the "License");
2035
+ * you may not use this file except in compliance with the License.
2036
+ * You may obtain a copy of the License at
2037
+ *
2038
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2039
+ *
2040
+ * Unless required by applicable law or agreed to in writing, software
2041
+ * distributed under the License is distributed on an "AS IS" basis,
2042
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2043
+ * See the License for the specific language governing permissions and
2044
+ * limitations under the License.
2045
+ */
2046
+
2047
+ /*
2048
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
2049
+ *
2050
+ * Licensed under EUPL, Version 1.2 (the "License");
2051
+ * you may not use this file except in compliance with the License.
2052
+ * You may obtain a copy of the License at
2053
+ *
2054
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2055
+ *
2056
+ * Unless required by applicable law or agreed to in writing, software
2057
+ * distributed under the License is distributed on an "AS IS" basis,
2058
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2059
+ * See the License for the specific language governing permissions and
2060
+ * limitations under the License.
2061
+ */
2062
+
2063
+ /*
2064
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
2065
+ *
2066
+ * Licensed under EUPL, Version 1.2 (the "License");
2067
+ * you may not use this file except in compliance with the License.
2068
+ * You may obtain a copy of the License at
2069
+ *
2070
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2071
+ *
2072
+ * Unless required by applicable law or agreed to in writing, software
2073
+ * distributed under the License is distributed on an "AS IS" basis,
2074
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2075
+ * See the License for the specific language governing permissions and
2076
+ * limitations under the License.
2077
+ */
2078
+
2079
+ /*
2080
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
2081
+ *
2082
+ * Licensed under EUPL, Version 1.2 (the "License");
2083
+ * you may not use this file except in compliance with the License.
2084
+ * You may obtain a copy of the License at
2085
+ *
2086
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2087
+ *
2088
+ * Unless required by applicable law or agreed to in writing, software
2089
+ * distributed under the License is distributed on an "AS IS" basis,
2090
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2091
+ * See the License for the specific language governing permissions and
2092
+ * limitations under the License.
2093
+ */
2094
+
2095
+ /*
2096
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
2097
+ *
2098
+ * Licensed under EUPL, Version 1.2 (the "License");
2099
+ * you may not use this file except in compliance with the License.
2100
+ * You may obtain a copy of the License at
2101
+ *
2102
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2103
+ *
2104
+ * Unless required by applicable law or agreed to in writing, software
2105
+ * distributed under the License is distributed on an "AS IS" basis,
2106
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2107
+ * See the License for the specific language governing permissions and
2108
+ * limitations under the License.
2109
+ */
2110
+ /*
2111
+ * Public API Surface of process-link
2112
+ */
2113
+
2114
+ /**
2115
+ * Generated bundle index. Do not edit.
2116
+ */
2117
+
2118
+ export { ChooseProcessLinkTypeComponent, FORM_FLOW_COMPONENT_TOKEN, FormFlowComponent, FormFlowService, PluginActionConfigurationComponent, ProcessLinkComponent, ProcessLinkModalComponent, ProcessLinkModule, ProcessLinkService, SelectPluginActionComponent, SelectPluginConfigurationComponent };
2119
+ //# sourceMappingURL=valtimo-process-link.mjs.map