@gravitee/ui-policy-studio-angular 13.6.0 → 13.7.0-apim-7162-ps-native-api-d1de6d3

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.
Files changed (36) hide show
  1. package/esm2022/lib/components/flow-details/gio-ps-flow-details.component.mjs +49 -26
  2. package/esm2022/lib/components/flow-details-phase/gio-ps-flow-details-phase.component.mjs +8 -5
  3. package/esm2022/lib/components/flow-form-dialog/flow-native-form-dialog/gio-ps-flow-native-form-dialog.component.mjs +89 -0
  4. package/esm2022/lib/components/flows-menu/gio-ps-flows-menu.component.mjs +97 -47
  5. package/esm2022/lib/components/policies-catalog-dialog/gio-ps-policies-catalog-dialog.component.mjs +10 -10
  6. package/esm2022/lib/models/ConnectorsInfo.mjs +1 -1
  7. package/esm2022/lib/models/flow/Flow.mjs +1 -1
  8. package/esm2022/lib/policy-group-studio/gio-policy-group-studio.component.mjs +2 -2
  9. package/esm2022/lib/policy-studio/gio-policy-studio.component.mjs +10 -8
  10. package/esm2022/lib/policy-studio/gio-policy-studio.model.mjs +1 -1
  11. package/esm2022/testing/lib/components/flow-details-phase/gio-ps-flow-details-phase.harness.mjs +2 -1
  12. package/esm2022/testing/lib/components/flow-form-dialog/flow-native-form-dialog/gio-ps-flow-native-form-dialog.harness.mjs +50 -0
  13. package/esm2022/testing/lib/models/ConnectorsInfo.fixture.mjs +31 -1
  14. package/esm2022/testing/lib/models/ConnectorsInfo.mjs +1 -1
  15. package/esm2022/testing/lib/models/flow/Flow.fixture.mjs +17 -1
  16. package/esm2022/testing/lib/models/flow/Flow.mjs +1 -1
  17. package/esm2022/testing/lib/models/policy/Policy.fixture.mjs +2 -1
  18. package/esm2022/testing/lib/policy-studio/gio-policy-studio.harness.mjs +10 -1
  19. package/fesm2022/gravitee-ui-policy-studio-angular-testing.mjs +104 -1
  20. package/fesm2022/gravitee-ui-policy-studio-angular-testing.mjs.map +1 -1
  21. package/fesm2022/gravitee-ui-policy-studio-angular.mjs +238 -92
  22. package/fesm2022/gravitee-ui-policy-studio-angular.mjs.map +1 -1
  23. package/lib/components/flow-details/gio-ps-flow-details.component.d.ts +1 -1
  24. package/lib/components/flow-details-phase/gio-ps-flow-details-phase.component.d.ts +3 -2
  25. package/lib/components/flow-form-dialog/flow-native-form-dialog/gio-ps-flow-native-form-dialog.component.d.ts +21 -0
  26. package/lib/components/flows-menu/gio-ps-flows-menu.component.d.ts +2 -1
  27. package/lib/models/ConnectorsInfo.d.ts +1 -1
  28. package/lib/models/flow/Flow.d.ts +2 -0
  29. package/lib/policy-studio/gio-policy-studio.model.d.ts +1 -0
  30. package/package.json +1 -1
  31. package/testing/lib/components/flow-details-phase/gio-ps-flow-details-phase.harness.d.ts +1 -1
  32. package/testing/lib/components/flow-form-dialog/flow-native-form-dialog/gio-ps-flow-native-form-dialog.harness.d.ts +17 -0
  33. package/testing/lib/models/ConnectorsInfo.d.ts +1 -1
  34. package/testing/lib/models/ConnectorsInfo.fixture.d.ts +2 -0
  35. package/testing/lib/models/flow/Flow.d.ts +2 -0
  36. package/testing/lib/models/flow/Flow.fixture.d.ts +1 -0
@@ -116,6 +116,22 @@ function fakeConditionedHttpFlow(modifier) {
116
116
  ...modifier,
117
117
  };
118
118
  }
