-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add new parameter assets_path_ignore for dash.Dash() #3077
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
079f79b
feat: add new parameter assets_path_ignore for dash.Dash()
CNFeffery 0801316
update CHANGELOG.md
CNFeffery a731de3
alter CHANGELOG.md
CNFeffery 66e0f62
handle ignore_path_list default None
CNFeffery d9630a9
add test for #3077
CNFeffery c025f1b
fix lint
CNFeffery 7d527b8
Merge branch 'dev' into dev
CNFeffery 718ff69
Add endline
CNFeffery c470eb3
Add import for typing.List
CNFeffery 858e62f
Merge branch 'plotly:dev' into dev
CNFeffery eef8d24
Fix black lint
CNFeffery b6fd63c
Fix black lint(via npm run format)
CNFeffery File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
from dash import Dash, html | ||
|
||
|
||
def test_api001_assets_path_ignore(dash_duo): | ||
app = Dash( | ||
__name__, | ||
assets_folder="test_assets_path_ignore_assets", | ||
assets_path_ignore=["should_be_ignored"], | ||
) | ||
app.index_string = """<!DOCTYPE html> | ||
<html> | ||
<head> | ||
{%metas%} | ||
<title>{%title%}</title> | ||
{%css%} | ||
</head> | ||
<body> | ||
<div id="normal-test-target"></div> | ||
<div id="ignored-test-target"></div> | ||
{%app_entry%} | ||
<footer> | ||
{%config%} | ||
{%scripts%} | ||
{%renderer%} | ||
</footer> | ||
</body> | ||
</html>""" | ||
|
||
app.layout = html.Div() | ||
|
||
dash_duo.start_server(app) | ||
|
||
assert ( | ||
dash_duo.find_element("#normal-test-target").value_of_css_property( | ||
"background-color" | ||
) | ||
== "rgba(255, 0, 0, 1)" | ||
) | ||
|
||
assert ( | ||
dash_duo.find_element("#ignored-test-target").value_of_css_property( | ||
"background-color" | ||
) | ||
!= "rgba(255, 0, 0, 1)" | ||
) | ||
|
||
normal_target_content = dash_duo.find_element("#normal-test-target").text | ||
ignored_target_content = dash_duo.find_element("#ignored-test-target").text | ||
|
||
assert normal_target_content == "loaded" | ||
assert ignored_target_content != "loaded" |
3 changes: 3 additions & 0 deletions
3
tests/integration/dash_assets/test_assets_path_ignore_assets/normal_files/normal.css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#normal-test-target { | ||
background-color: rgba(255, 0, 0, 1); | ||
} | ||
2 changes: 2 additions & 0 deletions
2
tests/integration/dash_assets/test_assets_path_ignore_assets/normal_files/normal.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
const normalTarget = document.getElementById('normal-test-target'); | ||
normalTarget.innerHTML = 'loaded'; |
3 changes: 3 additions & 0 deletions
3
tests/integration/dash_assets/test_assets_path_ignore_assets/should_be_ignored/ignored.css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#ignored-test-target { | ||
background-color: rgba(255, 0, 0, 1); | ||
} |
2 changes: 2 additions & 0 deletions
2
tests/integration/dash_assets/test_assets_path_ignore_assets/should_be_ignored/ignored.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
const ignoredTarget = document.getElementById('ignored-test-target'); | ||
ignoredTarget.innerHTML = 'loaded'; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing endline at the end in the new assets files.