@gravitee/ui-policy-studio-angular 7.6.0 → 7.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- package/esm2020/lib/components/flow-details/gio-ps-flow-details.component.mjs +14 -7
- package/esm2020/lib/components/flow-details-info-bar/gio-ps-flow-details-info-bar.component.mjs +91 -0
- package/esm2020/lib/components/flow-details-phase/gio-ps-flow-details-phase.component.mjs +44 -0
- package/esm2020/lib/components/flow-details-phase-policy/gio-ps-flow-details-phase-policy.component.mjs +31 -0
- package/esm2020/lib/components/flow-form-dialog/flow-message-form-dialog/gio-ps-flow-message-form-dialog.component.mjs +3 -3
- package/esm2020/lib/components/flows-menu/gio-ps-flows-menu.component.mjs +9 -6
- package/esm2020/lib/gio-policy-studio.component.mjs +43 -28
- package/esm2020/lib/gio-policy-studio.model.mjs +1 -1
- package/esm2020/lib/gio-policy-studio.module.mjs +20 -4
- package/esm2020/lib/models/SaveOutput.mjs +2 -0
- package/esm2020/lib/models/index.mjs +2 -1
- package/esm2020/lib/models/plan/Plan.mjs +1 -1
- package/esm2020/testing/lib/components/flow-details/gio-ps-flow-details.harness.mjs +41 -0
- package/esm2020/testing/lib/components/flow-details-info-bar/gio-ps-flow-details-info-bar.harness.mjs +35 -0
- package/esm2020/testing/lib/components/flow-form-dialog/flow-message-form-dialog/gio-ps-flow-message-form-dialog.harness.mjs +87 -0
- package/esm2020/testing/lib/components/flow-form-dialog/flow-proxy-form-dialog/gio-ps-flow-proxy-form-dialog.harness.mjs +69 -0
- package/esm2020/testing/lib/components/flows-menu/gio-ps-flows-menu.harness.mjs +66 -0
- package/esm2020/testing/lib/gio-policy-studio.harness.mjs +105 -0
- package/esm2020/testing/lib/models/ConnectorsInfo.mjs +2 -0
- package/esm2020/testing/lib/models/SaveOutput.mjs +2 -0
- package/esm2020/testing/lib/models/flow/Flow.fixture.mjs +2 -2
- package/esm2020/testing/{testing → lib/models}/index.mjs +5 -3
- package/esm2020/testing/lib/models/plan/Plan.fixture.mjs +2 -1
- package/esm2020/testing/lib/models/plan/Plan.mjs +1 -1
- package/esm2020/testing/lib/models/plan/index.mjs +17 -0
- package/esm2020/testing/public-testing-api.mjs +2 -2
- package/fesm2015/gravitee-ui-policy-studio-angular-testing.mjs +329 -1312
- package/fesm2015/gravitee-ui-policy-studio-angular-testing.mjs.map +1 -1
- package/fesm2015/gravitee-ui-policy-studio-angular.mjs +240 -43
- package/fesm2015/gravitee-ui-policy-studio-angular.mjs.map +1 -1
- package/fesm2020/gravitee-ui-policy-studio-angular-testing.mjs +320 -1317
- package/fesm2020/gravitee-ui-policy-studio-angular-testing.mjs.map +1 -1
- package/fesm2020/gravitee-ui-policy-studio-angular.mjs +233 -43
- package/fesm2020/gravitee-ui-policy-studio-angular.mjs.map +1 -1
- package/lib/components/flow-details/gio-ps-flow-details.component.d.ts +4 -3
- package/lib/components/flow-details-info-bar/gio-ps-flow-details-info-bar.component.d.ts +16 -0
- package/lib/components/flow-details-phase/gio-ps-flow-details-phase.component.d.ts +11 -0
- package/lib/components/flow-details-phase-policy/gio-ps-flow-details-phase-policy.component.d.ts +7 -0
- package/lib/components/flows-menu/gio-ps-flows-menu.component.d.ts +1 -1
- package/lib/gio-policy-studio.component.d.ts +5 -8
- package/lib/gio-policy-studio.model.d.ts +1 -0
- package/lib/gio-policy-studio.module.d.ts +14 -10
- package/lib/models/SaveOutput.d.ts +6 -0
- package/lib/models/index.d.ts +1 -0
- package/lib/models/plan/Plan.d.ts +1 -0
- package/package.json +1 -1
- package/testing/lib/components/flow-details/gio-ps-flow-details.harness.d.ts +9 -0
- package/testing/lib/components/flow-details-info-bar/gio-ps-flow-details-info-bar.harness.d.ts +5 -0
- package/testing/lib/components/flow-form-dialog/flow-message-form-dialog/gio-ps-flow-message-form-dialog.harness.d.ts +16 -0
- package/testing/lib/components/flow-form-dialog/flow-proxy-form-dialog/gio-ps-flow-proxy-form-dialog.harness.d.ts +15 -0
- package/testing/lib/components/flows-menu/gio-ps-flows-menu.harness.d.ts +25 -0
- package/testing/lib/gio-policy-studio.harness.d.ts +34 -0
- package/testing/lib/models/ConnectorsInfo.d.ts +4 -0
- package/testing/lib/models/SaveOutput.d.ts +6 -0
- package/testing/lib/models/index.d.ts +4 -0
- package/testing/lib/models/plan/Plan.d.ts +1 -0
- package/testing/lib/models/plan/index.d.ts +1 -0
- package/testing/public-testing-api.d.ts +1 -1
- package/esm2020/testing/testing/harnesses/div.harness.mjs +0 -42
- package/esm2020/testing/testing/harnesses/index.mjs +0 -17
- package/esm2020/testing/testing/stories-resources/apim-definition.json +0 -405
- package/esm2020/testing/testing/stories-resources/apim-flow.json +0 -54
- package/esm2020/testing/testing/stories-resources/apim-policies.json +0 -486
- package/esm2020/testing/testing/stories-resources/apim-property-providers.json +0 -39
- package/esm2020/testing/testing/stories-resources/apim-resource-types.json +0 -187
- package/esm2020/testing/testing/stories-resources/index.mjs +0 -26
- package/testing/testing/harnesses/div.harness.d.ts +0 -20
- package/testing/testing/harnesses/index.d.ts +0 -1
- package/testing/testing/index.d.ts +0 -2
- package/testing/testing/stories-resources/index.d.ts +0 -592
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Inject,
|
|
2
|
+
import { Component, Inject, Input, EventEmitter, Output, NgModule } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/material/button';
|
|
4
4
|
import { MatButtonModule } from '@angular/material/button';
|
|
5
5
|
import * as i7 from '@gravitee/ui-particles-angular';
|
|
6
|
-
import { GioIconsModule, GioFormTagsInputModule } from '@gravitee/ui-particles-angular';
|
|
6
|
+
import { GioIconsModule, GioFormTagsInputModule, GioBannerModule } from '@gravitee/ui-particles-angular';
|
|
7
7
|
import * as i5$1 from '@angular/common';
|
|
8
8
|
import { CommonModule } from '@angular/common';
|
|
9
9
|
import * as i4$1 from '@angular/material/tooltip';
|
|
@@ -18,7 +18,9 @@ import * as i5 from '@angular/material/select';
|
|
|
18
18
|
import { MatSelectModule } from '@angular/material/select';
|
|
19
19
|
import * as i8 from '@angular/forms';
|
|
20
20
|
import { FormGroup, FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
21
|
-
import
|
|
21
|
+
import * as i6$1 from '@angular/material/tabs';
|
|
22
|
+
import { MatTabsModule } from '@angular/material/tabs';
|
|
23
|
+
import { cloneDeep, uniqueId, capitalize, flatten, differenceBy, omit, unionBy } from 'lodash';
|
|
22
24
|
import * as i3 from '@angular/material/icon';
|
|
23
25
|
import * as i6 from '@angular/material/core';
|
|
24
26
|
import { tap } from 'rxjs/operators';
|
|
@@ -155,7 +157,7 @@ class GioPolicyStudioFlowMessageFormDialogComponent {
|
|
|
155
157
|
});
|
|
156
158
|
}
|
|
157
159
|
onSubmit() {
|
|
158
|
-
const
|
|
160
|
+
const channelSelectorToSave = {
|
|
159
161
|
type: 'CHANNEL',
|
|
160
162
|
channel: this.flowFormGroup?.get('channel')?.value,
|
|
161
163
|
channelOperator: this.flowFormGroup?.get('channelOperator')?.value,
|
|
@@ -178,7 +180,7 @@ class GioPolicyStudioFlowMessageFormDialogComponent {
|
|
|
178
180
|
_hasChanged: true,
|
|
179
181
|
// Add changes
|
|
180
182
|
name: this.flowFormGroup?.get('name')?.value,
|
|
181
|
-
selectors: conditionSelectorToSave ? [
|
|
183
|
+
selectors: conditionSelectorToSave ? [channelSelectorToSave, conditionSelectorToSave] : [channelSelectorToSave],
|
|
182
184
|
enabled: true,
|
|
183
185
|
};
|
|
184
186
|
this.dialogRef.close({
|
|
@@ -283,6 +285,132 @@ const sanitizeMethodFormValue = (methods) => {
|
|
|
283
285
|
return methods;
|
|
284
286
|
};
|
|
285
287
|
|
|
288
|
+
/*
|
|
289
|
+
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
290
|
+
*
|
|
291
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
292
|
+
* you may not use this file except in compliance with the License.
|
|
293
|
+
* You may obtain a copy of the License at
|
|
294
|
+
*
|
|
295
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
296
|
+
*
|
|
297
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
298
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
299
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
300
|
+
* See the License for the specific language governing permissions and
|
|
301
|
+
* limitations under the License.
|
|
302
|
+
*/
|
|
303
|
+
class GioPolicyStudioDetailsInfoBarComponent {
|
|
304
|
+
constructor() {
|
|
305
|
+
this.flow = undefined;
|
|
306
|
+
this.entrypointsInfo = [];
|
|
307
|
+
}
|
|
308
|
+
get condition() {
|
|
309
|
+
const conditionSelector = this.flow?.selectors?.find(s => s.type === 'CONDITION');
|
|
310
|
+
if (!conditionSelector) {
|
|
311
|
+
return undefined;
|
|
312
|
+
}
|
|
313
|
+
return conditionSelector?.condition;
|
|
314
|
+
}
|
|
315
|
+
// MESSAGE API type
|
|
316
|
+
get operations() {
|
|
317
|
+
const channelSelector = this.flow?.selectors?.find(s => s.type === 'CHANNEL');
|
|
318
|
+
if (!channelSelector) {
|
|
319
|
+
return undefined;
|
|
320
|
+
}
|
|
321
|
+
const operationToBadge = {
|
|
322
|
+
PUBLISH: 'PUB',
|
|
323
|
+
SUBSCRIBE: 'SUB',
|
|
324
|
+
};
|
|
325
|
+
return channelSelector?.operations?.map(o => operationToBadge[o]).sort();
|
|
326
|
+
}
|
|
327
|
+
get channel() {
|
|
328
|
+
const channelSelector = this.flow?.selectors?.find(s => s.type === 'CHANNEL');
|
|
329
|
+
if (!channelSelector) {
|
|
330
|
+
return undefined;
|
|
331
|
+
}
|
|
332
|
+
return channelSelector?.channel;
|
|
333
|
+
}
|
|
334
|
+
get channelOperator() {
|
|
335
|
+
const channelSelector = this.flow?.selectors?.find(s => s.type === 'CHANNEL');
|
|
336
|
+
if (!channelSelector) {
|
|
337
|
+
return undefined;
|
|
338
|
+
}
|
|
339
|
+
return channelSelector?.channelOperator;
|
|
340
|
+
}
|
|
341
|
+
// PROXY API type
|
|
342
|
+
get path() {
|
|
343
|
+
const httpSelector = this.flow?.selectors?.find(s => s.type === 'HTTP');
|
|
344
|
+
if (!httpSelector) {
|
|
345
|
+
return undefined;
|
|
346
|
+
}
|
|
347
|
+
return httpSelector?.path;
|
|
348
|
+
}
|
|
349
|
+
get pathOperator() {
|
|
350
|
+
const httpSelector = this.flow?.selectors?.find(s => s.type === 'HTTP');
|
|
351
|
+
if (!httpSelector) {
|
|
352
|
+
return undefined;
|
|
353
|
+
}
|
|
354
|
+
return httpSelector?.pathOperator;
|
|
355
|
+
}
|
|
356
|
+
get methods() {
|
|
357
|
+
const httpSelector = this.flow?.selectors?.find(s => s.type === 'HTTP');
|
|
358
|
+
if (!httpSelector) {
|
|
359
|
+
return undefined;
|
|
360
|
+
}
|
|
361
|
+
return httpSelector?.methods?.length ? httpSelector?.methods : ['ALL'];
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
GioPolicyStudioDetailsInfoBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioDetailsInfoBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
365
|
+
GioPolicyStudioDetailsInfoBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioPolicyStudioDetailsInfoBarComponent, selector: "gio-ps-flow-details-info-bar", inputs: { flow: "flow", entrypointsInfo: "entrypointsInfo" }, ngImport: i0, template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (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 http://www.apache.org/licenses/LICENSE-2.0\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 *ngIf=\"flow?.name\" class=\"info\">\n <span class=\"info__label\">Name</span>\n <span class=\"info__value strong\">{{ flow?.name }}</span>\n</div>\n\n<div *ngIf=\"entrypointsInfo\" class=\"info\">\n <span class=\"info__label\">Entrypoints</span>\n <span *ngFor=\"let entrypoint of entrypointsInfo\" class=\"info__value gio-badge-neutral\">\n <mat-icon [svgIcon]=\"entrypoint.icon\"></mat-icon>\n {{ entrypoint.type }}</span\n >\n</div>\n\n<!-- MESSAGE API type -->\n\n<div *ngIf=\"operations\" class=\"info\">\n <span class=\"info__label\">Operations</span>\n <span *ngFor=\"let operation of operations\" class=\"info__value gio-badge-neutral\"> {{ operation }}</span>\n</div>\n\n<div *ngIf=\"channel\" class=\"info\">\n <span class=\"info__label\">Channel</span>\n <span class=\"info__value strong\">{{ channel }}</span>\n</div>\n\n<div *ngIf=\"channelOperator\" class=\"info\">\n <span class=\"info__label\">Channel Operator</span>\n <span class=\"info__value gio-badge-neutral\">{{ channelOperator }}</span>\n</div>\n\n<!-- PROXY API type -->\n\n<div *ngIf=\"path\" class=\"info\">\n <span class=\"info__label\">Path</span>\n <span class=\"info__value strong\">{{ path }}</span>\n</div>\n\n<div *ngIf=\"pathOperator\" class=\"info\">\n <span class=\"info__label\">Path Operator</span>\n <span class=\"info__value gio-badge-neutral\">{{ pathOperator }}</span>\n</div>\n\n<div *ngIf=\"methods\" class=\"info\">\n <span class=\"info__label\">HTTP methods</span>\n <span *ngFor=\"let method of methods\" class=\"info__value gio-badge-neutral\"> {{ method }}</span>\n</div>\n\n<!-- Condition -->\n\n<div *ngIf=\"condition\" class=\"info\">\n <span class=\"info__label\">Condition</span>\n <span class=\"info__value gio-badge-neutral\">{{ condition }}</span>\n</div>\n", styles: [":host{display:flex;flex-flow:row wrap;padding:16px;gap:12px}.info__label{font:400 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;color:#606274}.info__value.strong{padding-left:8px;font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}\n"], components: [{ type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
366
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioDetailsInfoBarComponent, decorators: [{
|
|
367
|
+
type: Component,
|
|
368
|
+
args: [{ selector: 'gio-ps-flow-details-info-bar', template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (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 http://www.apache.org/licenses/LICENSE-2.0\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 *ngIf=\"flow?.name\" class=\"info\">\n <span class=\"info__label\">Name</span>\n <span class=\"info__value strong\">{{ flow?.name }}</span>\n</div>\n\n<div *ngIf=\"entrypointsInfo\" class=\"info\">\n <span class=\"info__label\">Entrypoints</span>\n <span *ngFor=\"let entrypoint of entrypointsInfo\" class=\"info__value gio-badge-neutral\">\n <mat-icon [svgIcon]=\"entrypoint.icon\"></mat-icon>\n {{ entrypoint.type }}</span\n >\n</div>\n\n<!-- MESSAGE API type -->\n\n<div *ngIf=\"operations\" class=\"info\">\n <span class=\"info__label\">Operations</span>\n <span *ngFor=\"let operation of operations\" class=\"info__value gio-badge-neutral\"> {{ operation }}</span>\n</div>\n\n<div *ngIf=\"channel\" class=\"info\">\n <span class=\"info__label\">Channel</span>\n <span class=\"info__value strong\">{{ channel }}</span>\n</div>\n\n<div *ngIf=\"channelOperator\" class=\"info\">\n <span class=\"info__label\">Channel Operator</span>\n <span class=\"info__value gio-badge-neutral\">{{ channelOperator }}</span>\n</div>\n\n<!-- PROXY API type -->\n\n<div *ngIf=\"path\" class=\"info\">\n <span class=\"info__label\">Path</span>\n <span class=\"info__value strong\">{{ path }}</span>\n</div>\n\n<div *ngIf=\"pathOperator\" class=\"info\">\n <span class=\"info__label\">Path Operator</span>\n <span class=\"info__value gio-badge-neutral\">{{ pathOperator }}</span>\n</div>\n\n<div *ngIf=\"methods\" class=\"info\">\n <span class=\"info__label\">HTTP methods</span>\n <span *ngFor=\"let method of methods\" class=\"info__value gio-badge-neutral\"> {{ method }}</span>\n</div>\n\n<!-- Condition -->\n\n<div *ngIf=\"condition\" class=\"info\">\n <span class=\"info__label\">Condition</span>\n <span class=\"info__value gio-badge-neutral\">{{ condition }}</span>\n</div>\n", styles: [":host{display:flex;flex-flow:row wrap;padding:16px;gap:12px}.info__label{font:400 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;color:#606274}.info__value.strong{padding-left:8px;font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}\n"] }]
|
|
369
|
+
}], propDecorators: { flow: [{
|
|
370
|
+
type: Input
|
|
371
|
+
}], entrypointsInfo: [{
|
|
372
|
+
type: Input
|
|
373
|
+
}] } });
|
|
374
|
+
|
|
375
|
+
/*
|
|
376
|
+
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
377
|
+
*
|
|
378
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
379
|
+
* you may not use this file except in compliance with the License.
|
|
380
|
+
* You may obtain a copy of the License at
|
|
381
|
+
*
|
|
382
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
383
|
+
*
|
|
384
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
385
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
386
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
387
|
+
* See the License for the specific language governing permissions and
|
|
388
|
+
* limitations under the License.
|
|
389
|
+
*/
|
|
390
|
+
class GioPolicyStudioDetailsPhaseComponent {
|
|
391
|
+
constructor() {
|
|
392
|
+
this.steps = undefined;
|
|
393
|
+
this.entrypointsInfo = [];
|
|
394
|
+
this.endpointsInfo = [];
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
GioPolicyStudioDetailsPhaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioDetailsPhaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
398
|
+
GioPolicyStudioDetailsPhaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioPolicyStudioDetailsPhaseComponent, selector: "gio-ps-flow-details-phase", inputs: { steps: "steps", name: "name", description: "description", entrypointsInfo: "entrypointsInfo", endpointsInfo: "endpointsInfo" }, ngImport: i0, template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (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 http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n\n<div class=\"header\">\n <span class=\"header__name\">\n {{ name }}\n </span>\n <span class=\"header__description\">\n {{ description }}\n </span>\n</div>\n\n<div class=\"wrapper\">\n <div class=\"content\">\n <span class=\"gio-badge-white content__connectorBadge\">\n <ng-container *ngFor=\"let entrypoint of entrypointsInfo\">\n <mat-icon [svgIcon]=\"entrypoint.icon\"></mat-icon>\n {{ entrypoint.type }}</ng-container\n >\n </span>\n\n <mat-icon class=\"content__rightArrow\" svgIcon=\"gio:arrow-right\"></mat-icon>\n\n <button mat-icon-button>\n <mat-icon svgIcon=\"gio:plus\"></mat-icon>\n </button>\n\n <mat-icon class=\"content__rightArrow\" svgIcon=\"gio:arrow-right\"></mat-icon>\n\n <span class=\"gio-badge-white content__connectorBadge\">\n <ng-container *ngFor=\"let endpoint of endpointsInfo\">\n <mat-icon [svgIcon]=\"endpoint.icon\"></mat-icon>\n {{ endpoint.type }}</ng-container\n >\n </span>\n </div>\n</div>\n", styles: [":host{display:flex;overflow:hidden;min-height:199px;flex-direction:column;padding-top:16px;border:1px solid #d3d5dc;border-radius:8px;background-color:#fff}.header{padding:0 16px}.header__name{font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}.header__description{padding-left:8px;font:400 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;color:#606274}.wrapper{display:flex;flex:1 1 auto;padding:0 16px;overflow-y:auto}.content{display:flex;align-items:center}.content__connectorBadge{border:1px solid #876fec;border-radius:16px}.content__rightArrow{width:16px;height:16px;margin:0 8px;color:#b4b5bb}\n"], components: [{ type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i5$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
399
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioDetailsPhaseComponent, decorators: [{
|
|
400
|
+
type: Component,
|
|
401
|
+
args: [{ selector: 'gio-ps-flow-details-phase', template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (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 http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n\n<div class=\"header\">\n <span class=\"header__name\">\n {{ name }}\n </span>\n <span class=\"header__description\">\n {{ description }}\n </span>\n</div>\n\n<div class=\"wrapper\">\n <div class=\"content\">\n <span class=\"gio-badge-white content__connectorBadge\">\n <ng-container *ngFor=\"let entrypoint of entrypointsInfo\">\n <mat-icon [svgIcon]=\"entrypoint.icon\"></mat-icon>\n {{ entrypoint.type }}</ng-container\n >\n </span>\n\n <mat-icon class=\"content__rightArrow\" svgIcon=\"gio:arrow-right\"></mat-icon>\n\n <button mat-icon-button>\n <mat-icon svgIcon=\"gio:plus\"></mat-icon>\n </button>\n\n <mat-icon class=\"content__rightArrow\" svgIcon=\"gio:arrow-right\"></mat-icon>\n\n <span class=\"gio-badge-white content__connectorBadge\">\n <ng-container *ngFor=\"let endpoint of endpointsInfo\">\n <mat-icon [svgIcon]=\"endpoint.icon\"></mat-icon>\n {{ endpoint.type }}</ng-container\n >\n </span>\n </div>\n</div>\n", styles: [":host{display:flex;overflow:hidden;min-height:199px;flex-direction:column;padding-top:16px;border:1px solid #d3d5dc;border-radius:8px;background-color:#fff}.header{padding:0 16px}.header__name{font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}.header__description{padding-left:8px;font:400 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;color:#606274}.wrapper{display:flex;flex:1 1 auto;padding:0 16px;overflow-y:auto}.content{display:flex;align-items:center}.content__connectorBadge{border:1px solid #876fec;border-radius:16px}.content__rightArrow{width:16px;height:16px;margin:0 8px;color:#b4b5bb}\n"] }]
|
|
402
|
+
}], propDecorators: { steps: [{
|
|
403
|
+
type: Input
|
|
404
|
+
}], name: [{
|
|
405
|
+
type: Input
|
|
406
|
+
}], description: [{
|
|
407
|
+
type: Input
|
|
408
|
+
}], entrypointsInfo: [{
|
|
409
|
+
type: Input
|
|
410
|
+
}], endpointsInfo: [{
|
|
411
|
+
type: Input
|
|
412
|
+
}] } });
|
|
413
|
+
|
|
286
414
|
/*
|
|
287
415
|
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
288
416
|
*
|
|
@@ -302,7 +430,8 @@ class GioPolicyStudioDetailsComponent {
|
|
|
302
430
|
constructor(matDialog) {
|
|
303
431
|
this.matDialog = matDialog;
|
|
304
432
|
this.flow = undefined;
|
|
305
|
-
this.
|
|
433
|
+
this.entrypointsInfo = [];
|
|
434
|
+
this.endpointsInfo = [];
|
|
306
435
|
this.flowChange = new EventEmitter();
|
|
307
436
|
this.deleteFlow = new EventEmitter();
|
|
308
437
|
}
|
|
@@ -312,7 +441,7 @@ class GioPolicyStudioDetailsComponent {
|
|
|
312
441
|
.open(GioPolicyStudioFlowMessageFormDialogComponent, {
|
|
313
442
|
data: {
|
|
314
443
|
flow: this.flow,
|
|
315
|
-
entrypoints: this.
|
|
444
|
+
entrypoints: (this.entrypointsInfo ?? []).map(e => e.type),
|
|
316
445
|
},
|
|
317
446
|
role: 'alertdialog',
|
|
318
447
|
id: 'gioPsFlowMessageFormDialog',
|
|
@@ -341,15 +470,17 @@ class GioPolicyStudioDetailsComponent {
|
|
|
341
470
|
}
|
|
342
471
|
}
|
|
343
472
|
GioPolicyStudioDetailsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioDetailsComponent, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
|
344
|
-
GioPolicyStudioDetailsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioPolicyStudioDetailsComponent, selector: "gio-ps-flow-details", inputs: { apiType: "apiType", flow: "flow",
|
|
473
|
+
GioPolicyStudioDetailsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioPolicyStudioDetailsComponent, selector: "gio-ps-flow-details", inputs: { apiType: "apiType", flow: "flow", entrypointsInfo: "entrypointsInfo", endpointsInfo: "endpointsInfo" }, outputs: { flowChange: "flowChange", deleteFlow: "deleteFlow" }, ngImport: i0, template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (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 http://www.apache.org/licenses/LICENSE-2.0\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=\"flow; else emptyFlows\">\n <div class=\"header\">\n <div class=\"header__label\">Flow details</div>\n <div class=\"header__configBtn\">\n <button class=\"header__configBtn__edit\" mat-stroked-button mat-icon-button (click)=\"onEditFlow()\">\n <mat-icon svgIcon=\"gio:edit-pencil\"></mat-icon>\n </button>\n <button class=\"header__configBtn__delete\" mat-stroked-button mat-icon-button (click)=\"onDeleteFlow()\">\n <mat-icon svgIcon=\"gio:trash\"></mat-icon>\n </button>\n </div>\n </div>\n <gio-ps-flow-details-info-bar class=\"infoBar\" [flow]=\"flow\" [entrypointsInfo]=\"entrypointsInfo\"></gio-ps-flow-details-info-bar>\n\n <div class=\"content\">\n <gio-banner-warning>\uD83D\uDEA7 Work in progress \uD83D\uDEA7</gio-banner-warning>\n\n <mat-tab-group *ngIf=\"apiType === 'MESSAGE'\" class=\"content__tabs\">\n <mat-tab label=\"Initial connection\">\n <gio-ps-flow-details-phase\n class=\"content__phase\"\n name=\"Request phase\"\n description=\"Policies will be applied during the connection establishment\"\n [entrypointsInfo]=\"entrypointsInfo\"\n [endpointsInfo]=\"endpointsInfo\"\n ></gio-ps-flow-details-phase>\n <gio-ps-flow-details-phase\n class=\"content__phase\"\n name=\"Response phase\"\n description=\"Policies will be applied during the connection termination\"\n [entrypointsInfo]=\"entrypointsInfo\"\n [endpointsInfo]=\"endpointsInfo\"\n ></gio-ps-flow-details-phase>\n </mat-tab>\n <mat-tab label=\"Event messages\">\n <gio-ps-flow-details-phase\n class=\"content__phase\"\n name=\"Publish phase\"\n description=\"Policies will be applied on messages sent to the endpoint\"\n [entrypointsInfo]=\"entrypointsInfo\"\n [endpointsInfo]=\"endpointsInfo\"\n ></gio-ps-flow-details-phase>\n <gio-ps-flow-details-phase\n class=\"content__phase\"\n name=\"Subscribe phase\"\n description=\"Policies will be applied on messages received by the entrypoint\"\n [entrypointsInfo]=\"entrypointsInfo\"\n [endpointsInfo]=\"endpointsInfo\"\n ></gio-ps-flow-details-phase>\n </mat-tab>\n </mat-tab-group>\n\n <div *ngIf=\"apiType === 'PROXY'\">\n <gio-ps-flow-details-phase\n class=\"content__phase\"\n name=\"Request phase\"\n description=\"Policies will be applied during the connection establishment\"\n [entrypointsInfo]=\"entrypointsInfo\"\n [endpointsInfo]=\"endpointsInfo\"\n ></gio-ps-flow-details-phase>\n <gio-ps-flow-details-phase\n class=\"content__phase\"\n name=\"Response phase\"\n description=\"Policies will be applied during the connection termination\"\n [entrypointsInfo]=\"entrypointsInfo\"\n [endpointsInfo]=\"endpointsInfo\"\n ></gio-ps-flow-details-phase>\n </div>\n </div>\n</ng-container>\n\n<ng-template #emptyFlows>\n <div class=\"emptyFlows\">\n <h2>No flows yet</h2>\n <p class=\"mat-body-1\">Flows allow you to customize the behavior of your API event phases through configurable policies</p>\n </div>\n</ng-template>\n", styles: [":host{display:flex;height:100%;flex-direction:column}.emptyFlows{display:flex;width:500px;height:100%;flex-direction:column;justify-content:center;margin:auto;text-align:center}.header{display:flex;align-items:center;padding:16px;border-bottom:1px solid #d3d5dc}.header__label{font:600 16px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;display:flex;flex:1 1 auto;align-items:center;margin-bottom:0;gap:8px}.header__configBtn{display:flex;align-items:center;margin-left:8px;gap:8px}.infoBar{border-bottom:1px solid #d3d5dc}.content{overflow:auto;flex:1 1 auto;background-color:#f7f8fd}.content__tabs{min-height:100%;min-height:calc(100% - 64px)}.content__phase{margin:16px 16px 0}\n"], components: [{ type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: GioPolicyStudioDetailsInfoBarComponent, selector: "gio-ps-flow-details-info-bar", inputs: ["flow", "entrypointsInfo"] }, { type: i7.GioBannerWarningComponent, selector: "gio-banner-warning" }, { type: i6$1.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { type: i6$1.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { type: GioPolicyStudioDetailsPhaseComponent, selector: "gio-ps-flow-details-phase", inputs: ["steps", "name", "description", "entrypointsInfo", "endpointsInfo"] }], directives: [{ type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
345
474
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioDetailsComponent, decorators: [{
|
|
346
475
|
type: Component,
|
|
347
|
-
args: [{ selector: 'gio-ps-flow-details', template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (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 http://www.apache.org/licenses/LICENSE-2.0\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=\"flow; else emptyFlows\">\n <div class=\"header\">\n <div class=\"header__label\">Flow details</div>\n <div class=\"header__configBtn\">\n <button class=\"header__configBtn__edit\" mat-stroked-button mat-icon-button (click)=\"onEditFlow()\">\n <mat-icon svgIcon=\"gio:edit-pencil\"></mat-icon>\n </button>\n <button class=\"header__configBtn__delete\" mat-stroked-button mat-icon-button (click)=\"onDeleteFlow()\">\n <mat-icon svgIcon=\"gio:trash\"></mat-icon>\n </button>\n </div>\n </div>\n\n <div class=\"content\">\n
|
|
476
|
+
args: [{ selector: 'gio-ps-flow-details', template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (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 http://www.apache.org/licenses/LICENSE-2.0\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=\"flow; else emptyFlows\">\n <div class=\"header\">\n <div class=\"header__label\">Flow details</div>\n <div class=\"header__configBtn\">\n <button class=\"header__configBtn__edit\" mat-stroked-button mat-icon-button (click)=\"onEditFlow()\">\n <mat-icon svgIcon=\"gio:edit-pencil\"></mat-icon>\n </button>\n <button class=\"header__configBtn__delete\" mat-stroked-button mat-icon-button (click)=\"onDeleteFlow()\">\n <mat-icon svgIcon=\"gio:trash\"></mat-icon>\n </button>\n </div>\n </div>\n <gio-ps-flow-details-info-bar class=\"infoBar\" [flow]=\"flow\" [entrypointsInfo]=\"entrypointsInfo\"></gio-ps-flow-details-info-bar>\n\n <div class=\"content\">\n <gio-banner-warning>\uD83D\uDEA7 Work in progress \uD83D\uDEA7</gio-banner-warning>\n\n <mat-tab-group *ngIf=\"apiType === 'MESSAGE'\" class=\"content__tabs\">\n <mat-tab label=\"Initial connection\">\n <gio-ps-flow-details-phase\n class=\"content__phase\"\n name=\"Request phase\"\n description=\"Policies will be applied during the connection establishment\"\n [entrypointsInfo]=\"entrypointsInfo\"\n [endpointsInfo]=\"endpointsInfo\"\n ></gio-ps-flow-details-phase>\n <gio-ps-flow-details-phase\n class=\"content__phase\"\n name=\"Response phase\"\n description=\"Policies will be applied during the connection termination\"\n [entrypointsInfo]=\"entrypointsInfo\"\n [endpointsInfo]=\"endpointsInfo\"\n ></gio-ps-flow-details-phase>\n </mat-tab>\n <mat-tab label=\"Event messages\">\n <gio-ps-flow-details-phase\n class=\"content__phase\"\n name=\"Publish phase\"\n description=\"Policies will be applied on messages sent to the endpoint\"\n [entrypointsInfo]=\"entrypointsInfo\"\n [endpointsInfo]=\"endpointsInfo\"\n ></gio-ps-flow-details-phase>\n <gio-ps-flow-details-phase\n class=\"content__phase\"\n name=\"Subscribe phase\"\n description=\"Policies will be applied on messages received by the entrypoint\"\n [entrypointsInfo]=\"entrypointsInfo\"\n [endpointsInfo]=\"endpointsInfo\"\n ></gio-ps-flow-details-phase>\n </mat-tab>\n </mat-tab-group>\n\n <div *ngIf=\"apiType === 'PROXY'\">\n <gio-ps-flow-details-phase\n class=\"content__phase\"\n name=\"Request phase\"\n description=\"Policies will be applied during the connection establishment\"\n [entrypointsInfo]=\"entrypointsInfo\"\n [endpointsInfo]=\"endpointsInfo\"\n ></gio-ps-flow-details-phase>\n <gio-ps-flow-details-phase\n class=\"content__phase\"\n name=\"Response phase\"\n description=\"Policies will be applied during the connection termination\"\n [entrypointsInfo]=\"entrypointsInfo\"\n [endpointsInfo]=\"endpointsInfo\"\n ></gio-ps-flow-details-phase>\n </div>\n </div>\n</ng-container>\n\n<ng-template #emptyFlows>\n <div class=\"emptyFlows\">\n <h2>No flows yet</h2>\n <p class=\"mat-body-1\">Flows allow you to customize the behavior of your API event phases through configurable policies</p>\n </div>\n</ng-template>\n", styles: [":host{display:flex;height:100%;flex-direction:column}.emptyFlows{display:flex;width:500px;height:100%;flex-direction:column;justify-content:center;margin:auto;text-align:center}.header{display:flex;align-items:center;padding:16px;border-bottom:1px solid #d3d5dc}.header__label{font:600 16px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;display:flex;flex:1 1 auto;align-items:center;margin-bottom:0;gap:8px}.header__configBtn{display:flex;align-items:center;margin-left:8px;gap:8px}.infoBar{border-bottom:1px solid #d3d5dc}.content{overflow:auto;flex:1 1 auto;background-color:#f7f8fd}.content__tabs{min-height:100%;min-height:calc(100% - 64px)}.content__phase{margin:16px 16px 0}\n"] }]
|
|
348
477
|
}], ctorParameters: function () { return [{ type: i1.MatDialog }]; }, propDecorators: { apiType: [{
|
|
349
478
|
type: Input
|
|
350
479
|
}], flow: [{
|
|
351
480
|
type: Input
|
|
352
|
-
}],
|
|
481
|
+
}], entrypointsInfo: [{
|
|
482
|
+
type: Input
|
|
483
|
+
}], endpointsInfo: [{
|
|
353
484
|
type: Input
|
|
354
485
|
}], flowChange: [{
|
|
355
486
|
type: Output
|
|
@@ -384,7 +515,7 @@ class GioPolicyStudioFlowsMenuComponent {
|
|
|
384
515
|
}
|
|
385
516
|
ngOnChanges(changes) {
|
|
386
517
|
if (changes.flowsGroups || changes.selectedFlow) {
|
|
387
|
-
this.flowsGroupsVMSelected = this.flowsGroups.map(flowGroup => {
|
|
518
|
+
this.flowsGroupsVMSelected = cloneDeep(this.flowsGroups).map(flowGroup => {
|
|
388
519
|
return {
|
|
389
520
|
...flowGroup,
|
|
390
521
|
flows: flowGroup.flows.map(flow => {
|
|
@@ -438,8 +569,11 @@ class GioPolicyStudioFlowsMenuComponent {
|
|
|
438
569
|
});
|
|
439
570
|
}
|
|
440
571
|
}
|
|
441
|
-
selectFlow(
|
|
442
|
-
this.
|
|
572
|
+
selectFlow(groupId, flowId) {
|
|
573
|
+
const flow = this.flowsGroups.find(fg => fg._id === groupId)?.flows.find(f => f._id === flowId);
|
|
574
|
+
if (flow) {
|
|
575
|
+
this.selectedFlowChange.emit(flow);
|
|
576
|
+
}
|
|
443
577
|
}
|
|
444
578
|
onAddFlow(flowGroup) {
|
|
445
579
|
const dialogResult = this.apiType === 'MESSAGE'
|
|
@@ -480,10 +614,10 @@ class GioPolicyStudioFlowsMenuComponent {
|
|
|
480
614
|
}
|
|
481
615
|
}
|
|
482
616
|
GioPolicyStudioFlowsMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioFlowsMenuComponent, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
|
483
|
-
GioPolicyStudioFlowsMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioPolicyStudioFlowsMenuComponent, selector: "gio-ps-flows-menu", inputs: { apiType: "apiType", flowsGroups: "flowsGroups", selectedFlow: "selectedFlow", entrypoints: "entrypoints" }, outputs: { selectedFlowChange: "selectedFlowChange", flowsGroupsChange: "flowsGroupsChange" }, usesOnChanges: true, ngImport: i0, template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (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 http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n\n<div class=\"header\">\n <div class=\"header__label\">\n Flows <mat-icon svgIcon=\"gio:info\" matTooltip=\"Flows allow you to apply different policies on your API event phases\"></mat-icon>\n </div>\n <div class=\"header__configBtn\">\n <button mat-stroked-button mat-icon-button><mat-icon svgIcon=\"gio:settings\"></mat-icon></button>\n </div>\n</div>\n\n<div class=\"list\">\n <div *ngFor=\"let flowsGroup of flowsGroupsVMSelected\" class=\"list__flowsGroup\">\n <div class=\"list__flowsGroup__header\">\n <div class=\"list__flowsGroup__header__label\">\n <mat-icon *ngIf=\"flowsGroup._icon\" [svgIcon]=\"flowsGroup._icon\"></mat-icon>\n <span>{{ flowsGroup.name }}</span>\n </div>\n <div class=\"list__flowsGroup__header__addBtn\">\n <button mat-icon-button (click)=\"onAddFlow(flowsGroup)\"><mat-icon svgIcon=\"gio:plus\" matTooltip=\"New flow\"></mat-icon></button>\n </div>\n </div>\n\n <div\n *ngFor=\"let flow of flowsGroup.flows\"\n class=\"list__flowsGroup__flow\"\n [class.selected]=\"flow.selected\"\n (click)=\"selectFlow(flow)\"\n (mouseout)=\"flow.mouseOver = false\"\n (mouseover)=\"flow.mouseOver = true\"\n >\n <div *ngIf=\"flow.name\" class=\"list__flowsGroup__flow__name\" [attr.title]=\"flow.name\">\n {{ flow.name }}\n </div>\n <div class=\"list__flowsGroup__flow__infos\">\n <div class=\"list__flowsGroup__flow__infos__badges\">\n <span *ngFor=\"let badge of flow.badges\" class=\"list__flowsGroup__flow__infos__badges__badge\" [ngClass]=\"badge.class\">{{\n badge.label\n }}</span>\n </div>\n <div class=\"list__flowsGroup__flow__infos__pathOrChannelLabel\">{{ flow.pathOrChannelLabel }}</div>\n </div>\n </div>\n </div>\n</div>\n", styles: [":host{display:flex;max-height:100%;flex-direction:column;padding-top:16px}.header{display:flex;align-items:center;padding:0 16px;margin-bottom:16px}.header__label{font:600 16px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;display:flex;flex:1 1 auto;align-items:center;margin-bottom:0;gap:8px}.header__configBtn{margin-left:8px}.list{padding:0 16px;overflow-y:overlay}.list__flowsGroup{display:flex;flex-direction:column;padding-bottom:8px;gap:8px}.list__flowsGroup__header{display:flex;align-items:center;padding:8px 8px 8px 10px;border-radius:8px;background-color:#cdc5f7}.list__flowsGroup__header__label{font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;display:flex;flex:1 1 auto;align-items:center;gap:8px}.list__flowsGroup__header__label>mat-icon{width:22px;height:22px;flex:0 0 auto}.list__flowsGroup__header__label>span{display:-webkit-box;overflow:hidden;flex:1 1 auto;-webkit-box-orient:vertical;-webkit-line-clamp:2}.list__flowsGroup__header__addBtn{margin-left:8px}.list__flowsGroup__flow{display:flex;height:68px;flex-direction:column;justify-content:center;padding:7px;border:1px solid #d3d5dc;border-radius:8px;gap:8px}.list__flowsGroup__flow:hover,.list__flowsGroup__flow.selected{padding:6px;border:2px solid #876fec;cursor:pointer}.list__flowsGroup__flow__name{overflow:hidden;padding-left:4px;text-overflow:ellipsis;white-space:nowrap}.list__flowsGroup__flow__infos{display:flex;align-items:center}.list__flowsGroup__flow__infos__badges{flex:0 0 auto}.list__flowsGroup__flow__infos__badges__badge{width:auto}.list__flowsGroup__flow__infos__pathOrChannelLabel{flex:1 1 auto}\n"], components: [{ type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i4$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i5$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
617
|
+
GioPolicyStudioFlowsMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioPolicyStudioFlowsMenuComponent, selector: "gio-ps-flows-menu", inputs: { apiType: "apiType", flowsGroups: "flowsGroups", selectedFlow: "selectedFlow", entrypoints: "entrypoints" }, outputs: { selectedFlowChange: "selectedFlowChange", flowsGroupsChange: "flowsGroupsChange" }, usesOnChanges: true, ngImport: i0, template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (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 http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n\n<div class=\"header\">\n <div class=\"header__label\">\n Flows <mat-icon svgIcon=\"gio:info\" matTooltip=\"Flows allow you to apply different policies on your API event phases\"></mat-icon>\n </div>\n <div class=\"header__configBtn\">\n <button mat-stroked-button mat-icon-button><mat-icon svgIcon=\"gio:settings\"></mat-icon></button>\n </div>\n</div>\n\n<div class=\"list\">\n <div *ngFor=\"let flowsGroup of flowsGroupsVMSelected\" class=\"list__flowsGroup\">\n <div class=\"list__flowsGroup__header\">\n <div class=\"list__flowsGroup__header__label\">\n <mat-icon *ngIf=\"flowsGroup._icon\" [svgIcon]=\"flowsGroup._icon\"></mat-icon>\n <span>{{ flowsGroup.name }}</span>\n </div>\n <div class=\"list__flowsGroup__header__addBtn\">\n <button mat-icon-button (click)=\"onAddFlow(flowsGroup)\"><mat-icon svgIcon=\"gio:plus\" matTooltip=\"New flow\"></mat-icon></button>\n </div>\n </div>\n\n <div\n *ngFor=\"let flow of flowsGroup.flows\"\n class=\"list__flowsGroup__flow\"\n [class.selected]=\"flow.selected\"\n (click)=\"selectFlow(flowsGroup._id, flow._id)\"\n (mouseout)=\"flow.mouseOver = false\"\n (mouseover)=\"flow.mouseOver = true\"\n >\n <div *ngIf=\"flow.name\" class=\"list__flowsGroup__flow__name\" [attr.title]=\"flow.name\">\n {{ flow.name }}\n </div>\n <div class=\"list__flowsGroup__flow__infos\">\n <div class=\"list__flowsGroup__flow__infos__badges\">\n <span *ngFor=\"let badge of flow.badges\" class=\"list__flowsGroup__flow__infos__badges__badge\" [ngClass]=\"badge.class\">{{\n badge.label\n }}</span>\n </div>\n <div class=\"list__flowsGroup__flow__infos__pathOrChannelLabel\">{{ flow.pathOrChannelLabel }}</div>\n </div>\n </div>\n </div>\n</div>\n", styles: [":host{display:flex;max-height:100%;flex-direction:column;padding-top:16px}.header{display:flex;align-items:center;padding:0 16px;margin-bottom:16px}.header__label{font:600 16px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;display:flex;flex:1 1 auto;align-items:center;margin-bottom:0;gap:8px}.header__configBtn{margin-left:8px}.list{padding:0 16px;overflow-y:overlay}.list__flowsGroup{display:flex;flex-direction:column;padding-bottom:8px;gap:8px}.list__flowsGroup__header{display:flex;align-items:center;padding:8px 8px 8px 10px;border-radius:8px;background-color:#cdc5f7}.list__flowsGroup__header__label{font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;display:flex;flex:1 1 auto;align-items:center;gap:8px}.list__flowsGroup__header__label>mat-icon{width:22px;height:22px;flex:0 0 auto}.list__flowsGroup__header__label>span{display:-webkit-box;overflow:hidden;flex:1 1 auto;-webkit-box-orient:vertical;-webkit-line-clamp:2}.list__flowsGroup__header__addBtn{margin-left:8px}.list__flowsGroup__flow{display:flex;height:68px;flex-direction:column;justify-content:center;padding:7px;border:1px solid #d3d5dc;border-radius:8px;gap:8px}.list__flowsGroup__flow:hover,.list__flowsGroup__flow.selected{padding:6px;border:2px solid #876fec;cursor:pointer}.list__flowsGroup__flow__name{overflow:hidden;padding-left:4px;text-overflow:ellipsis;white-space:nowrap}.list__flowsGroup__flow__infos{display:flex;align-items:center}.list__flowsGroup__flow__infos__badges{flex:0 0 auto}.list__flowsGroup__flow__infos__badges__badge{width:auto}.list__flowsGroup__flow__infos__pathOrChannelLabel{flex:1 1 auto}\n"], components: [{ type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i4$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i5$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
484
618
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioFlowsMenuComponent, decorators: [{
|
|
485
619
|
type: Component,
|
|
486
|
-
args: [{ selector: 'gio-ps-flows-menu', template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (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 http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n\n<div class=\"header\">\n <div class=\"header__label\">\n Flows <mat-icon svgIcon=\"gio:info\" matTooltip=\"Flows allow you to apply different policies on your API event phases\"></mat-icon>\n </div>\n <div class=\"header__configBtn\">\n <button mat-stroked-button mat-icon-button><mat-icon svgIcon=\"gio:settings\"></mat-icon></button>\n </div>\n</div>\n\n<div class=\"list\">\n <div *ngFor=\"let flowsGroup of flowsGroupsVMSelected\" class=\"list__flowsGroup\">\n <div class=\"list__flowsGroup__header\">\n <div class=\"list__flowsGroup__header__label\">\n <mat-icon *ngIf=\"flowsGroup._icon\" [svgIcon]=\"flowsGroup._icon\"></mat-icon>\n <span>{{ flowsGroup.name }}</span>\n </div>\n <div class=\"list__flowsGroup__header__addBtn\">\n <button mat-icon-button (click)=\"onAddFlow(flowsGroup)\"><mat-icon svgIcon=\"gio:plus\" matTooltip=\"New flow\"></mat-icon></button>\n </div>\n </div>\n\n <div\n *ngFor=\"let flow of flowsGroup.flows\"\n class=\"list__flowsGroup__flow\"\n [class.selected]=\"flow.selected\"\n (click)=\"selectFlow(flow)\"\n (mouseout)=\"flow.mouseOver = false\"\n (mouseover)=\"flow.mouseOver = true\"\n >\n <div *ngIf=\"flow.name\" class=\"list__flowsGroup__flow__name\" [attr.title]=\"flow.name\">\n {{ flow.name }}\n </div>\n <div class=\"list__flowsGroup__flow__infos\">\n <div class=\"list__flowsGroup__flow__infos__badges\">\n <span *ngFor=\"let badge of flow.badges\" class=\"list__flowsGroup__flow__infos__badges__badge\" [ngClass]=\"badge.class\">{{\n badge.label\n }}</span>\n </div>\n <div class=\"list__flowsGroup__flow__infos__pathOrChannelLabel\">{{ flow.pathOrChannelLabel }}</div>\n </div>\n </div>\n </div>\n</div>\n", styles: [":host{display:flex;max-height:100%;flex-direction:column;padding-top:16px}.header{display:flex;align-items:center;padding:0 16px;margin-bottom:16px}.header__label{font:600 16px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;display:flex;flex:1 1 auto;align-items:center;margin-bottom:0;gap:8px}.header__configBtn{margin-left:8px}.list{padding:0 16px;overflow-y:overlay}.list__flowsGroup{display:flex;flex-direction:column;padding-bottom:8px;gap:8px}.list__flowsGroup__header{display:flex;align-items:center;padding:8px 8px 8px 10px;border-radius:8px;background-color:#cdc5f7}.list__flowsGroup__header__label{font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;display:flex;flex:1 1 auto;align-items:center;gap:8px}.list__flowsGroup__header__label>mat-icon{width:22px;height:22px;flex:0 0 auto}.list__flowsGroup__header__label>span{display:-webkit-box;overflow:hidden;flex:1 1 auto;-webkit-box-orient:vertical;-webkit-line-clamp:2}.list__flowsGroup__header__addBtn{margin-left:8px}.list__flowsGroup__flow{display:flex;height:68px;flex-direction:column;justify-content:center;padding:7px;border:1px solid #d3d5dc;border-radius:8px;gap:8px}.list__flowsGroup__flow:hover,.list__flowsGroup__flow.selected{padding:6px;border:2px solid #876fec;cursor:pointer}.list__flowsGroup__flow__name{overflow:hidden;padding-left:4px;text-overflow:ellipsis;white-space:nowrap}.list__flowsGroup__flow__infos{display:flex;align-items:center}.list__flowsGroup__flow__infos__badges{flex:0 0 auto}.list__flowsGroup__flow__infos__badges__badge{width:auto}.list__flowsGroup__flow__infos__pathOrChannelLabel{flex:1 1 auto}\n"] }]
|
|
620
|
+
args: [{ selector: 'gio-ps-flows-menu', template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (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 http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n\n<div class=\"header\">\n <div class=\"header__label\">\n Flows <mat-icon svgIcon=\"gio:info\" matTooltip=\"Flows allow you to apply different policies on your API event phases\"></mat-icon>\n </div>\n <div class=\"header__configBtn\">\n <button mat-stroked-button mat-icon-button><mat-icon svgIcon=\"gio:settings\"></mat-icon></button>\n </div>\n</div>\n\n<div class=\"list\">\n <div *ngFor=\"let flowsGroup of flowsGroupsVMSelected\" class=\"list__flowsGroup\">\n <div class=\"list__flowsGroup__header\">\n <div class=\"list__flowsGroup__header__label\">\n <mat-icon *ngIf=\"flowsGroup._icon\" [svgIcon]=\"flowsGroup._icon\"></mat-icon>\n <span>{{ flowsGroup.name }}</span>\n </div>\n <div class=\"list__flowsGroup__header__addBtn\">\n <button mat-icon-button (click)=\"onAddFlow(flowsGroup)\"><mat-icon svgIcon=\"gio:plus\" matTooltip=\"New flow\"></mat-icon></button>\n </div>\n </div>\n\n <div\n *ngFor=\"let flow of flowsGroup.flows\"\n class=\"list__flowsGroup__flow\"\n [class.selected]=\"flow.selected\"\n (click)=\"selectFlow(flowsGroup._id, flow._id)\"\n (mouseout)=\"flow.mouseOver = false\"\n (mouseover)=\"flow.mouseOver = true\"\n >\n <div *ngIf=\"flow.name\" class=\"list__flowsGroup__flow__name\" [attr.title]=\"flow.name\">\n {{ flow.name }}\n </div>\n <div class=\"list__flowsGroup__flow__infos\">\n <div class=\"list__flowsGroup__flow__infos__badges\">\n <span *ngFor=\"let badge of flow.badges\" class=\"list__flowsGroup__flow__infos__badges__badge\" [ngClass]=\"badge.class\">{{\n badge.label\n }}</span>\n </div>\n <div class=\"list__flowsGroup__flow__infos__pathOrChannelLabel\">{{ flow.pathOrChannelLabel }}</div>\n </div>\n </div>\n </div>\n</div>\n", styles: [":host{display:flex;max-height:100%;flex-direction:column;padding-top:16px}.header{display:flex;align-items:center;padding:0 16px;margin-bottom:16px}.header__label{font:600 16px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;display:flex;flex:1 1 auto;align-items:center;margin-bottom:0;gap:8px}.header__configBtn{margin-left:8px}.list{padding:0 16px;overflow-y:overlay}.list__flowsGroup{display:flex;flex-direction:column;padding-bottom:8px;gap:8px}.list__flowsGroup__header{display:flex;align-items:center;padding:8px 8px 8px 10px;border-radius:8px;background-color:#cdc5f7}.list__flowsGroup__header__label{font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;display:flex;flex:1 1 auto;align-items:center;gap:8px}.list__flowsGroup__header__label>mat-icon{width:22px;height:22px;flex:0 0 auto}.list__flowsGroup__header__label>span{display:-webkit-box;overflow:hidden;flex:1 1 auto;-webkit-box-orient:vertical;-webkit-line-clamp:2}.list__flowsGroup__header__addBtn{margin-left:8px}.list__flowsGroup__flow{display:flex;height:68px;flex-direction:column;justify-content:center;padding:7px;border:1px solid #d3d5dc;border-radius:8px;gap:8px}.list__flowsGroup__flow:hover,.list__flowsGroup__flow.selected{padding:6px;border:2px solid #876fec;cursor:pointer}.list__flowsGroup__flow__name{overflow:hidden;padding-left:4px;text-overflow:ellipsis;white-space:nowrap}.list__flowsGroup__flow__infos{display:flex;align-items:center}.list__flowsGroup__flow__infos__badges{flex:0 0 auto}.list__flowsGroup__flow__infos__badges__badge{width:auto}.list__flowsGroup__flow__infos__pathOrChannelLabel{flex:1 1 auto}\n"] }]
|
|
487
621
|
}], ctorParameters: function () { return [{ type: i1.MatDialog }]; }, propDecorators: { apiType: [{
|
|
488
622
|
type: Input
|
|
489
623
|
}], flowsGroups: [{
|
|
@@ -526,18 +660,16 @@ class GioPolicyStudioComponent {
|
|
|
526
660
|
this.commonFlows = [];
|
|
527
661
|
this.plans = [];
|
|
528
662
|
/**
|
|
529
|
-
* Return
|
|
530
|
-
*/
|
|
531
|
-
this.commonFlowsChange = new EventEmitter();
|
|
532
|
-
/**
|
|
533
|
-
* Return the list of plans with updated flows. Plans with no updated flows are not returned.
|
|
663
|
+
* Return what is needed to save.
|
|
534
664
|
**/
|
|
535
|
-
this.
|
|
665
|
+
this.save = new EventEmitter();
|
|
536
666
|
this.connectorsTooltip = '';
|
|
537
667
|
this.selectedFlow = undefined;
|
|
538
668
|
this.flowsGroups = [];
|
|
539
669
|
this.entrypointsType = [];
|
|
540
670
|
this.disableSaveButton = true;
|
|
671
|
+
// Used to keep track of initial flows groups to know if there are deleted flows
|
|
672
|
+
this.initialFlowsGroups = [];
|
|
541
673
|
}
|
|
542
674
|
ngOnChanges(changes) {
|
|
543
675
|
if (changes.entrypointsInfo || changes.endpointsInfo) {
|
|
@@ -549,6 +681,7 @@ class GioPolicyStudioComponent {
|
|
|
549
681
|
if (changes.commonFlows || changes.plans) {
|
|
550
682
|
this.disableSaveButton = true;
|
|
551
683
|
this.flowsGroups = getFlowsGroups(this.commonFlows, this.plans);
|
|
684
|
+
this.initialFlowsGroups = cloneDeep(this.flowsGroups);
|
|
552
685
|
// Select first flow by default on first load
|
|
553
686
|
if (changes.commonFlows?.isFirstChange() || changes.plans?.isFirstChange()) {
|
|
554
687
|
this.selectedFlow = this.flowsGroups[0].flows[0];
|
|
@@ -581,22 +714,20 @@ class GioPolicyStudioComponent {
|
|
|
581
714
|
}
|
|
582
715
|
onSave() {
|
|
583
716
|
// Emit common flows only if they have been updated
|
|
584
|
-
const commonFlows = getCommonFlowsOutput(this.flowsGroups);
|
|
585
|
-
if (commonFlows != null) {
|
|
586
|
-
this.commonFlowsChange.emit(commonFlows);
|
|
587
|
-
}
|
|
717
|
+
const commonFlows = getCommonFlowsOutput(this.flowsGroups, this.initialFlowsGroups);
|
|
588
718
|
// Emit plans only if they have been updated
|
|
589
|
-
const
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
719
|
+
const plansToUpdate = getPlansChangeOutput(this.flowsGroups, this.initialFlowsGroups);
|
|
720
|
+
this.save.emit({
|
|
721
|
+
...(commonFlows ? { commonFlows } : {}),
|
|
722
|
+
...(plansToUpdate ? { plansToUpdate } : {}),
|
|
723
|
+
});
|
|
593
724
|
}
|
|
594
725
|
}
|
|
595
726
|
GioPolicyStudioComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
596
|
-
GioPolicyStudioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioPolicyStudioComponent, selector: "gio-policy-studio", inputs: { apiType: "apiType", entrypointsInfo: "entrypointsInfo", endpointsInfo: "endpointsInfo", commonFlows: "commonFlows", plans: "plans" }, outputs: {
|
|
727
|
+
GioPolicyStudioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioPolicyStudioComponent, selector: "gio-policy-studio", inputs: { apiType: "apiType", entrypointsInfo: "entrypointsInfo", endpointsInfo: "endpointsInfo", commonFlows: "commonFlows", plans: "plans" }, outputs: { save: "save" }, usesOnChanges: true, ngImport: i0, template: "<!--\n\n Copyright (C) 2015 The Gravitee team (http://gravitee.io)\n\n Licensed under the Apache License, Version 2.0 (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 http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n\n<div class=\"header\">\n <div class=\"header__apiInfo\">\n <span class=\"gio-badge-primary\">\n {{ apiType | titlecase }}\n </span>\n <span\n class=\"gio-badge-neutral\"\n [matTooltip]=\"connectorsTooltip\"\n matTooltipPosition=\"right\"\n matTooltipClass=\"gio-policy-studio__tooltip-line-break\"\n >\n <mat-icon *ngFor=\"let entrypoint of entrypointsInfo\" class=\"gio-left\" [svgIcon]=\"entrypoint.icon\"></mat-icon>\n <mat-icon *ngFor=\"let endpoint of endpointsInfo\" class=\"gio-left\" [svgIcon]=\"endpoint.icon\"></mat-icon>\n </span>\n </div>\n\n <div class=\"header__btn\">\n <button mat-stroked-button color=\"primary\" [disabled]=\"disableSaveButton\" (click)=\"onSave()\">Save</button>\n </div>\n</div>\n\n<div class=\"wrapper\">\n <div class=\"wrapper__flowsMenu\">\n <gio-ps-flows-menu\n [apiType]=\"apiType\"\n [flowsGroups]=\"flowsGroups\"\n [entrypoints]=\"entrypointsType\"\n (flowsGroupsChange)=\"onFlowsGroupsChange($event)\"\n [(selectedFlow)]=\"selectedFlow\"\n ></gio-ps-flows-menu>\n </div>\n\n <div class=\"wrapper__flowDetails\">\n <gio-ps-flow-details\n [apiType]=\"apiType\"\n [flow]=\"selectedFlow\"\n [entrypointsInfo]=\"entrypointsInfo\"\n [endpointsInfo]=\"endpointsInfo\"\n (flowChange)=\"onSelectedFlowChange($event)\"\n (deleteFlow)=\"onDeleteSelectedFlow($event)\"\n ></gio-ps-flow-details>\n </div>\n</div>\n", styles: [":host{display:flex;height:100%;flex-direction:column;padding:8px;background-color:#fff}::ng-deep .gio-policy-studio__tooltip-line-break{white-space:pre-line}.header{display:flex;align-items:center;padding-bottom:16px}.header__apiInfo{flex:1 1 auto}.wrapper{display:flex;min-height:0;flex:1 1 auto;flex-direction:row;gap:16px}.wrapper__flowsMenu{overflow:hidden;max-width:400px;flex:1 1 33%;border:1px solid #d3d5dc;border-radius:8px}.wrapper__flowDetails{overflow:hidden;flex:1 1 66%;border:1px solid #d3d5dc;border-radius:8px}\n"], components: [{ type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: GioPolicyStudioFlowsMenuComponent, selector: "gio-ps-flows-menu", inputs: ["apiType", "flowsGroups", "selectedFlow", "entrypoints"], outputs: ["selectedFlowChange", "flowsGroupsChange"] }, { type: GioPolicyStudioDetailsComponent, selector: "gio-ps-flow-details", inputs: ["apiType", "flow", "entrypointsInfo", "endpointsInfo"], outputs: ["flowChange", "deleteFlow"] }], directives: [{ type: i4$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i5$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "titlecase": i5$1.TitleCasePipe } });
|
|
597
728
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioComponent, decorators: [{
|
|
598
729
|
type: Component,
|
|
599
|
-
args: [{ selector: 'gio-policy-studio', template: "<!--\n\n Copyright (C) 2015 The Gravitee team (http://gravitee.io)\n\n Licensed under the Apache License, Version 2.0 (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 http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n\n<div class=\"header\">\n <div class=\"header__apiInfo\">\n <span class=\"gio-badge-primary\">\n {{ apiType | titlecase }}\n </span>\n <span\n class=\"gio-badge-neutral\"\n [matTooltip]=\"connectorsTooltip\"\n matTooltipPosition=\"right\"\n matTooltipClass=\"gio-policy-studio__tooltip-line-break\"\n >\n <mat-icon *ngFor=\"let entrypoint of entrypointsInfo\" class=\"gio-left\" [svgIcon]=\"entrypoint.icon\"></mat-icon>\n <mat-icon *ngFor=\"let endpoint of endpointsInfo\" class=\"gio-left\" [svgIcon]=\"endpoint.icon\"></mat-icon>\n </span>\n </div>\n\n <div class=\"header__btn\">\n <button mat-stroked-button color=\"primary\" [disabled]=\"disableSaveButton\" (click)=\"onSave()\">Save</button>\n </div>\n</div>\n\n<div class=\"wrapper\">\n <div class=\"wrapper__flowsMenu\">\n <gio-ps-flows-menu\n [apiType]=\"apiType\"\n [flowsGroups]=\"flowsGroups\"\n [entrypoints]=\"entrypointsType\"\n (flowsGroupsChange)=\"onFlowsGroupsChange($event)\"\n [(selectedFlow)]=\"selectedFlow\"\n ></gio-ps-flows-menu>\n </div>\n\n <div class=\"wrapper__flowDetails\">\n <gio-ps-flow-details\n [apiType]=\"apiType\"\n [flow]=\"selectedFlow\"\n [
|
|
730
|
+
args: [{ selector: 'gio-policy-studio', template: "<!--\n\n Copyright (C) 2015 The Gravitee team (http://gravitee.io)\n\n Licensed under the Apache License, Version 2.0 (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 http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n\n<div class=\"header\">\n <div class=\"header__apiInfo\">\n <span class=\"gio-badge-primary\">\n {{ apiType | titlecase }}\n </span>\n <span\n class=\"gio-badge-neutral\"\n [matTooltip]=\"connectorsTooltip\"\n matTooltipPosition=\"right\"\n matTooltipClass=\"gio-policy-studio__tooltip-line-break\"\n >\n <mat-icon *ngFor=\"let entrypoint of entrypointsInfo\" class=\"gio-left\" [svgIcon]=\"entrypoint.icon\"></mat-icon>\n <mat-icon *ngFor=\"let endpoint of endpointsInfo\" class=\"gio-left\" [svgIcon]=\"endpoint.icon\"></mat-icon>\n </span>\n </div>\n\n <div class=\"header__btn\">\n <button mat-stroked-button color=\"primary\" [disabled]=\"disableSaveButton\" (click)=\"onSave()\">Save</button>\n </div>\n</div>\n\n<div class=\"wrapper\">\n <div class=\"wrapper__flowsMenu\">\n <gio-ps-flows-menu\n [apiType]=\"apiType\"\n [flowsGroups]=\"flowsGroups\"\n [entrypoints]=\"entrypointsType\"\n (flowsGroupsChange)=\"onFlowsGroupsChange($event)\"\n [(selectedFlow)]=\"selectedFlow\"\n ></gio-ps-flows-menu>\n </div>\n\n <div class=\"wrapper__flowDetails\">\n <gio-ps-flow-details\n [apiType]=\"apiType\"\n [flow]=\"selectedFlow\"\n [entrypointsInfo]=\"entrypointsInfo\"\n [endpointsInfo]=\"endpointsInfo\"\n (flowChange)=\"onSelectedFlowChange($event)\"\n (deleteFlow)=\"onDeleteSelectedFlow($event)\"\n ></gio-ps-flow-details>\n </div>\n</div>\n", styles: [":host{display:flex;height:100%;flex-direction:column;padding:8px;background-color:#fff}::ng-deep .gio-policy-studio__tooltip-line-break{white-space:pre-line}.header{display:flex;align-items:center;padding-bottom:16px}.header__apiInfo{flex:1 1 auto}.wrapper{display:flex;min-height:0;flex:1 1 auto;flex-direction:row;gap:16px}.wrapper__flowsMenu{overflow:hidden;max-width:400px;flex:1 1 33%;border:1px solid #d3d5dc;border-radius:8px}.wrapper__flowDetails{overflow:hidden;flex:1 1 66%;border:1px solid #d3d5dc;border-radius:8px}\n"] }]
|
|
600
731
|
}], propDecorators: { apiType: [{
|
|
601
732
|
type: Input
|
|
602
733
|
}], entrypointsInfo: [{
|
|
@@ -607,9 +738,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
607
738
|
type: Input
|
|
608
739
|
}], plans: [{
|
|
609
740
|
type: Input
|
|
610
|
-
}],
|
|
611
|
-
type: Output
|
|
612
|
-
}], plansToUpdate: [{
|
|
741
|
+
}], save: [{
|
|
613
742
|
type: Output
|
|
614
743
|
}] } });
|
|
615
744
|
const getFlowsGroups = (commonFlows = [], plans = []) => {
|
|
@@ -622,27 +751,76 @@ const getFlowsGroups = (commonFlows = [], plans = []) => {
|
|
|
622
751
|
...plans.map(plan => ({
|
|
623
752
|
_id: uniqueId('flowsGroup_'),
|
|
624
753
|
_icon: 'gio:shield',
|
|
754
|
+
_planId: plan.id,
|
|
625
755
|
name: plan.name,
|
|
626
756
|
flows: plan.flows.map(flow => ({ ...flow, _id: uniqueId('flow_'), _hasChanged: false })),
|
|
627
757
|
})),
|
|
628
758
|
commFlowsGroup,
|
|
629
759
|
];
|
|
630
760
|
};
|
|
631
|
-
const getCommonFlowsOutput = (flowsGroups) => {
|
|
761
|
+
const getCommonFlowsOutput = (flowsGroups, initialFlowsGroups) => {
|
|
632
762
|
const commonFlowsGroup = flowsGroups.find(flowGroup => flowGroup._id === 'flowsGroup_commonFlow');
|
|
763
|
+
const initialCommonFlowsGroup = initialFlowsGroups.find(flowGroup => flowGroup._id === 'flowsGroup_commonFlow');
|
|
764
|
+
// Check if common flows have been updated
|
|
633
765
|
const hasChanged = commonFlowsGroup?.flows.some(flow => flow._hasChanged);
|
|
634
|
-
|
|
766
|
+
// Check if common flows have been deleted
|
|
767
|
+
const hasDeletedFlow = differenceBy(initialCommonFlowsGroup?.flows ?? [], commonFlowsGroup?.flows ?? [], '_id').length > 0;
|
|
768
|
+
return hasChanged || hasDeletedFlow ? (commonFlowsGroup?.flows ?? []).map(flow => omit(flow, '_id', '_hasChanged')) : null;
|
|
635
769
|
};
|
|
636
|
-
const getPlansChangeOutput = (flowsGroups) => {
|
|
637
|
-
const
|
|
638
|
-
const
|
|
639
|
-
|
|
640
|
-
|
|
770
|
+
const getPlansChangeOutput = (flowsGroups, initialFlowsGroups) => {
|
|
771
|
+
const plansGroups = flowsGroups.filter(flowGroup => flowGroup._id !== 'flowsGroup_commonFlow');
|
|
772
|
+
const initialPlansGroups = initialFlowsGroups.filter(flowGroup => flowGroup._id !== 'flowsGroup_commonFlow');
|
|
773
|
+
// Get plans with changed flows
|
|
774
|
+
const plansGroupsWithChangedFlows = plansGroups.filter(plan => plan.flows.some(flow => flow._hasChanged));
|
|
775
|
+
// Get plans with deleted flows
|
|
776
|
+
const plansGroupsWithDeletedFlows = [];
|
|
777
|
+
// Check if there are deleted flows in initial initialPlansGroups
|
|
778
|
+
initialPlansGroups.forEach(plan => {
|
|
779
|
+
const planGroupToCompare = plansGroups.find(p => p._planId === plan._planId);
|
|
780
|
+
if (planGroupToCompare && differenceBy(plan.flows, planGroupToCompare?.flows ?? [], '_id').length > 0) {
|
|
781
|
+
// If there are deleted flows, we need to return the complete plan with the new flows
|
|
782
|
+
plansGroupsWithDeletedFlows.push(planGroupToCompare);
|
|
783
|
+
}
|
|
784
|
+
});
|
|
785
|
+
// Merge plans with changed flows and plans with deleted flows
|
|
786
|
+
const plansWithChangedFlowsOutput = unionBy([...plansGroupsWithChangedFlows, ...plansGroupsWithDeletedFlows], '_planId').map(plan => ({
|
|
787
|
+
...omit(plan, '_id', '_icon', '_planId'),
|
|
788
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- planId is always defined
|
|
789
|
+
id: plan._planId,
|
|
641
790
|
flows: plan.flows.map(flow => omit(flow, '_id', '_hasChanged')),
|
|
642
791
|
}));
|
|
643
792
|
return plansWithChangedFlowsOutput.length > 0 ? plansWithChangedFlowsOutput : null;
|
|
644
793
|
};
|
|
645
794
|
|
|
795
|
+
/*
|
|
796
|
+
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
797
|
+
*
|
|
798
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
799
|
+
* you may not use this file except in compliance with the License.
|
|
800
|
+
* You may obtain a copy of the License at
|
|
801
|
+
*
|
|
802
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
803
|
+
*
|
|
804
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
805
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
806
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
807
|
+
* See the License for the specific language governing permissions and
|
|
808
|
+
* limitations under the License.
|
|
809
|
+
*/
|
|
810
|
+
class GioPolicyStudioDetailsPhasePolicyComponent {
|
|
811
|
+
constructor() {
|
|
812
|
+
this.step = undefined;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
GioPolicyStudioDetailsPhasePolicyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioDetailsPhasePolicyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
816
|
+
GioPolicyStudioDetailsPhasePolicyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioPolicyStudioDetailsPhasePolicyComponent, selector: "gio-ps-flow-details-phase-policy", inputs: { step: "step" }, ngImport: i0, template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (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 http://www.apache.org/licenses/LICENSE-2.0\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\uD83D\uDEA7 Work in progress \uD83D\uDEA7\n", styles: [""] });
|
|
817
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioDetailsPhasePolicyComponent, decorators: [{
|
|
818
|
+
type: Component,
|
|
819
|
+
args: [{ selector: 'gio-ps-flow-details-phase-policy', template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (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 http://www.apache.org/licenses/LICENSE-2.0\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\uD83D\uDEA7 Work in progress \uD83D\uDEA7\n", styles: [""] }]
|
|
820
|
+
}], propDecorators: { step: [{
|
|
821
|
+
type: Input
|
|
822
|
+
}] } });
|
|
823
|
+
|
|
646
824
|
/*
|
|
647
825
|
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
648
826
|
*
|
|
@@ -665,7 +843,10 @@ GioPolicyStudioModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", v
|
|
|
665
843
|
GioPolicyStudioFlowsMenuComponent,
|
|
666
844
|
GioPolicyStudioDetailsComponent,
|
|
667
845
|
GioPolicyStudioFlowMessageFormDialogComponent,
|
|
668
|
-
GioPolicyStudioFlowProxyFormDialogComponent
|
|
846
|
+
GioPolicyStudioFlowProxyFormDialogComponent,
|
|
847
|
+
GioPolicyStudioDetailsInfoBarComponent,
|
|
848
|
+
GioPolicyStudioDetailsPhaseComponent,
|
|
849
|
+
GioPolicyStudioDetailsPhasePolicyComponent], imports: [CommonModule,
|
|
669
850
|
ReactiveFormsModule,
|
|
670
851
|
MatButtonModule,
|
|
671
852
|
MatTooltipModule,
|
|
@@ -673,8 +854,10 @@ GioPolicyStudioModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", v
|
|
|
673
854
|
MatInputModule,
|
|
674
855
|
MatSelectModule,
|
|
675
856
|
MatDialogModule,
|
|
857
|
+
MatTabsModule,
|
|
676
858
|
GioIconsModule,
|
|
677
|
-
GioFormTagsInputModule
|
|
859
|
+
GioFormTagsInputModule,
|
|
860
|
+
GioBannerModule], exports: [GioPolicyStudioComponent] });
|
|
678
861
|
GioPolicyStudioModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioModule, imports: [[
|
|
679
862
|
CommonModule,
|
|
680
863
|
ReactiveFormsModule,
|
|
@@ -684,8 +867,10 @@ GioPolicyStudioModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", v
|
|
|
684
867
|
MatInputModule,
|
|
685
868
|
MatSelectModule,
|
|
686
869
|
MatDialogModule,
|
|
870
|
+
MatTabsModule,
|
|
687
871
|
GioIconsModule,
|
|
688
872
|
GioFormTagsInputModule,
|
|
873
|
+
GioBannerModule,
|
|
689
874
|
]] });
|
|
690
875
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioModule, decorators: [{
|
|
691
876
|
type: NgModule,
|
|
@@ -696,6 +881,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
696
881
|
GioPolicyStudioDetailsComponent,
|
|
697
882
|
GioPolicyStudioFlowMessageFormDialogComponent,
|
|
698
883
|
GioPolicyStudioFlowProxyFormDialogComponent,
|
|
884
|
+
GioPolicyStudioDetailsInfoBarComponent,
|
|
885
|
+
GioPolicyStudioDetailsPhaseComponent,
|
|
886
|
+
GioPolicyStudioDetailsPhasePolicyComponent,
|
|
699
887
|
],
|
|
700
888
|
imports: [
|
|
701
889
|
CommonModule,
|
|
@@ -706,8 +894,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
706
894
|
MatInputModule,
|
|
707
895
|
MatSelectModule,
|
|
708
896
|
MatDialogModule,
|
|
897
|
+
MatTabsModule,
|
|
709
898
|
GioIconsModule,
|
|
710
899
|
GioFormTagsInputModule,
|
|
900
|
+
GioBannerModule,
|
|
711
901
|
],
|
|
712
902
|
exports: [GioPolicyStudioComponent],
|
|
713
903
|
}]
|