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

Use navroot to render the sitemap (targets 17.x.x) #5185

Merged
merged 39 commits into from
May 7, 2024
Merged

Conversation

erral
Copy link
Member

@erral erral commented Sep 14, 2023

In #5105 we changed the sitemap component to be rooted to the language.

Instead doing that, in the PR we use the available navroot to do it.

Moreover I have extracted the hardcoded value of 4 used to call the getNavigation action to a siteMapDepth setting.

@netlify
Copy link

netlify bot commented Sep 14, 2023

Deploy Preview for volto ready!

Name Link
🔨 Latest commit b7ae8c0
🔍 Latest deploy log https://app.netlify.com/sites/volto/deploys/65b62666ff796b00081fee64
😎 Deploy Preview https://deploy-preview-5185--volto.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@erral erral requested a review from tiberiuichim September 14, 2023 15:19
settings.isMultilingual
? toBackendLang(getState().intl.locale)
: null,
const navroot = getState().navroot.data?.navroot?.navroot?.['@id'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the navroot available in both 7.x and 8.x branches of plone.restapi?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No right now it is not. But I can try to add a PR to backport them .

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it need to be backported? This fix will go in Volto 17 and maybe Volto 16, which both expect plone.restapi 8.x, even on Plone 5.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/plone/plone.restapi/blob/ed192208499989b379de8534a3aa12d037316db4/setup.py#L11

Volto 16 works fine with Plone 4, we're using it in production on a complex site. If this PR is backported to Volto 16, it will be a breaking change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I didn't know you are using Volto 16 with Plone 4. That is not officially supported, as far as I am aware, and there are no automated tests for it in volto. So this is a risk you took on in using Volto 16 with an unsupported Plone version. But, I agree we should avoid breaking that, unless it's really hard to avoid.

Copy link
Member Author

@erral erral Sep 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The navroot endpoints are not that complex, I would say that they could be backported to 7.x easily. But let's see what the tests say 😅

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iFlameing and others added 21 commits September 19, 2023 13:53
Co-authored-by: Nina <[email protected]>
Co-authored-by: Steve Piercy <[email protected]>
Co-authored-by: Piero Nicolli <[email protected]>
Co-authored-by: Nilesh <[email protected]>
Co-authored-by: Víctor Fernández de Alba <[email protected]>
@@ -23,12 +23,6 @@ const messages = defineMessages({
},
});

export function getSitemapPath(pathname = '', lang) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be a breaking change because the getSitemapPath is removed. Let's keep it and mark it as deprecated? @sneridagh your thoughts on this?

Copy link
Member Author

@erral erral Oct 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have kept the function and the tests, but mark it as deprecated with a docstring. This way, as you say, if anyone is using the function, it keeps working.

Would that be enough?

Copy link
Member

@sneridagh sneridagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erral erral changed the base branch from main to 17.x.x December 1, 2023 09:10
@erral erral changed the title Use navroot to render the sitemap Use navroot to render the sitemap (targets 17.x.x) Dec 6, 2023
@sneridagh
Copy link
Member

@erral Sorry, apparently, this got lost in the sea of PRs, merging now!

@sneridagh sneridagh merged commit b76eb39 into 17.x.x May 7, 2024
46 checks passed
@sneridagh sneridagh deleted the erral-sitemap branch May 7, 2024 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

8 participants