Skip to content

Commit

Permalink
fix: paths working and index.js set
Browse files Browse the repository at this point in the history
  • Loading branch information
Wagner3UB committed Mar 1, 2024
1 parent ef8d82b commit 506870c
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 49 deletions.
2 changes: 1 addition & 1 deletion src/RepeatableContentBlock/Body.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types';
import { RichTextRender } from '../Widget/RichText/RichTextRender';
import { RichTextRender } from '../Widget';
import { defineMessages, useIntl } from 'react-intl';

const Body = (props) => {
Expand Down
2 changes: 1 addition & 1 deletion src/RepeatableContentBlock/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { Segment } from 'semantic-ui-react';
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
import { LinkToWidget } from '../Widget/LinkToWidget';
import LinkToWidget from '../Widget/LinkToWidget/LinkToWidget';

const messages = defineMessages({
select_content: {
Expand Down
34 changes: 17 additions & 17 deletions src/RepeatableContentBlock/Skeleton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ import React from 'react';
import PropTypes from 'prop-types';

import {
Row,
Col,
Card,
CardBody,
CardText,
CardTitle,
} from 'design-react-kit/dist/design-react-kit';
GridRow,
GridColumn,
Grid,
CardHeader,
CardDescription,
CardContent,
} from 'semantic-ui-react';

const Skeleton = () => {
return (
<div className="skeleton-template">
<Row>
<Col lg={{ size: 12, order: 1 }}>
<Card>
<CardBody className="pb-2">
<CardTitle tag="h2">-</CardTitle>
<CardText></CardText>
</CardBody>
</Card>
</Col>
</Row>
<Grid>
<GridRow>
<GridColumn>
<CardContent className="pb-2">
<CardHeader tag="h2">-</CardHeader>
<CardDescription></CardDescription>
</CardContent>
</GridColumn>
</GridRow>
</Grid>
</div>
);
};
Expand Down
5 changes: 5 additions & 0 deletions src/RepeatableContentBlock/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export Skeleton from './Skeleton';
export Edit from './Edit';
export View from './View';
export Body from './Body';
export View from './View';
File renamed without changes.
6 changes: 4 additions & 2 deletions src/Widget/RichText/RenderBlocks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ const messages = defineMessages({
defaultMessage: 'Blocco sconosciuto',
},
});

/**
* RenderBlocks view component class.
* @function RenderBlocks
* @params {object} content: Content object.
* @returns {string} Markup of the component.
*/

const RenderBlocks = ({
data,
content,
Expand Down Expand Up @@ -78,8 +80,8 @@ const RenderBlocks = ({
) : null;
};

export default RenderBlocks;

RenderBlocks.propTypes = {
data: PropTypes.any,
};

export default RenderBlocks;
2 changes: 1 addition & 1 deletion src/Widget/RichText/RichTextRender.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import cx from 'classnames';
import { flattenDeep, values } from 'lodash';
import { flattenHTMLToAppURL } from '@plone/volto/helpers';
import { hasBlocksData } from '@plone/volto/helpers';
import { RenderBlocks } from './RenderBlocks';
import RenderBlocks from './RenderBlocks';

const richTextHasContent = (data) => {
if (hasBlocksData(data)) {
Expand Down
3 changes: 3 additions & 0 deletions src/Widget/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export RenderBlocks from './RichText/RenderBlocks';
export RichText from './RichText/RichText';
export { RichTextRender } from './RichText/RichTextRender';
42 changes: 15 additions & 27 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,21 @@ import sitemapSVG from '@plone/volto/icons/repeat.svg';
import RepeatableContentEdit from './RepeatableContentBlock/Edit';
import RepeatableContentView from './RepeatableContentBlock/View';

const applyConfig = (config) => {
config.blocks.blocksConfig = {
...(config.blocks.blocksConfig = {
repeatableContentBlock: {
id: 'repeatableContentBlock',
title: 'Contenuto da replicare',
icon: sitemapSVG,
group: 'common',
view: RepeatableContentView,
edit: RepeatableContentEdit,
restricted: false,
mostUsed: true,
security: {
addPermission: [],
view: [],
},
sidebarTab: 1,
},
}),
export default (config) => {
config.blocks.blocksConfig.repeatableContentBlock = {
id: 'repeatableContentBlock',
title: 'Contenuto da replicare',
icon: sitemapSVG,
group: 'common',
view: RepeatableContentView,
edit: RepeatableContentEdit,
restricted: false,
mostUsed: true,
security: {
addPermission: [],
view: [],
},
sidebarTab: 1,
};
config.settings['volto-blocks-widget'].allowedBlocks = [
...config.settings['volto-blocks-widget'].allowedBlocks,
'repeatableContentBlock',
];

return config;
};

export default applyConfig;
export { RepeatableContentEdit, RepeatableContentView };

0 comments on commit 506870c

Please sign in to comment.