@gravitee/ui-policy-studio-angular 13.1.1 → 13.1.2

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.
@@ -14,7 +14,7 @@ import { tap, map, catchError, takeUntil, startWith } from 'rxjs/operators';
14
14
  import * as i1 from '@angular/material/dialog';
15
15
  import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
16
16
  import * as i3 from '@angular/forms';
17
- import { UntypedFormGroup, UntypedFormControl, ReactiveFormsModule } from '@angular/forms';
17
+ import { UntypedFormGroup, UntypedFormControl, ReactiveFormsModule, FormControl } from '@angular/forms';
18
18
  import * as i5 from '@angular/material/form-field';
19
19
  import { MatFormFieldModule } from '@angular/material/form-field';
20
20
  import * as i6 from '@angular/material/select';
@@ -756,6 +756,7 @@ class GioPolicyStudioStepFormComponent {
756
756
  this.stepChange = new EventEmitter();
757
757
  this.isValid = new EventEmitter();
758
758
  this.unsubscribe$ = new Subject();
759
+ this.isMessage = false;
759
760
  }
760
761
  ngOnChanges(changes) {
761
762
  if (changes.genericPolicy) {
@@ -778,6 +779,7 @@ class GioPolicyStudioStepFormComponent {
778
779
  this.context = {
779
780
  executionPhase: this.executionPhase,
780
781
  };
782
+ this.isMessage = this.executionPhase === 'MESSAGE_REQUEST' || this.executionPhase === 'MESSAGE_RESPONSE';
781
783
  }
782
784
  }
783
785
  ngOnInit() {
@@ -791,6 +793,7 @@ class GioPolicyStudioStepFormComponent {
791
793
  this.stepForm = new UntypedFormGroup({
792
794
  description: new UntypedFormControl({ value: this.step?.description, disabled: this.readOnly }),
793
795
  condition: new UntypedFormControl({ value: this.step?.condition, disabled: this.readOnly }),
796
+ messageCondition: new FormControl({ value: this.step?.messageCondition, disabled: this.readOnly }),
794
797
  configuration: new UntypedFormControl({ value: this.step?.configuration, disabled: this.readOnly }),
795
798
  });
796
799
  this.stepForm.valueChanges.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
@@ -818,11 +821,12 @@ class GioPolicyStudioStepFormComponent {
818
821
  ...this.step,
819
822
  description: this.stepForm?.get('description')?.value,
820
823
  condition: this.stepForm?.get('condition')?.value ?? undefined,
824
+ messageCondition: this.stepForm?.get('messageCondition')?.value ?? undefined,
821
825
  configuration,
822
826
  });
823
827
  }
824
828
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GioPolicyStudioStepFormComponent, deps: [{ token: GioPolicyStudioService }], target: i0.ɵɵFactoryTarget.Component }); }
825
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: GioPolicyStudioStepFormComponent, isStandalone: true, selector: "gio-ps-step-form", inputs: { readOnly: "readOnly", step: "step", executionPhase: "executionPhase", genericPolicy: "genericPolicy" }, outputs: { stepChange: "stepChange", isValid: "isValid" }, usesOnChanges: true, ngImport: i0, template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n\n<div class=\"settings\">\n <div class=\"settings__header\">Settings</div>\n\n <div class=\"settings__content\">\n <ng-container *ngIf=\"stepForm && (policySchema$ | async) as policySchema; else loadingTmpl\" [formGroup]=\"stepForm\">\n <mat-form-field>\n <mat-label>Description</mat-label>\n <textarea matInput formControlName=\"description\" cdkFocusInitial></textarea>\n <mat-hint>Describe how your policy works.</mat-hint>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Trigger condition</mat-label>\n <input matInput formControlName=\"condition\" />\n <mat-hint>The condition to execute this policy. Supports Expression Language.</mat-hint>\n </mat-form-field>\n\n <gio-form-json-schema\n *ngIf=\"policySchema\"\n [jsonSchema]=\"$any(policySchema)\"\n [context]=\"context\"\n (ready)=\"onJsonSchemaReady($event)\"\n formControlName=\"configuration\"\n ></gio-form-json-schema>\n </ng-container>\n </div>\n</div>\n\n<div class=\"documentation\">\n <div class=\"documentation__header\">Documentation</div>\n\n <div class=\"documentation__content\">\n <gio-banner-warning *ngIf=\"infoBanner\">\n Prerequisite message\n <span gioBannerBody>{{ infoBanner }}</span>\n </gio-banner-warning>\n <ng-container *ngIf=\"policyDocumentation$ | async as policyDocumentation; else loadingTmpl\">\n <gio-asciidoctor [content]=\"policyDocumentation\"></gio-asciidoctor>\n </ng-container>\n </div>\n</div>\n\n<ng-template #loadingTmpl>\n <gio-loader></gio-loader>\n</ng-template>\n", styles: ["@charset \"UTF-8\";.gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}:host{display:flex;flex-direction:row;border:1px solid #d3d5dc;border-radius:8px}.settings{display:flex;flex:0 0 50%;flex-direction:column}.settings__header{border-right:1px solid #d3d5dc}.settings__content{display:flex;flex:1 1 auto;flex-direction:column;padding:16px;border-right:1px solid #d3d5dc}.documentation{display:flex;overflow:auto;flex:0 0 50%;flex-direction:column}.documentation__content{overflow:auto;flex:1 1 auto;padding:16px}.settings__header,.documentation__header{padding:16px;border-bottom:1px solid #d3d5dc;font-size:14px;font-weight:500;line-height:20px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i8.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: GioFormJsonSchemaModule }, { kind: "component", type: i6$1.GioFormJsonSchemaComponent, selector: "gio-form-json-schema", inputs: ["jsonSchema", "context", "options"], outputs: ["ready"] }, { kind: "ngmodule", type: GioAsciidoctorModule }, { kind: "component", type: i7$1.GioAsciidoctorComponent, selector: "gio-asciidoctor", inputs: ["content", "src"] }, { kind: "ngmodule", type: GioLoaderModule }, { kind: "component", type: i6$1.GioLoaderComponent, selector: "gio-loader" }, { kind: "ngmodule", type: GioBannerModule }, { kind: "component", type: i6$1.GioBannerWarningComponent, selector: "gio-banner-warning" }, { kind: "directive", type: i6$1.GioBannerBodyDirective, selector: "[gioBannerBody]" }] }); }
829
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: GioPolicyStudioStepFormComponent, isStandalone: true, selector: "gio-ps-step-form", inputs: { readOnly: "readOnly", step: "step", executionPhase: "executionPhase", genericPolicy: "genericPolicy" }, outputs: { stepChange: "stepChange", isValid: "isValid" }, usesOnChanges: true, ngImport: i0, template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n\n<div class=\"settings\">\n <div class=\"settings__header\">Settings</div>\n\n <div class=\"settings__content\">\n <ng-container *ngIf=\"stepForm && (policySchema$ | async) as policySchema; else loadingTmpl\" [formGroup]=\"stepForm\">\n <mat-form-field>\n <mat-label>Description</mat-label>\n <textarea matInput formControlName=\"description\" cdkFocusInitial></textarea>\n <mat-hint>Describe how your policy works.</mat-hint>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Trigger condition</mat-label>\n <input matInput formControlName=\"condition\" />\n <mat-hint>The condition to execute this policy. Supports Expression Language.</mat-hint>\n </mat-form-field>\n\n @if (isMessage) {\n <mat-form-field>\n <mat-label>Message trigger condition</mat-label>\n <input matInput formControlName=\"messageCondition\" />\n <mat-hint>The condition to execute this policy on message. Supports Expression Language.</mat-hint>\n </mat-form-field>\n }\n\n <gio-form-json-schema\n *ngIf=\"policySchema\"\n [jsonSchema]=\"$any(policySchema)\"\n [context]=\"context\"\n (ready)=\"onJsonSchemaReady($event)\"\n formControlName=\"configuration\"\n ></gio-form-json-schema>\n </ng-container>\n </div>\n</div>\n\n<div class=\"documentation\">\n <div class=\"documentation__header\">Documentation</div>\n\n <div class=\"documentation__content\">\n <gio-banner-warning *ngIf=\"infoBanner\">\n Prerequisite message\n <span gioBannerBody>{{ infoBanner }}</span>\n </gio-banner-warning>\n <ng-container *ngIf=\"policyDocumentation$ | async as policyDocumentation; else loadingTmpl\">\n <gio-asciidoctor [content]=\"policyDocumentation\"></gio-asciidoctor>\n </ng-container>\n </div>\n</div>\n\n<ng-template #loadingTmpl>\n <gio-loader></gio-loader>\n</ng-template>\n", styles: ["@charset \"UTF-8\";.gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}:host{display:flex;flex-direction:row;border:1px solid #d3d5dc;border-radius:8px}.settings{display:flex;flex:0 0 50%;flex-direction:column}.settings__header{border-right:1px solid #d3d5dc}.settings__content{display:flex;flex:1 1 auto;flex-direction:column;padding:16px;border-right:1px solid #d3d5dc}.documentation{display:flex;overflow:auto;flex:0 0 50%;flex-direction:column}.documentation__content{overflow:auto;flex:1 1 auto;padding:16px}.settings__header,.documentation__header{padding:16px;border-bottom:1px solid #d3d5dc;font-size:14px;font-weight:500;line-height:20px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i8.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: GioFormJsonSchemaModule }, { kind: "component", type: i6$1.GioFormJsonSchemaComponent, selector: "gio-form-json-schema", inputs: ["jsonSchema", "context", "options"], outputs: ["ready"] }, { kind: "ngmodule", type: GioAsciidoctorModule }, { kind: "component", type: i7$1.GioAsciidoctorComponent, selector: "gio-asciidoctor", inputs: ["content", "src"] }, { kind: "ngmodule", type: GioLoaderModule }, { kind: "component", type: i6$1.GioLoaderComponent, selector: "gio-loader" }, { kind: "ngmodule", type: GioBannerModule }, { kind: "component", type: i6$1.GioBannerWarningComponent, selector: "gio-banner-warning" }, { kind: "directive", type: i6$1.GioBannerBodyDirective, selector: "[gioBannerBody]" }] }); }
826
830
  }
827
831
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GioPolicyStudioStepFormComponent, decorators: [{
828
832
  type: Component,
@@ -835,7 +839,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
835
839
  GioAsciidoctorModule,
836
840
  GioLoaderModule,
837
841
  GioBannerModule,
838
- ], selector: 'gio-ps-step-form', template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n\n<div class=\"settings\">\n <div class=\"settings__header\">Settings</div>\n\n <div class=\"settings__content\">\n <ng-container *ngIf=\"stepForm && (policySchema$ | async) as policySchema; else loadingTmpl\" [formGroup]=\"stepForm\">\n <mat-form-field>\n <mat-label>Description</mat-label>\n <textarea matInput formControlName=\"description\" cdkFocusInitial></textarea>\n <mat-hint>Describe how your policy works.</mat-hint>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Trigger condition</mat-label>\n <input matInput formControlName=\"condition\" />\n <mat-hint>The condition to execute this policy. Supports Expression Language.</mat-hint>\n </mat-form-field>\n\n <gio-form-json-schema\n *ngIf=\"policySchema\"\n [jsonSchema]=\"$any(policySchema)\"\n [context]=\"context\"\n (ready)=\"onJsonSchemaReady($event)\"\n formControlName=\"configuration\"\n ></gio-form-json-schema>\n </ng-container>\n </div>\n</div>\n\n<div class=\"documentation\">\n <div class=\"documentation__header\">Documentation</div>\n\n <div class=\"documentation__content\">\n <gio-banner-warning *ngIf=\"infoBanner\">\n Prerequisite message\n <span gioBannerBody>{{ infoBanner }}</span>\n </gio-banner-warning>\n <ng-container *ngIf=\"policyDocumentation$ | async as policyDocumentation; else loadingTmpl\">\n <gio-asciidoctor [content]=\"policyDocumentation\"></gio-asciidoctor>\n </ng-container>\n </div>\n</div>\n\n<ng-template #loadingTmpl>\n <gio-loader></gio-loader>\n</ng-template>\n", styles: ["@charset \"UTF-8\";.gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}:host{display:flex;flex-direction:row;border:1px solid #d3d5dc;border-radius:8px}.settings{display:flex;flex:0 0 50%;flex-direction:column}.settings__header{border-right:1px solid #d3d5dc}.settings__content{display:flex;flex:1 1 auto;flex-direction:column;padding:16px;border-right:1px solid #d3d5dc}.documentation{display:flex;overflow:auto;flex:0 0 50%;flex-direction:column}.documentation__content{overflow:auto;flex:1 1 auto;padding:16px}.settings__header,.documentation__header{padding:16px;border-bottom:1px solid #d3d5dc;font-size:14px;font-weight:500;line-height:20px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}\n"] }]
842
+ ], selector: 'gio-ps-step-form', template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n\n<div class=\"settings\">\n <div class=\"settings__header\">Settings</div>\n\n <div class=\"settings__content\">\n <ng-container *ngIf=\"stepForm && (policySchema$ | async) as policySchema; else loadingTmpl\" [formGroup]=\"stepForm\">\n <mat-form-field>\n <mat-label>Description</mat-label>\n <textarea matInput formControlName=\"description\" cdkFocusInitial></textarea>\n <mat-hint>Describe how your policy works.</mat-hint>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Trigger condition</mat-label>\n <input matInput formControlName=\"condition\" />\n <mat-hint>The condition to execute this policy. Supports Expression Language.</mat-hint>\n </mat-form-field>\n\n @if (isMessage) {\n <mat-form-field>\n <mat-label>Message trigger condition</mat-label>\n <input matInput formControlName=\"messageCondition\" />\n <mat-hint>The condition to execute this policy on message. Supports Expression Language.</mat-hint>\n </mat-form-field>\n }\n\n <gio-form-json-schema\n *ngIf=\"policySchema\"\n [jsonSchema]=\"$any(policySchema)\"\n [context]=\"context\"\n (ready)=\"onJsonSchemaReady($event)\"\n formControlName=\"configuration\"\n ></gio-form-json-schema>\n </ng-container>\n </div>\n</div>\n\n<div class=\"documentation\">\n <div class=\"documentation__header\">Documentation</div>\n\n <div class=\"documentation__content\">\n <gio-banner-warning *ngIf=\"infoBanner\">\n Prerequisite message\n <span gioBannerBody>{{ infoBanner }}</span>\n </gio-banner-warning>\n <ng-container *ngIf=\"policyDocumentation$ | async as policyDocumentation; else loadingTmpl\">\n <gio-asciidoctor [content]=\"policyDocumentation\"></gio-asciidoctor>\n </ng-container>\n </div>\n</div>\n\n<ng-template #loadingTmpl>\n <gio-loader></gio-loader>\n</ng-template>\n", styles: ["@charset \"UTF-8\";.gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #e7e2fb);color:var(--gio-oem-palette--active-contrast, #100c27)}:host{display:flex;flex-direction:row;border:1px solid #d3d5dc;border-radius:8px}.settings{display:flex;flex:0 0 50%;flex-direction:column}.settings__header{border-right:1px solid #d3d5dc}.settings__content{display:flex;flex:1 1 auto;flex-direction:column;padding:16px;border-right:1px solid #d3d5dc}.documentation{display:flex;overflow:auto;flex:0 0 50%;flex-direction:column}.documentation__content{overflow:auto;flex:1 1 auto;padding:16px}.settings__header,.documentation__header{padding:16px;border-bottom:1px solid #d3d5dc;font-size:14px;font-weight:500;line-height:20px;font-family:Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}\n"] }]
839
843
  }], ctorParameters: () => [{ type: GioPolicyStudioService }], propDecorators: { readOnly: [{
840
844
  type: Input
841
845
  }], step: [{