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

refactor: disallow parametrized items in auto menu #2392

Merged
merged 10 commits into from
May 21, 2024

Conversation

Lodin
Copy link
Contributor

@Lodin Lodin commented May 6, 2024

Fixes #2378.

@Lodin Lodin added the hilla Issues related to Hilla label May 6, 2024
Copy link

codecov bot commented May 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.13%. Comparing base (6aba671) to head (64f8a6e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2392      +/-   ##
==========================================
+ Coverage   95.12%   95.13%   +0.01%     
==========================================
  Files          66       66              
  Lines        4512     4501      -11     
  Branches      649      646       -3     
==========================================
- Hits         4292     4282      -10     
+ Misses        179      178       -1     
  Partials       41       41              
Flag Coverage Δ
unittests 95.13% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@Lodin Lodin requested review from taefi, platosha and cromoteca May 6, 2024 12:30
@Lodin Lodin requested a review from taefi May 8, 2024 07:28
Copy link
Contributor

@platosha platosha left a comment

Choose a reason for hiding this comment

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

Let's keep the test fixtures for optional and wildcard parameters, as they (apart from known bugs and quirks) are supported use cases.

# Conflicts:
#	packages/java/endpoint/src/main/java/com/vaadin/hilla/route/RouteUnifyingIndexHtmlRequestListener.java
#	packages/java/endpoint/src/main/java/com/vaadin/hilla/route/records/AvailableViewInfo.java
#	packages/java/endpoint/src/test/resources/META-INF/VAADIN/available-views-admin.json
#	packages/java/endpoint/src/test/resources/META-INF/VAADIN/available-views-anonymous.json
#	packages/java/endpoint/src/test/resources/META-INF/VAADIN/available-views-user.json
#	packages/java/endpoint/src/test/resources/META-INF/VAADIN/only-client-views.json
Copy link
Contributor

@taefi taefi left a comment

Choose a reason for hiding this comment

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

From the code changes POV it LGTM!
From the tests POV, I agree with @platosha's comment regarding the support of views with optional params. So, I'm not going to restate those requested changes.

Copy link
Contributor

@platosha platosha left a comment

Choose a reason for hiding this comment

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

Upon a closer look, there is still an issue that the link target path contains optional segments, such as /:___commentId? in /comments/:___commentId?, for example. Somewhere we need to omit them...

@platosha
Copy link
Contributor

Upon a closer look, there is still an issue that the link target path contains optional segments, such as /:___commentId? in /comments/:___commentId?, for example. Somewhere we need to omit them...

addressed in ba2a093

@platosha platosha requested a review from taefi May 20, 2024 16:32
Copy link

sonarcloud bot commented May 20, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@platosha
Copy link
Contributor

From the code changes POV it LGTM! From the tests POV, I agree with @platosha's comment regarding the support of views with optional params. So, I'm not going to restate those requested changes.

I went with the tactic to omit the segments in Java, as it is more convenient there having the parameter info. Now that createMenuItems has nothing to do with route parameters, it just uses the path key as is — omitting tests for the use cases is fine.

@Lodin Lodin merged commit d748cb4 into main May 21, 2024
15 checks passed
@Lodin Lodin deleted the fix/file/param-items-menu branch May 21, 2024 07:33
@vaadin-bot
Copy link
Collaborator

Hi @Lodin and @Lodin, when i performed cherry-pick to this commit to 24.4, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick d748cb4
error: could not apply d748cb4... refactor: disallow parametrized items in auto menu (#2392)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hilla Issues related to Hilla
Projects
None yet
Development

Successfully merging this pull request may close these issues.

createMenuItems includes parameterized routes
4 participants