@gravitee/ui-policy-studio-angular 7.20.0 → 7.21.0-improve-btn-d6b8d6c
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-phase/gio-ps-flow-details-phase.component.mjs +3 -3
- package/esm2020/lib/components/flows-menu/gio-ps-flows-menu.component.mjs +11 -3
- package/esm2020/lib/components/step-form/gio-ps-step-form.component.mjs +5 -3
- package/esm2020/lib/gio-policy-studio.component.mjs +2 -2
- package/esm2020/testing/lib/components/flow-details-phase/gio-ps-flow-details-phase.harness.mjs +3 -1
- package/esm2020/testing/lib/components/flows-menu/gio-ps-flows-menu.harness.mjs +3 -1
- package/esm2020/testing/lib/components/step-form/gio-ps-step-form.harness.mjs +6 -1
- package/esm2020/testing/lib/models/flow/Flow.fixture.mjs +41 -1
- package/fesm2015/gravitee-ui-policy-studio-angular-testing.mjs +42 -2
- package/fesm2015/gravitee-ui-policy-studio-angular-testing.mjs.map +1 -1
- package/fesm2015/gravitee-ui-policy-studio-angular.mjs +24 -15
- package/fesm2015/gravitee-ui-policy-studio-angular.mjs.map +1 -1
- package/fesm2020/gravitee-ui-policy-studio-angular-testing.mjs +50 -1
- package/fesm2020/gravitee-ui-policy-studio-angular-testing.mjs.map +1 -1
- package/fesm2020/gravitee-ui-policy-studio-angular.mjs +18 -8
- package/fesm2020/gravitee-ui-policy-studio-angular.mjs.map +1 -1
- package/lib/components/flows-menu/gio-ps-flows-menu.component.d.ts +1 -0
- package/package.json +1 -1
- package/testing/lib/components/flow-details-phase/gio-ps-flow-details-phase.harness.d.ts +1 -0
- package/testing/lib/components/flows-menu/gio-ps-flows-menu.harness.d.ts +1 -0
- package/testing/lib/components/step-form/gio-ps-step-form.harness.d.ts +2 -0
- package/testing/lib/models/flow/Flow.fixture.d.ts +2 -0
|
@@ -2,6 +2,7 @@ import { isFunction, isEmpty } from 'lodash';
|
|
|
2
2
|
import { ComponentHarness, parallel, HarnessPredicate } from '@angular/cdk/testing';
|
|
3
3
|
import { MatButtonHarness } from '@angular/material/button/testing';
|
|
4
4
|
import { MatTabGroupHarness } from '@angular/material/tabs/testing';
|
|
5
|
+
import { MatIconHarness } from '@angular/material/icon/testing';
|
|
5
6
|
import { DivHarness, SpanHarness } from '@gravitee/ui-particles-angular/testing';
|
|
6
7
|
import { MatInputHarness } from '@angular/material/input/testing';
|
|
7
8
|
import { MatSelectHarness } from '@angular/material/select/testing';
|
|
@@ -50,6 +51,26 @@ function fakeChannelFlow(modifier) {
|
|
|
50
51
|
...modifier,
|
|
51
52
|
};
|
|
52
53
|
}
|
|
54
|
+
function fakeConditionedChannelFlow(modifier) {
|
|
55
|
+
const base = fakeChannelFlow((baseApi) => ({
|
|
56
|
+
...baseApi,
|
|
57
|
+
name: 'Conditioned flow',
|
|
58
|
+
selectors: [
|
|
59
|
+
...(baseApi.selectors ?? []),
|
|
60
|
+
{
|
|
61
|
+
type: 'CONDITION',
|
|
62
|
+
condition: 'false',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
}));
|
|
66
|
+
if (isFunction(modifier)) {
|
|
67
|
+
return modifier(base);
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
...base,
|
|
71
|
+
...modifier,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
53
74
|
function fakeHttpFlow(modifier) {
|
|
54
75
|
const httpSelector = {
|
|
55
76
|
type: 'HTTP',
|
|
@@ -74,6 +95,26 @@ function fakeHttpFlow(modifier) {
|
|
|
74
95
|
...modifier,
|
|
75
96
|
};
|
|
76
97
|
}
|
|
98
|
+
function fakeConditionedHttpFlow(modifier) {
|
|
99
|
+
const base = fakeHttpFlow((baseApi) => ({
|
|
100
|
+
...baseApi,
|
|
101
|
+
name: 'Conditioned flow',
|
|
102
|
+
selectors: [
|
|
103
|
+
...(baseApi.selectors ?? []),
|
|
104
|
+
{
|
|
105
|
+
type: 'CONDITION',
|
|
106
|
+
condition: 'false',
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
}));
|
|
110
|
+
if (isFunction(modifier)) {
|
|
111
|
+
return modifier(base);
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
...base,
|
|
115
|
+
...modifier,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
77
118
|
|
|
78
119
|
/*
|
|
79
120
|
* Copyright (C) 2023 The Gravitee team (http://gravitee.io)
|
|
@@ -599,6 +640,7 @@ class GioPolicyStudioFlowsMenuHarness extends ComponentHarness {
|
|
|
599
640
|
name: await flowDiv.getText({ childSelector: '.list__flowsGroup__flow__name' }),
|
|
600
641
|
infos: await flowDiv.getText({ childSelector: '.list__flowsGroup__flow__infos' }),
|
|
601
642
|
isSelected: await flowDiv.host().then(host => host.hasClass('selected')),
|
|
643
|
+
hasCondition: !!(await flowDiv.childLocatorFor(MatIconHarness.with({ name: 'gio:if' }))),
|
|
602
644
|
};
|
|
603
645
|
}));
|
|
604
646
|
return {
|
|
@@ -1037,12 +1079,17 @@ class GioPolicyStudioStepFormHarness extends ComponentHarness {
|
|
|
1037
1079
|
constructor() {
|
|
1038
1080
|
super(...arguments);
|
|
1039
1081
|
this.getDescriptionInput = this.locatorFor(MatInputHarness.with({ selector: '[formControlName="description"]' }));
|
|
1082
|
+
this.getConditionInput = this.locatorFor(MatInputHarness.with({ selector: '[formControlName="condition"]' }));
|
|
1040
1083
|
}
|
|
1041
1084
|
async setStepForm(stepForm) {
|
|
1042
1085
|
if (stepForm.description) {
|
|
1043
1086
|
const descriptionInput = await this.getDescriptionInput();
|
|
1044
1087
|
await descriptionInput.setValue(stepForm.description);
|
|
1045
1088
|
}
|
|
1089
|
+
if (stepForm.condition) {
|
|
1090
|
+
const conditionInput = await this.getConditionInput();
|
|
1091
|
+
await conditionInput.setValue(stepForm.condition);
|
|
1092
|
+
}
|
|
1046
1093
|
if (stepForm.waitForPolicyFormCompletionCb) {
|
|
1047
1094
|
await stepForm.waitForPolicyFormCompletionCb(this.locatorFactory);
|
|
1048
1095
|
}
|
|
@@ -1204,10 +1251,12 @@ class GioPolicyStudioDetailsPhaseHarness extends ComponentHarness {
|
|
|
1204
1251
|
};
|
|
1205
1252
|
}
|
|
1206
1253
|
const step = await stepDiv.childLocatorFor(GioPolicyStudioDetailsPhaseStepHarness)();
|
|
1254
|
+
const conditionDiv = await stepDiv.childLocatorForOptional(DivHarness.with({ selector: '.content__step__policy__condition' }))();
|
|
1207
1255
|
const description = await step.getDescription();
|
|
1208
1256
|
return {
|
|
1209
1257
|
type: 'step',
|
|
1210
1258
|
name: await step.getName(),
|
|
1259
|
+
hasCondition: !!conditionDiv,
|
|
1211
1260
|
...(description ? { description } : {}),
|
|
1212
1261
|
};
|
|
1213
1262
|
}));
|
|
@@ -1432,5 +1481,5 @@ GioPolicyStudioHarness.hostSelector = 'gio-policy-studio';
|
|
|
1432
1481
|
* Generated bundle index. Do not edit.
|
|
1433
1482
|
*/
|
|
1434
1483
|
|
|
1435
|
-
export { GioPolicyStudioHarness, POLICIES_V4_UNREGISTERED_ICON, fakeAllPolicies, fakeBestMatchFlowExecution, fakeChannelFlow, fakeDefaultFlowExecution, fakeHTTPGetMessageEntrypoint, fakeHTTPPostMessageEntrypoint, fakeHTTPProxyEndpoint, fakeHTTPProxyEntrypoint, fakeHttpFlow, fakeJsonToXmlStep, fakeKafkaMessageEndpoint, fakeMockMessageEndpoint, fakePlan, fakeRateLimitStep, fakeSSEMessageEntrypoint, fakeTestPolicy, fakeTestPolicyStep, fakeWebhookMessageEntrypoint, fakeWebsocketMessageEntrypoint };
|
|
1484
|
+
export { GioPolicyStudioHarness, POLICIES_V4_UNREGISTERED_ICON, fakeAllPolicies, fakeBestMatchFlowExecution, fakeChannelFlow, fakeConditionedChannelFlow, fakeConditionedHttpFlow, fakeDefaultFlowExecution, fakeHTTPGetMessageEntrypoint, fakeHTTPPostMessageEntrypoint, fakeHTTPProxyEndpoint, fakeHTTPProxyEntrypoint, fakeHttpFlow, fakeJsonToXmlStep, fakeKafkaMessageEndpoint, fakeMockMessageEndpoint, fakePlan, fakeRateLimitStep, fakeSSEMessageEntrypoint, fakeTestPolicy, fakeTestPolicyStep, fakeWebhookMessageEntrypoint, fakeWebsocketMessageEntrypoint };
|
|
1436
1485
|
//# sourceMappingURL=gravitee-ui-policy-studio-angular-testing.mjs.map
|