From 0f9f872859edc7e940d3025b572786ba0b6f9f01 Mon Sep 17 00:00:00 2001 From: Martina Bustacchini <41484878+deodorhunter@users.noreply.github.com> Date: Wed, 20 Sep 2023 09:57:54 +0200 Subject: [PATCH] feat: enable/disable external link icon in listing template SmallBlocksLink * fix: smallblockslink template and accessibility icon for external links * chore: update RELEASE.md --- RELEASE.md | 12 +++++++ locales/de/LC_MESSAGES/volto.po | 5 +++ locales/en/LC_MESSAGES/volto.po | 5 +++ locales/es/LC_MESSAGES/volto.po | 5 +++ locales/fr/LC_MESSAGES/volto.po | 5 +++ locales/it/LC_MESSAGES/volto.po | 5 +++ locales/volto.pot | 7 +++- .../Listing/SmallBlockLinksTemplate.jsx | 4 +++ src/config/Blocks/ListingOptions/index.js | 1 + .../ListingOptions/smallBlockLinksTemplate.js | 32 +++++++++++++++++++ src/config/Blocks/listingVariations.js | 9 ++++-- .../manage/UniversalLink/UniversalLink.jsx | 18 ++++++----- .../Blocks/_smallblockLinkstemplate.scss | 7 ++++ 13 files changed, 104 insertions(+), 11 deletions(-) create mode 100644 src/config/Blocks/ListingOptions/smallBlockLinksTemplate.js diff --git a/RELEASE.md b/RELEASE.md index 1a154b4d6..adcd31805 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -30,6 +30,17 @@ - ... --> + +## Versione x.x.x (dd/mm/yyyy) + +### Migliorie + +Nel template Blocco link solo immagini con link esterni, icona accessibilità per link esterni ora è disattivabile attraverso opzione del template + +### Fix + +- Fissato il layout del template Blocco link solo immagini con link esterni, icona accessibilità per link esterni ora è posizionata invece in overlay se presente + ## Versione 7.21.0 (19/09/2023) ### Novità @@ -41,6 +52,7 @@ - Blocco info: Colori dentro editor di testo sistemati (bottoni draftJS) - I link nella modulistica mostrano la remoteUrl + ## Versione 7.20.4 (13/09/2023) ### Fix diff --git a/locales/de/LC_MESSAGES/volto.po b/locales/de/LC_MESSAGES/volto.po index bbf99408e..ab9db93a0 100644 --- a/locales/de/LC_MESSAGES/volto.po +++ b/locales/de/LC_MESSAGES/volto.po @@ -2497,6 +2497,11 @@ msgstr "" msgid "other_info" msgstr "" +#: config/Blocks/ListingOptions/smallBlockLinksTemplate +# defaultMessage: Non mostrare l'icona di accessibilità per i link a siti esterni +msgid "override_links_accessibility_marker" +msgstr "Barrierefreiheitssymbol nicht für Links anzeigen, die auf externe Websites oder Ressourcen verweisen" + #: components/ItaliaTheme/View/Commons/TrasparenzaFields # defaultMessage: Pagamenti previsti e modalità msgid "pagamenti" diff --git a/locales/en/LC_MESSAGES/volto.po b/locales/en/LC_MESSAGES/volto.po index 13a95f04d..48a165ef3 100644 --- a/locales/en/LC_MESSAGES/volto.po +++ b/locales/en/LC_MESSAGES/volto.po @@ -2482,6 +2482,11 @@ msgstr "Ohter topics" msgid "other_info" msgstr "Further information" +#: config/Blocks/ListingOptions/smallBlockLinksTemplate +# defaultMessage: Non mostrare l'icona di accessibilità per i link a siti esterni +msgid "override_links_accessibility_marker" +msgstr "Do not show accessibility icon for links pointing to external websites or resources" + #: components/ItaliaTheme/View/Commons/TrasparenzaFields # defaultMessage: Pagamenti previsti e modalità msgid "pagamenti" diff --git a/locales/es/LC_MESSAGES/volto.po b/locales/es/LC_MESSAGES/volto.po index 471a0d951..da4e21887 100644 --- a/locales/es/LC_MESSAGES/volto.po +++ b/locales/es/LC_MESSAGES/volto.po @@ -2491,6 +2491,11 @@ msgstr "Otros temas" msgid "other_info" msgstr "Más información" +#: config/Blocks/ListingOptions/smallBlockLinksTemplate +# defaultMessage: Non mostrare l'icona di accessibilità per i link a siti esterni +msgid "override_links_accessibility_marker" +msgstr "No mostrar el ícono de accesibilidad para enlaces que apuntan a sitios web o recursos externos" + #: components/ItaliaTheme/View/Commons/TrasparenzaFields # defaultMessage: Pagamenti previsti e modalità msgid "pagamenti" diff --git a/locales/fr/LC_MESSAGES/volto.po b/locales/fr/LC_MESSAGES/volto.po index ff9060b99..28560574d 100644 --- a/locales/fr/LC_MESSAGES/volto.po +++ b/locales/fr/LC_MESSAGES/volto.po @@ -2499,6 +2499,11 @@ msgstr "Autres sujets" msgid "other_info" msgstr "Informations complémentaires" +#: config/Blocks/ListingOptions/smallBlockLinksTemplate +# defaultMessage: Non mostrare l'icona di accessibilità per i link a siti esterni +msgid "override_links_accessibility_marker" +msgstr "Ne pas afficher l'icône d'accessibilité pour les liens pointant vers des sites Web ou des ressources externes" + #: components/ItaliaTheme/View/Commons/TrasparenzaFields # defaultMessage: Pagamenti previsti e modalità msgid "pagamenti" diff --git a/locales/it/LC_MESSAGES/volto.po b/locales/it/LC_MESSAGES/volto.po index f5ce18d91..b52d64507 100644 --- a/locales/it/LC_MESSAGES/volto.po +++ b/locales/it/LC_MESSAGES/volto.po @@ -2482,6 +2482,11 @@ msgstr "Altri argomenti" msgid "other_info" msgstr "Ulteriori informazioni" +#: config/Blocks/ListingOptions/smallBlockLinksTemplate +# defaultMessage: Non mostrare l'icona di accessibilità per i link a siti esterni +msgid "override_links_accessibility_marker" +msgstr "" + #: components/ItaliaTheme/View/Commons/TrasparenzaFields # defaultMessage: Pagamenti previsti e modalità msgid "pagamenti" diff --git a/locales/volto.pot b/locales/volto.pot index 0b7a3ece8..f2f5570df 100644 --- a/locales/volto.pot +++ b/locales/volto.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plone\n" -"POT-Creation-Date: 2023-09-04T15:56:21.451Z\n" +"POT-Creation-Date: 2023-09-19T07:30:36.575Z\n" "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" "MIME-Version: 1.0\n" @@ -2484,6 +2484,11 @@ msgstr "" msgid "other_info" msgstr "" +#: config/Blocks/ListingOptions/smallBlockLinksTemplate +# defaultMessage: Non mostrare l'icona di accessibilità per i link a siti esterni +msgid "override_links_accessibility_marker" +msgstr "" + #: components/ItaliaTheme/View/Commons/TrasparenzaFields # defaultMessage: Pagamenti previsti e modalità msgid "pagamenti" diff --git a/src/components/ItaliaTheme/Blocks/Listing/SmallBlockLinksTemplate.jsx b/src/components/ItaliaTheme/Blocks/Listing/SmallBlockLinksTemplate.jsx index cd49a4d04..d70f1b0e5 100644 --- a/src/components/ItaliaTheme/Blocks/Listing/SmallBlockLinksTemplate.jsx +++ b/src/components/ItaliaTheme/Blocks/Listing/SmallBlockLinksTemplate.jsx @@ -17,6 +17,7 @@ const SmallBlockLinksTemplate = ({ linkTitle, linkHref, center_cards, + override_links_accessibility_marker, }) => { return (
@@ -44,6 +45,9 @@ const SmallBlockLinksTemplate = ({ item={!isEditMode ? item : null} href={isEditMode ? '#' : ''} className="img-link" + overrideMarkSpecialLinks={ + override_links_accessibility_marker + } > {image} diff --git a/src/config/Blocks/ListingOptions/index.js b/src/config/Blocks/ListingOptions/index.js index 71c5e74a7..82170be2b 100644 --- a/src/config/Blocks/ListingOptions/index.js +++ b/src/config/Blocks/ListingOptions/index.js @@ -19,3 +19,4 @@ export { addSliderTemplateOptions } from 'design-comuni-plone-theme/config/Block export { addSimpleListTemplateOptions } from 'design-comuni-plone-theme/config/Blocks/ListingOptions/simpleListTemplate'; export { addCardWithSlideUpTextTemplateOptions } from 'design-comuni-plone-theme/config/Blocks/ListingOptions/cardWithSlideUpTextTemplate'; export { addPhotogalleryTemplateOptions } from 'design-comuni-plone-theme/config/Blocks/ListingOptions/photogalleryTemplate'; +export { addSmallBlockLinksTemplateOptions } from 'design-comuni-plone-theme/config/Blocks/ListingOptions/smallBlockLinksTemplate'; diff --git a/src/config/Blocks/ListingOptions/smallBlockLinksTemplate.js b/src/config/Blocks/ListingOptions/smallBlockLinksTemplate.js new file mode 100644 index 000000000..227596ebd --- /dev/null +++ b/src/config/Blocks/ListingOptions/smallBlockLinksTemplate.js @@ -0,0 +1,32 @@ +import { defineMessages } from 'react-intl'; + +import { addSchemaField } from 'design-comuni-plone-theme/config/Blocks/ListingOptions'; + +const messages = defineMessages({ + override_links_accessibility_marker: { + id: 'override_links_accessibility_marker', + defaultMessage: + "Non mostrare l'icona di accessibilità per i link a siti esterni", + }, +}); + +export const addSmallBlockLinksTemplateOptions = ( + schema, + formData, + intl, + position = 0, +) => { + let pos = position; + + addSchemaField( + schema, + 'override_links_accessibility_marker', + intl.formatMessage(messages.override_links_accessibility_marker), + null, + { type: 'boolean' }, + pos, + ); + pos++; + + return pos; +}; diff --git a/src/config/Blocks/listingVariations.js b/src/config/Blocks/listingVariations.js index 9dea05273..0b4ca77be 100644 --- a/src/config/Blocks/listingVariations.js +++ b/src/config/Blocks/listingVariations.js @@ -58,9 +58,13 @@ import { addSimpleListTemplateOptions, addCardWithSlideUpTextTemplateOptions, addPhotogalleryTemplateOptions, + addSmallBlockLinksTemplateOptions, } from 'design-comuni-plone-theme/config/Blocks/ListingOptions'; -import { addLighthouseField, cloneBlock } from 'design-comuni-plone-theme/config/Blocks/ListingOptions/utils'; +import { + addLighthouseField, + cloneBlock, +} from 'design-comuni-plone-theme/config/Blocks/ListingOptions/utils'; const italiaListingVariations = [ { @@ -168,7 +172,8 @@ const italiaListingVariations = [ template: SmallBlockLinksTemplate, skeleton: SmallBlockLinksTemplateSkeleton, schemaEnhancer: ({ schema, formData, intl }) => { - /*let pos = */ addDefaultOptions(schema, formData, intl); + let pos = addDefaultOptions(schema, formData, intl); + addSmallBlockLinksTemplateOptions(schema, formData, intl, pos); return schema; }, cloneData: cloneBlock, diff --git a/src/customizations/volto/components/manage/UniversalLink/UniversalLink.jsx b/src/customizations/volto/components/manage/UniversalLink/UniversalLink.jsx index 238127402..668594c04 100644 --- a/src/customizations/volto/components/manage/UniversalLink/UniversalLink.jsx +++ b/src/customizations/volto/components/manage/UniversalLink/UniversalLink.jsx @@ -30,6 +30,7 @@ const UniversalLink = ({ children, className = null, title = null, + overrideMarkSpecialLinks = false, ...props }) => { const intl = useIntl(); @@ -117,14 +118,15 @@ const UniversalLink = ({ {...props} > {children} - {config.settings.siteProperties.markSpecialLinks && ( - - )} + {!overrideMarkSpecialLinks && + config.settings.siteProperties.markSpecialLinks && ( + + )} ); } else if (isDownload) { diff --git a/theme/ItaliaTheme/Blocks/_smallblockLinkstemplate.scss b/theme/ItaliaTheme/Blocks/_smallblockLinkstemplate.scss index d5c464058..e05f1c1bd 100644 --- a/theme/ItaliaTheme/Blocks/_smallblockLinkstemplate.scss +++ b/theme/ItaliaTheme/Blocks/_smallblockLinkstemplate.scss @@ -16,6 +16,13 @@ background: $white; box-shadow: 0 2px 20px 0 rgba(0, 0, 0, 0.1); + .img-link svg { + position: absolute; + top: 4px; + right: 4px; + z-index: 2; + } + img, .img-skeleton { width: auto;