119
+ function fakeNativeFlow(modifier) {
120
+ const base = {
121
+ name: 'Flow name',
122
+ interact: [],
123
+ subscribe: [],
124
+ publish: [],
125
+ enabled: true,
126
+ };
127
+ if (isFunction(modifier)) {
128
+ return modifier(base);
129
+ }
130
+ return {
131
+ ...base,
132
+ ...modifier,
133
+ };
134
+ }
119
135
 
120
136
  /*
121
137
  * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
@@ -293,6 +309,7 @@ function fakeTestPolicy(modifier) {
293
309
  flowPhaseCompatibility: {
294
310
  HTTP_PROXY: ['REQUEST', 'RESPONSE'],
295
311
  HTTP_MESSAGE: ['REQUEST', 'RESPONSE', 'SUBSCRIBE', 'PUBLISH'],
312
+ NATIVE_KAFKA: ['CONNECT', 'INTERACT', 'PUBLISH', 'SUBSCRIBE'],
296
313
  },
297
314
  };
298
315
  if (isFunction(modifier)) {
@@ -669,6 +686,36 @@ function fakeHTTPProxyEndpoint(modifier) {
669
686
  ...modifier,
670
687
  };
671
688
  }
689
+ function fakeKafkaNativeEntrypoint(modifier) {
690
+ const base = {
691
+ type: 'native-kafka',
692
+ name: 'Client',
693
+ supportedModes: ['INTERACT', 'PUBLISH', 'SUBSCRIBE'],
694
+ icon: 'gio:kafka',
695
+ };
696
+ if (isFunction(modifier)) {
697
+ return modifier(base);
698
+ }
699
+ return {
700
+ ...base,
701
+ ...modifier,
702
+ };
703
+ }
704
+ function fakeKafkaNativeEndpoint(modifier) {
705
+ const base = {
706
+ type: 'native-kafka',
707
+ name: 'Broker',
708
+ supportedModes: ['INTERACT', 'PUBLISH', 'SUBSCRIBE'],
709
+ icon: 'gio:kafka',
710
+ };
711
+ if (isFunction(modifier)) {
712
+ return modifier(base);
713
+ }
714
+ return {
715
+ ...base,
716
+ ...modifier,
717
+ };
718
+ }
672
719
 
673
720
  /*
674
721
  * Copyright (C) 2022 The Gravitee team (http://gravitee.io)
@@ -1352,6 +1399,7 @@ class GioPolicyStudioPoliciesCatalogDialogHarness extends ComponentHarness {
1352
1399
  * limitations under the License.
1353
1400
  */
1354
1401
  const TYPE_TO_TEXT = {
1402
+ INTERACT: 'Interact phase',
1355
1403
  REQUEST: 'Request phase',
1356
1404
  RESPONSE: 'Response phase',
1357
1405
  PUBLISH: 'Publish phase',
@@ -1459,6 +1507,53 @@ class GioPolicyStudioDetailsPhaseHarness extends ComponentHarness {
1459
1507
  }
1460
1508
  }
1461
1509
 
