Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced navigation reducer in Volto #5817

Merged
merged 6 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/volto/news/5772.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enhanced navigation reducer in Volto to keep items extra-data sent from the navigation endpoint @Hrittik20
1 change: 1 addition & 0 deletions packages/volto/src/reducers/navigation/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function getRecursiveItems(items) {
title: item.title,
description: item.description,
Hrittik20 marked this conversation as resolved.
Show resolved Hide resolved
url: flattenToAppURL(item['@id']),
...item,
davisagli marked this conversation as resolved.
Show resolved Hide resolved
...(item.items && { items: getRecursiveItems(item.items) }),
}));
}
Expand Down
6 changes: 6 additions & 0 deletions packages/volto/src/reducers/navigation/navigation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ describe('Navigation reducer', () => {
error: null,
items: [
{
'@id': 'http://localhost:8080/Plone/front-page',
title: 'Welcome to Plone!',
description:
'Congratulations! You have successfully installed Plone.',
Expand Down Expand Up @@ -91,17 +92,20 @@ describe('Navigation reducer', () => {
error: null,
items: [
{
'@id': 'http://localhost:8080/Plone/front-page',
title: 'Welcome to Plone!',
description:
'Congratulations! You have successfully installed Plone.',
url: '/front-page',
},
{
'@id': 'http://localhost:8080/Plone/folder1',
title: 'Folder1',
description: 'Folder description',
url: '/folder1',
items: [
{
'@id': 'http://localhost:8080/Plone/folderinfolder1',
title: 'FolderInFolder1',
description: 'Sub-folder description',
url: '/folderinfolder1',
Expand Down Expand Up @@ -162,6 +166,7 @@ describe('Navigation reducer (NAVIGATION)GET_CONTENT', () => {
error: null,
items: [
{
'@id': 'http://localhost:8080/Plone/front-page',
title: 'Welcome to Plone!',
description:
'Congratulations! You have successfully installed Plone.',
Expand Down Expand Up @@ -192,6 +197,7 @@ describe('Navigation reducer (NAVIGATION)GET_CONTENT', () => {
error: null,
items: [
{
'@id': 'http://localhost:8080/Plone/front-page',
title: 'Welcome to Plone!',
description:
'Congratulations! You have successfully installed Plone.',
Expand Down
Loading