@gravitee/ui-policy-studio-angular 7.1.0 → 7.2.0-apim-1549-flows-list-b8b519a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/components/flow-details/gio-ps-flow-details.component.mjs +5 -5
- package/esm2020/lib/components/flows-menu/gio-ps-flows-menu.component.mjs +71 -6
- package/esm2020/lib/gio-policy-studio.component.mjs +36 -8
- package/esm2020/lib/gio-policy-studio.model.mjs +17 -0
- package/esm2020/lib/models/ConnectorsInfo.mjs +2 -0
- package/esm2020/lib/models/flow/Selector.mjs +1 -1
- package/esm2020/lib/models/index.mjs +3 -1
- package/esm2020/lib/models/plan/Plan.mjs +17 -0
- package/esm2020/lib/models/plan/index.mjs +17 -0
- package/esm2020/public-api.mjs +3 -3
- package/esm2020/testing/lib/models/flow/ApiType.mjs +2 -0
- package/esm2020/testing/lib/models/flow/Flow.fixture.mjs +25 -1
- package/esm2020/testing/lib/models/flow/FlowExecution.mjs +17 -0
- package/esm2020/testing/lib/models/flow/Selector.mjs +1 -1
- package/esm2020/testing/lib/models/flow/index.mjs +22 -0
- package/esm2020/testing/lib/models/index-testing.mjs +2 -1
- package/esm2020/testing/lib/models/plan/Plan.fixture.mjs +30 -0
- package/esm2020/testing/lib/models/plan/Plan.mjs +17 -0
- package/esm2020/testing/lib/models/plan/index-testing.mjs +17 -0
- package/esm2020/testing/testing/harnesses/div.harness.mjs +8 -5
- package/fesm2015/gravitee-ui-policy-studio-angular-testing.mjs +71 -5
- package/fesm2015/gravitee-ui-policy-studio-angular-testing.mjs.map +1 -1
- package/fesm2015/gravitee-ui-policy-studio-angular.mjs +119 -17
- package/fesm2015/gravitee-ui-policy-studio-angular.mjs.map +1 -1
- package/fesm2020/gravitee-ui-policy-studio-angular-testing.mjs +77 -5
- package/fesm2020/gravitee-ui-policy-studio-angular-testing.mjs.map +1 -1
- package/fesm2020/gravitee-ui-policy-studio-angular.mjs +141 -17
- package/fesm2020/gravitee-ui-policy-studio-angular.mjs.map +1 -1
- package/lib/components/flow-details/gio-ps-flow-details.component.d.ts +3 -3
- package/lib/components/flows-menu/gio-ps-flows-menu.component.d.ts +23 -4
- package/lib/gio-policy-studio.component.d.ts +7 -7
- package/lib/gio-policy-studio.model.d.ts +10 -0
- package/lib/models/ConnectorsInfo.d.ts +4 -0
- package/lib/models/flow/Selector.d.ts +2 -2
- package/lib/models/index.d.ts +2 -0
- package/lib/models/plan/Plan.d.ts +5 -0
- package/lib/models/plan/index.d.ts +1 -0
- package/package.json +1 -1
- package/public-api.d.ts +2 -2
- package/testing/lib/models/flow/ApiType.d.ts +1 -0
- package/testing/lib/models/flow/Flow.fixture.d.ts +1 -0
- package/testing/lib/models/flow/FlowExecution.d.ts +11 -0
- package/testing/lib/models/flow/Selector.d.ts +2 -2
- package/testing/lib/models/flow/index.d.ts +6 -0
- package/testing/lib/models/index-testing.d.ts +1 -0
- package/testing/lib/models/plan/Plan.d.ts +5 -0
- package/testing/lib/models/plan/Plan.fixture.d.ts +2 -0
- package/testing/lib/models/plan/index-testing.d.ts +1 -0
- package/testing/testing/harnesses/div.harness.d.ts +7 -2
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2023 The Gravitee team (http://gravitee.io)
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { isFunction } from 'lodash';
|
|
17
|
+
export function fakePlan(modifier) {
|
|
18
|
+
const base = {
|
|
19
|
+
name: 'Keyless plan',
|
|
20
|
+
flows: [],
|
|
21
|
+
};
|
|
22
|
+
if (isFunction(modifier)) {
|
|
23
|
+
return modifier(base);
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
...base,
|
|
27
|
+
...modifier,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUGxhbi5maXh0dXJlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdWktcG9saWN5LXN0dWRpby1hbmd1bGFyL3NyYy9saWIvbW9kZWxzL3BsYW4vUGxhbi5maXh0dXJlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7Ozs7OztHQWNHO0FBQ0gsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLFFBQVEsQ0FBQztBQUlwQyxNQUFNLFVBQVUsUUFBUSxDQUFDLFFBQWlEO0lBQ3hFLE1BQU0sSUFBSSxHQUFTO1FBQ2pCLElBQUksRUFBRSxjQUFjO1FBQ3BCLEtBQUssRUFBRSxFQUFFO0tBQ1YsQ0FBQztJQUVGLElBQUksVUFBVSxDQUFDLFFBQVEsQ0FBQyxFQUFFO1FBQ3hCLE9BQU8sUUFBUSxDQUFDLElBQUksQ0FBQyxDQUFDO0tBQ3ZCO0lBRUQsT0FBTztRQUNMLEdBQUcsSUFBSTtRQUNQLEdBQUcsUUFBUTtLQUNaLENBQUM7QUFDSixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIENvcHlyaWdodCAoQykgMjAyMyBUaGUgR3Jhdml0ZWUgdGVhbSAoaHR0cDovL2dyYXZpdGVlLmlvKVxuICpcbiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBB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GlzRnVuY3Rpb24obW9kaWZpZXIpKSB7XG4gICAgcmV0dXJuIG1vZGlmaWVyKGJhc2UpO1xuICB9XG5cbiAgcmV0dXJuIHtcbiAgICAuLi5iYXNlLFxuICAgIC4uLm1vZGlmaWVyLFxuICB9O1xufVxuIl19
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUGxhbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3VpLXBvbGljeS1zdHVkaW8tYW5ndWxhci9zcmMvbGliL21vZGVscy9wbGFuL1BsYW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7O0dBY0ciLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuICogQ29weXJpZ2h0IChDKSAyMDIyIFRoZSBHcmF2aXRlZSB0ZWFtIChodHRwOi8vZ3Jhdml0ZWUuaW8pXG4gKlxuICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlIFwiTGljZW5zZVwiKTtcbiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS5cbiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdFxuICpcbiAqICAgICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wXG4gKlxuICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZVxuICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gXCJBUyBJU1wiIEJBU0lTLFxuICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuXG4gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kXG4gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS5cbiAqL1xuXG5pbXBvcnQgeyBGbG93IH0gZnJvbSAnLi4vZmxvdyc7XG5cbmV4cG9ydCBpbnRlcmZhY2UgUGxhbiB7XG4gIG5hbWU6IHN0cmluZztcbiAgZmxvd3M6IEZsb3dbXTtcbn1cbiJdfQ==
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2023 The Gravitee team (http://gravitee.io)
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export * from './Plan.fixture';
|
|
17
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXgtdGVzdGluZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3VpLXBvbGljeS1zdHVkaW8tYW5ndWxhci9zcmMvbGliL21vZGVscy9wbGFuL2luZGV4LXRlc3RpbmcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7O0dBY0c7QUFDSCxjQUFjLGdCQUFnQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIENvcHlyaWdodCAoQykgMjAyMyBUaGUgR3Jhdml0ZWUgdGVhbSAoaHR0cDovL2dyYXZpdGVlLmlvKVxuICpcbiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSBcIkxpY2Vuc2VcIik7XG4gKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuXG4gKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXRcbiAqXG4gKiAgICAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMFxuICpcbiAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmVcbiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuIFwiQVMgSVNcIiBCQVNJUyxcbiAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLlxuICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZFxuICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuXG4gKi9cbmV4cG9ydCAqIGZyb20gJy4vUGxhbi5maXh0dXJlJztcbiJdfQ==
|
|
@@ -22,7 +22,7 @@ export class DivHarness extends ComponentHarness {
|
|
|
22
22
|
* @return a `HarnessPredicate` configured with the given options.
|
|
23
23
|
*/
|
|
24
24
|
static with(options = {}) {
|
|
25
|
-
return new HarnessPredicate(DivHarness, options);
|
|
25
|
+
return new HarnessPredicate(DivHarness, options).addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text));
|
|
26
26
|
}
|
|
27
27
|
childLocatorFor(query) {
|
|
28
28
|
return this.locatorFor(query);
|
|
@@ -30,10 +30,13 @@ export class DivHarness extends ComponentHarness {
|
|
|
30
30
|
childLocatorForAll(query) {
|
|
31
31
|
return this.locatorForAll(query);
|
|
32
32
|
}
|
|
33
|
-
async getText() {
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
async getText(option) {
|
|
34
|
+
let element = await this.host();
|
|
35
|
+
if (option?.childSelector) {
|
|
36
|
+
element = await this.locatorForOptional(option.childSelector)();
|
|
37
|
+
}
|
|
38
|
+
return element ? element.text() : null;
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
DivHarness.hostSelector = 'div';
|
|
39
|
-
//# sourceMapping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G51bGw7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -39,6 +39,27 @@ function fakeChannelFlow(modifier) {
|
|
|
39
39
|
}
|
|
40
40
|
return Object.assign(Object.assign({}, base), modifier);
|
|
41
41
|
}
|
|
42
|
+
function fakeHttpFlow(modifier) {
|
|
43
|
+
const httpSelector = {
|
|
44
|
+
type: 'HTTP',
|
|
45
|
+
path: '/path',
|
|
46
|
+
pathOperator: 'EQUALS',
|
|
47
|
+
methods: ['GET'],
|
|
48
|
+
};
|
|
49
|
+
const base = {
|
|
50
|
+
name: 'Flow name',
|
|
51
|
+
selectors: [httpSelector],
|
|
52
|
+
request: [],
|
|
53
|
+
response: [],
|
|
54
|
+
subscribe: [],
|
|
55
|
+
publish: [],
|
|
56
|
+
enabled: true,
|
|
57
|
+
};
|
|
58
|
+
if (isFunction(modifier)) {
|
|
59
|
+
return modifier(base);
|
|
60
|
+
}
|
|
61
|
+
return Object.assign(Object.assign({}, base), modifier);
|
|
62
|
+
}
|
|
42
63
|
|
|
43
64
|
/*
|
|
44
65
|
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
@@ -56,6 +77,48 @@ function fakeChannelFlow(modifier) {
|
|
|
56
77
|
* limitations under the License.
|
|
57
78
|
*/
|
|
58
79
|
|
|
80
|
+
/*
|
|
81
|
+
* Copyright (C) 2023 The Gravitee team (http://gravitee.io)
|
|
82
|
+
*
|
|
83
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
84
|
+
* you may not use this file except in compliance with the License.
|
|
85
|
+
* You may obtain a copy of the License at
|
|
86
|
+
*
|
|
87
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
88
|
+
*
|
|
89
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
90
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
91
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
92
|
+
* See the License for the specific language governing permissions and
|
|
93
|
+
* limitations under the License.
|
|
94
|
+
*/
|
|
95
|
+
function fakePlan(modifier) {
|
|
96
|
+
const base = {
|
|
97
|
+
name: 'Keyless plan',
|
|
98
|
+
flows: [],
|
|
99
|
+
};
|
|
100
|
+
if (isFunction(modifier)) {
|
|
101
|
+
return modifier(base);
|
|
102
|
+
}
|
|
103
|
+
return Object.assign(Object.assign({}, base), modifier);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/*
|
|
107
|
+
* Copyright (C) 2023 The Gravitee team (http://gravitee.io)
|
|
108
|
+
*
|
|
109
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
110
|
+
* you may not use this file except in compliance with the License.
|
|
111
|
+
* You may obtain a copy of the License at
|
|
112
|
+
*
|
|
113
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
114
|
+
*
|
|
115
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
116
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
117
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
118
|
+
* See the License for the specific language governing permissions and
|
|
119
|
+
* limitations under the License.
|
|
120
|
+
*/
|
|
121
|
+
|
|
59
122
|
/*
|
|
60
123
|
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
61
124
|
*
|
|
@@ -1365,7 +1428,7 @@ class DivHarness extends ComponentHarness {
|
|
|
1365
1428
|
* @return a `HarnessPredicate` configured with the given options.
|
|
1366
1429
|
*/
|
|
1367
1430
|
static with(options = {}) {
|
|
1368
|
-
return new HarnessPredicate(DivHarness, options);
|
|
1431
|
+
return new HarnessPredicate(DivHarness, options).addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text));
|
|
1369
1432
|
}
|
|
1370
1433
|
childLocatorFor(query) {
|
|
1371
1434
|
return this.locatorFor(query);
|
|
@@ -1373,10 +1436,13 @@ class DivHarness extends ComponentHarness {
|
|
|
1373
1436
|
childLocatorForAll(query) {
|
|
1374
1437
|
return this.locatorForAll(query);
|
|
1375
1438
|
}
|
|
1376
|
-
getText() {
|
|
1439
|
+
getText(option) {
|
|
1377
1440
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1378
|
-
|
|
1379
|
-
|
|
1441
|
+
let element = yield this.host();
|
|
1442
|
+
if (option === null || option === void 0 ? void 0 : option.childSelector) {
|
|
1443
|
+
element = yield this.locatorForOptional(option.childSelector)();
|
|
1444
|
+
}
|
|
1445
|
+
return element ? element.text() : null;
|
|
1380
1446
|
});
|
|
1381
1447
|
}
|
|
1382
1448
|
}
|
|
@@ -1434,5 +1500,5 @@ DivHarness.hostSelector = 'div';
|
|
|
1434
1500
|
* Generated bundle index. Do not edit.
|
|
1435
1501
|
*/
|
|
1436
1502
|
|
|
1437
|
-
export { DivHarness, apimDefinition, apimFlow, apimPolicies, apimPropertyProviders, apimResourceTypes, fakeChannelFlow };
|
|
1503
|
+
export { DivHarness, apimDefinition, apimFlow, apimPolicies, apimPropertyProviders, apimResourceTypes, fakeChannelFlow, fakeHttpFlow, fakePlan };
|
|
1438
1504
|
//# sourceMappingURL=gravitee-ui-policy-studio-angular-testing.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gravitee-ui-policy-studio-angular-testing.mjs","sources":["../../../projects/ui-policy-studio-angular/src/lib/models/flow/Flow.fixture.ts","../../../projects/ui-policy-studio-angular/src/lib/models/flow/index-testing.ts","../../../projects/ui-policy-studio-angular/src/lib/models/index-testing.ts","../../../projects/ui-policy-studio-angular/src/testing/stories-resources/index.ts","../../../projects/ui-policy-studio-angular/src/testing/harnesses/div.harness.ts","../../../projects/ui-policy-studio-angular/src/testing/harnesses/index.ts","../../../projects/ui-policy-studio-angular/src/testing/index.ts","../../../projects/ui-policy-studio-angular/src/public-testing-api.ts","../../../projects/ui-policy-studio-angular/src/gravitee-ui-policy-studio-angular-testing.ts"],"sourcesContent":["/*\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 */\nimport { isFunction } from 'lodash';\n\nimport { Flow } from './Flow';\nimport { ChannelSelector } from './Selector';\n\nexport function fakeChannelFlow(modifier?: Partial<Flow> | ((baseApi: Flow) => Flow)): Flow {\n const channelSelector: ChannelSelector = {\n type: 'CHANNEL',\n channel: 'channel',\n channelOperator: 'EQUALS',\n entrypoints: ['entrypoint'],\n operations: ['PUBLISH'],\n };\n\n const base: Flow = {\n name: 'Flow name',\n selectors: [channelSelector],\n request: [],\n response: [],\n subscribe: [],\n publish: [],\n enabled: true,\n };\n\n if (isFunction(modifier)) {\n return modifier(base);\n }\n\n return {\n ...base,\n ...modifier,\n };\n}\n","/*\n * Copyright (C) 2022 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 */\nexport * from './Flow.fixture';\n","/*\n * Copyright (C) 2022 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 */\nexport * from './flow/index-testing';\n","/*\n * Copyright (C) 2022 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\nimport _apimPolicies from './apim-policies.json';\nimport _apimResourceTypes from './apim-resource-types.json';\nimport _apimDefinition from './apim-definition.json';\nimport _apimFlow from './apim-flow.json';\nimport _apimPropertyProviders from './apim-property-providers.json';\n\nexport const apimPolicies = _apimPolicies;\nexport const apimResourceTypes = _apimResourceTypes;\nexport const apimDefinition = _apimDefinition;\nexport const apimFlow = _apimFlow;\nexport const apimPropertyProviders = _apimPropertyProviders;\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 */\nimport { AsyncFactoryFn, BaseHarnessFilters, ComponentHarness, HarnessPredicate, HarnessQuery } from '@angular/cdk/testing';\n\nexport type DivHarnessFilters = BaseHarnessFilters;\n\nexport class DivHarness extends ComponentHarness {\n public static hostSelector = 'div';\n\n /**\n * Get Harness with the given filter.\n *\n * @param options Options for filtering which input instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n public static with(options: DivHarnessFilters = {}): HarnessPredicate<DivHarness> {\n return new HarnessPredicate(DivHarness, options);\n }\n\n public childLocatorFor<T extends ComponentHarness>(query: HarnessQuery<T>): AsyncFactoryFn<T> {\n return this.locatorFor(query);\n }\n\n public childLocatorForAll<T extends ComponentHarness>(query: HarnessQuery<T>): AsyncFactoryFn<T[]> {\n return this.locatorForAll(query);\n }\n\n public async getText(): Promise<string> {\n const hostText = await (await this.host()).text();\n return hostText;\n }\n}\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 */\nexport * from './div.harness';\n","/*\n * Copyright (C) 2022 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 */\nexport * from './stories-resources';\nexport * from './harnesses';\n","/*\n * Copyright (C) 2022 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 */\nexport * from './lib/models/index-testing';\nexport * from './testing';\n","/**\n * Generated bundle index. Do not edit.\n */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CAAC,CAAC;KAClD;IAEM,eAAe,CAA6B,KAAsB;QACvE,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;KAC/B;IAEM,kBAAkB,CAA6B,KAAsB;QAC1E,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;KAClC;IAEY,OAAO;;YAClB,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC;YAClD,OAAO,QAAQ,CAAC;SACjB;KAAA;;AAvBa,uBAAY,GAAG,KAAK;;ACpBpC;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;ACAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"gravitee-ui-policy-studio-angular-testing.mjs","sources":["../../../projects/ui-policy-studio-angular/src/lib/models/flow/Flow.fixture.ts","../../../projects/ui-policy-studio-angular/src/lib/models/flow/index-testing.ts","../../../projects/ui-policy-studio-angular/src/lib/models/plan/Plan.fixture.ts","../../../projects/ui-policy-studio-angular/src/lib/models/plan/index-testing.ts","../../../projects/ui-policy-studio-angular/src/lib/models/index-testing.ts","../../../projects/ui-policy-studio-angular/src/testing/stories-resources/index.ts","../../../projects/ui-policy-studio-angular/src/testing/harnesses/div.harness.ts","../../../projects/ui-policy-studio-angular/src/testing/harnesses/index.ts","../../../projects/ui-policy-studio-angular/src/testing/index.ts","../../../projects/ui-policy-studio-angular/src/public-testing-api.ts","../../../projects/ui-policy-studio-angular/src/gravitee-ui-policy-studio-angular-testing.ts"],"sourcesContent":["/*\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 */\nimport { isFunction } from 'lodash';\n\nimport { Flow } from './Flow';\nimport { ChannelSelector, HttpSelector } from './Selector';\n\nexport function fakeChannelFlow(modifier?: Partial<Flow> | ((baseApi: Flow) => Flow)): Flow {\n const channelSelector: ChannelSelector = {\n type: 'CHANNEL',\n channel: 'channel',\n channelOperator: 'EQUALS',\n entrypoints: ['entrypoint'],\n operations: ['PUBLISH'],\n };\n\n const base: Flow = {\n name: 'Flow name',\n selectors: [channelSelector],\n request: [],\n response: [],\n subscribe: [],\n publish: [],\n enabled: true,\n };\n\n if (isFunction(modifier)) {\n return modifier(base);\n }\n\n return {\n ...base,\n ...modifier,\n };\n}\n\nexport function fakeHttpFlow(modifier?: Partial<Flow> | ((baseApi: Flow) => Flow)): Flow {\n const httpSelector: HttpSelector = {\n type: 'HTTP',\n path: '/path',\n pathOperator: 'EQUALS',\n methods: ['GET'],\n };\n\n const base: Flow = {\n name: 'Flow name',\n selectors: [httpSelector],\n request: [],\n response: [],\n subscribe: [],\n publish: [],\n enabled: true,\n };\n\n if (isFunction(modifier)) {\n return modifier(base);\n }\n\n return {\n ...base,\n ...modifier,\n };\n}\n","/*\n * Copyright (C) 2022 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 */\nexport * from './Flow.fixture';\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 */\nimport { isFunction } from 'lodash';\n\nimport { Plan } from './Plan';\n\nexport function fakePlan(modifier?: Partial<Plan> | ((base: Plan) => Plan)): Plan {\n const base: Plan = {\n name: 'Keyless plan',\n flows: [],\n };\n\n if (isFunction(modifier)) {\n return modifier(base);\n }\n\n return {\n ...base,\n ...modifier,\n };\n}\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 */\nexport * from './Plan.fixture';\n","/*\n * Copyright (C) 2022 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 */\nexport * from './flow/index-testing';\nexport * from './plan/index-testing';\n","/*\n * Copyright (C) 2022 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\nimport _apimPolicies from './apim-policies.json';\nimport _apimResourceTypes from './apim-resource-types.json';\nimport _apimDefinition from './apim-definition.json';\nimport _apimFlow from './apim-flow.json';\nimport _apimPropertyProviders from './apim-property-providers.json';\n\nexport const apimPolicies = _apimPolicies;\nexport const apimResourceTypes = _apimResourceTypes;\nexport const apimDefinition = _apimDefinition;\nexport const apimFlow = _apimFlow;\nexport const apimPropertyProviders = _apimPropertyProviders;\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 */\nimport { AsyncFactoryFn, BaseHarnessFilters, ComponentHarness, HarnessPredicate, HarnessQuery, TestElement } from '@angular/cdk/testing';\n\nexport type DivHarnessFilters = BaseHarnessFilters & {\n /** Filters based on the text */\n text?: string | RegExp;\n};\n\nexport class DivHarness extends ComponentHarness {\n public static hostSelector = 'div';\n\n /**\n * Get Harness with the given filter.\n *\n * @param options Options for filtering which input instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n public static with(options: DivHarnessFilters = {}): HarnessPredicate<DivHarness> {\n return new HarnessPredicate(DivHarness, options).addOption('text', options.text, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getText(), text),\n );\n }\n\n public childLocatorFor<T extends ComponentHarness>(query: HarnessQuery<T>): AsyncFactoryFn<T> {\n return this.locatorFor(query);\n }\n\n public childLocatorForAll<T extends ComponentHarness>(query: HarnessQuery<T>): AsyncFactoryFn<T[]> {\n return this.locatorForAll(query);\n }\n\n public async getText(option?: { childSelector?: string }): Promise<string | null> {\n let element: TestElement | null = await this.host();\n if (option?.childSelector) {\n element = await this.locatorForOptional(option.childSelector)();\n }\n\n return element ? element.text() : null;\n }\n}\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 */\nexport * from './div.harness';\n","/*\n * Copyright (C) 2022 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 */\nexport * from './stories-resources';\nexport * from './harnesses';\n","/*\n * Copyright (C) 2022 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 */\nexport * from './lib/models/index-testing';\nexport * from './testing';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-testing-api';\n"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;SAoBgB,eAAe,CAAC,QAAoD;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gBACzB,OAAO,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;aACjE;YAED,OAAO,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC;SACxC;KAAA;;AA7Ba,uBAAY,GAAG,KAAK;;ACvBpC;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;ACAA;;;;;;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Input, NgModule } from '@angular/core';
|
|
2
|
+
import { EventEmitter, Component, Input, Output, NgModule } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/material/button';
|
|
4
4
|
import { MatButtonModule } from '@angular/material/button';
|
|
5
5
|
import { GioIconsModule } from '@gravitee/ui-particles-angular';
|
|
6
|
-
import * as
|
|
6
|
+
import * as i4 from '@angular/common';
|
|
7
7
|
import { CommonModule } from '@angular/common';
|
|
8
8
|
import * as i3 from '@angular/material/tooltip';
|
|
9
9
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
10
|
-
import { capitalize } from 'lodash';
|
|
10
|
+
import { capitalize, uniqueId } from 'lodash';
|
|
11
11
|
import * as i1 from '@angular/material/icon';
|
|
12
12
|
|
|
13
13
|
/*
|
|
@@ -26,6 +26,22 @@ import * as i1 from '@angular/material/icon';
|
|
|
26
26
|
* limitations under the License.
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
|
+
/*
|
|
30
|
+
* Copyright (C) 2023 The Gravitee team (http://gravitee.io)
|
|
31
|
+
*
|
|
32
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
33
|
+
* you may not use this file except in compliance with the License.
|
|
34
|
+
* You may obtain a copy of the License at
|
|
35
|
+
*
|
|
36
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
37
|
+
*
|
|
38
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
39
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
40
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
41
|
+
* See the License for the specific language governing permissions and
|
|
42
|
+
* limitations under the License.
|
|
43
|
+
*/
|
|
44
|
+
|
|
29
45
|
/*
|
|
30
46
|
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
31
47
|
*
|
|
@@ -59,16 +75,73 @@ import * as i1 from '@angular/material/icon';
|
|
|
59
75
|
*/
|
|
60
76
|
class GioPolicyStudioFlowsMenuComponent {
|
|
61
77
|
constructor() {
|
|
62
|
-
this.
|
|
78
|
+
this.flowsGroups = [];
|
|
79
|
+
this.selectedFlow = undefined;
|
|
80
|
+
this.selectedFlowChange = new EventEmitter();
|
|
81
|
+
this.flowGroupVMSelected = [];
|
|
82
|
+
}
|
|
83
|
+
ngOnChanges(changes) {
|
|
84
|
+
if (changes.flowsGroups || changes.selectedFlow) {
|
|
85
|
+
this.flowGroupVMSelected = this.flowsGroups.map(flowGroup => {
|
|
86
|
+
return Object.assign(Object.assign({}, flowGroup), { flows: flowGroup.flows.map(flow => {
|
|
87
|
+
var _a, _b, _c, _d, _e, _f;
|
|
88
|
+
const badges = [];
|
|
89
|
+
let pathOrChannelLabel = '';
|
|
90
|
+
const channelSelector = (_a = flow.selectors) === null || _a === void 0 ? void 0 : _a.find(s => s.type === 'CHANNEL');
|
|
91
|
+
if (channelSelector) {
|
|
92
|
+
const operationToBadge = {
|
|
93
|
+
PUBLISH: 'PUB',
|
|
94
|
+
SUBSCRIBE: 'SUB',
|
|
95
|
+
};
|
|
96
|
+
const operationBadges = (_b = channelSelector.operations) === null || _b === void 0 ? void 0 : _b.map(operation => ({
|
|
97
|
+
label: operationToBadge[operation],
|
|
98
|
+
class: 'gio-badge-neutral',
|
|
99
|
+
}));
|
|
100
|
+
operationBadges && badges.push(...operationBadges);
|
|
101
|
+
pathOrChannelLabel = `${channelSelector.channel}${channelSelector.channelOperator === 'STARTS_WITH' ? '**' : ''}`;
|
|
102
|
+
}
|
|
103
|
+
const httpSelector = (_c = flow.selectors) === null || _c === void 0 ? void 0 : _c.find(s => s.type === 'HTTP');
|
|
104
|
+
if (httpSelector) {
|
|
105
|
+
// Keep only 2 first http methods and add +X badge if there are more
|
|
106
|
+
const httpMethodsToKeep = (_d = httpSelector.methods) === null || _d === void 0 ? void 0 : _d.slice(0, 2);
|
|
107
|
+
const httpMethodsLength = (_e = httpSelector.methods) === null || _e === void 0 ? void 0 : _e.length;
|
|
108
|
+
httpMethodsToKeep &&
|
|
109
|
+
badges.push(...httpMethodsToKeep.map(method => ({ label: method, class: `gio-method-badge-${method.toLowerCase()}` })));
|
|
110
|
+
if (httpMethodsLength && httpMethodsLength > 2) {
|
|
111
|
+
badges === null || badges === void 0 ? void 0 : badges.push({
|
|
112
|
+
label: `+${httpMethodsLength - 2}`,
|
|
113
|
+
class: 'gio-badge-white',
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
if (httpMethodsLength === 0) {
|
|
117
|
+
badges === null || badges === void 0 ? void 0 : badges.push({
|
|
118
|
+
label: 'ALL',
|
|
119
|
+
class: 'gio-badge-white',
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
pathOrChannelLabel = `${httpSelector.path}${httpSelector.pathOperator === 'STARTS_WITH' ? '/**' : ''}`;
|
|
123
|
+
}
|
|
124
|
+
return Object.assign(Object.assign({}, flow), { selected: ((_f = this.selectedFlow) === null || _f === void 0 ? void 0 : _f._id) === flow._id, mouseOver: false, badges,
|
|
125
|
+
pathOrChannelLabel });
|
|
126
|
+
}) });
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
selectFlow(flow) {
|
|
131
|
+
this.selectedFlowChange.emit(flow);
|
|
63
132
|
}
|
|
64
133
|
}
|
|
65
134
|
GioPolicyStudioFlowsMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioFlowsMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
66
|
-
GioPolicyStudioFlowsMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioPolicyStudioFlowsMenuComponent, selector: "gio-ps-flows-menu", inputs: {
|
|
135
|
+
GioPolicyStudioFlowsMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioPolicyStudioFlowsMenuComponent, selector: "gio-ps-flows-menu", inputs: { flowsGroups: "flowsGroups", selectedFlow: "selectedFlow" }, outputs: { selectedFlowChange: "selectedFlowChange" }, usesOnChanges: true, ngImport: i0, template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n\n<div class=\"header\">\n <div class=\"header__label\">\n Flows <mat-icon svgIcon=\"gio:info\" matTooltip=\"Flows allow you to apply different policies on your API event phases\"></mat-icon>\n </div>\n <div class=\"header__configBtn\">\n <button mat-stroked-button mat-icon-button><mat-icon svgIcon=\"gio:settings\"></mat-icon></button>\n </div>\n</div>\n\n<div class=\"list\">\n <div *ngFor=\"let flowGroups of flowGroupVMSelected\" class=\"list__flowsGroup\">\n <div class=\"list__flowsGroup__header\">\n <div class=\"list__flowsGroup__header__label\">\n <mat-icon *ngIf=\"flowGroups.icon\" [svgIcon]=\"flowGroups.icon\"></mat-icon>\n <span>{{ flowGroups.name }}</span>\n </div>\n <div class=\"list__flowsGroup__header__addBtn\">\n <button mat-icon-button><mat-icon svgIcon=\"gio:plus\" matTooltip=\"New flow\"></mat-icon></button>\n </div>\n </div>\n\n <div\n *ngFor=\"let flow of flowGroups.flows\"\n class=\"list__flowsGroup__flow\"\n [class.selected]=\"flow.selected\"\n (click)=\"selectFlow(flow)\"\n (mouseout)=\"flow.mouseOver = false\"\n (mouseover)=\"flow.mouseOver = true\"\n >\n <div *ngIf=\"flow.name\" class=\"list__flowsGroup__flow__name\" [attr.title]=\"flow.name\">\n {{ flow.name }}\n </div>\n <div class=\"list__flowsGroup__flow__infos\">\n <div class=\"list__flowsGroup__flow__infos__badges\">\n <span *ngFor=\"let badge of flow.badges\" class=\"list__flowsGroup__flow__infos__badges__badge\" [ngClass]=\"badge.class\">{{\n badge.label\n }}</span>\n </div>\n <div class=\"list__flowsGroup__flow__infos__pathOrChannelLabel\">{{ flow.pathOrChannelLabel }}</div>\n </div>\n </div>\n </div>\n</div>\n", styles: [":host{display:flex;max-height:100%;flex-direction:column;padding-top:16px}.header{display:flex;align-items:center;padding:0 16px;margin-bottom:16px}.header__label{font:600 16px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;display:flex;flex:1 1 auto;align-items:center;margin-bottom:0;gap:8px}.header__configBtn{margin-left:8px}.list{padding:0 16px;overflow-y:overlay}.list__flowsGroup{display:flex;flex-direction:column;padding-bottom:8px;gap:8px}.list__flowsGroup__header{display:flex;align-items:center;padding:8px 8px 8px 10px;border-radius:8px;background-color:#cdc5f7}.list__flowsGroup__header__label{font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;display:flex;flex:1 1 auto;align-items:center;gap:8px}.list__flowsGroup__header__label>mat-icon{width:22px;height:22px;flex:0 0 auto}.list__flowsGroup__header__label>span{display:-webkit-box;overflow:hidden;flex:1 1 auto;-webkit-box-orient:vertical;-webkit-line-clamp:2}.list__flowsGroup__header__addBtn{margin-left:8px}.list__flowsGroup__flow{display:flex;height:68px;flex-direction:column;justify-content:center;padding:7px;border:1px solid #d3d5dc;border-radius:8px;gap:8px}.list__flowsGroup__flow:hover,.list__flowsGroup__flow.selected{padding:6px;border:2px solid #876fec;cursor:pointer}.list__flowsGroup__flow__name{overflow:hidden;padding-left:4px;text-overflow:ellipsis;white-space:nowrap}.list__flowsGroup__flow__infos{display:flex;align-items:center}.list__flowsGroup__flow__infos__badges{flex:0 0 auto}.list__flowsGroup__flow__infos__badges__badge{width:auto}.list__flowsGroup__flow__infos__pathOrChannelLabel{flex:1 1 auto}\n"], components: [{ type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
67
136
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioFlowsMenuComponent, decorators: [{
|
|
68
137
|
type: Component,
|
|
69
|
-
args: [{ selector: 'gio-ps-flows-menu', template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n\n<div class=\"header\">\n <div class=\"header__label\">\n Flows <mat-icon svgIcon=\"gio:info\" matTooltip=\"Flows allow you to apply different policies on your API event phases\"></mat-icon>\n </div>\n <div class=\"header__configBtn\">\n <button mat-stroked-button mat-icon-button><mat-icon svgIcon=\"gio:settings\"></mat-icon></button>\n </div>\n</div>\n\n<div class=\"list\">\n <div class=\"list__flowsGroup\">\n <div class=\"list__flowsGroup__header\">\n <div class=\"list__flowsGroup__header__label\">
|
|
70
|
-
}], propDecorators: {
|
|
138
|
+
args: [{ selector: 'gio-ps-flows-menu', template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n\n<div class=\"header\">\n <div class=\"header__label\">\n Flows <mat-icon svgIcon=\"gio:info\" matTooltip=\"Flows allow you to apply different policies on your API event phases\"></mat-icon>\n </div>\n <div class=\"header__configBtn\">\n <button mat-stroked-button mat-icon-button><mat-icon svgIcon=\"gio:settings\"></mat-icon></button>\n </div>\n</div>\n\n<div class=\"list\">\n <div *ngFor=\"let flowGroups of flowGroupVMSelected\" class=\"list__flowsGroup\">\n <div class=\"list__flowsGroup__header\">\n <div class=\"list__flowsGroup__header__label\">\n <mat-icon *ngIf=\"flowGroups.icon\" [svgIcon]=\"flowGroups.icon\"></mat-icon>\n <span>{{ flowGroups.name }}</span>\n </div>\n <div class=\"list__flowsGroup__header__addBtn\">\n <button mat-icon-button><mat-icon svgIcon=\"gio:plus\" matTooltip=\"New flow\"></mat-icon></button>\n </div>\n </div>\n\n <div\n *ngFor=\"let flow of flowGroups.flows\"\n class=\"list__flowsGroup__flow\"\n [class.selected]=\"flow.selected\"\n (click)=\"selectFlow(flow)\"\n (mouseout)=\"flow.mouseOver = false\"\n (mouseover)=\"flow.mouseOver = true\"\n >\n <div *ngIf=\"flow.name\" class=\"list__flowsGroup__flow__name\" [attr.title]=\"flow.name\">\n {{ flow.name }}\n </div>\n <div class=\"list__flowsGroup__flow__infos\">\n <div class=\"list__flowsGroup__flow__infos__badges\">\n <span *ngFor=\"let badge of flow.badges\" class=\"list__flowsGroup__flow__infos__badges__badge\" [ngClass]=\"badge.class\">{{\n badge.label\n }}</span>\n </div>\n <div class=\"list__flowsGroup__flow__infos__pathOrChannelLabel\">{{ flow.pathOrChannelLabel }}</div>\n </div>\n </div>\n </div>\n</div>\n", styles: [":host{display:flex;max-height:100%;flex-direction:column;padding-top:16px}.header{display:flex;align-items:center;padding:0 16px;margin-bottom:16px}.header__label{font:600 16px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;display:flex;flex:1 1 auto;align-items:center;margin-bottom:0;gap:8px}.header__configBtn{margin-left:8px}.list{padding:0 16px;overflow-y:overlay}.list__flowsGroup{display:flex;flex-direction:column;padding-bottom:8px;gap:8px}.list__flowsGroup__header{display:flex;align-items:center;padding:8px 8px 8px 10px;border-radius:8px;background-color:#cdc5f7}.list__flowsGroup__header__label{font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;display:flex;flex:1 1 auto;align-items:center;gap:8px}.list__flowsGroup__header__label>mat-icon{width:22px;height:22px;flex:0 0 auto}.list__flowsGroup__header__label>span{display:-webkit-box;overflow:hidden;flex:1 1 auto;-webkit-box-orient:vertical;-webkit-line-clamp:2}.list__flowsGroup__header__addBtn{margin-left:8px}.list__flowsGroup__flow{display:flex;height:68px;flex-direction:column;justify-content:center;padding:7px;border:1px solid #d3d5dc;border-radius:8px;gap:8px}.list__flowsGroup__flow:hover,.list__flowsGroup__flow.selected{padding:6px;border:2px solid #876fec;cursor:pointer}.list__flowsGroup__flow__name{overflow:hidden;padding-left:4px;text-overflow:ellipsis;white-space:nowrap}.list__flowsGroup__flow__infos{display:flex;align-items:center}.list__flowsGroup__flow__infos__badges{flex:0 0 auto}.list__flowsGroup__flow__infos__badges__badge{width:auto}.list__flowsGroup__flow__infos__pathOrChannelLabel{flex:1 1 auto}\n"] }]
|
|
139
|
+
}], propDecorators: { flowsGroups: [{
|
|
140
|
+
type: Input
|
|
141
|
+
}], selectedFlow: [{
|
|
71
142
|
type: Input
|
|
143
|
+
}], selectedFlowChange: [{
|
|
144
|
+
type: Output
|
|
72
145
|
}] } });
|
|
73
146
|
|
|
74
147
|
/*
|
|
@@ -88,15 +161,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
88
161
|
*/
|
|
89
162
|
class GioPolicyStudioDetailsComponent {
|
|
90
163
|
constructor() {
|
|
91
|
-
this.
|
|
164
|
+
this.flow = undefined;
|
|
92
165
|
}
|
|
93
166
|
}
|
|
94
167
|
GioPolicyStudioDetailsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioDetailsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
95
|
-
GioPolicyStudioDetailsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioPolicyStudioDetailsComponent, selector: "gio-ps-flow-details", inputs: {
|
|
168
|
+
GioPolicyStudioDetailsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioPolicyStudioDetailsComponent, selector: "gio-ps-flow-details", inputs: { flow: "flow" }, ngImport: i0, template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n<ng-container *ngIf=\"flow; else emptyFlows\">\n <div class=\"header\">\n <div class=\"mat-h4\">Flow details</div>\n </div>\n\n <div class=\"content\">\n \uD83D\uDEA7 Work in progress \uD83D\uDEA7 <br />\n {{ flow | json }}\n </div>\n</ng-container>\n\n<ng-template #emptyFlows>\n <div class=\"emptyFlows\">\n <h2>No flows yet</h2>\n <p class=\"mat-body-1\">Flows allow you to customize the behavior of your API event phases through configurable policies</p>\n </div>\n</ng-template>\n", styles: [".emptyFlows{display:flex;width:500px;height:100%;flex-direction:column;justify-content:center;margin:auto;text-align:center}\n"], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "json": i4.JsonPipe } });
|
|
96
169
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioDetailsComponent, decorators: [{
|
|
97
170
|
type: Component,
|
|
98
|
-
args: [{ selector: 'gio-ps-flow-details', template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n<ng-container *ngIf=\"
|
|
99
|
-
}], propDecorators: {
|
|
171
|
+
args: [{ selector: 'gio-ps-flow-details', template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n<ng-container *ngIf=\"flow; else emptyFlows\">\n <div class=\"header\">\n <div class=\"mat-h4\">Flow details</div>\n </div>\n\n <div class=\"content\">\n \uD83D\uDEA7 Work in progress \uD83D\uDEA7 <br />\n {{ flow | json }}\n </div>\n</ng-container>\n\n<ng-template #emptyFlows>\n <div class=\"emptyFlows\">\n <h2>No flows yet</h2>\n <p class=\"mat-body-1\">Flows allow you to customize the behavior of your API event phases through configurable policies</p>\n </div>\n</ng-template>\n", styles: [".emptyFlows{display:flex;width:500px;height:100%;flex-direction:column;justify-content:center;margin:auto;text-align:center}\n"] }]
|
|
172
|
+
}], propDecorators: { flow: [{
|
|
100
173
|
type: Input
|
|
101
174
|
}] } });
|
|
102
175
|
|
|
@@ -125,31 +198,60 @@ class GioPolicyStudioComponent {
|
|
|
125
198
|
* List of endpoints to display
|
|
126
199
|
*/
|
|
127
200
|
this.endpointsInfo = [];
|
|
128
|
-
this.
|
|
201
|
+
this.commonFlows = [];
|
|
202
|
+
this.plans = [];
|
|
129
203
|
this.connectorsTooltip = '';
|
|
204
|
+
this.selectedFlow = undefined;
|
|
205
|
+
this.flowsGroups = [];
|
|
130
206
|
}
|
|
131
207
|
ngOnChanges(changes) {
|
|
208
|
+
var _a, _b, _c, _d;
|
|
132
209
|
if (changes.entrypointsInfo || changes.endpointsInfo) {
|
|
133
|
-
this.connectorsTooltip = `Entrypoints: ${this.entrypointsInfo
|
|
210
|
+
this.connectorsTooltip = `Entrypoints: ${((_a = this.entrypointsInfo) !== null && _a !== void 0 ? _a : []).map(e => capitalize(e.type)).join(', ')}\nEndpoints: ${((_b = this.endpointsInfo) !== null && _b !== void 0 ? _b : [])
|
|
134
211
|
.map(e => capitalize(e.type))
|
|
135
|
-
.join(', ')}
|
|
212
|
+
.join(', ')}`;
|
|
213
|
+
}
|
|
214
|
+
if (changes.commonFlows || changes.plans) {
|
|
215
|
+
this.flowsGroups = getFlowsGroups(this.commonFlows, this.plans);
|
|
216
|
+
// Select first flow by default on first load
|
|
217
|
+
if (((_c = changes.commonFlows) === null || _c === void 0 ? void 0 : _c.isFirstChange()) || ((_d = changes.plans) === null || _d === void 0 ? void 0 : _d.isFirstChange())) {
|
|
218
|
+
this.selectedFlow = this.flowsGroups[0].flows[0];
|
|
219
|
+
}
|
|
136
220
|
}
|
|
137
221
|
}
|
|
138
222
|
}
|
|
139
223
|
GioPolicyStudioComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
140
|
-
GioPolicyStudioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioPolicyStudioComponent, selector: "gio-policy-studio", inputs: { apiType: "apiType", entrypointsInfo: "entrypointsInfo", endpointsInfo: "endpointsInfo",
|
|
224
|
+
GioPolicyStudioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioPolicyStudioComponent, selector: "gio-policy-studio", inputs: { apiType: "apiType", entrypointsInfo: "entrypointsInfo", endpointsInfo: "endpointsInfo", commonFlows: "commonFlows", plans: "plans" }, usesOnChanges: true, ngImport: i0, template: "<!--\n\n Copyright (C) 2015 The Gravitee team (http://gravitee.io)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n\n<div class=\"header\">\n <div class=\"header__apiInfo\">\n <span class=\"gio-badge-primary\">\n {{ apiType | titlecase }}\n </span>\n <span\n class=\"gio-badge-neutral\"\n [matTooltip]=\"connectorsTooltip\"\n matTooltipPosition=\"right\"\n matTooltipClass=\"gio-policy-studio__tooltip-line-break\"\n >\n <mat-icon *ngFor=\"let entrypoint of entrypointsInfo\" class=\"gio-left\" [svgIcon]=\"entrypoint.icon\"></mat-icon>\n <mat-icon *ngFor=\"let endpoint of endpointsInfo\" class=\"gio-left\" [svgIcon]=\"endpoint.icon\"></mat-icon>\n </span>\n </div>\n\n <div class=\"header__btn\">\n <button mat-stroked-button color=\"primary\">Save</button>\n </div>\n</div>\n\n<div class=\"wrapper\">\n <div class=\"wrapper__flowsMenu\">\n <gio-ps-flows-menu [flowsGroups]=\"flowsGroups\" [(selectedFlow)]=\"selectedFlow\"></gio-ps-flows-menu>\n </div>\n\n <div class=\"wrapper__flowDetails\">\n <gio-ps-flow-details [flow]=\"selectedFlow\"></gio-ps-flow-details>\n </div>\n</div>\n", styles: [":host{display:flex;height:100%;flex-direction:column;padding:8px;background-color:#fff}::ng-deep .gio-policy-studio__tooltip-line-break{white-space:pre-line}.header{display:flex;align-items:center;padding-bottom:16px}.header__apiInfo{flex:1 1 auto}.wrapper{display:flex;min-height:0;flex-direction:row;gap:16px}.wrapper__flowsMenu{max-width:400px;flex:0 1 400px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__flowDetails{flex:1 1 auto;padding:16px;border:1px solid #d3d5dc;border-radius:8px}\n"], components: [{ type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: GioPolicyStudioFlowsMenuComponent, selector: "gio-ps-flows-menu", inputs: ["flowsGroups", "selectedFlow"], outputs: ["selectedFlowChange"] }, { type: GioPolicyStudioDetailsComponent, selector: "gio-ps-flow-details", inputs: ["flow"] }], directives: [{ type: i3.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "titlecase": i4.TitleCasePipe } });
|
|
141
225
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioComponent, decorators: [{
|
|
142
226
|
type: Component,
|
|
143
|
-
args: [{ selector: 'gio-policy-studio', template: "<!--\n\n Copyright (C) 2015 The Gravitee team (http://gravitee.io)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n\n<div class=\"header\">\n <div class=\"header__apiInfo\">\n <span class=\"gio-badge-primary\">\n {{ apiType | titlecase }}\n </span>\n <span\n class=\"gio-badge-neutral\"\n [matTooltip]=\"connectorsTooltip\"\n matTooltipPosition=\"right\"\n matTooltipClass=\"gio-policy-studio__tooltip-line-break\"\n >\n <mat-icon *ngFor=\"let entrypoint of entrypointsInfo\" class=\"gio-left\" [svgIcon]=\"entrypoint.icon\"></mat-icon>\n <mat-icon *ngFor=\"let endpoint of endpointsInfo\" class=\"gio-left\" [svgIcon]=\"endpoint.icon\"></mat-icon>\n </span>\n </div>\n\n <div class=\"header__btn\">\n <button mat-stroked-button color=\"primary\">Save</button>\n </div>\n</div>\n\n<div class=\"wrapper\">\n <div class=\"wrapper__flowsMenu\">\n <gio-ps-flows-menu [
|
|
227
|
+
args: [{ selector: 'gio-policy-studio', template: "<!--\n\n Copyright (C) 2015 The Gravitee team (http://gravitee.io)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n\n<div class=\"header\">\n <div class=\"header__apiInfo\">\n <span class=\"gio-badge-primary\">\n {{ apiType | titlecase }}\n </span>\n <span\n class=\"gio-badge-neutral\"\n [matTooltip]=\"connectorsTooltip\"\n matTooltipPosition=\"right\"\n matTooltipClass=\"gio-policy-studio__tooltip-line-break\"\n >\n <mat-icon *ngFor=\"let entrypoint of entrypointsInfo\" class=\"gio-left\" [svgIcon]=\"entrypoint.icon\"></mat-icon>\n <mat-icon *ngFor=\"let endpoint of endpointsInfo\" class=\"gio-left\" [svgIcon]=\"endpoint.icon\"></mat-icon>\n </span>\n </div>\n\n <div class=\"header__btn\">\n <button mat-stroked-button color=\"primary\">Save</button>\n </div>\n</div>\n\n<div class=\"wrapper\">\n <div class=\"wrapper__flowsMenu\">\n <gio-ps-flows-menu [flowsGroups]=\"flowsGroups\" [(selectedFlow)]=\"selectedFlow\"></gio-ps-flows-menu>\n </div>\n\n <div class=\"wrapper__flowDetails\">\n <gio-ps-flow-details [flow]=\"selectedFlow\"></gio-ps-flow-details>\n </div>\n</div>\n", styles: [":host{display:flex;height:100%;flex-direction:column;padding:8px;background-color:#fff}::ng-deep .gio-policy-studio__tooltip-line-break{white-space:pre-line}.header{display:flex;align-items:center;padding-bottom:16px}.header__apiInfo{flex:1 1 auto}.wrapper{display:flex;min-height:0;flex-direction:row;gap:16px}.wrapper__flowsMenu{max-width:400px;flex:0 1 400px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__flowDetails{flex:1 1 auto;padding:16px;border:1px solid #d3d5dc;border-radius:8px}\n"] }]
|
|
144
228
|
}], propDecorators: { apiType: [{
|
|
145
229
|
type: Input
|
|
146
230
|
}], entrypointsInfo: [{
|
|
147
231
|
type: Input
|
|
148
232
|
}], endpointsInfo: [{
|
|
149
233
|
type: Input
|
|
150
|
-
}],
|
|
234
|
+
}], commonFlows: [{
|
|
235
|
+
type: Input
|
|
236
|
+
}], plans: [{
|
|
151
237
|
type: Input
|
|
152
238
|
}] } });
|
|
239
|
+
const getFlowsGroups = (commonFlows = [], plans = []) => {
|
|
240
|
+
const commFlowsGroup = {
|
|
241
|
+
_id: 'flowsGroup_commonFlow',
|
|
242
|
+
name: 'Common flows',
|
|
243
|
+
flows: commonFlows.map(flow => (Object.assign(Object.assign({}, flow), { _id: uniqueId('flow_') }))),
|
|
244
|
+
};
|
|
245
|
+
return [
|
|
246
|
+
...plans.map(plan => ({
|
|
247
|
+
_id: uniqueId('flowsGroup_'),
|
|
248
|
+
name: plan.name,
|
|
249
|
+
icon: 'gio:shield',
|
|
250
|
+
flows: plan.flows.map(flow => (Object.assign(Object.assign({}, flow), { _id: uniqueId('flow_') }))),
|
|
251
|
+
})),
|
|
252
|
+
commFlowsGroup,
|
|
253
|
+
];
|
|
254
|
+
};
|
|
153
255
|
|
|
154
256
|
/*
|
|
155
257
|
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|