Le bouton Partager n'apparaît que s'il y a des filtres
This commit is contained in:
+35
-28
@@ -413,9 +413,9 @@ Alors, on fait comment ?
|
|||||||
id="download-observatoire"
|
id="download-observatoire"
|
||||||
),
|
),
|
||||||
dbc.Button(
|
dbc.Button(
|
||||||
"Prévisualiser les données",
|
"Voir les données",
|
||||||
id="btn-observatoire-preview",
|
id="btn-observatoire-preview",
|
||||||
className="btn btn-primary",
|
className="btn btn-primary mt-2",
|
||||||
color="primary",
|
color="primary",
|
||||||
outline=True,
|
outline=True,
|
||||||
),
|
),
|
||||||
@@ -425,14 +425,16 @@ Alors, on fait comment ?
|
|||||||
style={"display": "none"},
|
style={"display": "none"},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
lg=12,
|
||||||
|
xl=6,
|
||||||
|
),
|
||||||
|
dbc.Col(
|
||||||
|
id="observatoire-copy-container",
|
||||||
|
lg=12,
|
||||||
|
xl=6,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
dbc.Row(
|
|
||||||
dbc.Col(
|
|
||||||
html.Div(id="observatoire-copy-container"),
|
|
||||||
)
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
dbc.Col(
|
dbc.Col(
|
||||||
@@ -606,6 +608,7 @@ def sync_observatoire_share_url(*args):
|
|||||||
href = args[-1]
|
href = args[-1]
|
||||||
|
|
||||||
if not href:
|
if not href:
|
||||||
|
print("no update")
|
||||||
return no_update, no_update
|
return no_update, no_update
|
||||||
|
|
||||||
base_url = href.split("?")[0]
|
base_url = href.split("?")[0]
|
||||||
@@ -622,27 +625,31 @@ def sync_observatoire_share_url(*args):
|
|||||||
|
|
||||||
query_string = urllib.parse.urlencode(params)
|
query_string = urllib.parse.urlencode(params)
|
||||||
full_url = f"{base_url}?{query_string}" if query_string else base_url
|
full_url = f"{base_url}?{query_string}" if query_string else base_url
|
||||||
|
print("query", query_string)
|
||||||
|
|
||||||
copy_button = dcc.Clipboard(
|
if params:
|
||||||
id="btn-copy-observatoire-url",
|
copy_button = dcc.Clipboard(
|
||||||
target_id="observatoire-share-url",
|
id="btn-copy-observatoire-url",
|
||||||
title="Copier l'URL de cette vue",
|
target_id="observatoire-share-url",
|
||||||
style={
|
title="Copier l'URL de cette vue",
|
||||||
"display": "inline-block",
|
style={
|
||||||
"fontSize": 20,
|
"display": "inline-block",
|
||||||
"verticalAlign": "top",
|
"fontSize": 20,
|
||||||
"cursor": "pointer",
|
"verticalAlign": "top",
|
||||||
},
|
"cursor": "pointer",
|
||||||
className="fa fa-link",
|
},
|
||||||
children=[
|
className="fa fa-link",
|
||||||
dbc.Button(
|
children=[
|
||||||
"Partager cette vue",
|
dbc.Button(
|
||||||
id="btn-copy-observatoire",
|
"Partager cette vue",
|
||||||
className="btn btn-primary mt-2",
|
id="btn-copy-observatoire",
|
||||||
title="Copier l'adresse de cette vue filtrée pour la partager.",
|
className="btn btn-primary mt-2",
|
||||||
)
|
title="Copier l'adresse de cette vue filtrée pour la partager.",
|
||||||
],
|
)
|
||||||
)
|
],
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
copy_button = html.Div()
|
||||||
|
|
||||||
return full_url, copy_button
|
return full_url, copy_button
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user