@gravitee/ui-components 3.25.0-fix-gvcode-15ce1d2 → 3.25.1-policy-prefix-common-field-6fb7e3e
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/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/policy-studio/gv-policy-studio.js +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [3.25.1](https://github.com/gravitee-io/gravitee-ui-components/compare/v3.25.0...v3.25.1) (2021-12-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* use lit instead lit-html to import classMap ([80bd439](https://github.com/gravitee-io/gravitee-ui-components/commit/80bd43915e53213d69e09175ce27a2875b4af68c))
|
|
7
|
+
|
|
1
8
|
# [3.25.0](https://github.com/gravitee-io/gravitee-ui-components/compare/v3.24.5...v3.25.0) (2021-12-21)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
@@ -614,12 +614,12 @@ export class GvPolicyStudio extends KeyboardElement(LitElement) {
|
|
|
614
614
|
}
|
|
615
615
|
|
|
616
616
|
buildSchema({ schema }) {
|
|
617
|
-
const
|
|
617
|
+
const commonDescription = {
|
|
618
618
|
title: 'Description',
|
|
619
619
|
description: 'Description of flow step',
|
|
620
620
|
type: 'string',
|
|
621
621
|
};
|
|
622
|
-
const
|
|
622
|
+
const commonCondition = {
|
|
623
623
|
title: 'Condition',
|
|
624
624
|
description: 'Condition the execution of the flow step (support EL)',
|
|
625
625
|
type: 'string',
|
|
@@ -629,10 +629,10 @@ export class GvPolicyStudio extends KeyboardElement(LitElement) {
|
|
|
629
629
|
};
|
|
630
630
|
if (schema) {
|
|
631
631
|
const jsonSchema = typeof schema === 'string' ? JSON.parse(schema) : schema;
|
|
632
|
-
const properties = {
|
|
632
|
+
const properties = { commonDescription, ...(this.hasConditionalSteps ? { commonCondition } : {}), ...jsonSchema.properties };
|
|
633
633
|
return { ...jsonSchema, properties };
|
|
634
634
|
}
|
|
635
|
-
return { properties: {
|
|
635
|
+
return { properties: { commonDescription, ...(this.hasConditionalSteps ? { commonCondition } : {}) } };
|
|
636
636
|
}
|
|
637
637
|
|
|
638
638
|
async _editFlowStep({ step, flow, policy, group }) {
|
|
@@ -735,7 +735,7 @@ export class GvPolicyStudio extends KeyboardElement(LitElement) {
|
|
|
735
735
|
: currentFlowStep.step.configuration;
|
|
736
736
|
const step = { ...currentFlowStep.step, configuration };
|
|
737
737
|
|
|
738
|
-
const _initialValues = { ...step.configuration,
|
|
738
|
+
const _initialValues = { ...step.configuration, commonDescription: step.description, commonCondition: step.condition };
|
|
739
739
|
this._currentFlowStep = { ...currentFlowStep, step, _initialValues };
|
|
740
740
|
|
|
741
741
|
if (flowStepSchema && flowStepSchema.properties.scope) {
|
|
@@ -841,18 +841,18 @@ export class GvPolicyStudio extends KeyboardElement(LitElement) {
|
|
|
841
841
|
}
|
|
842
842
|
|
|
843
843
|
_writeFlowStep(values) {
|
|
844
|
-
const {
|
|
844
|
+
const { commonDescription, commonCondition, ...configuration } = values;
|
|
845
845
|
if (
|
|
846
846
|
this._currentFlowStep.step._new ||
|
|
847
|
-
this._currentFlowStep.step.description !==
|
|
848
|
-
this._currentFlowStep.step.condition !==
|
|
847
|
+
this._currentFlowStep.step.description !== commonDescription ||
|
|
848
|
+
this._currentFlowStep.step.condition !== commonCondition ||
|
|
849
849
|
!deepEqual(this._currentFlowStep.step.configuration, configuration)
|
|
850
850
|
) {
|
|
851
851
|
const flow = this._findFlowById(this._currentFlowStep.flow._id);
|
|
852
852
|
const position = flow[this._currentFlowStep.group].findIndex((step) => step._id === this._currentFlowStep.step._id);
|
|
853
853
|
|
|
854
|
-
flow[this._currentFlowStep.group][position].description =
|
|
855
|
-
flow[this._currentFlowStep.group][position].condition =
|
|
854
|
+
flow[this._currentFlowStep.group][position].description = commonDescription;
|
|
855
|
+
flow[this._currentFlowStep.group][position].condition = commonCondition;
|
|
856
856
|
flow[this._currentFlowStep.group][position].configuration = deepClone(configuration);
|
|
857
857
|
delete flow[this._currentFlowStep.group][position]._new;
|
|
858
858
|
flow[this._currentFlowStep.group][position]._dirty = true;
|
|
@@ -1098,7 +1098,7 @@ export class GvPolicyStudio extends KeyboardElement(LitElement) {
|
|
|
1098
1098
|
_renderFlowStepForm(readonlyMode) {
|
|
1099
1099
|
const values = this._currentFlowStep._values || this._currentFlowStep._initialValues;
|
|
1100
1100
|
|
|
1101
|
-
const groups = [{ items: ['
|
|
1101
|
+
const groups = [{ items: ['commonDescription', 'commonCondition'] }, { name: i18n('gv-policy-studio.policy-settings'), default: true }];
|
|
1102
1102
|
return html`${cache(
|
|
1103
1103
|
this._flowStepSchema && this._currentFlowStep
|
|
1104
1104
|
? html`<div class="flow-step__container">
|