Skip to content

Commit

Permalink
Added support for blocksConfig configuration in the listing block (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh authored Oct 11, 2023
1 parent 8caa10f commit 85015ff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions news/5310.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added support for blocksConfig configuration in the listing block @sneridagh
6 changes: 3 additions & 3 deletions src/components/manage/Blocks/Listing/ListingData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import React from 'react';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { BlockDataForm } from '@plone/volto/components';
import config from '@plone/volto/registry';

const ListingData = (props) => {
const { data, block, onChangeBlock } = props;
const { data, block, blocksConfig, onChangeBlock } = props;
const intl = useIntl();
const schema = config.blocks.blocksConfig.listing.blockSchema({
const schema = blocksConfig.listing.blockSchema({
...props,
intl,
});
Expand All @@ -24,6 +23,7 @@ const ListingData = (props) => {
}}
onChangeBlock={onChangeBlock}
formData={data}
blocksConfig={blocksConfig}
block={block}
/>
);
Expand Down
2 changes: 2 additions & 0 deletions src/components/manage/Blocks/Listing/ListingData.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import renderer from 'react-test-renderer';
import configureStore from 'redux-mock-store';
import { Provider } from 'react-intl-redux';
import { waitFor } from '@testing-library/react';
import config from '@plone/volto/registry';

import ListingData from './ListingData';

Expand Down Expand Up @@ -33,6 +34,7 @@ test('renders an Listing Data Sidebar component', async () => {
block="1234"
pathname="/news"
onChangeBlock={() => {}}
blocksConfig={{ listing: config.blocks.blocksConfig.listing }}
/>
</Provider>,
);
Expand Down

0 comments on commit 85015ff

Please sign in to comment.