Skip to content

Commit

Permalink
fix(console): fix the validation of the form with a partial input
Browse files Browse the repository at this point in the history
Delete this code because we want the jsonSchema to initialise the mandatory fields so that it can manage its validity status correctly.
  • Loading branch information
ThibaudAV authored and wbabyte committed Mar 12, 2024
1 parent f7650b4 commit 8972e4c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
-->
<form *ngIf="!!configurationForm" [formGroup]="configurationForm">
<ng-container *ngIf="sharedConfigurationSchema">
<gio-form-json-schema
formControlName="groupConfiguration"
[jsonSchema]="sharedConfigurationSchema"
(ready)="onSchemaFormReady()"
></gio-form-json-schema>
<gio-form-json-schema formControlName="groupConfiguration" [jsonSchema]="sharedConfigurationSchema"></gio-form-json-schema>
</ng-container>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,4 @@ export class ApiEndpointGroupConfigurationComponent implements OnInit, OnDestroy
this.unsubscribe$.next(true);
this.unsubscribe$.complete();
}

onSchemaFormReady() {
// schema-form component is overriding the form with all the fields from the schema.
// We set back the initial value to avoid sending invalid data to the backend
this.configurationForm.setValue(this.initialValues, { emitEvent: false });
}
}

0 comments on commit 8972e4c

Please sign in to comment.