@valtimo/migration 4.23.0 → 5.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 (40) hide show
  1. package/esm2020/lib/migration-process-diagram/migration-process-diagram.component.mjs +73 -0
  2. package/esm2020/lib/migration-routing.module.mjs +44 -0
  3. package/esm2020/lib/migration.component.mjs +175 -0
  4. package/esm2020/lib/migration.module.mjs +57 -0
  5. package/esm2020/lib/migration.service.mjs +29 -0
  6. package/esm2020/public-api.mjs +22 -0
  7. package/esm2020/valtimo-migration.mjs +5 -0
  8. package/fesm2015/valtimo-migration.mjs +386 -0
  9. package/fesm2015/valtimo-migration.mjs.map +1 -0
  10. package/fesm2020/valtimo-migration.mjs +386 -0
  11. package/fesm2020/valtimo-migration.mjs.map +1 -0
  12. package/lib/migration-process-diagram/migration-process-diagram.component.d.ts +4 -0
  13. package/lib/migration-process-diagram/migration-process-diagram.component.d.ts.map +1 -0
  14. package/lib/migration-routing.module.d.ts +7 -0
  15. package/lib/migration-routing.module.d.ts.map +1 -0
  16. package/lib/migration.component.d.ts +4 -0
  17. package/lib/migration.component.d.ts.map +1 -0
  18. package/lib/migration.module.d.ts +12 -0
  19. package/lib/migration.module.d.ts.map +1 -0
  20. package/lib/migration.service.d.ts +4 -0
  21. package/lib/migration.service.d.ts.map +1 -0
  22. package/package.json +22 -10
  23. package/public-api.d.ts +1 -0
  24. package/public-api.d.ts.map +1 -0
  25. package/valtimo-migration.d.ts +2 -2
  26. package/valtimo-migration.d.ts.map +1 -0
  27. package/bundles/valtimo-migration.umd.js +0 -390
  28. package/bundles/valtimo-migration.umd.js.map +0 -1
  29. package/bundles/valtimo-migration.umd.min.js +0 -2
  30. package/bundles/valtimo-migration.umd.min.js.map +0 -1
  31. package/esm2015/lib/migration-process-diagram/migration-process-diagram.component.js +0 -74
  32. package/esm2015/lib/migration-routing.module.js +0 -40
  33. package/esm2015/lib/migration.component.js +0 -175
  34. package/esm2015/lib/migration.module.js +0 -40
  35. package/esm2015/lib/migration.service.js +0 -28
  36. package/esm2015/public-api.js +0 -22
  37. package/esm2015/valtimo-migration.js +0 -7
  38. package/fesm2015/valtimo-migration.js +0 -366
  39. package/fesm2015/valtimo-migration.js.map +0 -1
  40. package/valtimo-migration.metadata.json +0 -1
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Generated bundle index. Do not edit.
3
3
  */
4
+ /// <amd-module name="@valtimo/migration" />
4
5
  export * from './public-api';
