Skip to content

Commit

Permalink
Merge branch 'main' into new-folder-contents
Browse files Browse the repository at this point in the history
  • Loading branch information
pnicolli committed Jun 3, 2024
2 parents 9300758 + e489cd9 commit 7c1979e
Show file tree
Hide file tree
Showing 20 changed files with 170 additions and 56 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/npm.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Release latest version on npm

on:
release:
types: [released]

jobs:
release_to_npm:
name: Release to npm
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -25,3 +27,16 @@ jobs:
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_OUTPUT"

- name: Trigger job
run: |
curl --fail --request POST \
--form token=${{ secrets.TOKEN }} \
--form ref=master \
--form "variables[ADDON_NAME]=design-comuni-plone-theme" \
--form "variables[ADDON_TAG]=${{ steps.get_version.outputs.VERSION }}" \
"https://gitlab.com/api/v4/projects/${{ secrets.PROJECT_ID }}/trigger/pipeline"
23 changes: 0 additions & 23 deletions .github/workflows/themes.yml

This file was deleted.

65 changes: 65 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,70 @@


## [11.12.7](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v11.12.6...v11.12.7) (2024-06-03)


### Maintenance

* improve cors error logging ([b9d4513](https://github.com/RedTurtle/design-comuni-plone-theme/commit/b9d4513d58101d13315a3cfc1a06cffecb3b0307))


### Documentation

* updated publiccode ([a277894](https://github.com/RedTurtle/design-comuni-plone-theme/commit/a27789465ba8a4f7214ddaf01181573a55ee3664))

## [11.12.6](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v11.12.5...v11.12.6) (2024-05-30)


### Bug Fixes

* applied img-wrapper styles to all html elements with class ([#688](https://github.com/RedTurtle/design-comuni-plone-theme/issues/688)) ([b66d5af](https://github.com/RedTurtle/design-comuni-plone-theme/commit/b66d5af94a754eaebc55336ad1c136611a9b01fe))


### Documentation

* updated publiccode and release log ([6d86f99](https://github.com/RedTurtle/design-comuni-plone-theme/commit/6d86f99887b6622aa4f238a020d546fa8004eeb5))

## [11.12.5](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v11.12.4...v11.12.5) (2024-05-30)


### Bug Fixes

* card with image when elements have no image ([ff99a3b](https://github.com/RedTurtle/design-comuni-plone-theme/commit/ff99a3b0081d734e63a853e6d44830cf9624a3f3))


### Maintenance

* update release jobs ([1318aad](https://github.com/RedTurtle/design-comuni-plone-theme/commit/1318aad487cb310b7d445a305fb311243ee2fac5))

## [11.12.4](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v11.12.3...v11.12.4) (2024-05-30)


### Bug Fixes

* added styles for recurrence widget fields layout ([#686](https://github.com/RedTurtle/design-comuni-plone-theme/issues/686)) ([ec415d1](https://github.com/RedTurtle/design-comuni-plone-theme/commit/ec415d1615524b79755d3f562fcef909f1a126d1))


### Maintenance

* improve cors error logging ([6c483a7](https://github.com/RedTurtle/design-comuni-plone-theme/commit/6c483a79fbe6d40d688c33a36bb61e96f37372fb))


### Documentation

* updated publiccode and release log ([312af90](https://github.com/RedTurtle/design-comuni-plone-theme/commit/312af90e5c708e090df1ccd7eaa194a7f03360ec))

## [11.12.3](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v11.12.2...v11.12.3) (2024-05-28)


### Bug Fixes

* removed figure tag + added prop for link condition ([#685](https://github.com/RedTurtle/design-comuni-plone-theme/issues/685)) ([601e16c](https://github.com/RedTurtle/design-comuni-plone-theme/commit/601e16c51938aefb45524d8661a901427ff79c86))


### Documentation

* updated publiccode ([79cae20](https://github.com/RedTurtle/design-comuni-plone-theme/commit/79cae2059c5135d4f036eb16b193f072dd176f86))

## [11.12.2](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v11.12.1...v11.12.2) (2024-05-27)


Expand Down
18 changes: 18 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,24 @@
- ...
-->

## Versione 11.12.6 (30/05/2024)

### Fix

- Il layout delle card con immagini rimane corretto anche selezionando l'opzione "Non alterare le dimensioni naturali dell'immagine".

## Versione 11.12.5 (30/05/2024)

### Fix

- Sistemato il layout "Card con immagine" dei blocchi elenco quando gli elementi non hanno immagine.

## Versione 11.12.4 (30/05/2024)

### Fix

- Aggiustato il layout dei campi nel widget delle ricorrenze.

## Versione 11.12.1 (21/05/2024)

### Migliorie
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "design-comuni-plone-theme",
"description": "Volto Theme for Italia design guidelines",
"license": "GPL-v3",
"version": "11.12.2",
"version": "11.12.7",
"main": "src/index.js",
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions publiccode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ maintenance:
name: io-Comune - Il sito AgID per Comuni ed Enti Pubblici
platforms:
- web
releaseDate: '2024-05-27'
releaseDate: '2024-06-03'
softwareType: standalone/web
softwareVersion: 11.12.2
softwareVersion: 11.12.7
url: 'https://github.com/italia/design-comuni-plone-theme'
usedBy:
- ASP Comuni Modenesi Area Nord
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const CardWithImageDefault = (props) => {
})}
>
<div className="img-responsive img-responsive-panoramic">
<figure className="img-wrapper">{image}</figure>
{image}
{item['@type'] === 'Event' && (
<CardCalendar
start={item.start}
Expand Down
18 changes: 12 additions & 6 deletions src/components/ItaliaTheme/Blocks/Listing/Commons/ListingImage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const ListingImage = ({
responsive = true,
showTitleAttr = true,
sizes = '(max-width:320px) 200px, (max-width:425px) 300px, (max-width:767px) 500px, 410px',
noWrapLink = false,
...imageProps
}) => {
const Image = config.getComponent({ name: 'Image' }).component;
Expand All @@ -30,13 +31,18 @@ const ListingImage = ({
// photogallery needs to check for null image
// https://stackoverflow.com/questions/33136399/is-there-a-way-to-tell-if-reactelement-renders-null

const image = (
<UniversalLink item={item}>{Image(commonImageProps)}</UniversalLink>
);
if (image === null)
return showDefault ? <img src={DefaultImageSVG} alt="" /> : null;
const image = Image(commonImageProps);
const defaultImage = <img src={DefaultImageSVG} alt="" />;

if (image === null && !showDefault) return null;

return image;
return !noWrapLink ? (
<UniversalLink item={item} className="img-wrapper">
{image ?? defaultImage}
</UniversalLink>
) : (
image ?? defaultImage
);
};

export const getListingImageBackground = (item = {}, size = 'listing') => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const InEvidenceTemplate = (props) => {
{index === 0 && image && (
<div className="img-responsive-wrapper">
<div className="img-responsive">
<figure className="img-wrapper">{image}</figure>
{image}
{item['@type'] === 'Event' && (
<CardCalendar start={item.start} end={item.end} />
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ const PhotogalleryTemplate = ({
? '650'
: '450'
}px`,
noWrapLink: true,
});
return (
<SingleSlideWrapper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const SmallBlockLinksTemplate = ({
sizes: '(max-width:575px) 520px, 200px',
style: {},
alt: item.title,
noWrapLink: true,
});

return (
Expand Down
16 changes: 12 additions & 4 deletions src/customizations/volto/components/theme/Error/Error.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const Error = (props) => {
let FoundView;

// CUSTOMIZATION: added logging of errors
const notifySentry = (error) => {
const notifySentry = (message) => {
const loaders = Object.entries(sentryLibraries).map(
([name, Lib]) =>
new Promise((resolve) =>
Expand All @@ -37,7 +37,15 @@ const Error = (props) => {
{},
...libs.map(([name, lib]) => ({ [name]: lib })),
);
libraries.Sentry.captureException(error);
class MaybeCorsError extends Error {
constructor(...args) {
super(...args);
this.name = 'MaybeCorsError';
}
}
libraries.Sentry.captureException(new MaybeCorsError(message), {
props,
});
});
};

Expand All @@ -50,7 +58,7 @@ const Error = (props) => {
'DEV MODE CORS ERROR in Error component: ',
JSON.stringify(props, null, 2),
);
notifySentry(props);
notifySentry('DEV MODE CORS ERROR in Error component');
FoundView = views.errorViews.corsError;
} else {
if (error.status.toString() === 'corsError') {
Expand All @@ -59,7 +67,7 @@ const Error = (props) => {
'CORS ERROR in Error component: ',
JSON.stringify(props, null, 2),
);
notifySentry(props);
notifySentry('CORS ERROR in Error component');
}
FoundView = views.errorViews[error.status.toString()];
}
Expand Down
19 changes: 15 additions & 4 deletions src/customizations/volto/components/theme/View/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class View extends Component {
.toLowerCase();

// CUSTOMIZATION: added logging of errors
notifySentry = (error) => {
notifySentry = (message) => {
const loaders = Object.entries(sentryLibraries).map(
([name, Lib]) =>
new Promise((resolve) =>
Expand All @@ -221,7 +221,18 @@ class View extends Component {
{},
...libs.map(([name, lib]) => ({ [name]: lib })),
);
libraries.Sentry.captureException(error);
class MaybeCorsError extends Error {
constructor(...args) {
super(...args);
this.name = 'MaybeCorsError';
}
}
libraries.Sentry.captureException(
new MaybeCorsError(message, {
props: this.props,
isAnonymous: !this.props.token,
}),
);
});
};

Expand All @@ -246,7 +257,7 @@ class View extends Component {
'DEV MODE CORS ERROR in View component: ',
JSON.stringify(this.props, null, 2),
);
this.notifySentry(this.props);
this.notifySentry('DEV MODE CORS ERROR in View component');
FoundView = views.errorViews.corsError;
} else {
if (this.props.error.status.toString() === 'corsError') {
Expand All @@ -255,7 +266,7 @@ class View extends Component {
'CORS ERROR in View component: ',
JSON.stringify(this.props, null, 2),
);
this.notifySentry(this.props);
this.notifySentry('CORS ERROR in View component');
}
FoundView = views.errorViews[this.props.error.status.toString()];
}
Expand Down
4 changes: 2 additions & 2 deletions src/theme/ItaliaTheme/Blocks/_cardWithImage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
height: auto;
padding: 0;

figure.img-wrapper {
.img-wrapper {
position: static;
margin: 0;
}
Expand Down Expand Up @@ -155,7 +155,7 @@
height: auto;
padding: 0;

figure.img-wrapper {
.img-wrapper {
position: static;
margin: 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/theme/ItaliaTheme/Blocks/_ctaBlock.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
display: flex;
}

figure.img-wrapper,
.img-wrapper,
picture {
position: absolute;
z-index: -1;
Expand Down
2 changes: 1 addition & 1 deletion src/theme/ItaliaTheme/Blocks/_inEvidenceTemplate.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
height: auto;
padding: 0;

figure.img-wrapper {
.img-wrapper {
position: static;
margin: 0;
}
Expand Down
4 changes: 2 additions & 2 deletions src/theme/ItaliaTheme/Blocks/_photogallerytemplate.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}

.single-slide {
figure.img-wrapper {
.img-wrapper {
height: auto;
max-height: 500px;

Expand All @@ -16,7 +16,7 @@
}
}

figure.img-wrapper {
.img-wrapper {
display: flex;
flex-direction: column;
justify-content: center;
Expand Down
Loading

0 comments on commit 7c1979e

Please sign in to comment.