@gravitee/ui-policy-studio-angular 7.59.1 → 7.60.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.
@@ -568,12 +568,7 @@ class GioPolicyStudioStepFormComponent {
568
568
  configuration: new FormControl(this.step?.configuration ?? {}),
569
569
  });
570
570
  this.stepForm.valueChanges.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
571
- this.stepChange.emit({
572
- ...this.step,
573
- description: this.stepForm?.get('description')?.value,
574
- condition: this.stepForm?.get('condition')?.value ?? undefined,
575
- configuration: this.stepForm?.get('configuration')?.value,
576
- });
571
+ this.emitStepChange();
577
572
  });
578
573
  this.stepForm.statusChanges.pipe(takeUntil(this.unsubscribe$)).subscribe(valid => {
579
574
  this.isValid.emit(valid === 'VALID');
@@ -581,10 +576,21 @@ class GioPolicyStudioStepFormComponent {
581
576
  }
582
577
  onJsonSchemaReady(isReady) {
583
578
  // When ready and if the form is valid, emit
584
- if (isReady && this.stepForm?.status === 'VALID') {
585
- this.isValid.emit(true);
579
+ if (isReady) {
580
+ this.emitStepChange();
581
+ if (this.stepForm?.status === 'VALID') {
582
+ this.isValid.emit(true);
583
+ }
586
584
  }
587
585
  }
586
+ emitStepChange() {
587
+ this.stepChange.emit({
588
+ ...this.step,
589
+ description: this.stepForm?.get('description')?.value,
590
+ condition: this.stepForm?.get('condition')?.value ?? undefined,
591
+ configuration: this.stepForm?.get('configuration')?.value,
592
+ });
593
+ }
588
594
  }
589
595
  GioPolicyStudioStepFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPolicyStudioStepFormComponent, deps: [{ token: GioPolicyStudioService }], target: i0.ɵɵFactoryTarget.Component });
590
596
  GioPolicyStudioStepFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioPolicyStudioStepFormComponent, selector: "gio-ps-step-form", inputs: { step: "step", policy: "policy" }, 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 (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 <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: [".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:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}\n"], components: [{ type: i4.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i4$1.GioFormJsonSchemaComponent, selector: "gio-form-json-schema", inputs: ["jsonSchema", "options"], outputs: ["ready"] }, { type: i4$1.GioAsciidoctorComponent, selector: "gio-asciidoctor", inputs: ["content", "src"] }, { type: i4$1.GioLoaderComponent, selector: "gio-loader" }], directives: [{ type: i6$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i4.MatLabel, selector: "mat-label" }, { type: i10.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"] }, { type: i9.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i4.MatHint, selector: "mat-hint", inputs: ["align", "id"] }], pipes: { "async": i6$1.AsyncPipe } });