5
- export { MigrationProcessDiagramComponent as ɵa } from './lib/migration-process-diagram/migration-process-diagram.component';
6
- export { MigrationRoutingModule as ɵb } from './lib/migration-routing.module';
6
+ //# sourceMappingURL=valtimo-migration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"valtimo-migration.d.ts","sourceRoot":"","sources":["../../../projects/valtimo/migration/src/valtimo-migration.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,cAAc,cAAc,CAAC"}
@@ -1,390 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@valtimo/process'), require('ngx-logger'), require('@valtimo/components'), require('@angular/router'), require('@angular/common'), require('@valtimo/security'), require('@valtimo/config'), require('@angular/forms'), require('bpmn-js/dist/bpmn-navigated-viewer.production.min.js'), require('@ngx-translate/core')) :
3
- typeof define === 'function' && define.amd ? define('@valtimo/migration', ['exports', '@angular/core', '@valtimo/process', 'ngx-logger', '@valtimo/components', '@angular/router', '@angular/common', '@valtimo/security', '@valtimo/config', '@angular/forms', 'bpmn-js/dist/bpmn-navigated-viewer.production.min.js', '@ngx-translate/core'], factory) :
4
- (global = global || self, factory((global.valtimo = global.valtimo || {}, global.valtimo.migration = {}), global.ng.core, global.process, global.ngxLogger, global.components, global.ng.router, global.ng.common, global.security, global.config, global.ng.forms, global.BpmnJS, global.core));
5
- }(this, (function (exports, i0, process, ngxLogger, components, router, common, security, config, forms, BpmnJS, core) { 'use strict';
6
-
7
- /*
8
- * Copyright 2015-2020 Ritense BV, the Netherlands.
9
- *
10
- * Licensed under EUPL, Version 1.2 (the "License");
11
- * you may not use this file except in compliance with the License.
12
- * You may obtain a copy of the License at
13
- *
14
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
15
- *
16
- * Unless required by applicable law or agreed to in writing, software
17
- * distributed under the License is distributed on an "AS IS" basis,
18
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- * See the License for the specific language governing permissions and
20
- * limitations under the License.
21
- */
22
- var MigrationService = /** @class */ (function () {
23
- function MigrationService() {
24
- }
25
- return MigrationService;
26
- }());
27
- MigrationService.ɵprov = i0.ɵɵdefineInjectable({ factory: function MigrationService_Factory() { return new MigrationService(); }, token: MigrationService, providedIn: "root" });
28
- MigrationService.decorators = [
29
- { type: i0.Injectable, args: [{
30
- providedIn: 'root',
31
- },] }
32
- ];
33
- MigrationService.ctorParameters = function () { return []; };
34
-
35
- /*
36
- * Copyright 2015-2020 Ritense BV, the Netherlands.
37
- *
38
- * Licensed under EUPL, Version 1.2 (the "License");
39
- * you may not use this file except in compliance with the License.
40
- * You may obtain a copy of the License at
41
- *
42
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
43
- *
44
- * Unless required by applicable law or agreed to in writing, software
45
- * distributed under the License is distributed on an "AS IS" basis,
46
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
47
- * See the License for the specific language governing permissions and
48
- * limitations under the License.
49
- */
50
- var MigrationComponent = /** @class */ (function () {
51
- function MigrationComponent(processService, logger, alertService) {
52
- this.processService = processService;
53
- this.logger = logger;
54
- this.alertService = alertService;
55
- this.processDefinitions = [];
56
- this.selectedVersions = {
57
- source: [],
58
- target: [],
59
- };
60
- this.selectedId = {
61
- source: null,
62
- target: null,
63
- };
64
- this.loaded = {
65
- source: false,
66
- target: false,
67
- };
68
- this.fields = {
69
- source: {
70
- definition: null,
71
- version: null,
72
- },
73
- target: {
74
- definition: null,
75
- version: null,
76
- },
77
- };
78
- this.processCount = null;
79
- this.uniqueFlowNodeMap = [];
80
- this.taskMapping = {};
81
- this.diagram = null;
82
- }
83
- MigrationComponent.prototype.ngOnInit = function () {
84
- this.loadProcessDefinitions();
85
- };
86
- MigrationComponent.prototype.ngAfterViewInit = function () {
87
- this.diagram = {
88
- source: this.sourceDiagram,
89
- target: this.targetDiagram,
90
- };
91
- };
92
- Object.defineProperty(MigrationComponent.prototype, "taskMappingLength", {
93
- get: function () {
94
- return Object.keys(this.taskMapping).length;
95
- },
96
- enumerable: false,
97
- configurable: true
98
- });
99
- MigrationComponent.prototype.loadProcessDefinitions = function () {
100
- var _this = this;
101
- this.processService
102
- .getProcessDefinitions()
103
- .subscribe(function (processDefinitions) {
104
- _this.processDefinitions = processDefinitions;
105
- });
106
- };
107
- MigrationComponent.prototype.loadProcessDefinitionVersions = function (key, type) {
108
- var _this = this;
109
- this.fields[type].definition = key;
110
- this.selectedVersions[type] = [];
111
- this.clearProcess(type);
112
- if (key) {
113
- this.processService
114
- .getProcessDefinitionVersions(key)
115
- .subscribe(function (processDefinitionVersions) {
116
- _this.selectedVersions[type] = processDefinitionVersions;
117
- });
118
- }
119
- };
120
- MigrationComponent.prototype.loadProcess = function (id, type) {
121
- this.fields[type].version = id;
122
- this.clearProcess(type);
123
- if (id) {
124
- this.loadProcessDefinitionXML(id, type);
125
- if (type === 'source') {
126
- this.loadProcessCount(id);
127
- }
128
- }
129
- };
130
- MigrationComponent.prototype.clearProcess = function (type) {
131
- this.loaded[type] = false;
132
- this.selectedId[type] = null;
133
- this.diagram[type].clear();
134
- if (type === 'source') {
135
- this.processCount = null;
136
- }
137
- };
138
- MigrationComponent.prototype.loadProcessDefinitionXML = function (id, type) {
139
- var _this = this;
140
- this.processService.getProcessDefinitionXml(id).subscribe(function (xml) {
141
- _this.diagram[type].loadXml(xml['bpmn20Xml']);
142
- _this.selectedId[type] = id;
143
- });
144
- };
145
- MigrationComponent.prototype.loadProcessCount = function (id) {
146
- var _this = this;
147
- this.processService.getProcessCount(id).subscribe(function (response) {
148
- _this.processCount = response.count;
149
- });
150
- };
151
- MigrationComponent.prototype.setUniqueFlowNodeMap = function () {
152
- this.uniqueFlowNodeMap = [];
153
- var sourceFlowNodeMap = this.sourceDiagram.flowNodeMap;
154
- var targetFlowNodeMap = this.targetDiagram.flowNodeMap;
155
- if (sourceFlowNodeMap != null && targetFlowNodeMap != null) {
156
- this.uniqueFlowNodeMap = sourceFlowNodeMap.filter(function (sourceFlowNode) { return !targetFlowNodeMap.some(function (targetFlowNode) { return sourceFlowNode.id === targetFlowNode.id &&
157
- sourceFlowNode.$type === targetFlowNode.$type; }); });
158
- }
159
- };
160
- MigrationComponent.prototype.getFilteredTargetFlowNodeMap = function (flowNodeType) {
161
- var targetFlowNodeMap = this.targetDiagram.flowNodeMap;
162
- return targetFlowNodeMap.filter(function (flowNode) {
163
- return flowNode.$type === flowNodeType;
164
- });
165
- };
166
- MigrationComponent.prototype.diagramLoaded = function (diagramName) {
167
- this.loaded[diagramName] = true;
168
- if (this.loaded.source && this.loaded.target) {
169
- this.taskMapping = {};
170
- this.setUniqueFlowNodeMap();
171
- }
172
- };
173
- MigrationComponent.prototype.migrateProcess = function () {
174
- var _this = this;
175
- this.processService
176
- .migrateProcess(this.selectedId.source, this.selectedId.target, this.taskMapping)
177
- .subscribe(function (res) {
178
- _this.alertService.success('Process successfully migrated!');
179
- _this.clearProcess('source');
180
- _this.clearProcess('target');
181
- _this.fields = {
182
- source: {
183
- definition: null,
184
- version: null,
185
- },
186
- target: {
187
- definition: null,
188
- version: null,
189
- },
190
- };
191
- }, function (err) {
192
- _this.alertService.error('Process migration failed!');
193
- _this.logger.debug(err);
194
- });
195
- };
196
- return MigrationComponent;
197
- }());
198
- MigrationComponent.decorators = [
199
- { type: i0.Component, args: [{
200
- selector: 'valtimo-migration',
201
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"row mb-5\">\n <div class=\"col-12\">\n <div class=\"alert alert-warning pl-2 plr-2\" role=\"alert\">\n <div class=\"icon\"><span class=\"mdi mdi-alert-triangle\"></span></div>\n <div class=\"message\" [innerHTML]=\"'Process migration warning' | translate\"></div>\n </div>\n </div>\n </div>\n <div class=\"row mb-5\">\n <div class=\"col-4\">\n <label for=\"sourceDef\">Source Definition</label>\n <select\n class=\"form-control\"\n id=\"sourceDef\"\n [ngModel]=\"fields.source.definition\"\n (ngModelChange)=\"loadProcessDefinitionVersions($event, 'source')\"\n >\n <option [ngValue]=\"null\" selected>- Source Definition -</option>\n <option *ngFor=\"let processDef of processDefinitions\" [ngValue]=\"processDef.key\">\n {{ processDef.name }}\n </option>\n </select>\n </div>\n <div class=\"col-2\">\n <label for=\"sourceVer\">Source Version</label>\n <select\n class=\"form-control\"\n id=\"sourceVer\"\n [ngModel]=\"fields.source.version\"\n (ngModelChange)=\"loadProcess($event, 'source')\"\n >\n <option [ngValue]=\"null\" selected>- Source Version -</option>\n <option *ngFor=\"let processVer of selectedVersions.source\" [ngValue]=\"processVer.id\">\n {{ processVer.version }}\n </option>\n </select>\n </div>\n <div class=\"col-4\">\n <label for=\"targetDef\">Target Definition</label>\n <select\n class=\"form-control\"\n id=\"targetDef\"\n [ngModel]=\"fields.target.definition\"\n (ngModelChange)=\"loadProcessDefinitionVersions($event, 'target')\"\n >\n <option [ngValue]=\"null\" selected>- Target Definition -</option>\n <option *ngFor=\"let processDef of processDefinitions\" [ngValue]=\"processDef.key\">\n {{ processDef.name }}\n </option>\n </select>\n </div>\n <div class=\"col-2\">\n <label for=\"targetVer\">Target Version</label>\n <select\n class=\"form-control\"\n id=\"targetVer\"\n [ngModel]=\"fields.target.version\"\n (ngModelChange)=\"loadProcess($event, 'target')\"\n >\n <option [ngValue]=\"null\" selected>- Target Version -</option>\n <option *ngFor=\"let processVer of selectedVersions.target\" [ngValue]=\"processVer.id\">\n {{ processVer.version }}\n </option>\n </select>\n </div>\n </div>\n\n <div class=\"row mb-5\">\n <div class=\"col-6\">\n <valtimo-migration-process-diagram\n name=\"source\"\n (loaded)=\"diagramLoaded($event)\"\n #sourceDiagram\n ></valtimo-migration-process-diagram>\n </div>\n <div class=\"col-6\">\n <valtimo-migration-process-diagram\n name=\"target\"\n (loaded)=\"diagramLoaded($event)\"\n #targetDiagram\n ></valtimo-migration-process-diagram>\n </div>\n </div>\n <table class=\"table table-striped mb-5\" *ngIf=\"selectedId.source && selectedId.target\">\n <tr *ngFor=\"let node of uniqueFlowNodeMap\">\n <td>{{ node.name ? node.name : node.id }}</td>\n <td>\n <select class=\"form-control\" (change)=\"taskMapping[node.id] = $event.target.value\">\n <option [value]=\"null\" disabled selected>- Choose Target -</option>\n <option\n *ngFor=\"let targetFlowNode of getFilteredTargetFlowNodeMap(node.$type)\"\n [value]=\"targetFlowNode.id\"\n >\n {{ targetFlowNode.name ? targetFlowNode.name : targetFlowNode.id }}\n </option>\n </select>\n </td>\n </tr>\n </table>\n <hr />\n <div class=\"btn-group mb-5\">\n <button\n [disabled]=\"\n (uniqueFlowNodeMap.length !== taskMappingLength && uniqueFlowNodeMap.length > 0) ||\n !loaded.source ||\n !loaded.target\n \"\n (click)=\"migrateProcess()\"\n class=\"btn btn-primary\"\n >\n Migrate\n <span *ngIf=\"processCount !== null\" class=\"badge badge-pill badge-secondary\">{{\n processCount\n }}</span>\n </button>\n </div>\n </div>\n</div>\n",
202
- styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */"]
203
- },] }
204
- ];
205
- MigrationComponent.ctorParameters = function () { return [
206
- { type: process.ProcessService },
207
- { type: ngxLogger.NGXLogger },
208
- { type: components.AlertService }
209
- ]; };
210
- MigrationComponent.propDecorators = {
211
- sourceDiagram: [{ type: i0.ViewChild, args: ['sourceDiagram',] }],
212
- targetDiagram: [{ type: i0.ViewChild, args: ['targetDiagram',] }]
213
- };
214
-
215
- /*
216
- * Copyright 2015-2020 Ritense BV, the Netherlands.
217
- *
218
- * Licensed under EUPL, Version 1.2 (the "License");
219
- * you may not use this file except in compliance with the License.
220
- * You may obtain a copy of the License at
221
- *
222
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
223
- *
224
- * Unless required by applicable law or agreed to in writing, software
225
- * distributed under the License is distributed on an "AS IS" basis,
226
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
227
- * See the License for the specific language governing permissions and
228
- * limitations under the License.
229
- */
230
- var ɵ0 = { title: 'Process migration', roles: [config.ROLE_ADMIN] };
231
- var routes = [
232
- {
233
- path: 'process-migration',
234
- component: MigrationComponent,
235
- canActivate: [security.AuthGuardService],
236
- data: ɵ0,
237
- },
238
- ];
239
- var MigrationRoutingModule = /** @class */ (function () {
240
- function MigrationRoutingModule() {
241
- }
242
- return MigrationRoutingModule;
243
- }());
244
- MigrationRoutingModule.decorators = [
245
- { type: i0.NgModule, args: [{
246
- imports: [common.CommonModule, router.RouterModule.forChild(routes)],
247
- exports: [router.RouterModule],
248
- },] }
249
- ];
250
-
251
- /*
252
- * Copyright 2015-2020 Ritense BV, the Netherlands.
253
- *
254
- * Licensed under EUPL, Version 1.2 (the "License");
255
- * you may not use this file except in compliance with the License.
256
- * You may obtain a copy of the License at
257
- *
258
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
259
- *
260
- * Unless required by applicable law or agreed to in writing, software
261
- * distributed under the License is distributed on an "AS IS" basis,
262
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
263
- * See the License for the specific language governing permissions and
264
- * limitations under the License.
265
- */
266
- var MigrationProcessDiagramComponent = /** @class */ (function () {
267
- function MigrationProcessDiagramComponent(logger) {
268
- this.logger = logger;
269
- this.flowNodeMap = null;
270
- this.loaded = new i0.EventEmitter();
271
- }
272
- MigrationProcessDiagramComponent.prototype.ngOnInit = function () {
273
- var _this = this;
274
- this.bpmnJS = new BpmnJS();
275
- this.bpmnJS.on('import.done', function (_a) {
276
- var error = _a.error;
277
- if (!error) {
278
- var canvas = _this.bpmnJS.get('canvas');
279
- canvas.zoom('fit-viewport', 'auto');
280
- }
281
- });
282
- };
283
- MigrationProcessDiagramComponent.prototype.ngOnDestroy = function () {
284
- if (this.bpmnJS) {
285
- this.bpmnJS.destroy();
286
- }
287
- };
288
- MigrationProcessDiagramComponent.prototype.clear = function () {
289
- this.bpmnJS.clear();
290
- };
291
- MigrationProcessDiagramComponent.prototype.loadXml = function (xml) {
292
- var _this = this;
293
- this.bpmnJS.attachTo(this.el.nativeElement);
294
- this.bpmnJS.importXML(xml, function (err) {
295
- _this.logger.debug(err);
296
- var processElements = _this.bpmnJS.getDefinitions().rootElements.filter(function (element) {
297
- return element.isExecutable;
298
- });
299
- _this.flowNodeMap = processElements[0].flowElements.filter(function (element) {
300
- if (element.name === null || element.name === '') {
301
- element.name = element.id;
302
- }
303
- return element.$type !== 'bpmn:SequenceFlow';
304
- });
305
- _this.loaded.emit(_this.name);
306
- });
307
- };
308
- return MigrationProcessDiagramComponent;
309
- }());
310
- MigrationProcessDiagramComponent.decorators = [
311
- { type: i0.Component, args: [{
312
- selector: 'valtimo-migration-process-diagram',
313
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div #ref class=\"diagram-container\"></div>\n",
314
- styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.diagram-container-switch-holder{width:100%;z-index:1000}.diagram-container{height:48vh}"]
315
- },] }
316
- ];
317
- MigrationProcessDiagramComponent.ctorParameters = function () { return [
318
- { type: ngxLogger.NGXLogger }
319
- ]; };
320
- MigrationProcessDiagramComponent.propDecorators = {
321
- el: [{ type: i0.ViewChild, args: ['ref',] }],
322
- name: [{ type: i0.Input }],
323
- loaded: [{ type: i0.Output }]
324
- };
325
-
326
- /*
327
- * Copyright 2015-2020 Ritense BV, the Netherlands.
328
- *
329
- * Licensed under EUPL, Version 1.2 (the "License");
330
- * you may not use this file except in compliance with the License.
331
- * You may obtain a copy of the License at
332
- *
333
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
334
- *
335
- * Unless required by applicable law or agreed to in writing, software
336
- * distributed under the License is distributed on an "AS IS" basis,
337
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
338
- * See the License for the specific language governing permissions and
339
- * limitations under the License.
340
- */
341
- var MigrationModule = /** @class */ (function () {
342
- function MigrationModule() {
343
- }
344
- return MigrationModule;
345
- }());
346
- MigrationModule.decorators = [
347
- { type: i0.NgModule, args: [{
348
- declarations: [MigrationComponent, MigrationProcessDiagramComponent],
349
- imports: [
350
- common.CommonModule,
351
- MigrationRoutingModule,
352
- forms.ReactiveFormsModule,
353
- components.WidgetModule,
354
- forms.FormsModule,
355
- core.TranslateModule,
356
- ],
357
- exports: [MigrationComponent],
358
- },] }
359
- ];
360
-
361
- /*
362
- * Copyright 2015-2020 Ritense BV, the Netherlands.
363
- *
364
- * Licensed under EUPL, Version 1.2 (the "License");
365
- * you may not use this file except in compliance with the License.
366
- * You may obtain a copy of the License at
367
- *
368
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
369
- *
370
- * Unless required by applicable law or agreed to in writing, software
371
- * distributed under the License is distributed on an "AS IS" basis,
372
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
373
- * See the License for the specific language governing permissions and
374
- * limitations under the License.
375
- */
376
-
377
- /**
378
- * Generated bundle index. Do not edit.
379
- */
380
-
381
- exports.MigrationComponent = MigrationComponent;
382
- exports.MigrationModule = MigrationModule;
383
- exports.MigrationService = MigrationService;
384
- exports.ɵa = MigrationProcessDiagramComponent;
385
- exports.ɵb = MigrationRoutingModule;
386
-
387
- Object.defineProperty(exports, '__esModule', { value: true });
388
-
389
- })));
390
- //# sourceMappingURL=valtimo-migration.umd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"valtimo-migration.umd.js","sources":["../../../../projects/valtimo/migration/src/lib/migration.service.ts","../../../../projects/valtimo/migration/src/lib/migration.component.ts","../../../../projects/valtimo/migration/src/lib/migration-routing.module.ts","../../../../projects/valtimo/migration/src/lib/migration-process-diagram/migration-process-diagram.component.ts","../../../../projects/valtimo/migration/src/lib/migration.module.ts","../../../../projects/valtimo/migration/src/public-api.ts","../../../../projects/valtimo/migration/src/valtimo-migration.ts"],"sourcesContent":["/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable} from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MigrationService {\n constructor() {}\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {AfterViewInit, Component, OnInit, ViewChild} from '@angular/core';\nimport {ProcessService, ProcessDefinition} from '@valtimo/process';\nimport {MigrationProcessDiagramComponent} from './migration-process-diagram/migration-process-diagram.component';\nimport {NGXLogger} from 'ngx-logger';\nimport {AlertService} from '@valtimo/components';\n\n@Component({\n selector: 'valtimo-migration',\n templateUrl: './migration.component.html',\n styleUrls: ['./migration.component.scss'],\n})\nexport class MigrationComponent implements OnInit, AfterViewInit {\n public processDefinitions: ProcessDefinition[] = [];\n public selectedVersions = {\n source: [],\n target: [],\n };\n public selectedId = {\n source: null,\n target: null,\n };\n public loaded = {\n source: false,\n target: false,\n };\n public fields = {\n source: {\n definition: null,\n version: null,\n },\n target: {\n definition: null,\n version: null,\n },\n };\n\n public processCount: number | null = null;\n public uniqueFlowNodeMap: any[] = [];\n public taskMapping: any = {};\n\n @ViewChild('sourceDiagram') sourceDiagram: MigrationProcessDiagramComponent;\n @ViewChild('targetDiagram') targetDiagram: MigrationProcessDiagramComponent;\n\n public diagram: any = null;\n\n constructor(\n private processService: ProcessService,\n private logger: NGXLogger,\n private alertService: AlertService\n ) {}\n\n ngOnInit() {\n this.loadProcessDefinitions();\n }\n\n ngAfterViewInit() {\n this.diagram = {\n source: this.sourceDiagram,\n target: this.targetDiagram,\n };\n }\n\n public get taskMappingLength() {\n return Object.keys(this.taskMapping).length;\n }\n\n loadProcessDefinitions() {\n this.processService\n .getProcessDefinitions()\n .subscribe((processDefinitions: ProcessDefinition[]) => {\n this.processDefinitions = processDefinitions;\n });\n }\n\n loadProcessDefinitionVersions(key: string | null, type: string) {\n this.fields[type].definition = key;\n this.selectedVersions[type] = [];\n this.clearProcess(type);\n if (key) {\n this.processService\n .getProcessDefinitionVersions(key)\n .subscribe((processDefinitionVersions: ProcessDefinition[]) => {\n this.selectedVersions[type] = processDefinitionVersions;\n });\n }\n }\n\n loadProcess(id: string | null, type: string) {\n this.fields[type].version = id;\n this.clearProcess(type);\n if (id) {\n this.loadProcessDefinitionXML(id, type);\n if (type === 'source') {\n this.loadProcessCount(id);\n }\n }\n }\n\n private clearProcess(type: string) {\n this.loaded[type] = false;\n this.selectedId[type] = null;\n this.diagram[type].clear();\n if (type === 'source') {\n this.processCount = null;\n }\n }\n\n loadProcessDefinitionXML(id: string, type: string) {\n this.processService.getProcessDefinitionXml(id).subscribe(xml => {\n this.diagram[type].loadXml(xml['bpmn20Xml']);\n this.selectedId[type] = id;\n });\n }\n\n loadProcessCount(id: string) {\n this.processService.getProcessCount(id).subscribe(response => {\n this.processCount = response.count;\n });\n }\n\n setUniqueFlowNodeMap() {\n this.uniqueFlowNodeMap = [];\n const sourceFlowNodeMap = this.sourceDiagram.flowNodeMap;\n const targetFlowNodeMap = this.targetDiagram.flowNodeMap;\n\n if (sourceFlowNodeMap != null && targetFlowNodeMap != null) {\n this.uniqueFlowNodeMap = sourceFlowNodeMap.filter(\n sourceFlowNode =>\n !targetFlowNodeMap.some(\n targetFlowNode =>\n sourceFlowNode.id === targetFlowNode.id &&\n sourceFlowNode.$type === targetFlowNode.$type\n )\n );\n }\n }\n\n getFilteredTargetFlowNodeMap(flowNodeType) {\n const targetFlowNodeMap = this.targetDiagram.flowNodeMap;\n return targetFlowNodeMap.filter(function (flowNode) {\n return flowNode.$type === flowNodeType;\n });\n }\n\n diagramLoaded(diagramName: string) {\n this.loaded[diagramName] = true;\n if (this.loaded.source && this.loaded.target) {\n this.taskMapping = {};\n this.setUniqueFlowNodeMap();\n }\n }\n\n migrateProcess() {\n this.processService\n .migrateProcess(this.selectedId.source, this.selectedId.target, this.taskMapping)\n .subscribe(\n res => {\n this.alertService.success('Process successfully migrated!');\n this.clearProcess('source');\n this.clearProcess('target');\n this.fields = {\n source: {\n definition: null,\n version: null,\n },\n target: {\n definition: null,\n version: null,\n },\n };\n },\n err => {\n this.alertService.error('Process migration failed!');\n this.logger.debug(err);\n }\n );\n }\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {RouterModule, Routes} from '@angular/router';\nimport {CommonModule} from '@angular/common';\nimport {AuthGuardService} from '@valtimo/security';\nimport {MigrationComponent} from './migration.component';\nimport {ROLE_ADMIN} from '@valtimo/config';\n\nconst routes: Routes = [\n {\n path: 'process-migration',\n component: MigrationComponent,\n canActivate: [AuthGuardService],\n data: {title: 'Process migration', roles: [ROLE_ADMIN]},\n },\n];\n\n@NgModule({\n imports: [CommonModule, RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class MigrationRoutingModule {}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewChild,\n} from '@angular/core';\n\nimport * as BpmnJS from 'bpmn-js/dist/bpmn-navigated-viewer.production.min.js';\nimport {NGXLogger} from 'ngx-logger';\n\n@Component({\n selector: 'valtimo-migration-process-diagram',\n templateUrl: './migration-process-diagram.component.html',\n styleUrls: ['./migration-process-diagram.component.scss'],\n})\nexport class MigrationProcessDiagramComponent implements OnInit, OnDestroy {\n private bpmnJS: BpmnJS;\n public flowNodeMap: any = null;\n\n @ViewChild('ref') public el: ElementRef;\n @Input() name: string;\n @Output() loaded = new EventEmitter();\n\n constructor(private logger: NGXLogger) {}\n\n ngOnInit() {\n this.bpmnJS = new BpmnJS();\n this.bpmnJS.on('import.done', ({error}: any) => {\n if (!error) {\n const canvas = this.bpmnJS.get('canvas');\n canvas.zoom('fit-viewport', 'auto');\n }\n });\n }\n\n ngOnDestroy() {\n if (this.bpmnJS) {\n this.bpmnJS.destroy();\n }\n }\n\n clear() {\n this.bpmnJS.clear();\n }\n\n public loadXml(xml: string): void {\n this.bpmnJS.attachTo(this.el.nativeElement);\n this.bpmnJS.importXML(xml, err => {\n this.logger.debug(err);\n const processElements = this.bpmnJS.getDefinitions().rootElements.filter(function (element) {\n return element.isExecutable;\n });\n this.flowNodeMap = processElements[0].flowElements.filter(function (element) {\n if (element.name === null || element.name === '') {\n element.name = element.id;\n }\n return element.$type !== 'bpmn:SequenceFlow';\n });\n this.loaded.emit(this.name);\n });\n }\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {MigrationComponent} from './migration.component';\nimport {MigrationRoutingModule} from './migration-routing.module';\nimport {CommonModule} from '@angular/common';\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\nimport {MigrationProcessDiagramComponent} from './migration-process-diagram/migration-process-diagram.component';\nimport {WidgetModule} from '@valtimo/components';\nimport {TranslateModule} from '@ngx-translate/core';\n\n@NgModule({\n declarations: [MigrationComponent, MigrationProcessDiagramComponent],\n imports: [\n CommonModule,\n MigrationRoutingModule,\n ReactiveFormsModule,\n WidgetModule,\n FormsModule,\n TranslateModule,\n ],\n exports: [MigrationComponent],\n})\nexport class MigrationModule {}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * Public API Surface of migration\n */\n\nexport * from './lib/migration.service';\nexport * from './lib/migration.component';\nexport * from './lib/migration.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {MigrationProcessDiagramComponent as ɵa} from './lib/migration-process-diagram/migration-process-diagram.component';\nexport {MigrationRoutingModule as ɵb} from './lib/migration-routing.module';"],"names":["Injectable","Component","ProcessService","NGXLogger","AlertService","ViewChild","ROLE_ADMIN","AuthGuardService","NgModule","CommonModule","RouterModule","EventEmitter","Input","Output","ReactiveFormsModule","WidgetModule","FormsModule","TranslateModule"],"mappings":";;;;;;IAAA;;;;;;;;;;;;;;;;QAsBE;SAAgB;;;;;gBAJjBA,aAAU,SAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;;ICpBD;;;;;;;;;;;;;;;;QA6DE,4BACU,cAA8B,EAC9B,MAAiB,EACjB,YAA0B;YAF1B,mBAAc,GAAd,cAAc,CAAgB;YAC9B,WAAM,GAAN,MAAM,CAAW;YACjB,iBAAY,GAAZ,YAAY,CAAc;YApC7B,uBAAkB,GAAwB,EAAE,CAAC;YAC7C,qBAAgB,GAAG;gBACxB,MAAM,EAAE,EAAE;gBACV,MAAM,EAAE,EAAE;aACX,CAAC;YACK,eAAU,GAAG;gBAClB,MAAM,EAAE,IAAI;gBACZ,MAAM,EAAE,IAAI;aACb,CAAC;YACK,WAAM,GAAG;gBACd,MAAM,EAAE,KAAK;gBACb,MAAM,EAAE,KAAK;aACd,CAAC;YACK,WAAM,GAAG;gBACd,MAAM,EAAE;oBACN,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,IAAI;iBACd;gBACD,MAAM,EAAE;oBACN,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,IAAI;iBACd;aACF,CAAC;YAEK,iBAAY,GAAkB,IAAI,CAAC;YACnC,sBAAiB,GAAU,EAAE,CAAC;YAC9B,gBAAW,GAAQ,EAAE,CAAC;YAKtB,YAAO,GAAQ,IAAI,CAAC;SAMvB;QAE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,mCAAmC;oBAC7C,0sBAAyD;;iBAE1D;;;gBANOE,mBAAS;;;qBAWdE,YAAS,SAAC,KAAK;uBACfO,QAAK;yBACLC,SAAM;;;ICzCT;;;;;;;;;;;;;;;;QAqCA;;;;;gBAZCL,WAAQ,SAAC;oBACR,YAAY,EAAE,CAAC,kBAAkB,EAAE,gCAAgC,CAAC;oBACpE,OAAO,EAAE;wBACPC,mBAAY;wBACZ,sBAAsB;wBACtBK,yBAAmB;wBACnBC,uBAAY;wBACZC,iBAAW;wBACXC,oBAAe;qBAChB;oBACD,OAAO,EAAE,CAAC,kBAAkB,CAAC;iBAC9B;;;ICpCD;;;;;;;;;;;;;;;;ICAA;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +0,0 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/core"),require("@valtimo/process"),require("ngx-logger"),require("@valtimo/components"),require("@angular/router"),require("@angular/common"),require("@valtimo/security"),require("@valtimo/config"),require("@angular/forms"),require("bpmn-js/dist/bpmn-navigated-viewer.production.min.js"),require("@ngx-translate/core")):"function"==typeof define&&define.amd?define("@valtimo/migration",["exports","@angular/core","@valtimo/process","ngx-logger","@valtimo/components","@angular/router","@angular/common","@valtimo/security","@valtimo/config","@angular/forms","bpmn-js/dist/bpmn-navigated-viewer.production.min.js","@ngx-translate/core"],n):n(((e=e||self).valtimo=e.valtimo||{},e.valtimo.migration={}),e.ng.core,e.process,e.ngxLogger,e.components,e.ng.router,e.ng.common,e.security,e.config,e.ng.forms,e.BpmnJS,e.core)}(this,(function(e,n,t,o,i,r,s,a,l,c,d,u){"use strict";var p=function(){};p.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new p},token:p,providedIn:"root"}),p.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],p.ctorParameters=function(){return[]};var g=function(){function e(e,n,t){this.processService=e,this.logger=n,this.alertService=t,this.processDefinitions=[],this.selectedVersions={source:[],target:[]},this.selectedId={source:null,target:null},this.loaded={source:!1,target:!1},this.fields={source:{definition:null,version:null},target:{definition:null,version:null}},this.processCount=null,this.uniqueFlowNodeMap=[],this.taskMapping={},this.diagram=null}return e.prototype.ngOnInit=function(){this.loadProcessDefinitions()},e.prototype.ngAfterViewInit=function(){this.diagram={source:this.sourceDiagram,target:this.targetDiagram}},Object.defineProperty(e.prototype,"taskMappingLength",{get:function(){return Object.keys(this.taskMapping).length},enumerable:!1,configurable:!0}),e.prototype.loadProcessDefinitions=function(){var e=this;this.processService.getProcessDefinitions().subscribe((function(n){e.processDefinitions=n}))},e.prototype.loadProcessDefinitionVersions=function(e,n){var t=this;this.fields[n].definition=e,this.selectedVersions[n]=[],this.clearProcess(n),e&&this.processService.getProcessDefinitionVersions(e).subscribe((function(e){t.selectedVersions[n]=e}))},e.prototype.loadProcess=function(e,n){this.fields[n].version=e,this.clearProcess(n),e&&(this.loadProcessDefinitionXML(e,n),"source"===n&&this.loadProcessCount(e))},e.prototype.clearProcess=function(e){this.loaded[e]=!1,this.selectedId[e]=null,this.diagram[e].clear(),"source"===e&&(this.processCount=null)},e.prototype.loadProcessDefinitionXML=function(e,n){var t=this;this.processService.getProcessDefinitionXml(e).subscribe((function(o){t.diagram[n].loadXml(o.bpmn20Xml),t.selectedId[n]=e}))},e.prototype.loadProcessCount=function(e){var n=this;this.processService.getProcessCount(e).subscribe((function(e){n.processCount=e.count}))},e.prototype.setUniqueFlowNodeMap=function(){this.uniqueFlowNodeMap=[];var e=this.sourceDiagram.flowNodeMap,n=this.targetDiagram.flowNodeMap;null!=e&&null!=n&&(this.uniqueFlowNodeMap=e.filter((function(e){return!n.some((function(n){return e.id===n.id&&e.$type===n.$type}))})))},e.prototype.getFilteredTargetFlowNodeMap=function(e){return this.targetDiagram.flowNodeMap.filter((function(n){return n.$type===e}))},e.prototype.diagramLoaded=function(e){this.loaded[e]=!0,this.loaded.source&&this.loaded.target&&(this.taskMapping={},this.setUniqueFlowNodeMap())},e.prototype.migrateProcess=function(){var e=this;this.processService.migrateProcess(this.selectedId.source,this.selectedId.target,this.taskMapping).subscribe((function(n){e.alertService.success("Process successfully migrated!"),e.clearProcess("source"),e.clearProcess("target"),e.fields={source:{definition:null,version:null},target:{definition:null,version:null}}}),(function(n){e.alertService.error("Process migration failed!"),e.logger.debug(n)}))},e}();g.decorators=[{type:n.Component,args:[{selector:"valtimo-migration",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<div class="main-content">\n <div class="container-fluid">\n <div class="row mb-5">\n <div class="col-12">\n <div class="alert alert-warning pl-2 plr-2" role="alert">\n <div class="icon"><span class="mdi mdi-alert-triangle"></span></div>\n <div class="message" [innerHTML]="\'Process migration warning\' | translate"></div>\n </div>\n </div>\n </div>\n <div class="row mb-5">\n <div class="col-4">\n <label for="sourceDef">Source Definition</label>\n <select\n class="form-control"\n id="sourceDef"\n [ngModel]="fields.source.definition"\n (ngModelChange)="loadProcessDefinitionVersions($event, \'source\')"\n >\n <option [ngValue]="null" selected>- Source Definition -</option>\n <option *ngFor="let processDef of processDefinitions" [ngValue]="processDef.key">\n {{ processDef.name }}\n </option>\n </select>\n </div>\n <div class="col-2">\n <label for="sourceVer">Source Version</label>\n <select\n class="form-control"\n id="sourceVer"\n [ngModel]="fields.source.version"\n (ngModelChange)="loadProcess($event, \'source\')"\n >\n <option [ngValue]="null" selected>- Source Version -</option>\n <option *ngFor="let processVer of selectedVersions.source" [ngValue]="processVer.id">\n {{ processVer.version }}\n </option>\n </select>\n </div>\n <div class="col-4">\n <label for="targetDef">Target Definition</label>\n <select\n class="form-control"\n id="targetDef"\n [ngModel]="fields.target.definition"\n (ngModelChange)="loadProcessDefinitionVersions($event, \'target\')"\n >\n <option [ngValue]="null" selected>- Target Definition -</option>\n <option *ngFor="let processDef of processDefinitions" [ngValue]="processDef.key">\n {{ processDef.name }}\n </option>\n </select>\n </div>\n <div class="col-2">\n <label for="targetVer">Target Version</label>\n <select\n class="form-control"\n id="targetVer"\n [ngModel]="fields.target.version"\n (ngModelChange)="loadProcess($event, \'target\')"\n >\n <option [ngValue]="null" selected>- Target Version -</option>\n <option *ngFor="let processVer of selectedVersions.target" [ngValue]="processVer.id">\n {{ processVer.version }}\n </option>\n </select>\n </div>\n </div>\n\n <div class="row mb-5">\n <div class="col-6">\n <valtimo-migration-process-diagram\n name="source"\n (loaded)="diagramLoaded($event)"\n #sourceDiagram\n ></valtimo-migration-process-diagram>\n </div>\n <div class="col-6">\n <valtimo-migration-process-diagram\n name="target"\n (loaded)="diagramLoaded($event)"\n #targetDiagram\n ></valtimo-migration-process-diagram>\n </div>\n </div>\n <table class="table table-striped mb-5" *ngIf="selectedId.source && selectedId.target">\n <tr *ngFor="let node of uniqueFlowNodeMap">\n <td>{{ node.name ? node.name : node.id }}</td>\n <td>\n <select class="form-control" (change)="taskMapping[node.id] = $event.target.value">\n <option [value]="null" disabled selected>- Choose Target -</option>\n <option\n *ngFor="let targetFlowNode of getFilteredTargetFlowNodeMap(node.$type)"\n [value]="targetFlowNode.id"\n >\n {{ targetFlowNode.name ? targetFlowNode.name : targetFlowNode.id }}\n </option>\n </select>\n </td>\n </tr>\n </table>\n <hr />\n <div class="btn-group mb-5">\n <button\n [disabled]="\n (uniqueFlowNodeMap.length !== taskMappingLength && uniqueFlowNodeMap.length > 0) ||\n !loaded.source ||\n !loaded.target\n "\n (click)="migrateProcess()"\n class="btn btn-primary"\n >\n Migrate\n <span *ngIf="processCount !== null" class="badge badge-pill badge-secondary">{{\n processCount\n }}</span>\n </button>\n </div>\n </div>\n</div>\n',styles:['/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */']}]}],g.ctorParameters=function(){return[{type:t.ProcessService},{type:o.NGXLogger},{type:i.AlertService}]},g.propDecorators={sourceDiagram:[{type:n.ViewChild,args:["sourceDiagram"]}],targetDiagram:[{type:n.ViewChild,args:["targetDiagram"]}]};var m={title:"Process migration",roles:[l.ROLE_ADMIN]},f=[{path:"process-migration",component:g,canActivate:[a.AuthGuardService],data:m}],h=function(){};h.decorators=[{type:n.NgModule,args:[{imports:[s.CommonModule,r.RouterModule.forChild(f)],exports:[r.RouterModule]}]}];var v=function(){function e(e){this.logger=e,this.flowNodeMap=null,this.loaded=new n.EventEmitter}return e.prototype.ngOnInit=function(){var e=this;this.bpmnJS=new d,this.bpmnJS.on("import.done",(function(n){n.error||e.bpmnJS.get("canvas").zoom("fit-viewport","auto")}))},e.prototype.ngOnDestroy=function(){this.bpmnJS&&this.bpmnJS.destroy()},e.prototype.clear=function(){this.bpmnJS.clear()},e.prototype.loadXml=function(e){var n=this;this.bpmnJS.attachTo(this.el.nativeElement),this.bpmnJS.importXML(e,(function(e){n.logger.debug(e);var t=n.bpmnJS.getDefinitions().rootElements.filter((function(e){return e.isExecutable}));n.flowNodeMap=t[0].flowElements.filter((function(e){return null!==e.name&&""!==e.name||(e.name=e.id),"bpmn:SequenceFlow"!==e.$type})),n.loaded.emit(n.name)}))},e}();v.decorators=[{type:n.Component,args:[{selector:"valtimo-migration-process-diagram",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<div #ref class="diagram-container"></div>\n',styles:['/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.diagram-container-switch-holder{width:100%;z-index:1000}.diagram-container{height:48vh}']}]}],v.ctorParameters=function(){return[{type:o.NGXLogger}]},v.propDecorators={el:[{type:n.ViewChild,args:["ref"]}],name:[{type:n.Input}],loaded:[{type:n.Output}]};var b=function(){};b.decorators=[{type:n.NgModule,args:[{declarations:[g,v],imports:[s.CommonModule,h,c.ReactiveFormsModule,i.WidgetModule,c.FormsModule,u.TranslateModule],exports:[g]}]}],e.MigrationComponent=g,e.MigrationModule=b,e.MigrationService=p,e.ɵa=v,e.ɵb=h,Object.defineProperty(e,"__esModule",{value:!0})}));
2
- //# sourceMappingURL=valtimo-migration.umd.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../projects/valtimo/migration/src/lib/migration.service.ts","../../../../projects/valtimo/migration/src/lib/migration.component.ts","../../../../projects/valtimo/migration/src/lib/migration-routing.module.ts","../../../../projects/valtimo/migration/src/lib/migration-process-diagram/migration-process-diagram.component.ts","../../../../projects/valtimo/migration/src/lib/migration.module.ts"],"names":["Injectable","args","providedIn","MigrationComponent","processService","logger","alertService","this","processDefinitions","selectedVersions","source","target","selectedId","loaded","fields","definition","version","processCount","uniqueFlowNodeMap","taskMapping","diagram","prototype","ngOnInit","loadProcessDefinitions","ngAfterViewInit","sourceDiagram","targetDiagram","Object","defineProperty","keys","length","_this","getProcessDefinitions","subscribe","loadProcessDefinitionVersions","key","type","clearProcess","getProcessDefinitionVersions","processDefinitionVersions","loadProcess","id","loadProcessDefinitionXML","loadProcessCount","clear","getProcessDefinitionXml","xml","loadXml","getProcessCount","response","count","setUniqueFlowNodeMap","sourceFlowNodeMap","flowNodeMap","targetFlowNodeMap","filter","sourceFlowNode","some","targetFlowNode","$type","getFilteredTargetFlowNodeMap","flowNodeType","flowNode","diagramLoaded","diagramName","migrateProcess","res","success","err","error","debug","Component","selector","template","ProcessService","NGXLogger","AlertService","ViewChild","title","roles","ROLE_ADMIN","routes","path","component","canActivate","AuthGuardService","data","NgModule","imports","CommonModule","RouterModule","forChild","exports","MigrationProcessDiagramComponent","EventEmitter","bpmnJS","BpmnJS","on","_a","get","zoom","ngOnDestroy","destroy","attachTo","el","nativeElement","importXML","processElements","getDefinitions","rootElements","element","isExecutable","flowElements","name","emit","Input","Output","declarations","MigrationRoutingModule","ReactiveFormsModule","WidgetModule","FormsModule","TranslateModule"],"mappings":"68BAsBE,4HAJDA,EAAAA,WAAUC,KAAA,CAAC,CACVC,WAAY,kEC0CZ,SAAAC,EACUC,EACAC,EACAC,GAFAC,KAAAH,eAAAA,EACAG,KAAAF,OAAAA,EACAE,KAAAD,aAAAA,EApCHC,KAAAC,mBAA0C,GAC1CD,KAAAE,iBAAmB,CACxBC,OAAQ,GACRC,OAAQ,IAEHJ,KAAAK,WAAa,CAClBF,OAAQ,KACRC,OAAQ,MAEHJ,KAAAM,OAAS,CACdH,QAAQ,EACRC,QAAQ,GAEHJ,KAAAO,OAAS,CACdJ,OAAQ,CACNK,WAAY,KACZC,QAAS,MAEXL,OAAQ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AAQG,KAAOH,EAAQrE,IAEA,sBAAlBqE,EAAQnD,SAEjB5B,EAAKlB,OAAOqG,KAAKnF,EAAKkF,mCAhD3B1C,EAAAA,UAAStE,KAAA,CAAC,CACTuE,SAAU,oCACVC,SAAA,08CAJME,EAAAA,yCAWLE,EAAAA,UAAS5E,KAAA,CAAC,qBACVkH,EAAAA,sBACAC,EAAAA,gBCJH,iCAZC7B,EAAAA,SAAQtF,KAAA,CAAC,CACRoH,aAAc,CAAClH,EAAoB0F,GACnCL,QAAS,CACPC,EAAAA,aACA6B,EACAC,EAAAA,oBACAC,EAAAA,aACAC,EAAAA,YACAC,EAAAA,iBAEF9B,QAAS,CAACzF","sourcesContent":["/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable} from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MigrationService {\n constructor() {}\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {AfterViewInit, Component, OnInit, ViewChild} from '@angular/core';\nimport {ProcessService, ProcessDefinition} from '@valtimo/process';\nimport {MigrationProcessDiagramComponent} from './migration-process-diagram/migration-process-diagram.component';\nimport {NGXLogger} from 'ngx-logger';\nimport {AlertService} from '@valtimo/components';\n\n@Component({\n selector: 'valtimo-migration',\n templateUrl: './migration.component.html',\n styleUrls: ['./migration.component.scss'],\n})\nexport class MigrationComponent implements OnInit, AfterViewInit {\n public processDefinitions: ProcessDefinition[] = [];\n public selectedVersions = {\n source: [],\n target: [],\n };\n public selectedId = {\n source: null,\n target: null,\n };\n public loaded = {\n source: false,\n target: false,\n };\n public fields = {\n source: {\n definition: null,\n version: null,\n },\n target: {\n definition: null,\n version: null,\n },\n };\n\n public processCount: number | null = null;\n public uniqueFlowNodeMap: any[] = [];\n public taskMapping: any = {};\n\n @ViewChild('sourceDiagram') sourceDiagram: MigrationProcessDiagramComponent;\n @ViewChild('targetDiagram') targetDiagram: MigrationProcessDiagramComponent;\n\n public diagram: any = null;\n\n constructor(\n private processService: ProcessService,\n private logger: NGXLogger,\n private alertService: AlertService\n ) {}\n\n ngOnInit() {\n this.loadProcessDefinitions();\n }\n\n ngAfterViewInit() {\n this.diagram = {\n source: this.sourceDiagram,\n target: this.targetDiagram,\n };\n }\n\n public get taskMappingLength() {\n return Object.keys(this.taskMapping).length;\n }\n\n loadProcessDefinitions() {\n this.processService\n .getProcessDefinitions()\n .subscribe((processDefinitions: ProcessDefinition[]) => {\n this.processDefinitions = processDefinitions;\n });\n }\n\n loadProcessDefinitionVersions(key: string | null, type: string) {\n this.fields[type].definition = key;\n this.selectedVersions[type] = [];\n this.clearProcess(type);\n if (key) {\n this.processService\n .getProcessDefinitionVersions(key)\n .subscribe((processDefinitionVersions: ProcessDefinition[]) => {\n this.selectedVersions[type] = processDefinitionVersions;\n });\n }\n }\n\n loadProcess(id: string | null, type: string) {\n this.fields[type].version = id;\n this.clearProcess(type);\n if (id) {\n this.loadProcessDefinitionXML(id, type);\n if (type === 'source') {\n this.loadProcessCount(id);\n }\n }\n }\n\n private clearProcess(type: string) {\n this.loaded[type] = false;\n this.selectedId[type] = null;\n this.diagram[type].clear();\n if (type === 'source') {\n this.processCount = null;\n }\n }\n\n loadProcessDefinitionXML(id: string, type: string) {\n this.processService.getProcessDefinitionXml(id).subscribe(xml => {\n this.diagram[type].loadXml(xml['bpmn20Xml']);\n this.selectedId[type] = id;\n });\n }\n\n loadProcessCount(id: string) {\n this.processService.getProcessCount(id).subscribe(response => {\n this.processCount = response.count;\n });\n }\n\n setUniqueFlowNodeMap() {\n this.uniqueFlowNodeMap = [];\n const sourceFlowNodeMap = this.sourceDiagram.flowNodeMap;\n const targetFlowNodeMap = this.targetDiagram.flowNodeMap;\n\n if (sourceFlowNodeMap != null && targetFlowNodeMap != null) {\n this.uniqueFlowNodeMap = sourceFlowNodeMap.filter(\n sourceFlowNode =>\n !targetFlowNodeMap.some(\n targetFlowNode =>\n sourceFlowNode.id === targetFlowNode.id &&\n sourceFlowNode.$type === targetFlowNode.$type\n )\n );\n }\n }\n\n getFilteredTargetFlowNodeMap(flowNodeType) {\n const targetFlowNodeMap = this.targetDiagram.flowNodeMap;\n return targetFlowNodeMap.filter(function (flowNode) {\n return flowNode.$type === flowNodeType;\n });\n }\n\n diagramLoaded(diagramName: string) {\n this.loaded[diagramName] = true;\n if (this.loaded.source && this.loaded.target) {\n this.taskMapping = {};\n this.setUniqueFlowNodeMap();\n }\n }\n\n migrateProcess() {\n this.processService\n .migrateProcess(this.selectedId.source, this.selectedId.target, this.taskMapping)\n .subscribe(\n res => {\n this.alertService.success('Process successfully migrated!');\n this.clearProcess('source');\n this.clearProcess('target');\n this.fields = {\n source: {\n definition: null,\n version: null,\n },\n target: {\n definition: null,\n version: null,\n },\n };\n },\n err => {\n this.alertService.error('Process migration failed!');\n this.logger.debug(err);\n }\n );\n }\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {RouterModule, Routes} from '@angular/router';\nimport {CommonModule} from '@angular/common';\nimport {AuthGuardService} from '@valtimo/security';\nimport {MigrationComponent} from './migration.component';\nimport {ROLE_ADMIN} from '@valtimo/config';\n\nconst routes: Routes = [\n {\n path: 'process-migration',\n component: MigrationComponent,\n canActivate: [AuthGuardService],\n data: {title: 'Process migration', roles: [ROLE_ADMIN]},\n },\n];\n\n@NgModule({\n imports: [CommonModule, RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class MigrationRoutingModule {}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewChild,\n} from '@angular/core';\n\nimport * as BpmnJS from 'bpmn-js/dist/bpmn-navigated-viewer.production.min.js';\nimport {NGXLogger} from 'ngx-logger';\n\n@Component({\n selector: 'valtimo-migration-process-diagram',\n templateUrl: './migration-process-diagram.component.html',\n styleUrls: ['./migration-process-diagram.component.scss'],\n})\nexport class MigrationProcessDiagramComponent implements OnInit, OnDestroy {\n private bpmnJS: BpmnJS;\n public flowNodeMap: any = null;\n\n @ViewChild('ref') public el: ElementRef;\n @Input() name: string;\n @Output() loaded = new EventEmitter();\n\n constructor(private logger: NGXLogger) {}\n\n ngOnInit() {\n this.bpmnJS = new BpmnJS();\n this.bpmnJS.on('import.done', ({error}: any) => {\n if (!error) {\n const canvas = this.bpmnJS.get('canvas');\n canvas.zoom('fit-viewport', 'auto');\n }\n });\n }\n\n ngOnDestroy() {\n if (this.bpmnJS) {\n this.bpmnJS.destroy();\n }\n }\n\n clear() {\n this.bpmnJS.clear();\n }\n\n public loadXml(xml: string): void {\n this.bpmnJS.attachTo(this.el.nativeElement);\n this.bpmnJS.importXML(xml, err => {\n this.logger.debug(err);\n const processElements = this.bpmnJS.getDefinitions().rootElements.filter(function (element) {\n return element.isExecutable;\n });\n this.flowNodeMap = processElements[0].flowElements.filter(function (element) {\n if (element.name === null || element.name === '') {\n element.name = element.id;\n }\n return element.$type !== 'bpmn:SequenceFlow';\n });\n this.loaded.emit(this.name);\n });\n }\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {MigrationComponent} from './migration.component';\nimport {MigrationRoutingModule} from './migration-routing.module';\nimport {CommonModule} from '@angular/common';\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\nimport {MigrationProcessDiagramComponent} from './migration-process-diagram/migration-process-diagram.component';\nimport {WidgetModule} from '@valtimo/components';\nimport {TranslateModule} from '@ngx-translate/core';\n\n@NgModule({\n declarations: [MigrationComponent, MigrationProcessDiagramComponent],\n imports: [\n CommonModule,\n MigrationRoutingModule,\n ReactiveFormsModule,\n WidgetModule,\n FormsModule,\n TranslateModule,\n ],\n exports: [MigrationComponent],\n})\nexport class MigrationModule {}\n"]}
@@ -1,74 +0,0 @@
1
- /*
2
- * Copyright 2015-2020 Ritense BV, the Netherlands.
3
- *
4
- * Licensed under EUPL, Version 1.2 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" basis,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { Component, ElementRef, EventEmitter, Input, Output, ViewChild, } from '@angular/core';
17
- import * as BpmnJS from 'bpmn-js/dist/bpmn-navigated-viewer.production.min.js';
18
- import { NGXLogger } from 'ngx-logger';
19
- export class MigrationProcessDiagramComponent {
20
- constructor(logger) {
21
- this.logger = logger;
22
- this.flowNodeMap = null;
23
- this.loaded = new EventEmitter();
24
- }
25
- ngOnInit() {
26
- this.bpmnJS = new BpmnJS();
27
- this.bpmnJS.on('import.done', ({ error }) => {
28
- if (!error) {
29
- const canvas = this.bpmnJS.get('canvas');
30
- canvas.zoom('fit-viewport', 'auto');
31
- }
32
- });
33
- }
34
- ngOnDestroy() {
35
- if (this.bpmnJS) {
36
- this.bpmnJS.destroy();
37
- }
38
- }
39
- clear() {
40
- this.bpmnJS.clear();
41
- }
42
- loadXml(xml) {
43
- this.bpmnJS.attachTo(this.el.nativeElement);
44
- this.bpmnJS.importXML(xml, err => {
45
- this.logger.debug(err);
46
- const processElements = this.bpmnJS.getDefinitions().rootElements.filter(function (element) {
47
- return element.isExecutable;
48
- });
49
- this.flowNodeMap = processElements[0].flowElements.filter(function (element) {
50
- if (element.name === null || element.name === '') {
51
- element.name = element.id;
52
- }
53
- return element.$type !== 'bpmn:SequenceFlow';
54
- });
55
- this.loaded.emit(this.name);
56
- });
57
- }
58
- }
59
- MigrationProcessDiagramComponent.decorators = [
60
- { type: Component, args: [{
61
- selector: 'valtimo-migration-process-diagram',
62
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div #ref class=\"diagram-container\"></div>\n",
63
- styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.diagram-container-switch-holder{width:100%;z-index:1000}.diagram-container{height:48vh}"]
64
- },] }
65
- ];
66
- MigrationProcessDiagramComponent.ctorParameters = () => [
67
- { type: NGXLogger }
68
- ];
69
- MigrationProcessDiagramComponent.propDecorators = {
70
- el: [{ type: ViewChild, args: ['ref',] }],
71
- name: [{ type: Input }],
72
- loaded: [{ type: Output }]
73
- };
74
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWlncmF0aW9uLXByb2Nlc3MtZGlhZ3JhbS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiL3RtcC9qZW5raW5zLTBlODRmNjBmL3dvcmtzcGFjZS9yb250ZW5kX2xpYnJhcmllc18tX3JlbGVhc2VfbWFpbi9wcm9qZWN0cy92YWx0aW1vL21pZ3JhdGlvbi9zcm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