@gravitee/ui-policy-studio-angular 12.3.0 → 12.4.0-fix-studio-harness-a2e6885

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 (28) hide show
  1. package/esm2022/lib/components/flow-details/gio-ps-flow-details.component.mjs +7 -4
  2. package/esm2022/lib/components/flow-details-phase/gio-ps-flow-details-phase.component.mjs +7 -4
  3. package/esm2022/lib/components/flow-details-phase-step/gio-ps-flow-details-phase-step.component.mjs +9 -5
  4. package/esm2022/lib/components/flow-execution-form-dialog/gio-ps-flow-execution-form-dialog.component.mjs +8 -3
  5. package/esm2022/lib/components/flows-menu/gio-ps-flows-menu.component.mjs +8 -4
  6. package/esm2022/lib/components/policies-catalog-dialog/gio-ps-policies-catalog-dialog.component.mjs +1 -1
  7. package/esm2022/lib/components/step-edit-dialog/gio-ps-step-edit-dialog.component.mjs +5 -3
  8. package/esm2022/lib/components/step-form/gio-ps-step-form.component.mjs +13 -5
  9. package/esm2022/lib/gio-policy-studio.component.mjs +10 -4
  10. package/esm2022/testing/lib/components/flow-details/gio-ps-flow-details.harness.mjs +8 -1
  11. package/esm2022/testing/lib/components/flows-menu/gio-ps-flows-menu.harness.mjs +10 -1
  12. package/esm2022/testing/lib/gio-policy-studio.harness.mjs +14 -1
  13. package/fesm2022/gravitee-ui-policy-studio-angular-testing.mjs +29 -0
  14. package/fesm2022/gravitee-ui-policy-studio-angular-testing.mjs.map +1 -1
  15. package/fesm2022/gravitee-ui-policy-studio-angular.mjs +60 -25
  16. package/fesm2022/gravitee-ui-policy-studio-angular.mjs.map +1 -1
  17. package/lib/components/flow-details/gio-ps-flow-details.component.d.ts +2 -1
  18. package/lib/components/flow-details-phase/gio-ps-flow-details-phase.component.d.ts +2 -1
  19. package/lib/components/flow-details-phase-step/gio-ps-flow-details-phase-step.component.d.ts +3 -2
  20. package/lib/components/flow-execution-form-dialog/gio-ps-flow-execution-form-dialog.component.d.ts +2 -0
  21. package/lib/components/flows-menu/gio-ps-flows-menu.component.d.ts +2 -1
  22. package/lib/components/step-edit-dialog/gio-ps-step-edit-dialog.component.d.ts +2 -0
  23. package/lib/components/step-form/gio-ps-step-form.component.d.ts +2 -1
  24. package/lib/gio-policy-studio.component.d.ts +5 -1
  25. package/package.json +1 -1
  26. package/testing/lib/components/flow-details/gio-ps-flow-details.harness.d.ts +1 -0
  27. package/testing/lib/components/flows-menu/gio-ps-flows-menu.harness.d.ts +1 -0
  28. package/testing/lib/gio-policy-studio.harness.d.ts +1 -0
@@ -692,6 +692,15 @@ class GioPolicyStudioFlowsMenuHarness extends ComponentHarness {
692
692
  await (await flowsGroups.childLocatorFor(MatButtonHarness.with({ ancestor: '.list__flowsGroup__header__addBtn' }))()).click();
693
693
  }
694
694
  }
695
+ async isReadOnly() {
696
+ const flowsGroups = await this.locateFlowsGroups();
697
+ const flowGroup = flowsGroups.pop();
698
+ if (!flowGroup) {
699
+ throw new Error('A flow group is required to test that menu is readonly');
700
+ }
701
+ const addBtn = await flowGroup.childLocatorFor(MatButtonHarness.with({ ancestor: '.list__flowsGroup__header__addBtn' }))();
702
+ return await addBtn.isDisabled();
703
+ }
695
704
  async openFlowExecutionConfig() {
696
705
  await (await this.locatorFor(MatButtonHarness.with({ selector: '.header__configBtn_edit' }))())?.click();
697
706
  }
@@ -758,6 +767,13 @@ class GioPolicyStudioDetailsHarness extends ComponentHarness {
758
767
  const hostText = await (await this.host()).text();
759
768
  return matcher.test(hostText);
760
769
  }
770
+ async isReadOnly() {
771
+ const editFlowBtn = await this.locatorFor(MatButtonHarness.with({ selector: '.header__configBtn__edit' }))();
772
+ const editBtnDisabled = await editFlowBtn.isDisabled();
773
+ const deleteFlowBtn = await this.locatorFor(MatButtonHarness.with({ selector: '.header__configBtn__delete' }))();
774
+ const deleteBtnDisabled = await deleteFlowBtn.isDisabled();
775
+ return editBtnDisabled && deleteBtnDisabled;
776
+ }
761
777
  async clickEditFlowBtn() {
762
778
  const editFlowBtn = await this.locatorFor(MatButtonHarness.with({ selector: '.header__configBtn__edit' }))();
763
779
  await editFlowBtn.click();
@@ -1385,6 +1401,19 @@ class GioPolicyStudioHarness extends ComponentHarness {
1385
1401
  this.phaseHarness = (phaseType) => this.locatorFor(GioPolicyStudioDetailsPhaseHarness.with({ type: phaseType }))();
1386
1402
  }
1387
1403
  static { this.hostSelector = 'gio-policy-studio'; }
1404
+ async isReadOnly() {
1405
+ const menu = await this.menuHarness();
1406
+ const readOnlyMenu = await menu.isReadOnly();
1407
+ await this.selectFlowInMenu('.+');
1408
+ const details = await this.detailsHarness();
1409
+ const emptyDetails = await details.isDisplayEmptyFlow();
1410
+ if (!emptyDetails) {
1411
+ await this.selectFlowInMenu('.+');
1412
+ const readOnlyDetails = await details.isReadOnly();
1413
+ return readOnlyMenu && readOnlyDetails;
1414
+ }
1415
+ return readOnlyMenu;
1416
+ }
1388
1417
  /**
1389
1418
  * Add a flow to a plan or to "Common flows"
1390
1419
  *