Skip to content

Commit

Permalink
#785 - Schema fields are getting required automatically- fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
suvarnakale committed Sep 8, 2023
1 parent 3951824 commit 33c8ab3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/admin/create-entity/create-entity.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ export class CreateEntityComponent implements OnInit, AfterContentChecked {


let required: any = [];
required = (self.required != undefined) ? self.required.includes(key) : false;
required = propertyObj[key]?.hasOwnProperty('required') ? propertyObj[key].required : (self.required ?? []).includes(key);

if (!self.usecaseSchema[self.activeMenuNo].hasOwnProperty('isRefSchema') && !self.usecaseSchema[self.activeMenuNo].isRefSchema) {
if (!required && self.usecaseSchema[self.activeMenuNo].definitions[self.usecaseSchema[self.activeMenuNo].title].hasOwnProperty('required')) {
Expand Down Expand Up @@ -1295,7 +1295,9 @@ export class CreateEntityComponent implements OnInit, AfterContentChecked {

let requiredSecFields = [];
for (let j = 0; j < formioJson[i].components.length; j++) {
if(formioJson[i].components[j].hasOwnProperty('validate') && formioJson[i].components[j].validate.required){
requiredSecFields.push(formioJson[i].components[j].key);
}
}


Expand Down

0 comments on commit 33c8ab3

Please sign in to comment.