@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,24 @@ 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 DmnJS from 'dmn-js/dist/dmn-modeler.development.js';
|
|
17
|
+
import { migrateDiagram } from '@bpmn-io/dmn-migrate';
|
|
18
|
+
import * as i5$1 from '@valtimo/layout';
|
|
19
|
+
import * as i6 from '@valtimo/user-interface';
|
|
20
|
+
import { SelectModule } from '@valtimo/user-interface';
|
|
14
21
|
import DmnViewer from 'dmn-js';
|
|
22
|
+
import * as i3 from 'ngx-toastr';
|
|
15
23
|
import { FormsModule } from '@angular/forms';
|
|
16
24
|
|
|
17
25
|
/*
|
|
@@ -77,6 +85,12 @@ class DecisionService {
|
|
|
77
85
|
getDecisions() {
|
|
78
86
|
return this.http.get(`${this.valtimoApiConfig.endpointUri}camunda-rest/engine/default/decision-definition`);
|
|
79
87
|
}
|
|
88
|
+
getDecisionById(decisionId) {
|
|
89
|
+
return this.http.get(`${this.valtimoApiConfig.endpointUri}camunda-rest/engine/default/decision-definition/${decisionId}`);
|
|
90
|
+
}
|
|
91
|
+
getLatestDecisionByKey(decisionKey) {
|
|
92
|
+
return this.http.get(`${this.valtimoApiConfig.endpointUri}camunda-rest/engine/default/decision-definition/key/${decisionKey}`);
|
|
93
|
+
}
|
|
80
94
|
getDecisionXml(decisionId) {
|
|
81
95
|
return this.http.get(`${this.valtimoApiConfig.endpointUri}camunda-rest/engine/default/decision-definition/${decisionId}/xml`);
|
|
82
96
|
}
|
|
@@ -90,6 +104,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
90
104
|
}]
|
|
91
105
|
}], ctorParameters: function () { return [{ type: i1.ConfigService }, { type: i2.HttpClient }]; } });
|
|
92
106
|
|
|
107
|
+
class DecisionStateService {
|
|
108
|
+
constructor() {
|
|
109
|
+
this._refreshDecisions$ = new Subject();
|
|
110
|
+
}
|
|
111
|
+
get refreshDecisions$() {
|
|
112
|
+
return this._refreshDecisions$.asObservable().pipe(startWith(null));
|
|
113
|
+
}
|
|
114
|
+
refreshDecisions() {
|
|
115
|
+
this._refreshDecisions$.next(null);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
DecisionStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
119
|
+
DecisionStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionStateService, providedIn: 'root' });
|
|
120
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionStateService, decorators: [{
|
|
121
|
+
type: Injectable,
|
|
122
|
+
args: [{
|
|
123
|
+
providedIn: 'root',
|
|
124
|
+
}]
|
|
125
|
+
}] });
|
|
126
|
+
|
|
93
127
|
/*
|
|
94
128
|
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
95
129
|
*
|
|
@@ -106,33 +140,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
106
140
|
* limitations under the License.
|
|
107
141
|
*/
|
|
108
142
|
class DecisionListComponent {
|
|
109
|
-
constructor(decisionService, router) {
|
|
143
|
+
constructor(decisionService, router, configService, stateService) {
|
|
110
144
|
this.decisionService = decisionService;
|
|
111
145
|
this.router = router;
|
|
146
|
+
this.configService = configService;
|
|
147
|
+
this.stateService = stateService;
|
|
112
148
|
this.fields = [
|
|
113
149
|
{ key: 'key', label: 'Key' },
|
|
114
150
|
{ key: 'name', label: 'Name' },
|
|
115
151
|
{ key: 'version', label: 'Version' },
|
|
116
152
|
];
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
153
|
+
this.loading$ = new BehaviorSubject(true);
|
|
154
|
+
this.decisionsLatestVersions$ = this.stateService.refreshDecisions$.pipe(switchMap(() => this.decisionService.getDecisions()), map(decisions => decisions.reduce((acc, curr) => {
|
|
155
|
+
const findInAcc = acc.find(decision => decision.key === curr.key);
|
|
156
|
+
if (findInAcc && findInAcc.version > curr.version) {
|
|
157
|
+
return acc;
|
|
158
|
+
}
|
|
159
|
+
else if (findInAcc && findInAcc.version < curr.version) {
|
|
160
|
+
const newAcc = acc.filter(decision => decision.key !== curr.key);
|
|
161
|
+
return [...newAcc, curr];
|
|
162
|
+
}
|
|
163
|
+
return [...acc, curr];
|
|
164
|
+
}, [])), tap(() => this.loading$.next(false)));
|
|
165
|
+
this.experimentalEditing = this.configService.config.featureToggles.experimentalDmnEditing;
|
|
125
166
|
}
|
|
126
167
|
viewDecisionTable(decision) {
|
|
127
|
-
this.
|
|
168
|
+
if (this.experimentalEditing) {
|
|
169
|
+
this.router.navigate(['/decision-tables/edit', decision.id]);
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
this.router.navigate(['/decision-tables', decision.id]);
|
|
173
|
+
}
|
|
128
174
|
}
|
|
129
175
|
}
|
|
130
|
-
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 });
|
|
131
|
-
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
|
|
176
|
+
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 });
|
|
177
|
+
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 } });
|
|
132
178
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionListComponent, decorators: [{
|
|
133
179
|
type: Component,
|
|
134
|
-
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
|
|
135
|
-
}], ctorParameters: function () { return [{ type: DecisionService }, { type: i2$1.Router }]; } });
|
|
180
|
+
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"] }]
|
|
181
|
+
}], ctorParameters: function () { return [{ type: DecisionService }, { type: i2$1.Router }, { type: i1.ConfigService }, { type: DecisionStateService }]; } });
|
|
136
182
|
|
|
137
183
|
/*
|
|
138
184
|
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
@@ -150,8 +196,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
150
196
|
* limitations under the License.
|
|
151
197
|
*/
|
|
152
198
|
class DecisionDeployComponent {
|
|
153
|
-
constructor(decisionService) {
|
|
199
|
+
constructor(decisionService, stateService) {
|
|
154
200
|
this.decisionService = decisionService;
|
|
201
|
+
this.stateService = stateService;
|
|
155
202
|
this.dmn = null;
|
|
156
203
|
this.deploySuccessful = new EventEmitter();
|
|
157
204
|
}
|
|
@@ -163,18 +210,19 @@ class DecisionDeployComponent {
|
|
|
163
210
|
this.decisionService.deployDmn(this.dmn).subscribe(() => {
|
|
164
211
|
this.modal.hide();
|
|
165
212
|
this.deploySuccessful.emit();
|
|
213
|
+
this.stateService.refreshDecisions();
|
|
166
214
|
});
|
|
167
215
|
}
|
|
168
216
|
openModal() {
|
|
169
217
|
this.modal.show();
|
|
170
218
|
}
|
|
171
219
|
}
|
|
172
|
-
DecisionDeployComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionDeployComponent, deps: [{ token: DecisionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
173
|
-
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:
|
|
220
|
+
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 });
|
|
221
|
+
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 } });
|
|
174
222
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionDeployComponent, decorators: [{
|
|
175
223
|
type: Component,
|
|
176
224
|
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"] }]
|
|
177
|
-
}], ctorParameters: function () { return [{ type: DecisionService }]; }, propDecorators: { deploySuccessful: [{
|
|
225
|
+
}], ctorParameters: function () { return [{ type: DecisionService }, { type: DecisionStateService }]; }, propDecorators: { deploySuccessful: [{
|
|
178
226
|
type: Output
|
|
179
227
|
}], modal: [{
|
|
180
228
|
type: ViewChild,
|
|
@@ -197,13 +245,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
197
245
|
* limitations under the License.
|
|
198
246
|
*/
|
|
199
247
|
class DecisionComponent {
|
|
248
|
+
constructor(configService) {
|
|
249
|
+
this.configService = configService;
|
|
250
|
+
this.experimentalEditing = this.configService.config.featureToggles.experimentalDmnEditing;
|
|
251
|
+
}
|
|
200
252
|
}
|
|
201
|
-
DecisionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
202
|
-
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
|
|
253
|
+
DecisionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionComponent, deps: [{ token: i1.ConfigService }], target: i0.ɵɵFactoryTarget.Component });
|
|
254
|
+
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 } });
|
|
203
255
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionComponent, decorators: [{
|
|
204
256
|
type: Component,
|
|
205
|
-
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
|
|
206
|
-
}], propDecorators: { deploy: [{
|
|
257
|
+
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"] }]
|
|
258
|
+
}], ctorParameters: function () { return [{ type: i1.ConfigService }]; }, propDecorators: { deploy: [{
|
|
207
259
|
type: ViewChild,
|
|
208
260
|
args: ['decisionDeploy']
|
|
209
261
|
}], list: [{
|
|
@@ -211,6 +263,229 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
211
263
|
args: ['decisionList']
|
|
212
264
|
}] } });
|
|
213
265
|
|
|
266
|
+
const EMPTY_DECISION = {
|
|
267
|
+
id: '',
|
|
268
|
+
dmnXml: `<?xml version="1.0" encoding="UTF-8"?>
|
|
269
|
+
<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">
|
|
270
|
+
<decision id="Decision_1e18q76" name="Decision 1">
|
|
271
|
+
<decisionTable id="DecisionTable_1apu23m">
|
|
272
|
+
<input id="Input_1">
|
|
273
|
+
<inputExpression id="InputExpression_1" typeRef="string">
|
|
274
|
+
<text></text>
|
|
275
|
+
</inputExpression>
|
|
276
|
+
</input>
|
|
277
|
+
<output id="Output_1" typeRef="string" />
|
|
278
|
+
</decisionTable>
|
|
279
|
+
</decision>
|
|
280
|
+
<dmndi:DMNDI>
|
|
281
|
+
<dmndi:DMNDiagram>
|
|
282
|
+
<dmndi:DMNShape dmnElementRef="Decision_1e18q76">
|
|
283
|
+
<dc:Bounds height="80" width="180" x="160" y="100" />
|
|
284
|
+
</dmndi:DMNShape>
|
|
285
|
+
</dmndi:DMNDiagram>
|
|
286
|
+
</dmndi:DMNDI>
|
|
287
|
+
</definitions>
|
|
288
|
+
`,
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
class DecisionModelerComponent {
|
|
292
|
+
constructor(decisionService, route, router, alertService, translateService, layoutService) {
|
|
293
|
+
this.decisionService = decisionService;
|
|
294
|
+
this.route = route;
|
|
295
|
+
this.router = router;
|
|
296
|
+
this.alertService = alertService;
|
|
297
|
+
this.translateService = translateService;
|
|
298
|
+
this.layoutService = layoutService;
|
|
299
|
+
this.CLASS_NAMES = {
|
|
300
|
+
drd: 'dmn-icon-lasso-tool',
|
|
301
|
+
decisionTable: 'dmn-icon-decision-table',
|
|
302
|
+
literalExpression: 'dmn-icon-literal-expression',
|
|
303
|
+
};
|
|
304
|
+
this.versionSelectionDisabled$ = new BehaviorSubject(true);
|
|
305
|
+
this.isCreating$ = new BehaviorSubject(false);
|
|
306
|
+
this.decisionId$ = this.route.params.pipe(map(params => params?.id), tap(decisionId => this.isCreating$.next(decisionId === 'create')), filter(decisionId => !!decisionId && decisionId !== 'create'), tap(() => this.versionSelectionDisabled$.next(true)));
|
|
307
|
+
this.selectionId$ = new BehaviorSubject('');
|
|
308
|
+
this.decision$ = this.decisionId$.pipe(switchMap(decisionId => this.decisionService.getDecisionById(decisionId)), tap(decision => {
|
|
309
|
+
if (decision) {
|
|
310
|
+
this.selectionId$.next(decision.id);
|
|
311
|
+
}
|
|
312
|
+
}));
|
|
313
|
+
this.decisionTitle$ = this.decision$.pipe(map(decision => decision?.key || ''));
|
|
314
|
+
this.createdDecisionVersionSelectItems$ = new BehaviorSubject([]);
|
|
315
|
+
this.decisionVersionSelectItems$ = combineLatest([
|
|
316
|
+
this.decision$,
|
|
317
|
+
this.decisionService.getDecisions(),
|
|
318
|
+
this.createdDecisionVersionSelectItems$,
|
|
319
|
+
]).pipe(map(([currentDecision, decisions, createdDecisionVersionSelectItems]) => {
|
|
320
|
+
const decisionsWithKey = decisions.filter(decision => decision.key === currentDecision.key);
|
|
321
|
+
return [
|
|
322
|
+
...decisionsWithKey.map(decision => ({
|
|
323
|
+
id: decision.id,
|
|
324
|
+
text: decision.version.toString(),
|
|
325
|
+
})),
|
|
326
|
+
...createdDecisionVersionSelectItems,
|
|
327
|
+
].sort((a, b) => Number(b.text) - Number(a.text));
|
|
328
|
+
}), tap(() => this.versionSelectionDisabled$.next(false)));
|
|
329
|
+
this.decisionXml$ = this.decisionId$.pipe(switchMap(decisionId => this.decisionService.getDecisionXml(decisionId)), tap(decisionXml => {
|
|
330
|
+
if (decisionXml) {
|
|
331
|
+
this.loadDecisionXml(decisionXml);
|
|
332
|
+
}
|
|
333
|
+
}));
|
|
334
|
+
this.setTabEvents = () => {
|
|
335
|
+
const $tabs = this.$tabs;
|
|
336
|
+
const dmnModeler = this.dmnModeler;
|
|
337
|
+
$tabs.delegate('.tab', 'click', async function (e) {
|
|
338
|
+
// get index of view from clicked tab
|
|
339
|
+
const viewIdx = parseInt(this.getAttribute('data-id'), 10);
|
|
340
|
+
// get view using index
|
|
341
|
+
const view = dmnModeler.getViews()[viewIdx];
|
|
342
|
+
// open view
|
|
343
|
+
try {
|
|
344
|
+
await dmnModeler.open(view);
|
|
345
|
+
}
|
|
346
|
+
catch (err) {
|
|
347
|
+
console.error('error opening tab', err);
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
};
|
|
351
|
+
this.setModelerEvents = () => {
|
|
352
|
+
const $tabs = this.$tabs;
|
|
353
|
+
const CLASS_NAMES = this.CLASS_NAMES;
|
|
354
|
+
this.dmnModeler.on('views.changed', function (event) {
|
|
355
|
+
// get views from event
|
|
356
|
+
const { views, activeView } = event;
|
|
357
|
+
// clear tabs
|
|
358
|
+
$tabs.empty();
|
|
359
|
+
// create a new tab for each view
|
|
360
|
+
views.forEach(function (v, idx) {
|
|
361
|
+
const className = CLASS_NAMES[v.type];
|
|
362
|
+
const tab = $(`
|
|
363
|
+
<div class="tab ${v === activeView ? 'active' : ''}" data-id="${idx}">
|
|
364
|
+
<span class="${className}"></span>
|
|
365
|
+
${v.element.name || v.element.id}
|
|
366
|
+
</div>
|
|
367
|
+
`);
|
|
368
|
+
$tabs.append(tab);
|
|
369
|
+
});
|
|
370
|
+
});
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
ngAfterViewInit() {
|
|
374
|
+
this.setProperties();
|
|
375
|
+
this.setTabEvents();
|
|
376
|
+
this.setModelerEvents();
|
|
377
|
+
}
|
|
378
|
+
switchVersion(decisionId) {
|
|
379
|
+
if (decisionId) {
|
|
380
|
+
this.router.navigate(['/decision-tables/edit', decisionId]);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
deploy() {
|
|
384
|
+
from(this.dmnModeler.saveXML({ format: true }))
|
|
385
|
+
.pipe(map(result => result.xml), map(xml => new File([xml], 'decision.dmn', {
|
|
386
|
+
type: 'text/xml',
|
|
387
|
+
})), switchMap(file => this.decisionService.deployDmn(file)), tap(res => {
|
|
388
|
+
const deployedDefinitions = res.deployedDecisionDefinitions;
|
|
389
|
+
const deployedDecisionDefinition = deployedDefinitions[Object.keys(deployedDefinitions)[0]];
|
|
390
|
+
const deployedId = deployedDecisionDefinition.id;
|
|
391
|
+
this.createdDecisionVersionSelectItems$
|
|
392
|
+
.pipe(take(1))
|
|
393
|
+
.subscribe(createdDecisionVersionSelectItems => {
|
|
394
|
+
if (deployedDecisionDefinition) {
|
|
395
|
+
this.createdDecisionVersionSelectItems$.next([
|
|
396
|
+
...createdDecisionVersionSelectItems,
|
|
397
|
+
{
|
|
398
|
+
id: deployedId,
|
|
399
|
+
text: deployedDecisionDefinition.version.toString(),
|
|
400
|
+
},
|
|
401
|
+
]);
|
|
402
|
+
}
|
|
403
|
+
if (deployedId) {
|
|
404
|
+
setTimeout(() => {
|
|
405
|
+
this.switchVersion(deployedId);
|
|
406
|
+
this.alertService.success(this.translateService.instant('decisions.deploySuccess'));
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
}), catchError(() => {
|
|
411
|
+
this.alertService.error(this.translateService.instant('decisions.deployFailure'));
|
|
412
|
+
return of(null);
|
|
413
|
+
}))
|
|
414
|
+
.subscribe();
|
|
415
|
+
}
|
|
416
|
+
download() {
|
|
417
|
+
from(this.dmnModeler.saveXML({ format: true }))
|
|
418
|
+
.pipe(map(result => result.xml), map(xml => new File([xml], 'decision.dmn', {
|
|
419
|
+
type: 'text/xml',
|
|
420
|
+
})), tap(file => {
|
|
421
|
+
const link = document.createElement('a');
|
|
422
|
+
link.download = 'diagram.dmn';
|
|
423
|
+
link.href = window.URL.createObjectURL(file);
|
|
424
|
+
link.click();
|
|
425
|
+
window.URL.revokeObjectURL(link.href);
|
|
426
|
+
link.remove();
|
|
427
|
+
}))
|
|
428
|
+
.subscribe();
|
|
429
|
+
}
|
|
430
|
+
setProperties() {
|
|
431
|
+
const isCreating = this.isCreating$.getValue();
|
|
432
|
+
this.$container = $('.editor-container');
|
|
433
|
+
this.$tabs = $('.editor-tabs');
|
|
434
|
+
this.dmnModeler = new DmnJS({
|
|
435
|
+
container: this.$container,
|
|
436
|
+
height: 500,
|
|
437
|
+
width: '100%',
|
|
438
|
+
keyboard: {
|
|
439
|
+
bindTo: window,
|
|
440
|
+
},
|
|
441
|
+
});
|
|
442
|
+
if (isCreating) {
|
|
443
|
+
this.loadEmptyDecisionTable();
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
loadEmptyDecisionTable() {
|
|
447
|
+
this.loadDecisionXml(EMPTY_DECISION);
|
|
448
|
+
}
|
|
449
|
+
loadDecisionXml(decision) {
|
|
450
|
+
from(this.dmnModeler.importXML(decision.dmnXml))
|
|
451
|
+
.pipe(tap(() => {
|
|
452
|
+
this.setEditor();
|
|
453
|
+
}), catchError(() => {
|
|
454
|
+
this.migrateAndLoadDecisionXml(decision);
|
|
455
|
+
return of(null);
|
|
456
|
+
}))
|
|
457
|
+
.subscribe();
|
|
458
|
+
}
|
|
459
|
+
migrateAndLoadDecisionXml(decision) {
|
|
460
|
+
from(migrateDiagram(decision.dmnXml))
|
|
461
|
+
.pipe(switchMap(decisionXml => this.dmnModeler.importXML(decisionXml)), tap(() => {
|
|
462
|
+
this.setEditor();
|
|
463
|
+
}), catchError(() => {
|
|
464
|
+
this.alertService.error(this.translateService.instant('decisions.loadFailure'));
|
|
465
|
+
return of(null);
|
|
466
|
+
}))
|
|
467
|
+
.subscribe();
|
|
468
|
+
}
|
|
469
|
+
setEditor() {
|
|
470
|
+
const dmnModeler = this.dmnModeler;
|
|
471
|
+
const activeView = dmnModeler.getActiveView();
|
|
472
|
+
// apply initial logic in DRD view
|
|
473
|
+
if (activeView.type === 'drd') {
|
|
474
|
+
const activeEditor = dmnModeler.getActiveViewer();
|
|
475
|
+
// access active editor components
|
|
476
|
+
const canvas = activeEditor.get('canvas');
|
|
477
|
+
// zoom to fit full viewport
|
|
478
|
+
canvas.zoom('fit-viewport');
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
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 });
|
|
483
|
+
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 } });
|
|
484
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionModelerComponent, decorators: [{
|
|
485
|
+
type: Component,
|
|
486
|
+
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"] }]
|
|
487
|
+
}], ctorParameters: function () { return [{ type: DecisionService }, { type: i2$1.ActivatedRoute }, { type: i2$1.Router }, { type: i5.AlertService }, { type: i4.TranslateService }, { type: i5$1.LayoutService }]; } });
|
|
488
|
+
|
|
214
489
|
/*
|
|
215
490
|
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
216
491
|
*
|
|
@@ -227,9 +502,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
227
502
|
* limitations under the License.
|
|
228
503
|
*/
|
|
229
504
|
class DecisionDisplayComponent {
|
|
230
|
-
constructor(decisionService, route) {
|
|
505
|
+
constructor(decisionService, route, toasterService) {
|
|
231
506
|
this.decisionService = decisionService;
|
|
232
507
|
this.route = route;
|
|
508
|
+
this.toasterService = toasterService;
|
|
233
509
|
}
|
|
234
510
|
ngOnInit() {
|
|
235
511
|
this.viewer = new DmnViewer({
|
|
@@ -240,10 +516,25 @@ class DecisionDisplayComponent {
|
|
|
240
516
|
}
|
|
241
517
|
loadDecisionXml() {
|
|
242
518
|
this.decisionService.getDecisionXml(this.decisionId).subscribe((decision) => {
|
|
243
|
-
this.viewer.importXML(decision.dmnXml
|
|
519
|
+
this.viewer.importXML(decision.dmnXml, error => {
|
|
520
|
+
if (error) {
|
|
521
|
+
this.migrateAndLoadDecisionXml(decision);
|
|
522
|
+
}
|
|
523
|
+
});
|
|
244
524
|
this.decisionXml = decision.dmnXml;
|
|
245
525
|
});
|
|
246
526
|
}
|
|
527
|
+
async migrateAndLoadDecisionXml(decision) {
|
|
528
|
+
const decisionXml = await migrateDiagram(decision.dmnXml);
|
|
529
|
+
if (decisionXml) {
|
|
530
|
+
this.viewer.importXML(decisionXml, error => {
|
|
531
|
+
if (error) {
|
|
532
|
+
console.log('error');
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
this.decisionXml = decisionXml;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
247
538
|
download() {
|
|
248
539
|
const file = new Blob([this.decisionXml], { type: 'text/xml' });
|
|
249
540
|
const link = document.createElement('a');
|
|
@@ -254,12 +545,12 @@ class DecisionDisplayComponent {
|
|
|
254
545
|
link.remove();
|
|
255
546
|
}
|
|
256
547
|
}
|
|
257
|
-
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 });
|
|
258
|
-
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":
|
|
548
|
+
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 });
|
|
549
|
+
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 });
|
|
259
550
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionDisplayComponent, decorators: [{
|
|
260
551
|
type: Component,
|
|
261
552
|
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"] }]
|
|
262
|
-
}], ctorParameters: function () { return [{ type: DecisionService }, { type: i2$1.ActivatedRoute }]; } });
|
|
553
|
+
}], ctorParameters: function () { return [{ type: DecisionService }, { type: i2$1.ActivatedRoute }, { type: i3.ToastrService }]; } });
|
|
263
554
|
|
|
264
555
|
/*
|
|
265
556
|
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
@@ -289,6 +580,18 @@ const routes = [
|
|
|
289
580
|
canActivate: [AuthGuardService],
|
|
290
581
|
data: { title: 'Decision tables', roles: [ROLE_ADMIN] },
|
|
291
582
|
},
|
|
583
|
+
{
|
|
584
|
+
path: 'decision-tables/edit/:id',
|
|
585
|
+
component: DecisionModelerComponent,
|
|
586
|
+
canActivate: [AuthGuardService],
|
|
587
|
+
data: { title: 'Edit decision table', roles: [ROLE_ADMIN] },
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
path: 'decision-tables/edit/create',
|
|
591
|
+
component: DecisionModelerComponent,
|
|
592
|
+
canActivate: [AuthGuardService],
|
|
593
|
+
data: { title: 'Create decision table', roles: [ROLE_ADMIN] },
|
|
594
|
+
},
|
|
292
595
|
];
|
|
293
596
|
class DecisionRoutingModule {
|
|
294
597
|
}
|
|
@@ -325,13 +628,16 @@ DecisionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version:
|
|
|
325
628
|
DecisionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionModule, declarations: [DecisionComponent,
|
|
326
629
|
DecisionDeployComponent,
|
|
327
630
|
DecisionDisplayComponent,
|
|
328
|
-
DecisionListComponent
|
|
631
|
+
DecisionListComponent,
|
|
632
|
+
DecisionModelerComponent], imports: [DecisionRoutingModule,
|
|
329
633
|
WidgetModule,
|
|
330
634
|
ListModule,
|
|
331
635
|
TranslateModule,
|
|
332
636
|
ModalModule,
|
|
333
637
|
CommonModule,
|
|
334
|
-
FormsModule
|
|
638
|
+
FormsModule,
|
|
639
|
+
SelectModule,
|
|
640
|
+
SpinnerModule], exports: [DecisionComponent, DecisionModelerComponent] });
|
|
335
641
|
DecisionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionModule, imports: [[
|
|
336
642
|
DecisionRoutingModule,
|
|
337
643
|
WidgetModule,
|
|
@@ -340,6 +646,8 @@ DecisionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version:
|
|
|
340
646
|
ModalModule,
|
|
341
647
|
CommonModule,
|
|
342
648
|
FormsModule,
|
|
649
|
+
SelectModule,
|
|
650
|
+
SpinnerModule,
|
|
343
651
|
]] });
|
|
344
652
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DecisionModule, decorators: [{
|
|
345
653
|
type: NgModule,
|
|
@@ -349,6 +657,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
349
657
|
DecisionDeployComponent,
|
|
350
658
|
DecisionDisplayComponent,
|
|
351
659
|
DecisionListComponent,
|
|
660
|
+
DecisionModelerComponent,
|
|
352
661
|
],
|
|
353
662
|
imports: [
|
|
354
663
|
DecisionRoutingModule,
|
|
@@ -358,8 +667,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
358
667
|
ModalModule,
|
|
359
668
|
CommonModule,
|
|
360
669
|
FormsModule,
|
|
670
|
+
SelectModule,
|
|
671
|
+
SpinnerModule,
|
|
361
672
|
],
|
|
362
|
-
exports: [DecisionComponent],
|
|
673
|
+
exports: [DecisionComponent, DecisionModelerComponent],
|
|
363
674
|
}]
|
|
364
675
|
}] });
|
|
365
676
|
|
|
@@ -383,5 +694,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
383
694
|
* Generated bundle index. Do not edit.
|
|
384
695
|
*/
|
|
385
696
|
|
|
386
|
-
export { DecisionComponent, DecisionModule };
|
|
697
|
+
export { DecisionComponent, DecisionModelerComponent, DecisionModule };
|
|
387
698
|
//# sourceMappingURL=valtimo-decision.mjs.map
|