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

Don't override initial value of hidden HTML Element attribute. #8419

Merged
merged 2 commits into from
May 27, 2020

Conversation

denis-anisimov
Copy link
Contributor

@denis-anisimov denis-anisimov commented May 26, 2020

Fixes #8100


This change is Reviewable

@denis-anisimov denis-anisimov force-pushed the 8100-remove-add-set-visible branch 2 times, most recently from 007a3f4 to 80641e6 Compare May 26, 2020 11:08
@denis-anisimov denis-anisimov marked this pull request as ready for review May 26, 2020 11:09
@denis-anisimov denis-anisimov added this to Iteration Reviews in OLD Vaadin Flow ongoing work (Vaadin 10+) via automation May 26, 2020
@joheriks joheriks self-requested a review May 27, 2020 07:07
Copy link
Contributor

@joheriks joheriks left a comment

Choose a reason for hiding this comment

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

Reviewed 7 of 7 files at r1.
Reviewable status: 2 unresolved discussions, 0 of 1 LGTMs obtained (waiting on @denis-anisimov)


flow-client/src/main/java/com/vaadin/client/flow/binding/SimpleElementBindingStrategy.java, line 589 at r1 (raw file):

        NodeMap visibilityData = context.node.getMap(NodeFeatures.ELEMENT_DATA);
        // Store the current "hidden" value to restore it when the element
        // becomes visible

Should this comment be removed as it pertained to the removed line?


flow-tests/test-root-context/src/main/java/com/vaadin/flow/uitest/ui/RemoveAddVisibilityView.java, line 24 at r1 (raw file):

        add(toggle, hidden);
    }
}
  • I would prefer for simplicity if the button only set the element visible (instead of toggling), as there is anyway no test for going back to invisible (unlike the other IT). Less code and mutable state makes IT easier to understand and modify if needed.
  • Add a newline at the end.

Copy link
Contributor Author

@denis-anisimov denis-anisimov left a comment

Choose a reason for hiding this comment

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

Reviewable status: 2 unresolved discussions, 0 of 1 LGTMs obtained (waiting on @joheriks)


flow-client/src/main/java/com/vaadin/client/flow/binding/SimpleElementBindingStrategy.java, line 589 at r1 (raw file):

Previously, joheriks (Johannes Eriksson) wrote…

Should this comment be removed as it pertained to the removed line?

Good catch.
Forgot about the comment after several rewritings.


flow-tests/test-root-context/src/main/java/com/vaadin/flow/uitest/ui/RemoveAddVisibilityView.java, line 24 at r1 (raw file):

Previously, joheriks (Johannes Eriksson) wrote…
  • I would prefer for simplicity if the button only set the element visible (instead of toggling), as there is anyway no test for going back to invisible (unlike the other IT). Less code and mutable state makes IT easier to understand and modify if needed.
  • Add a newline at the end.

Well, it makes sense.
The code snippet is almost exact copy of the code from the ticket.
But you are right: there is no sense to make it toggle.

Copy link
Contributor Author

@denis-anisimov denis-anisimov left a comment

Choose a reason for hiding this comment

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

Reviewable status: 2 unresolved discussions, 0 of 1 LGTMs obtained (waiting on @joheriks)


flow-client/src/main/java/com/vaadin/client/flow/binding/SimpleElementBindingStrategy.java, line 589 at r1 (raw file):

Previously, denis-anisimov (Denis) wrote…

Good catch.
Forgot about the comment after several rewritings.

Done.


flow-tests/test-root-context/src/main/java/com/vaadin/flow/uitest/ui/RemoveAddVisibilityView.java, line 24 at r1 (raw file):

Previously, denis-anisimov (Denis) wrote…

Well, it makes sense.
The code snippet is almost exact copy of the code from the ticket.
But you are right: there is no sense to make it toggle.

Done.

Copy link
Contributor

@joheriks joheriks left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 3 of 3 files at r2.
Reviewable status: :shipit: complete! all discussions resolved, 1 of 1 LGTMs obtained

