Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Add demo on styling grid with HasTheme #255

Closed
wants to merge 3 commits into from
Closed

Conversation

ZheSun88
Copy link
Contributor

@ZheSun88 ZheSun88 commented Jul 13, 2018

Part of the ticket vaadin/flow#4318


This change is Reviewable

@SomeoneToIgnore
Copy link
Contributor


src/test/java/com/vaadin/flow/component/grid/demo/GridView.java, line 1095 at r1 (raw file):

        grid.addColumn(Person::getName).setHeader("Name");
        grid.addColumn(Person::getAge).setHeader("Age");
        grid.addThemeNames("no-border", "no-row-borders", "row-stripes");

I propose to do this with theme variants.

In order to do this, you need to:

@SomeoneToIgnore
Copy link
Contributor


src/test/java/com/vaadin/flow/component/grid/demo/GridView.java, line 1095 at r1 (raw file):

        grid.addColumn(Person::getName).setHeader("Name");
        grid.addColumn(Person::getAge).setHeader("Age");
        grid.addThemeNames("no-border", "no-row-borders", "row-stripes");

Would it look better if you add some sort of theme toggling?
For instance, a button that will add and remove some themes.

Copy link
Contributor

@SomeoneToIgnore SomeoneToIgnore left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r1.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @vaadin-bot and @ZheSun88)

Copy link
Contributor Author

@ZheSun88 ZheSun88 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: all files reviewed, 3 unresolved discussions (waiting on @vaadin-bot and @ZheSun88)


src/test/java/com/vaadin/flow/component/grid/demo/GridView.java, line 1095 at r1 (raw file):

Previously, SomeoneToIgnore (Kirill Bulatov) wrote…

I propose to do this with theme variants.

In order to do this, you need to:

actually, this PR is wrong.. because the purpose of the demo should be theme the component inside grid..

the necessary part in the PR is only adding the hasTheme interface. I think i need to close this PR.. ...

@SomeoneToIgnore
Copy link
Contributor


src/test/java/com/vaadin/flow/component/grid/demo/GridView.java, line 1095 at r1 (raw file):

Previously, ZheSun88 (Sun Zhe) wrote…

actually, this PR is wrong.. because the purpose of the demo should be theme the component inside grid..

the necessary part in the PR is only adding the hasTheme interface. I think i need to close this PR.. ...

Nope, as discussed, you carry on with this one :)

@ZheSun88 ZheSun88 self-assigned this Jul 13, 2018
Copy link

@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.

Reviewed 2 of 3 files at r1, 1 of 1 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ZheSun88)

@vaadin-bot
Copy link

SonarQube analysis reported 21 issues

  • CRITICAL 1 critical
  • MAJOR 7 major
  • MINOR 12 minor
  • INFO 1 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. CRITICAL Grid.java#L1655: Remove usage of generic wildcard type. rule
  2. MAJOR Grid.java#: This file has 1,197 lines, which is greater than 750 authorized. Split it into smaller files. rule
  3. MAJOR Grid.java#L1299: Call "Optional#isPresent()" before accessing the value. rule
  4. MAJOR Grid.java#L1300: Either log or rethrow this exception. rule
  5. MAJOR Grid.java#L1313: Either log or rethrow this exception. rule
  6. MAJOR Grid.java#L2070: Call "Optional#isPresent()" before accessing the value. rule
  7. MAJOR Grid.java#L2080: Call "Optional#isPresent()" before accessing the value. rule
  8. MAJOR GridViewIT.java#L814: Remove this use of "Thread.sleep()". rule
  9. MINOR Grid.java#L454: Remove this method to simply inherit it. rule
  10. MINOR Grid.java#L1390: Use isEmpty() to check whether the collection is empty or not. rule

Copy link
Contributor

@SomeoneToIgnore SomeoneToIgnore left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r3.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ZheSun88)

a discussion (no related file):
Should we close it or update the same way as in vaadin/vaadin-button-flow#77?


Copy link
Contributor Author

@ZheSun88 ZheSun88 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: all files reviewed, 3 unresolved discussions (waiting on @ZheSun88)

a discussion (no related file):

Previously, SomeoneToIgnore (Kirill Bulatov) wrote…

Should we close it or update the same way as in vaadin/vaadin-button-flow#77?

yes


@ZheSun88 ZheSun88 closed this Jul 18, 2018
@SomeoneToIgnore SomeoneToIgnore deleted the demo-for-theme branch July 18, 2018 12:43
@gilberto-torrezan gilberto-torrezan added this to the Abandoned milestone Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants