Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Components as props in labels #940

Merged
merged 13 commits into from
Feb 22, 2023
Merged

Conversation

AnnMarieW
Copy link
Contributor

Added support for components in props for Checklist, Checkbox, RadioButton, RadioItems, and Switch

Copy link
Collaborator

@tcbegley tcbegley left a comment

Choose a reason for hiding this comment

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

Thanks for this @AnnMarieW

I've made a few suggestions to get the tests working, but running your examples locally everything looks fine to me. This will be a great addition to the library!

@@ -0,0 +1,40 @@
from dash import Dash, dcc, html
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can also drop dcc import

from dash_bootstrap_components import Checklist, Checkbox, RadioButton, RadioItems, Switch


def test_mdcap001_components_as_props(dash_dcc):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think dash_dcc is a custom fixture in the dash repo, but swapping this out for dash_duo worked for me when I tested locally.

Comment on lines 4 to 6
flights = html.Div([html.Div(className="fa fa-plane pe-1"), "Flights"])
car = html.Div([html.Div(className="fa fa-car pe-1"), "Rental Car"])
hotel = html.Div([html.Div(className="fa fa-hotel pe-1"), "Hotel"])
Copy link
Collaborator

Choose a reason for hiding this comment

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

These icons aren't showing up for me when I run the docs because Font Awesome stylesheet isn't actually linked.

We can add the link in docs/templates/partials/head.html, though I would actually have a preference for changing this example to use Bootstrap icons, since we're already linking the CSS anyway. So less for the reader of the docs to load when they visit.

AnnMarieW and others added 10 commits February 21, 2023 11:10
Co-authored-by: Tom Begley <tomcbegley@gmail.com>
Co-authored-by: Tom Begley <tomcbegley@gmail.com>
Co-authored-by: Tom Begley <tomcbegley@gmail.com>
Co-authored-by: Tom Begley <tomcbegley@gmail.com>
Co-authored-by: Tom Begley <tomcbegley@gmail.com>
Co-authored-by: Tom Begley <tomcbegley@gmail.com>
updated example to use Bootstrap icons
updated icons versions.
Copy link
Collaborator

@tcbegley tcbegley left a comment

Choose a reason for hiding this comment

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

Thanks for this!

I just updated the noxfile.py to format the tests and ran nox -s format. I also added the new bootstrap icons CDN link to docs/templates/partials/head.html, since that's where the docs pull the CSS from rather than from dbc.icons.

Hopefully we'll get all green CI and then I think this is good to go!

@tcbegley tcbegley merged commit fd23bc0 into facultyai:main Feb 22, 2023
This was referenced Feb 22, 2023
tcbegley pushed a commit that referenced this pull request Feb 27, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants