Skip to content

Commit

Permalink
feat: Us 46339 link esterni smalllinksblock (#339)
Browse files Browse the repository at this point in the history
* fix: aggiunto opzione al template per rimuovere l'svg accessibilita per link a siti esterni, posizionato absolute rispetto all'immagine

* chore: translations

* chore: update RELEASE.md
  • Loading branch information
deodorhunter authored Sep 20, 2023
1 parent a311095 commit 9d4ab47
Show file tree
Hide file tree
Showing 13 changed files with 96 additions and 12 deletions.
8 changes: 7 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +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

- sistemati gli oggetti link che puntano a file nella Cartella Modulistica

- Sistemato l'allineamento degli elementi nel blocco Contatti: se ci sono meno di tre elementi l'allineamento è centrato, se ce ne sono più di 3 l'allineamento è a sinistra.
- Migliorata accessibilità del calendario nel blocco ricerca Eventi e ricerca Bandi
- Fissato il layout del template Blocco link solo immagini con link esterni, posizionata l'icona di accessibilità per link esterni in overlay se presente

5 changes: 5 additions & 0 deletions locales/de/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2633,6 +2633,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"
Expand Down
5 changes: 5 additions & 0 deletions locales/en/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2618,6 +2618,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"
Expand Down
5 changes: 5 additions & 0 deletions locales/es/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2627,6 +2627,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"
Expand Down
5 changes: 5 additions & 0 deletions locales/fr/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2635,6 +2635,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"
Expand Down
5 changes: 5 additions & 0 deletions locales/it/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2618,6 +2618,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"
Expand Down
7 changes: 6 additions & 1 deletion locales/volto.pot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Plone\n"
"POT-Creation-Date: 2023-08-28T07:32:02.134Z\n"
"POT-Creation-Date: 2023-09-18T12:53:30.989Z\n"
"Last-Translator: Plone i18n <[email protected]>\n"
"Language-Team: Plone i18n <[email protected]>\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -2620,6 +2620,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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const SmallBlockLinksTemplate = ({
linkHref,
titleLine,
linkmore_id_lighthouse,
override_links_accessibility_marker,
}) => {
return (
<div className="small-block-links">
Expand Down Expand Up @@ -48,6 +49,9 @@ const SmallBlockLinksTemplate = ({
item={!isEditMode ? item : null}
href={isEditMode ? '#' : ''}
className="img-link"
overrideMarkSpecialLinks={
override_links_accessibility_marker
}
>
{image}
</UniversalLink>
Expand Down
1 change: 1 addition & 0 deletions src/config/Blocks/ListingOptions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,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';
32 changes: 32 additions & 0 deletions src/config/Blocks/ListingOptions/smallBlockLinksTemplate.js
Original file line number Diff line number Diff line change
@@ -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;
};
4 changes: 3 additions & 1 deletion src/config/Blocks/listingVariations.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import {
addCardWithSlideUpTextTemplateOptions,
addPhotogalleryTemplateOptions,
addLinkMoreOptions,
addSmallBlockLinksTemplateOptions,
cloneBlock,
} from 'design-comuni-plone-theme/config/Blocks/ListingOptions';

Expand Down Expand Up @@ -178,7 +179,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);
addLinkMoreOptions(schema, formData, intl);
return schema;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const UniversalLink = ({
children,
className = null,
title = null,
overrideMarkSpecialLinks = false,
...props
}) => {
const intl = useIntl();
Expand Down Expand Up @@ -116,14 +117,15 @@ const UniversalLink = ({
{...props}
>
{children}
{config.settings.siteProperties.markSpecialLinks && (
<Icon
icon="it-external-link"
title={title}
size="xs"
className="align-top ms-1 external-link"
/>
)}
{!overrideMarkSpecialLinks &&
config.settings.siteProperties.markSpecialLinks && (
<Icon
icon="it-external-link"
title={title}
size="xs"
className="align-top ms-1 external-link"
/>
)}
</a>
);
} else if (isDownload) {
Expand Down
9 changes: 8 additions & 1 deletion src/theme/ItaliaTheme/Blocks/_smallblockLinkstemplate.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,20 @@
border: 8px solid $white;
background: $white;
box-shadow: 0 2px 20px 0 rgba(0, 0, 0, 0.1);
position: relative;

.img-link svg {
position: absolute;
top: 4px;
right: 4px;
z-index: 2;
}

.volto-image.responsive img,
.img-skeleton {
width: auto;
max-width: 100%;
object-fit: contain;

}

.img-skeleton {
Expand Down

0 comments on commit 9d4ab47

Please sign in to comment.