@gravitee/ui-policy-studio-angular 9.6.0 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{esm2020 → esm2022}/lib/components/filter-pipe/gio-flter-connectors-by-mode.pipe.mjs +4 -4
- package/{esm2020 → esm2022}/lib/components/flow-details/gio-ps-flow-details.component.mjs +5 -5
- package/{esm2020 → esm2022}/lib/components/flow-details-info-bar/gio-ps-flow-details-info-bar.component.mjs +5 -5
- package/{esm2020 → esm2022}/lib/components/flow-details-phase/gio-ps-flow-details-phase.component.mjs +5 -5
- package/{esm2020 → esm2022}/lib/components/flow-details-phase-step/gio-ps-flow-details-phase-step.component.mjs +5 -5
- package/{esm2020 → esm2022}/lib/components/flow-execution-form-dialog/gio-ps-flow-execution-form-dialog.component.mjs +4 -4
- package/{esm2020 → esm2022}/lib/components/flow-form-dialog/flow-message-form-dialog/gio-ps-flow-message-form-dialog.component.mjs +4 -4
- package/{esm2020 → esm2022}/lib/components/flow-form-dialog/flow-proxy-form-dialog/gio-ps-flow-proxy-form-dialog.component.mjs +4 -4
- package/{esm2020 → esm2022}/lib/components/flows-menu/gio-ps-flows-menu.component.mjs +5 -5
- package/{esm2020 → esm2022}/lib/components/policies-catalog-dialog/gio-ps-policies-catalog-dialog.component.mjs +5 -5
- package/{esm2020 → esm2022}/lib/components/step-edit-dialog/gio-ps-step-edit-dialog.component.mjs +5 -5
- package/{esm2020 → esm2022}/lib/components/step-form/gio-ps-step-form.component.mjs +5 -5
- package/{esm2020 → esm2022}/lib/gio-policy-studio.component.mjs +5 -5
- package/{esm2020 → esm2022}/lib/gio-policy-studio.module.mjs +53 -53
- package/{esm2020 → esm2022}/lib/gio-policy-studio.service.mjs +4 -4
- package/esm2022/testing/lib/components/flow-details/gio-ps-flow-details.harness.mjs +41 -0
- package/esm2022/testing/lib/components/flow-details-info-bar/gio-ps-flow-details-info-bar.harness.mjs +35 -0
- package/esm2022/testing/lib/components/flow-details-phase/gio-ps-flow-details-phase.harness.mjs +126 -0
- package/esm2022/testing/lib/components/flow-details-phase-step/gio-ps-flow-details-phase-step.harness.mjs +50 -0
- package/esm2022/testing/lib/components/flow-execution-form-dialog/gio-ps-flow-execution-form-dialog.harness.mjs +60 -0
- package/esm2022/testing/lib/components/flow-form-dialog/flow-message-form-dialog/gio-ps-flow-message-form-dialog.harness.mjs +128 -0
- package/esm2022/testing/lib/components/flow-form-dialog/flow-proxy-form-dialog/gio-ps-flow-proxy-form-dialog.harness.mjs +98 -0
- package/esm2022/testing/lib/components/flows-menu/gio-ps-flows-menu.harness.mjs +71 -0
- package/esm2022/testing/lib/components/policies-catalog-dialog/gio-ps-policies-catalog-dialog.harness.mjs +87 -0
- package/{esm2020 → esm2022}/testing/lib/components/step-edit-dialog/gio-ps-step-edit-dialog.harness.mjs +2 -2
- package/esm2022/testing/lib/components/step-form/gio-ps-step-form.harness.mjs +49 -0
- package/esm2022/testing/lib/gio-policy-studio.harness.mjs +161 -0
- package/{fesm2020 → fesm2022}/gravitee-ui-policy-studio-angular-testing.mjs +12 -12
- package/{fesm2020 → fesm2022}/gravitee-ui-policy-studio-angular-testing.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/gravitee-ui-policy-studio-angular.mjs +103 -103
- package/{fesm2020 → fesm2022}/gravitee-ui-policy-studio-angular.mjs.map +1 -1
- package/lib/components/flow-details/gio-ps-flow-details.component.d.ts +1 -1
- package/lib/components/flow-details-info-bar/gio-ps-flow-details-info-bar.component.d.ts +1 -1
- package/lib/components/flow-details-phase/gio-ps-flow-details-phase.component.d.ts +1 -1
- package/lib/components/flow-details-phase-step/gio-ps-flow-details-phase-step.component.d.ts +1 -1
- package/lib/components/flows-menu/gio-ps-flows-menu.component.d.ts +1 -1
- package/lib/components/step-form/gio-ps-step-form.component.d.ts +1 -1
- package/lib/gio-policy-studio.component.d.ts +1 -1
- package/package.json +14 -22
- package/esm2020/testing/lib/components/flow-details/gio-ps-flow-details.harness.mjs +0 -41
- package/esm2020/testing/lib/components/flow-details-info-bar/gio-ps-flow-details-info-bar.harness.mjs +0 -35
- package/esm2020/testing/lib/components/flow-details-phase/gio-ps-flow-details-phase.harness.mjs +0 -126
- package/esm2020/testing/lib/components/flow-details-phase-step/gio-ps-flow-details-phase-step.harness.mjs +0 -50
- package/esm2020/testing/lib/components/flow-execution-form-dialog/gio-ps-flow-execution-form-dialog.harness.mjs +0 -60
- package/esm2020/testing/lib/components/flow-form-dialog/flow-message-form-dialog/gio-ps-flow-message-form-dialog.harness.mjs +0 -128
- package/esm2020/testing/lib/components/flow-form-dialog/flow-proxy-form-dialog/gio-ps-flow-proxy-form-dialog.harness.mjs +0 -98
- package/esm2020/testing/lib/components/flows-menu/gio-ps-flows-menu.harness.mjs +0 -71
- package/esm2020/testing/lib/components/policies-catalog-dialog/gio-ps-policies-catalog-dialog.harness.mjs +0 -87
- package/esm2020/testing/lib/components/step-form/gio-ps-step-form.harness.mjs +0 -49
- package/esm2020/testing/lib/gio-policy-studio.harness.mjs +0 -161
- package/fesm2015/gravitee-ui-policy-studio-angular-testing.mjs +0 -1443
- package/fesm2015/gravitee-ui-policy-studio-angular-testing.mjs.map +0 -1
- package/fesm2015/gravitee-ui-policy-studio-angular.mjs +0 -1645
- package/fesm2015/gravitee-ui-policy-studio-angular.mjs.map +0 -1
- /package/{esm2020 → esm2022}/gravitee-ui-policy-studio-angular.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/components/flow-form-dialog/gio-ps-flow-form-dialog-result.model.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/gio-policy-studio.model.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/ConnectorsInfo.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/PolicySchemaFetcher.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/SaveOutput.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/flow/ApiType.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/flow/Flow.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/flow/FlowExecution.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/flow/HttpMethod.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/flow/Selector.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/flow/Step.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/flow/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/plan/Plan.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/plan/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/policy/Policy.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/policy/index.mjs +0 -0
- /package/{esm2020 → esm2022}/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/gravitee-ui-policy-studio-angular-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/ConnectorsInfo.fixture.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/ConnectorsInfo.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/PolicySchemaFetcher.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/SaveOutput.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/flow/ApiType.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/flow/Flow.fixture.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/flow/Flow.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/flow/FlowExecution.fixture.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/flow/FlowExecution.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/flow/HttpMethod.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/flow/Selector.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/flow/Step.fixture.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/flow/Step.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/flow/index-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/flow/index.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/index-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/index.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/plan/Plan.fixture.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/plan/Plan.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/plan/index-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/plan/index.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/policy/Policy.fixture.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/policy/Policy.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/policy/index-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/models/policy/index.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/public-testing-api.mjs +0 -0
|
@@ -1,1645 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Inject, Input, Injectable, EventEmitter, Output, Pipe, NgModule } from '@angular/core';
|
|
3
|
-
import * as i4 from '@angular/material/button';
|
|
4
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
5
|
-
import * as i10 from '@gravitee/ui-particles-angular';
|
|
6
|
-
import { GioFormJsonSchemaComponent, GIO_DIALOG_WIDTH, GioIconsModule, GioFormSlideToggleModule, GioFormTagsInputModule, GioBannerModule, GioFormJsonSchemaModule, GioAsciidoctorModule, GioLoaderModule } from '@gravitee/ui-particles-angular';
|
|
7
|
-
import * as i2 from '@angular/common';
|
|
8
|
-
import { CommonModule } from '@angular/common';
|
|
9
|
-
import * as i4$1 from '@angular/material/tooltip';
|
|
10
|
-
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
11
|
-
import * as i1 from '@angular/material/dialog';
|
|
12
|
-
import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
|
13
|
-
import * as i5 from '@angular/material/form-field';
|
|
14
|
-
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
15
|
-
import * as i6 from '@angular/material/input';
|
|
16
|
-
import { MatInputModule } from '@angular/material/input';
|
|
17
|
-
import * as i7 from '@angular/material/select';
|
|
18
|
-
import { MatSelectModule } from '@angular/material/select';
|
|
19
|
-
import * as i3 from '@angular/forms';
|
|
20
|
-
import { UntypedFormGroup, UntypedFormControl, ReactiveFormsModule } from '@angular/forms';
|
|
21
|
-
import * as i4$3 from '@angular/material/tabs';
|
|
22
|
-
import { MatTabsModule } from '@angular/material/tabs';
|
|
23
|
-
import * as i8$2 from '@angular/material/slide-toggle';
|
|
24
|
-
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
25
|
-
import * as i4$2 from '@angular/material/menu';
|
|
26
|
-
import { MatMenuModule } from '@angular/material/menu';
|
|
27
|
-
import * as i8$1 from '@angular/material/chips';
|
|
28
|
-
import { MatChipsModule } from '@angular/material/chips';
|
|
29
|
-
import { cloneDeep, uniqueId, isEmpty, uniq, toLower, filter, flatten, isEqual, differenceBy, omit, unionBy } from 'lodash';
|
|
30
|
-
import * as i8 from '@angular/material/core';
|
|
31
|
-
import * as i5$1 from '@angular/material/icon';
|
|
32
|
-
import { tap, map, takeUntil, startWith } from 'rxjs/operators';
|
|
33
|
-
import { BehaviorSubject, Subject, EMPTY, timer } from 'rxjs';
|
|
34
|
-
|
|
35
|
-
/*
|
|
36
|
-
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
|
|
37
|
-
*
|
|
38
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
39
|
-
* you may not use this file except in compliance with the License.
|
|
40
|
-
* You may obtain a copy of the License at
|
|
41
|
-
*
|
|
42
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
43
|
-
*
|
|
44
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
45
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
46
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
47
|
-
* See the License for the specific language governing permissions and
|
|
48
|
-
* limitations under the License.
|
|
49
|
-
*/
|
|
50
|
-
const HttpMethods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE', 'OTHER'];
|
|
51
|
-
const toHttpMethod = (value) => {
|
|
52
|
-
switch (value) {
|
|
53
|
-
case 'CONNECT':
|
|
54
|
-
return 'CONNECT';
|
|
55
|
-
case 'DELETE':
|
|
56
|
-
return 'DELETE';
|
|
57
|
-
case 'GET':
|
|
58
|
-
return 'GET';
|
|
59
|
-
case 'HEAD':
|
|
60
|
-
return 'HEAD';
|
|
61
|
-
case 'OPTIONS':
|
|
62
|
-
return 'OPTIONS';
|
|
63
|
-
case 'PATCH':
|
|
64
|
-
return 'PATCH';
|
|
65
|
-
case 'POST':
|
|
66
|
-
return 'POST';
|
|
67
|
-
case 'PUT':
|
|
68
|
-
return 'PUT';
|
|
69
|
-
case 'TRACE':
|
|
70
|
-
return 'TRACE';
|
|
71
|
-
case 'OTHER':
|
|
72
|
-
return 'OTHER';
|
|
73
|
-
default:
|
|
74
|
-
return undefined;
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
/*
|
|
79
|
-
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
80
|
-
*
|
|
81
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
82
|
-
* you may not use this file except in compliance with the License.
|
|
83
|
-
* You may obtain a copy of the License at
|
|
84
|
-
*
|
|
85
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
86
|
-
*
|
|
87
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
88
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
89
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
90
|
-
* See the License for the specific language governing permissions and
|
|
91
|
-
* limitations under the License.
|
|
92
|
-
*/
|
|
93
|
-
|
|
94
|
-
/*
|
|
95
|
-
* Copyright (C) 2023 The Gravitee team (http://gravitee.io)
|
|
96
|
-
*
|
|
97
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
98
|
-
* you may not use this file except in compliance with the License.
|
|
99
|
-
* You may obtain a copy of the License at
|
|
100
|
-
*
|
|
101
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
102
|
-
*
|
|
103
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
104
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
105
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
106
|
-
* See the License for the specific language governing permissions and
|
|
107
|
-
* limitations under the License.
|
|
108
|
-
*/
|
|
109
|
-
|
|
110
|
-
/*
|
|
111
|
-
* Copyright (C) 2023 The Gravitee team (http://gravitee.io)
|
|
112
|
-
*
|
|
113
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
114
|
-
* you may not use this file except in compliance with the License.
|
|
115
|
-
* You may obtain a copy of the License at
|
|
116
|
-
*
|
|
117
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
118
|
-
*
|
|
119
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
120
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
121
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
122
|
-
* See the License for the specific language governing permissions and
|
|
123
|
-
* limitations under the License.
|
|
124
|
-
*/
|
|
125
|
-
|
|
126
|
-
/*
|
|
127
|
-
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
128
|
-
*
|
|
129
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
130
|
-
* you may not use this file except in compliance with the License.
|
|
131
|
-
* You may obtain a copy of the License at
|
|
132
|
-
*
|
|
133
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
134
|
-
*
|
|
135
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
136
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
137
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
138
|
-
* See the License for the specific language governing permissions and
|
|
139
|
-
* limitations under the License.
|
|
140
|
-
*/
|
|
141
|
-
|
|
142
|
-
/*
|
|
143
|
-
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
|
|
144
|
-
*
|
|
145
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
146
|
-
* you may not use this file except in compliance with the License.
|
|
147
|
-
* You may obtain a copy of the License at
|
|
148
|
-
*
|
|
149
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
150
|
-
*
|
|
151
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
152
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
153
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
154
|
-
* See the License for the specific language governing permissions and
|
|
155
|
-
* limitations under the License.
|
|
156
|
-
*/
|
|
157
|
-
class GioPolicyStudioFlowMessageFormDialogComponent {
|
|
158
|
-
constructor(dialogRef, flowDialogData) {
|
|
159
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
160
|
-
this.dialogRef = dialogRef;
|
|
161
|
-
this.entrypoints = [];
|
|
162
|
-
this.mode = 'create';
|
|
163
|
-
this.entrypoints = (_a = flowDialogData === null || flowDialogData === void 0 ? void 0 : flowDialogData.entrypoints) !== null && _a !== void 0 ? _a : [];
|
|
164
|
-
this.existingFlow = cloneDeep(flowDialogData === null || flowDialogData === void 0 ? void 0 : flowDialogData.flow);
|
|
165
|
-
this.mode = this.existingFlow ? 'edit' : 'create';
|
|
166
|
-
const channelSelector = (_c = (_b = flowDialogData === null || flowDialogData === void 0 ? void 0 : flowDialogData.flow) === null || _b === void 0 ? void 0 : _b.selectors) === null || _c === void 0 ? void 0 : _c.find(s => s.type === 'CHANNEL');
|
|
167
|
-
const conditionSelector = (_e = (_d = flowDialogData === null || flowDialogData === void 0 ? void 0 : flowDialogData.flow) === null || _d === void 0 ? void 0 : _d.selectors) === null || _e === void 0 ? void 0 : _e.find(s => s.type === 'CONDITION');
|
|
168
|
-
this.flowFormGroup = new UntypedFormGroup({
|
|
169
|
-
name: new UntypedFormControl((_g = (_f = flowDialogData === null || flowDialogData === void 0 ? void 0 : flowDialogData.flow) === null || _f === void 0 ? void 0 : _f.name) !== null && _g !== void 0 ? _g : ''),
|
|
170
|
-
channelOperator: new UntypedFormControl((_h = channelSelector === null || channelSelector === void 0 ? void 0 : channelSelector.channelOperator) !== null && _h !== void 0 ? _h : 'EQUALS'),
|
|
171
|
-
channel: new UntypedFormControl((_j = channelSelector === null || channelSelector === void 0 ? void 0 : channelSelector.channel) !== null && _j !== void 0 ? _j : ''),
|
|
172
|
-
operations: new UntypedFormControl((_k = channelSelector === null || channelSelector === void 0 ? void 0 : channelSelector.operations) !== null && _k !== void 0 ? _k : []),
|
|
173
|
-
entrypoints: new UntypedFormControl((_l = channelSelector === null || channelSelector === void 0 ? void 0 : channelSelector.entrypoints) !== null && _l !== void 0 ? _l : []),
|
|
174
|
-
condition: new UntypedFormControl((_m = conditionSelector === null || conditionSelector === void 0 ? void 0 : conditionSelector.condition) !== null && _m !== void 0 ? _m : ''),
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
onSubmit() {
|
|
178
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
179
|
-
const channelSelectorToSave = {
|
|
180
|
-
type: 'CHANNEL',
|
|
181
|
-
channel: (_b = (_a = this.flowFormGroup) === null || _a === void 0 ? void 0 : _a.get('channel')) === null || _b === void 0 ? void 0 : _b.value,
|
|
182
|
-
channelOperator: (_d = (_c = this.flowFormGroup) === null || _c === void 0 ? void 0 : _c.get('channelOperator')) === null || _d === void 0 ? void 0 : _d.value,
|
|
183
|
-
operations: (_f = (_e = this.flowFormGroup) === null || _e === void 0 ? void 0 : _e.get('operations')) === null || _f === void 0 ? void 0 : _f.value,
|
|
184
|
-
entrypoints: (_h = (_g = this.flowFormGroup) === null || _g === void 0 ? void 0 : _g.get('entrypoints')) === null || _h === void 0 ? void 0 : _h.value,
|
|
185
|
-
};
|
|
186
|
-
const conditionValue = (_k = (_j = this.flowFormGroup) === null || _j === void 0 ? void 0 : _j.get('condition')) === null || _k === void 0 ? void 0 : _k.value;
|
|
187
|
-
const conditionSelectorToSave = conditionValue
|
|
188
|
-
? {
|
|
189
|
-
type: 'CONDITION',
|
|
190
|
-
condition: conditionValue,
|
|
191
|
-
}
|
|
192
|
-
: undefined;
|
|
193
|
-
const flowToSave = Object.assign(Object.assign({
|
|
194
|
-
// New id for new flow
|
|
195
|
-
_id: uniqueId('flow_') }, this.existingFlow), {
|
|
196
|
-
// Mark as changed
|
|
197
|
-
_hasChanged: true,
|
|
198
|
-
// Add changes
|
|
199
|
-
name: (_m = (_l = this.flowFormGroup) === null || _l === void 0 ? void 0 : _l.get('name')) === null || _m === void 0 ? void 0 : _m.value, selectors: conditionSelectorToSave ? [channelSelectorToSave, conditionSelectorToSave] : [channelSelectorToSave], enabled: true });
|
|
200
|
-
this.dialogRef.close(Object.assign({}, flowToSave));
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
GioPolicyStudioFlowMessageFormDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioFlowMessageFormDialogComponent, deps: [{ token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
204
|
-
GioPolicyStudioFlowMessageFormDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: GioPolicyStudioFlowMessageFormDialogComponent, selector: "gio-ps-flow-message-form-dialog", 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<h2 mat-dialog-title class=\"title\">\n {{ mode === 'create' ? 'Create a new flow' : 'Edit flow'\n }}<button class=\"title__closeBtn\" mat-icon-button aria-label=\"Close dialog\" [mat-dialog-close]=\"false\">\n <mat-icon svgIcon=\"gio:cancel\"></mat-icon>\n </button>\n</h2>\n\n<mat-dialog-content *ngIf=\"flowFormGroup\" class=\"content\" [formGroup]=\"flowFormGroup\">\n <p>Flows allow you to apply different policies per event phases. For example you can reroute calls based on the URL specified.</p>\n\n <div class=\"content__row\">\n <mat-form-field>\n <mat-label>Flow name</mat-label>\n <input matInput formControlName=\"name\" cdkFocusInitial />\n <mat-hint>Names will be automatically generated with channel and operation if left blank.</mat-hint>\n </mat-form-field>\n </div>\n <div class=\"content__row\">\n <mat-form-field>\n <mat-label>Operator</mat-label>\n <mat-select formControlName=\"channelOperator\">\n <mat-option value=\"EQUALS\">Equals</mat-option>\n <mat-option value=\"STARTS_WITH\">Starts with</mat-option>\n </mat-select>\n <mat-hint>Channel operator.</mat-hint>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Channel</mat-label>\n <input matInput formControlName=\"channel\" />\n <mat-hint>Publish or Subscribe channel. This is the path of your request.</mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"content__row\">\n <mat-form-field>\n <mat-label>Entrypoints</mat-label>\n <mat-select multiple formControlName=\"entrypoints\">\n <mat-option *ngFor=\"let entrypoint of entrypoints\" [value]=\"entrypoint.type\">{{ entrypoint.name }}</mat-option>\n </mat-select>\n <mat-hint>Entrypoints where your flow will be executed. They will all be executed if left empty.</mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"content__row\">\n <mat-form-field>\n <mat-label>Entrypoints supported operations</mat-label>\n <mat-select multiple formControlName=\"operations\">\n <mat-option value=\"PUBLISH\">Publish</mat-option>\n <mat-option value=\"SUBSCRIBE\">Subscribe</mat-option>\n </mat-select>\n <mat-hint>They will all be supported if left empty.</mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"content__row\">\n <mat-form-field>\n <mat-label>Condition</mat-label>\n <input matInput formControlName=\"condition\" />\n <mat-hint>Condition to execute the flow, supports Expression Language.</mat-hint>\n </mat-form-field>\n </div>\n</mat-dialog-content>\n\n<mat-dialog-actions class=\"actions\" align=\"end\">\n <button class=\"actions__cancelBtn\" mat-button [mat-dialog-close]=\"false\">Cancel</button>\n <button class=\"actions__saveBtn\" color=\"primary\" mat-flat-button role=\"dialog\" (click)=\"onSubmit()\">\n {{ mode === 'create' ? 'Create' : 'Save' }}\n </button>\n</mat-dialog-actions>\n", styles: [".title__closeBtn{top:0;right:-24px;float:right}.content__row{display:flex;align-items:flex-start;gap:16px}.content__row mat-form-field{flex:1 1 auto}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "component", type: i8.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
205
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioFlowMessageFormDialogComponent, decorators: [{
|
|
206
|
-
type: Component,
|
|
207
|
-
args: [{ selector: 'gio-ps-flow-message-form-dialog', 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<h2 mat-dialog-title class=\"title\">\n {{ mode === 'create' ? 'Create a new flow' : 'Edit flow'\n }}<button class=\"title__closeBtn\" mat-icon-button aria-label=\"Close dialog\" [mat-dialog-close]=\"false\">\n <mat-icon svgIcon=\"gio:cancel\"></mat-icon>\n </button>\n</h2>\n\n<mat-dialog-content *ngIf=\"flowFormGroup\" class=\"content\" [formGroup]=\"flowFormGroup\">\n <p>Flows allow you to apply different policies per event phases. For example you can reroute calls based on the URL specified.</p>\n\n <div class=\"content__row\">\n <mat-form-field>\n <mat-label>Flow name</mat-label>\n <input matInput formControlName=\"name\" cdkFocusInitial />\n <mat-hint>Names will be automatically generated with channel and operation if left blank.</mat-hint>\n </mat-form-field>\n </div>\n <div class=\"content__row\">\n <mat-form-field>\n <mat-label>Operator</mat-label>\n <mat-select formControlName=\"channelOperator\">\n <mat-option value=\"EQUALS\">Equals</mat-option>\n <mat-option value=\"STARTS_WITH\">Starts with</mat-option>\n </mat-select>\n <mat-hint>Channel operator.</mat-hint>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Channel</mat-label>\n <input matInput formControlName=\"channel\" />\n <mat-hint>Publish or Subscribe channel. This is the path of your request.</mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"content__row\">\n <mat-form-field>\n <mat-label>Entrypoints</mat-label>\n <mat-select multiple formControlName=\"entrypoints\">\n <mat-option *ngFor=\"let entrypoint of entrypoints\" [value]=\"entrypoint.type\">{{ entrypoint.name }}</mat-option>\n </mat-select>\n <mat-hint>Entrypoints where your flow will be executed. They will all be executed if left empty.</mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"content__row\">\n <mat-form-field>\n <mat-label>Entrypoints supported operations</mat-label>\n <mat-select multiple formControlName=\"operations\">\n <mat-option value=\"PUBLISH\">Publish</mat-option>\n <mat-option value=\"SUBSCRIBE\">Subscribe</mat-option>\n </mat-select>\n <mat-hint>They will all be supported if left empty.</mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"content__row\">\n <mat-form-field>\n <mat-label>Condition</mat-label>\n <input matInput formControlName=\"condition\" />\n <mat-hint>Condition to execute the flow, supports Expression Language.</mat-hint>\n </mat-form-field>\n </div>\n</mat-dialog-content>\n\n<mat-dialog-actions class=\"actions\" align=\"end\">\n <button class=\"actions__cancelBtn\" mat-button [mat-dialog-close]=\"false\">Cancel</button>\n <button class=\"actions__saveBtn\" color=\"primary\" mat-flat-button role=\"dialog\" (click)=\"onSubmit()\">\n {{ mode === 'create' ? 'Create' : 'Save' }}\n </button>\n</mat-dialog-actions>\n", styles: [".title__closeBtn{top:0;right:-24px;float:right}.content__row{display:flex;align-items:flex-start;gap:16px}.content__row mat-form-field{flex:1 1 auto}\n"] }]
|
|
208
|
-
}], ctorParameters: function () {
|
|
209
|
-
return [{ type: i1.MatDialogRef }, { type: undefined, decorators: [{
|
|
210
|
-
type: Inject,
|
|
211
|
-
args: [MAT_DIALOG_DATA]
|
|
212
|
-
}] }];
|
|
213
|
-
} });
|
|
214
|
-
|
|
215
|
-
/*
|
|
216
|
-
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
|
|
217
|
-
*
|
|
218
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
219
|
-
* you may not use this file except in compliance with the License.
|
|
220
|
-
* You may obtain a copy of the License at
|
|
221
|
-
*
|
|
222
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
223
|
-
*
|
|
224
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
225
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
226
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
227
|
-
* See the License for the specific language governing permissions and
|
|
228
|
-
* limitations under the License.
|
|
229
|
-
*/
|
|
230
|
-
const METHODS_AUTOCOMPLETE = ['ALL', ...HttpMethods];
|
|
231
|
-
class GioPolicyStudioFlowProxyFormDialogComponent {
|
|
232
|
-
constructor(dialogRef, flowDialogData) {
|
|
233
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
234
|
-
this.dialogRef = dialogRef;
|
|
235
|
-
this.mode = 'create';
|
|
236
|
-
this.methods = METHODS_AUTOCOMPLETE;
|
|
237
|
-
this.existingFlow = cloneDeep(flowDialogData === null || flowDialogData === void 0 ? void 0 : flowDialogData.flow);
|
|
238
|
-
this.mode = this.existingFlow ? 'edit' : 'create';
|
|
239
|
-
const httpSelector = (_b = (_a = flowDialogData === null || flowDialogData === void 0 ? void 0 : flowDialogData.flow) === null || _a === void 0 ? void 0 : _a.selectors) === null || _b === void 0 ? void 0 : _b.find(s => s.type === 'HTTP');
|
|
240
|
-
const conditionSelector = (_d = (_c = flowDialogData === null || flowDialogData === void 0 ? void 0 : flowDialogData.flow) === null || _c === void 0 ? void 0 : _c.selectors) === null || _d === void 0 ? void 0 : _d.find(s => s.type === 'CONDITION');
|
|
241
|
-
this.flowFormGroup = new UntypedFormGroup({
|
|
242
|
-
name: new UntypedFormControl((_f = (_e = flowDialogData === null || flowDialogData === void 0 ? void 0 : flowDialogData.flow) === null || _e === void 0 ? void 0 : _e.name) !== null && _f !== void 0 ? _f : ''),
|
|
243
|
-
pathOperator: new UntypedFormControl((_g = httpSelector === null || httpSelector === void 0 ? void 0 : httpSelector.pathOperator) !== null && _g !== void 0 ? _g : 'EQUALS'),
|
|
244
|
-
path: new UntypedFormControl(sanitizePathFormValue(httpSelector === null || httpSelector === void 0 ? void 0 : httpSelector.path)),
|
|
245
|
-
methods: new UntypedFormControl(sanitizeMethodFormValue(httpSelector === null || httpSelector === void 0 ? void 0 : httpSelector.methods)),
|
|
246
|
-
condition: new UntypedFormControl((_h = conditionSelector === null || conditionSelector === void 0 ? void 0 : conditionSelector.condition) !== null && _h !== void 0 ? _h : ''),
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
onSubmit() {
|
|
250
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
251
|
-
const httpSelectorToSave = {
|
|
252
|
-
type: 'HTTP',
|
|
253
|
-
path: sanitizePath((_b = (_a = this.flowFormGroup) === null || _a === void 0 ? void 0 : _a.get('path')) === null || _b === void 0 ? void 0 : _b.value),
|
|
254
|
-
pathOperator: (_d = (_c = this.flowFormGroup) === null || _c === void 0 ? void 0 : _c.get('pathOperator')) === null || _d === void 0 ? void 0 : _d.value,
|
|
255
|
-
methods: sanitizeMethods((_f = (_e = this.flowFormGroup) === null || _e === void 0 ? void 0 : _e.get('methods')) === null || _f === void 0 ? void 0 : _f.value),
|
|
256
|
-
};
|
|
257
|
-
const conditionValue = (_h = (_g = this.flowFormGroup) === null || _g === void 0 ? void 0 : _g.get('condition')) === null || _h === void 0 ? void 0 : _h.value;
|
|
258
|
-
const conditionSelectorToSave = conditionValue
|
|
259
|
-
? {
|
|
260
|
-
type: 'CONDITION',
|
|
261
|
-
condition: conditionValue,
|
|
262
|
-
}
|
|
263
|
-
: undefined;
|
|
264
|
-
const flowToSave = Object.assign(Object.assign({
|
|
265
|
-
// New id for new flow
|
|
266
|
-
_id: uniqueId('flow_') }, this.existingFlow), {
|
|
267
|
-
// Mark as changed
|
|
268
|
-
_hasChanged: true,
|
|
269
|
-
// Add changes
|
|
270
|
-
name: (_k = (_j = this.flowFormGroup) === null || _j === void 0 ? void 0 : _j.get('name')) === null || _k === void 0 ? void 0 : _k.value, selectors: conditionSelectorToSave ? [httpSelectorToSave, conditionSelectorToSave] : [httpSelectorToSave], enabled: true });
|
|
271
|
-
this.dialogRef.close(Object.assign({}, flowToSave));
|
|
272
|
-
}
|
|
273
|
-
tagValidationHook(tag, validationCb) {
|
|
274
|
-
validationCb(METHODS_AUTOCOMPLETE.map(m => `${m}`).includes(tag.toUpperCase()));
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
GioPolicyStudioFlowProxyFormDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioFlowProxyFormDialogComponent, deps: [{ token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
278
|
-
GioPolicyStudioFlowProxyFormDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: GioPolicyStudioFlowProxyFormDialogComponent, selector: "gio-ps-flow-proxy-form-dialog", 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<h2 mat-dialog-title class=\"title\">\n {{ mode === 'create' ? 'Create a new flow' : 'Edit flow' }}\n\n <button class=\"title__closeBtn\" mat-icon-button aria-label=\"Close dialog\" [mat-dialog-close]=\"false\">\n <mat-icon svgIcon=\"gio:cancel\"></mat-icon>\n </button>\n</h2>\n\n<mat-dialog-content *ngIf=\"flowFormGroup\" class=\"content\" [formGroup]=\"flowFormGroup\">\n <p>\n Flows allow you to apply different policies per HTTP path and/or method. For example you can reroute calls based on the URL specified.\n </p>\n\n <div class=\"content__row\">\n <mat-form-field>\n <mat-label>Flow name</mat-label>\n <input matInput formControlName=\"name\" cdkFocusInitial />\n <mat-hint>Names will be automatically generated with path and method if left blank</mat-hint>\n </mat-form-field>\n </div>\n <div class=\"content__row\">\n <mat-form-field>\n <mat-label>Operator</mat-label>\n <mat-select formControlName=\"pathOperator\">\n <mat-option value=\"EQUALS\">Equals</mat-option>\n <mat-option value=\"STARTS_WITH\">Starts with</mat-option>\n </mat-select>\n <mat-hint>Path operator</mat-hint>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Path</mat-label>\n <span matTextPrefix>/</span>\n <input matInput formControlName=\"path\" />\n <mat-hint>Path</mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"content__row\">\n <mat-form-field>\n <mat-label>Methods for your flow</mat-label>\n <gio-form-tags-input\n formControlName=\"methods\"\n [autocompleteOptions]=\"methods\"\n [tagValidationHook]=\"tagValidationHook\"\n ></gio-form-tags-input>\n </mat-form-field>\n </div>\n\n <div class=\"content__row\">\n <mat-form-field>\n <mat-label>Condition</mat-label>\n <input matInput formControlName=\"condition\" />\n <mat-hint>Condition to execute the flow, supports Expression Language</mat-hint>\n </mat-form-field>\n </div>\n</mat-dialog-content>\n\n<mat-dialog-actions class=\"actions\" align=\"end\">\n <button class=\"actions__cancelBtn\" mat-button [mat-dialog-close]=\"false\">Cancel</button>\n <button class=\"actions__saveBtn\" color=\"primary\" mat-flat-button role=\"dialog\" (click)=\"onSubmit()\">\n {{ mode === 'create' ? 'Create' : 'Save' }}\n </button>\n</mat-dialog-actions>\n", styles: [".title__closeBtn{top:0;right:-24px;float:right}.content__row{display:flex;align-items:flex-start;gap:16px}.content__row mat-form-field{flex:1 1 auto}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i5.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "component", type: i8.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i10.GioFormTagsInputComponent, selector: "gio-form-tags-input", inputs: ["aria-label", "addOnBlur", "tagValidationHook", "autocompleteOptions", "displayValueWith", "useAutocompleteOptionValueOnly", "placeholder", "required", "disabled"] }] });
|
|
279
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioFlowProxyFormDialogComponent, decorators: [{
|
|
280
|
-
type: Component,
|
|
281
|
-
args: [{ selector: 'gio-ps-flow-proxy-form-dialog', 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<h2 mat-dialog-title class=\"title\">\n {{ mode === 'create' ? 'Create a new flow' : 'Edit flow' }}\n\n <button class=\"title__closeBtn\" mat-icon-button aria-label=\"Close dialog\" [mat-dialog-close]=\"false\">\n <mat-icon svgIcon=\"gio:cancel\"></mat-icon>\n </button>\n</h2>\n\n<mat-dialog-content *ngIf=\"flowFormGroup\" class=\"content\" [formGroup]=\"flowFormGroup\">\n <p>\n Flows allow you to apply different policies per HTTP path and/or method. For example you can reroute calls based on the URL specified.\n </p>\n\n <div class=\"content__row\">\n <mat-form-field>\n <mat-label>Flow name</mat-label>\n <input matInput formControlName=\"name\" cdkFocusInitial />\n <mat-hint>Names will be automatically generated with path and method if left blank</mat-hint>\n </mat-form-field>\n </div>\n <div class=\"content__row\">\n <mat-form-field>\n <mat-label>Operator</mat-label>\n <mat-select formControlName=\"pathOperator\">\n <mat-option value=\"EQUALS\">Equals</mat-option>\n <mat-option value=\"STARTS_WITH\">Starts with</mat-option>\n </mat-select>\n <mat-hint>Path operator</mat-hint>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Path</mat-label>\n <span matTextPrefix>/</span>\n <input matInput formControlName=\"path\" />\n <mat-hint>Path</mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"content__row\">\n <mat-form-field>\n <mat-label>Methods for your flow</mat-label>\n <gio-form-tags-input\n formControlName=\"methods\"\n [autocompleteOptions]=\"methods\"\n [tagValidationHook]=\"tagValidationHook\"\n ></gio-form-tags-input>\n </mat-form-field>\n </div>\n\n <div class=\"content__row\">\n <mat-form-field>\n <mat-label>Condition</mat-label>\n <input matInput formControlName=\"condition\" />\n <mat-hint>Condition to execute the flow, supports Expression Language</mat-hint>\n </mat-form-field>\n </div>\n</mat-dialog-content>\n\n<mat-dialog-actions class=\"actions\" align=\"end\">\n <button class=\"actions__cancelBtn\" mat-button [mat-dialog-close]=\"false\">Cancel</button>\n <button class=\"actions__saveBtn\" color=\"primary\" mat-flat-button role=\"dialog\" (click)=\"onSubmit()\">\n {{ mode === 'create' ? 'Create' : 'Save' }}\n </button>\n</mat-dialog-actions>\n", styles: [".title__closeBtn{top:0;right:-24px;float:right}.content__row{display:flex;align-items:flex-start;gap:16px}.content__row mat-form-field{flex:1 1 auto}\n"] }]
|
|
282
|
-
}], ctorParameters: function () {
|
|
283
|
-
return [{ type: i1.MatDialogRef }, { type: undefined, decorators: [{
|
|
284
|
-
type: Inject,
|
|
285
|
-
args: [MAT_DIALOG_DATA]
|
|
286
|
-
}] }];
|
|
287
|
-
} });
|
|
288
|
-
const sanitizeMethods = (value) => {
|
|
289
|
-
if (!value || value.find(m => m === 'ALL'))
|
|
290
|
-
return [];
|
|
291
|
-
return value;
|
|
292
|
-
};
|
|
293
|
-
const sanitizeMethodFormValue = (methods) => {
|
|
294
|
-
if (!methods || methods.length === 0)
|
|
295
|
-
return ['ALL'];
|
|
296
|
-
return methods;
|
|
297
|
-
};
|
|
298
|
-
const sanitizePath = (path) => {
|
|
299
|
-
if (!path || !path.startsWith('/')) {
|
|
300
|
-
return `/${path}`;
|
|
301
|
-
}
|
|
302
|
-
return path;
|
|
303
|
-
};
|
|
304
|
-
const sanitizePathFormValue = (path) => {
|
|
305
|
-
if (path && path.startsWith('/')) {
|
|
306
|
-
return path.substring(1);
|
|
307
|
-
}
|
|
308
|
-
return path !== null && path !== void 0 ? path : '';
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
/*
|
|
312
|
-
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
313
|
-
*
|
|
314
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
315
|
-
* you may not use this file except in compliance with the License.
|
|
316
|
-
* You may obtain a copy of the License at
|
|
317
|
-
*
|
|
318
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
319
|
-
*
|
|
320
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
321
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
322
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
323
|
-
* See the License for the specific language governing permissions and
|
|
324
|
-
* limitations under the License.
|
|
325
|
-
*/
|
|
326
|
-
class GioPolicyStudioDetailsInfoBarComponent {
|
|
327
|
-
constructor() {
|
|
328
|
-
this.flow = undefined;
|
|
329
|
-
}
|
|
330
|
-
get condition() {
|
|
331
|
-
var _a, _b;
|
|
332
|
-
const conditionSelector = (_b = (_a = this.flow) === null || _a === void 0 ? void 0 : _a.selectors) === null || _b === void 0 ? void 0 : _b.find(s => s.type === 'CONDITION');
|
|
333
|
-
if (!conditionSelector) {
|
|
334
|
-
return undefined;
|
|
335
|
-
}
|
|
336
|
-
return conditionSelector === null || conditionSelector === void 0 ? void 0 : conditionSelector.condition;
|
|
337
|
-
}
|
|
338
|
-
// MESSAGE API type
|
|
339
|
-
get operations() {
|
|
340
|
-
var _a, _b;
|
|
341
|
-
const channelSelector = (_b = (_a = this.flow) === null || _a === void 0 ? void 0 : _a.selectors) === null || _b === void 0 ? void 0 : _b.find(s => s.type === 'CHANNEL');
|
|
342
|
-
if (!channelSelector) {
|
|
343
|
-
return undefined;
|
|
344
|
-
}
|
|
345
|
-
const operationToBadge = {
|
|
346
|
-
PUBLISH: 'PUB',
|
|
347
|
-
SUBSCRIBE: 'SUB',
|
|
348
|
-
};
|
|
349
|
-
// If no operations are selected, all operations are valid
|
|
350
|
-
const operations = !channelSelector.operations || isEmpty(channelSelector.operations) ? ['PUBLISH', 'SUBSCRIBE'] : channelSelector.operations;
|
|
351
|
-
return operations.map(o => operationToBadge[o]).sort();
|
|
352
|
-
}
|
|
353
|
-
get channel() {
|
|
354
|
-
var _a, _b;
|
|
355
|
-
const channelSelector = (_b = (_a = this.flow) === null || _a === void 0 ? void 0 : _a.selectors) === null || _b === void 0 ? void 0 : _b.find(s => s.type === 'CHANNEL');
|
|
356
|
-
if (!channelSelector) {
|
|
357
|
-
return undefined;
|
|
358
|
-
}
|
|
359
|
-
return channelSelector === null || channelSelector === void 0 ? void 0 : channelSelector.channel;
|
|
360
|
-
}
|
|
361
|
-
get channelOperator() {
|
|
362
|
-
var _a, _b;
|
|
363
|
-
const channelSelector = (_b = (_a = this.flow) === null || _a === void 0 ? void 0 : _a.selectors) === null || _b === void 0 ? void 0 : _b.find(s => s.type === 'CHANNEL');
|
|
364
|
-
if (!channelSelector) {
|
|
365
|
-
return undefined;
|
|
366
|
-
}
|
|
367
|
-
return channelSelector === null || channelSelector === void 0 ? void 0 : channelSelector.channelOperator;
|
|
368
|
-
}
|
|
369
|
-
get entrypoints() {
|
|
370
|
-
var _a, _b, _c;
|
|
371
|
-
const channelSelector = (_b = (_a = this.flow) === null || _a === void 0 ? void 0 : _a.selectors) === null || _b === void 0 ? void 0 : _b.find(s => s.type === 'CHANNEL');
|
|
372
|
-
if (!channelSelector) {
|
|
373
|
-
return undefined;
|
|
374
|
-
}
|
|
375
|
-
return (_c = this.entrypointsInfo) === null || _c === void 0 ? void 0 : _c.filter(e => { var _a;
|
|
376
|
-
// If no entrypoints are selected, all entrypoints are valid
|
|
377
|
-
return !channelSelector.entrypoints || isEmpty(channelSelector.entrypoints) || ((_a = channelSelector.entrypoints) === null || _a === void 0 ? void 0 : _a.includes(e.type)); });
|
|
378
|
-
}
|
|
379
|
-
// PROXY API type
|
|
380
|
-
get path() {
|
|
381
|
-
var _a, _b;
|
|
382
|
-
const httpSelector = (_b = (_a = this.flow) === null || _a === void 0 ? void 0 : _a.selectors) === null || _b === void 0 ? void 0 : _b.find(s => s.type === 'HTTP');
|
|
383
|
-
if (!httpSelector) {
|
|
384
|
-
return undefined;
|
|
385
|
-
}
|
|
386
|
-
return httpSelector === null || httpSelector === void 0 ? void 0 : httpSelector.path;
|
|
387
|
-
}
|
|
388
|
-
get pathOperator() {
|
|
389
|
-
var _a, _b;
|
|
390
|
-
const httpSelector = (_b = (_a = this.flow) === null || _a === void 0 ? void 0 : _a.selectors) === null || _b === void 0 ? void 0 : _b.find(s => s.type === 'HTTP');
|
|
391
|
-
if (!httpSelector) {
|
|
392
|
-
return undefined;
|
|
393
|
-
}
|
|
394
|
-
return httpSelector === null || httpSelector === void 0 ? void 0 : httpSelector.pathOperator;
|
|
395
|
-
}
|
|
396
|
-
get methods() {
|
|
397
|
-
var _a, _b, _c;
|
|
398
|
-
const httpSelector = (_b = (_a = this.flow) === null || _a === void 0 ? void 0 : _a.selectors) === null || _b === void 0 ? void 0 : _b.find(s => s.type === 'HTTP');
|
|
399
|
-
if (!httpSelector) {
|
|
400
|
-
return undefined;
|
|
401
|
-
}
|
|
402
|
-
return ((_c = httpSelector === null || httpSelector === void 0 ? void 0 : httpSelector.methods) === null || _c === void 0 ? void 0 : _c.length)
|
|
403
|
-
? httpSelector === null || httpSelector === void 0 ? void 0 : httpSelector.methods.map(m => ({
|
|
404
|
-
name: m,
|
|
405
|
-
class: `gio-method-badge-${m.toLowerCase()}`,
|
|
406
|
-
}))
|
|
407
|
-
: [
|
|
408
|
-
{
|
|
409
|
-
name: 'ALL',
|
|
410
|
-
class: 'gio-badge-neutral',
|
|
411
|
-
},
|
|
412
|
-
];
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
GioPolicyStudioDetailsInfoBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioDetailsInfoBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
416
|
-
GioPolicyStudioDetailsInfoBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", 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=\"entrypoints\" class=\"info\">\n <span class=\"info__label\">Entrypoints</span>\n <span *ngFor=\"let entrypoint of entrypoints\" class=\"info__value gio-badge gio-badge-neutral\">\n <mat-icon [svgIcon]=\"entrypoint.icon\"></mat-icon>\n {{ entrypoint.name }}</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 method\" [ngClass]=\"method.class\"> {{ method.name }}</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\">{{ condition }}</span>\n</div>\n", styles: [".gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}:host{display:flex;flex-flow:row wrap;padding:16px;gap:12px}.info__label{font-size:14px;font-weight:400;line-height:20px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;color:#606274}.info__value.strong{padding-left:8px;font-size:14px;font-weight:500;line-height:20px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}.info__value.method{width:auto}.info__value.gio-badge mat-icon{margin-right:4px}.info__value.condition{text-transform:none}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
417
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioDetailsInfoBarComponent, decorators: [{
|
|
418
|
-
type: Component,
|
|
419
|
-
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=\"entrypoints\" class=\"info\">\n <span class=\"info__label\">Entrypoints</span>\n <span *ngFor=\"let entrypoint of entrypoints\" class=\"info__value gio-badge gio-badge-neutral\">\n <mat-icon [svgIcon]=\"entrypoint.icon\"></mat-icon>\n {{ entrypoint.name }}</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 method\" [ngClass]=\"method.class\"> {{ method.name }}</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\">{{ condition }}</span>\n</div>\n", styles: [".gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}:host{display:flex;flex-flow:row wrap;padding:16px;gap:12px}.info__label{font-size:14px;font-weight:400;line-height:20px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;color:#606274}.info__value.strong{padding-left:8px;font-size:14px;font-weight:500;line-height:20px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}.info__value.method{width:auto}.info__value.gio-badge mat-icon{margin-right:4px}.info__value.condition{text-transform:none}\n"] }]
|
|
420
|
-
}], propDecorators: { flow: [{
|
|
421
|
-
type: Input
|
|
422
|
-
}], entrypointsInfo: [{
|
|
423
|
-
type: Input
|
|
424
|
-
}] } });
|
|
425
|
-
|
|
426
|
-
/*
|
|
427
|
-
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
428
|
-
*
|
|
429
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
430
|
-
* you may not use this file except in compliance with the License.
|
|
431
|
-
* You may obtain a copy of the License at
|
|
432
|
-
*
|
|
433
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
434
|
-
*
|
|
435
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
436
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
437
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
438
|
-
* See the License for the specific language governing permissions and
|
|
439
|
-
* limitations under the License.
|
|
440
|
-
*/
|
|
441
|
-
class GioPolicyStudioService {
|
|
442
|
-
constructor() {
|
|
443
|
-
this.schemasCache = {};
|
|
444
|
-
this.documentationsCache = {};
|
|
445
|
-
}
|
|
446
|
-
setPolicySchemaFetcher(policySchemaFetcher) {
|
|
447
|
-
this.policySchemaFetcher = policySchemaFetcher;
|
|
448
|
-
}
|
|
449
|
-
setPolicyDocumentationFetcher(policyDocumentationFetcher) {
|
|
450
|
-
this.policyDocumentationFetcher = policyDocumentationFetcher;
|
|
451
|
-
}
|
|
452
|
-
/**
|
|
453
|
-
* Call the policy schema fetcher to get the schema for the given policy. If the
|
|
454
|
-
* schema has already been fetched, it will be returned from the cache.
|
|
455
|
-
*
|
|
456
|
-
* @param policy to get the schema for
|
|
457
|
-
* @returns the schema for the policy
|
|
458
|
-
*/
|
|
459
|
-
getPolicySchema(policy) {
|
|
460
|
-
if (!this.policySchemaFetcher)
|
|
461
|
-
throw new Error('PolicySchemaFetcher not defined!');
|
|
462
|
-
if (this.schemasCache[policy.id]) {
|
|
463
|
-
return this.schemasCache[policy.id].asObservable();
|
|
464
|
-
}
|
|
465
|
-
return this.policySchemaFetcher(policy).pipe(tap(schema => {
|
|
466
|
-
this.schemasCache[policy.id] = new BehaviorSubject(schema);
|
|
467
|
-
}));
|
|
468
|
-
}
|
|
469
|
-
/**
|
|
470
|
-
* Call the policy documentation fetcher to get the documentation for the given policy. If the
|
|
471
|
-
* documentation has already been fetched, it will be returned from the cache.
|
|
472
|
-
*
|
|
473
|
-
* @param policy to get the documentation for
|
|
474
|
-
* @returns the documentation for the policy
|
|
475
|
-
*/
|
|
476
|
-
getPolicyDocumentation(policy) {
|
|
477
|
-
if (!this.policyDocumentationFetcher)
|
|
478
|
-
throw new Error('PolicyDocumentationFetcher not defined!');
|
|
479
|
-
if (this.documentationsCache[policy.id]) {
|
|
480
|
-
return this.documentationsCache[policy.id].asObservable();
|
|
481
|
-
}
|
|
482
|
-
return this.policyDocumentationFetcher(policy).pipe(tap(documentation => {
|
|
483
|
-
this.documentationsCache[policy.id] = new BehaviorSubject(documentation);
|
|
484
|
-
}));
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
GioPolicyStudioService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
488
|
-
GioPolicyStudioService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioService, providedIn: 'root' });
|
|
489
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioService, decorators: [{
|
|
490
|
-
type: Injectable,
|
|
491
|
-
args: [{
|
|
492
|
-
providedIn: 'root',
|
|
493
|
-
}]
|
|
494
|
-
}] });
|
|
495
|
-
|
|
496
|
-
/*
|
|
497
|
-
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
498
|
-
*
|
|
499
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
500
|
-
* you may not use this file except in compliance with the License.
|
|
501
|
-
* You may obtain a copy of the License at
|
|
502
|
-
*
|
|
503
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
504
|
-
*
|
|
505
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
506
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
507
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
508
|
-
* See the License for the specific language governing permissions and
|
|
509
|
-
* limitations under the License.
|
|
510
|
-
*/
|
|
511
|
-
class GioPolicyStudioStepFormComponent {
|
|
512
|
-
constructor(policyStudioService) {
|
|
513
|
-
this.policyStudioService = policyStudioService;
|
|
514
|
-
this.stepChange = new EventEmitter();
|
|
515
|
-
this.isValid = new EventEmitter();
|
|
516
|
-
this.unsubscribe$ = new Subject();
|
|
517
|
-
}
|
|
518
|
-
ngOnChanges(changes) {
|
|
519
|
-
if (changes.policy) {
|
|
520
|
-
this.policySchema$ = this.policyStudioService.getPolicySchema(this.policy).pipe(map(schema => {
|
|
521
|
-
if (GioFormJsonSchemaComponent.isDisplayable(schema)) {
|
|
522
|
-
return schema;
|
|
523
|
-
}
|
|
524
|
-
return {};
|
|
525
|
-
}));
|
|
526
|
-
this.policyDocumentation$ = this.policyStudioService
|
|
527
|
-
.getPolicyDocumentation(this.policy)
|
|
528
|
-
.pipe(map(doc => (isEmpty(doc) ? 'No documentation available.' : doc)));
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
ngOnInit() {
|
|
532
|
-
this.initStepForm();
|
|
533
|
-
}
|
|
534
|
-
ngOnDestroy() {
|
|
535
|
-
this.unsubscribe$.next();
|
|
536
|
-
this.unsubscribe$.complete();
|
|
537
|
-
}
|
|
538
|
-
initStepForm() {
|
|
539
|
-
var _a, _b, _c, _d;
|
|
540
|
-
this.stepForm = new UntypedFormGroup({
|
|
541
|
-
description: new UntypedFormControl((_a = this.step) === null || _a === void 0 ? void 0 : _a.description),
|
|
542
|
-
condition: new UntypedFormControl((_b = this.step) === null || _b === void 0 ? void 0 : _b.condition),
|
|
543
|
-
configuration: new UntypedFormControl((_d = (_c = this.step) === null || _c === void 0 ? void 0 : _c.configuration) !== null && _d !== void 0 ? _d : {}),
|
|
544
|
-
});
|
|
545
|
-
this.stepForm.valueChanges.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
546
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
547
|
-
this.stepChange.emit(Object.assign(Object.assign({}, this.step), { description: (_b = (_a = this.stepForm) === null || _a === void 0 ? void 0 : _a.get('description')) === null || _b === void 0 ? void 0 : _b.value, condition: (_e = (_d = (_c = this.stepForm) === null || _c === void 0 ? void 0 : _c.get('condition')) === null || _d === void 0 ? void 0 : _d.value) !== null && _e !== void 0 ? _e : undefined, configuration: (_g = (_f = this.stepForm) === null || _f === void 0 ? void 0 : _f.get('configuration')) === null || _g === void 0 ? void 0 : _g.value }));
|
|
548
|
-
});
|
|
549
|
-
this.stepForm.statusChanges.pipe(takeUntil(this.unsubscribe$)).subscribe(valid => {
|
|
550
|
-
this.isValid.emit(valid === 'VALID');
|
|
551
|
-
});
|
|
552
|
-
}
|
|
553
|
-
onJsonSchemaReady(isReady) {
|
|
554
|
-
var _a;
|
|
555
|
-
// When ready and if the form is valid, emit
|
|
556
|
-
if (isReady && ((_a = this.stepForm) === null || _a === void 0 ? void 0 : _a.status) === 'VALID') {
|
|
557
|
-
this.isValid.emit(true);
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
GioPolicyStudioStepFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioStepFormComponent, deps: [{ token: GioPolicyStudioService }], target: i0.ɵɵFactoryTarget.Component });
|
|
562
|
-
GioPolicyStudioStepFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: GioPolicyStudioStepFormComponent, selector: "gio-ps-step-form", inputs: { step: "step", policy: "policy" }, outputs: { stepChange: "stepChange", isValid: "isValid" }, 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=\"settings\">\n <div class=\"settings__header\">Settings</div>\n\n <div class=\"settings__content\">\n <ng-container *ngIf=\"stepForm && (policySchema$ | async) as policySchema; else loadingTmpl\" [formGroup]=\"stepForm\">\n <mat-form-field>\n <mat-label>Description</mat-label>\n <textarea matInput formControlName=\"description\" cdkFocusInitial></textarea>\n <mat-hint>Describe how your policy works.</mat-hint>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Trigger condition</mat-label>\n <input matInput formControlName=\"condition\" />\n <mat-hint>The condition to execute this policy. Supports Expression Language.</mat-hint>\n </mat-form-field>\n\n <gio-form-json-schema\n *ngIf=\"policySchema\"\n [jsonSchema]=\"$any(policySchema)\"\n (ready)=\"onJsonSchemaReady($event)\"\n formControlName=\"configuration\"\n ></gio-form-json-schema>\n </ng-container>\n </div>\n</div>\n\n<div class=\"documentation\">\n <div class=\"documentation__header\">Documentation</div>\n\n <div class=\"documentation__content\">\n <ng-container *ngIf=\"policyDocumentation$ | async as policyDocumentation; else loadingTmpl\">\n <gio-asciidoctor [content]=\"policyDocumentation\"></gio-asciidoctor>\n </ng-container>\n </div>\n</div>\n\n<ng-template #loadingTmpl>\n <gio-loader></gio-loader>\n</ng-template>\n", styles: [".gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}:host{display:flex;flex-direction:row;border:1px solid #d3d5dc;border-radius:8px}.settings{display:flex;flex:0 0 50%;flex-direction:column}.settings__header{border-right:1px solid #d3d5dc}.settings__content{display:flex;flex:1 1 auto;flex-direction:column;padding:16px;border-right:1px solid #d3d5dc}.documentation{display:flex;overflow:auto;flex:0 0 50%;flex-direction:column}.documentation__content{overflow:auto;flex:1 1 auto;padding:16px}.settings__header,.documentation__header{padding:16px;border-bottom:1px solid #d3d5dc;font-size:14px;font-weight:500;line-height:20px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i10.GioFormJsonSchemaComponent, selector: "gio-form-json-schema", inputs: ["jsonSchema", "options"], outputs: ["ready"] }, { kind: "component", type: i10.GioAsciidoctorComponent, selector: "gio-asciidoctor", inputs: ["content", "src"] }, { kind: "component", type: i10.GioLoaderComponent, selector: "gio-loader" }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }] });
|
|
563
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioStepFormComponent, decorators: [{
|
|
564
|
-
type: Component,
|
|
565
|
-
args: [{ selector: 'gio-ps-step-form', 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=\"settings\">\n <div class=\"settings__header\">Settings</div>\n\n <div class=\"settings__content\">\n <ng-container *ngIf=\"stepForm && (policySchema$ | async) as policySchema; else loadingTmpl\" [formGroup]=\"stepForm\">\n <mat-form-field>\n <mat-label>Description</mat-label>\n <textarea matInput formControlName=\"description\" cdkFocusInitial></textarea>\n <mat-hint>Describe how your policy works.</mat-hint>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Trigger condition</mat-label>\n <input matInput formControlName=\"condition\" />\n <mat-hint>The condition to execute this policy. Supports Expression Language.</mat-hint>\n </mat-form-field>\n\n <gio-form-json-schema\n *ngIf=\"policySchema\"\n [jsonSchema]=\"$any(policySchema)\"\n (ready)=\"onJsonSchemaReady($event)\"\n formControlName=\"configuration\"\n ></gio-form-json-schema>\n </ng-container>\n </div>\n</div>\n\n<div class=\"documentation\">\n <div class=\"documentation__header\">Documentation</div>\n\n <div class=\"documentation__content\">\n <ng-container *ngIf=\"policyDocumentation$ | async as policyDocumentation; else loadingTmpl\">\n <gio-asciidoctor [content]=\"policyDocumentation\"></gio-asciidoctor>\n </ng-container>\n </div>\n</div>\n\n<ng-template #loadingTmpl>\n <gio-loader></gio-loader>\n</ng-template>\n", styles: [".gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}:host{display:flex;flex-direction:row;border:1px solid #d3d5dc;border-radius:8px}.settings{display:flex;flex:0 0 50%;flex-direction:column}.settings__header{border-right:1px solid #d3d5dc}.settings__content{display:flex;flex:1 1 auto;flex-direction:column;padding:16px;border-right:1px solid #d3d5dc}.documentation{display:flex;overflow:auto;flex:0 0 50%;flex-direction:column}.documentation__content{overflow:auto;flex:1 1 auto;padding:16px}.settings__header,.documentation__header{padding:16px;border-bottom:1px solid #d3d5dc;font-size:14px;font-weight:500;line-height:20px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}\n"] }]
|
|
566
|
-
}], ctorParameters: function () { return [{ type: GioPolicyStudioService }]; }, propDecorators: { step: [{
|
|
567
|
-
type: Input
|
|
568
|
-
}], policy: [{
|
|
569
|
-
type: Input
|
|
570
|
-
}], stepChange: [{
|
|
571
|
-
type: Output
|
|
572
|
-
}], isValid: [{
|
|
573
|
-
type: Output
|
|
574
|
-
}] } });
|
|
575
|
-
|
|
576
|
-
/*
|
|
577
|
-
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
|
|
578
|
-
*
|
|
579
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
580
|
-
* you may not use this file except in compliance with the License.
|
|
581
|
-
* You may obtain a copy of the License at
|
|
582
|
-
*
|
|
583
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
584
|
-
*
|
|
585
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
586
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
587
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
588
|
-
* See the License for the specific language governing permissions and
|
|
589
|
-
* limitations under the License.
|
|
590
|
-
*/
|
|
591
|
-
const executionPhaseLabels = {
|
|
592
|
-
REQUEST: 'Request',
|
|
593
|
-
RESPONSE: 'Response',
|
|
594
|
-
MESSAGE_REQUEST: 'Publish',
|
|
595
|
-
MESSAGE_RESPONSE: 'Subscribe',
|
|
596
|
-
};
|
|
597
|
-
class GioPolicyStudioPoliciesCatalogDialogComponent {
|
|
598
|
-
constructor(dialogRef, flowDialogData) {
|
|
599
|
-
this.dialogRef = dialogRef;
|
|
600
|
-
this.policies = [];
|
|
601
|
-
this.categories = [];
|
|
602
|
-
this.isValid = false;
|
|
603
|
-
this.filtersForm = new UntypedFormGroup({
|
|
604
|
-
categories: new UntypedFormControl([]),
|
|
605
|
-
search: new UntypedFormControl(''),
|
|
606
|
-
});
|
|
607
|
-
this.allPolicies = [];
|
|
608
|
-
this.unsubscribe$ = new Subject();
|
|
609
|
-
this.isUnlicensed = false;
|
|
610
|
-
this.executionPhaseLabel = executionPhaseLabels[flowDialogData.executionPhase];
|
|
611
|
-
this.allPolicies = flowDialogData.policies
|
|
612
|
-
.filter(policy => {
|
|
613
|
-
var _a, _b;
|
|
614
|
-
if (flowDialogData.apiType === 'PROXY') {
|
|
615
|
-
return (_a = policy.proxy) === null || _a === void 0 ? void 0 : _a.includes(flowDialogData.executionPhase);
|
|
616
|
-
}
|
|
617
|
-
return (_b = policy.message) === null || _b === void 0 ? void 0 : _b.includes(flowDialogData.executionPhase);
|
|
618
|
-
})
|
|
619
|
-
.map(policy => {
|
|
620
|
-
var _a;
|
|
621
|
-
return (Object.assign(Object.assign({}, policy), { category: (_a = policy.category) !== null && _a !== void 0 ? _a : 'Others' }));
|
|
622
|
-
});
|
|
623
|
-
this.categories = uniq(this.allPolicies.map(policy => policy.category.toLowerCase())).sort((a, b) => a.localeCompare(b));
|
|
624
|
-
const othersIndex = this.categories.indexOf('others');
|
|
625
|
-
if (othersIndex !== -1) {
|
|
626
|
-
this.categories.push(this.categories.splice(othersIndex, 1)[0]);
|
|
627
|
-
}
|
|
628
|
-
this.filtersForm.valueChanges
|
|
629
|
-
.pipe(startWith(this.filtersForm.value), takeUntil(this.unsubscribe$))
|
|
630
|
-
.subscribe(({ categories, search }) => {
|
|
631
|
-
const selectedCategories = categories && categories.length > 0 ? categories : this.categories;
|
|
632
|
-
this.policies = this.allPolicies
|
|
633
|
-
.filter(policy => {
|
|
634
|
-
return selectedCategories.map(toLower).includes(toLower(policy.category));
|
|
635
|
-
})
|
|
636
|
-
.filter(policy => {
|
|
637
|
-
return search ? toLower(policy.name).includes(toLower(search)) : true;
|
|
638
|
-
});
|
|
639
|
-
});
|
|
640
|
-
this.trialUrl = flowDialogData.trialUrl;
|
|
641
|
-
}
|
|
642
|
-
ngOnDestroy() {
|
|
643
|
-
this.unsubscribe$.next();
|
|
644
|
-
this.unsubscribe$.complete();
|
|
645
|
-
}
|
|
646
|
-
onSelectPolicy(policy) {
|
|
647
|
-
if (policy.deployed === false) {
|
|
648
|
-
this.isUnlicensed = true;
|
|
649
|
-
}
|
|
650
|
-
this.selectedPolicy = policy;
|
|
651
|
-
}
|
|
652
|
-
onStepChange(step) {
|
|
653
|
-
this.stepToAdd = step;
|
|
654
|
-
}
|
|
655
|
-
onIsValid(isValid) {
|
|
656
|
-
this.isValid = isValid;
|
|
657
|
-
}
|
|
658
|
-
onAddPolicy() {
|
|
659
|
-
var _a, _b;
|
|
660
|
-
this.dialogRef.close(Object.assign(Object.assign({}, this.stepToAdd), { name: (_a = this.selectedPolicy) === null || _a === void 0 ? void 0 : _a.name, enabled: true, policy: (_b = this.selectedPolicy) === null || _b === void 0 ? void 0 : _b.id }));
|
|
661
|
-
}
|
|
662
|
-
onGoBack() {
|
|
663
|
-
// Reset to initial value
|
|
664
|
-
this.selectedPolicy = undefined;
|
|
665
|
-
this.isValid = false;
|
|
666
|
-
this.isUnlicensed = false;
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
GioPolicyStudioPoliciesCatalogDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioPoliciesCatalogDialogComponent, deps: [{ token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
670
|
-
GioPolicyStudioPoliciesCatalogDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: GioPolicyStudioPoliciesCatalogDialogComponent, selector: "gio-ps-policies-catalog-dialog", 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<h2 mat-dialog-title class=\"title\">\n Policies for <span class=\"title__phase\">{{ executionPhaseLabel }}</span> phase\n\n <button class=\"title__closeBtn\" mat-icon-button aria-label=\"Close dialog\" [mat-dialog-close]=\"\">\n <mat-icon svgIcon=\"gio:cancel\"></mat-icon>\n </button>\n</h2>\n\n<ng-container>\n <mat-dialog-content *ngIf=\"!selectedPolicy\" class=\"policiesCatalog\">\n <div class=\"policiesCatalog__filters\" [formGroup]=\"filtersForm\">\n <mat-form-field class=\"policiesCatalog__filters__search\" appearance=\"outline\">\n <mat-label>Search</mat-label>\n <input matInput formControlName=\"search\" />\n <button\n matIconSuffix\n mat-icon-button\n aria-label=\"Clear\"\n *ngIf=\"filtersForm.get('search')?.value\"\n (click)=\"filtersForm.get('search')?.setValue('')\"\n >\n <mat-icon svgIcon=\"gio:cancel\"></mat-icon>\n </button>\n </mat-form-field>\n <mat-chip-listbox\n *ngIf=\"categories.length > 1\"\n class=\"policiesCatalog__filters__categories\"\n aria-label=\"Categories selection\"\n multiple\n formControlName=\"categories\"\n >\n <mat-chip-option *ngFor=\"let category of categories\" [selected]=\"category\" [value]=\"category\">{{\n category | titlecase\n }}</mat-chip-option>\n </mat-chip-listbox>\n </div>\n\n <div *ngIf=\"policies.length; else emptyPoliciesTpl\" class=\"policiesCatalog__list\">\n <div *ngFor=\"let policy of policies\" class=\"policiesCatalog__list__policy\">\n <div class=\"policiesCatalog__list__policy__head\">\n <mat-icon class=\"policiesCatalog__list__policy__head__icon\" [svgIcon]=\"policy.icon ?? 'gio:puzzle'\"></mat-icon>\n\n <span *ngIf=\"policy.name\" class=\"policiesCatalog__list__policy__head__name\">{{ policy.name }}</span>\n </div>\n\n <div class=\"policiesCatalog__list__policy__enterprise\" *ngIf=\"policy.deployed === false\">\n <mat-icon\n class=\"policiesCatalog__list__policy__enterprise__lock\"\n [svgIcon]=\"'gio:lock'\"\n matTooltip=\"This policy is only available for users with an enterprise license.\"\n ></mat-icon>\n </div>\n\n <div *ngIf=\"policy.description\" class=\"policiesCatalog__list__policy__description\">{{ policy.description }}</div>\n\n <button class=\"policiesCatalog__list__policy__selectBtn\" mat-stroked-button role=\"dialog\" (click)=\"onSelectPolicy(policy)\">\n Select\n </button>\n </div>\n </div>\n </mat-dialog-content>\n</ng-container>\n\n<ng-template #emptyPoliciesTpl>\n <div class=\"emptyPoliciesCatalog\">No policies available.</div>\n</ng-template>\n\n<mat-dialog-content *ngIf=\"selectedPolicy\" class=\"policyForm\">\n <button class=\"policyForm__goBackBtn\" mat-stroked-button (click)=\"onGoBack()\">\n <mat-icon svgIcon=\"gio:arrow-left\"></mat-icon>\n Go back\n </button>\n\n <gio-banner *ngIf=\"isUnlicensed\" type=\"error\" icon=\"gio:universe\">\n This policy is only available for users with an enterprise license.\n <span gioBannerBody>Request a license to upgrade your account and unlock this policy</span>\n <div gioBannerAction>\n <a *ngIf=\"trialUrl\" mat-stroked-button [href]=\"trialUrl\" target=\"_blank\">Request upgrade</a>\n </div>\n </gio-banner>\n\n <div class=\"policyForm__info\">\n <div class=\"policyForm__info__head\">\n <mat-icon class=\"policyForm__info__head__icon\" [svgIcon]=\"selectedPolicy.icon ?? 'gio:puzzle'\"></mat-icon>\n\n <span *ngIf=\"selectedPolicy.name\" class=\"policyForm__info__head__name\">{{ selectedPolicy.name }}</span>\n </div>\n\n <div *ngIf=\"selectedPolicy.description\" class=\"policyForm__info__description\">{{ selectedPolicy.description }}</div>\n </div>\n\n <gio-ps-step-form [policy]=\"selectedPolicy\" (stepChange)=\"onStepChange($event)\" (isValid)=\"onIsValid($event)\"></gio-ps-step-form>\n</mat-dialog-content>\n\n<mat-dialog-actions class=\"actions\" align=\"end\">\n <button class=\"actions__cancelBtn\" mat-button [mat-dialog-close]=\"\">Cancel</button>\n <button\n *ngIf=\"selectedPolicy\"\n class=\"actions__addBtn\"\n color=\"primary\"\n mat-flat-button\n role=\"dialog\"\n [disabled]=\"!isValid || isUnlicensed\"\n (click)=\"onAddPolicy()\"\n >\n Add policy\n </button>\n</mat-dialog-actions>\n", styles: [".gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}.title__closeBtn{top:0;right:-24px;float:right}.policiesCatalog__filters{display:flex;flex-direction:column;padding:0 0 8px;gap:8px}.policiesCatalog__filters__search{width:100%;height:54px;padding-bottom:0}.policiesCatalog__list{--grid-layout-gap: 16px;--grid-column-count: 3;--grid-item-min-width: 200px;--gap-count: calc(var(--grid-column-count) - 1);--total-gap-width: calc(var(--gap-count) * var(--grid-layout-gap));--grid-item-max-width: calc((100% - var(--total-gap-width)) / var(--grid-column-count));display:grid;grid-gap:var(--grid-layout-gap);grid-template-columns:repeat(auto-fill,minmax(max(var(--grid-item-min-width),var(--grid-item-max-width)),1fr))}.policiesCatalog__list__policy{position:relative;display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;padding:16px;border:1px solid #d3d5dc;border-radius:8px;gap:4px}.policiesCatalog__list__policy__head{display:flex;max-width:95%;align-items:center}.policiesCatalog__list__policy__head__icon{min-width:24px;flex:1 1 24px;margin-right:8px}.policiesCatalog__list__policy__head__name{overflow:hidden;flex:1 1 auto;text-overflow:ellipsis;white-space:nowrap}.policiesCatalog__list__policy__enterprise{position:absolute;top:0;right:0;padding:8px 8px 8px 16px;border-radius:0 8px 0 38px;background:#e7e8ef;color:#6c59bd}.policiesCatalog__list__policy__enterprise__lock{min-width:16px;max-width:16px;color:#6c59bd}.policiesCatalog__list__policy__description{font-size:12px;font-weight:400;line-height:16px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;color:#606274;-webkit-line-clamp:2}.policiesCatalog__list__policy__description:empty{display:none}.policiesCatalog__list__policy__selectBtn{margin-top:8px}.policyForm__goBackBtn{margin:16px 0}.policyForm__info{display:flex;max-width:100%;flex-direction:column;align-items:flex-start;padding-bottom:16px;gap:4px}.policyForm__info__head{display:flex;align-items:center}.policyForm__info__head__icon{min-width:24px;flex:1 1 24px;margin-right:8px}.policyForm__info__head__name{flex:1 1 auto}.policyForm__info__description{font-size:12px;font-weight:400;line-height:16px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#606274}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i8$1.MatChipListbox, selector: "mat-chip-listbox", inputs: ["tabIndex", "multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i8$1.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["color", "disabled", "disableRipple", "tabIndex", "selectable", "selected"], outputs: ["selectionChange"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i10.GioBannerComponent, selector: "gio-banner", inputs: ["type", "icon", "collapsible"] }, { kind: "directive", type: i10.GioBannerBodyDirective, selector: "[gioBannerBody]" }, { kind: "directive", type: i10.GioBannerActionDirective, selector: "[gioBannerAction]" }, { kind: "component", type: GioPolicyStudioStepFormComponent, selector: "gio-ps-step-form", inputs: ["step", "policy"], outputs: ["stepChange", "isValid"] }, { kind: "pipe", type: i2.TitleCasePipe, name: "titlecase" }] });
|
|
671
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioPoliciesCatalogDialogComponent, decorators: [{
|
|
672
|
-
type: Component,
|
|
673
|
-
args: [{ selector: 'gio-ps-policies-catalog-dialog', 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<h2 mat-dialog-title class=\"title\">\n Policies for <span class=\"title__phase\">{{ executionPhaseLabel }}</span> phase\n\n <button class=\"title__closeBtn\" mat-icon-button aria-label=\"Close dialog\" [mat-dialog-close]=\"\">\n <mat-icon svgIcon=\"gio:cancel\"></mat-icon>\n </button>\n</h2>\n\n<ng-container>\n <mat-dialog-content *ngIf=\"!selectedPolicy\" class=\"policiesCatalog\">\n <div class=\"policiesCatalog__filters\" [formGroup]=\"filtersForm\">\n <mat-form-field class=\"policiesCatalog__filters__search\" appearance=\"outline\">\n <mat-label>Search</mat-label>\n <input matInput formControlName=\"search\" />\n <button\n matIconSuffix\n mat-icon-button\n aria-label=\"Clear\"\n *ngIf=\"filtersForm.get('search')?.value\"\n (click)=\"filtersForm.get('search')?.setValue('')\"\n >\n <mat-icon svgIcon=\"gio:cancel\"></mat-icon>\n </button>\n </mat-form-field>\n <mat-chip-listbox\n *ngIf=\"categories.length > 1\"\n class=\"policiesCatalog__filters__categories\"\n aria-label=\"Categories selection\"\n multiple\n formControlName=\"categories\"\n >\n <mat-chip-option *ngFor=\"let category of categories\" [selected]=\"category\" [value]=\"category\">{{\n category | titlecase\n }}</mat-chip-option>\n </mat-chip-listbox>\n </div>\n\n <div *ngIf=\"policies.length; else emptyPoliciesTpl\" class=\"policiesCatalog__list\">\n <div *ngFor=\"let policy of policies\" class=\"policiesCatalog__list__policy\">\n <div class=\"policiesCatalog__list__policy__head\">\n <mat-icon class=\"policiesCatalog__list__policy__head__icon\" [svgIcon]=\"policy.icon ?? 'gio:puzzle'\"></mat-icon>\n\n <span *ngIf=\"policy.name\" class=\"policiesCatalog__list__policy__head__name\">{{ policy.name }}</span>\n </div>\n\n <div class=\"policiesCatalog__list__policy__enterprise\" *ngIf=\"policy.deployed === false\">\n <mat-icon\n class=\"policiesCatalog__list__policy__enterprise__lock\"\n [svgIcon]=\"'gio:lock'\"\n matTooltip=\"This policy is only available for users with an enterprise license.\"\n ></mat-icon>\n </div>\n\n <div *ngIf=\"policy.description\" class=\"policiesCatalog__list__policy__description\">{{ policy.description }}</div>\n\n <button class=\"policiesCatalog__list__policy__selectBtn\" mat-stroked-button role=\"dialog\" (click)=\"onSelectPolicy(policy)\">\n Select\n </button>\n </div>\n </div>\n </mat-dialog-content>\n</ng-container>\n\n<ng-template #emptyPoliciesTpl>\n <div class=\"emptyPoliciesCatalog\">No policies available.</div>\n</ng-template>\n\n<mat-dialog-content *ngIf=\"selectedPolicy\" class=\"policyForm\">\n <button class=\"policyForm__goBackBtn\" mat-stroked-button (click)=\"onGoBack()\">\n <mat-icon svgIcon=\"gio:arrow-left\"></mat-icon>\n Go back\n </button>\n\n <gio-banner *ngIf=\"isUnlicensed\" type=\"error\" icon=\"gio:universe\">\n This policy is only available for users with an enterprise license.\n <span gioBannerBody>Request a license to upgrade your account and unlock this policy</span>\n <div gioBannerAction>\n <a *ngIf=\"trialUrl\" mat-stroked-button [href]=\"trialUrl\" target=\"_blank\">Request upgrade</a>\n </div>\n </gio-banner>\n\n <div class=\"policyForm__info\">\n <div class=\"policyForm__info__head\">\n <mat-icon class=\"policyForm__info__head__icon\" [svgIcon]=\"selectedPolicy.icon ?? 'gio:puzzle'\"></mat-icon>\n\n <span *ngIf=\"selectedPolicy.name\" class=\"policyForm__info__head__name\">{{ selectedPolicy.name }}</span>\n </div>\n\n <div *ngIf=\"selectedPolicy.description\" class=\"policyForm__info__description\">{{ selectedPolicy.description }}</div>\n </div>\n\n <gio-ps-step-form [policy]=\"selectedPolicy\" (stepChange)=\"onStepChange($event)\" (isValid)=\"onIsValid($event)\"></gio-ps-step-form>\n</mat-dialog-content>\n\n<mat-dialog-actions class=\"actions\" align=\"end\">\n <button class=\"actions__cancelBtn\" mat-button [mat-dialog-close]=\"\">Cancel</button>\n <button\n *ngIf=\"selectedPolicy\"\n class=\"actions__addBtn\"\n color=\"primary\"\n mat-flat-button\n role=\"dialog\"\n [disabled]=\"!isValid || isUnlicensed\"\n (click)=\"onAddPolicy()\"\n >\n Add policy\n </button>\n</mat-dialog-actions>\n", styles: [".gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}.title__closeBtn{top:0;right:-24px;float:right}.policiesCatalog__filters{display:flex;flex-direction:column;padding:0 0 8px;gap:8px}.policiesCatalog__filters__search{width:100%;height:54px;padding-bottom:0}.policiesCatalog__list{--grid-layout-gap: 16px;--grid-column-count: 3;--grid-item-min-width: 200px;--gap-count: calc(var(--grid-column-count) - 1);--total-gap-width: calc(var(--gap-count) * var(--grid-layout-gap));--grid-item-max-width: calc((100% - var(--total-gap-width)) / var(--grid-column-count));display:grid;grid-gap:var(--grid-layout-gap);grid-template-columns:repeat(auto-fill,minmax(max(var(--grid-item-min-width),var(--grid-item-max-width)),1fr))}.policiesCatalog__list__policy{position:relative;display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;padding:16px;border:1px solid #d3d5dc;border-radius:8px;gap:4px}.policiesCatalog__list__policy__head{display:flex;max-width:95%;align-items:center}.policiesCatalog__list__policy__head__icon{min-width:24px;flex:1 1 24px;margin-right:8px}.policiesCatalog__list__policy__head__name{overflow:hidden;flex:1 1 auto;text-overflow:ellipsis;white-space:nowrap}.policiesCatalog__list__policy__enterprise{position:absolute;top:0;right:0;padding:8px 8px 8px 16px;border-radius:0 8px 0 38px;background:#e7e8ef;color:#6c59bd}.policiesCatalog__list__policy__enterprise__lock{min-width:16px;max-width:16px;color:#6c59bd}.policiesCatalog__list__policy__description{font-size:12px;font-weight:400;line-height:16px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;color:#606274;-webkit-line-clamp:2}.policiesCatalog__list__policy__description:empty{display:none}.policiesCatalog__list__policy__selectBtn{margin-top:8px}.policyForm__goBackBtn{margin:16px 0}.policyForm__info{display:flex;max-width:100%;flex-direction:column;align-items:flex-start;padding-bottom:16px;gap:4px}.policyForm__info__head{display:flex;align-items:center}.policyForm__info__head__icon{min-width:24px;flex:1 1 24px;margin-right:8px}.policyForm__info__head__name{flex:1 1 auto}.policyForm__info__description{font-size:12px;font-weight:400;line-height:16px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#606274}\n"] }]
|
|
674
|
-
}], ctorParameters: function () {
|
|
675
|
-
return [{ type: i1.MatDialogRef }, { type: undefined, decorators: [{
|
|
676
|
-
type: Inject,
|
|
677
|
-
args: [MAT_DIALOG_DATA]
|
|
678
|
-
}] }];
|
|
679
|
-
} });
|
|
680
|
-
|
|
681
|
-
/*
|
|
682
|
-
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
|
|
683
|
-
*
|
|
684
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
685
|
-
* you may not use this file except in compliance with the License.
|
|
686
|
-
* You may obtain a copy of the License at
|
|
687
|
-
*
|
|
688
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
689
|
-
*
|
|
690
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
691
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
692
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
693
|
-
* See the License for the specific language governing permissions and
|
|
694
|
-
* limitations under the License.
|
|
695
|
-
*/
|
|
696
|
-
class GioPolicyStudioStepEditDialogComponent {
|
|
697
|
-
constructor(dialogRef, flowDialogData) {
|
|
698
|
-
this.dialogRef = dialogRef;
|
|
699
|
-
this.isValid = false;
|
|
700
|
-
this.policy = flowDialogData.policy;
|
|
701
|
-
this.step = flowDialogData.step;
|
|
702
|
-
}
|
|
703
|
-
onSave() {
|
|
704
|
-
this.dialogRef.close(Object.assign({}, this.step));
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
GioPolicyStudioStepEditDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioStepEditDialogComponent, deps: [{ token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
708
|
-
GioPolicyStudioStepEditDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: GioPolicyStudioStepEditDialogComponent, selector: "gio-ps-step-edit-dialog", 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<h2 mat-dialog-title class=\"title\">\n <mat-icon class=\"title__icon\" [svgIcon]=\"policy.icon ?? 'gio:puzzle'\"></mat-icon>\n\n <span *ngIf=\"step.name\" class=\"title__name\">{{ step.name }}</span>\n\n <button class=\"title__closeBtn\" mat-icon-button aria-label=\"Close dialog\" [mat-dialog-close]=\"\">\n <mat-icon svgIcon=\"gio:cancel\"></mat-icon>\n </button>\n\n <div class=\"title__description\">\n {{ policy.description }}\n </div>\n</h2>\n\n<mat-dialog-content class=\"content\">\n <gio-ps-step-form [policy]=\"policy\" [(step)]=\"step\" (isValid)=\"isValid = $event\"></gio-ps-step-form>\n</mat-dialog-content>\n\n<mat-dialog-actions class=\"actions\" align=\"end\">\n <button class=\"actions__cancelBtn\" mat-button [mat-dialog-close]=\"\">Cancel</button>\n <button class=\"actions__saveBtn\" color=\"primary\" mat-flat-button role=\"dialog\" (click)=\"onSave()\" [disabled]=\"!isValid\">Save</button>\n</mat-dialog-actions>\n", styles: [".gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}.title__icon{margin-right:8px}.title__closeBtn{top:0;right:-24px;float:right}.title__description{font-size:12px;font-weight:400;line-height:16px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#606274}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: GioPolicyStudioStepFormComponent, selector: "gio-ps-step-form", inputs: ["step", "policy"], outputs: ["stepChange", "isValid"] }] });
|
|
709
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioStepEditDialogComponent, decorators: [{
|
|
710
|
-
type: Component,
|
|
711
|
-
args: [{ selector: 'gio-ps-step-edit-dialog', 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<h2 mat-dialog-title class=\"title\">\n <mat-icon class=\"title__icon\" [svgIcon]=\"policy.icon ?? 'gio:puzzle'\"></mat-icon>\n\n <span *ngIf=\"step.name\" class=\"title__name\">{{ step.name }}</span>\n\n <button class=\"title__closeBtn\" mat-icon-button aria-label=\"Close dialog\" [mat-dialog-close]=\"\">\n <mat-icon svgIcon=\"gio:cancel\"></mat-icon>\n </button>\n\n <div class=\"title__description\">\n {{ policy.description }}\n </div>\n</h2>\n\n<mat-dialog-content class=\"content\">\n <gio-ps-step-form [policy]=\"policy\" [(step)]=\"step\" (isValid)=\"isValid = $event\"></gio-ps-step-form>\n</mat-dialog-content>\n\n<mat-dialog-actions class=\"actions\" align=\"end\">\n <button class=\"actions__cancelBtn\" mat-button [mat-dialog-close]=\"\">Cancel</button>\n <button class=\"actions__saveBtn\" color=\"primary\" mat-flat-button role=\"dialog\" (click)=\"onSave()\" [disabled]=\"!isValid\">Save</button>\n</mat-dialog-actions>\n", styles: [".gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}.title__icon{margin-right:8px}.title__closeBtn{top:0;right:-24px;float:right}.title__description{font-size:12px;font-weight:400;line-height:16px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#606274}\n"] }]
|
|
712
|
-
}], ctorParameters: function () {
|
|
713
|
-
return [{ type: i1.MatDialogRef }, { type: undefined, decorators: [{
|
|
714
|
-
type: Inject,
|
|
715
|
-
args: [MAT_DIALOG_DATA]
|
|
716
|
-
}] }];
|
|
717
|
-
} });
|
|
718
|
-
|
|
719
|
-
/*
|
|
720
|
-
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
721
|
-
*
|
|
722
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
723
|
-
* you may not use this file except in compliance with the License.
|
|
724
|
-
* You may obtain a copy of the License at
|
|
725
|
-
*
|
|
726
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
727
|
-
*
|
|
728
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
729
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
730
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
731
|
-
* See the License for the specific language governing permissions and
|
|
732
|
-
* limitations under the License.
|
|
733
|
-
*/
|
|
734
|
-
class GioPolicyStudioDetailsPhaseStepComponent {
|
|
735
|
-
constructor(matDialog) {
|
|
736
|
-
this.matDialog = matDialog;
|
|
737
|
-
this.policies = [];
|
|
738
|
-
this.stepChange = new EventEmitter();
|
|
739
|
-
this.deleted = new EventEmitter();
|
|
740
|
-
this.disabled = new EventEmitter();
|
|
741
|
-
}
|
|
742
|
-
ngOnChanges(changes) {
|
|
743
|
-
if (changes.policies || changes.step) {
|
|
744
|
-
this.policy = this.policies.find(policy => policy.id === this.step.policy);
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
onEdit() {
|
|
748
|
-
if (!this.policy) {
|
|
749
|
-
// TODO: Handle UseCase when policy is not found. (Like if the plugin is removed from the BackEnd)
|
|
750
|
-
return;
|
|
751
|
-
}
|
|
752
|
-
this.matDialog
|
|
753
|
-
.open(GioPolicyStudioStepEditDialogComponent, {
|
|
754
|
-
data: {
|
|
755
|
-
policy: this.policy,
|
|
756
|
-
step: this.step,
|
|
757
|
-
},
|
|
758
|
-
role: 'alertdialog',
|
|
759
|
-
id: 'gioPolicyStudioPolicyFormDialog',
|
|
760
|
-
width: GIO_DIALOG_WIDTH.LARGE,
|
|
761
|
-
})
|
|
762
|
-
.afterClosed()
|
|
763
|
-
.subscribe(stepToEdit => {
|
|
764
|
-
if (!stepToEdit) {
|
|
765
|
-
return;
|
|
766
|
-
}
|
|
767
|
-
this.stepChange.emit(stepToEdit);
|
|
768
|
-
});
|
|
769
|
-
}
|
|
770
|
-
onDisable() {
|
|
771
|
-
this.disabled.emit();
|
|
772
|
-
}
|
|
773
|
-
onDelete() {
|
|
774
|
-
this.deleted.emit();
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
GioPolicyStudioDetailsPhaseStepComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioDetailsPhaseStepComponent, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
|
778
|
-
GioPolicyStudioDetailsPhaseStepComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: GioPolicyStudioDetailsPhaseStepComponent, selector: "gio-ps-flow-details-phase-step", inputs: { step: "step", policies: "policies" }, outputs: { stepChange: "stepChange", deleted: "deleted", disabled: "disabled" }, 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=\"info\">\n <div class=\"info__head\">\n <mat-icon class=\"info__head__icon\" [svgIcon]=\"policy?.icon ?? 'gio:puzzle'\"></mat-icon>\n\n <span *ngIf=\"step.name\" class=\"info__head__name\">{{ step.name }}</span>\n </div>\n\n <div *ngIf=\"step.description\" class=\"info__description\">{{ step.description }}</div>\n</div>\n\n<button class=\"menuBtn\" mat-icon-button [matMenuTriggerFor]=\"policyMenu\"><mat-icon svgIcon=\"gio:more-vertical\"></mat-icon></button>\n\n<mat-menu #policyMenu=\"matMenu\">\n <button mat-menu-item (click)=\"onEdit()\">\n <mat-icon svgIcon=\"gio:edit-pencil\"></mat-icon>\n <span>Edit</span>\n </button>\n\n <button mat-menu-item (click)=\"onDisable()\">\n <mat-icon [svgIcon]=\"step.enabled ? 'gio:prohibition' : 'gio:check-circled-outline'\"></mat-icon>\n <span>{{ step.enabled ? 'Disable' : 'Enable' }}</span>\n </button>\n\n <button mat-menu-item (click)=\"onDelete()\">\n <mat-icon svgIcon=\"gio:trash\"></mat-icon>\n <span>Delete</span>\n </button>\n</mat-menu>\n", styles: [".gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}:host{display:flex;align-items:center;padding:8px;border:1px solid #6c59bd;border-radius:8px}:host-context(.disabled){border:1px solid #d3d5dc}.info{display:flex;max-width:300px;flex-direction:column;margin-left:4px;gap:4px}.info__head{display:flex;align-items:center}.info__head__icon{min-width:24px;flex:1 1 24px;margin-right:8px}.info__head__name{overflow:hidden;flex:1 1 auto;text-overflow:ellipsis;white-space:nowrap}.info__description{font-size:12px;font-weight:400;line-height:16px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;color:#606274;-webkit-line-clamp:2}.info__description:empty{display:none}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4$2.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i4$2.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i4$2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
779
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioDetailsPhaseStepComponent, decorators: [{
|
|
780
|
-
type: Component,
|
|
781
|
-
args: [{ selector: 'gio-ps-flow-details-phase-step', 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=\"info\">\n <div class=\"info__head\">\n <mat-icon class=\"info__head__icon\" [svgIcon]=\"policy?.icon ?? 'gio:puzzle'\"></mat-icon>\n\n <span *ngIf=\"step.name\" class=\"info__head__name\">{{ step.name }}</span>\n </div>\n\n <div *ngIf=\"step.description\" class=\"info__description\">{{ step.description }}</div>\n</div>\n\n<button class=\"menuBtn\" mat-icon-button [matMenuTriggerFor]=\"policyMenu\"><mat-icon svgIcon=\"gio:more-vertical\"></mat-icon></button>\n\n<mat-menu #policyMenu=\"matMenu\">\n <button mat-menu-item (click)=\"onEdit()\">\n <mat-icon svgIcon=\"gio:edit-pencil\"></mat-icon>\n <span>Edit</span>\n </button>\n\n <button mat-menu-item (click)=\"onDisable()\">\n <mat-icon [svgIcon]=\"step.enabled ? 'gio:prohibition' : 'gio:check-circled-outline'\"></mat-icon>\n <span>{{ step.enabled ? 'Disable' : 'Enable' }}</span>\n </button>\n\n <button mat-menu-item (click)=\"onDelete()\">\n <mat-icon svgIcon=\"gio:trash\"></mat-icon>\n <span>Delete</span>\n </button>\n</mat-menu>\n", styles: [".gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}:host{display:flex;align-items:center;padding:8px;border:1px solid #6c59bd;border-radius:8px}:host-context(.disabled){border:1px solid #d3d5dc}.info{display:flex;max-width:300px;flex-direction:column;margin-left:4px;gap:4px}.info__head{display:flex;align-items:center}.info__head__icon{min-width:24px;flex:1 1 24px;margin-right:8px}.info__head__name{overflow:hidden;flex:1 1 auto;text-overflow:ellipsis;white-space:nowrap}.info__description{font-size:12px;font-weight:400;line-height:16px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;color:#606274;-webkit-line-clamp:2}.info__description:empty{display:none}\n"] }]
|
|
782
|
-
}], ctorParameters: function () { return [{ type: i1.MatDialog }]; }, propDecorators: { step: [{
|
|
783
|
-
type: Input
|
|
784
|
-
}], policies: [{
|
|
785
|
-
type: Input
|
|
786
|
-
}], stepChange: [{
|
|
787
|
-
type: Output
|
|
788
|
-
}], deleted: [{
|
|
789
|
-
type: Output
|
|
790
|
-
}], disabled: [{
|
|
791
|
-
type: Output
|
|
792
|
-
}] } });
|
|
793
|
-
|
|
794
|
-
/*
|
|
795
|
-
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
796
|
-
*
|
|
797
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
798
|
-
* you may not use this file except in compliance with the License.
|
|
799
|
-
* You may obtain a copy of the License at
|
|
800
|
-
*
|
|
801
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
802
|
-
*
|
|
803
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
804
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
805
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
806
|
-
* See the License for the specific language governing permissions and
|
|
807
|
-
* limitations under the License.
|
|
808
|
-
*/
|
|
809
|
-
class GioPolicyStudioDetailsPhaseComponent {
|
|
810
|
-
constructor(matDialog) {
|
|
811
|
-
this.matDialog = matDialog;
|
|
812
|
-
this.steps = [];
|
|
813
|
-
this.startConnector = [];
|
|
814
|
-
this.endConnector = [];
|
|
815
|
-
this.policies = [];
|
|
816
|
-
this.stepsChange = new EventEmitter();
|
|
817
|
-
this.stepsVM = [];
|
|
818
|
-
this.isDisabled = false;
|
|
819
|
-
}
|
|
820
|
-
ngOnChanges(changes) {
|
|
821
|
-
var _a;
|
|
822
|
-
if (changes.steps || changes.startConnector || changes.endConnector) {
|
|
823
|
-
this.stepsVM = [
|
|
824
|
-
{
|
|
825
|
-
type: 'connectors',
|
|
826
|
-
connectors: this.startConnector.map(connector => ({
|
|
827
|
-
name: connector.name,
|
|
828
|
-
icon: connector.icon,
|
|
829
|
-
})),
|
|
830
|
-
},
|
|
831
|
-
...((_a = this.steps) !== null && _a !== void 0 ? _a : []).map((step, index) => ({
|
|
832
|
-
type: 'step',
|
|
833
|
-
step: step,
|
|
834
|
-
index,
|
|
835
|
-
})),
|
|
836
|
-
{
|
|
837
|
-
type: 'connectors',
|
|
838
|
-
connectors: this.endConnector.map(connector => ({
|
|
839
|
-
name: connector.name,
|
|
840
|
-
icon: connector.icon,
|
|
841
|
-
})),
|
|
842
|
-
},
|
|
843
|
-
];
|
|
844
|
-
// Disable phase if there are no start & end connectors
|
|
845
|
-
this.isDisabled = this.stepsVM.filter(step => step.type === 'connectors' && !isEmpty(step.connectors)).length < 2;
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
onAddPolicy(index) {
|
|
849
|
-
this.matDialog
|
|
850
|
-
.open(GioPolicyStudioPoliciesCatalogDialogComponent, {
|
|
851
|
-
data: {
|
|
852
|
-
policies: this.policies,
|
|
853
|
-
executionPhase: this.policyExecutionPhase,
|
|
854
|
-
apiType: this.apiType,
|
|
855
|
-
trialUrl: this.trialUrl,
|
|
856
|
-
},
|
|
857
|
-
role: 'alertdialog',
|
|
858
|
-
id: 'gioPolicyStudioPoliciesCatalogDialog',
|
|
859
|
-
width: GIO_DIALOG_WIDTH.LARGE,
|
|
860
|
-
})
|
|
861
|
-
.afterClosed()
|
|
862
|
-
.subscribe(stepToAdd => {
|
|
863
|
-
if (!this.steps || !stepToAdd) {
|
|
864
|
-
return;
|
|
865
|
-
}
|
|
866
|
-
// Add Step after the given index
|
|
867
|
-
this.stepsChange.emit([...this.steps.slice(0, index + 1), stepToAdd, ...this.steps.slice(index + 1)]);
|
|
868
|
-
});
|
|
869
|
-
}
|
|
870
|
-
onStepChange(index, stepToEdit) {
|
|
871
|
-
if (!this.steps) {
|
|
872
|
-
return;
|
|
873
|
-
}
|
|
874
|
-
// Replace the step at the given index
|
|
875
|
-
this.stepsChange.emit([...this.steps.slice(0, index), stepToEdit, ...this.steps.slice(index + 1)]);
|
|
876
|
-
}
|
|
877
|
-
onStepDeleted(index) {
|
|
878
|
-
if (!this.steps) {
|
|
879
|
-
return;
|
|
880
|
-
}
|
|
881
|
-
this.stepsChange.emit([...this.steps.slice(0, index), ...this.steps.slice(index + 1)]);
|
|
882
|
-
}
|
|
883
|
-
onStepDisabled(index) {
|
|
884
|
-
if (!this.steps) {
|
|
885
|
-
return;
|
|
886
|
-
}
|
|
887
|
-
this.stepsChange.emit([
|
|
888
|
-
...this.steps.slice(0, index),
|
|
889
|
-
Object.assign(Object.assign({}, this.steps[index]), { enabled: !this.steps[index].enabled }),
|
|
890
|
-
...this.steps.slice(index + 1),
|
|
891
|
-
]);
|
|
892
|
-
}
|
|
893
|
-
}
|
|
894
|
-
GioPolicyStudioDetailsPhaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioDetailsPhaseComponent, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
|
895
|
-
GioPolicyStudioDetailsPhaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: GioPolicyStudioDetailsPhaseComponent, selector: "gio-ps-flow-details-phase", inputs: { steps: "steps", name: "name", description: "description", startConnector: "startConnector", endConnector: "endConnector", apiType: "apiType", policies: "policies", policyExecutionPhase: "policyExecutionPhase", trialUrl: "trialUrl" }, outputs: { stepsChange: "stepsChange" }, 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 <span class=\"header__name\">\n {{ name }}\n </span>\n <span class=\"header__description\">\n {{ description }}\n </span>\n\n <span *ngIf=\"isDisabled\" class=\"header__infoIcon\" matTooltip=\"Policies might not be evaluated\" matTooltipPosition=\"before\">\n <mat-icon svgIcon=\"gio:info\"></mat-icon>\n </span>\n</div>\n\n<div *ngIf=\"!isDisabled; else disabledPhaseContent\" class=\"wrapper\">\n <div class=\"content\">\n <div *ngFor=\"let stepVM of stepsVM; first as isFirst\" class=\"content__step\">\n <!-- Connector -->\n <ng-container *ngIf=\"stepVM.type === 'connectors'\">\n <div class=\"content__step__connector\">\n <span *ngFor=\"let connector of stepVM.connectors\" class=\"gio-badge-white content__step__connector__badge\">\n <mat-icon *ngIf=\"connector.icon\" [svgIcon]=\"connector.icon\" class=\"content__step__connector__badge__icon\"></mat-icon>\n {{ connector.name }}\n </span>\n </div>\n\n <!-- Add policy button after first connector -->\n <ng-container *ngIf=\"isFirst\">\n <mat-icon class=\"content__step__rightArrow\" svgIcon=\"gio:arrow-right\"></mat-icon>\n <button class=\"content__step__addBtn\" mat-button (click)=\"onAddPolicy(-1)\">\n <mat-icon svgIcon=\"gio:plus\"></mat-icon>\n </button>\n <mat-icon class=\"content__step__rightArrow\" svgIcon=\"gio:arrow-right\"></mat-icon>\n </ng-container>\n </ng-container>\n\n <!-- Policy -->\n <ng-container *ngIf=\"stepVM.type === 'step'\">\n <div class=\"content__step__policy\">\n <div *ngIf=\"stepVM.step?.condition\" class=\"content__step__policy__condition\">\n <span class=\"gio-badge-neutral\" [matTooltip]=\"'Condition: ' + stepVM.step.condition\"\n ><mat-icon svgIcon=\"gio:if\"></mat-icon>{{ stepVM.step.condition }}</span\n >\n </div>\n <gio-ps-flow-details-phase-step\n class=\"content__step__step\"\n [class.disabled]=\"!stepVM.step.enabled\"\n [policies]=\"policies\"\n [step]=\"stepVM.step\"\n (stepChange)=\"onStepChange(stepVM.index, $event)\"\n (deleted)=\"onStepDeleted(stepVM.index)\"\n (disabled)=\"onStepDisabled(stepVM.index)\"\n ></gio-ps-flow-details-phase-step>\n </div>\n\n <!-- Add policy button -->\n <mat-icon class=\"content__step__rightArrow\" svgIcon=\"gio:arrow-right\"></mat-icon>\n <button class=\"content__step__addBtn\" mat-button (click)=\"onAddPolicy(stepVM.index)\">\n <mat-icon svgIcon=\"gio:plus\"></mat-icon>\n </button>\n <mat-icon class=\"content__step__rightArrow\" svgIcon=\"gio:arrow-right\"></mat-icon>\n </ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #disabledPhaseContent>\n <div class=\"disabledContent\">\n <gio-banner-warning>\n Policies might not be evaluated\n <span gioBannerBody>\n Your current flow settings are not applicable to this phase. Select supporting endpoints and operations in the flow configuration to\n enable this phase.\n </span>\n </gio-banner-warning>\n </div>\n</ng-template>\n", styles: [".gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}:host{display:flex;overflow:hidden;min-height:215px;flex-direction:column;padding-top:16px;border:1px solid #d3d5dc;border-radius:8px;background-color:#fff}.header{display:flex;padding:0 16px;gap:8px}.header__name{flex:0 1 auto;font-size:14px;font-weight:500;line-height:20px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}.header__description{flex:1 1 auto;font-size:14px;font-weight:400;line-height:20px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;color:#606274}.wrapper{position:relative;flex:1 1 auto;overflow-y:auto}.content{position:absolute;display:flex;width:max-content;height:100%;align-items:center;padding:0 16px}.content__step{display:flex;align-items:center}.content__step__connector{display:flex;flex-direction:column;gap:8px}.content__step__connector__badge{border:1px solid #876fec;border-radius:16px}.content__step__connector__badge__icon{margin-right:4px}.content__step__rightArrow{width:16px;height:16px;margin:0 8px;color:#b4b5bb}.content__step__policy{position:relative;display:flex;flex-direction:row;align-items:center}.content__step__policy__condition{position:absolute;top:-32px;right:0;left:0;display:flex;flex-direction:column}.content__step__policy__condition span{display:inline-block;overflow:hidden;text-overflow:ellipsis;text-transform:none;white-space:nowrap}.content__step__policy__condition span mat-icon{margin-right:4px}.disabledContent{display:flex;flex-direction:column;padding:16px}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i10.GioBannerWarningComponent, selector: "gio-banner-warning" }, { kind: "directive", type: i10.GioBannerBodyDirective, selector: "[gioBannerBody]" }, { kind: "component", type: GioPolicyStudioDetailsPhaseStepComponent, selector: "gio-ps-flow-details-phase-step", inputs: ["step", "policies"], outputs: ["stepChange", "deleted", "disabled"] }] });
|
|
896
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioDetailsPhaseComponent, decorators: [{
|
|
897
|
-
type: Component,
|
|
898
|
-
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\n <span *ngIf=\"isDisabled\" class=\"header__infoIcon\" matTooltip=\"Policies might not be evaluated\" matTooltipPosition=\"before\">\n <mat-icon svgIcon=\"gio:info\"></mat-icon>\n </span>\n</div>\n\n<div *ngIf=\"!isDisabled; else disabledPhaseContent\" class=\"wrapper\">\n <div class=\"content\">\n <div *ngFor=\"let stepVM of stepsVM; first as isFirst\" class=\"content__step\">\n <!-- Connector -->\n <ng-container *ngIf=\"stepVM.type === 'connectors'\">\n <div class=\"content__step__connector\">\n <span *ngFor=\"let connector of stepVM.connectors\" class=\"gio-badge-white content__step__connector__badge\">\n <mat-icon *ngIf=\"connector.icon\" [svgIcon]=\"connector.icon\" class=\"content__step__connector__badge__icon\"></mat-icon>\n {{ connector.name }}\n </span>\n </div>\n\n <!-- Add policy button after first connector -->\n <ng-container *ngIf=\"isFirst\">\n <mat-icon class=\"content__step__rightArrow\" svgIcon=\"gio:arrow-right\"></mat-icon>\n <button class=\"content__step__addBtn\" mat-button (click)=\"onAddPolicy(-1)\">\n <mat-icon svgIcon=\"gio:plus\"></mat-icon>\n </button>\n <mat-icon class=\"content__step__rightArrow\" svgIcon=\"gio:arrow-right\"></mat-icon>\n </ng-container>\n </ng-container>\n\n <!-- Policy -->\n <ng-container *ngIf=\"stepVM.type === 'step'\">\n <div class=\"content__step__policy\">\n <div *ngIf=\"stepVM.step?.condition\" class=\"content__step__policy__condition\">\n <span class=\"gio-badge-neutral\" [matTooltip]=\"'Condition: ' + stepVM.step.condition\"\n ><mat-icon svgIcon=\"gio:if\"></mat-icon>{{ stepVM.step.condition }}</span\n >\n </div>\n <gio-ps-flow-details-phase-step\n class=\"content__step__step\"\n [class.disabled]=\"!stepVM.step.enabled\"\n [policies]=\"policies\"\n [step]=\"stepVM.step\"\n (stepChange)=\"onStepChange(stepVM.index, $event)\"\n (deleted)=\"onStepDeleted(stepVM.index)\"\n (disabled)=\"onStepDisabled(stepVM.index)\"\n ></gio-ps-flow-details-phase-step>\n </div>\n\n <!-- Add policy button -->\n <mat-icon class=\"content__step__rightArrow\" svgIcon=\"gio:arrow-right\"></mat-icon>\n <button class=\"content__step__addBtn\" mat-button (click)=\"onAddPolicy(stepVM.index)\">\n <mat-icon svgIcon=\"gio:plus\"></mat-icon>\n </button>\n <mat-icon class=\"content__step__rightArrow\" svgIcon=\"gio:arrow-right\"></mat-icon>\n </ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #disabledPhaseContent>\n <div class=\"disabledContent\">\n <gio-banner-warning>\n Policies might not be evaluated\n <span gioBannerBody>\n Your current flow settings are not applicable to this phase. Select supporting endpoints and operations in the flow configuration to\n enable this phase.\n </span>\n </gio-banner-warning>\n </div>\n</ng-template>\n", styles: [".gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}:host{display:flex;overflow:hidden;min-height:215px;flex-direction:column;padding-top:16px;border:1px solid #d3d5dc;border-radius:8px;background-color:#fff}.header{display:flex;padding:0 16px;gap:8px}.header__name{flex:0 1 auto;font-size:14px;font-weight:500;line-height:20px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}.header__description{flex:1 1 auto;font-size:14px;font-weight:400;line-height:20px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;color:#606274}.wrapper{position:relative;flex:1 1 auto;overflow-y:auto}.content{position:absolute;display:flex;width:max-content;height:100%;align-items:center;padding:0 16px}.content__step{display:flex;align-items:center}.content__step__connector{display:flex;flex-direction:column;gap:8px}.content__step__connector__badge{border:1px solid #876fec;border-radius:16px}.content__step__connector__badge__icon{margin-right:4px}.content__step__rightArrow{width:16px;height:16px;margin:0 8px;color:#b4b5bb}.content__step__policy{position:relative;display:flex;flex-direction:row;align-items:center}.content__step__policy__condition{position:absolute;top:-32px;right:0;left:0;display:flex;flex-direction:column}.content__step__policy__condition span{display:inline-block;overflow:hidden;text-overflow:ellipsis;text-transform:none;white-space:nowrap}.content__step__policy__condition span mat-icon{margin-right:4px}.disabledContent{display:flex;flex-direction:column;padding:16px}\n"] }]
|
|
899
|
-
}], ctorParameters: function () { return [{ type: i1.MatDialog }]; }, propDecorators: { steps: [{
|
|
900
|
-
type: Input
|
|
901
|
-
}], name: [{
|
|
902
|
-
type: Input
|
|
903
|
-
}], description: [{
|
|
904
|
-
type: Input
|
|
905
|
-
}], startConnector: [{
|
|
906
|
-
type: Input
|
|
907
|
-
}], endConnector: [{
|
|
908
|
-
type: Input
|
|
909
|
-
}], apiType: [{
|
|
910
|
-
type: Input
|
|
911
|
-
}], policies: [{
|
|
912
|
-
type: Input
|
|
913
|
-
}], policyExecutionPhase: [{
|
|
914
|
-
type: Input
|
|
915
|
-
}], trialUrl: [{
|
|
916
|
-
type: Input
|
|
917
|
-
}], stepsChange: [{
|
|
918
|
-
type: Output
|
|
919
|
-
}] } });
|
|
920
|
-
|
|
921
|
-
/*
|
|
922
|
-
* Copyright (C) 2023 The Gravitee team (http://gravitee.io)
|
|
923
|
-
*
|
|
924
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
925
|
-
* you may not use this file except in compliance with the License.
|
|
926
|
-
* You may obtain a copy of the License at
|
|
927
|
-
*
|
|
928
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
929
|
-
*
|
|
930
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
931
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
932
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
933
|
-
* See the License for the specific language governing permissions and
|
|
934
|
-
* limitations under the License.
|
|
935
|
-
*/
|
|
936
|
-
class GioFilterConnectorsByModePipe {
|
|
937
|
-
transform(items, mode, activeModes = []) {
|
|
938
|
-
if (items) {
|
|
939
|
-
if (!mode) {
|
|
940
|
-
return items;
|
|
941
|
-
}
|
|
942
|
-
if (isEmpty(activeModes) || activeModes.includes(mode)) {
|
|
943
|
-
return filter(items, (item) => {
|
|
944
|
-
return item.supportedModes.includes(mode);
|
|
945
|
-
});
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
return [];
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
GioFilterConnectorsByModePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioFilterConnectorsByModePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
952
|
-
GioFilterConnectorsByModePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: GioFilterConnectorsByModePipe, name: "gioFilterConnectorsByMode" });
|
|
953
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioFilterConnectorsByModePipe, decorators: [{
|
|
954
|
-
type: Pipe,
|
|
955
|
-
args: [{
|
|
956
|
-
name: 'gioFilterConnectorsByMode',
|
|
957
|
-
}]
|
|
958
|
-
}] });
|
|
959
|
-
|
|
960
|
-
/*
|
|
961
|
-
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
962
|
-
*
|
|
963
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
964
|
-
* you may not use this file except in compliance with the License.
|
|
965
|
-
* You may obtain a copy of the License at
|
|
966
|
-
*
|
|
967
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
968
|
-
*
|
|
969
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
970
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
971
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
972
|
-
* See the License for the specific language governing permissions and
|
|
973
|
-
* limitations under the License.
|
|
974
|
-
*/
|
|
975
|
-
class GioPolicyStudioDetailsComponent {
|
|
976
|
-
constructor(matDialog) {
|
|
977
|
-
this.matDialog = matDialog;
|
|
978
|
-
this.loading = false;
|
|
979
|
-
this.flow = undefined;
|
|
980
|
-
this.entrypointsInfo = [];
|
|
981
|
-
this.endpointsInfo = [];
|
|
982
|
-
this.policies = [];
|
|
983
|
-
this.flowChange = new EventEmitter();
|
|
984
|
-
this.deleteFlow = new EventEmitter();
|
|
985
|
-
this.messageFlowEntrypointsInfo = [];
|
|
986
|
-
this.operations = [];
|
|
987
|
-
}
|
|
988
|
-
ngOnChanges(changes) {
|
|
989
|
-
var _a, _b, _c, _d, _e;
|
|
990
|
-
if (changes.entrypointsInfo || changes.flow) {
|
|
991
|
-
const channelSelector = (_b = (_a = this.flow) === null || _a === void 0 ? void 0 : _a.selectors) === null || _b === void 0 ? void 0 : _b.find(s => s.type === 'CHANNEL');
|
|
992
|
-
this.operations = (_c = channelSelector === null || channelSelector === void 0 ? void 0 : channelSelector.operations) !== null && _c !== void 0 ? _c : [];
|
|
993
|
-
if (!channelSelector) {
|
|
994
|
-
// If no channel selector found. Keep default value
|
|
995
|
-
this.messageFlowEntrypointsInfo = [];
|
|
996
|
-
return;
|
|
997
|
-
}
|
|
998
|
-
this.messageFlowEntrypointsInfo =
|
|
999
|
-
(_e = (_d = this.entrypointsInfo) === null || _d === void 0 ? void 0 : _d.filter(e => { var _a;
|
|
1000
|
-
// If not entrypoints are defined, all entrypoints are valid
|
|
1001
|
-
return !channelSelector.entrypoints || isEmpty(channelSelector.entrypoints) || ((_a = channelSelector.entrypoints) === null || _a === void 0 ? void 0 : _a.includes(e.type)); })) !== null && _e !== void 0 ? _e : [];
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
onEditFlow() {
|
|
1005
|
-
var _a;
|
|
1006
|
-
const dialogResult = this.apiType === 'MESSAGE'
|
|
1007
|
-
? this.matDialog
|
|
1008
|
-
.open(GioPolicyStudioFlowMessageFormDialogComponent, {
|
|
1009
|
-
data: {
|
|
1010
|
-
flow: this.flow,
|
|
1011
|
-
entrypoints: (_a = this.entrypointsInfo) !== null && _a !== void 0 ? _a : [],
|
|
1012
|
-
},
|
|
1013
|
-
role: 'alertdialog',
|
|
1014
|
-
id: 'gioPsFlowMessageFormDialog',
|
|
1015
|
-
width: GIO_DIALOG_WIDTH.MEDIUM,
|
|
1016
|
-
})
|
|
1017
|
-
.afterClosed()
|
|
1018
|
-
: this.matDialog
|
|
1019
|
-
.open(GioPolicyStudioFlowProxyFormDialogComponent, {
|
|
1020
|
-
data: {
|
|
1021
|
-
flow: this.flow,
|
|
1022
|
-
},
|
|
1023
|
-
role: 'alertdialog',
|
|
1024
|
-
id: 'gioPsFlowProxyFormDialog',
|
|
1025
|
-
width: GIO_DIALOG_WIDTH.MEDIUM,
|
|
1026
|
-
})
|
|
1027
|
-
.afterClosed();
|
|
1028
|
-
dialogResult
|
|
1029
|
-
.pipe(tap(createdOrEdited => {
|
|
1030
|
-
if (!createdOrEdited) {
|
|
1031
|
-
return;
|
|
1032
|
-
}
|
|
1033
|
-
this.flowChange.emit(createdOrEdited);
|
|
1034
|
-
}))
|
|
1035
|
-
.subscribe();
|
|
1036
|
-
}
|
|
1037
|
-
onDeleteFlow() {
|
|
1038
|
-
this.deleteFlow.emit(this.flow);
|
|
1039
|
-
}
|
|
1040
|
-
onStepsChange(flowPhase, steps) {
|
|
1041
|
-
if (!this.flow) {
|
|
1042
|
-
return;
|
|
1043
|
-
}
|
|
1044
|
-
this.flowChange.emit(Object.assign(Object.assign({}, this.flow), { [flowPhase]: steps, _hasChanged: true }));
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
1047
|
-
GioPolicyStudioDetailsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioDetailsComponent, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
|
1048
|
-
GioPolicyStudioDetailsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: GioPolicyStudioDetailsComponent, selector: "gio-ps-flow-details", inputs: { loading: "loading", apiType: "apiType", flow: "flow", entrypointsInfo: "entrypointsInfo", endpointsInfo: "endpointsInfo", policies: "policies", trialUrl: "trialUrl" }, outputs: { flowChange: "flowChange", deleteFlow: "deleteFlow" }, 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<ng-container *ngIf=\"!loading; then flowDetailsTpl; else loadingTpl\"></ng-container>\n\n<ng-template #flowDetailsTpl>\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 (click)=\"onEditFlow()\">\n <mat-icon svgIcon=\"gio:edit-pencil\"></mat-icon>\n </button>\n <button class=\"header__configBtn__delete\" mat-stroked-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 <mat-tab-group *ngIf=\"apiType === 'MESSAGE'\" class=\"content__tabs\" dynamicHeight>\n <mat-tab label=\"Initial connection\" bodyClass=\"content__tabs__body\">\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 [startConnector]=\"messageFlowEntrypointsInfo\"\n [endConnector]=\"endpointsInfo\"\n [steps]=\"flow.request ?? []\"\n [apiType]=\"apiType\"\n [policies]=\"policies\"\n [trialUrl]=\"trialUrl\"\n policyExecutionPhase=\"REQUEST\"\n (stepsChange)=\"onStepsChange('request', $event)\"\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 to the response from the initial connection\"\n [startConnector]=\"endpointsInfo\"\n [endConnector]=\"messageFlowEntrypointsInfo\"\n [steps]=\"flow.response ?? []\"\n [apiType]=\"apiType\"\n [policies]=\"policies\"\n [trialUrl]=\"trialUrl\"\n policyExecutionPhase=\"RESPONSE\"\n (stepsChange)=\"onStepsChange('response', $event)\"\n ></gio-ps-flow-details-phase>\n </mat-tab>\n <mat-tab label=\"Event messages\" bodyClass=\"content__tabs__body\">\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 [startConnector]=\"messageFlowEntrypointsInfo | gioFilterConnectorsByMode : 'PUBLISH' : operations\"\n [endConnector]=\"endpointsInfo | gioFilterConnectorsByMode : 'PUBLISH' : operations\"\n [steps]=\"flow.publish ?? []\"\n [apiType]=\"apiType\"\n [policies]=\"policies\"\n [trialUrl]=\"trialUrl\"\n policyExecutionPhase=\"MESSAGE_REQUEST\"\n (stepsChange)=\"onStepsChange('publish', $event)\"\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 [startConnector]=\"endpointsInfo | gioFilterConnectorsByMode : 'SUBSCRIBE' : operations\"\n [endConnector]=\"messageFlowEntrypointsInfo | gioFilterConnectorsByMode : 'SUBSCRIBE' : operations\"\n [steps]=\"flow.subscribe ?? []\"\n [apiType]=\"apiType\"\n [policies]=\"policies\"\n [trialUrl]=\"trialUrl\"\n policyExecutionPhase=\"MESSAGE_RESPONSE\"\n (stepsChange)=\"onStepsChange('subscribe', $event)\"\n ></gio-ps-flow-details-phase>\n </mat-tab>\n </mat-tab-group>\n\n <ng-container *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 [startConnector]=\"entrypointsInfo | gioFilterConnectorsByMode : 'REQUEST_RESPONSE'\"\n [endConnector]=\"endpointsInfo | gioFilterConnectorsByMode : 'REQUEST_RESPONSE'\"\n [steps]=\"flow.request ?? []\"\n [apiType]=\"apiType\"\n [policies]=\"policies\"\n [trialUrl]=\"trialUrl\"\n policyExecutionPhase=\"REQUEST\"\n (stepsChange)=\"onStepsChange('request', $event)\"\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 [startConnector]=\"endpointsInfo | gioFilterConnectorsByMode : 'REQUEST_RESPONSE'\"\n [endConnector]=\"entrypointsInfo | gioFilterConnectorsByMode : 'REQUEST_RESPONSE'\"\n [steps]=\"flow.response ?? []\"\n [apiType]=\"apiType\"\n [policies]=\"policies\"\n [trialUrl]=\"trialUrl\"\n policyExecutionPhase=\"RESPONSE\"\n (stepsChange)=\"onStepsChange('response', $event)\"\n ></gio-ps-flow-details-phase>\n </ng-container>\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</ng-template>\n\n<ng-template #loadingTpl>\n <div class=\"header loading\">\n <div class=\"header__label\">Flow details</div>\n <div class=\"header__configBtn\">\n <button class=\"header__configBtn__edit\" mat-stroked-button disabled>\n <mat-icon svgIcon=\"gio:edit-pencil\"></mat-icon>\n </button>\n <button class=\"header__configBtn__delete\" mat-stroked-button disabled>\n <mat-icon svgIcon=\"gio:trash\"></mat-icon>\n </button>\n </div>\n </div>\n <gio-ps-flow-details-info-bar class=\"infoBar loading\"></gio-ps-flow-details-info-bar>\n <div class=\"content loading\">\n <gio-loader></gio-loader>\n </div>\n</ng-template>\n", styles: [".gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}:host{display:flex;height:100%;flex-direction:column}.emptyFlows{display:flex;max-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-size:16px;font-weight:500;letter-spacing:.4px;line-height:24px;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}.infoBar.loading{min-height:52px}.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}.content.loading{display:flex}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4$3.MatTab, selector: "mat-tab", inputs: ["disabled"], exportAs: ["matTab"] }, { kind: "component", type: i4$3.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple", "fitInkBarToContent", "mat-stretch-tabs"], exportAs: ["matTabGroup"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i10.GioLoaderComponent, selector: "gio-loader" }, { kind: "component", type: GioPolicyStudioDetailsInfoBarComponent, selector: "gio-ps-flow-details-info-bar", inputs: ["flow", "entrypointsInfo"] }, { kind: "component", type: GioPolicyStudioDetailsPhaseComponent, selector: "gio-ps-flow-details-phase", inputs: ["steps", "name", "description", "startConnector", "endConnector", "apiType", "policies", "policyExecutionPhase", "trialUrl"], outputs: ["stepsChange"] }, { kind: "pipe", type: GioFilterConnectorsByModePipe, name: "gioFilterConnectorsByMode" }] });
|
|
1049
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioDetailsComponent, decorators: [{
|
|
1050
|
-
type: Component,
|
|
1051
|
-
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\n<ng-container *ngIf=\"!loading; then flowDetailsTpl; else loadingTpl\"></ng-container>\n\n<ng-template #flowDetailsTpl>\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 (click)=\"onEditFlow()\">\n <mat-icon svgIcon=\"gio:edit-pencil\"></mat-icon>\n </button>\n <button class=\"header__configBtn__delete\" mat-stroked-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 <mat-tab-group *ngIf=\"apiType === 'MESSAGE'\" class=\"content__tabs\" dynamicHeight>\n <mat-tab label=\"Initial connection\" bodyClass=\"content__tabs__body\">\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 [startConnector]=\"messageFlowEntrypointsInfo\"\n [endConnector]=\"endpointsInfo\"\n [steps]=\"flow.request ?? []\"\n [apiType]=\"apiType\"\n [policies]=\"policies\"\n [trialUrl]=\"trialUrl\"\n policyExecutionPhase=\"REQUEST\"\n (stepsChange)=\"onStepsChange('request', $event)\"\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 to the response from the initial connection\"\n [startConnector]=\"endpointsInfo\"\n [endConnector]=\"messageFlowEntrypointsInfo\"\n [steps]=\"flow.response ?? []\"\n [apiType]=\"apiType\"\n [policies]=\"policies\"\n [trialUrl]=\"trialUrl\"\n policyExecutionPhase=\"RESPONSE\"\n (stepsChange)=\"onStepsChange('response', $event)\"\n ></gio-ps-flow-details-phase>\n </mat-tab>\n <mat-tab label=\"Event messages\" bodyClass=\"content__tabs__body\">\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 [startConnector]=\"messageFlowEntrypointsInfo | gioFilterConnectorsByMode : 'PUBLISH' : operations\"\n [endConnector]=\"endpointsInfo | gioFilterConnectorsByMode : 'PUBLISH' : operations\"\n [steps]=\"flow.publish ?? []\"\n [apiType]=\"apiType\"\n [policies]=\"policies\"\n [trialUrl]=\"trialUrl\"\n policyExecutionPhase=\"MESSAGE_REQUEST\"\n (stepsChange)=\"onStepsChange('publish', $event)\"\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 [startConnector]=\"endpointsInfo | gioFilterConnectorsByMode : 'SUBSCRIBE' : operations\"\n [endConnector]=\"messageFlowEntrypointsInfo | gioFilterConnectorsByMode : 'SUBSCRIBE' : operations\"\n [steps]=\"flow.subscribe ?? []\"\n [apiType]=\"apiType\"\n [policies]=\"policies\"\n [trialUrl]=\"trialUrl\"\n policyExecutionPhase=\"MESSAGE_RESPONSE\"\n (stepsChange)=\"onStepsChange('subscribe', $event)\"\n ></gio-ps-flow-details-phase>\n </mat-tab>\n </mat-tab-group>\n\n <ng-container *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 [startConnector]=\"entrypointsInfo | gioFilterConnectorsByMode : 'REQUEST_RESPONSE'\"\n [endConnector]=\"endpointsInfo | gioFilterConnectorsByMode : 'REQUEST_RESPONSE'\"\n [steps]=\"flow.request ?? []\"\n [apiType]=\"apiType\"\n [policies]=\"policies\"\n [trialUrl]=\"trialUrl\"\n policyExecutionPhase=\"REQUEST\"\n (stepsChange)=\"onStepsChange('request', $event)\"\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 [startConnector]=\"endpointsInfo | gioFilterConnectorsByMode : 'REQUEST_RESPONSE'\"\n [endConnector]=\"entrypointsInfo | gioFilterConnectorsByMode : 'REQUEST_RESPONSE'\"\n [steps]=\"flow.response ?? []\"\n [apiType]=\"apiType\"\n [policies]=\"policies\"\n [trialUrl]=\"trialUrl\"\n policyExecutionPhase=\"RESPONSE\"\n (stepsChange)=\"onStepsChange('response', $event)\"\n ></gio-ps-flow-details-phase>\n </ng-container>\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</ng-template>\n\n<ng-template #loadingTpl>\n <div class=\"header loading\">\n <div class=\"header__label\">Flow details</div>\n <div class=\"header__configBtn\">\n <button class=\"header__configBtn__edit\" mat-stroked-button disabled>\n <mat-icon svgIcon=\"gio:edit-pencil\"></mat-icon>\n </button>\n <button class=\"header__configBtn__delete\" mat-stroked-button disabled>\n <mat-icon svgIcon=\"gio:trash\"></mat-icon>\n </button>\n </div>\n </div>\n <gio-ps-flow-details-info-bar class=\"infoBar loading\"></gio-ps-flow-details-info-bar>\n <div class=\"content loading\">\n <gio-loader></gio-loader>\n </div>\n</ng-template>\n", styles: [".gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}:host{display:flex;height:100%;flex-direction:column}.emptyFlows{display:flex;max-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-size:16px;font-weight:500;letter-spacing:.4px;line-height:24px;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}.infoBar.loading{min-height:52px}.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}.content.loading{display:flex}\n"] }]
|
|
1052
|
-
}], ctorParameters: function () { return [{ type: i1.MatDialog }]; }, propDecorators: { loading: [{
|
|
1053
|
-
type: Input
|
|
1054
|
-
}], apiType: [{
|
|
1055
|
-
type: Input
|
|
1056
|
-
}], flow: [{
|
|
1057
|
-
type: Input
|
|
1058
|
-
}], entrypointsInfo: [{
|
|
1059
|
-
type: Input
|
|
1060
|
-
}], endpointsInfo: [{
|
|
1061
|
-
type: Input
|
|
1062
|
-
}], policies: [{
|
|
1063
|
-
type: Input
|
|
1064
|
-
}], trialUrl: [{
|
|
1065
|
-
type: Input
|
|
1066
|
-
}], flowChange: [{
|
|
1067
|
-
type: Output
|
|
1068
|
-
}], deleteFlow: [{
|
|
1069
|
-
type: Output
|
|
1070
|
-
}] } });
|
|
1071
|
-
|
|
1072
|
-
/*
|
|
1073
|
-
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
|
|
1074
|
-
*
|
|
1075
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1076
|
-
* you may not use this file except in compliance with the License.
|
|
1077
|
-
* You may obtain a copy of the License at
|
|
1078
|
-
*
|
|
1079
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1080
|
-
*
|
|
1081
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1082
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1083
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1084
|
-
* See the License for the specific language governing permissions and
|
|
1085
|
-
* limitations under the License.
|
|
1086
|
-
*/
|
|
1087
|
-
class GioPolicyStudioFlowExecutionFormDialogComponent {
|
|
1088
|
-
constructor(dialogRef, flowDialogData) {
|
|
1089
|
-
var _a, _b, _c, _d;
|
|
1090
|
-
this.dialogRef = dialogRef;
|
|
1091
|
-
this.existingFlowExecution = cloneDeep(flowDialogData === null || flowDialogData === void 0 ? void 0 : flowDialogData.flowExecution);
|
|
1092
|
-
this.flowExecutionFormGroup = new UntypedFormGroup({
|
|
1093
|
-
mode: new UntypedFormControl((_b = (_a = flowDialogData === null || flowDialogData === void 0 ? void 0 : flowDialogData.flowExecution) === null || _a === void 0 ? void 0 : _a.mode) !== null && _b !== void 0 ? _b : 'DEFAULT'),
|
|
1094
|
-
matchRequired: new UntypedFormControl((_d = (_c = flowDialogData === null || flowDialogData === void 0 ? void 0 : flowDialogData.flowExecution) === null || _c === void 0 ? void 0 : _c.matchRequired) !== null && _d !== void 0 ? _d : false),
|
|
1095
|
-
});
|
|
1096
|
-
}
|
|
1097
|
-
onSubmit() {
|
|
1098
|
-
var _a, _b, _c, _d;
|
|
1099
|
-
const flowExecutionToSave = Object.assign(Object.assign({}, this.existingFlowExecution), { mode: (_b = (_a = this.flowExecutionFormGroup) === null || _a === void 0 ? void 0 : _a.get('mode')) === null || _b === void 0 ? void 0 : _b.value, matchRequired: (_d = (_c = this.flowExecutionFormGroup) === null || _c === void 0 ? void 0 : _c.get('matchRequired')) === null || _d === void 0 ? void 0 : _d.value });
|
|
1100
|
-
this.dialogRef.close(Object.assign({}, flowExecutionToSave));
|
|
1101
|
-
}
|
|
1102
|
-
}
|
|
1103
|
-
GioPolicyStudioFlowExecutionFormDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioFlowExecutionFormDialogComponent, deps: [{ token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
1104
|
-
GioPolicyStudioFlowExecutionFormDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: GioPolicyStudioFlowExecutionFormDialogComponent, selector: "gio-ps-flow-execution-form-dialog", 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<h2 mat-dialog-title class=\"title\">\n Flow execution\n\n <button class=\"title__closeBtn\" mat-icon-button aria-label=\"Close dialog\" [mat-dialog-close]=\"\">\n <mat-icon svgIcon=\"gio:cancel\"></mat-icon>\n </button>\n</h2>\n\n<mat-dialog-content *ngIf=\"flowExecutionFormGroup\" class=\"content\" [formGroup]=\"flowExecutionFormGroup\">\n <div class=\"content__row\">\n <gio-banner-info>\n By default, flow selection is based on the operators defined in your flows, either when it \u201Cmatches with\u201D or \u201Cstarts with\u201D a path. You\n can choose the \"Best match\" option to select a flow from the closest path.\n </gio-banner-info>\n </div>\n <div class=\"content__row\">\n <mat-form-field>\n <mat-label>Default flow mode</mat-label>\n <mat-select formControlName=\"mode\">\n <mat-option value=\"BEST_MATCH\">Best Match</mat-option>\n <mat-option value=\"DEFAULT\">Default</mat-option>\n </mat-select>\n <mat-hint>Change how the flow selection is made</mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"content__row\">\n <gio-form-slide-toggle>\n <gio-form-label>Fail on flow mismatch</gio-form-label>\n Respond with an error when requests don\u2019t match any defined flow\n <mat-slide-toggle gioFormSlideToggle formControlName=\"matchRequired\"></mat-slide-toggle>\n </gio-form-slide-toggle>\n </div>\n</mat-dialog-content>\n\n<mat-dialog-actions class=\"actions\" align=\"end\">\n <button class=\"actions__cancelBtn\" mat-button [mat-dialog-close]=\"\">Cancel</button>\n <button class=\"actions__saveBtn\" color=\"primary\" mat-flat-button role=\"dialog\" (click)=\"onSubmit()\">Save</button>\n</mat-dialog-actions>\n", styles: [".title__closeBtn{top:0;right:-24px;float:right}.content__row{display:flex;align-items:flex-start;gap:16px}.content__row mat-form-field{flex:1 1 auto}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "component", type: i8.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i8$2.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matSlideToggle"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i10.GioFormSlideToggleComponent, selector: "gio-form-slide-toggle", inputs: ["appearance"] }, { kind: "component", type: i10.GioFormLabelComponent, selector: "gio-form-label" }, { kind: "directive", type: i10.GioFormSlideToggleDirective, selector: "[gioFormSlideToggle]" }, { kind: "component", type: i10.GioBannerInfoComponent, selector: "gio-banner-info" }] });
|
|
1105
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioFlowExecutionFormDialogComponent, decorators: [{
|
|
1106
|
-
type: Component,
|
|
1107
|
-
args: [{ selector: 'gio-ps-flow-execution-form-dialog', 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<h2 mat-dialog-title class=\"title\">\n Flow execution\n\n <button class=\"title__closeBtn\" mat-icon-button aria-label=\"Close dialog\" [mat-dialog-close]=\"\">\n <mat-icon svgIcon=\"gio:cancel\"></mat-icon>\n </button>\n</h2>\n\n<mat-dialog-content *ngIf=\"flowExecutionFormGroup\" class=\"content\" [formGroup]=\"flowExecutionFormGroup\">\n <div class=\"content__row\">\n <gio-banner-info>\n By default, flow selection is based on the operators defined in your flows, either when it \u201Cmatches with\u201D or \u201Cstarts with\u201D a path. You\n can choose the \"Best match\" option to select a flow from the closest path.\n </gio-banner-info>\n </div>\n <div class=\"content__row\">\n <mat-form-field>\n <mat-label>Default flow mode</mat-label>\n <mat-select formControlName=\"mode\">\n <mat-option value=\"BEST_MATCH\">Best Match</mat-option>\n <mat-option value=\"DEFAULT\">Default</mat-option>\n </mat-select>\n <mat-hint>Change how the flow selection is made</mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"content__row\">\n <gio-form-slide-toggle>\n <gio-form-label>Fail on flow mismatch</gio-form-label>\n Respond with an error when requests don\u2019t match any defined flow\n <mat-slide-toggle gioFormSlideToggle formControlName=\"matchRequired\"></mat-slide-toggle>\n </gio-form-slide-toggle>\n </div>\n</mat-dialog-content>\n\n<mat-dialog-actions class=\"actions\" align=\"end\">\n <button class=\"actions__cancelBtn\" mat-button [mat-dialog-close]=\"\">Cancel</button>\n <button class=\"actions__saveBtn\" color=\"primary\" mat-flat-button role=\"dialog\" (click)=\"onSubmit()\">Save</button>\n</mat-dialog-actions>\n", styles: [".title__closeBtn{top:0;right:-24px;float:right}.content__row{display:flex;align-items:flex-start;gap:16px}.content__row mat-form-field{flex:1 1 auto}\n"] }]
|
|
1108
|
-
}], ctorParameters: function () {
|
|
1109
|
-
return [{ type: i1.MatDialogRef }, { type: undefined, decorators: [{
|
|
1110
|
-
type: Inject,
|
|
1111
|
-
args: [MAT_DIALOG_DATA]
|
|
1112
|
-
}] }];
|
|
1113
|
-
} });
|
|
1114
|
-
|
|
1115
|
-
/*
|
|
1116
|
-
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
1117
|
-
*
|
|
1118
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1119
|
-
* you may not use this file except in compliance with the License.
|
|
1120
|
-
* You may obtain a copy of the License at
|
|
1121
|
-
*
|
|
1122
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1123
|
-
*
|
|
1124
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1125
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1126
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1127
|
-
* See the License for the specific language governing permissions and
|
|
1128
|
-
* limitations under the License.
|
|
1129
|
-
*/
|
|
1130
|
-
class GioPolicyStudioFlowsMenuComponent {
|
|
1131
|
-
constructor(matDialog) {
|
|
1132
|
-
this.matDialog = matDialog;
|
|
1133
|
-
this.loading = false;
|
|
1134
|
-
this.flowsGroups = [];
|
|
1135
|
-
this.selectedFlow = undefined;
|
|
1136
|
-
this.entrypoints = [];
|
|
1137
|
-
this.selectedFlowChange = new EventEmitter();
|
|
1138
|
-
this.flowsGroupsChange = new EventEmitter();
|
|
1139
|
-
this.flowExecutionChange = new EventEmitter();
|
|
1140
|
-
this.flowGroupMenuItems = [];
|
|
1141
|
-
}
|
|
1142
|
-
ngOnChanges(changes) {
|
|
1143
|
-
if (changes.flowsGroups || changes.selectedFlow) {
|
|
1144
|
-
this.flowGroupMenuItems = cloneDeep(this.flowsGroups).map(flowGroup => {
|
|
1145
|
-
return Object.assign(Object.assign({}, flowGroup), { flows: flowGroup.flows.map(flow => {
|
|
1146
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1147
|
-
const badges = [];
|
|
1148
|
-
let pathOrChannelLabel = '';
|
|
1149
|
-
let hasCondition = false;
|
|
1150
|
-
// MESSAGE API - CHANNEL
|
|
1151
|
-
const channelSelector = (_a = flow.selectors) === null || _a === void 0 ? void 0 : _a.find(s => s.type === 'CHANNEL');
|
|
1152
|
-
if (channelSelector) {
|
|
1153
|
-
const operationToBadge = {
|
|
1154
|
-
PUBLISH: 'PUB',
|
|
1155
|
-
SUBSCRIBE: 'SUB',
|
|
1156
|
-
};
|
|
1157
|
-
// If no operations are selected, all operations are valid
|
|
1158
|
-
const operationBadges = (!channelSelector.operations || isEmpty(channelSelector.operations)
|
|
1159
|
-
? ['PUBLISH', 'SUBSCRIBE']
|
|
1160
|
-
: channelSelector.operations)
|
|
1161
|
-
.map(operation => ({
|
|
1162
|
-
label: operationToBadge[operation],
|
|
1163
|
-
class: 'gio-badge-neutral',
|
|
1164
|
-
}))
|
|
1165
|
-
.sort((a, b) => a.label.localeCompare(b.label));
|
|
1166
|
-
operationBadges && badges.push(...operationBadges);
|
|
1167
|
-
pathOrChannelLabel = `${channelSelector.channel}${channelSelector.channelOperator === 'STARTS_WITH' ? '**' : ''}`;
|
|
1168
|
-
}
|
|
1169
|
-
// HTTP API - HTTP
|
|
1170
|
-
const httpSelector = (_b = flow.selectors) === null || _b === void 0 ? void 0 : _b.find(s => s.type === 'HTTP');
|
|
1171
|
-
if (httpSelector) {
|
|
1172
|
-
// Keep only 2 first http methods and add +X badge if there are more
|
|
1173
|
-
const httpMethodsToKeep = (_c = httpSelector.methods) === null || _c === void 0 ? void 0 : _c.slice(0, 2);
|
|
1174
|
-
const httpMethodsLength = (_d = httpSelector.methods) === null || _d === void 0 ? void 0 : _d.length;
|
|
1175
|
-
httpMethodsToKeep &&
|
|
1176
|
-
badges.push(...httpMethodsToKeep.map(method => ({ label: method, class: `gio-method-badge-${method.toLowerCase()}` })));
|
|
1177
|
-
if (httpMethodsLength && httpMethodsLength > 2) {
|
|
1178
|
-
badges === null || badges === void 0 ? void 0 : badges.push({
|
|
1179
|
-
label: `+${httpMethodsLength - 2}`,
|
|
1180
|
-
class: 'gio-badge-neutral',
|
|
1181
|
-
});
|
|
1182
|
-
}
|
|
1183
|
-
if (httpMethodsLength === 0) {
|
|
1184
|
-
badges === null || badges === void 0 ? void 0 : badges.push({
|
|
1185
|
-
label: 'ALL',
|
|
1186
|
-
class: 'gio-badge-neutral',
|
|
1187
|
-
});
|
|
1188
|
-
}
|
|
1189
|
-
pathOrChannelLabel = `${httpSelector.path}${httpSelector.pathOperator === 'STARTS_WITH' ? '/**' : ''}`;
|
|
1190
|
-
}
|
|
1191
|
-
const conditionSelector = (_e = flow.selectors) === null || _e === void 0 ? void 0 : _e.find(s => s.type === 'CONDITION');
|
|
1192
|
-
if (conditionSelector && conditionSelector.condition) {
|
|
1193
|
-
hasCondition = true;
|
|
1194
|
-
}
|
|
1195
|
-
return Object.assign(Object.assign({}, flow), { selected: ((_f = this.selectedFlow) === null || _f === void 0 ? void 0 : _f._id) === flow._id, mouseOver: false, badges,
|
|
1196
|
-
pathOrChannelLabel,
|
|
1197
|
-
hasCondition });
|
|
1198
|
-
}) });
|
|
1199
|
-
});
|
|
1200
|
-
}
|
|
1201
|
-
}
|
|
1202
|
-
selectFlow(groupId, flowId) {
|
|
1203
|
-
var _a;
|
|
1204
|
-
const flow = (_a = this.flowsGroups.find(fg => fg._id === groupId)) === null || _a === void 0 ? void 0 : _a.flows.find(f => f._id === flowId);
|
|
1205
|
-
if (flow) {
|
|
1206
|
-
this.selectedFlowChange.emit(flow);
|
|
1207
|
-
}
|
|
1208
|
-
}
|
|
1209
|
-
onAddFlow(flowGroup) {
|
|
1210
|
-
const dialogResult = this.apiType === 'MESSAGE'
|
|
1211
|
-
? this.matDialog
|
|
1212
|
-
.open(GioPolicyStudioFlowMessageFormDialogComponent, {
|
|
1213
|
-
data: {
|
|
1214
|
-
flow: undefined,
|
|
1215
|
-
entrypoints: this.entrypoints,
|
|
1216
|
-
},
|
|
1217
|
-
role: 'alertdialog',
|
|
1218
|
-
id: 'gioPsFlowFormDialog',
|
|
1219
|
-
width: GIO_DIALOG_WIDTH.MEDIUM,
|
|
1220
|
-
})
|
|
1221
|
-
.afterClosed()
|
|
1222
|
-
: this.matDialog
|
|
1223
|
-
.open(GioPolicyStudioFlowProxyFormDialogComponent, {
|
|
1224
|
-
data: {
|
|
1225
|
-
flow: undefined,
|
|
1226
|
-
},
|
|
1227
|
-
role: 'alertdialog',
|
|
1228
|
-
id: 'gioPsFlowFormDialog',
|
|
1229
|
-
width: GIO_DIALOG_WIDTH.MEDIUM,
|
|
1230
|
-
})
|
|
1231
|
-
.afterClosed();
|
|
1232
|
-
dialogResult
|
|
1233
|
-
.pipe(tap(createdOrEdited => {
|
|
1234
|
-
if (!createdOrEdited) {
|
|
1235
|
-
return;
|
|
1236
|
-
}
|
|
1237
|
-
const editedFlowsGroups = cloneDeep(this.flowsGroups);
|
|
1238
|
-
const flowsGroupToEdit = editedFlowsGroups.find(fg => fg._id === flowGroup._id);
|
|
1239
|
-
if (!flowsGroupToEdit) {
|
|
1240
|
-
throw new Error(`Flow group ${flowGroup._id} not found`);
|
|
1241
|
-
}
|
|
1242
|
-
flowsGroupToEdit.flows.push(createdOrEdited);
|
|
1243
|
-
this.flowsGroupsChange.emit(editedFlowsGroups);
|
|
1244
|
-
this.selectedFlowChange.emit(createdOrEdited);
|
|
1245
|
-
}))
|
|
1246
|
-
.subscribe();
|
|
1247
|
-
}
|
|
1248
|
-
onConfigureExecution(flowExecution) {
|
|
1249
|
-
const dialogResult = this.matDialog
|
|
1250
|
-
.open(GioPolicyStudioFlowExecutionFormDialogComponent, {
|
|
1251
|
-
data: {
|
|
1252
|
-
flowExecution,
|
|
1253
|
-
},
|
|
1254
|
-
role: 'alertdialog',
|
|
1255
|
-
id: 'gioPsFlowExecutionFormDialog',
|
|
1256
|
-
width: GIO_DIALOG_WIDTH.MEDIUM,
|
|
1257
|
-
})
|
|
1258
|
-
.afterClosed();
|
|
1259
|
-
dialogResult
|
|
1260
|
-
.pipe(tap(edited => {
|
|
1261
|
-
if (!edited) {
|
|
1262
|
-
return;
|
|
1263
|
-
}
|
|
1264
|
-
this.flowExecutionChange.emit(edited);
|
|
1265
|
-
}))
|
|
1266
|
-
.subscribe();
|
|
1267
|
-
}
|
|
1268
|
-
}
|
|
1269
|
-
GioPolicyStudioFlowsMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioFlowsMenuComponent, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
|
1270
|
-
GioPolicyStudioFlowsMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: GioPolicyStudioFlowsMenuComponent, selector: "gio-ps-flows-menu", inputs: { loading: "loading", apiType: "apiType", flowExecution: "flowExecution", flowsGroups: "flowsGroups", selectedFlow: "selectedFlow", entrypoints: "entrypoints" }, outputs: { selectedFlowChange: "selectedFlowChange", flowsGroupsChange: "flowsGroupsChange", flowExecutionChange: "flowExecutionChange" }, 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 class=\"header__configBtn_edit\" mat-stroked-button [disabled]=\"loading\" (click)=\"onConfigureExecution(flowExecution)\">\n <mat-icon svgIcon=\"gio:settings\"></mat-icon>\n </button>\n </div>\n</div>\n\n<div class=\"list\" *ngIf=\"!loading; else loadingList\">\n <div *ngFor=\"let flowsGroup of flowGroupMenuItems\" 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-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\">\n <span *ngIf=\"flow.pathOrChannelLabel; else emptyPathOrChannelLabel\" [attr.title]=\"flow.pathOrChannelLabel\">{{\n flow.pathOrChannelLabel\n }}</span>\n <ng-template #emptyPathOrChannelLabel>\n <em>Empty</em>\n </ng-template>\n </div>\n\n <span *ngIf=\"flow.hasCondition\" class=\"list__flowsGroup__flow__infos__conditionBadge gio-badge-neutral\" matTooltip=\"Conditioned\"\n ><mat-icon svgIcon=\"gio:if\"></mat-icon\n ></span>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #loadingList>\n <div class=\"loadingList\">\n <gio-loader></gio-loader>\n </div>\n</ng-template>\n", styles: [".gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}:host{display:flex;height:100%;max-height:100%;flex-direction:column;padding-top:16px}.header{display:flex;align-items:center;padding:0 16px;margin-bottom:16px}.header__label{font-size:16px;font-weight:500;letter-spacing:.4px;line-height:24px;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-size:14px;font-weight:500;line-height:20px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;display:flex;overflow:hidden;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;overflow:hidden;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{overflow:hidden;flex:1 1 auto;direction:rtl;text-align:left;text-overflow:ellipsis;white-space:nowrap}.list__flowsGroup__flow__infos__pathOrChannelLabel span{direction:ltr;unicode-bidi:bidi-override}.list__flowsGroup__flow__infos__conditionBadge{flex:0 0 auto}.loadingList{display:flex;height:100%;flex-direction:column;align-items:center;justify-content:center}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i10.GioLoaderComponent, selector: "gio-loader" }] });
|
|
1271
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioFlowsMenuComponent, decorators: [{
|
|
1272
|
-
type: Component,
|
|
1273
|
-
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 class=\"header__configBtn_edit\" mat-stroked-button [disabled]=\"loading\" (click)=\"onConfigureExecution(flowExecution)\">\n <mat-icon svgIcon=\"gio:settings\"></mat-icon>\n </button>\n </div>\n</div>\n\n<div class=\"list\" *ngIf=\"!loading; else loadingList\">\n <div *ngFor=\"let flowsGroup of flowGroupMenuItems\" 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-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\">\n <span *ngIf=\"flow.pathOrChannelLabel; else emptyPathOrChannelLabel\" [attr.title]=\"flow.pathOrChannelLabel\">{{\n flow.pathOrChannelLabel\n }}</span>\n <ng-template #emptyPathOrChannelLabel>\n <em>Empty</em>\n </ng-template>\n </div>\n\n <span *ngIf=\"flow.hasCondition\" class=\"list__flowsGroup__flow__infos__conditionBadge gio-badge-neutral\" matTooltip=\"Conditioned\"\n ><mat-icon svgIcon=\"gio:if\"></mat-icon\n ></span>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #loadingList>\n <div class=\"loadingList\">\n <gio-loader></gio-loader>\n </div>\n</ng-template>\n", styles: [".gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}:host{display:flex;height:100%;max-height:100%;flex-direction:column;padding-top:16px}.header{display:flex;align-items:center;padding:0 16px;margin-bottom:16px}.header__label{font-size:16px;font-weight:500;letter-spacing:.4px;line-height:24px;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-size:14px;font-weight:500;line-height:20px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;display:flex;overflow:hidden;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;overflow:hidden;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{overflow:hidden;flex:1 1 auto;direction:rtl;text-align:left;text-overflow:ellipsis;white-space:nowrap}.list__flowsGroup__flow__infos__pathOrChannelLabel span{direction:ltr;unicode-bidi:bidi-override}.list__flowsGroup__flow__infos__conditionBadge{flex:0 0 auto}.loadingList{display:flex;height:100%;flex-direction:column;align-items:center;justify-content:center}\n"] }]
|
|
1274
|
-
}], ctorParameters: function () { return [{ type: i1.MatDialog }]; }, propDecorators: { loading: [{
|
|
1275
|
-
type: Input
|
|
1276
|
-
}], apiType: [{
|
|
1277
|
-
type: Input
|
|
1278
|
-
}], flowExecution: [{
|
|
1279
|
-
type: Input
|
|
1280
|
-
}], flowsGroups: [{
|
|
1281
|
-
type: Input
|
|
1282
|
-
}], selectedFlow: [{
|
|
1283
|
-
type: Input
|
|
1284
|
-
}], entrypoints: [{
|
|
1285
|
-
type: Input
|
|
1286
|
-
}], selectedFlowChange: [{
|
|
1287
|
-
type: Output
|
|
1288
|
-
}], flowsGroupsChange: [{
|
|
1289
|
-
type: Output
|
|
1290
|
-
}], flowExecutionChange: [{
|
|
1291
|
-
type: Output
|
|
1292
|
-
}] } });
|
|
1293
|
-
|
|
1294
|
-
/*
|
|
1295
|
-
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
1296
|
-
*
|
|
1297
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1298
|
-
* you may not use this file except in compliance with the License.
|
|
1299
|
-
* You may obtain a copy of the License at
|
|
1300
|
-
*
|
|
1301
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1302
|
-
*
|
|
1303
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1304
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1305
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1306
|
-
* See the License for the specific language governing permissions and
|
|
1307
|
-
* limitations under the License.
|
|
1308
|
-
*/
|
|
1309
|
-
class GioPolicyStudioComponent {
|
|
1310
|
-
constructor(policyStudioService) {
|
|
1311
|
-
this.policyStudioService = policyStudioService;
|
|
1312
|
-
/**
|
|
1313
|
-
* List of entrypoints to display
|
|
1314
|
-
*/
|
|
1315
|
-
this.entrypointsInfo = [];
|
|
1316
|
-
/**
|
|
1317
|
-
* List of endpoints to display
|
|
1318
|
-
*/
|
|
1319
|
-
this.endpointsInfo = [];
|
|
1320
|
-
/**
|
|
1321
|
-
* List of common flows to add to common flows group
|
|
1322
|
-
*/
|
|
1323
|
-
this.commonFlows = [];
|
|
1324
|
-
/**
|
|
1325
|
-
* List of plans with their flows
|
|
1326
|
-
*/
|
|
1327
|
-
this.plans = [];
|
|
1328
|
-
/**
|
|
1329
|
-
* List of policies usable in the policy studio
|
|
1330
|
-
*/
|
|
1331
|
-
this.policies = [];
|
|
1332
|
-
/**
|
|
1333
|
-
* Loading state
|
|
1334
|
-
*/
|
|
1335
|
-
this.loading = false;
|
|
1336
|
-
/**
|
|
1337
|
-
* Called when Policy Studio needs to fetch the policy schema
|
|
1338
|
-
* @returns Observable of the policy schema
|
|
1339
|
-
*/
|
|
1340
|
-
this.policySchemaFetcher = () => EMPTY;
|
|
1341
|
-
/**
|
|
1342
|
-
* Called when Policy Studio needs to fetch the policy documentation
|
|
1343
|
-
* @returns Observable of the policy documentation
|
|
1344
|
-
*/
|
|
1345
|
-
this.policyDocumentationFetcher = () => EMPTY;
|
|
1346
|
-
/**
|
|
1347
|
-
* Return what is needed to save.
|
|
1348
|
-
**/
|
|
1349
|
-
this.save = new EventEmitter();
|
|
1350
|
-
this.connectorsTooltip = '';
|
|
1351
|
-
this.selectedFlow = undefined;
|
|
1352
|
-
this.flowsGroups = [];
|
|
1353
|
-
this.disableSaveButton = true;
|
|
1354
|
-
this.saving = false;
|
|
1355
|
-
// Used to keep track of initial flows groups to know if there are deleted flows
|
|
1356
|
-
this.initialFlowsGroups = [];
|
|
1357
|
-
this.hasFlowExecutionChanged = false;
|
|
1358
|
-
this.enableSavingTimer = true;
|
|
1359
|
-
}
|
|
1360
|
-
ngOnChanges(changes) {
|
|
1361
|
-
var _a, _b, _c;
|
|
1362
|
-
if (changes.entrypointsInfo || changes.endpointsInfo) {
|
|
1363
|
-
this.connectorsTooltip = `Entrypoints: ${((_a = this.entrypointsInfo) !== null && _a !== void 0 ? _a : []).map(e => e.name).join(', ')}\nEndpoints: ${((_b = this.endpointsInfo) !== null && _b !== void 0 ? _b : [])
|
|
1364
|
-
.map(e => e.name)
|
|
1365
|
-
.join(', ')}`;
|
|
1366
|
-
}
|
|
1367
|
-
if (changes.commonFlows || changes.plans) {
|
|
1368
|
-
this.disableSaveButton = true;
|
|
1369
|
-
this.flowsGroups = getFlowsGroups(this.commonFlows, this.plans);
|
|
1370
|
-
this.initialFlowsGroups = cloneDeep(this.flowsGroups);
|
|
1371
|
-
// Select first flow by default on first load
|
|
1372
|
-
this.selectedFlow = flatten(this.flowsGroups.map(flowGroup => flowGroup.flows))[0];
|
|
1373
|
-
// Reset saving state when flowsGroups are updated
|
|
1374
|
-
this.saving = false;
|
|
1375
|
-
(_c = this.unSavingButtonSubscription) === null || _c === void 0 ? void 0 : _c.unsubscribe();
|
|
1376
|
-
}
|
|
1377
|
-
if (changes.policySchemaFetcher) {
|
|
1378
|
-
this.policyStudioService.setPolicySchemaFetcher(this.policySchemaFetcher);
|
|
1379
|
-
}
|
|
1380
|
-
if (changes.policyDocumentationFetcher) {
|
|
1381
|
-
this.policyStudioService.setPolicyDocumentationFetcher(this.policyDocumentationFetcher);
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
1384
|
-
ngOnDestroy() {
|
|
1385
|
-
var _a;
|
|
1386
|
-
(_a = this.unSavingButtonSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
1387
|
-
}
|
|
1388
|
-
onFlowExecutionChange(flowExecution) {
|
|
1389
|
-
this.hasFlowExecutionChanged = !isEqual(this.flowExecution, flowExecution);
|
|
1390
|
-
if (this.hasFlowExecutionChanged) {
|
|
1391
|
-
this.disableSaveButton = false;
|
|
1392
|
-
this.flowExecution = flowExecution;
|
|
1393
|
-
}
|
|
1394
|
-
}
|
|
1395
|
-
onFlowsGroupsChange(flowsGroups) {
|
|
1396
|
-
this.flowsGroups = flowsGroups;
|
|
1397
|
-
this.disableSaveButton = false;
|
|
1398
|
-
}
|
|
1399
|
-
onSelectedFlowChange(flow) {
|
|
1400
|
-
this.flowsGroups = this.flowsGroups.map(flowGroup => (Object.assign(Object.assign({}, flowGroup), { flows: flowGroup.flows.map(f => (f._id === flow._id ? flow : f)) })));
|
|
1401
|
-
this.selectedFlow = flow;
|
|
1402
|
-
this.disableSaveButton = false;
|
|
1403
|
-
}
|
|
1404
|
-
onDeleteSelectedFlow(flow) {
|
|
1405
|
-
var _a;
|
|
1406
|
-
// Define next selected flow and remove flow from flowsGroups
|
|
1407
|
-
const allFlowsId = flatten(this.flowsGroups.map(flowGroup => flowGroup.flows)).map(f => f._id);
|
|
1408
|
-
const flowToDeleteIndex = allFlowsId.indexOf(flow._id);
|
|
1409
|
-
const nextSelectedFlow = (_a = allFlowsId[flowToDeleteIndex + 1]) !== null && _a !== void 0 ? _a : allFlowsId[flowToDeleteIndex - 1];
|
|
1410
|
-
this.flowsGroups = this.flowsGroups.map(flowGroup => (Object.assign(Object.assign({}, flowGroup), { flows: flowGroup.flows.filter(f => f._id !== flow._id) })));
|
|
1411
|
-
this.selectedFlow = flatten(this.flowsGroups.map(flowGroup => flowGroup.flows)).find(f => f._id === nextSelectedFlow);
|
|
1412
|
-
this.disableSaveButton = false;
|
|
1413
|
-
}
|
|
1414
|
-
onSave() {
|
|
1415
|
-
var _a;
|
|
1416
|
-
// Emit common flows only if they have been updated
|
|
1417
|
-
const commonFlows = getCommonFlowsOutput(this.flowsGroups, this.initialFlowsGroups);
|
|
1418
|
-
// Emit plans only if they have been updated
|
|
1419
|
-
const plansToUpdate = getPlansChangeOutput(this.flowsGroups, this.initialFlowsGroups);
|
|
1420
|
-
this.save.emit(Object.assign(Object.assign(Object.assign({}, (commonFlows ? { commonFlows } : {})), (plansToUpdate ? { plansToUpdate } : {})), (this.hasFlowExecutionChanged ? { flowExecution: this.flowExecution } : {})));
|
|
1421
|
-
this.saving = true;
|
|
1422
|
-
(_a = this.unSavingButtonSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
1423
|
-
if (this.enableSavingTimer) {
|
|
1424
|
-
this.unSavingButtonSubscription = timer(5000).subscribe(() => {
|
|
1425
|
-
this.saving = false;
|
|
1426
|
-
});
|
|
1427
|
-
}
|
|
1428
|
-
}
|
|
1429
|
-
}
|
|
1430
|
-
GioPolicyStudioComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioComponent, deps: [{ token: GioPolicyStudioService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1431
|
-
GioPolicyStudioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: GioPolicyStudioComponent, selector: "gio-policy-studio", inputs: { apiType: "apiType", flowExecution: "flowExecution", entrypointsInfo: "entrypointsInfo", endpointsInfo: "endpointsInfo", commonFlows: "commonFlows", plans: "plans", policies: "policies", trialUrl: "trialUrl", loading: "loading", policySchemaFetcher: "policySchemaFetcher", policyDocumentationFetcher: "policyDocumentationFetcher" }, 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\" *ngIf=\"!loading; else loadingApiInfo\">\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 <ng-template #loadingApiInfo>\n <div class=\"header__apiInfo\">\n <span class=\"gio-badge-primary\"> </span>\n <span class=\"gio-badge-neutral\"> </span>\n </div>\n </ng-template>\n\n <div class=\"header__btn\">\n <button *ngIf=\"!saving\" mat-flat-button color=\"primary\" [disabled]=\"loading || disableSaveButton\" (click)=\"onSave()\">Save</button>\n <button *ngIf=\"saving\" mat-flat-button color=\"primary\" disabled>Saving...</button>\n </div>\n</div>\n\n<div class=\"wrapper\">\n <div class=\"wrapper__flowsMenu\">\n <gio-ps-flows-menu\n [loading]=\"loading\"\n [apiType]=\"apiType\"\n [flowExecution]=\"flowExecution\"\n [flowsGroups]=\"flowsGroups\"\n [entrypoints]=\"entrypointsInfo\"\n (flowsGroupsChange)=\"onFlowsGroupsChange($event)\"\n (flowExecutionChange)=\"onFlowExecutionChange($event)\"\n [(selectedFlow)]=\"selectedFlow\"\n ></gio-ps-flows-menu>\n </div>\n\n <div class=\"wrapper__flowDetails\">\n <gio-ps-flow-details\n [loading]=\"loading\"\n [apiType]=\"apiType\"\n [flow]=\"selectedFlow\"\n [entrypointsInfo]=\"entrypointsInfo\"\n [endpointsInfo]=\"endpointsInfo\"\n [policies]=\"policies\"\n [trialUrl]=\"trialUrl\"\n (flowChange)=\"onSelectedFlowChange($event)\"\n (deleteFlow)=\"onDeleteSelectedFlow($event)\"\n ></gio-ps-flow-details>\n </div>\n</div>\n", styles: [".gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}:host{display:flex;height:100%;flex-direction:column;padding:16px;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;min-width:230px;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"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: GioPolicyStudioFlowsMenuComponent, selector: "gio-ps-flows-menu", inputs: ["loading", "apiType", "flowExecution", "flowsGroups", "selectedFlow", "entrypoints"], outputs: ["selectedFlowChange", "flowsGroupsChange", "flowExecutionChange"] }, { kind: "component", type: GioPolicyStudioDetailsComponent, selector: "gio-ps-flow-details", inputs: ["loading", "apiType", "flow", "entrypointsInfo", "endpointsInfo", "policies", "trialUrl"], outputs: ["flowChange", "deleteFlow"] }, { kind: "pipe", type: i2.TitleCasePipe, name: "titlecase" }] });
|
|
1432
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioComponent, decorators: [{
|
|
1433
|
-
type: Component,
|
|
1434
|
-
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\" *ngIf=\"!loading; else loadingApiInfo\">\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 <ng-template #loadingApiInfo>\n <div class=\"header__apiInfo\">\n <span class=\"gio-badge-primary\"> </span>\n <span class=\"gio-badge-neutral\"> </span>\n </div>\n </ng-template>\n\n <div class=\"header__btn\">\n <button *ngIf=\"!saving\" mat-flat-button color=\"primary\" [disabled]=\"loading || disableSaveButton\" (click)=\"onSave()\">Save</button>\n <button *ngIf=\"saving\" mat-flat-button color=\"primary\" disabled>Saving...</button>\n </div>\n</div>\n\n<div class=\"wrapper\">\n <div class=\"wrapper__flowsMenu\">\n <gio-ps-flows-menu\n [loading]=\"loading\"\n [apiType]=\"apiType\"\n [flowExecution]=\"flowExecution\"\n [flowsGroups]=\"flowsGroups\"\n [entrypoints]=\"entrypointsInfo\"\n (flowsGroupsChange)=\"onFlowsGroupsChange($event)\"\n (flowExecutionChange)=\"onFlowExecutionChange($event)\"\n [(selectedFlow)]=\"selectedFlow\"\n ></gio-ps-flows-menu>\n </div>\n\n <div class=\"wrapper__flowDetails\">\n <gio-ps-flow-details\n [loading]=\"loading\"\n [apiType]=\"apiType\"\n [flow]=\"selectedFlow\"\n [entrypointsInfo]=\"entrypointsInfo\"\n [endpointsInfo]=\"endpointsInfo\"\n [policies]=\"policies\"\n [trialUrl]=\"trialUrl\"\n (flowChange)=\"onSelectedFlowChange($event)\"\n (deleteFlow)=\"onDeleteSelectedFlow($event)\"\n ></gio-ps-flow-details>\n </div>\n</div>\n", styles: [".gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}:host{display:flex;height:100%;flex-direction:column;padding:16px;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;min-width:230px;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"] }]
|
|
1435
|
-
}], ctorParameters: function () { return [{ type: GioPolicyStudioService }]; }, propDecorators: { apiType: [{
|
|
1436
|
-
type: Input
|
|
1437
|
-
}], flowExecution: [{
|
|
1438
|
-
type: Input
|
|
1439
|
-
}], entrypointsInfo: [{
|
|
1440
|
-
type: Input
|
|
1441
|
-
}], endpointsInfo: [{
|
|
1442
|
-
type: Input
|
|
1443
|
-
}], commonFlows: [{
|
|
1444
|
-
type: Input
|
|
1445
|
-
}], plans: [{
|
|
1446
|
-
type: Input
|
|
1447
|
-
}], policies: [{
|
|
1448
|
-
type: Input
|
|
1449
|
-
}], trialUrl: [{
|
|
1450
|
-
type: Input
|
|
1451
|
-
}], loading: [{
|
|
1452
|
-
type: Input
|
|
1453
|
-
}], policySchemaFetcher: [{
|
|
1454
|
-
type: Input
|
|
1455
|
-
}], policyDocumentationFetcher: [{
|
|
1456
|
-
type: Input
|
|
1457
|
-
}], save: [{
|
|
1458
|
-
type: Output
|
|
1459
|
-
}] } });
|
|
1460
|
-
const getFlowsGroups = (commonFlows = [], plans = []) => {
|
|
1461
|
-
const commFlowsGroup = {
|
|
1462
|
-
_id: 'flowsGroup_commonFlow',
|
|
1463
|
-
name: 'Common flows',
|
|
1464
|
-
flows: commonFlows.map(flow => (Object.assign(Object.assign({}, flow), { _id: uniqueId('flow_'), _hasChanged: false }))),
|
|
1465
|
-
};
|
|
1466
|
-
return [
|
|
1467
|
-
...plans.map(plan => ({
|
|
1468
|
-
_id: uniqueId('flowsGroup_'),
|
|
1469
|
-
_icon: 'gio:shield',
|
|
1470
|
-
_planId: plan.id,
|
|
1471
|
-
name: plan.name,
|
|
1472
|
-
flows: plan.flows.map(flow => (Object.assign(Object.assign({}, flow), { _id: uniqueId('flow_'), _hasChanged: false }))),
|
|
1473
|
-
})),
|
|
1474
|
-
commFlowsGroup,
|
|
1475
|
-
];
|
|
1476
|
-
};
|
|
1477
|
-
const getCommonFlowsOutput = (flowsGroups, initialFlowsGroups) => {
|
|
1478
|
-
var _a, _b, _c;
|
|
1479
|
-
const commonFlowsGroup = flowsGroups.find(flowGroup => flowGroup._id === 'flowsGroup_commonFlow');
|
|
1480
|
-
const initialCommonFlowsGroup = initialFlowsGroups.find(flowGroup => flowGroup._id === 'flowsGroup_commonFlow');
|
|
1481
|
-
// Check if common flows have been updated
|
|
1482
|
-
const hasChanged = commonFlowsGroup === null || commonFlowsGroup === void 0 ? void 0 : commonFlowsGroup.flows.some(flow => flow._hasChanged);
|
|
1483
|
-
// Check if common flows have been deleted
|
|
1484
|
-
const hasDeletedFlow = differenceBy((_a = initialCommonFlowsGroup === null || initialCommonFlowsGroup === void 0 ? void 0 : initialCommonFlowsGroup.flows) !== null && _a !== void 0 ? _a : [], (_b = commonFlowsGroup === null || commonFlowsGroup === void 0 ? void 0 : commonFlowsGroup.flows) !== null && _b !== void 0 ? _b : [], '_id').length > 0;
|
|
1485
|
-
return hasChanged || hasDeletedFlow ? ((_c = commonFlowsGroup === null || commonFlowsGroup === void 0 ? void 0 : commonFlowsGroup.flows) !== null && _c !== void 0 ? _c : []).map(flow => omit(flow, '_id', '_hasChanged')) : null;
|
|
1486
|
-
};
|
|
1487
|
-
const getPlansChangeOutput = (flowsGroups, initialFlowsGroups) => {
|
|
1488
|
-
const plansGroups = flowsGroups.filter(flowGroup => flowGroup._id !== 'flowsGroup_commonFlow');
|
|
1489
|
-
const initialPlansGroups = initialFlowsGroups.filter(flowGroup => flowGroup._id !== 'flowsGroup_commonFlow');
|
|
1490
|
-
// Get plans with changed flows
|
|
1491
|
-
const plansGroupsWithChangedFlows = plansGroups.filter(plan => plan.flows.some(flow => flow._hasChanged));
|
|
1492
|
-
// Get plans with deleted flows
|
|
1493
|
-
const plansGroupsWithDeletedFlows = [];
|
|
1494
|
-
// Check if there are deleted flows in initial initialPlansGroups
|
|
1495
|
-
initialPlansGroups.forEach(plan => {
|
|
1496
|
-
var _a;
|
|
1497
|
-
const planGroupToCompare = plansGroups.find(p => p._planId === plan._planId);
|
|
1498
|
-
if (planGroupToCompare && differenceBy(plan.flows, (_a = planGroupToCompare === null || planGroupToCompare === void 0 ? void 0 : planGroupToCompare.flows) !== null && _a !== void 0 ? _a : [], '_id').length > 0) {
|
|
1499
|
-
// If there are deleted flows, we need to return the complete plan with the new flows
|
|
1500
|
-
plansGroupsWithDeletedFlows.push(planGroupToCompare);
|
|
1501
|
-
}
|
|
1502
|
-
});
|
|
1503
|
-
// Merge plans with changed flows and plans with deleted flows
|
|
1504
|
-
const plansWithChangedFlowsOutput = unionBy([...plansGroupsWithChangedFlows, ...plansGroupsWithDeletedFlows], '_planId').map(plan => (Object.assign(Object.assign({}, omit(plan, '_id', '_icon', '_planId')), {
|
|
1505
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- planId is always defined
|
|
1506
|
-
id: plan._planId, flows: plan.flows.map(flow => omit(flow, '_id', '_hasChanged')) })));
|
|
1507
|
-
return plansWithChangedFlowsOutput.length > 0 ? plansWithChangedFlowsOutput : null;
|
|
1508
|
-
};
|
|
1509
|
-
|
|
1510
|
-
/*
|
|
1511
|
-
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
1512
|
-
*
|
|
1513
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1514
|
-
* you may not use this file except in compliance with the License.
|
|
1515
|
-
* You may obtain a copy of the License at
|
|
1516
|
-
*
|
|
1517
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1518
|
-
*
|
|
1519
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1520
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1521
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1522
|
-
* See the License for the specific language governing permissions and
|
|
1523
|
-
* limitations under the License.
|
|
1524
|
-
*/
|
|
1525
|
-
class GioPolicyStudioModule {
|
|
1526
|
-
}
|
|
1527
|
-
GioPolicyStudioModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1528
|
-
GioPolicyStudioModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioModule, declarations: [GioPolicyStudioComponent,
|
|
1529
|
-
GioPolicyStudioFlowsMenuComponent,
|
|
1530
|
-
GioPolicyStudioDetailsComponent,
|
|
1531
|
-
GioPolicyStudioFlowExecutionFormDialogComponent,
|
|
1532
|
-
GioPolicyStudioFlowMessageFormDialogComponent,
|
|
1533
|
-
GioPolicyStudioFlowProxyFormDialogComponent,
|
|
1534
|
-
GioPolicyStudioDetailsInfoBarComponent,
|
|
1535
|
-
GioPolicyStudioDetailsPhaseComponent,
|
|
1536
|
-
GioPolicyStudioDetailsPhaseStepComponent,
|
|
1537
|
-
GioFilterConnectorsByModePipe,
|
|
1538
|
-
GioPolicyStudioPoliciesCatalogDialogComponent,
|
|
1539
|
-
GioPolicyStudioStepEditDialogComponent,
|
|
1540
|
-
GioPolicyStudioStepFormComponent], imports: [CommonModule,
|
|
1541
|
-
ReactiveFormsModule,
|
|
1542
|
-
MatButtonModule,
|
|
1543
|
-
MatTooltipModule,
|
|
1544
|
-
MatFormFieldModule,
|
|
1545
|
-
MatInputModule,
|
|
1546
|
-
MatSelectModule,
|
|
1547
|
-
MatSlideToggleModule,
|
|
1548
|
-
MatDialogModule,
|
|
1549
|
-
MatTabsModule,
|
|
1550
|
-
MatMenuModule,
|
|
1551
|
-
MatChipsModule,
|
|
1552
|
-
GioIconsModule,
|
|
1553
|
-
GioFormSlideToggleModule,
|
|
1554
|
-
GioFormTagsInputModule,
|
|
1555
|
-
GioBannerModule,
|
|
1556
|
-
GioFormJsonSchemaModule,
|
|
1557
|
-
GioAsciidoctorModule,
|
|
1558
|
-
GioLoaderModule], exports: [GioPolicyStudioComponent] });
|
|
1559
|
-
GioPolicyStudioModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioModule, imports: [CommonModule,
|
|
1560
|
-
ReactiveFormsModule,
|
|
1561
|
-
MatButtonModule,
|
|
1562
|
-
MatTooltipModule,
|
|
1563
|
-
MatFormFieldModule,
|
|
1564
|
-
MatInputModule,
|
|
1565
|
-
MatSelectModule,
|
|
1566
|
-
MatSlideToggleModule,
|
|
1567
|
-
MatDialogModule,
|
|
1568
|
-
MatTabsModule,
|
|
1569
|
-
MatMenuModule,
|
|
1570
|
-
MatChipsModule,
|
|
1571
|
-
GioIconsModule,
|
|
1572
|
-
GioFormSlideToggleModule,
|
|
1573
|
-
GioFormTagsInputModule,
|
|
1574
|
-
GioBannerModule,
|
|
1575
|
-
GioFormJsonSchemaModule,
|
|
1576
|
-
GioAsciidoctorModule,
|
|
1577
|
-
GioLoaderModule] });
|
|
1578
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GioPolicyStudioModule, decorators: [{
|
|
1579
|
-
type: NgModule,
|
|
1580
|
-
args: [{
|
|
1581
|
-
declarations: [
|
|
1582
|
-
GioPolicyStudioComponent,
|
|
1583
|
-
GioPolicyStudioFlowsMenuComponent,
|
|
1584
|
-
GioPolicyStudioDetailsComponent,
|
|
1585
|
-
GioPolicyStudioFlowExecutionFormDialogComponent,
|
|
1586
|
-
GioPolicyStudioFlowMessageFormDialogComponent,
|
|
1587
|
-
GioPolicyStudioFlowProxyFormDialogComponent,
|
|
1588
|
-
GioPolicyStudioDetailsInfoBarComponent,
|
|
1589
|
-
GioPolicyStudioDetailsPhaseComponent,
|
|
1590
|
-
GioPolicyStudioDetailsPhaseStepComponent,
|
|
1591
|
-
GioFilterConnectorsByModePipe,
|
|
1592
|
-
GioPolicyStudioPoliciesCatalogDialogComponent,
|
|
1593
|
-
GioPolicyStudioStepEditDialogComponent,
|
|
1594
|
-
GioPolicyStudioStepFormComponent,
|
|
1595
|
-
],
|
|
1596
|
-
imports: [
|
|
1597
|
-
CommonModule,
|
|
1598
|
-
ReactiveFormsModule,
|
|
1599
|
-
MatButtonModule,
|
|
1600
|
-
MatTooltipModule,
|
|
1601
|
-
MatFormFieldModule,
|
|
1602
|
-
MatInputModule,
|
|
1603
|
-
MatSelectModule,
|
|
1604
|
-
MatSlideToggleModule,
|
|
1605
|
-
MatDialogModule,
|
|
1606
|
-
MatTabsModule,
|
|
1607
|
-
MatMenuModule,
|
|
1608
|
-
MatChipsModule,
|
|
1609
|
-
GioIconsModule,
|
|
1610
|
-
GioFormSlideToggleModule,
|
|
1611
|
-
GioFormTagsInputModule,
|
|
1612
|
-
GioBannerModule,
|
|
1613
|
-
GioFormJsonSchemaModule,
|
|
1614
|
-
GioAsciidoctorModule,
|
|
1615
|
-
GioLoaderModule,
|
|
1616
|
-
],
|
|
1617
|
-
exports: [GioPolicyStudioComponent],
|
|
1618
|
-
}]
|
|
1619
|
-
}] });
|
|
1620
|
-
|
|
1621
|
-
/*
|
|
1622
|
-
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
1623
|
-
*
|
|
1624
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1625
|
-
* you may not use this file except in compliance with the License.
|
|
1626
|
-
* You may obtain a copy of the License at
|
|
1627
|
-
*
|
|
1628
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1629
|
-
*
|
|
1630
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1631
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1632
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1633
|
-
* See the License for the specific language governing permissions and
|
|
1634
|
-
* limitations under the License.
|
|
1635
|
-
*/
|
|
1636
|
-
/*
|
|
1637
|
-
* Public API Surface of ui-policy-studio-angular
|
|
1638
|
-
*/
|
|
1639
|
-
|
|
1640
|
-
/**
|
|
1641
|
-
* Generated bundle index. Do not edit.
|
|
1642
|
-
*/
|
|
1643
|
-
|
|
1644
|
-
export { GioPolicyStudioComponent, GioPolicyStudioModule, HttpMethods, toHttpMethod };
|
|
1645
|
-
//# sourceMappingURL=gravitee-ui-policy-studio-angular.mjs.map
|