Skip to content

Commit

Permalink
Merge pull request #84 from indec-it/fix/interruptionModal
Browse files Browse the repository at this point in the history
fix(formBuilder): fix open interruption modal
  • Loading branch information
maximilianoforlenza authored Sep 21, 2023
2 parents 28b29aa + 20fa914 commit 16131e2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@indec/form-builder",
"version": "2.4.4",
"version": "2.4.5",
"description": "Form builder",
"main": "index.js",
"private": false,
Expand Down
4 changes: 2 additions & 2 deletions src/components/FormBuilder/FormBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ function FormBuilder({
</Box>
)}
<Modals
open={selectedSectionId === currentSection.id}
open={selectedSectionId}
options={section.interruption.options}
label={section.interruption.reason}
label={{text: section.interruption.reason}}
name={`${section.name}.${index}.${section.interruption.name}`}
onAccept={
[modals.CONFIRM_DELETE_SECTION_MODAL, modals.INTERRUPTION_MODAL].includes(openModal)
Expand Down
2 changes: 1 addition & 1 deletion src/components/FormBuilder/Modals/Modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const getChildren = (modal, {options, label, name}) => {
);
case modals.INTERRUPTION_MODAL:
return (
<FastField component={Radio} options={options} label={label} name={name} required readOnlyMode={false} />
<FastField component={Radio} options={options} label={label} name={name} />
);
default:
return null;
Expand Down
9 changes: 8 additions & 1 deletion src/components/FormBuilder/SectionHeader/SectionHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,14 @@ function SectionHeader({
}
</Stack>
{section.introduction && (
<Typography data-testid="introduction" fontWeight="bold" color="gray">{section.introduction}</Typography>
<Typography
data-testid="introduction"
fontWeight="bold"
color="gray"
whiteSpace="pre-line"
>
{section.introduction}
</Typography>
)}
<Typography>{getHeaders(section.questions, values, section.headers)}</Typography>
</Stack>
Expand Down

0 comments on commit 16131e2

Please sign in to comment.