Skip to content

Commit

Permalink
Boolean field type
Browse files Browse the repository at this point in the history
  • Loading branch information
thecalcc committed Nov 7, 2023
1 parent 087f8c2 commit 55e7012
Show file tree
Hide file tree
Showing 12 changed files with 1,649 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
23 changes: 13 additions & 10 deletions scripts/core/services/modalService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,20 @@ 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) => {
console.log(section, contentSections);

Check failure on line 82 in scripts/core/services/modalService.tsx

View workflow job for this annotation

GitHub Actions / test

Unexpected console statement
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 55e7012

Please sign in to comment.