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
fix: improve error message when a component is moved from one UI to another. #18019
Conversation
Sister function for Element.get(StateNode), but returns an empty Optional instead of throwing an exception
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
Outdated
Show resolved
Hide resolved
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
Outdated
Show resolved
Hide resolved
Some minor changes requested, but LGTM. Great job @mvysny |
Thank you @mcollovati , all items should now be resolved. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me as well, nice work @mvysny!
…nother. (#18019) * feat: Add ElementUtil.from(StateNode) which returns Optional<Element> Sister function for Element.get(StateNode), but returns an empty Optional instead of throwing an exception * fix: improve error message when a component is moved from one UI to another. Fixes #9376 * chore: mention both createLocation and attachLocation in the exception message * chore: mention both createLocation and attachLocation in the exception message * chore: minor fixes in messages
Hi @mvysny and @mvysny, when i performed cherry-pick to this commit to 24.1, i have encountered the following issue. Can you take a look and pick it manually? |
…nother. (#18019) * feat: Add ElementUtil.from(StateNode) which returns Optional<Element> Sister function for Element.get(StateNode), but returns an empty Optional instead of throwing an exception * fix: improve error message when a component is moved from one UI to another. Fixes #9376 * chore: mention both createLocation and attachLocation in the exception message * chore: mention both createLocation and attachLocation in the exception message * chore: minor fixes in messages
…nother. (#18019) (CP: 24.2) (#18060) * fix: improve error message when a component is moved from one UI to another. (#18019) * feat: Add ElementUtil.from(StateNode) which returns Optional<Element> Sister function for Element.get(StateNode), but returns an empty Optional instead of throwing an exception * fix: improve error message when a component is moved from one UI to another. Fixes #9376 * chore: mention both createLocation and attachLocation in the exception message * chore: mention both createLocation and attachLocation in the exception message * chore: minor fixes in messages * test: reset ComponentTracker.productionMode static field (#18028) Prevents unexpected situation in ComponentTest caused by the ComponenTracker.productionMode flag being initialized to true by some other tests. In particular, cannotMoveComponentsToOtherUI test may fail because the exception message is different in development and production modes. --------- Co-authored-by: Martin Vysny <mavi@vaadin.com> Co-authored-by: Marco Collovati <marco@vaadin.com>
…nother. (#18019) (CP: 24.1) (#18061) * fix: improve error message when a component is moved from one UI to another. (#18019) * feat: Add ElementUtil.from(StateNode) which returns Optional<Element> Sister function for Element.get(StateNode), but returns an empty Optional instead of throwing an exception * fix: improve error message when a component is moved from one UI to another. Fixes #9376 * chore: mention both createLocation and attachLocation in the exception message * chore: mention both createLocation and attachLocation in the exception message * chore: minor fixes in messages * test: reset ComponentTracker.productionMode static field (#18028) Prevents unexpected situation in ComponentTest caused by the ComponenTracker.productionMode flag being initialized to true by some other tests. In particular, cannotMoveComponentsToOtherUI test may fail because the exception message is different in development and production modes. --------- Co-authored-by: Martin Vysny <mavi@vaadin.com>
Description
Improve error message when a component is moved from one UI to another.
Fixes #9376
Type of change
Checklist
Additional for
Feature
type of change