feat: Support for conditional menu item rendering #1631
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is "part 2" of #1629. It adds support for conditionally rendering menu items at request time.
@dpgaspar the tests for the menu piece specifically are not very comprehensive but I think we should get more confidence around this code. Do you have a preference for how you'd like to expand upon these tests? The menu code is almost entirely self-contained, so IMO we should pass the one non-self-contained piece (
current_app
) which let's us easily stub that value and unit test the code. That should give us all we need, since this is already tested from API PoV. Thoughts?Also, let me know what other (if any) docs you think should be added here.