@vaadin-bot vaadin-bot added +1.0.0 and removed +0.0.1 labels May 27, 2020
@joheriks joheriks merged commit d4e71c6 into master May 27, 2020
OLD Vaadin Flow ongoing work (Vaadin 10+) automation moved this from Iteration Reviews to Done - pending release May 27, 2020
@joheriks joheriks deleted the 8100-remove-add-set-visible branch May 27, 2020 11:22
denis-anisimov pushed a commit that referenced this pull request May 28, 2020
* 'master' of github.com:vaadin/flow: (191 commits)
  Fix regression in @Push when running in client bootstrapping (#8435)
  Don't override initial value of hidden HTML Element attribute. (#8419)
  Cherry pick from 2.2 to master and fix postpone and forward with CCDM
(#8342) (#8359)
  Moved init parameters to new class
com.vaadin.flow.server.InitParameters (#8409)
  Update chrome version to 83 (#8417)
  Listen detach events on "listenOn" components in shortcut registration
(#8391)
  Correct Javadocs for adding JS and Stylesheets programatically.
(#8392)
  Close client app on change location (#8334)
  Close UI after refreshing the page in PreserveOnRefresh case and mark
it (#8365)
  remove unused import
  fix: custom connect client breaks endpoints mapping
  Wait for intermediate page to load completely in @PreserveOnRefresh IT
(#8338)
  Properly encoded URIs use %20 (#8271)
  Removed unnecessary private method (#8357)
  Extract live reload ITs into separate test module (#8324)
  fix: check for TypeVariable in the ExplicitNullableTypeChecker (#8316)
  Live reload show message on error (#8206) (#8304)
  Clarify message about blocking with the session locked (#8312)
  Url parameter template support. (#7608)
  Store vaadin hash to node_modules (#8282)
  ...

# Conflicts:
#	.gitignore
#	flow-client/src/main/java/com/vaadin/client/ApplicationConnection.java
#	flow-client/src/main/resources/META-INF/resources/frontend/Flow.ts
#	flow-client/src/test/frontend/FlowTests.ts
#	flow-maven-plugin/src/main/java/com/vaadin/flow/plugin/maven/BuildFrontendMojo.java
#	flow-maven-plugin/src/main/java/com/vaadin/flow/plugin/maven/FlowModeAbstractMojo.java
#	flow-maven-plugin/src/main/java/com/vaadin/flow/plugin/maven/PrepareFrontendMojo.java
#	flow-maven-plugin/src/test/java/com/vaadin/flow/plugin/maven/BuildFrontendMojoTest.java
#	flow-maven-plugin/src/test/java/com/vaadin/flow/plugin/maven/PrepareFrontendMojoTest.java
#	flow-server/src/main/java/com/vaadin/flow/function/DeploymentConfiguration.java
#	flow-server/src/main/java/com/vaadin/flow/server/Constants.java
#	flow-server/src/main/java/com/vaadin/flow/server/DefaultDeploymentConfiguration.java
#	flow-server/src/main/java/com/vaadin/flow/server/DeploymentConfigurationFactory.java
#	flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
#	flow-server/src/main/java/com/vaadin/flow/server/connect/VaadinConnectController.java
#	flow-server/src/main/java/com/vaadin/flow/server/frontend/FrontendUtils.java
#	flow-server/src/main/java/com/vaadin/flow/server/frontend/NodeTasks.java
#	flow-server/src/main/java/com/vaadin/flow/server/frontend/NodeUpdater.java
#	flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskGenerateTsConfig.java
#	flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskRunNpmInstall.java
#	flow-server/src/main/java/com/vaadin/flow/server/frontend/VersionsJsonConverter.java
#	flow-server/src/main/java/com/vaadin/flow/server/startup/AbstractRouteRegistryInitializer.java
#	flow-server/src/main/java/com/vaadin/flow/server/startup/DevModeInitializer.java
#	flow-server/src/main/java/com/vaadin/flow/server/startup/ServletDeployer.java
#	flow-server/src/main/java/com/vaadin/flow/server/startup/VaadinAppShellInitializer.java
#	flow-server/src/main/java/com/vaadin/flow/shared/ApplicationConstants.java
#	flow-server/src/main/resources/pnpmfile.js
#	flow-server/src/main/resources/webpack.generated.js
#	flow-server/src/test/java/com/vaadin/flow/server/DefaultDeploymentConfigurationTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/DeploymentConfigurationFactoryTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/communication/WebComponentBootstrapHandlerTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/connect/VaadinConnectControllerTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/connect/rest/EndpointWithRestControllerTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/frontend/FrontendUtilsTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/frontend/TaskRunNpmInstallTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/frontend/TaskRunPnpmInstallTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/frontend/VersionsJsonConverterTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/startup/AbstractRouteRegistryInitializerTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/startup/DevModeInitializerTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/startup/DevModeInitializerTestBase.java
#	flow-server/src/test/java/com/vaadin/flow/server/startup/VaadinAppShellInitializerTest.java
#	flow-server/src/test/resources/versions/no_vaadin_package.json
#	flow-server/src/test/resources/versions/package.json
#	flow-server/src/test/resources/versions/user_package.json
#	flow-server/src/test/resources/versions/user_versions.json
#	flow-server/src/test/resources/versions/versions.json
#	flow-test-util/src/main/java/com/vaadin/flow/testutil/AbstractTestBenchTest.java
#	flow-tests/pom.xml
#	flow-tests/test-npm-only-features/test-npm-performance-regression/src/test/java/com/vaadin/flow/testnpmonlyfeatures/performanceregression/StartupPerformanceIT.java
#	flow-tests/test-root-context/src/main/java/com/vaadin/flow/uitest/ui/PushWithPreserveOnRefreshView.java
#	flow-tests/test-root-context/src/main/java/com/vaadin/flow/uitest/ui/StreamResourceView.java
#	flow-tests/test-root-context/src/test/java/com/vaadin/flow/VerifyBrowserVersionIT.java
#	flow-tests/test-root-context/src/test/java/com/vaadin/flow/uitest/ui/NavigationTriggerIT.java
#	flow-tests/test-root-context/src/test/java/com/vaadin/flow/uitest/ui/PushWithPreserveOnRefreshIT.java
#	flow-tests/test-root-context/src/test/java/com/vaadin/flow/uitest/ui/RequestParametersIT.java
#	flow-tests/test-root-context/src/test/java/com/vaadin/flow/uitest/ui/RouterSessionExpirationIT.java
#	flow-tests/test-root-context/src/test/java/com/vaadin/flow/uitest/ui/StreamResourceIT.java
#	flow-tests/test-root-ui-context/src/main/java/com/vaadin/flow/uitest/servlet/ApplicationRunnerServlet.java
#	flow-tests/test-root-ui-context/src/test/java/com/vaadin/flow/uitest/ui/push/ReconnectLongPollingIT.java
#	flow-tests/test-router-custom-context/src/test/java/com/vaadin/flow/contexttest/ui/PushIT.java
pleku pushed a commit that referenced this pull request May 28, 2020
* 'master' of github.com:vaadin/flow: (191 commits)
  Fix regression in @Push when running in client bootstrapping (#8435)
  Don't override initial value of hidden HTML Element attribute. (#8419)
  Cherry pick from 2.2 to master and fix postpone and forward with CCDM
(#8342) (#8359)
  Moved init parameters to new class
com.vaadin.flow.server.InitParameters (#8409)
  Update chrome version to 83 (#8417)
  Listen detach events on "listenOn" components in shortcut registration
(#8391)
  Correct Javadocs for adding JS and Stylesheets programatically.
(#8392)
  Close client app on change location (#8334)
  Close UI after refreshing the page in PreserveOnRefresh case and mark
it (#8365)
  remove unused import
  fix: custom connect client breaks endpoints mapping
  Wait for intermediate page to load completely in @PreserveOnRefresh IT
(#8338)
  Properly encoded URIs use %20 (#8271)
  Removed unnecessary private method (#8357)
  Extract live reload ITs into separate test module (#8324)
  fix: check for TypeVariable in the ExplicitNullableTypeChecker (#8316)
  Live reload show message on error (#8206) (#8304)
  Clarify message about blocking with the session locked (#8312)
  Url parameter template support. (#7608)
  Store vaadin hash to node_modules (#8282)
  ...

# Conflicts:
#	.gitignore
#	flow-client/src/main/java/com/vaadin/client/ApplicationConnection.java
#	flow-client/src/main/resources/META-INF/resources/frontend/Flow.ts
#	flow-client/src/test/frontend/FlowTests.ts
#	flow-maven-plugin/src/main/java/com/vaadin/flow/plugin/maven/BuildFrontendMojo.java
#	flow-maven-plugin/src/main/java/com/vaadin/flow/plugin/maven/FlowModeAbstractMojo.java
#	flow-maven-plugin/src/main/java/com/vaadin/flow/plugin/maven/PrepareFrontendMojo.java
#	flow-maven-plugin/src/test/java/com/vaadin/flow/plugin/maven/BuildFrontendMojoTest.java
#	flow-maven-plugin/src/test/java/com/vaadin/flow/plugin/maven/PrepareFrontendMojoTest.java
#	flow-server/src/main/java/com/vaadin/flow/function/DeploymentConfiguration.java
#	flow-server/src/main/java/com/vaadin/flow/server/Constants.java
#	flow-server/src/main/java/com/vaadin/flow/server/DefaultDeploymentConfiguration.java
#	flow-server/src/main/java/com/vaadin/flow/server/DeploymentConfigurationFactory.java
#	flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
#	flow-server/src/main/java/com/vaadin/flow/server/connect/VaadinConnectController.java
#	flow-server/src/main/java/com/vaadin/flow/server/frontend/FrontendUtils.java
#	flow-server/src/main/java/com/vaadin/flow/server/frontend/NodeTasks.java
#	flow-server/src/main/java/com/vaadin/flow/server/frontend/NodeUpdater.java
#	flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskGenerateTsConfig.java
#	flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskRunNpmInstall.java
#	flow-server/src/main/java/com/vaadin/flow/server/frontend/VersionsJsonConverter.java
#	flow-server/src/main/java/com/vaadin/flow/server/startup/AbstractRouteRegistryInitializer.java
#	flow-server/src/main/java/com/vaadin/flow/server/startup/DevModeInitializer.java
#	flow-server/src/main/java/com/vaadin/flow/server/startup/ServletDeployer.java
#	flow-server/src/main/java/com/vaadin/flow/server/startup/VaadinAppShellInitializer.java
#	flow-server/src/main/java/com/vaadin/flow/shared/ApplicationConstants.java
#	flow-server/src/main/resources/pnpmfile.js
#	flow-server/src/main/resources/webpack.generated.js
#	flow-server/src/test/java/com/vaadin/flow/server/DefaultDeploymentConfigurationTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/DeploymentConfigurationFactoryTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/communication/WebComponentBootstrapHandlerTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/connect/VaadinConnectControllerTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/connect/rest/EndpointWithRestControllerTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/frontend/FrontendUtilsTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/frontend/TaskRunNpmInstallTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/frontend/TaskRunPnpmInstallTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/frontend/VersionsJsonConverterTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/startup/AbstractRouteRegistryInitializerTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/startup/DevModeInitializerTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/startup/DevModeInitializerTestBase.java
#	flow-server/src/test/java/com/vaadin/flow/server/startup/VaadinAppShellInitializerTest.java
#	flow-server/src/test/resources/versions/no_vaadin_package.json
#	flow-server/src/test/resources/versions/package.json
#	flow-server/src/test/resources/versions/user_package.json
#	flow-server/src/test/resources/versions/user_versions.json
#	flow-server/src/test/resources/versions/versions.json
#	flow-test-util/src/main/java/com/vaadin/flow/testutil/AbstractTestBenchTest.java
#	flow-tests/pom.xml
#	flow-tests/test-npm-only-features/test-npm-performance-regression/src/test/java/com/vaadin/flow/testnpmonlyfeatures/performanceregression/StartupPerformanceIT.java
#	flow-tests/test-root-context/src/main/java/com/vaadin/flow/uitest/ui/PushWithPreserveOnRefreshView.java
#	flow-tests/test-root-context/src/main/java/com/vaadin/flow/uitest/ui/StreamResourceView.java
#	flow-tests/test-root-context/src/test/java/com/vaadin/flow/VerifyBrowserVersionIT.java
#	flow-tests/test-root-context/src/test/java/com/vaadin/flow/uitest/ui/NavigationTriggerIT.java
#	flow-tests/test-root-context/src/test/java/com/vaadin/flow/uitest/ui/PushWithPreserveOnRefreshIT.java
#	flow-tests/test-root-context/src/test/java/com/vaadin/flow/uitest/ui/RequestParametersIT.java
#	flow-tests/test-root-context/src/test/java/com/vaadin/flow/uitest/ui/RouterSessionExpirationIT.java
#	flow-tests/test-root-context/src/test/java/com/vaadin/flow/uitest/ui/StreamResourceIT.java
#	flow-tests/test-root-ui-context/src/main/java/com/vaadin/flow/uitest/servlet/ApplicationRunnerServlet.java
#	flow-tests/test-root-ui-context/src/test/java/com/vaadin/flow/uitest/ui/push/ReconnectLongPollingIT.java
#	flow-tests/test-router-custom-context/src/test/java/com/vaadin/flow/contexttest/ui/PushIT.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
OLD Vaadin Flow ongoing work (Vaadin ...
  
Done - pending release
Development

Successfully merging this pull request may close these issues.

setVisible does not work if done after remove/add of component
3 participants