Skip to content

Commit

Permalink
breaking: renamed redraftHelper to richTextHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliaghisini committed Oct 9, 2023
1 parent d3d88b3 commit 344cde3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export {
contentFolderHasItems,
renderPDCItemValue,
} from 'design-comuni-plone-theme/helpers/contentHelper';
export { checkRedraftHasContent } from 'design-comuni-plone-theme/helpers/redraftHelper';
export { checkRichTextHasContent } from 'design-comuni-plone-theme/helpers/richTextHelper';
export { getTableRowData } from 'design-comuni-plone-theme/helpers/amministrazioneTrasparenteHelper';
export { getItemsByPath } from 'design-comuni-plone-theme/helpers/getItemsByPath';
export {
Expand Down
9 changes: 0 additions & 9 deletions src/helpers/redraftHelper.js

This file was deleted.

12 changes: 12 additions & 0 deletions src/helpers/richTextHelper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { serializeNodesToText } from '@plone/volto-slate/editor/render';
/*
Used to verify if slate text blocks are empty
*/
export const checkRichTextHasContent = (text) => {
if (text?.[0]?.children) {
return serializeNodesToText(text?.[0]?.children || [])?.length > 0
? true
: false;
}
return false;
};

0 comments on commit 344cde3

Please sign in to comment.