mirror of
https://github.com/apache/superset.git
synced 2026-04-20 16:44:46 +00:00
[datasets] new, listview (react) (#9197)
* [datasets] new, react listview * add hidden columns to support filtering by columns not rendered * throw exception if config is incorrect * fix database filter * update endpoints to point to datasets; fix translation strings * move Link into src/components * add add new record button to datasets listview
This commit is contained in:
@@ -30,6 +30,7 @@ const mockStore = configureStore([thunk]);
|
||||
const store = mockStore({});
|
||||
|
||||
const dashboardsInfoEndpoint = 'glob:*/api/v1/dashboard/_info*';
|
||||
const dashboardOwnersEndpoint = 'glob:*/api/v1/dashboard/related/owners*';
|
||||
const dashboardsEndpoint = 'glob:*/api/v1/dashboard/?*';
|
||||
|
||||
const mockDashboards = [...new Array(3)].map((_, i) => ({
|
||||
@@ -45,7 +46,15 @@ const mockDashboards = [...new Array(3)].map((_, i) => ({
|
||||
|
||||
fetchMock.get(dashboardsInfoEndpoint, {
|
||||
permissions: ['can_list', 'can_edit'],
|
||||
filters: [],
|
||||
filters: {
|
||||
dashboard_title: [],
|
||||
slug: [],
|
||||
owners: [],
|
||||
published: [],
|
||||
},
|
||||
});
|
||||
fetchMock.get(dashboardOwnersEndpoint, {
|
||||
result: [],
|
||||
});
|
||||
fetchMock.get(dashboardsEndpoint, {
|
||||
result: mockDashboards,
|
||||
@@ -71,6 +80,11 @@ describe('DashboardList', () => {
|
||||
expect(callsI).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('fetches owners', () => {
|
||||
const callsO = fetchMock.calls(/dashboard\/related\/owners/);
|
||||
expect(callsO).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('fetches data', () => {
|
||||
wrapper.update();
|
||||
const callsD = fetchMock.calls(/dashboard\/\?q/);
|
||||
|
||||
Reference in New Issue
Block a user