@gravitee/ui-policy-studio-angular 7.19.0 → 7.20.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-info-bar/gio-ps-flow-details-info-bar.component.mjs +14 -4
- package/esm2020/lib/components/flows-menu/gio-ps-flows-menu.component.mjs +3 -3
- package/esm2020/lib/components/policies-catalog-dialog/gio-ps-policies-catalog-dialog.component.mjs +36 -7
- package/esm2020/lib/gio-policy-studio.component.mjs +7 -3
- package/esm2020/lib/gio-policy-studio.module.mjs +5 -1
- package/esm2020/testing/lib/components/policies-catalog-dialog/gio-ps-policies-catalog-dialog.harness.mjs +18 -5
- package/esm2020/testing/lib/gio-policy-studio.harness.mjs +16 -1
- package/fesm2015/gravitee-ui-policy-studio-angular-testing.mjs +36 -4
- package/fesm2015/gravitee-ui-policy-studio-angular-testing.mjs.map +1 -1
- package/fesm2015/gravitee-ui-policy-studio-angular.mjs +56 -15
- package/fesm2015/gravitee-ui-policy-studio-angular.mjs.map +1 -1
- package/fesm2020/gravitee-ui-policy-studio-angular-testing.mjs +32 -4
- package/fesm2020/gravitee-ui-policy-studio-angular-testing.mjs.map +1 -1
- package/fesm2020/gravitee-ui-policy-studio-angular.mjs +56 -15
- package/fesm2020/gravitee-ui-policy-studio-angular.mjs.map +1 -1
- package/lib/components/flow-details-info-bar/gio-ps-flow-details-info-bar.component.d.ts +4 -1
- package/lib/components/policies-catalog-dialog/gio-ps-policies-catalog-dialog.component.d.ts +13 -2
- package/lib/gio-policy-studio.component.d.ts +1 -0
- package/lib/gio-policy-studio.module.d.ts +3 -2
- package/package.json +1 -1
- package/testing/lib/components/policies-catalog-dialog/gio-ps-policies-catalog-dialog.harness.d.ts +4 -0
- package/testing/lib/gio-policy-studio.harness.d.ts +4 -0
|
@@ -8,6 +8,7 @@ import { MatSelectHarness } from '@angular/material/select/testing';
|
|
|
8
8
|
import { GioFormTagsInputHarness } from '@gravitee/ui-particles-angular';
|
|
9
9
|
import { MatSlideToggleHarness } from '@angular/material/slide-toggle/testing';
|
|
10
10
|
import { MatMenuHarness } from '@angular/material/menu/testing';
|
|
11
|
+
import { MatChipListHarness } from '@angular/material/chips/testing';
|
|
11
12
|
|
|
12
13
|
/*
|
|
13
14
|
* Copyright (C) 2023 The Gravitee team (http://gravitee.io)
|
|
@@ -1105,23 +1106,23 @@ GioPolicyStudioStepEditDialogHarness.hostSelector = 'gio-ps-step-edit-dialog';
|
|
|
1105
1106
|
class GioPolicyStudioPoliciesCatalogDialogHarness extends ComponentHarness {
|
|
1106
1107
|
constructor() {
|
|
1107
1108
|
super(...arguments);
|
|
1108
|
-
this.policiesLocator = this.locatorForAll(DivHarness.with({ selector: '.
|
|
1109
|
+
this.policiesLocator = this.locatorForAll(DivHarness.with({ selector: '.policiesCatalog__list__policy' }));
|
|
1109
1110
|
}
|
|
1110
1111
|
async getPhase() {
|
|
1111
1112
|
const phase = await this.locatorFor('.title__phase')();
|
|
1112
1113
|
return phase.text();
|
|
1113
1114
|
}
|
|
1114
1115
|
async getPoliciesName() {
|
|
1115
|
-
const policies = await this.locatorForAll('.
|
|
1116
|
+
const policies = await this.locatorForAll('.policiesCatalog__list__policy__head__name')();
|
|
1116
1117
|
return parallel(() => policies.map(policy => policy.text()));
|
|
1117
1118
|
}
|
|
1118
1119
|
async selectPolicy(policyName) {
|
|
1119
1120
|
const policies = await this.policiesLocator();
|
|
1120
|
-
const policy = policies.find(async (p) => (await p.getText({ childSelector: '.
|
|
1121
|
+
const policy = policies.find(async (p) => (await p.getText({ childSelector: '.policiesCatalog__list__policy__head__name' })) === policyName);
|
|
1121
1122
|
if (!policy) {
|
|
1122
1123
|
throw new Error(`Policy ${policyName} not found`);
|
|
1123
1124
|
}
|
|
1124
|
-
const selectBtn = await policy.childLocatorFor(MatButtonHarness.with({ selector: '.
|
|
1125
|
+
const selectBtn = await policy.childLocatorFor(MatButtonHarness.with({ selector: '.policiesCatalog__list__policy__selectBtn' }))();
|
|
1125
1126
|
await selectBtn.click();
|
|
1126
1127
|
}
|
|
1127
1128
|
async getSelectedPolicyName() {
|
|
@@ -1135,6 +1136,18 @@ class GioPolicyStudioPoliciesCatalogDialogHarness extends ComponentHarness {
|
|
|
1135
1136
|
async getStepForm() {
|
|
1136
1137
|
return await this.locatorFor(GioPolicyStudioStepFormHarness)();
|
|
1137
1138
|
}
|
|
1139
|
+
async getCategoriesSelection() {
|
|
1140
|
+
const chipList = await this.locatorForOptional(MatChipListHarness.with({ ancestor: '.policiesCatalog__categoriesSelection' }))();
|
|
1141
|
+
if (!chipList) {
|
|
1142
|
+
return [];
|
|
1143
|
+
}
|
|
1144
|
+
const chips = await chipList.getChips();
|
|
1145
|
+
return parallel(() => chips.map(async (chip) => {
|
|
1146
|
+
const selected = await chip.isSelected();
|
|
1147
|
+
const name = await chip.getText();
|
|
1148
|
+
return { name, selected };
|
|
1149
|
+
}));
|
|
1150
|
+
}
|
|
1138
1151
|
}
|
|
1139
1152
|
GioPolicyStudioPoliciesCatalogDialogHarness.hostSelector = 'gio-ps-policies-catalog-dialog';
|
|
1140
1153
|
|
|
@@ -1331,6 +1344,21 @@ class GioPolicyStudioHarness extends ComponentHarness {
|
|
|
1331
1344
|
const steps = await await this.phaseHarness(phaseType);
|
|
1332
1345
|
return steps ? steps : undefined;
|
|
1333
1346
|
}
|
|
1347
|
+
/**
|
|
1348
|
+
* Get Save button state
|
|
1349
|
+
*/
|
|
1350
|
+
async getSaveButtonState() {
|
|
1351
|
+
const saveButton = await this.locatorFor(MatButtonHarness.with({ ancestor: '.header__btn' }))();
|
|
1352
|
+
const disabled = await saveButton.isDisabled();
|
|
1353
|
+
const text = await saveButton.getText();
|
|
1354
|
+
if (text === 'Saving...') {
|
|
1355
|
+
return 'SAVING';
|
|
1356
|
+
}
|
|
1357
|
+
if (disabled) {
|
|
1358
|
+
return 'DISABLED';
|
|
1359
|
+
}
|
|
1360
|
+
return 'VISIBLE';
|
|
1361
|
+
}
|
|
1334
1362
|
/**
|
|
1335
1363
|
* Click on the "Save" button
|
|
1336
1364
|
*/
|