Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#785 -Schema fields are getting required - Bug fixed #131

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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