Skip to content

Commit

Permalink
Merge pull request #186 from Rushikesh-Sonawane99/main
Browse files Browse the repository at this point in the history
Issue #PS-1875 chore: Fixed sho hide issue of rjsf form based on selection of BMGS
  • Loading branch information
itsvick authored Sep 3, 2024
2 parents c805ce9 + 3fbae46 commit b7cc7d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/components/AddNewCenters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ const AddNewCenters: React.FC<AddLearnerModalProps> = ({
setShowForm={setShowForm}
/>
</>
{dynamicFormForBlock && schema && uiSchema && selectedBlockCohortId && (
{dynamicFormForBlock && schema && uiSchema && selectedBlockCohortId && (
<>
{showForm && (
{showForm ? (
<DynamicForm
schema={schema}
uiSchema={uiSchema}
Expand Down Expand Up @@ -327,7 +327,7 @@ const AddNewCenters: React.FC<AddLearnerModalProps> = ({
</Button>
</Box>
</DynamicForm>
)}
) : null}
</>
)}
{!selectedBlockCohortId && selectedBlockCohortId !== "" && (
Expand Down
12 changes: 6 additions & 6 deletions src/components/DependentFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ const DependentFields: React.FC<DependentFieldsProps> = ({
const fieldsOfInterest = ['board', 'medium', 'grade', 'subject'];
const fieldIds: { [key: string]: string } = {};

data.fields.forEach((field: { name: string; fieldId: string }) => {
if (fieldsOfInterest.includes(field.name)) {
data?.fields?.forEach((field: { name: string; fieldId: string }) => {
if (fieldsOfInterest?.includes(field.name)) {
fieldIds[field.name] = field.fieldId;
}
});
Expand All @@ -62,19 +62,19 @@ const DependentFields: React.FC<DependentFieldsProps> = ({
if (fieldIds) {
const arrangedData = {
board: {
fieldId: fieldIds.board,
fieldId: fieldIds?.board,
boardName: selectedBoard,
},
medium: {
fieldId: fieldIds.medium,
fieldId: fieldIds?.medium,
mediumName: selectedMedium,
},
grade: {
fieldId: fieldIds.grade,
fieldId: fieldIds?.grade,
gradeName: selectedGrade,
},
subject: {
fieldId: fieldIds.subject,
fieldId: fieldIds?.subject,
subjectName: selectedSubjectLabel,
},
};
Expand Down

0 comments on commit b7cc7d1

Please sign in to comment.