mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore(dashboard): Integrate dashboard app into the SPA bundle (#14356)
* chore(dashboard): Integrate dashboard app into the SPA bundle * fix url params * change variable name * change title correctly * custom css * lint * remove unused file * remove content assertions from dashboard tests * fix case with missing bootstrap data * fix: respect crud views flag * crud views -> spa * remove unused dashboard templates * fix: remove unused variable * fix: missed a spot with the crudViews -> spa * router link to dashboard from dashboard list page * link using the router when in card mode * lint * fix tests, add memory router * remove dashboard app files * split up the bundle a little more * use webpack preload
This commit is contained in:
committed by
GitHub
parent
158ac302d8
commit
21cf12a480
@@ -26,14 +26,6 @@ class BaseTestDashboardSecurity(DashboardTestCase):
|
||||
def tearDown(self) -> None:
|
||||
self.clean_created_objects()
|
||||
|
||||
def assert_dashboard_view_response(
|
||||
self, response: Response, dashboard_to_access: Dashboard
|
||||
) -> None:
|
||||
self.assert200(response)
|
||||
assert escape(dashboard_to_access.dashboard_title) in response.data.decode(
|
||||
"utf-8"
|
||||
)
|
||||
|
||||
def assert_dashboard_api_response(
|
||||
self, response: Response, dashboard_to_access: Dashboard
|
||||
) -> None:
|
||||
|
||||
@@ -76,15 +76,12 @@ class TestDashboardDatasetSecurity(DashboardTestCase):
|
||||
|
||||
# act
|
||||
responses_by_url = {
|
||||
url: self.client.get(url).data.decode("utf-8")
|
||||
for url in dashboard_title_by_url.keys()
|
||||
url: self.client.get(url) for url in dashboard_title_by_url.keys()
|
||||
}
|
||||
|
||||
# assert
|
||||
for dashboard_url, get_dashboard_response in responses_by_url.items():
|
||||
assert (
|
||||
escape(dashboard_title_by_url[dashboard_url]) in get_dashboard_response
|
||||
)
|
||||
self.assert200(get_dashboard_response)
|
||||
|
||||
def test_get_dashboards__users_are_dashboards_owners(self):
|
||||
# arrange
|
||||
|
||||
@@ -49,7 +49,7 @@ class TestDashboardRoleBasedSecurity(BaseTestDashboardSecurity):
|
||||
response = self.get_dashboard_view_response(dashboard_to_access)
|
||||
|
||||
# assert
|
||||
self.assert_dashboard_view_response(response, dashboard_to_access)
|
||||
self.assert200(response)
|
||||
|
||||
def test_get_dashboard_view__owner_can_access(self):
|
||||
# arrange
|
||||
@@ -67,7 +67,7 @@ class TestDashboardRoleBasedSecurity(BaseTestDashboardSecurity):
|
||||
response = self.get_dashboard_view_response(dashboard_to_access)
|
||||
|
||||
# assert
|
||||
self.assert_dashboard_view_response(response, dashboard_to_access)
|
||||
self.assert200(response)
|
||||
|
||||
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
|
||||
def test_get_dashboard_view__user_can_not_access_without_permission(self):
|
||||
@@ -133,7 +133,7 @@ class TestDashboardRoleBasedSecurity(BaseTestDashboardSecurity):
|
||||
response = self.get_dashboard_view_response(dashboard_to_access)
|
||||
|
||||
# assert
|
||||
self.assert_dashboard_view_response(response, dashboard_to_access)
|
||||
self.assert200(response)
|
||||
|
||||
request_payload = get_query_context("birth_names")
|
||||
rv = self.post_assert_metric(CHART_DATA_URI, request_payload, "data")
|
||||
@@ -184,7 +184,7 @@ class TestDashboardRoleBasedSecurity(BaseTestDashboardSecurity):
|
||||
response = self.get_dashboard_view_response(dashboard_to_access)
|
||||
|
||||
# assert
|
||||
self.assert_dashboard_view_response(response, dashboard_to_access)
|
||||
self.assert200(response)
|
||||
|
||||
# post
|
||||
revoke_access_to_dashboard(dashboard_to_access, "Public")
|
||||
|
||||
Reference in New Issue
Block a user