diff --git a/src/customizations/volto/components/manage/Sidebar/ObjectBrowserBody.jsx b/src/customizations/volto/components/manage/Sidebar/ObjectBrowserBody.jsx
index 0efa97811..2730b2cd7 100644
--- a/src/customizations/volto/components/manage/Sidebar/ObjectBrowserBody.jsx
+++ b/src/customizations/volto/components/manage/Sidebar/ObjectBrowserBody.jsx
@@ -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':
@@ -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;
};
@@ -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();
}
diff --git a/src/customizations/volto/components/manage/UniversalLink/UniversalLink.jsx b/src/customizations/volto/components/manage/UniversalLink/UniversalLink.jsx
index baea0b2ec..1d48aa773 100644
--- a/src/customizations/volto/components/manage/UniversalLink/UniversalLink.jsx
+++ b/src/customizations/volto/components/manage/UniversalLink/UniversalLink.jsx
@@ -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"
/>
)}
diff --git a/src/customizations/volto/components/manage/Widgets/ObjectBrowserWidget.jsx b/src/customizations/volto/components/manage/Widgets/ObjectBrowserWidget.jsx
index f66382de7..65dfc725f 100644
--- a/src/customizations/volto/components/manage/Widgets/ObjectBrowserWidget.jsx
+++ b/src/customizations/volto/components/manage/Widgets/ObjectBrowserWidget.jsx
@@ -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 || []);
diff --git a/src/helpers/IconWidget/IconAliasHelper.js b/src/helpers/IconWidget/IconAliasHelper.js
index 747b9f612..7cbfdbfed 100644
--- a/src/helpers/IconWidget/IconAliasHelper.js
+++ b/src/helpers/IconWidget/IconAliasHelper.js
@@ -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',
diff --git a/src/helpers/IconWidget/IconWidgetHelper.js b/src/helpers/IconWidget/IconWidgetHelper.js
index ff117c206..66c195557 100644
--- a/src/helpers/IconWidget/IconWidgetHelper.js
+++ b/src/helpers/IconWidget/IconWidgetHelper.js
@@ -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'],
diff --git a/src/theme/ItaliaTheme/Blocks/_ctaBlock.scss b/src/theme/ItaliaTheme/Blocks/_ctaBlock.scss
index 816df337c..7902dd71d 100644
--- a/src/theme/ItaliaTheme/Blocks/_ctaBlock.scss
+++ b/src/theme/ItaliaTheme/Blocks/_ctaBlock.scss
@@ -36,6 +36,7 @@
color: $secondary-text;
font-size: 0.9rem;
text-transform: uppercase;
+ position: relative;
&:hover,
&:focus {
@@ -47,6 +48,9 @@
}
.external-link {
fill: $external-link-fill-buttons !important;
+ position: absolute;
+ top: 3px;
+ right: 3px;
}
}
@@ -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 {
diff --git a/src/theme/ItaliaTheme/Subsites/bootstrap-italia/custom/_headercenter.scss b/src/theme/ItaliaTheme/Subsites/bootstrap-italia/custom/_headercenter.scss
index d03251a88..ee20c8560 100644
--- a/src/theme/ItaliaTheme/Subsites/bootstrap-italia/custom/_headercenter.scss
+++ b/src/theme/ItaliaTheme/Subsites/bootstrap-italia/custom/_headercenter.scss
@@ -42,6 +42,10 @@
.it-search-wrapper {
a {
+ &.search-link {
+ outline: $subsite-primary 2px solid !important;
+ }
+
&.rounded-icon {
svg {
@if $subsite-light-theme {
diff --git a/src/theme/ItaliaTheme/_common.scss b/src/theme/ItaliaTheme/_common.scss
index d5c812ef4..5be0e208d 100644
--- a/src/theme/ItaliaTheme/_common.scss
+++ b/src/theme/ItaliaTheme/_common.scss
@@ -72,6 +72,9 @@
.external-link {
fill: $link-color !important;
+ &.align-sub {
+ vertical-align: sub;
+ }
&:hover {
fill: #004080 !important;