Skip to content

Commit

Permalink
Merge branch 'develop' into bug_45924_blocco_numeri_sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
pnicolli authored Oct 13, 2023
2 parents b61112b + e584f63 commit eae8ad5
Show file tree
Hide file tree
Showing 16 changed files with 120 additions and 35 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
RELEASE.md merge=union
14 changes: 13 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,20 @@
- ...
-->

## Versione 8.x.x (xx/xx/2023)
## Versione X.X.X (dd/mm/yyyy)

### Migliorie

- Migliorato il comportamento alla selezione/deselezione degli elementi multipli nel componente Object Browser

### Fix

- Eliminata la sovrapposizione tra immagine e testo nel tipo documento Pagina quando l'immagine è verticale
- Cambiato il colore del bordo dell'icona Ricerca nell'header dei sottositi per garantire il contrasto per accessibilità
- Non mostrare la fascia colorata del footer di un sottosito quando questo non è compilato
- Risolto un bug nel componente Object Browser che permetteva di selezionare più elementi di quelli consentiti
- Alcune icone mancanti nel widget icone fontawesome sono state rese nuovamente visibili
- Sistemate inconsistenze nella visualizzazione di alcuni tipi di elementi della lista degli allegati in Cartella Modulistica
- Visualizzazione sidebar in edit del blocco Numeri: sistemato overflowing del testo di aiuto

## Versione 8.7.8 (12/10/2023)
Expand All @@ -59,6 +69,8 @@

- Aggiornata nuova icona di Twitter

## Versione 8.7.6 (06/10/2023)

### Fix

- Uniformato e impostato a sinistra l'allineamento del testo nel blocco Elenco nella variazione Quadratoni con immagine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const CompleteBlockLinksTemplate = ({
icon="it-external-link"
title={title}
size="xs"
className="align-top ms-1 external-link"
className="ms-1 align-sub external-link"
/>
)}
</CardTitle>
Expand Down
3 changes: 0 additions & 3 deletions src/components/ItaliaTheme/Footer/FooterSmall.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ const FooterSmall = () => {
return subFooterItems?.length > 0 || links.length > 0 || true ? (
<div className="it-footer-small-prints clearfix">
<Container tag="div">
<h3 className="visually-hidden">
{intl.formatMessage(messages.goToPage)}
</h3>
<ul className="it-footer-small-prints-list list-inline mb-0 d-flex flex-column flex-md-row">
{subFooterItems?.length > 0 &&
subFooterItems.map((item, index) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/ItaliaTheme/Footer/SubsiteFooter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import React from 'react';
import { useSelector } from 'react-redux';
import { useLocation } from 'react-router-dom';
import { flattenHTMLToAppURL, isCmsUi } from '@plone/volto/helpers';
import { richTextHasContent } from 'design-comuni-plone-theme/components/ItaliaTheme/View';

const SubsiteFooter = () => {
const location = useLocation();
const isCmsUI = isCmsUi(location.pathname);
const subsite = useSelector((state) => state.subsite?.data);

return subsite?.subsite_footer?.data ? (
return richTextHasContent(subsite?.subsite_footer) ? (
<div className={`subsite-footer ${isCmsUI ? 'public-ui' : ''}`}>
<div className="text">
<div className="container px-md-4">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ const DocRow = ({ doc }) => {

{/*Single file*/}
{doc.items?.length === 1 && (
<div className="doc">
<div
className={cx('doc', {
'link-to-doc': doc.items[0]?.['@type'] === 'Link',
})}
>
{titleWrapper}
{doc.items?.length === 1 && (
<Downloads item={doc.items[0]} titleDoc={doc.title} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ class ObjectBrowserBody extends Component {
onSelectItem = (item) => {
const url = item['@id'];
const { block, data, mode, dataName, onChangeBlock } = this.props;

const updateState = (mode) => {
switch (mode) {
case 'image':
Expand Down Expand Up @@ -312,8 +311,18 @@ class ObjectBrowserBody extends Component {
};

isSelectable = (item) => {
return this.props.selectableTypes.length > 0
? this.props.selectableTypes.indexOf(item['@type']) >= 0
const { maximumSelectionSize, data, mode, selectableTypes } = this.props;
if (
maximumSelectionSize &&
data &&
mode === 'multiple' &&
maximumSelectionSize <= data.length
)
return data.some(
(d) => flattenToAppURL(d['@id']) === flattenToAppURL(item['@id']),
);
return selectableTypes.length > 0
? selectableTypes.indexOf(item['@type']) >= 0
: true;
};

Expand All @@ -331,16 +340,24 @@ class ObjectBrowserBody extends Component {
!this.props.maximumSelectionSize ||
this.props.mode === 'multiple' ||
!this.props.data ||
this.props.data.length < this.props.maximumSelectionSize
this.props.data.length <= this.props.maximumSelectionSize
) {
let isDeselecting;
if (this.props.mode === 'multiple' && Array.isArray(this.props.data))
isDeselecting = this.props.data.some(
(d) => flattenToAppURL(d['@id']) === flattenToAppURL(item['@id']),
);
this.onSelectItem(item);
let length = this.props.data ? this.props.data.length : 0;

let stopSelecting =
this.props.mode !== 'multiple' ||
(this.props.maximumSelectionSize > 0 &&
length + 1 >= this.props.maximumSelectionSize);

let stopSelecting = this.props.mode !== 'multiple';
if (isDeselecting && !stopSelecting)
stopSelecting =
this.props.maximumSelectionSize > 0 &&
length - 1 >= this.props.maximumSelectionSize;
else
stopSelecting =
this.props.maximumSelectionSize > 0 &&
length + 1 >= this.props.maximumSelectionSize;
if (stopSelecting) {
this.props.closeObjectBrowser();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const UniversalLink = ({
icon="it-external-link"
title={title}
size="xs"
className="align-top ms-1 external-link"
className="ms-1 align-sub external-link"
/>
)}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,15 @@ export class ObjectBrowserWidgetComponent extends Component {
* @returns {string} Markup for the component.
*/
render() {
const { id, description, fieldSet, value, mode, onChange, isDisabled } =
this.props;
const {
id,
description,
fieldSet,
value,
mode,
onChange,
isDisabled,
} = this.props;

let items = compact(!isArray(value) && value ? [value] : value || []);

Expand Down
2 changes: 1 addition & 1 deletion src/helpers/IconWidget/IconAliasHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ export const fontAwesomeAliases = {
'pencil-paintbrush': 'pen-paintbrush',
'pencil-ruler': 'pen-ruler',
pennant: 'flag-pennant',
'people-arrows': 'people-arrows-left-right',
'people-arrows': 'people-arrows',
'people-carry': 'people-carry-box',
percentage: 'percent',
'person-carry': 'person-carry-box',
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/IconWidget/IconWidgetHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const defaultIconWidgetOptions = [
['bus', 'Trasporto'],
['heart', 'Matrimonio'],
['person-booth', 'Procedura elettorale e voto'],
['masks-theater ', 'Tempo libero'],
['masks-theater', 'Tempo libero'],
['book', 'Cultura'],
['passport', 'Immigrazione'],
['smog', 'Inquinamento'],
Expand Down
11 changes: 11 additions & 0 deletions src/theme/ItaliaTheme/Blocks/_ctaBlock.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
color: $secondary-text;
font-size: 0.9rem;
text-transform: uppercase;
position: relative;

&:hover,
&:focus {
Expand All @@ -47,6 +48,9 @@
}
.external-link {
fill: $external-link-fill-buttons !important;
position: absolute;
top: 3px;
right: 3px;
}
}

Expand Down Expand Up @@ -121,6 +125,13 @@
padding: 18px 60px;
font-weight: bold;
font-size: 1rem;
position: relative;

.external-link {
position: absolute;
top: 3px;
right: 3px;
}

&:hover,
&:focus {
Expand Down
1 change: 0 additions & 1 deletion src/theme/ItaliaTheme/Components/_pageHeader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

.header-image {
max-width: 16em;
max-height: 8em;
}

.link-list-wrapper .link-list {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@

.it-search-wrapper {
a {
&.search-link {
outline: $subsite-primary 2px solid !important;
}

&.rounded-icon {
svg {
@if $subsite-light-theme {
Expand Down
52 changes: 41 additions & 11 deletions src/theme/ItaliaTheme/Views/_cartellaModulistica.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,10 @@ $docs-section-margin: 3em;
align-items: center;
justify-content: space-between;
padding: 0.4em 0;

gap: 4rem;
.title-wrap {
flex: 1;

&.single-row {
max-width: 70%;
}
.title {
font-size: 1.2em;
font-weight: 500;
Expand Down Expand Up @@ -88,13 +85,25 @@ $docs-section-margin: 3em;

a.modulistica-link {
display: flex;
width: 100%;
position: relative;
align-items: center;
justify-content: space-between;

svg {
width: 2em;
font-size: 1.2em;
height: fit-content;
flex-shrink: 0;

svg.icon.fa-icon {
width: 1.6rem;
height: 1.6rem;
font-size: 1.3rem;
order: 2;
margin-right: 1.15rem;
margin-left: 0.25rem;
}
svg.external-link {
order: 1;
right: 0;
top: -2px;
position: absolute;
}
}
}
Expand Down Expand Up @@ -169,16 +178,37 @@ $docs-section-margin: 3em;
.doc-row {
.doc {
flex-wrap: wrap;
align-items: unset;
align-items: center;
justify-content: unset;
gap: 2rem;
&.link-to-doc {
align-items: unset;
gap: 0.5rem;
.title-wrap,
a.modulistica-link {
flex-basis: 100%;
svg.icon.fa-icon {
margin-left: 0;
margin-right: 1.25rem;
}
}
}
.title-wrap {
&.single-row {
max-width: none;
}
}

&.modulo {
justify-content: space-between;
.title,
.downloads {
flex-basis: unset;
}
}
.title,
.downloads {
flex: 1 1 100%;
flex: 1 1 unset;
justify-content: flex-end;

a {
Expand Down
3 changes: 3 additions & 0 deletions src/theme/ItaliaTheme/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@

.external-link {
fill: $link-color !important;
&.align-sub {
vertical-align: sub;
}

&:hover {
fill: #004080 !important;
Expand Down

0 comments on commit eae8ad5

Please sign in to comment.