Skip to content

Commit

Permalink
feat: enable dynamic footer generation from control panel (#509)
Browse files Browse the repository at this point in the history
* feat: enable dynamic footer generation from control panel

* chore: updated release-md

* fix: default value for show_in_footer in redurcer
  • Loading branch information
giuliaghisini authored Feb 5, 2024
1 parent c03f4cd commit 6d3ed52
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
7 changes: 7 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@

- Sistemata la gerarchia per i titoli dentro al blocco semplice


## Versione x.x.x (xx/xx/xxxx)

### Novità
- Nel pannello di controllo di 'Design plone' è stata aggiunta la possibilità di mostrare o meno il footer autogenerato.


## Versione 11.3.3 (30/01/2024)

### Migliorie
Expand Down
7 changes: 6 additions & 1 deletion src/components/ItaliaTheme/Footer/FooterNavigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ const messages = defineMessages({
const FooterNavigation = () => {
const intl = useIntl();
const items = useSelector((state) => state.navigation.items, isEqual);
const show_navigation = useSelector(
(state) => state.navigation.show_in_footer,
);

// DEPRECATED: isFooterCollapsed to be removed in version 12
if (config.settings.isFooterCollapsed) {
Expand All @@ -32,7 +35,7 @@ const FooterNavigation = () => {
);
}

return (
return show_navigation ? (
<>
{items && (
<Row tag="div">
Expand Down Expand Up @@ -87,6 +90,8 @@ const FooterNavigation = () => {
</Row>
)}
</>
) : (
<></>
);
};

Expand Down
6 changes: 6 additions & 0 deletions src/customizations/volto/reducers/navigation/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
const initialState = {
error: null,
items: [],
show_in_footer: false,
loaded: false,
loading: false,
};
Expand Down Expand Up @@ -69,6 +70,8 @@ export default function navigation(state = initialState, action = {}) {
return {
...state,
error: null,
show_in_footer:
action.result['@components'].navigation.show_in_footer,
items: getRecursiveItems(
action.result['@components'].navigation.items,
),
Expand All @@ -86,6 +89,8 @@ export default function navigation(state = initialState, action = {}) {
return {
...state,
error: null,
show_in_footer:
action.result['@components'].navigation.show_in_footer,
items: getRecursiveItems(action.result.items),
loaded: true,
loading: false,
Expand All @@ -97,6 +102,7 @@ export default function navigation(state = initialState, action = {}) {
...state,
error: action.error,
items: [],
show_in_footer: false,
loaded: false,
loading: false,
};
Expand Down

0 comments on commit 6d3ed52

Please sign in to comment.