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

[Tidy] Replace RadioItems and Checklist #414

Merged
merged 79 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from 76 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
522dff0
Add vizro-bootstrap CSS files
huong-li-nguyen Mar 25, 2024
e92a6f1
Remove CSS code for `Accordion`
huong-li-nguyen Mar 25, 2024
84e9da8
Remove CSS for `Card`
huong-li-nguyen Mar 25, 2024
00fc1fd
Ignore Bootstrap files and lint
huong-li-nguyen Mar 25, 2024
63385ff
Remove CSS for `Button`
huong-li-nguyen Mar 25, 2024
8129702
Add newest CSS file
huong-li-nguyen Mar 25, 2024
b1368e8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 25, 2024
8ecdffd
Remove redundant files
huong-li-nguyen Mar 25, 2024
07f5c24
Tidy and lint
huong-li-nguyen Mar 25, 2024
533a9f0
Fix unit tests
huong-li-nguyen Mar 25, 2024
0ef547c
Merge branch 'tidy/replace_css_bootstrap' of https://github.com/mckin…
huong-li-nguyen Mar 25, 2024
db3d0c2
Merge branch 'main' into tidy/replace_css_bootstrap
huong-li-nguyen Mar 26, 2024
63cca69
Update CSS files
huong-li-nguyen Mar 26, 2024
22e2d2e
Refactor `NavBar`
huong-li-nguyen Mar 26, 2024
7dd3a65
Merge branch 'main' into tidy/replace_css_bootstrap
huong-li-nguyen Mar 26, 2024
bb02055
Lint
huong-li-nguyen Mar 26, 2024
f191fc3
Fix unit tests
huong-li-nguyen Mar 26, 2024
b04dc7f
Replace `html.Div` with `dbc.Nav` or `dbc.Navbar`
huong-li-nguyen Mar 27, 2024
3bbb973
Create 20240327_104803_huong_li_nguyen_improve_semantics_nav.md
huong-li-nguyen Mar 27, 2024
74031d6
Replace `hidden` argument with `className`
huong-li-nguyen Mar 27, 2024
9c506b8
Overwrite CSS temporarily
huong-li-nguyen Mar 27, 2024
9926932
Lint
huong-li-nguyen Mar 27, 2024
45a4aba
Merge branch 'main' into tidy/improve_semantics_nav
huong-li-nguyen Mar 27, 2024
5eee94e
Merge branch 'tidy/improve_semantics_nav' into tidy/replace_css_boots…
huong-li-nguyen Mar 27, 2024
8682c3e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 27, 2024
87dcaa3
Merge branch 'main' into tidy/replace_css_bootstrap
huong-li-nguyen Apr 9, 2024
5e972d2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 9, 2024
c234b91
Merge branch 'main' into tidy/replace_css_bootstrap
huong-li-nguyen Apr 9, 2024
5b4036a
Add relevant code for RadioItems
huong-li-nguyen Apr 9, 2024
f9dcc0f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 9, 2024
80992f1
Update classNames
huong-li-nguyen Apr 9, 2024
25701b9
Merge branch 'tidy/replace_css_bootstrap' of https://github.com/mckin…
huong-li-nguyen Apr 9, 2024
90b5003
Add CSS file without radio
huong-li-nguyen Apr 9, 2024
4b11fc9
Revert changes on RadioItem
huong-li-nguyen Apr 9, 2024
8771ca7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 9, 2024
bd149b4
Remove custom CSS for NavBar
huong-li-nguyen Apr 9, 2024
d250f40
Update letter spacing
huong-li-nguyen Apr 9, 2024
c2f8313
Merge branch 'main' into tidy/replace_css_bootstrap
huong-li-nguyen Apr 9, 2024
7d7ae28
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 9, 2024
a0bdc47
Tidy NavBar
huong-li-nguyen Apr 9, 2024
5060a4d
Merge branch 'tidy/replace_css_bootstrap' of https://github.com/mckin…
huong-li-nguyen Apr 9, 2024
dec7037
Fix unit tests
huong-li-nguyen Apr 9, 2024
5ee7cb3
Remove redundant className
huong-li-nguyen Apr 9, 2024
2274596
Fix unit tests
huong-li-nguyen Apr 9, 2024
c590deb
Update vizro bootstrap css
pruthvip15 Apr 10, 2024
1f612e6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 10, 2024
af94fc9
Merge remote-tracking branch 'origin/main' into tidy/replace_css_boot…
pruthvip15 Apr 10, 2024
2095111
Rename map file
pruthvip15 Apr 10, 2024
b7ca78a
Rename map file
pruthvip15 Apr 10, 2024
312c520
Merge remote-tracking branch 'origin/tidy/replace_css_bootstrap' into…
pruthvip15 Apr 10, 2024
280d48a
Ensure vizro-bootstrap is loaded in first
huong-li-nguyen Apr 10, 2024
b879c69
Update ignore statement for codespell
huong-li-nguyen Apr 10, 2024
4d0d0c9
Remove custom CSS for radioitem and checklist
huong-li-nguyen Apr 10, 2024
530fd47
Replace components with dbc equivalents
huong-li-nguyen Apr 10, 2024
58694b9
Add changelog
huong-li-nguyen Apr 10, 2024
c8b8498
Lint
huong-li-nguyen Apr 10, 2024
65ac5b8
Merge branch 'main' into tidy/replace_radio_item
huong-li-nguyen Apr 15, 2024
1703e44
Add new CSS file
huong-li-nguyen Apr 15, 2024
93b661f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 15, 2024
943e32e
Fix unit tests
huong-li-nguyen Apr 15, 2024
80e2f68
Tidy
huong-li-nguyen Apr 15, 2024
c4807be
Merge branch 'tidy/replace_radio_item' of https://github.com/mckinsey…
huong-li-nguyen Apr 15, 2024
37c217b
Revert changes in card and add another test
huong-li-nguyen Apr 15, 2024
1a3164b
Tidy
huong-li-nguyen Apr 15, 2024
4031f30
Fix unit tests for Card
huong-li-nguyen Apr 15, 2024
97a10b9
Remove classNames
huong-li-nguyen Apr 15, 2024
49c85bb
Merge branch 'main' into tidy/replace_radio_item
huong-li-nguyen Apr 16, 2024
b9b7b67
Add new CSS file
huong-li-nguyen Apr 17, 2024
fbdce65
Switch to semantically correct Fieldset
huong-li-nguyen Apr 17, 2024
b483a49
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 17, 2024
f66c626
Refactor `RadioItems` and `Checklist`
huong-li-nguyen Apr 17, 2024
4c34c52
Remove `input-container`
huong-li-nguyen Apr 17, 2024
ec29a2e
Merge branch 'main' into tidy/replace_radio_item
huong-li-nguyen Apr 17, 2024
f833a84
Fix unit tests
huong-li-nguyen Apr 17, 2024
d97ee22
Add to custom overwrites
huong-li-nguyen Apr 17, 2024
fa92191
Remove unused className
huong-li-nguyen Apr 17, 2024
6892109
Update CSS
huong-li-nguyen Apr 18, 2024
435673f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 18, 2024
4496961
Update 20240410_192546_huong_li_nguyen_replace_radio_item.md
huong-li-nguyen Apr 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
huong-li-nguyen marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
A new scriv changelog fragment.

