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

Support reusable application theme #9650

Merged
merged 22 commits into from
Dec 18, 2020
Merged

Support reusable application theme #9650

merged 22 commits into from
Dec 18, 2020

Conversation

tanbt
Copy link

@tanbt tanbt commented Dec 14, 2020

Resolves #9585

@tanbt tanbt changed the title WIP: Support reusable application theme Support reusable application theme Dec 17, 2020
pom.xml Outdated Show resolved Hide resolved
@caalador caalador requested a review from pleku December 17, 2020 13:16
@vaadin-bot
Copy link
Collaborator

SonarQube analysis reported 31 issues

  • INFO 31 info

Top 10 extra issues

Note: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:

  1. INFO Constants.java#L43: Do not forget to remove this deprecated code someday. rule
  2. INFO Constants.java#L62: Do not forget to remove this deprecated code someday. rule
  3. INFO Constants.java#L69: Do not forget to remove this deprecated code someday. rule
  4. INFO Constants.java#L77: Do not forget to remove this deprecated code someday. rule
  5. INFO Constants.java#L84: Do not forget to remove this deprecated code someday. rule
  6. INFO Constants.java#L91: Do not forget to remove this deprecated code someday. rule
  7. INFO Constants.java#L99: Do not forget to remove this deprecated code someday. rule
  8. INFO Constants.java#L107: Do not forget to remove this deprecated code someday. rule
  9. INFO Constants.java#L115: Do not forget to remove this deprecated code someday. rule
  10. INFO Constants.java#L123: Do not forget to remove this deprecated code someday. rule

/**
* The name of the application theme root folder.
*/
public static final String APPLICATION_THEME_ROOT = "themes";
Copy link
Contributor

Choose a reason for hiding this comment

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

@taefi is running for this to be in FrontendUtils.

Of course, agree to define it once, but I have a feeling that it is better to define it here since many other
default/hardcoded path and folder constants defined in this file, e.g. NODE_MODULES, FRONTEND,
DEFAULT_NODE_DIR, DEFAULT_FRONTEND_DIR, etc. I propose to keep it here but rename it to
APPLICATION_THEME_ROOT as Tan defined.

Copy link
Author

Choose a reason for hiding this comment

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

So should I move this constant to FrontendUtils? Or @taefi will do that in his PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

Please resolve this kind of trivial issues as fast as possible by e.g. just agreeing over Slack

@@ -134,7 +134,7 @@ protected void writeImportLines(List<String> lines) {

if (themeDef != null && !"".equals(themeDef.getName())) {
// If we define a theme name we need to import theme/theme-generated.js
lines.add("import {applyTheme} from 'theme/theme-generated.js';");
lines.add("import {applyTheme} from 'themes/theme-generated.js';");
Copy link
Contributor

Choose a reason for hiding this comment

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

non-blocking: I'm not sure if this related to this PR (?) but the comment should have been changed too

/**
* The name of the application theme root folder.
*/
public static final String APPLICATION_THEME_ROOT = "themes";
Copy link
Contributor

Choose a reason for hiding this comment

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

Please resolve this kind of trivial issues as fast as possible by e.g. just agreeing over Slack

@tanbt tanbt merged commit a6eebc7 into master Dec 18, 2020
OLD Vaadin Flow ongoing work (Vaadin 10+) automation moved this from Iteration Reviews to Done - pending release Dec 18, 2020
@tanbt tanbt deleted the reusable-theme branch December 18, 2020 10:27
@tanbt
Copy link
Author

tanbt commented Dec 18, 2020

I guess @taefi can continue from master, i.e. moving APPLICATION_THEME_ROOT to FrontendUtils
and update the comment // If we define a theme name we need to import theme/theme-generated.js to .... themes/theme-generated.js

caalador pushed a commit that referenced this pull request Mar 5, 2021
Resolves #9585
# Conflicts:
#	flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskCopyFrontendFiles.java
#	flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskUpdateThemeImport.java
#	flow-tests/pom.xml
pleku pushed a commit that referenced this pull request Mar 8, 2021
Resolves #9585
# Conflicts:
#	flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskCopyFrontendFiles.java
#	flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskUpdateThemeImport.java
#	flow-tests/pom.xml
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.

Support making reusable ApplicationTheme
4 participants