@valtimo/decision 4.23.0 → 5.2.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 (56) hide show
  1. package/esm2020/lib/decision-deploy/decision-deploy.component.mjs +52 -0
  2. package/esm2020/lib/decision-display/decision-display.component.mjs +56 -0
  3. package/esm2020/lib/decision-list/decision-list.component.mjs +50 -0
  4. package/esm2020/lib/decision-routing.module.mjs +52 -0
  5. package/esm2020/lib/decision.component.mjs +35 -0
  6. package/esm2020/lib/decision.module.mjs +70 -0
  7. package/esm2020/lib/decision.service.mjs +48 -0
  8. package/esm2020/lib/models/decision.model.mjs +17 -0
  9. package/esm2020/lib/models/index.mjs +19 -0
  10. package/esm2020/public-api.mjs +22 -0
  11. package/esm2020/valtimo-decision.mjs +5 -0
  12. package/fesm2015/valtimo-decision.mjs +373 -0
  13. package/fesm2015/valtimo-decision.mjs.map +1 -0
  14. package/fesm2020/valtimo-decision.mjs +389 -0
  15. package/fesm2020/valtimo-decision.mjs.map +1 -0
  16. package/lib/decision-deploy/decision-deploy.component.d.ts +4 -0
  17. package/lib/decision-deploy/decision-deploy.component.d.ts.map +1 -0
  18. package/lib/decision-display/decision-display.component.d.ts +4 -0
  19. package/lib/decision-display/decision-display.component.d.ts.map +1 -0
  20. package/lib/decision-list/decision-list.component.d.ts +4 -0
  21. package/lib/decision-list/decision-list.component.d.ts.map +1 -0
  22. package/lib/decision-routing.module.d.ts +7 -0
  23. package/lib/decision-routing.module.d.ts.map +1 -0
  24. package/lib/decision.component.d.ts +4 -0
  25. package/lib/decision.component.d.ts.map +1 -0
  26. package/lib/decision.module.d.ts +14 -0
  27. package/lib/decision.module.d.ts.map +1 -0
  28. package/lib/decision.service.d.ts +4 -0
  29. package/lib/decision.service.d.ts.map +1 -0
  30. package/lib/models/decision.model.d.ts +1 -0
  31. package/lib/models/decision.model.d.ts.map +1 -0
  32. package/lib/models/index.d.ts +1 -0
  33. package/lib/models/index.d.ts.map +1 -0
  34. package/package.json +22 -10
  35. package/public-api.d.ts +1 -0
  36. package/public-api.d.ts.map +1 -0
  37. package/valtimo-decision.d.ts +2 -5
  38. package/valtimo-decision.d.ts.map +1 -0
  39. package/bundles/valtimo-decision.umd.js +0 -398
  40. package/bundles/valtimo-decision.umd.js.map +0 -1
  41. package/bundles/valtimo-decision.umd.min.js +0 -2
  42. package/bundles/valtimo-decision.umd.min.js.map +0 -1
  43. package/esm2015/lib/decision-deploy/decision-deploy.component.js +0 -53
  44. package/esm2015/lib/decision-display/decision-display.component.js +0 -60
  45. package/esm2015/lib/decision-list/decision-list.component.js +0 -52
  46. package/esm2015/lib/decision-routing.module.js +0 -48
  47. package/esm2015/lib/decision.component.js +0 -32
  48. package/esm2015/lib/decision.module.js +0 -48
  49. package/esm2015/lib/decision.service.js +0 -52
  50. package/esm2015/lib/models/decision.model.js +0 -16
  51. package/esm2015/lib/models/index.js +0 -19
  52. package/esm2015/public-api.js +0 -22
  53. package/esm2015/valtimo-decision.js +0 -10
  54. package/fesm2015/valtimo-decision.js +0 -375
  55. package/fesm2015/valtimo-decision.js.map +0 -1
  56. package/valtimo-decision.metadata.json +0 -1
@@ -16,3 +16,4 @@ export interface DecisionXml {
16
16
  id: string;
17
17
  dmnXml: string;
18
18
  }
19
+ //# sourceMappingURL=decision.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decision.model.d.ts","sourceRoot":"","sources":["../../../../../projects/valtimo/decision/src/lib/models/decision.model.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC,EAAE,MAAM,CAAC;IACzC,iCAAiC,EAAE,MAAM,CAAC;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;CAChB"}
@@ -1 +1,2 @@
1
1
  export * from './decision.model';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../projects/valtimo/decision/src/lib/models/index.ts"],"names":[],"mappings":"AAkBA,cAAc,kBAAkB,CAAC"}
package/package.json CHANGED
@@ -1,21 +1,33 @@
1
1
  {
2
2
  "name": "@valtimo/decision",
3
3
  "license": "EUPL-1.2",
4
- "version": "4.23.0",
4
+ "version": "5.2.0",
5
5
  "peerDependencies": {
6
- "@angular/common": "^10.0.11",
7
- "@angular/core": "^10.0.11"
6
+ "@angular/common": "^13.2.3",
7
+ "@angular/core": "^13.2.3"
8
8
  },
9
9
  "dependencies": {
10
10
  "dmn-js": "^12.1.0",
11
11
  "tslib": "^2.0.0"
12
12
  },
13
- "main": "bundles/valtimo-decision.umd.js",
14
- "module": "fesm2015/valtimo-decision.js",
15
- "es2015": "fesm2015/valtimo-decision.js",
16
- "esm2015": "esm2015/valtimo-decision.js",
17
- "fesm2015": "fesm2015/valtimo-decision.js",
13
+ "module": "fesm2015/valtimo-decision.mjs",
14
+ "es2020": "fesm2020/valtimo-decision.mjs",
15
+ "esm2020": "esm2020/valtimo-decision.mjs",
16
+ "fesm2020": "fesm2020/valtimo-decision.mjs",
17
+ "fesm2015": "fesm2015/valtimo-decision.mjs",
18
18
  "typings": "valtimo-decision.d.ts",
19
- "metadata": "valtimo-decision.metadata.json",
19
+ "exports": {
20
+ "./package.json": {
21
+ "default": "./package.json"
22
+ },
23
+ ".": {
24
+ "types": "./valtimo-decision.d.ts",
25
+ "esm2020": "./esm2020/valtimo-decision.mjs",
26
+ "es2020": "./fesm2020/valtimo-decision.mjs",
27
+ "es2015": "./fesm2015/valtimo-decision.mjs",
28
+ "node": "./fesm2015/valtimo-decision.mjs",
29
+ "default": "./fesm2020/valtimo-decision.mjs"
30
+ }
31
+ },
20
32
  "sideEffects": false
21
- }
33
+ }
package/public-api.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './lib/models';
2
2
  export * from './lib/decision.module';
3
3
  export * from './lib/decision.component';
4
+ //# sourceMappingURL=public-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../../../projects/valtimo/decision/src/public-api.ts"],"names":[],"mappings":"AAoBA,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC"}
@@ -1,9 +1,6 @@
1
1
  /**
2
2
  * Generated bundle index. Do not edit.
3
3
  */
4
+ /// <amd-module name="@valtimo/decision" />
4
5
  export * from './public-api';
5
- export { DecisionDeployComponent as ɵa } from './lib/decision-deploy/decision-deploy.component';
6
- export { DecisionDisplayComponent as ɵc } from './lib/decision-display/decision-display.component';
7
- export { DecisionListComponent as ɵd } from './lib/decision-list/decision-list.component';
8
- export { DecisionRoutingModule as ɵe } from './lib/decision-routing.module';
9
- export { DecisionService as ɵb } from './lib/decision.service';
6
+ //# sourceMappingURL=valtimo-decision.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"valtimo-decision.d.ts","sourceRoot":"","sources":["../../../projects/valtimo/decision/src/valtimo-decision.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,cAAc,cAAc,CAAC"}
@@ -1,398 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/router'), require('@angular/common'), require('@valtimo/security'), require('@angular/common/http'), require('@valtimo/config'), require('dmn-js'), require('@angular/forms'), require('@valtimo/components'), require('@ngx-translate/core')) :
3
- typeof define === 'function' && define.amd ? define('@valtimo/decision', ['exports', '@angular/core', '@angular/router', '@angular/common', '@valtimo/security', '@angular/common/http', '@valtimo/config', 'dmn-js', '@angular/forms', '@valtimo/components', '@ngx-translate/core'], factory) :
4
- (global = global || self, factory((global.valtimo = global.valtimo || {}, global.valtimo.decision = {}), global.ng.core, global.ng.router, global.ng.common, global.security, global.ng.common.http, global.config, global.DmnViewer, global.ng.forms, global.components, global.core$1));
5
- }(this, (function (exports, i0, router, common, security, i2, i1, DmnViewer, forms, components, core) { 'use strict';
6
-
7
- DmnViewer = DmnViewer && Object.prototype.hasOwnProperty.call(DmnViewer, 'default') ? DmnViewer['default'] : DmnViewer;
8
-
9
- /*
10
- * Copyright 2015-2020 Ritense BV, the Netherlands.
11
- *
12
- * Licensed under EUPL, Version 1.2 (the "License");
13
- * you may not use this file except in compliance with the License.
14
- * You may obtain a copy of the License at
15
- *
16
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
17
- *
18
- * Unless required by applicable law or agreed to in writing, software
19
- * distributed under the License is distributed on an "AS IS" basis,
20
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
- * See the License for the specific language governing permissions and
22
- * limitations under the License.
23
- */
24
-
25
- /*
26
- *
27
- * * Copyright 2015-2020 Ritense BV, the Netherlands.
28
- * *
29
- * * Licensed under EUPL, Version 1.2 (the "License");
30
- * * you may not use this file except in compliance with the License.
31
- * * You may obtain a copy of the License at
32
- * *
33
- * * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
34
- * *
35
- * * Unless required by applicable law or agreed to in writing, software
36
- * * distributed under the License is distributed on an "AS IS" basis,
37
- * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
38
- * * See the License for the specific language governing permissions and
39
- * * limitations under the License.
40
- *
41
- */
42
-
43
- /*
44
- * Copyright 2015-2020 Ritense BV, the Netherlands.
45
- *
46
- * Licensed under EUPL, Version 1.2 (the "License");
47
- * you may not use this file except in compliance with the License.
48
- * You may obtain a copy of the License at
49
- *
50
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
51
- *
52
- * Unless required by applicable law or agreed to in writing, software
53
- * distributed under the License is distributed on an "AS IS" basis,
54
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
55
- * See the License for the specific language governing permissions and
56
- * limitations under the License.
57
- */
58
- var DecisionComponent = /** @class */ (function () {
59
- function DecisionComponent() {
60
- }
61
- return DecisionComponent;
62
- }());
63
- DecisionComponent.decorators = [
64
- { type: i0.Component, args: [{
65
- selector: 'valtimo-decision',
66
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content pt-0\">\n <div class=\"container-fluid\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3\">\n <button (click)=\"this.deploy.openModal()\" class=\"btn btn-secondary btn-space mr-0\">\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'Upload' | translate }}\n </button>\n </div>\n </div>\n <valtimo-decision-list #decisionList></valtimo-decision-list>\n <valtimo-decision-deploy\n #decisionDeploy\n (deploySuccessful)=\"this.list.loadDecisions()\"\n ></valtimo-decision-deploy>\n </div>\n</div>\n",
67
- 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 */"]
68
- },] }
69
- ];
70
- DecisionComponent.propDecorators = {
71
- deploy: [{ type: i0.ViewChild, args: ['decisionDeploy',] }],
72
- list: [{ type: i0.ViewChild, args: ['decisionList',] }]
73
- };
74
-
75
- /*
76
- * Copyright 2015-2020 Ritense BV, the Netherlands.
77
- *
78
- * Licensed under EUPL, Version 1.2 (the "License");
79
- * you may not use this file except in compliance with the License.
80
- * You may obtain a copy of the License at
81
- *
82
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
83
- *
84
- * Unless required by applicable law or agreed to in writing, software
85
- * distributed under the License is distributed on an "AS IS" basis,
86
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
87
- * See the License for the specific language governing permissions and
88
- * limitations under the License.
89
- */
90
- var DecisionService = /** @class */ (function () {
91
- function DecisionService(configService, http) {
92
- this.configService = configService;
93
- this.http = http;
94
- this.valtimoApiConfig = configService.config.valtimoApi;
95
- }
96
- DecisionService.prototype.deployDmn = function (dmn) {
97
- var formData = new FormData();
98
- formData.append('file', dmn);
99
- formData.append('deployment-name', 'dmnTableDeploy');
100
- formData.append('deployment-source', 'process application');
101
- return this.http.post(this.valtimoApiConfig.endpointUri + "camunda-rest/engine/default/deployment/create", formData);
102
- };
103
- DecisionService.prototype.getDecisions = function () {
104
- return this.http.get(this.valtimoApiConfig.endpointUri + "camunda-rest/engine/default/decision-definition");
105
- };
106
- DecisionService.prototype.getDecisionXml = function (decisionId) {
107
- return this.http.get(this.valtimoApiConfig.endpointUri + "camunda-rest/engine/default/decision-definition/" + decisionId + "/xml");
108
- };
109
- return DecisionService;
110
- }());
111
- DecisionService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DecisionService_Factory() { return new DecisionService(i0.ɵɵinject(i1.ConfigService), i0.ɵɵinject(i2.HttpClient)); }, token: DecisionService, providedIn: "root" });
112
- DecisionService.decorators = [
113
- { type: i0.Injectable, args: [{
114
- providedIn: 'root',
115
- },] }
116
- ];
117
- DecisionService.ctorParameters = function () { return [
118
- { type: i1.ConfigService },
119
- { type: i2.HttpClient }
120
- ]; };
121
-
122
- /*
123
- * Copyright 2015-2020 Ritense BV, the Netherlands.
124
- *
125
- * Licensed under EUPL, Version 1.2 (the "License");
126
- * you may not use this file except in compliance with the License.
127
- * You may obtain a copy of the License at
128
- *
129
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
130
- *
131
- * Unless required by applicable law or agreed to in writing, software
132
- * distributed under the License is distributed on an "AS IS" basis,
133
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
134
- * See the License for the specific language governing permissions and
135
- * limitations under the License.
136
- */
137
- var DecisionDisplayComponent = /** @class */ (function () {
138
- function DecisionDisplayComponent(decisionService, route) {
139
- this.decisionService = decisionService;
140
- this.route = route;
141
- }
142
- DecisionDisplayComponent.prototype.ngOnInit = function () {
143
- this.viewer = new DmnViewer({
144
- container: '#canvas',
145
- });
146
- this.decisionId = this.route.snapshot.paramMap.get('id');
147
- this.loadDecisionXml();
148
- };
149
- DecisionDisplayComponent.prototype.loadDecisionXml = function () {
150
- var _this = this;
151
- this.decisionService.getDecisionXml(this.decisionId).subscribe(function (decision) {
152
- _this.viewer.importXML(decision.dmnXml);
153
- _this.decisionXml = decision.dmnXml;
154
- });
155
- };
156
- DecisionDisplayComponent.prototype.download = function () {
157
- var file = new Blob([this.decisionXml], { type: 'text/xml' });
158
- var link = document.createElement('a');
159
- link.download = "decision_table_" + this.decisionId + ".dmn";
160
- link.href = window.URL.createObjectURL(file);
161
- link.click();
162
- window.URL.revokeObjectURL(link.href);
163
- link.remove();
164
- };
165
- return DecisionDisplayComponent;
166
- }());
167
- DecisionDisplayComponent.decorators = [
168
- { type: i0.Component, args: [{
169
- selector: 'valtimo-decision-display',
170
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content pt-0\">\n <div class=\"container-fluid\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3\">\n <button (click)=\"download()\" class=\"btn btn-primary btn-space mr-0\">\n <i class=\"fa fa-save\"></i> &nbsp;\n <span>{{ 'Download' | translate }}</span>\n </button>\n </div>\n </div>\n <div id=\"canvas\"></div>\n </div>\n</div>\n",
171
- encapsulation: i0.ViewEncapsulation.None,
172
- 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 */"]
173
- },] }
174
- ];
175
- DecisionDisplayComponent.ctorParameters = function () { return [
176
- { type: DecisionService },
177
- { type: router.ActivatedRoute }
178
- ]; };
179
-
180
- /*
181
- * Copyright 2015-2020 Ritense BV, the Netherlands.
182
- *
183
- * Licensed under EUPL, Version 1.2 (the "License");
184
- * you may not use this file except in compliance with the License.
185
- * You may obtain a copy of the License at
186
- *
187
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
188
- *
189
- * Unless required by applicable law or agreed to in writing, software
190
- * distributed under the License is distributed on an "AS IS" basis,
191
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
192
- * See the License for the specific language governing permissions and
193
- * limitations under the License.
194
- */
195
- var ɵ0 = { title: 'Decision tables', roles: [i1.ROLE_ADMIN] }, ɵ1 = { title: 'Decision tables', roles: [i1.ROLE_ADMIN] };
196
- var routes = [
197
- {
198
- path: 'decision-tables',
199
- component: DecisionComponent,
200
- canActivate: [security.AuthGuardService],
201
- data: ɵ0,
202
- },
203
- {
204
- path: 'decision-tables/:id',
205
- component: DecisionDisplayComponent,
206
- canActivate: [security.AuthGuardService],
207
- data: ɵ1,
208
- },
209
- ];
210
- var DecisionRoutingModule = /** @class */ (function () {
211
- function DecisionRoutingModule() {
212
- }
213
- return DecisionRoutingModule;
214
- }());
215
- DecisionRoutingModule.decorators = [
216
- { type: i0.NgModule, args: [{
217
- declarations: [],
218
- imports: [common.CommonModule, router.RouterModule.forChild(routes)],
219
- exports: [router.RouterModule],
220
- },] }
221
- ];
222
-
223
- /*
224
- * Copyright 2015-2020 Ritense BV, the Netherlands.
225
- *
226
- * Licensed under EUPL, Version 1.2 (the "License");
227
- * you may not use this file except in compliance with the License.
228
- * You may obtain a copy of the License at
229
- *
230
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
231
- *
232
- * Unless required by applicable law or agreed to in writing, software
233
- * distributed under the License is distributed on an "AS IS" basis,
234
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
235
- * See the License for the specific language governing permissions and
236
- * limitations under the License.
237
- */
238
- var DecisionDeployComponent = /** @class */ (function () {
239
- function DecisionDeployComponent(decisionService) {
240
- this.decisionService = decisionService;
241
- this.dmn = null;
242
- this.deploySuccessful = new i0.EventEmitter();
243
- }
244
- DecisionDeployComponent.prototype.ngOnInit = function () { };
245
- DecisionDeployComponent.prototype.onChange = function (files) {
246
- this.dmn = files.item(0);
247
- };
248
- DecisionDeployComponent.prototype.deployDmn = function () {
249
- var _this = this;
250
- this.decisionService.deployDmn(this.dmn).subscribe(function () {
251
- _this.modal.hide();
252
- _this.deploySuccessful.emit();
253
- });
254
- };
255
- DecisionDeployComponent.prototype.openModal = function () {
256
- this.modal.show();
257
- };
258
- return DecisionDeployComponent;
259
- }());
260
- DecisionDeployComponent.decorators = [
261
- { type: i0.Component, args: [{
262
- selector: 'valtimo-decision-deploy',
263
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-modal\n #decisionDeployModal\n elementId=\"decisionDeployModal\"\n title=\"Upload Decision table\"\n [showFooter]=\"true\"\n>\n <div body>\n <div class=\"mt-3\">{{ 'decisions.upload.description' | translate }}</div>\n <div class=\"form-group mt-3 mb-3\">\n <input type=\"file\" id=\"file\" accept=\".dmn\" (change)=\"onChange($event.target.files)\" />\n </div>\n </div>\n <div footer>\n <div class=\"mb-0 p-3 text-right\">\n <button\n [disabled]=\"!dmn\"\n class=\"btn btn-primary btn-space\"\n type=\"button\"\n (click)=\"deployDmn()\"\n >\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'Upload' | translate }}\n </button>\n </div>\n </div>\n</valtimo-modal>\n",
264
- 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 */"]
265
- },] }
266
- ];
267
- DecisionDeployComponent.ctorParameters = function () { return [
268
- { type: DecisionService }
269
- ]; };
270
- DecisionDeployComponent.propDecorators = {
271
- deploySuccessful: [{ type: i0.Output }],
272
- modal: [{ type: i0.ViewChild, args: ['decisionDeployModal',] }]
273
- };
274
-
275
- /*
276
- * Copyright 2015-2020 Ritense BV, the Netherlands.
277
- *
278
- * Licensed under EUPL, Version 1.2 (the "License");
279
- * you may not use this file except in compliance with the License.
280
- * You may obtain a copy of the License at
281
- *
282
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
283
- *
284
- * Unless required by applicable law or agreed to in writing, software
285
- * distributed under the License is distributed on an "AS IS" basis,
286
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
287
- * See the License for the specific language governing permissions and
288
- * limitations under the License.
289
- */
290
- var DecisionListComponent = /** @class */ (function () {
291
- function DecisionListComponent(decisionService, router) {
292
- this.decisionService = decisionService;
293
- this.router = router;
294
- this.fields = [
295
- { key: 'key', label: 'Key' },
296
- { key: 'name', label: 'Name' },
297
- { key: 'version', label: 'Version' },
298
- ];
299
- }
300
- DecisionListComponent.prototype.ngOnInit = function () {
301
- this.loadDecisions();
302
- };
303
- DecisionListComponent.prototype.loadDecisions = function () {
304
- var _this = this;
305
- this.decisionService.getDecisions().subscribe(function (decisions) {
306
- _this.decisions = decisions;
307
- });
308
- };
309
- DecisionListComponent.prototype.viewDecisionTable = function (decision) {
310
- this.router.navigate(['/decision-tables', decision.id]);
311
- };
312
- return DecisionListComponent;
313
- }());
314
- DecisionListComponent.decorators = [
315
- { type: i0.Component, args: [{
316
- selector: 'valtimo-decision-list',
317
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-widget>\n <valtimo-list\n [items]=\"decisions\"\n [fields]=\"fields\"\n (rowClicked)=\"viewDecisionTable($event)\"\n [header]=\"true\"\n [viewMode]=\"true\"\n [isSearchable]=\"true\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ 'Decision tables' | translate }}</h3>\n <h5 class=\"list-header-description\">{{ 'Overview of all Decision tables' | translate }}</h5>\n </div>\n </valtimo-list>\n</valtimo-widget>\n",
318
- 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 */"]
319
- },] }
320
- ];
321
- DecisionListComponent.ctorParameters = function () { return [
322
- { type: DecisionService },
323
- { type: router.Router }
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 DecisionModule = /** @class */ (function () {
342
- function DecisionModule() {
343
- }
344
- return DecisionModule;
345
- }());
346
- DecisionModule.decorators = [
347
- { type: i0.NgModule, args: [{
348
- declarations: [
349
- DecisionComponent,
350
- DecisionDeployComponent,
351
- DecisionDisplayComponent,
352
- DecisionListComponent,
353
- ],
354
- imports: [
355
- DecisionRoutingModule,
356
- components.WidgetModule,
357
- components.ListModule,
358
- core.TranslateModule,
359
- components.ModalModule,
360
- common.CommonModule,
361
- forms.FormsModule,
362
- ],
363
- exports: [DecisionComponent],
364
- },] }
365
- ];
366
-
367
- /*
368
- * Copyright 2015-2020 Ritense BV, the Netherlands.
369
- *
370
- * Licensed under EUPL, Version 1.2 (the "License");
371
- * you may not use this file except in compliance with the License.
372
- * You may obtain a copy of the License at
373
- *
374
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
375
- *
376
- * Unless required by applicable law or agreed to in writing, software
377
- * distributed under the License is distributed on an "AS IS" basis,
378
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
379
- * See the License for the specific language governing permissions and
380
- * limitations under the License.
381
- */
382
-
383
- /**
384
- * Generated bundle index. Do not edit.
385
- */
386
-
387
- exports.DecisionComponent = DecisionComponent;
388
- exports.DecisionModule = DecisionModule;
389
- exports.ɵa = DecisionDeployComponent;
390
- exports.ɵb = DecisionService;
391
- exports.ɵc = DecisionDisplayComponent;
392
- exports.ɵd = DecisionListComponent;
393
- exports.ɵe = DecisionRoutingModule;
394
-
395
- Object.defineProperty(exports, '__esModule', { value: true });
396
-
397
- })));
398
- //# sourceMappingURL=valtimo-decision.umd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"valtimo-decision.umd.js","sources":["../../../../projects/valtimo/decision/src/lib/models/decision.model.ts","../../../../projects/valtimo/decision/src/lib/models/index.ts","../../../../projects/valtimo/decision/src/lib/decision.component.ts","../../../../projects/valtimo/decision/src/lib/decision.service.ts","../../../../projects/valtimo/decision/src/lib/decision-display/decision-display.component.ts","../../../../projects/valtimo/decision/src/lib/decision-routing.module.ts","../../../../projects/valtimo/decision/src/lib/decision-deploy/decision-deploy.component.ts","../../../../projects/valtimo/decision/src/lib/decision-list/decision-list.component.ts","../../../../projects/valtimo/decision/src/lib/decision.module.ts","../../../../projects/valtimo/decision/src/public-api.ts","../../../../projects/valtimo/decision/src/valtimo-decision.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\nexport interface Decision {\n category: string;\n decisionRequirementsDefinitionId: string;\n decisionRequirementsDefinitionKey: string;\n deploymentId: string;\n historyTimeToLive: number;\n id: string;\n key: string;\n name: string;\n resource: string;\n tenantId: string;\n version: number;\n versionTag: string;\n}\n\nexport interface DecisionXml {\n id: string;\n dmnXml: string;\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 */\n\nexport * from './decision.model';\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 {Component, ViewChild} from '@angular/core';\nimport {DecisionDeployComponent} from './decision-deploy/decision-deploy.component';\nimport {DecisionListComponent} from './decision-list/decision-list.component';\n\n@Component({\n selector: 'valtimo-decision',\n templateUrl: './decision.component.html',\n styleUrls: ['./decision.component.scss'],\n})\nexport class DecisionComponent {\n @ViewChild('decisionDeploy') deploy: DecisionDeployComponent;\n @ViewChild('decisionList') list: DecisionListComponent;\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 {Injectable} from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {Observable} from 'rxjs';\nimport {Decision, DecisionXml} from './models';\nimport {ConfigService} from '@valtimo/config';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DecisionService {\n private valtimoApiConfig: any;\n\n constructor(private configService: ConfigService, private http: HttpClient) {\n this.valtimoApiConfig = configService.config.valtimoApi;\n }\n\n deployDmn(dmn: File): Observable<any> {\n const formData: FormData = new FormData();\n formData.append('file', dmn);\n formData.append('deployment-name', 'dmnTableDeploy');\n formData.append('deployment-source', 'process application');\n return this.http.post<any>(\n `${this.valtimoApiConfig.endpointUri}camunda-rest/engine/default/deployment/create`,\n formData\n );\n }\n\n getDecisions(): Observable<Decision[]> {\n return this.http.get<Decision[]>(\n `${this.valtimoApiConfig.endpointUri}camunda-rest/engine/default/decision-definition`\n );\n }\n\n getDecisionXml(decisionId: string): Observable<DecisionXml> {\n return this.http.get<DecisionXml>(\n `${this.valtimoApiConfig.endpointUri}camunda-rest/engine/default/decision-definition/${decisionId}/xml`\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 {Component, OnInit, ViewEncapsulation} from '@angular/core';\nimport {DecisionService} from '../decision.service';\nimport DmnViewer from 'dmn-js';\nimport {DecisionXml} from '../models';\nimport {ActivatedRoute} from '@angular/router';\n\n@Component({\n selector: 'valtimo-decision-display',\n templateUrl: './decision-display.component.html',\n styleUrls: ['./decision-display.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class DecisionDisplayComponent implements OnInit {\n public viewer: DmnViewer;\n private decisionId: string;\n public decisionXml: string;\n\n constructor(private decisionService: DecisionService, private route: ActivatedRoute) {}\n\n ngOnInit() {\n this.viewer = new DmnViewer({\n container: '#canvas',\n });\n this.decisionId = this.route.snapshot.paramMap.get('id');\n this.loadDecisionXml();\n }\n\n loadDecisionXml(): void {\n this.decisionService.getDecisionXml(this.decisionId).subscribe((decision: DecisionXml) => {\n this.viewer.importXML(decision.dmnXml);\n this.decisionXml = decision.dmnXml;\n });\n }\n\n download(): void {\n const file = new Blob([this.decisionXml], {type: 'text/xml'});\n const link = document.createElement('a');\n link.download = `decision_table_${this.decisionId}.dmn`;\n link.href = window.URL.createObjectURL(file);\n link.click();\n window.URL.revokeObjectURL(link.href);\n link.remove();\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 {DecisionComponent} from './decision.component';\nimport {DecisionDisplayComponent} from './decision-display/decision-display.component';\nimport {ROLE_ADMIN} from '@valtimo/config';\n\nconst routes: Routes = [\n {\n path: 'decision-tables',\n component: DecisionComponent,\n canActivate: [AuthGuardService],\n data: {title: 'Decision tables', roles: [ROLE_ADMIN]},\n },\n {\n path: 'decision-tables/:id',\n component: DecisionDisplayComponent,\n canActivate: [AuthGuardService],\n data: {title: 'Decision tables', roles: [ROLE_ADMIN]},\n },\n];\n\n@NgModule({\n declarations: [],\n imports: [CommonModule, RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class DecisionRoutingModule {}\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 {Component, EventEmitter, OnInit, Output, ViewChild} from '@angular/core';\nimport {DecisionService} from '../decision.service';\nimport {ModalComponent} from '@valtimo/components';\n\n@Component({\n selector: 'valtimo-decision-deploy',\n templateUrl: './decision-deploy.component.html',\n styleUrls: ['./decision-deploy.component.scss'],\n})\nexport class DecisionDeployComponent implements OnInit {\n public dmn: File | null = null;\n @Output() deploySuccessful = new EventEmitter();\n @ViewChild('decisionDeployModal') modal: ModalComponent;\n\n constructor(private decisionService: DecisionService) {}\n\n ngOnInit() {}\n\n onChange(files: FileList): void {\n this.dmn = files.item(0);\n }\n\n deployDmn(): void {\n this.decisionService.deployDmn(this.dmn).subscribe(() => {\n this.modal.hide();\n this.deploySuccessful.emit();\n });\n }\n\n openModal() {\n this.modal.show();\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 {Component, OnInit} from '@angular/core';\nimport {Decision} from '../models';\nimport {DecisionService} from '../decision.service';\nimport {Router} from '@angular/router';\n\n@Component({\n selector: 'valtimo-decision-list',\n templateUrl: './decision-list.component.html',\n styleUrls: ['./decision-list.component.scss'],\n})\nexport class DecisionListComponent implements OnInit {\n public decisions: Decision[];\n public fields = [\n {key: 'key', label: 'Key'},\n {key: 'name', label: 'Name'},\n {key: 'version', label: 'Version'},\n ];\n\n constructor(private decisionService: DecisionService, private router: Router) {}\n\n ngOnInit() {\n this.loadDecisions();\n }\n\n loadDecisions() {\n this.decisionService.getDecisions().subscribe((decisions: Decision[]) => {\n this.decisions = decisions;\n });\n }\n\n viewDecisionTable(decision: Decision) {\n this.router.navigate(['/decision-tables', decision.id]);\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 {DecisionComponent} from './decision.component';\nimport {DecisionRoutingModule} from './decision-routing.module';\nimport {DecisionDeployComponent} from './decision-deploy/decision-deploy.component';\nimport {CommonModule} from '@angular/common';\nimport {FormsModule} from '@angular/forms';\nimport {DecisionDisplayComponent} from './decision-display/decision-display.component';\nimport {DecisionListComponent} from './decision-list/decision-list.component';\nimport {ListModule, ModalModule, WidgetModule} from '@valtimo/components';\nimport {TranslateModule} from '@ngx-translate/core';\n\n@NgModule({\n declarations: [\n DecisionComponent,\n DecisionDeployComponent,\n DecisionDisplayComponent,\n DecisionListComponent,\n ],\n imports: [\n DecisionRoutingModule,\n WidgetModule,\n ListModule,\n TranslateModule,\n ModalModule,\n CommonModule,\n FormsModule,\n ],\n exports: [DecisionComponent],\n})\nexport class DecisionModule {}\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 decision\n */\n\nexport * from './lib/models';\nexport * from './lib/decision.module';\nexport * from './lib/decision.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {DecisionDeployComponent as ɵa} from './lib/decision-deploy/decision-deploy.component';\nexport {DecisionDisplayComponent as ɵc} from './lib/decision-display/decision-display.component';\nexport {DecisionListComponent as ɵd} from './lib/decision-list/decision-list.component';\nexport {DecisionRoutingModule as ɵe} from './lib/decision-routing.module';\nexport {DecisionService as ɵb} from './lib/decision.service';"],"names":["Component","ViewChild","Injectable","ConfigService","HttpClient","ViewEncapsulation","ActivatedRoute","ROLE_ADMIN","AuthGuardService","NgModule","CommonModule","RouterModule","EventEmitter","Output","Router","WidgetModule","ListModule","TranslateModule","ModalModule","FormsModule"],"mappings":";;;;;;;;IAAA;;;;;;;;;;;;;;;;ICAA;;;;;;;;;;;;;;;;;;ICAA;;;;;;;;;;;;;;;;QAyBA;;;;;gBALCA,YAAS,SAAC;oBACT,QAAQ,EAAE,kBAAkB;oBAC5B,6vCAAwC;;iBAEzC;;;yBAEEC,YAAS,SAAC,gBAAgB;uBAC1BA,YAAS,SAAC,cAAc;;;IC3B3B;;;;;;;;;;;;;;;;QA4BE,yBAAoB,aAA4B,EAAU,IAAgB;YAAtD,kBAAa,GAAb,aAAa,CAAe;YAAU,SAAI,GAAJ,IAAI,CAAY;YACxE,IAAI,CAAC,gBAAgB,GAAG,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC;SACzD;QAED,mCAAS,GAAT,UAAU,GAAS;YACjB,IAAM,QAAQ,GAAa,IAAI,QAAQ,EAAE,CAAC;YAC1C,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YAC7B,QAAQ,CAAC,MAAM,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;YACrD,QAAQ,CAAC,MAAM,CAAC,mBAAmB,EAAE,qBAAqB,CAAC,CAAC;YAC5D,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAChB,IAAI,CAAC,gBAAgB,CAAC,WAAW,kDAA+C,EACnF,QAAQ,CACT,CAAC;SACH;QAED,sCAAY,GAAZ;Y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AiB,GAAjB,UAAkB,QAAkB;YAClC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,kBAAkB,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;SACzD;;;;gBA3BFD,YAAS,SAAC;oBACT,QAAQ,EAAE,uBAAuB;oBACjC,+mCAA6C;;iBAE9C;;;gBAPO,eAAe;gBACfc,aAAM;;;ICnBd;;;;;;;;;;;;;;;;QA6CA;;;;;gBAlBCL,WAAQ,SAAC;oBACR,YAAY,EAAE;wBACZ,iBAAiB;wBACjB,uBAAuB;wBACvB,wBAAwB;wBACxB,qBAAqB;qBACtB;oBACD,OAAO,EAAE;wBACP,qBAAqB;wBACrBM,uBAAY;wBACZC,qBAAU;wBACVC,oBAAe;wBACfC,sBAAW;wBACXR,mBAAY;wBACZS,iBAAW;qBACZ;oBACD,OAAO,EAAE,CAAC,iBAAiB,CAAC;iBAC7B;;;IC5CD;;;;;;;;;;;;;;;;ICAA;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +0,0 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/core"),require("@angular/router"),require("@angular/common"),require("@valtimo/security"),require("@angular/common/http"),require("@valtimo/config"),require("dmn-js"),require("@angular/forms"),require("@valtimo/components"),require("@ngx-translate/core")):"function"==typeof define&&define.amd?define("@valtimo/decision",["exports","@angular/core","@angular/router","@angular/common","@valtimo/security","@angular/common/http","@valtimo/config","dmn-js","@angular/forms","@valtimo/components","@ngx-translate/core"],n):n(((e=e||self).valtimo=e.valtimo||{},e.valtimo.decision={}),e.ng.core,e.ng.router,e.ng.common,e.security,e.ng.common.http,e.config,e.DmnViewer,e.ng.forms,e.components,e.core$1)}(this,(function(e,n,i,t,o,s,r,a,c,l,d){"use strict";a=a&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a;var p=function(){};p.decorators=[{type:n.Component,args:[{selector:"valtimo-decision",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 pt-0">\n <div class="container-fluid">\n <div class="text-right">\n <div class="btn-group mt-m3px mb-3">\n <button (click)="this.deploy.openModal()" class="btn btn-secondary btn-space mr-0">\n <i class="icon mdi mdi-upload mr-1"></i>\n {{ \'Upload\' | translate }}\n </button>\n </div>\n </div>\n <valtimo-decision-list #decisionList></valtimo-decision-list>\n <valtimo-decision-deploy\n #decisionDeploy\n (deploySuccessful)="this.list.loadDecisions()"\n ></valtimo-decision-deploy>\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 */']}]}],p.propDecorators={deploy:[{type:n.ViewChild,args:["decisionDeploy"]}],list:[{type:n.ViewChild,args:["decisionList"]}]};var u=function(){function e(e,n){this.configService=e,this.http=n,this.valtimoApiConfig=e.config.valtimoApi}return e.prototype.deployDmn=function(e){var n=new FormData;return n.append("file",e),n.append("deployment-name","dmnTableDeploy"),n.append("deployment-source","process application"),this.http.post(this.valtimoApiConfig.endpointUri+"camunda-rest/engine/default/deployment/create",n)},e.prototype.getDecisions=function(){return this.http.get(this.valtimoApiConfig.endpointUri+"camunda-rest/engine/default/decision-definition")},e.prototype.getDecisionXml=function(e){return this.http.get(this.valtimoApiConfig.endpointUri+"camunda-rest/engine/default/decision-definition/"+e+"/xml")},e}();u.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new u(n.ɵɵinject(r.ConfigService),n.ɵɵinject(s.HttpClient))},token:u,providedIn:"root"}),u.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],u.ctorParameters=function(){return[{type:r.ConfigService},{type:s.HttpClient}]};var m=function(){function e(e,n){this.decisionService=e,this.route=n}return e.prototype.ngOnInit=function(){this.viewer=new a({container:"#canvas"}),this.decisionId=this.route.snapshot.paramMap.get("id"),this.loadDecisionXml()},e.prototype.loadDecisionXml=function(){var e=this;this.decisionService.getDecisionXml(this.decisionId).subscribe((function(n){e.viewer.importXML(n.dmnXml),e.decisionXml=n.dmnXml}))},e.prototype.download=function(){var e=new Blob([this.decisionXml],{type:"text/xml"}),n=document.createElement("a");n.download="decision_table_"+this.decisionId+".dmn",n.href=window.URL.createObjectURL(e),n.click(),window.URL.revokeObjectURL(n.href),n.remove()},e}();m.decorators=[{type:n.Component,args:[{selector:"valtimo-decision-display",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 pt-0">\n <div class="container-fluid">\n <div class="text-right">\n <div class="btn-group mt-m3px mb-3">\n <button (click)="download()" class="btn btn-primary btn-space mr-0">\n <i class="fa fa-save"></i> &nbsp;\n <span>{{ \'Download\' | translate }}</span>\n </button>\n </div>\n </div>\n <div id="canvas"></div>\n </div>\n</div>\n',encapsulation:n.ViewEncapsulation.None,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 */']}]}],m.ctorParameters=function(){return[{type:u},{type:i.ActivatedRoute}]};var h={title:"Decision tables",roles:[r.ROLE_ADMIN]},f={title:"Decision tables",roles:[r.ROLE_ADMIN]},y=[{path:"decision-tables",component:p,canActivate:[o.AuthGuardService],data:h},{path:"decision-tables/:id",component:m,canActivate:[o.AuthGuardService],data:f}],g=function(){};g.decorators=[{type:n.NgModule,args:[{declarations:[],imports:[t.CommonModule,i.RouterModule.forChild(y)],exports:[i.RouterModule]}]}];var v=function(){function e(e){this.decisionService=e,this.dmn=null,this.deploySuccessful=new n.EventEmitter}return e.prototype.ngOnInit=function(){},e.prototype.onChange=function(e){this.dmn=e.item(0)},e.prototype.deployDmn=function(){var e=this;this.decisionService.deployDmn(this.dmn).subscribe((function(){e.modal.hide(),e.deploySuccessful.emit()}))},e.prototype.openModal=function(){this.modal.show()},e}();v.decorators=[{type:n.Component,args:[{selector:"valtimo-decision-deploy",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<valtimo-modal\n #decisionDeployModal\n elementId="decisionDeployModal"\n title="Upload Decision table"\n [showFooter]="true"\n>\n <div body>\n <div class="mt-3">{{ \'decisions.upload.description\' | translate }}</div>\n <div class="form-group mt-3 mb-3">\n <input type="file" id="file" accept=".dmn" (change)="onChange($event.target.files)" />\n </div>\n </div>\n <div footer>\n <div class="mb-0 p-3 text-right">\n <button\n [disabled]="!dmn"\n class="btn btn-primary btn-space"\n type="button"\n (click)="deployDmn()"\n >\n <i class="icon mdi mdi-upload mr-1"></i>\n {{ \'Upload\' | translate }}\n </button>\n </div>\n </div>\n</valtimo-modal>\n',styles:['/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */']}]}],v.ctorParameters=function(){return[{type:u}]},v.propDecorators={deploySuccessful:[{type:n.Output}],modal:[{type:n.ViewChild,args:["decisionDeployModal"]}]};var b=function(){function e(e,n){this.decisionService=e,this.router=n,this.fields=[{key:"key",label:"Key"},{key:"name",label:"Name"},{key:"version",label:"Version"}]}return e.prototype.ngOnInit=function(){this.loadDecisions()},e.prototype.loadDecisions=function(){var e=this;this.decisionService.getDecisions().subscribe((function(n){e.decisions=n}))},e.prototype.viewDecisionTable=function(e){this.router.navigate(["/decision-tables",e.id])},e}();b.decorators=[{type:n.Component,args:[{selector:"valtimo-decision-list",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<valtimo-widget>\n <valtimo-list\n [items]="decisions"\n [fields]="fields"\n (rowClicked)="viewDecisionTable($event)"\n [header]="true"\n [viewMode]="true"\n [isSearchable]="true"\n >\n <div header>\n <h3 class="list-header-title">{{ \'Decision tables\' | translate }}</h3>\n <h5 class="list-header-description">{{ \'Overview of all Decision tables\' | translate }}</h5>\n </div>\n </valtimo-list>\n</valtimo-widget>\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 */']}]}],b.ctorParameters=function(){return[{type:u},{type:i.Router}]};var L=function(){};L.decorators=[{type:n.NgModule,args:[{declarations:[p,v,m,b],imports:[g,l.WidgetModule,l.ListModule,d.TranslateModule,l.ModalModule,t.CommonModule,c.FormsModule],exports:[p]}]}],e.DecisionComponent=p,e.DecisionModule=L,e.ɵa=v,e.ɵb=u,e.ɵc=m,e.ɵd=b,e.ɵe=g,Object.defineProperty(e,"__esModule",{value:!0})}));
2
- //# sourceMappingURL=valtimo-decision.umd.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../projects/valtimo/decision/src/lib/decision.component.ts","../../../../projects/valtimo/decision/src/lib/decision.service.ts","../../../../projects/valtimo/decision/src/lib/decision-display/decision-display.component.ts","../../../../projects/valtimo/decision/src/lib/decision-routing.module.ts","../../../../projects/valtimo/decision/src/lib/decision-deploy/decision-deploy.component.ts","../../../../projects/valtimo/decision/src/lib/decision-list/decision-list.component.ts","../../../../projects/valtimo/decision/src/lib/decision.module.ts"],"names":["Component","args","selector","template","ViewChild","DecisionService","configService","http","this","valtimoApiConfig","config","valtimoApi","prototype","deployDmn","dmn","formData","FormData","append","post","endpointUri","getDecisions","get","getDecisionXml","decisionId","Injectable","providedIn","ConfigService","HttpClient","DecisionDisplayComponent","decisionService","route","ngOnInit","viewer","DmnViewer","container","snapshot","paramMap","loadDecisionXml","_this","subscribe","decision","importXML","dmnXml","decisionXml","download","file","Blob","type","link","document","createElement","href","window","URL","createObjectURL","click","revokeObjectURL","remove","encapsulation","ViewEncapsulation","None","ActivatedRoute","title","roles","ROLE_ADMIN","routes","path","component","DecisionComponent","canActivate","AuthGuardService","data","NgModule","declarations","imports","CommonModule","RouterModule","forChild","exports","DecisionDeployComponent","deploySuccessful","EventEmitter","onChange","files","item","modal","hide","emit","openModal","show","Output","DecisionListComponent","router","fields","key","label","loadDecisions","decisions","viewDecisionTable","navigate","id","Router","DecisionRoutingModule","WidgetModule","ListModule","TranslateModule","ModalModule","FormsModule"],"mappings":"q5BAyBA,iCALCA,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,mBACVC,SAAA,g5DAICC,EAAAA,UAASH,KAAA,CAAC,gCACVG,EAAAA,UAASH,KAAA,CAAC,oCCCX,SAAAI,EAAoBC,EAAsCC,GAAtCC,KAAAF,cAAAA,EAAsCE,KAAAD,KAAAA,EACxDC,KAAKC,iBAAmBH,EAAcI,OAAOC,kBAG/CN,EAAAO,UAAAC,UAAA,SAAUC,GACR,IAAMC,EAAqB,IAAIC,SAI/B,OAHAD,EAASE,OAAO,OAAQH,GACxBC,EAASE,OAAO,kBAAmB,kBACnCF,EAASE,OAAO,oBAAqB,uBAC9BT,KAAKD,KAAKW,KACZV,KAAK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sF,kBAAA,SAAkB1D,GAChBhC,KAAKoF,OAAOO,SAAS,CAAC,mBAAoB3D,EAAS4D,+BA1BtDpG,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,wBACVC,SAAA,6wDALME,SACAgG,EAAAA,gBC0BR,iCAlBC7B,EAAAA,SAAQvE,KAAA,CAAC,CACRwE,aAAc,CACZL,EACAW,EACAnD,EACA+D,GAEFjB,QAAS,CACP4B,EACAC,EAAAA,aACAC,EAAAA,WACAC,EAAAA,gBACAC,EAAAA,YACA/B,EAAAA,aACAgC,EAAAA,aAEF7B,QAAS,CAACV","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 {Component, ViewChild} from '@angular/core';\nimport {DecisionDeployComponent} from './decision-deploy/decision-deploy.component';\nimport {DecisionListComponent} from './decision-list/decision-list.component';\n\n@Component({\n selector: 'valtimo-decision',\n templateUrl: './decision.component.html',\n styleUrls: ['./decision.component.scss'],\n})\nexport class DecisionComponent {\n @ViewChild('decisionDeploy') deploy: DecisionDeployComponent;\n @ViewChild('decisionList') list: DecisionListComponent;\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 {Injectable} from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {Observable} from 'rxjs';\nimport {Decision, DecisionXml} from './models';\nimport {ConfigService} from '@valtimo/config';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DecisionService {\n private valtimoApiConfig: any;\n\n constructor(private configService: ConfigService, private http: HttpClient) {\n this.valtimoApiConfig = configService.config.valtimoApi;\n }\n\n deployDmn(dmn: File): Observable<any> {\n const formData: FormData = new FormData();\n formData.append('file', dmn);\n formData.append('deployment-name', 'dmnTableDeploy');\n formData.append('deployment-source', 'process application');\n return this.http.post<any>(\n `${this.valtimoApiConfig.endpointUri}camunda-rest/engine/default/deployment/create`,\n formData\n );\n }\n\n getDecisions(): Observable<Decision[]> {\n return this.http.get<Decision[]>(\n `${this.valtimoApiConfig.endpointUri}camunda-rest/engine/default/decision-definition`\n );\n }\n\n getDecisionXml(decisionId: string): Observable<DecisionXml> {\n return this.http.get<DecisionXml>(\n `${this.valtimoApiConfig.endpointUri}camunda-rest/engine/default/decision-definition/${decisionId}/xml`\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 {Component, OnInit, ViewEncapsulation} from '@angular/core';\nimport {DecisionService} from '../decision.service';\nimport DmnViewer from 'dmn-js';\nimport {DecisionXml} from '../models';\nimport {ActivatedRoute} from '@angular/router';\n\n@Component({\n selector: 'valtimo-decision-display',\n templateUrl: './decision-display.component.html',\n styleUrls: ['./decision-display.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class DecisionDisplayComponent implements OnInit {\n public viewer: DmnViewer;\n private decisionId: string;\n public decisionXml: string;\n\n constructor(private decisionService: DecisionService, private route: ActivatedRoute) {}\n\n ngOnInit() {\n this.viewer = new DmnViewer({\n container: '#canvas',\n });\n this.decisionId = this.route.snapshot.paramMap.get('id');\n this.loadDecisionXml();\n }\n\n loadDecisionXml(): void {\n this.decisionService.getDecisionXml(this.decisionId).subscribe((decision: DecisionXml) => {\n this.viewer.importXML(decision.dmnXml);\n this.decisionXml = decision.dmnXml;\n });\n }\n\n download(): void {\n const file = new Blob([this.decisionXml], {type: 'text/xml'});\n const link = document.createElement('a');\n link.download = `decision_table_${this.decisionId}.dmn`;\n link.href = window.URL.createObjectURL(file);\n link.click();\n window.URL.revokeObjectURL(link.href);\n link.remove();\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 {DecisionComponent} from './decision.component';\nimport {DecisionDisplayComponent} from './decision-display/decision-display.component';\nimport {ROLE_ADMIN} from '@valtimo/config';\n\nconst routes: Routes = [\n {\n path: 'decision-tables',\n component: DecisionComponent,\n canActivate: [AuthGuardService],\n data: {title: 'Decision tables', roles: [ROLE_ADMIN]},\n },\n {\n path: 'decision-tables/:id',\n component: DecisionDisplayComponent,\n canActivate: [AuthGuardService],\n data: {title: 'Decision tables', roles: [ROLE_ADMIN]},\n },\n];\n\n@NgModule({\n declarations: [],\n imports: [CommonModule, RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class DecisionRoutingModule {}\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 {Component, EventEmitter, OnInit, Output, ViewChild} from '@angular/core';\nimport {DecisionService} from '../decision.service';\nimport {ModalComponent} from '@valtimo/components';\n\n@Component({\n selector: 'valtimo-decision-deploy',\n templateUrl: './decision-deploy.component.html',\n styleUrls: ['./decision-deploy.component.scss'],\n})\nexport class DecisionDeployComponent implements OnInit {\n public dmn: File | null = null;\n @Output() deploySuccessful = new EventEmitter();\n @ViewChild('decisionDeployModal') modal: ModalComponent;\n\n constructor(private decisionService: DecisionService) {}\n\n ngOnInit() {}\n\n onChange(files: FileList): void {\n this.dmn = files.item(0);\n }\n\n deployDmn(): void {\n this.decisionService.deployDmn(this.dmn).subscribe(() => {\n this.modal.hide();\n this.deploySuccessful.emit();\n });\n }\n\n openModal() {\n this.modal.show();\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 {Component, OnInit} from '@angular/core';\nimport {Decision} from '../models';\nimport {DecisionService} from '../decision.service';\nimport {Router} from '@angular/router';\n\n@Component({\n selector: 'valtimo-decision-list',\n templateUrl: './decision-list.component.html',\n styleUrls: ['./decision-list.component.scss'],\n})\nexport class DecisionListComponent implements OnInit {\n public decisions: Decision[];\n public fields = [\n {key: 'key', label: 'Key'},\n {key: 'name', label: 'Name'},\n {key: 'version', label: 'Version'},\n ];\n\n constructor(private decisionService: DecisionService, private router: Router) {}\n\n ngOnInit() {\n this.loadDecisions();\n }\n\n loadDecisions() {\n this.decisionService.getDecisions().subscribe((decisions: Decision[]) => {\n this.decisions = decisions;\n });\n }\n\n viewDecisionTable(decision: Decision) {\n this.router.navigate(['/decision-tables', decision.id]);\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 {DecisionComponent} from './decision.component';\nimport {DecisionRoutingModule} from './decision-routing.module';\nimport {DecisionDeployComponent} from './decision-deploy/decision-deploy.component';\nimport {CommonModule} from '@angular/common';\nimport {FormsModule} from '@angular/forms';\nimport {DecisionDisplayComponent} from './decision-display/decision-display.component';\nimport {DecisionListComponent} from './decision-list/decision-list.component';\nimport {ListModule, ModalModule, WidgetModule} from '@valtimo/components';\nimport {TranslateModule} from '@ngx-translate/core';\n\n@NgModule({\n declarations: [\n DecisionComponent,\n DecisionDeployComponent,\n DecisionDisplayComponent,\n DecisionListComponent,\n ],\n imports: [\n DecisionRoutingModule,\n WidgetModule,\n ListModule,\n TranslateModule,\n ModalModule,\n CommonModule,\n FormsModule,\n ],\n exports: [DecisionComponent],\n})\nexport class DecisionModule {}\n"]}