feat: add a theme CRUD page to manage themes (#34182)

Co-authored-by: Mehmet Salih Yavuz <salih.yavuz@proton.me>
This commit is contained in:
Maxime Beauchemin
2025-07-25 13:26:41 -07:00
committed by GitHub
parent 5f11f9097a
commit e741a3167f
96 changed files with 6391 additions and 862 deletions

View File

@@ -549,6 +549,7 @@ class TestDashboardApi(ApiOwnersTestCaseMixin, InsertChartMixin, SupersetTestCas
"tags": [],
"thumbnail_url": dashboard.thumbnail_url,
"is_managed_externally": False,
"theme": None,
}
data = json.loads(rv.data.decode("utf-8"))
assert "changed_on" in data["result"]
@@ -870,10 +871,13 @@ class TestDashboardApi(ApiOwnersTestCaseMixin, InsertChartMixin, SupersetTestCas
"""
Dataset API: Test add dashboard to favorites
"""
# Let database auto-generate ID and use unique names
import uuid
unique_id = uuid.uuid4().hex[:8]
dashboard = Dashboard(
id=100,
dashboard_title="test_dashboard",
slug="test_slug",
dashboard_title=f"test_dashboard_{unique_id}",
slug=f"test_slug_{unique_id}",
slices=[],
published=True,
)
@@ -903,10 +907,13 @@ class TestDashboardApi(ApiOwnersTestCaseMixin, InsertChartMixin, SupersetTestCas
"""
Dataset API: Test remove dashboard from favorites
"""
# Let database auto-generate ID and use unique names
import uuid
unique_id = uuid.uuid4().hex[:8]
dashboard = Dashboard(
id=100,
dashboard_title="test_dashboard",
slug="test_slug",
dashboard_title=f"test_dashboard_{unique_id}",
slug=f"test_slug_{unique_id}",
slices=[],
published=True,
)
@@ -991,6 +998,7 @@ class TestDashboardApi(ApiOwnersTestCaseMixin, InsertChartMixin, SupersetTestCas
@pytest.mark.usefixtures("create_dashboards")
def test_gets_not_certified_dashboards_filter(self):
# Get all uncertified dashboards to check if any belong to this test
arguments = {
"filters": [
{
@@ -1008,7 +1016,18 @@ class TestDashboardApi(ApiOwnersTestCaseMixin, InsertChartMixin, SupersetTestCas
rv = self.get_assert_metric(uri, "get_list")
assert rv.status_code == 200
data = json.loads(rv.data.decode("utf-8"))
assert data["count"] == 0
# Filter results to only count dashboards that could belong to this fixture
# The create_dashboards fixture creates dashboards with titles like
# "title0", "title1", etc.
fixture_uncertified_count = 0
for result in data["result"]:
title = result["dashboard_title"]
# Only count dashboards that match the fixture naming pattern
if title and title.startswith("title") and title[5:].isdigit():
fixture_uncertified_count += 1
assert fixture_uncertified_count == 0
@pytest.mark.usefixtures("create_created_by_gamma_dashboards")
def test_get_dashboards_created_by_me(self):