@gravitee/ui-policy-studio-angular 7.1.0 → 7.2.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/lib/components/flow-details/gio-ps-flow-details.component.mjs +5 -5
- package/esm2020/lib/components/flows-menu/gio-ps-flows-menu.component.mjs +33 -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/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/FlowExecution.mjs +17 -0
- 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 +50 -5
- package/fesm2015/gravitee-ui-policy-studio-angular-testing.mjs.map +1 -1
- package/fesm2015/gravitee-ui-policy-studio-angular.mjs +82 -17
- package/fesm2015/gravitee-ui-policy-studio-angular.mjs.map +1 -1
- package/fesm2020/gravitee-ui-policy-studio-angular-testing.mjs +53 -5
- package/fesm2020/gravitee-ui-policy-studio-angular-testing.mjs.map +1 -1
- package/fesm2020/gravitee-ui-policy-studio-angular.mjs +103 -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 +18 -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/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/FlowExecution.d.ts +11 -0
- 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
|
@@ -56,6 +56,48 @@ function fakeChannelFlow(modifier) {
|
|
|
56
56
|
* limitations under the License.
|
|
57
57
|
*/
|
|
58
58
|
|
|
59
|
+
/*
|
|
60
|
+
* Copyright (C) 2023 The Gravitee team (http://gravitee.io)
|
|
61
|
+
*
|
|
62
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
63
|
+
* you may not use this file except in compliance with the License.
|
|
64
|
+
* You may obtain a copy of the License at
|
|
65
|
+
*
|
|
66
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
67
|
+
*
|
|
68
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
69
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
70
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
71
|
+
* See the License for the specific language governing permissions and
|
|
72
|
+
* limitations under the License.
|
|
73
|
+
*/
|
|
74
|
+
function fakePlan(modifier) {
|
|
75
|
+
const base = {
|
|
76
|
+
name: 'Keyless plan',
|
|
77
|
+
flows: [],
|
|
78
|
+
};
|
|
79
|
+
if (isFunction(modifier)) {
|
|
80
|
+
return modifier(base);
|
|
81
|
+
}
|
|
82
|
+
return Object.assign(Object.assign({}, base), modifier);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/*
|
|
86
|
+
* Copyright (C) 2023 The Gravitee team (http://gravitee.io)
|
|
87
|
+
*
|
|
88
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
89
|
+
* you may not use this file except in compliance with the License.
|
|
90
|
+
* You may obtain a copy of the License at
|
|
91
|
+
*
|
|
92
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
93
|
+
*
|
|
94
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
95
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
96
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
97
|
+
* See the License for the specific language governing permissions and
|
|
98
|
+
* limitations under the License.
|
|
99
|
+
*/
|
|
100
|
+
|
|
59
101
|
/*
|
|
60
102
|
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
61
103
|
*
|
|
@@ -1365,7 +1407,7 @@ class DivHarness extends ComponentHarness {
|
|
|
1365
1407
|
* @return a `HarnessPredicate` configured with the given options.
|
|
1366
1408
|
*/
|
|
1367
1409
|
static with(options = {}) {
|
|
1368
|
-
return new HarnessPredicate(DivHarness, options);
|
|
1410
|
+
return new HarnessPredicate(DivHarness, options).addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text));
|
|
1369
1411
|
}
|
|
1370
1412
|
childLocatorFor(query) {
|
|
1371
1413
|
return this.locatorFor(query);
|
|
@@ -1373,10 +1415,13 @@ class DivHarness extends ComponentHarness {
|
|
|
1373
1415
|
childLocatorForAll(query) {
|
|
1374
1416
|
return this.locatorForAll(query);
|
|
1375
1417
|
}
|
|
1376
|
-
getText() {
|
|
1418
|
+
getText(option) {
|
|
1377
1419
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1378
|
-
|
|
1379
|
-
|
|
1420
|
+
let element = yield this.host();
|
|
1421
|
+
if (option === null || option === void 0 ? void 0 : option.childSelector) {
|
|
1422
|
+
element = yield this.locatorForOptional(option.childSelector)();
|
|
1423
|
+
}
|
|
1424
|
+
return element ? element.text() : null;
|
|
1380
1425
|
});
|
|
1381
1426
|
}
|
|
1382
1427
|
}
|
|
@@ -1434,5 +1479,5 @@ DivHarness.hostSelector = 'div';
|
|
|
1434
1479
|
* Generated bundle index. Do not edit.
|
|
1435
1480
|
*/
|
|
1436
1481
|
|
|
1437
|
-
export { DivHarness, apimDefinition, apimFlow, apimPolicies, apimPropertyProviders, apimResourceTypes, fakeChannelFlow };
|
|
1482
|
+
export { DivHarness, apimDefinition, apimFlow, apimPolicies, apimPropertyProviders, apimResourceTypes, fakeChannelFlow, fakePlan };
|
|
1438
1483
|
//# 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 */\n\nexport * from './public-testing-api';\n"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;SAoBgB,eAAe,CAAC,QAAoD;IAClF,MAAM,eAAe,GAAoB;QACvC,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,SAAS;QAClB,eAAe,EAAE,QAAQ;QACzB,WAAW,EAAE,CAAC,YAAY,CAAC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AQ,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 } 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) 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;IAClF,MAAM,eAAe,GAAoB;QACvC,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,SAAS;QAClB,eAAe,EAAE,QAAQ;QACzB,WAAW,EAAE,CAAC,YAAY,CAAC;QAC3B,UAAU,EAAE,CAAC,SAAS,CAAC;KACxB,CAAC;IAEF,MAAM,IAAI,GAAS;QACjB,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,CAAC,eAAe,CAAC;QAC5B,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,IAAI;KACd,CAAC;IAEF,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE;QACxB,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;KACvB;IAED,uCACK,IAAI,GACJ,QAAQ,EACX;AACJ;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AC,KAAK,CAAC,CAAC;KAClC;IAEY,OAAO,CAAC,MAAmC;;YACtD,IAAI,OAAO,GAAuB,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;YACpD,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,aAAa,EAAE;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,36 @@ 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;
|
|
88
|
+
return Object.assign(Object.assign({}, flow), { selected: ((_a = this.selectedFlow) === null || _a === void 0 ? void 0 : _a._id) === flow._id, mouseOver: false });
|
|
89
|
+
}) });
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
selectFlow(flow) {
|
|
94
|
+
this.selectedFlowChange.emit(flow);
|
|
63
95
|
}
|
|
64
96
|
}
|
|
65
97
|
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: {
|
|
98
|
+
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 [ngClass]=\"flow.mouseOver || flow.selected ? 'gio-badge-white' : 'gio-badge-neutral'\">SUB</span>\n </div>\n <div class=\"list__flowsGroup__flow__infos__channelName\">My channel</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:#e9f6ff}.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:8px;border-radius:8px;gap:8px}.list__flowsGroup__flow:hover,.list__flowsGroup__flow.selected{background-color:#e7e8ef;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__channelName{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
99
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioFlowsMenuComponent, decorators: [{
|
|
68
100
|
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: {
|
|
101
|
+
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 [ngClass]=\"flow.mouseOver || flow.selected ? 'gio-badge-white' : 'gio-badge-neutral'\">SUB</span>\n </div>\n <div class=\"list__flowsGroup__flow__infos__channelName\">My channel</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:#e9f6ff}.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:8px;border-radius:8px;gap:8px}.list__flowsGroup__flow:hover,.list__flowsGroup__flow.selected{background-color:#e7e8ef;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__channelName{flex:1 1 auto}\n"] }]
|
|
102
|
+
}], propDecorators: { flowsGroups: [{
|
|
103
|
+
type: Input
|
|
104
|
+
}], selectedFlow: [{
|
|
71
105
|
type: Input
|
|
106
|
+
}], selectedFlowChange: [{
|
|
107
|
+
type: Output
|
|
72
108
|
}] } });
|
|
73
109
|
|
|
74
110
|
/*
|
|
@@ -88,15 +124,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
88
124
|
*/
|
|
89
125
|
class GioPolicyStudioDetailsComponent {
|
|
90
126
|
constructor() {
|
|
91
|
-
this.
|
|
127
|
+
this.flow = undefined;
|
|
92
128
|
}
|
|
93
129
|
}
|
|
94
130
|
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: {
|
|
131
|
+
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
132
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioDetailsComponent, decorators: [{
|
|
97
133
|
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: {
|
|
134
|
+
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"] }]
|
|
135
|
+
}], propDecorators: { flow: [{
|
|
100
136
|
type: Input
|
|
101
137
|
}] } });
|
|
102
138
|
|
|
@@ -125,31 +161,60 @@ class GioPolicyStudioComponent {
|
|
|
125
161
|
* List of endpoints to display
|
|
126
162
|
*/
|
|
127
163
|
this.endpointsInfo = [];
|
|
128
|
-
this.
|
|
164
|
+
this.commonFlows = [];
|
|
165
|
+
this.plans = [];
|
|
129
166
|
this.connectorsTooltip = '';
|
|
167
|
+
this.selectedFlow = undefined;
|
|
168
|
+
this.flowsGroups = [];
|
|
130
169
|
}
|
|
131
170
|
ngOnChanges(changes) {
|
|
171
|
+
var _a, _b, _c, _d;
|
|
132
172
|
if (changes.entrypointsInfo || changes.endpointsInfo) {
|
|
133
|
-
this.connectorsTooltip = `Entrypoints: ${this.entrypointsInfo
|
|
173
|
+
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
174
|
.map(e => capitalize(e.type))
|
|
135
|
-
.join(', ')}
|
|
175
|
+
.join(', ')}`;
|
|
176
|
+
}
|
|
177
|
+
if (changes.commonFlows || changes.plans) {
|
|
178
|
+
this.flowsGroups = getFlowsGroups(this.commonFlows, this.plans);
|
|
179
|
+
// Select first flow by default on first load
|
|
180
|
+
if (((_c = changes.commonFlows) === null || _c === void 0 ? void 0 : _c.isFirstChange()) || ((_d = changes.plans) === null || _d === void 0 ? void 0 : _d.isFirstChange())) {
|
|
181
|
+
this.selectedFlow = this.flowsGroups[0].flows[0];
|
|
182
|
+
}
|
|
136
183
|
}
|
|
137
184
|
}
|
|
138
185
|
}
|
|
139
186
|
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",
|
|
187
|
+
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
188
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioComponent, decorators: [{
|
|
142
189
|
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 [
|
|
190
|
+
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
191
|
}], propDecorators: { apiType: [{
|
|
145
192
|
type: Input
|
|
146
193
|
}], entrypointsInfo: [{
|
|
147
194
|
type: Input
|
|
148
195
|
}], endpointsInfo: [{
|
|
149
196
|
type: Input
|
|
150
|
-
}],
|
|
197
|
+
}], commonFlows: [{
|
|
198
|
+
type: Input
|
|
199
|
+
}], plans: [{
|
|
151
200
|
type: Input
|
|
152
201
|
}] } });
|
|
202
|
+
const getFlowsGroups = (commonFlows = [], plans = []) => {
|
|
203
|
+
const commFlowsGroup = {
|
|
204
|
+
_id: 'flowsGroup_commonFlow',
|
|
205
|
+
name: 'Common flows',
|
|
206
|
+
flows: commonFlows.map(flow => (Object.assign(Object.assign({}, flow), { _id: uniqueId('flow_') }))),
|
|
207
|
+
};
|
|
208
|
+
return [
|
|
209
|
+
...plans.map(plan => ({
|
|
210
|
+
_id: uniqueId('flowsGroup_'),
|
|
211
|
+
name: plan.name,
|
|
212
|
+
icon: 'gio:shield',
|
|
213
|
+
flows: plan.flows.map(flow => (Object.assign(Object.assign({}, flow), { _id: uniqueId('flow_') }))),
|
|
214
|
+
})),
|
|
215
|
+
commFlowsGroup,
|
|
216
|
+
];
|
|
217
|
+
};
|
|
153
218
|
|
|
154
219
|
/*
|
|
155
220
|
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gravitee-ui-policy-studio-angular.mjs","sources":["../../../projects/ui-policy-studio-angular/src/lib/models/flow/index.ts","../../../projects/ui-policy-studio-angular/src/lib/models/index.ts","../../../projects/ui-policy-studio-angular/src/lib/components/flows-menu/gio-ps-flows-menu.component.ts","../../../projects/ui-policy-studio-angular/src/lib/components/flows-menu/gio-ps-flows-menu.component.html","../../../projects/ui-policy-studio-angular/src/lib/components/flow-details/gio-ps-flow-details.component.ts","../../../projects/ui-policy-studio-angular/src/lib/components/flow-details/gio-ps-flow-details.component.html","../../../projects/ui-policy-studio-angular/src/lib/gio-policy-studio.component.ts","../../../projects/ui-policy-studio-angular/src/lib/gio-policy-studio.component.html","../../../projects/ui-policy-studio-angular/src/lib/gio-policy-studio.module.ts","../../../projects/ui-policy-studio-angular/src/public-api.ts","../../../projects/ui-policy-studio-angular/src/gravitee-ui-policy-studio-angular.ts"],"sourcesContent":["/*\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 './ApiType';\nexport * from './Flow';\nexport * from './FlowExecution';\nexport * from './HttpMethod';\nexport * from './Selector';\nexport * from './Step';\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';\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 */\nimport { Component, Input } from '@angular/core';\n\nimport { Flow } from '../../models';\n\n@Component({\n selector: 'gio-ps-flows-menu',\n templateUrl: './gio-ps-flows-menu.component.html',\n styleUrls: ['./gio-ps-flows-menu.component.scss'],\n})\nexport class GioPolicyStudioFlowsMenuComponent {\n @Input()\n public flows: Flow[] = [];\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\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\">Common flows</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 </div>\n</div>\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 */\nimport { Component, Input } from '@angular/core';\n\nimport { Flow } from '../../models';\n\n@Component({\n selector: 'gio-ps-flow-details',\n templateUrl: './gio-ps-flow-details.component.html',\n styleUrls: ['./gio-ps-flow-details.component.scss'],\n})\nexport class GioPolicyStudioDetailsComponent {\n @Input()\n public flows: Flow[] = [];\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\n-->\n<ng-container *ngIf=\"flows.length; else emptyFlows\">\n <div class=\"header\">\n <div class=\"mat-h4\">Flow details</div>\n </div>\n\n <div class=\"content\">🚧 Work in progress 🚧</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","/*\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 */\nimport { Component, Input, OnChanges, SimpleChanges } from '@angular/core';\nimport { capitalize } from 'lodash';\n\nimport { ApiType, Flow } from './models';\n\nexport interface ConnectorsInfo {\n type: string;\n icon: string;\n}\n\n@Component({\n selector: 'gio-policy-studio',\n templateUrl: './gio-policy-studio.component.html',\n styleUrls: ['./gio-policy-studio.component.scss'],\n})\nexport class GioPolicyStudioComponent implements OnChanges {\n @Input()\n public apiType!: ApiType;\n\n /**\n * List of entrypoints to display\n */\n @Input()\n public entrypointsInfo: ConnectorsInfo[] = [];\n\n /**\n * List of endpoints to display\n */\n @Input()\n public endpointsInfo: ConnectorsInfo[] = [];\n\n @Input()\n public flows: Flow[] = [];\n\n public connectorsTooltip = '';\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.entrypointsInfo || changes.endpointsInfo) {\n this.connectorsTooltip = `Entrypoints: ${this.entrypointsInfo\n .map(e => capitalize(e.type))\n .join(', ')}\\nEndpoints: ${this.endpointsInfo.map(e => capitalize(e.type)).join(', ')}`;\n }\n }\n}\n","<!--\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 [flows]=\"flows\"></gio-ps-flows-menu>\n </div>\n\n <div class=\"wrapper__flowDetails\">\n <gio-ps-flow-details></gio-ps-flow-details>\n </div>\n</div>\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 */\nimport { NgModule } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { GioIconsModule } from '@gravitee/ui-particles-angular';\nimport { CommonModule } from '@angular/common';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\nimport { GioPolicyStudioComponent } from './gio-policy-studio.component';\nimport { GioPolicyStudioFlowsMenuComponent } from './components/flows-menu/gio-ps-flows-menu.component';\nimport { GioPolicyStudioDetailsComponent } from './components/flow-details/gio-ps-flow-details.component';\n\n@NgModule({\n declarations: [GioPolicyStudioComponent, GioPolicyStudioFlowsMenuComponent, GioPolicyStudioDetailsComponent],\n imports: [CommonModule, MatButtonModule, MatTooltipModule, GioIconsModule],\n exports: [GioPolicyStudioComponent],\n})\nexport class GioPolicyStudioModule {}\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/*\n * Public API Surface of ui-policy-studio-angular\n */\nexport * from './lib/models';\nexport * from './lib/gio-policy-studio.module';\nexport * from './lib/gio-policy-studio.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;MAwBa,iCAAiC;IAL9C;QAOS,UAAK,GAAW,EAAE,CAAC;KAC3B;;+HAHY,iCAAiC;mHAAjC,iCAAiC,qFCxB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AAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,aAC/D,wBAAwB;oHAEvB,qBAAqB,YAHvB,CAAC,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,CAAC;4FAG/D,qBAAqB;kBALjC,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,wBAAwB,EAAE,iCAAiC,EAAE,+BAA+B,CAAC;oBAC5G,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,CAAC;oBAC1E,OAAO,EAAE,CAAC,wBAAwB,CAAC;iBACpC;;;AC7BD;;;;;;;;;;;;;;;;ACAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"gravitee-ui-policy-studio-angular.mjs","sources":["../../../projects/ui-policy-studio-angular/src/lib/models/flow/index.ts","../../../projects/ui-policy-studio-angular/src/lib/models/plan/index.ts","../../../projects/ui-policy-studio-angular/src/lib/models/index.ts","../../../projects/ui-policy-studio-angular/src/lib/components/flows-menu/gio-ps-flows-menu.component.ts","../../../projects/ui-policy-studio-angular/src/lib/components/flows-menu/gio-ps-flows-menu.component.html","../../../projects/ui-policy-studio-angular/src/lib/components/flow-details/gio-ps-flow-details.component.ts","../../../projects/ui-policy-studio-angular/src/lib/components/flow-details/gio-ps-flow-details.component.html","../../../projects/ui-policy-studio-angular/src/lib/gio-policy-studio.component.ts","../../../projects/ui-policy-studio-angular/src/lib/gio-policy-studio.component.html","../../../projects/ui-policy-studio-angular/src/lib/gio-policy-studio.module.ts","../../../projects/ui-policy-studio-angular/src/public-api.ts","../../../projects/ui-policy-studio-angular/src/gravitee-ui-policy-studio-angular.ts"],"sourcesContent":["/*\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 './ApiType';\nexport * from './Flow';\nexport * from './FlowExecution';\nexport * from './HttpMethod';\nexport * from './Selector';\nexport * from './Step';\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';\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';\nexport * from './ConnectorsInfo';\nexport * from './plan';\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 */\nimport { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';\n\nimport { FlowGroupVM, FlowVM } from '../../gio-policy-studio.model';\n\ninterface FlowGroupMenuVM extends FlowGroupVM {\n flows: FlowMenuVM[];\n}\n\ninterface FlowMenuVM extends FlowVM {\n selected: boolean;\n mouseOver: boolean;\n}\n\n@Component({\n selector: 'gio-ps-flows-menu',\n templateUrl: './gio-ps-flows-menu.component.html',\n styleUrls: ['./gio-ps-flows-menu.component.scss'],\n})\nexport class GioPolicyStudioFlowsMenuComponent implements OnChanges {\n @Input()\n public flowsGroups: FlowGroupVM[] = [];\n\n @Input()\n public selectedFlow?: FlowVM = undefined;\n\n @Output()\n public selectedFlowChange = new EventEmitter<FlowVM>();\n\n public flowGroupVMSelected: FlowGroupMenuVM[] = [];\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.flowsGroups || changes.selectedFlow) {\n this.flowGroupVMSelected = this.flowsGroups.map(flowGroup => {\n return {\n ...flowGroup,\n flows: flowGroup.flows.map(flow => {\n return {\n ...flow,\n selected: this.selectedFlow?._id === flow._id,\n mouseOver: false,\n };\n }),\n };\n });\n }\n }\n\n public selectFlow(flow: FlowVM): void {\n this.selectedFlowChange.emit(flow);\n }\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\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 [ngClass]=\"flow.mouseOver || flow.selected ? 'gio-badge-white' : 'gio-badge-neutral'\">SUB</span>\n </div>\n <div class=\"list__flowsGroup__flow__infos__channelName\">My channel</div>\n </div>\n </div>\n </div>\n</div>\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 */\nimport { Component, Input } from '@angular/core';\n\nimport { FlowVM } from '../../gio-policy-studio.model';\n\n@Component({\n selector: 'gio-ps-flow-details',\n templateUrl: './gio-ps-flow-details.component.html',\n styleUrls: ['./gio-ps-flow-details.component.scss'],\n})\nexport class GioPolicyStudioDetailsComponent {\n @Input()\n public flow?: FlowVM = undefined;\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\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 🚧 Work in progress 🚧 <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","/*\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 */\nimport { Component, Input, OnChanges, SimpleChanges } from '@angular/core';\nimport { capitalize, uniqueId } from 'lodash';\n\nimport { ApiType, ConnectorsInfo, Flow, Plan } from './models';\nimport { FlowGroupVM, FlowVM } from './gio-policy-studio.model';\n\n@Component({\n selector: 'gio-policy-studio',\n templateUrl: './gio-policy-studio.component.html',\n styleUrls: ['./gio-policy-studio.component.scss'],\n})\nexport class GioPolicyStudioComponent implements OnChanges {\n @Input()\n public apiType!: ApiType;\n\n /**\n * List of entrypoints to display\n */\n @Input()\n public entrypointsInfo: ConnectorsInfo[] = [];\n\n /**\n * List of endpoints to display\n */\n @Input()\n public endpointsInfo: ConnectorsInfo[] = [];\n\n @Input()\n public commonFlows: Flow[] = [];\n\n @Input()\n public plans: Plan[] = [];\n\n public connectorsTooltip = '';\n\n public selectedFlow?: FlowVM = undefined;\n\n public flowsGroups: FlowGroupVM[] = [];\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.entrypointsInfo || changes.endpointsInfo) {\n this.connectorsTooltip = `Entrypoints: ${(this.entrypointsInfo ?? []).map(e => capitalize(e.type)).join(', ')}\\nEndpoints: ${(\n this.endpointsInfo ?? []\n )\n .map(e => capitalize(e.type))\n .join(', ')}`;\n }\n\n if (changes.commonFlows || changes.plans) {\n this.flowsGroups = getFlowsGroups(this.commonFlows, this.plans);\n\n // Select first flow by default on first load\n if (changes.commonFlows?.isFirstChange() || changes.plans?.isFirstChange()) {\n this.selectedFlow = this.flowsGroups[0].flows[0];\n }\n }\n }\n}\n\nconst getFlowsGroups = (commonFlows: Flow[] = [], plans: Plan[] = []): FlowGroupVM[] => {\n const commFlowsGroup: FlowGroupVM = {\n _id: 'flowsGroup_commonFlow',\n name: 'Common flows',\n flows: commonFlows.map(flow => ({ ...flow, _id: uniqueId('flow_') })),\n };\n\n return [\n ...plans.map(plan => ({\n _id: uniqueId('flowsGroup_'),\n name: plan.name,\n icon: 'gio:shield',\n flows: plan.flows.map(flow => ({ ...flow, _id: uniqueId('flow_') })),\n })),\n commFlowsGroup,\n ];\n};\n","<!--\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","/*\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 */\nimport { NgModule } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { GioIconsModule } from '@gravitee/ui-particles-angular';\nimport { CommonModule } from '@angular/common';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\nimport { GioPolicyStudioComponent } from './gio-policy-studio.component';\nimport { GioPolicyStudioFlowsMenuComponent } from './components/flows-menu/gio-ps-flows-menu.component';\nimport { GioPolicyStudioDetailsComponent } from './components/flow-details/gio-ps-flow-details.component';\n\n@NgModule({\n declarations: [GioPolicyStudioComponent, GioPolicyStudioFlowsMenuComponent, GioPolicyStudioDetailsComponent],\n imports: [CommonModule, MatButtonModule, MatTooltipModule, GioIconsModule],\n exports: [GioPolicyStudioComponent],\n})\nexport class GioPolicyStudioModule {}\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/*\n * Public API Surface of ui-policy-studio-angular\n */\nexport * from './lib/models';\nexport { GioPolicyStudioModule } from './lib/gio-policy-studio.module';\nexport { GioPolicyStudioComponent } from './lib/gio-policy-studio.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;MAiCa,iCAAiC;IAL9C;QAOS,gBAAW,GAAkB,EAAE,CAAC;QAGhC,iBAAY,GAAY,SAAS,CAAC;QAGlC,uBAAkB,GAAG,IAAI,YAAY,EAAU,CAAC;QAEhD,wBAAmB,GAAsB,EAAE,CAAC;KAsBpD;IApBQ,WAAW,CAAC,OAAsB;QACvC,IAAI,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,YAAY,EAAE;YAC/C,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS;gBACvD,uCACK,SAAS,KACZ,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI;;wBAC7B,uCACK,IAAI,KACP,QAAQ,EAAE,CAAA,MAAA,IAAI,CAAC,YAAY,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IAAI,qCAAU,IAAI,KAAE,GAAG,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAG,CAAC;SACrE,CAAC,CAAC;QACH,cAAc;KACf,CAAC;AACJ,CAAC;;AE1FD;;;;;;;;;;;;;;;MA8Ba,qBAAqB;;mHAArB,qBAAqB;oHAArB,qBAAqB,iBAJjB,wBAAwB,EAAE,iCAAiC,EAAE,+BAA+B,aACjG,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,aAC/D,wBAAwB;oHAEvB,qBAAqB,YAHvB,CAAC,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,CAAC;4FAG/D,qBAAqB;kBALjC,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,wBAAwB,EAAE,iCAAiC,EAAE,+BAA+B,CAAC;oBAC5G,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,CAAC;oBAC1E,OAAO,EAAE,CAAC,wBAAwB,CAAC;iBACpC;;;AC7BD;;;;;;;;;;;;;;;;ACAA;;;;;;"}
|
|
@@ -58,6 +58,51 @@ function fakeChannelFlow(modifier) {
|
|
|
58
58
|
* limitations under the License.
|
|
59
59
|
*/
|
|
60
60
|
|
|
61
|
+
/*
|
|
62
|
+
* Copyright (C) 2023 The Gravitee team (http://gravitee.io)
|
|
63
|
+
*
|
|
64
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
65
|
+
* you may not use this file except in compliance with the License.
|
|
66
|
+
* You may obtain a copy of the License at
|
|
67
|
+
*
|
|
68
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
69
|
+
*
|
|
70
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
71
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
72
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
73
|
+
* See the License for the specific language governing permissions and
|
|
74
|
+
* limitations under the License.
|
|
75
|
+
*/
|
|
76
|
+
function fakePlan(modifier) {
|
|
77
|
+
const base = {
|
|
78
|
+
name: 'Keyless plan',
|
|
79
|
+
flows: [],
|
|
80
|
+
};
|
|
81
|
+
if (isFunction(modifier)) {
|
|
82
|
+
return modifier(base);
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
...base,
|
|
86
|
+
...modifier,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/*
|
|
91
|
+
* Copyright (C) 2023 The Gravitee team (http://gravitee.io)
|
|
92
|
+
*
|
|
93
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
94
|
+
* you may not use this file except in compliance with the License.
|
|
95
|
+
* You may obtain a copy of the License at
|
|
96
|
+
*
|
|
97
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
98
|
+
*
|
|
99
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
100
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
101
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
102
|
+
* See the License for the specific language governing permissions and
|
|
103
|
+
* limitations under the License.
|
|
104
|
+
*/
|
|
105
|
+
|
|
61
106
|
/*
|
|
62
107
|
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
63
108
|
*
|
|
@@ -1407,7 +1452,7 @@ class DivHarness extends ComponentHarness {
|
|
|
1407
1452
|
* @return a `HarnessPredicate` configured with the given options.
|
|
1408
1453
|
*/
|
|
1409
1454
|
static with(options = {}) {
|
|
1410
|
-
return new HarnessPredicate(DivHarness, options);
|
|
1455
|
+
return new HarnessPredicate(DivHarness, options).addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text));
|
|
1411
1456
|
}
|
|
1412
1457
|
childLocatorFor(query) {
|
|
1413
1458
|
return this.locatorFor(query);
|
|
@@ -1415,9 +1460,12 @@ class DivHarness extends ComponentHarness {
|
|
|
1415
1460
|
childLocatorForAll(query) {
|
|
1416
1461
|
return this.locatorForAll(query);
|
|
1417
1462
|
}
|
|
1418
|
-
async getText() {
|
|
1419
|
-
|
|
1420
|
-
|
|
1463
|
+
async getText(option) {
|
|
1464
|
+
let element = await this.host();
|
|
1465
|
+
if (option?.childSelector) {
|
|
1466
|
+
element = await this.locatorForOptional(option.childSelector)();
|
|
1467
|
+
}
|
|
1468
|
+
return element ? element.text() : null;
|
|
1421
1469
|
}
|
|
1422
1470
|
}
|
|
1423
1471
|
DivHarness.hostSelector = 'div';
|
|
@@ -1474,5 +1522,5 @@ DivHarness.hostSelector = 'div';
|
|
|
1474
1522
|
* Generated bundle index. Do not edit.
|
|
1475
1523
|
*/
|
|
1476
1524
|
|
|
1477
|
-
export { DivHarness, apimDefinition, apimFlow, apimPolicies, apimPropertyProviders, apimResourceTypes, fakeChannelFlow };
|
|
1525
|
+
export { DivHarness, apimDefinition, apimFlow, apimPolicies, apimPropertyProviders, apimResourceTypes, fakeChannelFlow, fakePlan };
|
|
1478
1526
|
//# sourceMappingURL=gravitee-ui-policy-studio-angular-testing.mjs.map
|