Skip to content

Commit 3fce1a2

Browse files
authored
Merge branch 'dev' into fix-slider-mark-height
2 parents f5b0aec + 2b1b814 commit 3fce1a2

File tree

5 files changed

+57
-45
lines changed

5 files changed

+57
-45
lines changed

.github/workflows/testing.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ jobs:
9494
test-typing:
9595
name: Typing Tests
9696
runs-on: ubuntu-latest
97+
if: github.ref_name != 'master'
9798
needs: build
9899
timeout-minutes: 30
99100
strategy:

components/dash-core-components/src/components/Graph.react.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,11 @@ PlotlyGraph.propTypes = {
550550
* plot rather than registering them globally.
551551
*/
552552
locales: PropTypes.object,
553+
554+
/**
555+
* Determines whether or not notifier is displayed
556+
*/
557+
displayNotifier: PropTypes.bool,
553558
}),
554559

555560
/**

components/dash-core-components/tests/integration/loading/test_loading_component.py

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from multiprocessing import Lock
2-
from dash import Dash, Input, Output, dcc, html
2+
from dash import Dash, Input, Output, dcc, html, MATCH, ALL
33
from dash.dependencies import stringify_id
44
from dash.testing import wait
55
import time
@@ -417,7 +417,7 @@ def updateDiv(n_clicks):
417417

418418
# update multiple props of same component, only targeted id/prop triggers spinner
419419
# test that target_components id can be a dict id
420-
def test_ldcp011_loading_component_target_components(dash_dcc):
420+
def test_ldcp010_loading_component_target_components(dash_dcc):
421421
lock = Lock()
422422

423423
app = Dash(__name__)
@@ -461,7 +461,7 @@ def updateDiv2(n_clicks):
461461

462462
dash_dcc.start_server(app)
463463

464-
btn1id = "#" + stringify_id({"type": "button", "index": "one"})
464+
btn1id = "[id='" + stringify_id({"type": "button", "index": "one"}) + "']"
465465

466466
dash_dcc.wait_for_text_to_equal(btn1id, "content 1")
467467

@@ -839,3 +839,50 @@ def update_btn1_children(n_clicks):
839839
assert spinners == []
840840

841841
assert dash_dcc.get_logs() == []
842+
843+
844+
# loading spinner triggers when callback Output uses ALL wildcard
845+
def test_ldcp019_loading_component_pattern_matching(dash_dcc):
846+
lock = Lock()
847+
848+
app = Dash(__name__)
849+
850+
app.layout = html.Div(
851+
[
852+
dcc.Loading(
853+
[
854+
html.Div(
855+
id={"type": "div-1", "index": 1, "name": "test"},
856+
className="div-1",
857+
)
858+
],
859+
className="loading",
860+
)
861+
],
862+
id={"type": "root", "index": 1, "name": "test"},
863+
className="root",
864+
)
865+
866+
@app.callback(
867+
Output({"type": "div-1", "index": ALL, "name": MATCH}, "children"),
868+
Input({"type": "root", "index": ALL, "name": MATCH}, "n_clicks"),
869+
)
870+
def updateDiv(n_clicks):
871+
if n_clicks == [1]:
872+
time.sleep(0.1)
873+
return ["changed"]
874+
return ["content"]
875+
876+
with lock:
877+
dash_dcc.start_server(app)
878+
dash_dcc.wait_for_text_to_equal(".div-1", "content")
879+
880+
dash_dcc.find_element(".root").click()
881+
882+
dash_dcc.find_element(".loading .dash-spinner")
883+
# mounted but hidden, so looks like no text
884+
dash_dcc.wait_for_text_to_equal(".div-1", "")
885+
886+
dash_dcc.wait_for_text_to_equal(".div-1", "changed")
887+
888+
assert dash_dcc.get_logs() == []

components/dash-core-components/tests/integration/tab/test_tabs_with_graphs.py

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from dash import Dash, Input, Output, dcc, html
22
from dash.exceptions import PreventUpdate
3-
import json
4-
import os
53
import pytest
64
from selenium.webdriver.common.by import By
75
from selenium.webdriver.support import expected_conditions as EC
@@ -185,43 +183,4 @@ def on_click_update_graph(n_clicks):
185183
time.sleep(1)
186184
dash_dcc.percy_snapshot(f"Tabs-2 rendered ({is_eager})")
187185

188-
# do some extra tests while we're here
189-
# and have access to Graph and plotly.js
190-
check_graph_config_shape(dash_dcc)
191-
192-
assert dash_dcc.get_logs() == []
193-
194-
195-
def check_graph_config_shape(dash_dcc):
196-
config_schema = dash_dcc.driver.execute_script(
197-
"return Plotly.PlotSchema.get().config;"
198-
)
199-
with open(os.path.join(dcc.__path__[0], "metadata.json")) as meta:
200-
graph_meta = json.load(meta)["src/components/Graph.react.js"]
201-
config_prop_shape = graph_meta["props"]["config"]["type"]["value"]
202-
203-
ignored_config = [
204-
"setBackground",
205-
"showSources",
206-
"logging",
207-
"globalTransforms",
208-
"notifyOnLogging",
209-
"role",
210-
"typesetMath",
211-
]
212-
213-
def crawl(schema, props):
214-
for prop_name in props:
215-
assert prop_name in schema
216-
217-
for item_name, item in schema.items():
218-
if item_name in ignored_config:
219-
continue
220-
221-
assert item_name in props
222-
if "valType" not in item:
223-
crawl(item, props[item_name]["value"])
224-
225-
crawl(config_schema, config_prop_shape)
226-
227186
assert dash_dcc.get_logs() == []

dash/dash-renderer/src/actions/callbacks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ export function executeCallback(
791791
}
792792

793793
const __execute = async (): Promise<CallbackResult> => {
794-
const loadingOutputs = outputs.map(out => ({
794+
const loadingOutputs = flatten(outputs).map(out => ({
795795
path: getPath(paths, out.id),
796796
property: out.property?.split('@')[0],
797797
id: stringifyId(out.id)

0 commit comments

Comments
 (0)