[charts] adds new filters ui (#9530)

* [charts] adds new filters ui

* move null check to be more visible

* better filter lists and async filter functionality
This commit is contained in:
ʈᵃᵢ
2020-04-21 12:04:11 -07:00
committed by GitHub
parent 9cf33e9f9d
commit 0b999e3b91
12 changed files with 366 additions and 100 deletions

View File

@@ -32,6 +32,8 @@ const store = mockStore({});
const chartsInfoEndpoint = 'glob:*/api/v1/chart/_info*';
const chartssOwnersEndpoint = 'glob:*/api/v1/chart/related/owners*';
const chartsEndpoint = 'glob:*/api/v1/chart/?*';
const chartsVizTypesEndpoint = 'glob:*/api/v1/chart/viz_types';
const chartsDtasourcesEndpoint = 'glob:*/api/v1/chart/datasources';
const mockCharts = [...new Array(3)].map((_, i) => ({
changed_on: new Date().toISOString(),
@@ -40,6 +42,7 @@ const mockCharts = [...new Array(3)].map((_, i) => ({
slice_name: `cool chart ${i}`,
url: 'url',
viz_type: 'bar',
datasource_name: `ds${i}`,
}));
fetchMock.get(chartsInfoEndpoint, {
@@ -60,6 +63,16 @@ fetchMock.get(chartsEndpoint, {
chart_count: 3,
});
fetchMock.get(chartsVizTypesEndpoint, {
result: [],
count: 0,
});
fetchMock.get(chartsDtasourcesEndpoint, {
result: [],
count: 0,
});
describe('ChartList', () => {
const mockedProps = {};
const wrapper = mount(<ChartList {...mockedProps} />, {