1510
+ /*
1511
+ * Copyright (C) 2022 The Gravitee team (http://gravitee.io)
1512
+ *
1513
+ * Licensed under the Apache License, Version 2.0 (the "License");
1514
+ * you may not use this file except in compliance with the License.
1515
+ * You may obtain a copy of the License at
1516
+ *
1517
+ * http://www.apache.org/licenses/LICENSE-2.0
1518
+ *
1519
+ * Unless required by applicable law or agreed to in writing, software
1520
+ * distributed under the License is distributed on an "AS IS" BASIS,
1521
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1522
+ * See the License for the specific language governing permissions and
1523
+ * limitations under the License.
1524
+ */
1525
+ class GioPolicyStudioFlowNativeFormDialogHarness extends ComponentHarness {
1526
+ constructor() {
1527
+ super(...arguments);
1528
+ this.getSaveBtn = this.locatorFor(MatButtonHarness.with({ selector: '.actions__saveBtn' }));
1529
+ this.getCancelBtn = this.locatorFor(MatButtonHarness.with({ selector: '.actions__cancelBtn' }));
1530
+ this.nameInput = this.locatorFor(MatInputHarness.with({ selector: '[formControlName="name"]' }));
1531
+ }
1532
+ static { this.hostSelector = 'gio-ps-flow-native-form-dialog'; }
1533
+ async setFlowFormValues(flow) {
1534
+ if (flow.name) {
1535
+ const nameInput = await this.nameInput();
1536
+ await nameInput.setValue(flow.name);
1537
+ }
1538
+ }
1539
+ async getFlowFormValues() {
1540
+ return {
1541
+ name: await this.getFlowName(),
1542
+ };
1543
+ }
1544
+ async getFlowName() {
1545
+ return this.nameInput().then(input => input.getValue());
1546
+ }
1547
+ async save() {
1548
+ const button = await this.getSaveBtn();
1549
+ await button.click();
1550
+ }
1551
+ async cancel() {
1552
+ const button = await this.getCancelBtn();
1553
+ await button.click();
1554
+ }
1555
+ }
1556
+
1462
1557
  /*
1463
1558
  * Copyright (C) 2022 The Gravitee team (http://gravitee.io)
1464
1559
  *
@@ -1621,6 +1716,14 @@ class GioPolicyStudioHarness extends ComponentHarness {
1621
1716
  await flowFormNewDialog.save();
1622
1717
  return;
1623
1718
  }
1719
+ if (!channelSelector && !httpSelector) {
1720
+ const flowFormNewDialog = await this.documentRootLocatorFactory().locatorFor(GioPolicyStudioFlowNativeFormDialogHarness)();
1721
+ await flowFormNewDialog.setFlowFormValues({
1722
+ name: flow.name,
1723
+ });
1724
+ await flowFormNewDialog.save();
1725
+ return;
1726
+ }
1624
1727
  throw new Error('No selector found for this flow. Needed to select Message or Proxy flow form dialog.');
1625
1728
  }
1626
1729
  async setFlowExecutionConfig(flowExecution) {
@@ -1698,5 +1801,5 @@ class GioPolicyGroupStudioHarness extends ComponentHarness {
1698
1801
  * Generated bundle index. Do not edit.
1699
1802
  */
1700
1803
 
1701
- export { GioPolicyGroupStudioHarness, GioPolicyStudioHarness, POLICIES_V4_UNREGISTERED_ICON, fakeAllPolicies, fakeBestMatchFlowExecution, fakeChannelFlow, fakeConditionedChannelFlow, fakeConditionedHttpFlow, fakeDefaultFlowExecution, fakeHTTPGetMessageEntrypoint, fakeHTTPPostMessageEntrypoint, fakeHTTPProxyEndpoint, fakeHTTPProxyEntrypoint, fakeHttpFlow, fakeJsonToXmlStep, fakeKafkaMessageEndpoint, fakeMockMessageEndpoint, fakePlan, fakeRateLimitStep, fakeSSEMessageEntrypoint, fakeSharedPolicyGroupPolicyStep, fakeTestPolicy, fakeTestPolicyStep, fakeWebhookMessageEntrypoint, fakeWebsocketMessageEntrypoint };
1804
+ export { GioPolicyGroupStudioHarness, GioPolicyStudioHarness, POLICIES_V4_UNREGISTERED_ICON, fakeAllPolicies, fakeBestMatchFlowExecution, fakeChannelFlow, fakeConditionedChannelFlow, fakeConditionedHttpFlow, fakeDefaultFlowExecution, fakeHTTPGetMessageEntrypoint, fakeHTTPPostMessageEntrypoint, fakeHTTPProxyEndpoint, fakeHTTPProxyEntrypoint, fakeHttpFlow, fakeJsonToXmlStep, fakeKafkaMessageEndpoint, fakeKafkaNativeEndpoint, fakeKafkaNativeEntrypoint, fakeMockMessageEndpoint, fakeNativeFlow, fakePlan, fakeRateLimitStep, fakeSSEMessageEntrypoint, fakeSharedPolicyGroupPolicyStep, fakeTestPolicy, fakeTestPolicyStep, fakeWebhookMessageEntrypoint, fakeWebsocketMessageEntrypoint };
1702
1805
  //# sourceMappingURL=gravitee-ui-policy-studio-angular-testing.mjs.map