Skip to content

Commit

Permalink
Merge pull request Sunbird-RC#131 from suvarnakale/main
Browse files Browse the repository at this point in the history
#785 -Schema fields are getting required - Bug fixed
  • Loading branch information
Pratikshakhandagale authored Sep 26, 2023
2 parents 514fd1c + deff60d commit 87bbc6f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/app/admin/create-entity/create-entity.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1320,8 +1320,8 @@ export class CreateEntityComponent implements OnInit, AfterContentChecked {
if (formioJson[i].type == "container") {
let key

if (formioJson[i].key) {
key = formioJson[i].key;
if (formioJson[i].label) {
key = formioJson[i].label;
} else {
key = formioJson[i].label.replaceAll(/\s/g, '');
key = key.charAt(0).toLowerCase() + key.slice(1);
Expand All @@ -1339,7 +1339,7 @@ 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);
requiredSecFields.push(formioJson[i].components[j].label);
}
}

Expand All @@ -1358,16 +1358,16 @@ export class CreateEntityComponent implements OnInit, AfterContentChecked {


let key;
if (formioJson[i].key) {
key = formioJson[i].key;
if (formioJson[i].label) {
key = formioJson[i].label;
} else {
key = formioJson[i].label.replaceAll(/\s/g, '');
key = key.charAt(0).toLowerCase() + key.slice(1);
}


if (formioJson[i].hasOwnProperty('validate') && formioJson[i].validate.required) {
requiredFields.push(formioJson[i].key);
requiredFields.push(key);
}

let data = formioJson[i];
Expand Down

0 comments on commit 87bbc6f

Please sign in to comment.