Uncomment the section that is right (remove the HTML comment wrapper).
-->

<!--
### Highlights ✨

- A bullet item for the Highlights ✨ category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Removed

- A bullet item for the Removed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Added

- A bullet item for the Added category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Changed

- A bullet item for the Changed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Deprecated

- A bullet item for the Deprecated category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Fixed

- A bullet item for the Fixed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Security

- A bullet item for the Security category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,5 @@ def build(self):
className="text-area",
),
],
className="input-container",
id=f"{self.id}_outer",
)
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,5 @@ def build(self):
className="user_input",
),
],
className="input-container",
id=f"{self.id}_outer",
)
10 changes: 4 additions & 6 deletions vizro-core/src/vizro/models/_components/form/checklist.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import List, Literal, Optional

from dash import dcc, html
from dash import html

try:
from pydantic.v1 import Field, PrivateAttr, root_validator, validator
Expand Down Expand Up @@ -50,18 +50,16 @@ class Checklist(VizroBaseModel):
def build(self):
full_options, default_value = get_options_and_default(options=self.options, multi=True)

return html.Div(
return html.Fieldset(
[
dbc.Label(self.title, html_for=self.id) if self.title else None,
dcc.Checklist(
html.Legend(self.title, className="form-label") if self.title else None,
dbc.Checklist(
id=self.id,
options=full_options,
value=self.value if self.value is not None else [default_value],
persistence=True,
persistence_type="session",
className="checkboxes-list",
),
],
className="input-container",
id=f"{self.id}_outer",
)
2 changes: 0 additions & 2 deletions vizro-core/src/vizro/models/_components/form/dropdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ def build(self):
multi=self.multi,
persistence=True,
persistence_type="session",
className="selector_body_dropdown",
),
],
className="input-container",
id=f"{self.id}_outer",
)
10 changes: 4 additions & 6 deletions vizro-core/src/vizro/models/_components/form/radio_items.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import List, Literal, Optional

from dash import dcc, html
from dash import html

try:
from pydantic.v1 import Field, PrivateAttr, root_validator, validator
Expand Down Expand Up @@ -51,18 +51,16 @@ class RadioItems(VizroBaseModel):
def build(self):
full_options, default_value = get_options_and_default(options=self.options, multi=False)

return html.Div(
return html.Fieldset(
[
dbc.Label(self.title, html_for=self.id) if self.title else None,
dcc.RadioItems(
html.Legend(self.title, className="form-label") if self.title else None,
dbc.RadioItems(
id=self.id,
options=full_options,
value=self.value if self.value is not None else default_value,
persistence=True,
persistence_type="session",
className="radio-items-list",
),
],
className="input-container",
id=f"{self.id}_outer",
)
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,5 @@ def build(self):
className="slider-track-without-marks" if self.marks is None else "slider-track-with-marks",
),
],
className="input-container",
id=f"{self.id}_outer",
)
1 change: 0 additions & 1 deletion vizro-core/src/vizro/models/_components/form/slider.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,5 @@ def build(self):
className="slider-track-without-marks" if self.marks is None else "slider-track-with-marks",
),
],
className="input-container",
id=f"{self.id}_outer",
)
4 changes: 4 additions & 0 deletions vizro-core/src/vizro/static/css/bootstrap_overwrites.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ but do not want to take over to `vizro-bootstrap` as these settings might not be
.card .nav-link {
height: 100%;
}

.form-check:last-of-type {
margin-bottom: 0;
}
huong-li-nguyen marked this conversation as resolved.
Show resolved Hide resolved
27 changes: 0 additions & 27 deletions vizro-core/src/vizro/static/css/checklist.css

This file was deleted.

27 changes: 0 additions & 27 deletions vizro-core/src/vizro/static/css/radio_item.css

This file was deleted.

27 changes: 0 additions & 27 deletions vizro-core/src/vizro/static/css/selectors.css

This file was deleted.

1 change: 1 addition & 0 deletions vizro-core/src/vizro/static/css/slider.css
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ input.dash-input:invalid {
display: flex;
flex-direction: row;
gap: var(--spacing-01);
margin-bottom: var(--spacing-03);
}

.slider-text-input-field {
Expand Down
Loading
Loading