@valtimo/decision 5.8.0 → 5.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/decision-deploy/decision-deploy.component.mjs +10 -7
- package/esm2020/lib/decision-display/decision-display.component.mjs +25 -7
- package/esm2020/lib/decision-list/decision-list.component.mjs +33 -17
- package/esm2020/lib/decision-modeler/decision-modeler.component.mjs +211 -0
- package/esm2020/lib/decision-modeler/empty-decision.mjs +26 -0
- package/esm2020/lib/decision-routing.module.mjs +15 -2
- package/esm2020/lib/decision.component.mjs +13 -8
- package/esm2020/lib/decision.module.mjs +15 -5
- package/esm2020/lib/decision.service.mjs +7 -1
- package/esm2020/lib/services/decision-state.service.mjs +23 -0
- package/esm2020/lib/services/index.mjs +2 -0
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/valtimo-decision.mjs +351 -50
- package/fesm2015/valtimo-decision.mjs.map +1 -1
- package/fesm2020/valtimo-decision.mjs +346 -35
- package/fesm2020/valtimo-decision.mjs.map +1 -1
- package/lib/decision-deploy/decision-deploy.component.d.ts +4 -2
- package/lib/decision-deploy/decision-deploy.component.d.ts.map +1 -1
- package/lib/decision-display/decision-display.component.d.ts +7 -3
- package/lib/decision-display/decision-display.component.d.ts.map +1 -1
- package/lib/decision-list/decision-list.component.d.ts +10 -6
- package/lib/decision-list/decision-list.component.d.ts.map +1 -1
- package/lib/decision-modeler/decision-modeler.component.d.ts +46 -0
- package/lib/decision-modeler/decision-modeler.component.d.ts.map +1 -0
- package/lib/decision-modeler/empty-decision.d.ts +4 -0
- package/lib/decision-modeler/empty-decision.d.ts.map +1 -0
- package/lib/decision-routing.module.d.ts.map +1 -1
- package/lib/decision.component.d.ts +4 -0
- package/lib/decision.component.d.ts.map +1 -1
- package/lib/decision.module.d.ts +8 -6
- package/lib/decision.module.d.ts.map +1 -1
- package/lib/decision.service.d.ts +2 -0
- package/lib/decision.service.d.ts.map +1 -1
- package/lib/services/decision-state.service.d.ts +10 -0
- package/lib/services/decision-state.service.d.ts.map +1 -0
- package/lib/services/index.d.ts +2 -0
- package/lib/services/index.d.ts.map +1 -0
- package/package.json +3 -2
- package/public-api.d.ts +1 -0
- package/public-api.d.ts.map +1 -1
|
@@ -2,16 +2,25 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Injectable, Component, EventEmitter, Output, ViewChild, ViewEncapsulation, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@valtimo/config';
|
|
4
4
|
import { ROLE_ADMIN } from '@valtimo/config';
|
|
5
|
+
import { Subject, startWith, BehaviorSubject, switchMap, map, tap, filter, combineLatest, from, take, catchError, of } from 'rxjs';
|
|
5
6
|
import * as i2 from '@angular/common/http';
|
|
6
7
|
import * as i2$1 from '@angular/router';
|
|
7
8
|
import { RouterModule } from '@angular/router';
|
|
8
|
-
import * as
|
|
9
|
-
import { WidgetModule, ListModule, ModalModule } from '@valtimo/components';
|
|
10
|
-
import * as
|
|
11
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
9
|
+
import * as i5 from '@valtimo/components';
|
|
10
|
+
import { WidgetModule, ListModule, ModalModule, SpinnerModule } from '@valtimo/components';
|
|
11
|
+
import * as i7 from '@angular/common';
|
|
12
12
|
import { CommonModule } from '@angular/common';
|
|
13
|
+
import * as i4 from '@ngx-translate/core';
|
|
14
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
13
15
|
import { AuthGuardService } from '@valtimo/security';
|
|
16
|
+
import { __awaiter } from 'tslib';
|
|
17
|
+
import DmnJS from 'dmn-js/dist/dmn-modeler.development.js';
|
|
18
|
+
import { migrateDiagram } from '@bpmn-io/dmn-migrate';
|
|
19
|
+
import * as i5$1 from '@valtimo/layout';
|
|
20
|
+
import * as i6 from '@valtimo/user-interface';
|
|
21
|
+
import { SelectModule } from '@valtimo/user-interface';
|
|
14
22
|
import DmnViewer from 'dmn-js';
|
|
23
|
+
import * as i3 from 'ngx-toastr';
|
|
15
24
|
import { FormsModule } from '@angular/forms';
|
|
16
25
|
|
|
17
26
|
/*
|
|
@@ -61,6 +70,12 @@ class DecisionService {
|
|
|
61
70
|
getDecisions() {
|
|
62
71
|
return this.http.get(`${this.valtimoApiConfig.endpointUri}camunda-rest/engine/default/decision-definition`);
|
|
63
72
|
}
|
|
73
|
+
getDecisionById(decisionId) {
|
|
74
|
+
return this.http.get(`${this.valtimoApiConfig.endpointUri}camunda-rest/engine/default/decision-definition/${decisionId}`);
|
|
75
|
+
}
|
|
76
|
+
getLatestDecisionByKey(decisionKey) {
|
|
77
|
+
return this.http.get(`${this.valtimoApiConfig.endpointUri}camunda-rest/engine/default/decision-definition/key/${decisionKey}`);
|
|
78
|
+
}
|
|
64
79
|
getDecisionXml(decisionId) {
|
|
65
80
|
return this.http.get(`${this.valtimoApiConfig.endpointUri}camunda-rest/engine/default/decision-definition/${decisionId}/xml`);
|
|
66
81
|
}
|
|
@@ -74,6 +89,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
74
89
|
}]
|
|
75
90
|
}], ctorParameters: function () { return [{ type: i1.ConfigService }, { type: i2.HttpClient }]; } });
|
|
76
91
|
|
|
92
|
+
class DecisionStateService {
|
|
93
|
+
constructor() {
|
|
94
|
+
this._refreshDecisions$ = new Subject();
|
|
95
|
+
}
|
|
96
|
+
get refreshDecisions$() {
|
|
97
|
+
return this._refreshDecisions$.asObservable().pipe(startWith(null));
|
|
98
|
+
}
|
|
99
|
+
refreshDecisions() {
|
|
100
|
+
this._refreshDecisions$.next(null);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
DecisionStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
104
|
+
DecisionStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionStateService, providedIn: 'root' });
|
|
105
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionStateService, decorators: [{
|
|
106
|
+
type: Injectable,
|
|
107
|
+
args: [{
|
|
108
|
+
providedIn: 'root',
|
|
109
|
+
}]
|
|
110
|
+
}] });
|
|
111
|
+
|
|
77
112
|
/*
|
|
78
113
|
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
79
114
|
*
|
|
@@ -90,33 +125,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
90
125
|
* limitations under the License.
|
|
91
126
|
*/
|
|
92
127
|
class DecisionListComponent {
|
|
93
|
-
constructor(decisionService, router) {
|
|
128
|
+
constructor(decisionService, router, configService, stateService) {
|
|
94
129
|
this.decisionService = decisionService;
|
|
95
130
|
this.router = router;
|
|
131
|
+
this.configService = configService;
|
|
132
|
+
this.stateService = stateService;
|
|
96
133
|
this.fields = [
|
|
97
134
|
{ key: 'key', label: 'Key' },
|
|
98
135
|
{ key: 'name', label: 'Name' },
|
|
99
136
|
{ key: 'version', label: 'Version' },
|
|
100
137
|
];
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
138
|
+
this.loading$ = new BehaviorSubject(true);
|
|
139
|
+
this.decisionsLatestVersions$ = this.stateService.refreshDecisions$.pipe(switchMap(() => this.decisionService.getDecisions()), map(decisions => decisions.reduce((acc, curr) => {
|
|
140
|
+
const findInAcc = acc.find(decision => decision.key === curr.key);
|
|
141
|
+
if (findInAcc && findInAcc.version > curr.version) {
|
|
142
|
+
return acc;
|
|
143
|
+
}
|
|
144
|
+
else if (findInAcc && findInAcc.version < curr.version) {
|
|
145
|
+
const newAcc = acc.filter(decision => decision.key !== curr.key);
|
|
146
|
+
return [...newAcc, curr];
|
|
147
|
+
}
|
|
148
|
+
return [...acc, curr];
|
|
149
|
+
}, [])), tap(() => this.loading$.next(false)));
|
|
150
|
+
this.experimentalEditing = this.configService.config.featureToggles.experimentalDmnEditing;
|
|
109
151
|
}
|
|
110
152
|
viewDecisionTable(decision) {
|
|
111
|
-
this.
|
|
153
|
+
if (this.experimentalEditing) {
|
|
154
|
+
this.router.navigate(['/decision-tables/edit', decision.id]);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
this.router.navigate(['/decision-tables', decision.id]);
|
|
158
|
+
}
|
|
112
159
|
}
|
|
113
160
|
}
|
|
114
|
-
DecisionListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionListComponent, deps: [{ token: DecisionService }, { token: i2$1.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
115
|
-
DecisionListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DecisionListComponent, selector: "valtimo-decision-list", ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-widget>\n
|
|
161
|
+
DecisionListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionListComponent, deps: [{ token: DecisionService }, { token: i2$1.Router }, { token: i1.ConfigService }, { token: DecisionStateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
162
|
+
DecisionListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DecisionListComponent, selector: "valtimo-decision-list", ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container *ngIf=\"decisionsLatestVersions$ | async as decisions\">\n <ng-container *ngIf=\"(loading$ | async) === false\">\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\">\n {{ 'Overview of all Decision tables' | translate }}\n </h5>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"loading$ | async\">\n <valtimo-spinner></valtimo-spinner>\n</ng-container>\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], components: [{ type: i5.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { type: i5.ListComponent, selector: "valtimo-list", inputs: ["items", "fields", "pagination", "viewMode", "isSearchable", "header", "actions", "paginationIdentifier", "initialSortState"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged"] }, { type: i5.SpinnerComponent, selector: "valtimo-spinner", inputs: ["useBootstrapSpinner", "name", "type", "size", "color", "bdColor", "fullScreen", "noMarginTop"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i7.AsyncPipe, "translate": i4.TranslatePipe } });
|
|
116
163
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionListComponent, decorators: [{
|
|
117
164
|
type: Component,
|
|
118
|
-
args: [{ selector: 'valtimo-decision-list', 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
|
|
119
|
-
}], ctorParameters: function () { return [{ type: DecisionService }, { type: i2$1.Router }]; } });
|
|
165
|
+
args: [{ selector: 'valtimo-decision-list', 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<ng-container *ngIf=\"decisionsLatestVersions$ | async as decisions\">\n <ng-container *ngIf=\"(loading$ | async) === false\">\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\">\n {{ 'Overview of all Decision tables' | translate }}\n </h5>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"loading$ | async\">\n <valtimo-spinner></valtimo-spinner>\n</ng-container>\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
166
|
+
}], ctorParameters: function () { return [{ type: DecisionService }, { type: i2$1.Router }, { type: i1.ConfigService }, { type: DecisionStateService }]; } });
|
|
120
167
|
|
|
121
168
|
/*
|
|
122
169
|
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
@@ -134,8 +181,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
134
181
|
* limitations under the License.
|
|
135
182
|
*/
|
|
136
183
|
class DecisionDeployComponent {
|
|
137
|
-
constructor(decisionService) {
|
|
184
|
+
constructor(decisionService, stateService) {
|
|
138
185
|
this.decisionService = decisionService;
|
|
186
|
+
this.stateService = stateService;
|
|
139
187
|
this.dmn = null;
|
|
140
188
|
this.deploySuccessful = new EventEmitter();
|
|
141
189
|
}
|
|
@@ -147,18 +195,19 @@ class DecisionDeployComponent {
|
|
|
147
195
|
this.decisionService.deployDmn(this.dmn).subscribe(() => {
|
|
148
196
|
this.modal.hide();
|
|
149
197
|
this.deploySuccessful.emit();
|
|
198
|
+
this.stateService.refreshDecisions();
|
|
150
199
|
});
|
|
151
200
|
}
|
|
152
201
|
openModal() {
|
|
153
202
|
this.modal.show();
|
|
154
203
|
}
|
|
155
204
|
}
|
|
156
|
-
DecisionDeployComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionDeployComponent, deps: [{ token: DecisionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
157
|
-
DecisionDeployComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DecisionDeployComponent, selector: "valtimo-decision-deploy", outputs: { deploySuccessful: "deploySuccessful" }, viewQueries: [{ propertyName: "modal", first: true, predicate: ["decisionDeployModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-modal\n #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 */\n"], components: [{ type:
|
|
205
|
+
DecisionDeployComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionDeployComponent, deps: [{ token: DecisionService }, { token: DecisionStateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
206
|
+
DecisionDeployComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DecisionDeployComponent, selector: "valtimo-decision-deploy", outputs: { deploySuccessful: "deploySuccessful" }, viewQueries: [{ propertyName: "modal", first: true, predicate: ["decisionDeployModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-modal\n #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 */\n"], components: [{ type: i5.ModalComponent, selector: "valtimo-modal", inputs: ["elementId", "title", "subtitle", "templateBelowSubtitle", "showFooter"] }], pipes: { "translate": i4.TranslatePipe } });
|
|
158
207
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionDeployComponent, decorators: [{
|
|
159
208
|
type: Component,
|
|
160
209
|
args: [{ selector: 'valtimo-decision-deploy', 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", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
161
|
-
}], ctorParameters: function () { return [{ type: DecisionService }]; }, propDecorators: { deploySuccessful: [{
|
|
210
|
+
}], ctorParameters: function () { return [{ type: DecisionService }, { type: DecisionStateService }]; }, propDecorators: { deploySuccessful: [{
|
|
162
211
|
type: Output
|
|
163
212
|
}], modal: [{
|
|
164
213
|
type: ViewChild,
|
|
@@ -181,13 +230,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
181
230
|
* limitations under the License.
|
|
182
231
|
*/
|
|
183
232
|
class DecisionComponent {
|
|
233
|
+
constructor(configService) {
|
|
234
|
+
this.configService = configService;
|
|
235
|
+
this.experimentalEditing = this.configService.config.featureToggles.experimentalDmnEditing;
|
|
236
|
+
}
|
|
184
237
|
}
|
|
185
|
-
DecisionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
186
|
-
DecisionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DecisionComponent, selector: "valtimo-decision", viewQueries: [{ propertyName: "deploy", first: true, predicate: ["decisionDeploy"], descendants: true }, { propertyName: "list", first: true, predicate: ["decisionList"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<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
|
|
238
|
+
DecisionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionComponent, deps: [{ token: i1.ConfigService }], target: i0.ɵɵFactoryTarget.Component });
|
|
239
|
+
DecisionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DecisionComponent, selector: "valtimo-decision", viewQueries: [{ propertyName: "deploy", first: true, predicate: ["decisionDeploy"], descendants: true }, { propertyName: "list", first: true, predicate: ["decisionList"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<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\">\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'Upload' | translate }}\n </button>\n <!-- <button-->\n <!-- *ngIf=\"experimentalEditing\"-->\n <!-- class=\"btn btn-primary btn-space\"-->\n <!-- [routerLink]=\"'edit/create'\"-->\n <!-- >-->\n <!-- <i class=\"icon mdi mdi-plus mr-1\"></i>-->\n <!-- {{ 'Create decision table' | translate }}-->\n <!-- </button>-->\n </div>\n </div>\n <valtimo-decision-list #decisionList></valtimo-decision-list>\n <valtimo-decision-deploy #decisionDeploy></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 */\n"], components: [{ type: DecisionListComponent, selector: "valtimo-decision-list" }, { type: DecisionDeployComponent, selector: "valtimo-decision-deploy", outputs: ["deploySuccessful"] }], pipes: { "translate": i4.TranslatePipe } });
|
|
187
240
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionComponent, decorators: [{
|
|
188
241
|
type: Component,
|
|
189
|
-
args: [{ selector: 'valtimo-decision', 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
|
|
190
|
-
}], propDecorators: { deploy: [{
|
|
242
|
+
args: [{ selector: 'valtimo-decision', 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\">\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'Upload' | translate }}\n </button>\n <!-- <button-->\n <!-- *ngIf=\"experimentalEditing\"-->\n <!-- class=\"btn btn-primary btn-space\"-->\n <!-- [routerLink]=\"'edit/create'\"-->\n <!-- >-->\n <!-- <i class=\"icon mdi mdi-plus mr-1\"></i>-->\n <!-- {{ 'Create decision table' | translate }}-->\n <!-- </button>-->\n </div>\n </div>\n <valtimo-decision-list #decisionList></valtimo-decision-list>\n <valtimo-decision-deploy #decisionDeploy></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 */\n"] }]
|
|
243
|
+
}], ctorParameters: function () { return [{ type: i1.ConfigService }]; }, propDecorators: { deploy: [{
|
|
191
244
|
type: ViewChild,
|
|
192
245
|
args: ['decisionDeploy']
|
|
193
246
|
}], list: [{
|
|
@@ -195,25 +248,236 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
195
248
|
args: ['decisionList']
|
|
196
249
|
}] } });
|
|
197
250
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
251
|
+
const EMPTY_DECISION = {
|
|
252
|
+
id: '',
|
|
253
|
+
dmnXml: `<?xml version="1.0" encoding="UTF-8"?>
|
|
254
|
+
<definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/" xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" id="Definitions_1h198v9" name="DRD" namespace="http://camunda.org/schema/1.0/dmn" xmlns:modeler="http://camunda.org/schema/modeler/1.0" exporter="Camunda Modeler" exporterVersion="5.2.0" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.0.0">
|
|
255
|
+
<decision id="Decision_1e18q76" name="Decision 1">
|
|
256
|
+
<decisionTable id="DecisionTable_1apu23m">
|
|
257
|
+
<input id="Input_1">
|
|
258
|
+
<inputExpression id="InputExpression_1" typeRef="string">
|
|
259
|
+
<text></text>
|
|
260
|
+
</inputExpression>
|
|
261
|
+
</input>
|
|
262
|
+
<output id="Output_1" typeRef="string" />
|
|
263
|
+
</decisionTable>
|
|
264
|
+
</decision>
|
|
265
|
+
<dmndi:DMNDI>
|
|
266
|
+
<dmndi:DMNDiagram>
|
|
267
|
+
<dmndi:DMNShape dmnElementRef="Decision_1e18q76">
|
|
268
|
+
<dc:Bounds height="80" width="180" x="160" y="100" />
|
|
269
|
+
</dmndi:DMNShape>
|
|
270
|
+
</dmndi:DMNDiagram>
|
|
271
|
+
</dmndi:DMNDI>
|
|
272
|
+
</definitions>
|
|
273
|
+
`,
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
class DecisionModelerComponent {
|
|
277
|
+
constructor(decisionService, route, router, alertService, translateService, layoutService) {
|
|
278
|
+
this.decisionService = decisionService;
|
|
279
|
+
this.route = route;
|
|
280
|
+
this.router = router;
|
|
281
|
+
this.alertService = alertService;
|
|
282
|
+
this.translateService = translateService;
|
|
283
|
+
this.layoutService = layoutService;
|
|
284
|
+
this.CLASS_NAMES = {
|
|
285
|
+
drd: 'dmn-icon-lasso-tool',
|
|
286
|
+
decisionTable: 'dmn-icon-decision-table',
|
|
287
|
+
literalExpression: 'dmn-icon-literal-expression',
|
|
288
|
+
};
|
|
289
|
+
this.versionSelectionDisabled$ = new BehaviorSubject(true);
|
|
290
|
+
this.isCreating$ = new BehaviorSubject(false);
|
|
291
|
+
this.decisionId$ = this.route.params.pipe(map(params => params === null || params === void 0 ? void 0 : params.id), tap(decisionId => this.isCreating$.next(decisionId === 'create')), filter(decisionId => !!decisionId && decisionId !== 'create'), tap(() => this.versionSelectionDisabled$.next(true)));
|
|
292
|
+
this.selectionId$ = new BehaviorSubject('');
|
|
293
|
+
this.decision$ = this.decisionId$.pipe(switchMap(decisionId => this.decisionService.getDecisionById(decisionId)), tap(decision => {
|
|
294
|
+
if (decision) {
|
|
295
|
+
this.selectionId$.next(decision.id);
|
|
296
|
+
}
|
|
297
|
+
}));
|
|
298
|
+
this.decisionTitle$ = this.decision$.pipe(map(decision => (decision === null || decision === void 0 ? void 0 : decision.key) || ''));
|
|
299
|
+
this.createdDecisionVersionSelectItems$ = new BehaviorSubject([]);
|
|
300
|
+
this.decisionVersionSelectItems$ = combineLatest([
|
|
301
|
+
this.decision$,
|
|
302
|
+
this.decisionService.getDecisions(),
|
|
303
|
+
this.createdDecisionVersionSelectItems$,
|
|
304
|
+
]).pipe(map(([currentDecision, decisions, createdDecisionVersionSelectItems]) => {
|
|
305
|
+
const decisionsWithKey = decisions.filter(decision => decision.key === currentDecision.key);
|
|
306
|
+
return [
|
|
307
|
+
...decisionsWithKey.map(decision => ({
|
|
308
|
+
id: decision.id,
|
|
309
|
+
text: decision.version.toString(),
|
|
310
|
+
})),
|
|
311
|
+
...createdDecisionVersionSelectItems,
|
|
312
|
+
].sort((a, b) => Number(b.text) - Number(a.text));
|
|
313
|
+
}), tap(() => this.versionSelectionDisabled$.next(false)));
|
|
314
|
+
this.decisionXml$ = this.decisionId$.pipe(switchMap(decisionId => this.decisionService.getDecisionXml(decisionId)), tap(decisionXml => {
|
|
315
|
+
if (decisionXml) {
|
|
316
|
+
this.loadDecisionXml(decisionXml);
|
|
317
|
+
}
|
|
318
|
+
}));
|
|
319
|
+
this.setTabEvents = () => {
|
|
320
|
+
const $tabs = this.$tabs;
|
|
321
|
+
const dmnModeler = this.dmnModeler;
|
|
322
|
+
$tabs.delegate('.tab', 'click', function (e) {
|
|
323
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
324
|
+
// get index of view from clicked tab
|
|
325
|
+
const viewIdx = parseInt(this.getAttribute('data-id'), 10);
|
|
326
|
+
// get view using index
|
|
327
|
+
const view = dmnModeler.getViews()[viewIdx];
|
|
328
|
+
// open view
|
|
329
|
+
try {
|
|
330
|
+
yield dmnModeler.open(view);
|
|
331
|
+
}
|
|
332
|
+
catch (err) {
|
|
333
|
+
console.error('error opening tab', err);
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
});
|
|
337
|
+
};
|
|
338
|
+
this.setModelerEvents = () => {
|
|
339
|
+
const $tabs = this.$tabs;
|
|
340
|
+
const CLASS_NAMES = this.CLASS_NAMES;
|
|
341
|
+
this.dmnModeler.on('views.changed', function (event) {
|
|
342
|
+
// get views from event
|
|
343
|
+
const { views, activeView } = event;
|
|
344
|
+
// clear tabs
|
|
345
|
+
$tabs.empty();
|
|
346
|
+
// create a new tab for each view
|
|
347
|
+
views.forEach(function (v, idx) {
|
|
348
|
+
const className = CLASS_NAMES[v.type];
|
|
349
|
+
const tab = $(`
|
|
350
|
+
<div class="tab ${v === activeView ? 'active' : ''}" data-id="${idx}">
|
|
351
|
+
<span class="${className}"></span>
|
|
352
|
+
${v.element.name || v.element.id}
|
|
353
|
+
</div>
|
|
354
|
+
`);
|
|
355
|
+
$tabs.append(tab);
|
|
356
|
+
});
|
|
357
|
+
});
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
ngAfterViewInit() {
|
|
361
|
+
this.setProperties();
|
|
362
|
+
this.setTabEvents();
|
|
363
|
+
this.setModelerEvents();
|
|
364
|
+
}
|
|
365
|
+
switchVersion(decisionId) {
|
|
366
|
+
if (decisionId) {
|
|
367
|
+
this.router.navigate(['/decision-tables/edit', decisionId]);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
deploy() {
|
|
371
|
+
from(this.dmnModeler.saveXML({ format: true }))
|
|
372
|
+
.pipe(map(result => result.xml), map(xml => new File([xml], 'decision.dmn', {
|
|
373
|
+
type: 'text/xml',
|
|
374
|
+
})), switchMap(file => this.decisionService.deployDmn(file)), tap(res => {
|
|
375
|
+
const deployedDefinitions = res.deployedDecisionDefinitions;
|
|
376
|
+
const deployedDecisionDefinition = deployedDefinitions[Object.keys(deployedDefinitions)[0]];
|
|
377
|
+
const deployedId = deployedDecisionDefinition.id;
|
|
378
|
+
this.createdDecisionVersionSelectItems$
|
|
379
|
+
.pipe(take(1))
|
|
380
|
+
.subscribe(createdDecisionVersionSelectItems => {
|
|
381
|
+
if (deployedDecisionDefinition) {
|
|
382
|
+
this.createdDecisionVersionSelectItems$.next([
|
|
383
|
+
...createdDecisionVersionSelectItems,
|
|
384
|
+
{
|
|
385
|
+
id: deployedId,
|
|
386
|
+
text: deployedDecisionDefinition.version.toString(),
|
|
387
|
+
},
|
|
388
|
+
]);
|
|
389
|
+
}
|
|
390
|
+
if (deployedId) {
|
|
391
|
+
setTimeout(() => {
|
|
392
|
+
this.switchVersion(deployedId);
|
|
393
|
+
this.alertService.success(this.translateService.instant('decisions.deploySuccess'));
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
}), catchError(() => {
|
|
398
|
+
this.alertService.error(this.translateService.instant('decisions.deployFailure'));
|
|
399
|
+
return of(null);
|
|
400
|
+
}))
|
|
401
|
+
.subscribe();
|
|
402
|
+
}
|
|
403
|
+
download() {
|
|
404
|
+
from(this.dmnModeler.saveXML({ format: true }))
|
|
405
|
+
.pipe(map(result => result.xml), map(xml => new File([xml], 'decision.dmn', {
|
|
406
|
+
type: 'text/xml',
|
|
407
|
+
})), tap(file => {
|
|
408
|
+
const link = document.createElement('a');
|
|
409
|
+
link.download = 'diagram.dmn';
|
|
410
|
+
link.href = window.URL.createObjectURL(file);
|
|
411
|
+
link.click();
|
|
412
|
+
window.URL.revokeObjectURL(link.href);
|
|
413
|
+
link.remove();
|
|
414
|
+
}))
|
|
415
|
+
.subscribe();
|
|
416
|
+
}
|
|
417
|
+
setProperties() {
|
|
418
|
+
const isCreating = this.isCreating$.getValue();
|
|
419
|
+
this.$container = $('.editor-container');
|
|
420
|
+
this.$tabs = $('.editor-tabs');
|
|
421
|
+
this.dmnModeler = new DmnJS({
|
|
422
|
+
container: this.$container,
|
|
423
|
+
height: 500,
|
|
424
|
+
width: '100%',
|
|
425
|
+
keyboard: {
|
|
426
|
+
bindTo: window,
|
|
427
|
+
},
|
|
428
|
+
});
|
|
429
|
+
if (isCreating) {
|
|
430
|
+
this.loadEmptyDecisionTable();
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
loadEmptyDecisionTable() {
|
|
434
|
+
this.loadDecisionXml(EMPTY_DECISION);
|
|
435
|
+
}
|
|
436
|
+
loadDecisionXml(decision) {
|
|
437
|
+
from(this.dmnModeler.importXML(decision.dmnXml))
|
|
438
|
+
.pipe(tap(() => {
|
|
439
|
+
this.setEditor();
|
|
440
|
+
}), catchError(() => {
|
|
441
|
+
this.migrateAndLoadDecisionXml(decision);
|
|
442
|
+
return of(null);
|
|
443
|
+
}))
|
|
444
|
+
.subscribe();
|
|
445
|
+
}
|
|
446
|
+
migrateAndLoadDecisionXml(decision) {
|
|
447
|
+
from(migrateDiagram(decision.dmnXml))
|
|
448
|
+
.pipe(switchMap(decisionXml => this.dmnModeler.importXML(decisionXml)), tap(() => {
|
|
449
|
+
this.setEditor();
|
|
450
|
+
}), catchError(() => {
|
|
451
|
+
this.alertService.error(this.translateService.instant('decisions.loadFailure'));
|
|
452
|
+
return of(null);
|
|
453
|
+
}))
|
|
454
|
+
.subscribe();
|
|
455
|
+
}
|
|
456
|
+
setEditor() {
|
|
457
|
+
const dmnModeler = this.dmnModeler;
|
|
458
|
+
const activeView = dmnModeler.getActiveView();
|
|
459
|
+
// apply initial logic in DRD view
|
|
460
|
+
if (activeView.type === 'drd') {
|
|
461
|
+
const activeEditor = dmnModeler.getActiveViewer();
|
|
462
|
+
// access active editor components
|
|
463
|
+
const canvas = activeEditor.get('canvas');
|
|
464
|
+
// zoom to fit full viewport
|
|
465
|
+
canvas.zoom('fit-viewport');
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
DecisionModelerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionModelerComponent, deps: [{ token: DecisionService }, { token: i2$1.ActivatedRoute }, { token: i2$1.Router }, { token: i5.AlertService }, { token: i4.TranslateService }, { token: i5$1.LayoutService }], target: i0.ɵɵFactoryTarget.Component });
|
|
470
|
+
DecisionModelerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DecisionModelerComponent, selector: "valtimo-decision-modeler", ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div\n [ngClass]=\"{'main-content pt-0': !layoutService.isFullscreen}\"\n class=\"mb-5\"\n *ngIf=\"{\n decisionXml: decisionXml$ | async\n } as obs\"\n>\n <div [ngClass]=\"{'container-fluid': !layoutService.isFullscreen}\">\n <ng-container *ngTemplateOutlet=\"buttons\"></ng-container>\n <ng-container *ngTemplateOutlet=\"createButtons\"></ng-container>\n <div [ngClass]=\"{'mt-4': !layoutService.isFullscreen}\" class=\"modeler pl-3 pr-3 mb-3\">\n <ng-container *ngTemplateOutlet=\"diagramHeader\"></ng-container>\n <ng-container *ngTemplateOutlet=\"diagram\"></ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #buttons>\n <div\n class=\"text-right\"\n *ngIf=\"(isCreating$ | async) === false && {selectionId: selectionId$ | async} as obs\"\n >\n <div class=\"btn-group mt-m3px mb-3\" *ngIf=\"obs.selectionId && !layoutService.isFullscreen\">\n <button class=\"btn btn-primary btn-space\" (click)=\"download()\">\n <i class=\"icon mdi mdi-download mr-1\"></i>{{ 'processManagement.download' | translate }}\n </button>\n <button\n class=\"btn btn-success btn-space\"\n (click)=\"deploy()\"\n [ngClass]=\"{'mr-0': obs.selectionId !== null}\"\n >\n <i class=\"icon mdi mdi-upload mr-1\"></i>{{ 'decisions.deploy' | translate }}\n </button>\n </div>\n </div>\n</ng-template>\n\n<ng-template #createButtons>\n <div class=\"text-right\" *ngIf=\"isCreating$ | async\">\n <div class=\"btn-group mt-m3px mb-3\" *ngIf=\"!layoutService.isFullscreen\">\n <button class=\"btn btn-success btn-space\" (click)=\"deploy()\">\n <i class=\"icon mdi mdi-upload mr-1\"></i>{{ 'decisions.deploy' | translate }}\n </button>\n <!-- <button-->\n <!-- *ngIf=\"selectedVersion === null\"-->\n <!-- class=\"btn btn-danger btn-space mr-0\"-->\n <!-- (click)=\"reset()\"-->\n <!-- >-->\n <!-- <i class=\"icon mdi mdi-delete mr-1\"></i>{{ 'processManagement.clear' | translate }}-->\n <!-- </button>-->\n </div>\n </div>\n</ng-template>\n\n<ng-template #diagramHeader>\n <div class=\"row pt-4 pb-3 bg-light diagram-header justify-content-between\">\n <ng-container *ngTemplateOutlet=\"decisionTitle\"></ng-container>\n <ng-container *ngTemplateOutlet=\"versionSelection\"></ng-container>\n <ng-container *ngTemplateOutlet=\"fullScreenToggle\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #decisionTitle>\n <div class=\"col-md-5 d-flex align-items-center\">\n <h2 class=\"decision-title\">\n {{ decisionTitle$ | async }}\n </h2>\n </div>\n</ng-template>\n\n<ng-template #versionSelection>\n <div class=\"col-md-2 d-flex justify-content-center align-items-center\">\n <ng-container\n *ngIf=\"\n (isCreating$ | async) === false && {\n versionSelectItems: decisionVersionSelectItems$ | async,\n defaultSelectionId: selectionId$ | async,\n disabled: versionSelectionDisabled$ | async\n } as obs\n \"\n >\n <v-select\n name=\"version\"\n [title]=\"'decisions.version' | translate\"\n [disabled]=\"obs.disabled\"\n [clearable]=\"false\"\n [loading]=\"!obs.versionSelectItems\"\n [items]=\"obs.versionSelectItems\"\n [defaultSelectionId]=\"obs.defaultSelectionId\"\n [widthInPx]=\"100\"\n (selectedChange)=\"switchVersion($event)\"\n ></v-select>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #fullScreenToggle>\n <div class=\"col-md-2 d-flex fullscreen-toggle align-items-start justify-content-end\">\n <i\n (click)=\"layoutService.toggleFullscreen()\"\n [ngClass]=\"{\n 'mdi-fullscreen': !layoutService.isFullscreen,\n 'mdi-fullscreen-exit': layoutService.isFullscreen\n }\"\n class=\"mdi\"\n ></i>\n </div>\n</ng-template>\n\n<ng-template #diagram>\n <div class=\"row bg-white diagram mb-3\">\n <div class=\"dmn-modeler\">\n <div class=\"test-container\">\n <div class=\"editor-parent\">\n <div class=\"editor-container\"></div>\n <div class=\"editor-tabs\"></div>\n </div>\n </div>\n </div>\n </div>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */#save-button{position:absolute;bottom:10px;left:10px;background:white;border:solid 1px #ccc;border-radius:2px;padding:8px;font-family:Arial,sans-serif;font-weight:700;cursor:default;font-size:14px;color:#444}.dmn-modeler{display:flex;flex-direction:column;width:100%;padding:1rem}.diagram,.diagram-header{border:1px solid #dee2e6}.decision-title{color:#6b6b6b;font-size:1.5rem;margin:0}.fullscreen-toggle{font-size:2rem}.fullscreen-toggle>i{cursor:pointer}\n"], components: [{ type: i6.SelectComponent, selector: "v-select", inputs: ["items", "defaultSelection", "defaultSelectionId", "clearable", "disabled", "multiple", "margin", "widthInPx", "notFoundText", "clearAllText", "name", "title", "titleTranslationKey", "clearSelectionSubject$", "tooltip", "required", "loading", "loadingText", "placeholder"], outputs: ["selectedChange", "clear"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i7.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i7.AsyncPipe, "translate": i4.TranslatePipe } });
|
|
471
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionModelerComponent, decorators: [{
|
|
472
|
+
type: Component,
|
|
473
|
+
args: [{ selector: 'valtimo-decision-modeler', 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\n [ngClass]=\"{'main-content pt-0': !layoutService.isFullscreen}\"\n class=\"mb-5\"\n *ngIf=\"{\n decisionXml: decisionXml$ | async\n } as obs\"\n>\n <div [ngClass]=\"{'container-fluid': !layoutService.isFullscreen}\">\n <ng-container *ngTemplateOutlet=\"buttons\"></ng-container>\n <ng-container *ngTemplateOutlet=\"createButtons\"></ng-container>\n <div [ngClass]=\"{'mt-4': !layoutService.isFullscreen}\" class=\"modeler pl-3 pr-3 mb-3\">\n <ng-container *ngTemplateOutlet=\"diagramHeader\"></ng-container>\n <ng-container *ngTemplateOutlet=\"diagram\"></ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #buttons>\n <div\n class=\"text-right\"\n *ngIf=\"(isCreating$ | async) === false && {selectionId: selectionId$ | async} as obs\"\n >\n <div class=\"btn-group mt-m3px mb-3\" *ngIf=\"obs.selectionId && !layoutService.isFullscreen\">\n <button class=\"btn btn-primary btn-space\" (click)=\"download()\">\n <i class=\"icon mdi mdi-download mr-1\"></i>{{ 'processManagement.download' | translate }}\n </button>\n <button\n class=\"btn btn-success btn-space\"\n (click)=\"deploy()\"\n [ngClass]=\"{'mr-0': obs.selectionId !== null}\"\n >\n <i class=\"icon mdi mdi-upload mr-1\"></i>{{ 'decisions.deploy' | translate }}\n </button>\n </div>\n </div>\n</ng-template>\n\n<ng-template #createButtons>\n <div class=\"text-right\" *ngIf=\"isCreating$ | async\">\n <div class=\"btn-group mt-m3px mb-3\" *ngIf=\"!layoutService.isFullscreen\">\n <button class=\"btn btn-success btn-space\" (click)=\"deploy()\">\n <i class=\"icon mdi mdi-upload mr-1\"></i>{{ 'decisions.deploy' | translate }}\n </button>\n <!-- <button-->\n <!-- *ngIf=\"selectedVersion === null\"-->\n <!-- class=\"btn btn-danger btn-space mr-0\"-->\n <!-- (click)=\"reset()\"-->\n <!-- >-->\n <!-- <i class=\"icon mdi mdi-delete mr-1\"></i>{{ 'processManagement.clear' | translate }}-->\n <!-- </button>-->\n </div>\n </div>\n</ng-template>\n\n<ng-template #diagramHeader>\n <div class=\"row pt-4 pb-3 bg-light diagram-header justify-content-between\">\n <ng-container *ngTemplateOutlet=\"decisionTitle\"></ng-container>\n <ng-container *ngTemplateOutlet=\"versionSelection\"></ng-container>\n <ng-container *ngTemplateOutlet=\"fullScreenToggle\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #decisionTitle>\n <div class=\"col-md-5 d-flex align-items-center\">\n <h2 class=\"decision-title\">\n {{ decisionTitle$ | async }}\n </h2>\n </div>\n</ng-template>\n\n<ng-template #versionSelection>\n <div class=\"col-md-2 d-flex justify-content-center align-items-center\">\n <ng-container\n *ngIf=\"\n (isCreating$ | async) === false && {\n versionSelectItems: decisionVersionSelectItems$ | async,\n defaultSelectionId: selectionId$ | async,\n disabled: versionSelectionDisabled$ | async\n } as obs\n \"\n >\n <v-select\n name=\"version\"\n [title]=\"'decisions.version' | translate\"\n [disabled]=\"obs.disabled\"\n [clearable]=\"false\"\n [loading]=\"!obs.versionSelectItems\"\n [items]=\"obs.versionSelectItems\"\n [defaultSelectionId]=\"obs.defaultSelectionId\"\n [widthInPx]=\"100\"\n (selectedChange)=\"switchVersion($event)\"\n ></v-select>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #fullScreenToggle>\n <div class=\"col-md-2 d-flex fullscreen-toggle align-items-start justify-content-end\">\n <i\n (click)=\"layoutService.toggleFullscreen()\"\n [ngClass]=\"{\n 'mdi-fullscreen': !layoutService.isFullscreen,\n 'mdi-fullscreen-exit': layoutService.isFullscreen\n }\"\n class=\"mdi\"\n ></i>\n </div>\n</ng-template>\n\n<ng-template #diagram>\n <div class=\"row bg-white diagram mb-3\">\n <div class=\"dmn-modeler\">\n <div class=\"test-container\">\n <div class=\"editor-parent\">\n <div class=\"editor-container\"></div>\n <div class=\"editor-tabs\"></div>\n </div>\n </div>\n </div>\n </div>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */#save-button{position:absolute;bottom:10px;left:10px;background:white;border:solid 1px #ccc;border-radius:2px;padding:8px;font-family:Arial,sans-serif;font-weight:700;cursor:default;font-size:14px;color:#444}.dmn-modeler{display:flex;flex-direction:column;width:100%;padding:1rem}.diagram,.diagram-header{border:1px solid #dee2e6}.decision-title{color:#6b6b6b;font-size:1.5rem;margin:0}.fullscreen-toggle{font-size:2rem}.fullscreen-toggle>i{cursor:pointer}\n"] }]
|
|
474
|
+
}], ctorParameters: function () { return [{ type: DecisionService }, { type: i2$1.ActivatedRoute }, { type: i2$1.Router }, { type: i5.AlertService }, { type: i4.TranslateService }, { type: i5$1.LayoutService }]; } });
|
|
475
|
+
|
|
213
476
|
class DecisionDisplayComponent {
|
|
214
|
-
constructor(decisionService, route) {
|
|
477
|
+
constructor(decisionService, route, toasterService) {
|
|
215
478
|
this.decisionService = decisionService;
|
|
216
479
|
this.route = route;
|
|
480
|
+
this.toasterService = toasterService;
|
|
217
481
|
}
|
|
218
482
|
ngOnInit() {
|
|
219
483
|
this.viewer = new DmnViewer({
|
|
@@ -224,10 +488,27 @@ class DecisionDisplayComponent {
|
|
|
224
488
|
}
|
|
225
489
|
loadDecisionXml() {
|
|
226
490
|
this.decisionService.getDecisionXml(this.decisionId).subscribe((decision) => {
|
|
227
|
-
this.viewer.importXML(decision.dmnXml
|
|
491
|
+
this.viewer.importXML(decision.dmnXml, error => {
|
|
492
|
+
if (error) {
|
|
493
|
+
this.migrateAndLoadDecisionXml(decision);
|
|
494
|
+
}
|
|
495
|
+
});
|
|
228
496
|
this.decisionXml = decision.dmnXml;
|
|
229
497
|
});
|
|
230
498
|
}
|
|
499
|
+
migrateAndLoadDecisionXml(decision) {
|
|
500
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
501
|
+
const decisionXml = yield migrateDiagram(decision.dmnXml);
|
|
502
|
+
if (decisionXml) {
|
|
503
|
+
this.viewer.importXML(decisionXml, error => {
|
|
504
|
+
if (error) {
|
|
505
|
+
console.log('error');
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
this.decisionXml = decisionXml;
|
|
509
|
+
}
|
|
510
|
+
});
|
|
511
|
+
}
|
|
231
512
|
download() {
|
|
232
513
|
const file = new Blob([this.decisionXml], { type: 'text/xml' });
|
|
233
514
|
const link = document.createElement('a');
|
|
@@ -238,12 +519,12 @@ class DecisionDisplayComponent {
|
|
|
238
519
|
link.remove();
|
|
239
520
|
}
|
|
240
521
|
}
|
|
241
|
-
DecisionDisplayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionDisplayComponent, deps: [{ token: DecisionService }, { token: i2$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
242
|
-
DecisionDisplayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DecisionDisplayComponent, selector: "valtimo-decision-display", ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content pt-0\">\n <div class=\"container-fluid\">\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> \n <span>{{ 'Download' | translate }}</span>\n </button>\n </div>\n </div>\n <div id=\"canvas\" class=\"canvas-dmn\"></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 */.canvas-dmn{height:70vh}\n"], pipes: { "translate":
|
|
522
|
+
DecisionDisplayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionDisplayComponent, deps: [{ token: DecisionService }, { token: i2$1.ActivatedRoute }, { token: i3.ToastrService }], target: i0.ɵɵFactoryTarget.Component });
|
|
523
|
+
DecisionDisplayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DecisionDisplayComponent, selector: "valtimo-decision-display", ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content pt-0\">\n <div class=\"container-fluid\">\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> \n <span>{{ 'Download' | translate }}</span>\n </button>\n </div>\n </div>\n <div id=\"canvas\" class=\"canvas-dmn\"></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 */.canvas-dmn{height:70vh}\n"], pipes: { "translate": i4.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
|
|
243
524
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionDisplayComponent, decorators: [{
|
|
244
525
|
type: Component,
|
|
245
526
|
args: [{ selector: 'valtimo-decision-display', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content pt-0\">\n <div class=\"container-fluid\">\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> \n <span>{{ 'Download' | translate }}</span>\n </button>\n </div>\n </div>\n <div id=\"canvas\" class=\"canvas-dmn\"></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 */.canvas-dmn{height:70vh}\n"] }]
|
|
246
|
-
}], ctorParameters: function () { return [{ type: DecisionService }, { type: i2$1.ActivatedRoute }]; } });
|
|
527
|
+
}], ctorParameters: function () { return [{ type: DecisionService }, { type: i2$1.ActivatedRoute }, { type: i3.ToastrService }]; } });
|
|
247
528
|
|
|
248
529
|
/*
|
|
249
530
|
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
@@ -273,6 +554,18 @@ const routes = [
|
|
|
273
554
|
canActivate: [AuthGuardService],
|
|
274
555
|
data: { title: 'Decision tables', roles: [ROLE_ADMIN] },
|
|
275
556
|
},
|
|
557
|
+
{
|
|
558
|
+
path: 'decision-tables/edit/:id',
|
|
559
|
+
component: DecisionModelerComponent,
|
|
560
|
+
canActivate: [AuthGuardService],
|
|
561
|
+
data: { title: 'Edit decision table', roles: [ROLE_ADMIN] },
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
path: 'decision-tables/edit/create',
|
|
565
|
+
component: DecisionModelerComponent,
|
|
566
|
+
canActivate: [AuthGuardService],
|
|
567
|
+
data: { title: 'Create decision table', roles: [ROLE_ADMIN] },
|
|
568
|
+
},
|
|
276
569
|
];
|
|
277
570
|
class DecisionRoutingModule {
|
|
278
571
|
}
|
|
@@ -309,13 +602,16 @@ DecisionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version:
|
|
|
309
602
|
DecisionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionModule, declarations: [DecisionComponent,
|
|
310
603
|
DecisionDeployComponent,
|
|
311
604
|
DecisionDisplayComponent,
|
|
312
|
-
DecisionListComponent
|
|
605
|
+
DecisionListComponent,
|
|
606
|
+
DecisionModelerComponent], imports: [DecisionRoutingModule,
|
|
313
607
|
WidgetModule,
|
|
314
608
|
ListModule,
|
|
315
609
|
TranslateModule,
|
|
316
610
|
ModalModule,
|
|
317
611
|
CommonModule,
|
|
318
|
-
FormsModule
|
|
612
|
+
FormsModule,
|
|
613
|
+
SelectModule,
|
|
614
|
+
SpinnerModule], exports: [DecisionComponent, DecisionModelerComponent] });
|
|
319
615
|
DecisionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionModule, imports: [[
|
|
320
616
|
DecisionRoutingModule,
|
|
321
617
|
WidgetModule,
|
|
@@ -324,6 +620,8 @@ DecisionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version:
|
|
|
324
620
|
ModalModule,
|
|
325
621
|
CommonModule,
|
|
326
622
|
FormsModule,
|
|
623
|
+
SelectModule,
|
|
624
|
+
SpinnerModule,
|
|
327
625
|
]] });
|
|
328
626
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionModule, decorators: [{
|
|
329
627
|
type: NgModule,
|
|
@@ -333,6 +631,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
333
631
|
DecisionDeployComponent,
|
|
334
632
|
DecisionDisplayComponent,
|
|
335
633
|
DecisionListComponent,
|
|
634
|
+
DecisionModelerComponent,
|
|
336
635
|
],
|
|
337
636
|
imports: [
|
|
338
637
|
DecisionRoutingModule,
|
|
@@ -342,8 +641,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
342
641
|
ModalModule,
|
|
343
642
|
CommonModule,
|
|
344
643
|
FormsModule,
|
|
644
|
+
SelectModule,
|
|
645
|
+
SpinnerModule,
|
|
345
646
|
],
|
|
346
|
-
exports: [DecisionComponent],
|
|
647
|
+
exports: [DecisionComponent, DecisionModelerComponent],
|
|
347
648
|
}]
|
|
348
649
|
}] });
|
|
349
650
|
|
|
@@ -367,5 +668,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
367
668
|
* Generated bundle index. Do not edit.
|
|
368
669
|
*/
|
|
369
670
|
|
|
370
|
-
export { DecisionComponent, DecisionModule };
|
|
671
|
+
export { DecisionComponent, DecisionModelerComponent, DecisionModule };
|
|
371
672
|
//# sourceMappingURL=valtimo-decision.mjs.map
|