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

ui: CSS modules for Table components #47606

Conversation

koorosh
Copy link
Collaborator

@koorosh koorosh commented Apr 17, 2020

Depends on #47513
Related to #47527

This change refactors components to use CSS modules and
incorporate all required styles without any external
dependencies and prevent styles altering from outside.
It affects several components which tightly
coupled with StatementsTable and couldn't be changed
separately.

Following component are changed:

  • HighlightedText
  • Drawer
  • StatementsTable
  • SortableTable

Note, that StatementsTable#makeCommonColumns function
is refactored to provide custom styles from parent to
child components via props instead of overriding styles.

Storybook is extended to show some components as independent
units or in context of StatementTable component (if it is
only the way components work).

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@blathers-crl
Copy link

blathers-crl bot commented Apr 17, 2020

❌ The GitHub CI (Cockroach) build has failed on d365bfbb.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@koorosh koorosh force-pushed the koorosh/ui-statements-extraction--sortable-table branch from d365bfb to c782a36 Compare April 24, 2020 08:49
@koorosh koorosh changed the title ui: WIP. CSS modules for Table components ui: CSS modules for Table components Apr 24, 2020
@koorosh koorosh added the do-not-merge bors won't merge a PR with this label. label Apr 24, 2020
@koorosh koorosh marked this pull request as ready for review April 24, 2020 08:52
@koorosh koorosh requested a review from a team April 24, 2020 08:52
@koorosh koorosh force-pushed the koorosh/ui-statements-extraction--sortable-table branch 2 times, most recently from a74c2bd to d0b4a14 Compare April 24, 2020 13:22
@koorosh koorosh force-pushed the koorosh/ui-statements-extraction--sortable-table branch from d0b4a14 to db34934 Compare April 28, 2020 07:04
@koorosh koorosh force-pushed the koorosh/ui-statements-extraction--sortable-table branch from db34934 to 8068545 Compare May 22, 2020 08:20
@koorosh koorosh removed the do-not-merge bors won't merge a PR with this label. label May 22, 2020
@koorosh koorosh force-pushed the koorosh/ui-statements-extraction--sortable-table branch 3 times, most recently from 093ffbf to 02873ff Compare June 3, 2020 14:53
To test styles isolation for statements page
we need storybook which displays entire
Statements screen only.

To make it work, RouterProvider decorator
is added which connects router to dummy (empty)
store.

`statementsPage.fixture.ts` file contains snapshot
of required props for StatementsPage component

Release note: None
- refactor fonts imports to correctly resolve paths
when module is required from different locations;
- move all files related to PlanView component under
`planView` directory
- Added story for PlanView component

Release note: None
Previously, class names were constructed by simply accessing
style modules class names and assigning it to classes. It was
cumbersome and not readable at all.

To enhance this, `classnames/bind` alternate is used, which
allows simply put class names.

Release note: None
This change refactors components to use CSS modules and
incorporate all required styles without any external
dependencies and prevent styles altering from outside.
It affects several components which tightly
coupled with StatementsTable and couldn't be changed
separately.

Following component are changed:
- HighlightedText
- Drawer
- StatementsTable
- SortableTable

Note, that `StatementsTable#makeCommonColumns` function
is refactored to provide custom styles from parent to
child components via props instead of overriding styles.

Storybook is extended to show some components as independent
units or in context of `StatementTable` component (if it is
only the way components work).

Release note: None
@koorosh koorosh force-pushed the koorosh/ui-statements-extraction--sortable-table branch from 02873ff to af044f0 Compare June 4, 2020 10:25
@koorosh
Copy link
Collaborator Author

koorosh commented Jun 4, 2020

bors r+

@craig
Copy link
Contributor

craig bot commented Jun 4, 2020

Merge conflict (retrying...)

@craig
Copy link
Contributor

craig bot commented Jun 4, 2020

Build succeeded

@craig craig bot merged commit 994d306 into cockroachdb:master Jun 4, 2020
craig bot pushed a commit that referenced this pull request Jun 9, 2020
48012: ui: CSS modules for Statements filter section r=koorosh a=koorosh

Depends on #47606
Related to #47527

This change refactors following components to
use CSS modules instead of styles defined as
global:
- Dropdown
- Search
- PageConfig

Release note: None

Co-authored-by: Andrii Vorobiov <and.vorobiov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants