feat(compte/vues): Ouvrir via URL courte + bouton copier (#112)

This commit is contained in:
Colin Maudry
2026-07-13 17:35:53 +02:00
parent 2a22951829
commit 0e0fb32222
2 changed files with 25 additions and 7 deletions
+8 -5
View File
@@ -1,7 +1,7 @@
import re
import dash_bootstrap_components as dbc
from dash import html
from dash import dcc, html
from unidecode import unidecode
from src.utils import DOMAIN_NAME
@@ -63,19 +63,22 @@ def saved_views_items(views) -> list:
def _view_row(view) -> html.Div:
view_id = view["id"]
share_url = build_view_url(view["name"], view["token"])
return html.Div(
className="saved-view-row d-flex align-items-center gap-2 mb-2",
children=[
html.Span(view["name"], className="flex-grow-1"),
dbc.Button(
# Limitation connue : la vue n'est pas appliquée automatiquement
# en arrivant sur /tableau depuis cette page. Le mécanisme de
# rappel multi-page reste à faire (voir tableau.py `apply_saved_view`).
"Ouvrir",
href="/tableau",
href=share_url,
color="link",
size="sm",
),
dcc.Clipboard(
content=share_url,
title="Copier le lien vers cette vue",
style={"cursor": "pointer", "fontSize": "1.1rem"},
),
dbc.Button(
"Renommer",
id={"type": "vue-rename-open", "index": view_id},