Skip to content

Commit

Permalink
Merge pull request #68 from eea/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
avoinea authored Jul 19, 2023
2 parents bc5fd0a + b1dd763 commit abe8c7c
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 101 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ 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).

### [4.2.2](https://github.com/eea/volto-listing-block/compare/4.2.1...4.2.2) - 19 July 2023

#### :hammer_and_wrench: Others

- Fix cases when image_field is null [laszlocseh - [`b9626e1`](https://github.com/eea/volto-listing-block/commit/b9626e1b16b476bf7129c234ec301762b1d482a6)]
- test: Fix issues identified by Sonarqube refs #254220 [dana-cfc4 - [`29fe139`](https://github.com/eea/volto-listing-block/commit/29fe13952299e3265a49aacf9875e3a164af7e58)]
### [4.2.1](https://github.com/eea/volto-listing-block/compare/4.2.0...4.2.1) - 13 June 2023

#### :bug: Bug Fixes
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-listing-block",
"version": "4.2.1",
"version": "4.2.2",
"description": "@eeacms/volto-listing-block: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
13 changes: 3 additions & 10 deletions src/PreviewImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import { flattenToAppURL } from '@plone/volto/helpers';
import DefaultImageSVG from './default-image.svg';

const getSrc = (item, size) =>
flattenToAppURL(`${item['@id']}/@@images/${item.image_field}/${size}`);
flattenToAppURL(
`${item['@id']}/@@images/${item.image_field || 'image'}/${size}`,
);

// TODO: do we still need volto-depiction compatibility?
// import DefaultImageSVG from '@plone/volto/components/manage/Blocks/Listing/default-image.svg';
Expand Down Expand Up @@ -65,13 +67,4 @@ function PreviewImage(props) {
);
}

// PreviewImage.propTypes = {
// size: PropTypes.string,
// item: PropTypes.shape({
// '@id': PropTypes.string.isRequired,
// image_field: PropTypes.string,
// title: PropTypes.string.isRequired,
// }),
// };

export default PreviewImage;
1 change: 0 additions & 1 deletion src/blocks/Listing/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// import { addStyling } from '@plone/volto/helpers';
import UniversalCard from '@eeacms/volto-listing-block/components/UniversalCard/UniversalCard';
import { composeSchema } from '@eeacms/volto-listing-block/schema-utils';

Expand Down
1 change: 0 additions & 1 deletion src/blocks/Listing/layout-templates/Carousel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ const CardsCarousel = ({ block, items, ...rest }) => {

CardsCarousel.schemaEnhancer = (args) => {
const { schema } = args;
// const schema = UniversalCard.schemaEnhancer(args);

schema.fieldsets.splice(1, 0, {
id: 'carousel',
Expand Down
41 changes: 0 additions & 41 deletions src/blocks/Listing/layout-templates/Gallery.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ const Gallery = ({
};

Gallery.schemaEnhancer = ({ schema }) => {
// const schema = UniversalCard.schemaEnhancer(args);
// schema.fieldsets[0].fields.push('gridSize');

schema.fieldsets.splice(1, 0, {
id: 'cardsGallery',
title: 'Gallery',
Expand Down Expand Up @@ -60,41 +57,3 @@ Gallery.propTypes = {
};

export default Gallery;

// const makeTextBody = (item) => (
// <Card.Content>
// <Card.Meta>
// {hasDate && item.effective && (
// <span className="category">
// {moment(item.effective).format('ll')}
// </span>
// )}
// </Card.Meta>
// <Card.Header>{item.title ? item.title : item.id}</Card.Header>
// {hasDescription && (
// <Card.Description>
// <p>{item.description}</p>
// </Card.Description>
// )}
// </Card.Content>
// );
//
// const makeImage = (item) => {
// return (
// <ConditionalLink className="image" item={item} condition={!isEditMode}>
// <PreviewImage item={item} alt={item.title} />
// </ConditionalLink>
// );
// };
//
// <Card key={item['@id']} className={cx('centered', styles?.theme)}>
// {makeImage(item)}
// {makeTextBody(item)}
// </Card>

// import PreviewImage from '@eeacms/volto-listing-block/PreviewImage';
// import { ConditionalLink } from '@plone/volto/components';
// import { Card } from 'semantic-ui-react';
// import cx from 'classnames';
// styles,
// itemModel,
38 changes: 0 additions & 38 deletions src/blocks/Listing/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,6 @@ const ALIGN_INFO_MAP = {
center: [alignCenterSVG, 'Center'],
};

// export const setBasicStylingSchema = (args) => {
// const { schema, intl } = args;
// schema.properties.styles.schema = {
// fieldsets: [
// {
// id: 'styling',
// title: 'Styling',
// fields: ['theme', 'inverted', 'rounded'],
// },
// ],
// properties: {
// theme: {
// title: intl.formatMessage(messages.Theme),
// description: intl.formatMessage(messages.ThemeHelp),
// choices: [
// ['', intl.formatMessage(messages.ThemeDefault)],
// ['primary', intl.formatMessage(messages.ThemePrimary)],
// ['secondary', intl.formatMessage(messages.ThemeSecondary)],
// ['tertiary', intl.formatMessage(messages.ThemeTertiary)],
// ],
// },
// inverted: {
// title: intl.formatMessage(messages.Inverted),
// description: intl.formatMessage(messages.InvertedHelp),
// type: 'boolean',
// },
// rounded: {
// title: intl.formatMessage(messages.Rounded),
// description: intl.formatMessage(messages.RoundedHelp),
// type: 'boolean',
// },
// },
// required: [],
// };

// return schema;
// };

const CallToActionSchema = ({ formData }) => {
return {
fieldsets: [
Expand Down
3 changes: 0 additions & 3 deletions src/blocks/Teaser/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { composeSchema } from '@eeacms/volto-listing-block/schema-utils';
// import { addStyling } from '@plone/volto/helpers';

import TeaserCardTemplate from './Card';
import { adjustTeaserSchema } from './schema';
import UniversalCard from '@eeacms/volto-listing-block/components/UniversalCard/UniversalCard';
// import { setBasicStylingSchema } from '../Listing/schema';

export default (config) => {
if (config.blocks.blocksConfig.teaser) {
Expand Down
2 changes: 0 additions & 2 deletions src/blocks/Teaser/schema.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
export const adjustTeaserSchema = ({ schema }) => {
// const fieldset = schema.fieldsets.find(({fields}) => fields?.indexOf('title') > -1);

// make the title required for accessibility reasons
if (schema.properties?.title && schema.required?.indexOf('title') === -1) {
schema.required.push('title');
Expand Down
3 changes: 0 additions & 3 deletions src/components/UniversalCard/UniversalCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import config from '@plone/volto/registry';
import { resolveExtension } from '@plone/volto/helpers/Extensions/withBlockExtensions';
import { Item } from './model';
import cx from 'classnames';

// import { getVoltoStyles } from '@eeacms/volto-listing-block/schema-utils';
import { buildStyleClassNamesFromData } from '@plone/volto/helpers';
//
import schemaEnhancer from './schema';

function UniversalCard(props) {
Expand Down
1 change: 0 additions & 1 deletion src/components/UniversalCard/fragments/CardMeta.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const CardMeta = (props) => {
const locale = config.settings.dateLocale || 'en-gb';
const showDate = itemModel.hasDate !== false && EffectiveDate !== 'None';
const showMeta = !!(head_title || (itemModel?.hasMetaType && item['@type']));
// const show = showDate || showMeta;

// TODO: <EEAFormattedDate data={EffectiveDate} />

Expand Down

0 comments on commit abe8c7c

Please sign in to comment.