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

Only allow to assign contentpages in menu node form #2967

Merged
merged 3 commits into from
Jul 9, 2024

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Jul 8, 2024

What is this pull request for?

Layoutpages are not routable (they don't have an URL and only hold content rendered elsewhere).

Since menus are meant to render a list of page urls it does not make any sense to allow to assign a layoutpage to a menu node.

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

tvdeyen added 3 commits July 8, 2024 22:30
Sometimes we just want to search a value in a select2 type-ahead
and not also click (select) the value.
Layoutpages are not routable (they don't have an URL and only
hold content rendered elsewhere).

Since menus are meant to render a list of page urls it does not
make any sense to allow to assign a layoutpage to a menu node.
@tvdeyen tvdeyen requested a review from a team as a code owner July 8, 2024 20:35
@tvdeyen tvdeyen added this to the 7.3 milestone Jul 8, 2024
Copy link

codecov bot commented Jul 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.00%. Comparing base (7a235c2) to head (af0f689).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2967   +/-   ##
=======================================
  Coverage   96.00%   96.00%           
=======================================
  Files         232      232           
  Lines        6282     6284    +2     
=======================================
+ Hits         6031     6033    +2     
  Misses        251      251           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mamhoff
Copy link
Contributor

mamhoff commented Jul 9, 2024

Looks good to me, maybe there should be a model validation as well? What du you think?

@tvdeyen
Copy link
Member Author

tvdeyen commented Jul 9, 2024

In my opinion validations are for data integrity and this here is more a "don't shoot in your own foot" situation. Technically it is totally valid to assign any page, it just doesn't make any sense. A validation could also be harmful for existing sites.

So, no, I think we should not ☺️

@tvdeyen tvdeyen merged commit 1657590 into main Jul 9, 2024
36 checks passed
@tvdeyen tvdeyen deleted the menu-nodes-no-layoutpage branch July 9, 2024 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants