Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix project built due to running react in the index file #35

Merged
merged 6 commits into from
Jul 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [0.6.5](https://github.com/eea/volto-block-image-cards/compare/0.6.4...0.6.5)

- removed debug header [`b37bc34`](https://github.com/eea/volto-block-image-cards/commit/b37bc34d792bba4f901caac1cde18091d7b01765)
- fix view and edit views by passing the props also to the style wrapper [`0c9222a`](https://github.com/eea/volto-block-image-cards/commit/0c9222abfcd3087a2a4fa241431a2284bf8c2b7e)
- eslint fix [`82284dc`](https://github.com/eea/volto-block-image-cards/commit/82284dc46aa0a0630e6722b643e800d47dd24e37)
- change(view): wrap views in their files avoiding parse error for other projects [`dddcf21`](https://github.com/eea/volto-block-image-cards/commit/dddcf21cebf019ceb5ef39c940bc482adf067917)

#### [0.6.4](https://github.com/eea/volto-block-image-cards/compare/0.6.3...0.6.4)

> 30 June 2022

- develop [`#34`](https://github.com/eea/volto-block-image-cards/pull/34)

#### [0.6.3](https://github.com/eea/volto-block-image-cards/compare/0.6.2...0.6.3)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-block-image-cards",
"version": "0.6.4",
"version": "0.6.5",
"description": "volto-block-image-cards: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
12 changes: 11 additions & 1 deletion src/ImageCards/ImageCardsEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import config from '@plone/volto/registry';
import ImageCardsView from './ImageCardsView';
import ImageCardSchema from './schema';

import { BlockStyleWrapperEdit } from '@eeacms/volto-block-style/BlockStyleWrapper';

const tweakSchema = (schema, data) => {
const { blockRenderers } = config.blocks.blocksConfig.imagecards;
const extension = data.display
Expand All @@ -14,7 +16,7 @@ const tweakSchema = (schema, data) => {
return extension ? extension(schema, data) : schema;
};

const ImageCardsEdit = (props) => {
const CardsEdit = (props) => {
const { selected, onChangeBlock, data = {}, block } = props;
const basicSchema = ImageCardSchema(props);
const schema = tweakSchema(basicSchema, props.data, props.intl);
Expand All @@ -41,4 +43,12 @@ const ImageCardsEdit = (props) => {
);
};

const ImageCardsEdit = (props) => {
return (
<BlockStyleWrapperEdit {...props}>
<CardsEdit {...props} />
</BlockStyleWrapperEdit>
);
};

export default ImageCardsEdit;
14 changes: 12 additions & 2 deletions src/ImageCards/ImageCardsView.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import React from 'react';
import config from '@plone/volto/registry';

const ImageCardView = (props) => {
import { BlockStyleWrapperView } from '@eeacms/volto-block-style/BlockStyleWrapper';

const CardsView = (props) => {
const byDisplayType = {};
const blockRenderers = config.blocks.blocksConfig.imagecards.blockRenderers;
const block_renderers_ids = Object.keys(blockRenderers);
Expand All @@ -13,4 +15,12 @@ const ImageCardView = (props) => {
return Impl ? <Impl {...props} /> : '';
};

export default ImageCardView;
const ImageCardsView = (props) => {
return (
<BlockStyleWrapperView {...props}>
<CardsView {...props} />
</BlockStyleWrapperView>
);
};

export default ImageCardsView;
17 changes: 2 additions & 15 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import iconSVG from '@plone/volto/icons/images.svg';
import React from 'react';
import { ImageCardsView, ImageCardsEdit } from './ImageCards';
import {
BlockStyleWrapperEdit,
BlockStyleWrapperView,
} from '@eeacms/volto-block-style/BlockStyleWrapper';
import {
Cards,
Carousel,
Expand All @@ -18,16 +13,8 @@ export default (config) => {
title: 'Image Cards',
icon: iconSVG,
group: 'common',
view: (props) => (
<BlockStyleWrapperView {...props}>
<ImageCardsView {...props} />
</BlockStyleWrapperView>
),
edit: (props) => (
<BlockStyleWrapperEdit {...props}>
<ImageCardsEdit {...props} />
</BlockStyleWrapperEdit>
),
view: ImageCardsView,
edit: ImageCardsEdit,
restricted: false,
mostUsed: false,
sidebarTab: 1,
Expand Down