Skip to content

Commit

Permalink
Boolean field type (#4367)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecalcc authored Nov 7, 2023
1 parent db6c866 commit 61502c1
Show file tree
Hide file tree
Showing 12 changed files with 1,640 additions and 11 deletions.
2 changes: 1 addition & 1 deletion scripts/apps/authoring/authoring/preview-custom-field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class PreviewCustomField extends React.PureComponent<IProps> {
const FieldType = getField(field.custom_field_type);
const label = getLabelForFieldId(field._id, [field]);

if (FieldType == null || isEmpty(value)) {
if (FieldType == null || (typeof value !== 'boolean' && isEmpty(value))) {
return null;
}

Expand Down
22 changes: 12 additions & 10 deletions scripts/core/services/modalService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,19 @@ export function showPrintableModal(

<div className="sd-full-preview--content-wrapper">
{
contentSections.map((section, i) => (
<div key={i}>
{ // always start a new article on a new page in print mode
i > 0 && pageBreak
}

<div className="sd-full-preview--content">
{section}
contentSections.map((section, i) => {
return (
<div key={i}>
{ // always start a new article on a new page in print mode
i > 0 && pageBreak
}

<div className="sd-full-preview--content">
{section}
</div>
</div>
</div>
))
);
})
}
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions scripts/extensions/booleanField/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
Loading

0 comments on commit 61502c1

Please sign in to comment.