mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
chore: move fixtures and helpers to root (#11812)
This commit is contained in:
committed by
GitHub
parent
011724750f
commit
84e0606a90
@@ -1,79 +0,0 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { datasourceId } from '../../../fixtures/mockDatasource';
|
||||
|
||||
export const sliceId = 18;
|
||||
|
||||
export default {
|
||||
[sliceId]: {
|
||||
id: sliceId,
|
||||
chartAlert: null,
|
||||
chartStatus: 'rendered',
|
||||
chartUpdateEndTime: 1525852456388,
|
||||
chartUpdateStartTime: 1525852454838,
|
||||
latestQueryFormData: {},
|
||||
queryRequest: {},
|
||||
queryResponse: {},
|
||||
triggerQuery: false,
|
||||
lastRendered: 0,
|
||||
form_data: {
|
||||
slice_id: sliceId,
|
||||
viz_type: 'pie',
|
||||
row_limit: 50000,
|
||||
metric: 'sum__num',
|
||||
since: '100 years ago',
|
||||
groupby: ['gender'],
|
||||
metrics: ['sum__num'],
|
||||
compare_lag: '10',
|
||||
limit: '25',
|
||||
until: 'now',
|
||||
granularity: 'ds',
|
||||
markup_type: 'markdown',
|
||||
where: '',
|
||||
compare_suffix: 'o10Y',
|
||||
datasource: datasourceId,
|
||||
},
|
||||
formData: {
|
||||
datasource: datasourceId,
|
||||
viz_type: 'pie',
|
||||
slice_id: sliceId,
|
||||
granularity_sqla: null,
|
||||
time_grain_sqla: null,
|
||||
since: '100 years ago',
|
||||
until: 'now',
|
||||
metrics: ['sum__num'],
|
||||
groupby: ['gender'],
|
||||
limit: '25',
|
||||
pie_label_type: 'key',
|
||||
donut: false,
|
||||
show_legend: true,
|
||||
labels_outside: true,
|
||||
color_scheme: 'bnbColors',
|
||||
where: '',
|
||||
having: '',
|
||||
filters: [],
|
||||
row_limit: 50000,
|
||||
metric: 'sum__num',
|
||||
compare_lag: '10',
|
||||
granularity: 'ds',
|
||||
markup_type: 'markdown',
|
||||
compare_suffix: 'o10Y',
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { dashboardLayout } from './mockDashboardLayout';
|
||||
|
||||
// mock the object to be posted to save_dash or copy_dash API
|
||||
export default {
|
||||
css: '',
|
||||
dashboard_title: 'Test 1',
|
||||
default_filters: {},
|
||||
expanded_slices: {},
|
||||
positions: dashboardLayout.present,
|
||||
};
|
||||
@@ -1,50 +0,0 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { DASHBOARD_FILTER_SCOPE_GLOBAL } from 'src/dashboard/reducers/dashboardFilters';
|
||||
import { filterId } from './mockSliceEntities';
|
||||
|
||||
export const emptyFilters = {};
|
||||
|
||||
export const dashboardFilters = {
|
||||
[filterId]: {
|
||||
chartId: filterId,
|
||||
componentId: 'CHART-rwDfbGqeEn',
|
||||
directPathToFilter: [
|
||||
'ROOT_ID',
|
||||
'TABS-VPEX_c476g',
|
||||
'TAB-PMJyKM1yB',
|
||||
'TABS-YdylzDMTMQ',
|
||||
'TAB-O9AaU9FT0',
|
||||
'ROW-l6PrlhwSjh',
|
||||
'CHART-rwDfbGqeEn',
|
||||
],
|
||||
scopes: {
|
||||
region: DASHBOARD_FILTER_SCOPE_GLOBAL,
|
||||
gender: DASHBOARD_FILTER_SCOPE_GLOBAL,
|
||||
},
|
||||
isDateFilter: false,
|
||||
isInstantFilter: true,
|
||||
columns: {
|
||||
region: ['a', 'b'],
|
||||
},
|
||||
labels: {
|
||||
region: 'region',
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -1,30 +0,0 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
export default {
|
||||
id: 1234,
|
||||
slug: 'dashboardSlug',
|
||||
metadata: {},
|
||||
userId: 'mock_user_id',
|
||||
dash_edit_perm: true,
|
||||
dash_save_perm: true,
|
||||
common: {
|
||||
flash_messages: [],
|
||||
conf: { ENABLE_JAVASCRIPT_CONTROLS: false, SUPERSET_WEBSERVER_TIMEOUT: 60 },
|
||||
},
|
||||
};
|
||||
@@ -1,260 +0,0 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import {
|
||||
DASHBOARD_GRID_TYPE,
|
||||
DASHBOARD_HEADER_TYPE,
|
||||
DASHBOARD_ROOT_TYPE,
|
||||
TABS_TYPE,
|
||||
TAB_TYPE,
|
||||
CHART_TYPE,
|
||||
ROW_TYPE,
|
||||
COLUMN_TYPE,
|
||||
MARKDOWN_TYPE,
|
||||
} from 'src/dashboard/util/componentTypes';
|
||||
|
||||
import {
|
||||
DASHBOARD_ROOT_ID,
|
||||
DASHBOARD_HEADER_ID,
|
||||
DASHBOARD_GRID_ID,
|
||||
} from 'src/dashboard/util/constants';
|
||||
|
||||
import newComponentFactory from 'src/dashboard/util/newComponentFactory';
|
||||
|
||||
import { sliceId as chartId } from './mockChartQueries';
|
||||
import { filterId } from './mockSliceEntities';
|
||||
|
||||
export const sliceId = chartId;
|
||||
|
||||
export const dashboardLayout = {
|
||||
past: [],
|
||||
present: {
|
||||
[DASHBOARD_ROOT_ID]: {
|
||||
type: DASHBOARD_ROOT_TYPE,
|
||||
id: DASHBOARD_ROOT_ID,
|
||||
children: [DASHBOARD_GRID_ID],
|
||||
},
|
||||
|
||||
[DASHBOARD_GRID_ID]: {
|
||||
type: DASHBOARD_GRID_TYPE,
|
||||
id: DASHBOARD_GRID_ID,
|
||||
children: ['ROW_ID'],
|
||||
meta: {},
|
||||
},
|
||||
|
||||
[DASHBOARD_HEADER_ID]: {
|
||||
type: DASHBOARD_HEADER_TYPE,
|
||||
id: DASHBOARD_HEADER_ID,
|
||||
meta: {
|
||||
text: 'New dashboard',
|
||||
},
|
||||
},
|
||||
|
||||
ROW_ID: {
|
||||
...newComponentFactory(ROW_TYPE),
|
||||
id: 'ROW_ID',
|
||||
children: ['COLUMN_ID'],
|
||||
},
|
||||
|
||||
COLUMN_ID: {
|
||||
...newComponentFactory(COLUMN_TYPE),
|
||||
id: 'COLUMN_ID',
|
||||
children: ['CHART_ID'],
|
||||
},
|
||||
|
||||
CHART_ID: {
|
||||
...newComponentFactory(CHART_TYPE),
|
||||
id: 'CHART_ID',
|
||||
meta: {
|
||||
chartId,
|
||||
width: 3,
|
||||
height: 10,
|
||||
chartName: 'Mock chart name',
|
||||
},
|
||||
},
|
||||
|
||||
MARKDOWN_ID: {
|
||||
...newComponentFactory(MARKDOWN_TYPE),
|
||||
id: 'MARKDOWN_ID',
|
||||
},
|
||||
},
|
||||
future: [],
|
||||
};
|
||||
|
||||
export const dashboardLayoutWithTabs = {
|
||||
past: [],
|
||||
present: {
|
||||
[DASHBOARD_ROOT_ID]: {
|
||||
type: DASHBOARD_ROOT_TYPE,
|
||||
id: DASHBOARD_ROOT_ID,
|
||||
children: ['TABS_ID'],
|
||||
},
|
||||
|
||||
TABS_ID: {
|
||||
id: 'TABS_ID',
|
||||
type: TABS_TYPE,
|
||||
children: ['TAB_ID', 'TAB_ID2'],
|
||||
parents: ['ROOT_ID'],
|
||||
},
|
||||
|
||||
TAB_ID: {
|
||||
id: 'TAB_ID',
|
||||
type: TAB_TYPE,
|
||||
children: ['ROW_ID'],
|
||||
parents: ['ROOT_ID', 'TABS_ID'],
|
||||
meta: {
|
||||
text: 'tab1',
|
||||
},
|
||||
},
|
||||
|
||||
TAB_ID2: {
|
||||
id: 'TAB_ID2',
|
||||
type: TAB_TYPE,
|
||||
children: ['ROW_ID2'],
|
||||
parents: ['ROOT_ID', 'TABS_ID'],
|
||||
meta: {
|
||||
text: 'tab2',
|
||||
},
|
||||
},
|
||||
|
||||
CHART_ID: {
|
||||
...newComponentFactory(CHART_TYPE),
|
||||
id: 'CHART_ID',
|
||||
parents: ['ROOT_ID', 'TABS_ID', 'TAB_ID', 'ROW_ID'],
|
||||
meta: {
|
||||
chartId,
|
||||
width: 3,
|
||||
height: 10,
|
||||
chartName: 'Mock chart name',
|
||||
},
|
||||
},
|
||||
|
||||
ROW_ID: {
|
||||
...newComponentFactory(ROW_TYPE),
|
||||
id: 'ROW_ID',
|
||||
children: ['CHART_ID'],
|
||||
parents: ['ROOT_ID', 'TABS_ID', 'TAB_ID'],
|
||||
},
|
||||
|
||||
CHART_ID2: {
|
||||
...newComponentFactory(CHART_TYPE),
|
||||
id: 'CHART_ID2',
|
||||
parents: ['ROOT_ID', 'TABS_ID', 'TAB_ID2', 'ROW_ID2'],
|
||||
meta: {
|
||||
chartId,
|
||||
width: 3,
|
||||
height: 10,
|
||||
chartName: 'Mock chart name 2',
|
||||
},
|
||||
},
|
||||
|
||||
ROW_ID2: {
|
||||
...newComponentFactory(ROW_TYPE),
|
||||
id: 'ROW_ID2',
|
||||
children: ['CHART_ID2'],
|
||||
parents: ['ROOT_ID', 'TABS_ID', 'TAB_ID2'],
|
||||
},
|
||||
|
||||
[DASHBOARD_GRID_ID]: {
|
||||
type: DASHBOARD_GRID_TYPE,
|
||||
id: DASHBOARD_GRID_ID,
|
||||
children: [],
|
||||
parents: ['ROOT_ID'],
|
||||
meta: {},
|
||||
},
|
||||
|
||||
[DASHBOARD_HEADER_ID]: {
|
||||
type: DASHBOARD_HEADER_TYPE,
|
||||
id: DASHBOARD_HEADER_ID,
|
||||
meta: {
|
||||
text: 'New dashboard',
|
||||
},
|
||||
},
|
||||
},
|
||||
future: [],
|
||||
};
|
||||
|
||||
export const filterComponent = {
|
||||
...newComponentFactory(CHART_TYPE),
|
||||
id: 'CHART-rwDfbGqeEn',
|
||||
parents: [
|
||||
'ROOT_ID',
|
||||
'TABS-VPEX_c476g',
|
||||
'TAB-PMJyKM1yB',
|
||||
'TABS-YdylzDMTMQ',
|
||||
'TAB-O9AaU9FT0',
|
||||
'ROW-l6PrlhwSjh',
|
||||
],
|
||||
meta: {
|
||||
chartId: filterId,
|
||||
width: 3,
|
||||
height: 10,
|
||||
sliceName: 'Filter',
|
||||
},
|
||||
};
|
||||
|
||||
export const dashboardWithFilter = {
|
||||
[DASHBOARD_ROOT_ID]: {
|
||||
type: DASHBOARD_ROOT_TYPE,
|
||||
id: DASHBOARD_ROOT_ID,
|
||||
children: [DASHBOARD_GRID_ID],
|
||||
},
|
||||
|
||||
[DASHBOARD_GRID_ID]: {
|
||||
type: DASHBOARD_GRID_TYPE,
|
||||
id: DASHBOARD_GRID_ID,
|
||||
children: ['ROW_ID'],
|
||||
meta: {},
|
||||
},
|
||||
|
||||
[DASHBOARD_HEADER_ID]: {
|
||||
type: DASHBOARD_HEADER_TYPE,
|
||||
id: DASHBOARD_HEADER_ID,
|
||||
meta: {
|
||||
text: 'New dashboard',
|
||||
},
|
||||
},
|
||||
|
||||
ROW_ID: {
|
||||
...newComponentFactory(ROW_TYPE),
|
||||
id: 'ROW_ID',
|
||||
children: ['CHART_ID', 'FILTER_ID'],
|
||||
},
|
||||
|
||||
FILTER_ID: {
|
||||
...newComponentFactory(CHART_TYPE),
|
||||
id: 'FILTER_ID',
|
||||
meta: {
|
||||
chartId: filterId,
|
||||
width: 3,
|
||||
height: 10,
|
||||
chartName: 'filter name',
|
||||
},
|
||||
},
|
||||
|
||||
CHART_ID: {
|
||||
...newComponentFactory(CHART_TYPE),
|
||||
id: 'CHART_ID',
|
||||
meta: {
|
||||
chartId,
|
||||
width: 3,
|
||||
height: 10,
|
||||
chartName: 'Mock chart name',
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -1,31 +0,0 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { sliceId } from './mockChartQueries';
|
||||
|
||||
export default {
|
||||
sliceIds: [sliceId],
|
||||
expandedSlices: {},
|
||||
editMode: false,
|
||||
hasUnsavedChanges: false,
|
||||
maxUndoHistoryExceeded: false,
|
||||
isStarred: true,
|
||||
isPublished: true,
|
||||
css: '',
|
||||
focusedFilterField: null,
|
||||
};
|
||||
@@ -1,210 +0,0 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { datasourceId } from '../../../fixtures/mockDatasource';
|
||||
import { sliceId } from './mockChartQueries';
|
||||
|
||||
export const filterId = 127;
|
||||
export const column = 'region';
|
||||
|
||||
export const sliceEntitiesForChart = {
|
||||
slices: {
|
||||
[sliceId]: {
|
||||
slice_id: sliceId,
|
||||
slice_url: '/superset/explore/?form_data=%7B%22slice_id%22%3A%2018%7D',
|
||||
slice_name: 'Genders',
|
||||
form_data: {
|
||||
slice_id: sliceId,
|
||||
viz_type: 'pie',
|
||||
row_limit: 50000,
|
||||
metric: 'sum__num',
|
||||
since: '100 years ago',
|
||||
groupby: ['gender'],
|
||||
metrics: ['sum__num'],
|
||||
compare_lag: '10',
|
||||
limit: '25',
|
||||
until: 'now',
|
||||
granularity: 'ds',
|
||||
markup_type: 'markdown',
|
||||
where: '',
|
||||
compare_suffix: 'o10Y',
|
||||
datasource: datasourceId,
|
||||
},
|
||||
edit_url: `/chart/edit/${sliceId}`,
|
||||
viz_type: 'pie',
|
||||
datasource: datasourceId,
|
||||
description: null,
|
||||
description_markeddown: '',
|
||||
modified: '23 hours ago',
|
||||
changed_on: 1529453332615,
|
||||
},
|
||||
},
|
||||
isLoading: false,
|
||||
errorMessage: null,
|
||||
lastUpdated: 0,
|
||||
};
|
||||
|
||||
export const sliceEntitiesForDashboard = {
|
||||
slices: {
|
||||
[filterId]: {
|
||||
slice_id: filterId,
|
||||
slice_url: '/superset/explore/?form_data=%7B%22slice_id%22%3A%20127%7D',
|
||||
slice_name: 'Region Filter',
|
||||
form_data: {
|
||||
instant_filtering: true,
|
||||
filter_configs: [
|
||||
{
|
||||
asc: true,
|
||||
clearable: true,
|
||||
column,
|
||||
key: 'JknLrSlNL',
|
||||
multiple: true,
|
||||
label: column,
|
||||
},
|
||||
],
|
||||
},
|
||||
edit_url: '/chart/edit/127',
|
||||
viz_type: 'filter_box',
|
||||
datasource: '2__table',
|
||||
description: null,
|
||||
description_markeddown: '',
|
||||
modified: '23 hours ago',
|
||||
changed_on: 1529453332615,
|
||||
},
|
||||
128: {
|
||||
slice_id: 128,
|
||||
slice_url: '/superset/explore/?form_data=%7B%22slice_id%22%3A%20128%7D',
|
||||
slice_name: "World's Population",
|
||||
form_data: {},
|
||||
edit_url: '/chart/edit/128',
|
||||
viz_type: 'big_number',
|
||||
datasource: '2__table',
|
||||
description: null,
|
||||
description_markeddown: '',
|
||||
modified: '23 hours ago',
|
||||
changed_on: 1529453332628,
|
||||
},
|
||||
129: {
|
||||
slice_id: 129,
|
||||
slice_url: '/superset/explore/?form_data=%7B%22slice_id%22%3A%20129%7D',
|
||||
slice_name: 'Most Populated Countries',
|
||||
form_data: {},
|
||||
edit_url: '/chart/edit/129',
|
||||
viz_type: 'table',
|
||||
datasource: '2__table',
|
||||
description: null,
|
||||
description_markeddown: '',
|
||||
modified: '23 hours ago',
|
||||
changed_on: 1529453332637,
|
||||
},
|
||||
130: {
|
||||
slice_id: 130,
|
||||
slice_url: '/superset/explore/?form_data=%7B%22slice_id%22%3A%20130%7D',
|
||||
slice_name: 'Growth Rate',
|
||||
form_data: {},
|
||||
edit_url: '/chart/edit/130',
|
||||
viz_type: 'line',
|
||||
datasource: '2__table',
|
||||
description: null,
|
||||
description_markeddown: '',
|
||||
modified: '23 hours ago',
|
||||
changed_on: 1529453332645,
|
||||
},
|
||||
131: {
|
||||
slice_id: 131,
|
||||
slice_url: '/superset/explore/?form_data=%7B%22slice_id%22%3A%20131%7D',
|
||||
slice_name: '% Rural',
|
||||
form_data: {},
|
||||
edit_url: '/chart/edit/131',
|
||||
viz_type: 'world_map',
|
||||
datasource: '2__table',
|
||||
description: null,
|
||||
description_markeddown: '',
|
||||
modified: '23 hours ago',
|
||||
changed_on: 1529453332654,
|
||||
},
|
||||
132: {
|
||||
slice_id: 132,
|
||||
slice_url: '/superset/explore/?form_data=%7B%22slice_id%22%3A%20132%7D',
|
||||
slice_name: 'Life Expectancy VS Rural %',
|
||||
form_data: {},
|
||||
edit_url: '/chart/edit/132',
|
||||
viz_type: 'bubble',
|
||||
datasource: '2__table',
|
||||
description: null,
|
||||
description_markeddown: '',
|
||||
modified: '23 hours ago',
|
||||
changed_on: 1529453332663,
|
||||
},
|
||||
133: {
|
||||
slice_id: 133,
|
||||
slice_url: '/superset/explore/?form_data=%7B%22slice_id%22%3A%20133%7D',
|
||||
slice_name: 'Rural Breakdown',
|
||||
form_data: {},
|
||||
edit_url: '/chart/edit/133',
|
||||
viz_type: 'sunburst',
|
||||
datasource: '2__table',
|
||||
description: null,
|
||||
description_markeddown: '',
|
||||
modified: '23 hours ago',
|
||||
changed_on: 1529453332673,
|
||||
},
|
||||
134: {
|
||||
slice_id: 134,
|
||||
slice_url: '/superset/explore/?form_data=%7B%22slice_id%22%3A%20134%7D',
|
||||
slice_name: "World's Pop Growth",
|
||||
form_data: {},
|
||||
edit_url: '/chart/edit/134',
|
||||
viz_type: 'area',
|
||||
datasource: '2__table',
|
||||
description: null,
|
||||
description_markeddown: '',
|
||||
modified: '23 hours ago',
|
||||
changed_on: 1529453332680,
|
||||
},
|
||||
135: {
|
||||
slice_id: 135,
|
||||
slice_url: '/superset/explore/?form_data=%7B%22slice_id%22%3A%20135%7D',
|
||||
slice_name: 'Box plot',
|
||||
form_data: {},
|
||||
edit_url: '/chart/edit/135',
|
||||
viz_type: 'box_plot',
|
||||
datasource: '2__table',
|
||||
description: null,
|
||||
description_markeddown: '',
|
||||
modified: '23 hours ago',
|
||||
changed_on: 1529453332688,
|
||||
},
|
||||
136: {
|
||||
slice_id: 136,
|
||||
slice_url: '/superset/explore/?form_data=%7B%22slice_id%22%3A%20136%7D',
|
||||
slice_name: 'Treemap',
|
||||
form_data: {},
|
||||
edit_url: '/chart/edit/136',
|
||||
viz_type: 'treemap',
|
||||
datasource: '2__table',
|
||||
description: null,
|
||||
description_markeddown: '',
|
||||
modified: '23 hours ago',
|
||||
changed_on: 1529453332700,
|
||||
},
|
||||
},
|
||||
isLoading: false,
|
||||
errorMessage: null,
|
||||
lastUpdated: 0,
|
||||
};
|
||||
@@ -1,38 +0,0 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import chartQueries from './mockChartQueries';
|
||||
import { dashboardLayout } from './mockDashboardLayout';
|
||||
import dashboardInfo from './mockDashboardInfo';
|
||||
import { emptyFilters } from './mockDashboardFilters';
|
||||
import dashboardState from './mockDashboardState';
|
||||
import messageToasts from '../../messageToasts/mockMessageToasts';
|
||||
import datasources from '../../../fixtures/mockDatasource';
|
||||
import sliceEntities from './mockSliceEntities';
|
||||
|
||||
export default {
|
||||
datasources,
|
||||
sliceEntities,
|
||||
charts: chartQueries,
|
||||
dashboardInfo,
|
||||
dashboardFilters: emptyFilters,
|
||||
dashboardState,
|
||||
dashboardLayout,
|
||||
messageToasts,
|
||||
impressionId: 'mock_impression_id',
|
||||
};
|
||||
@@ -1,76 +0,0 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { createStore, applyMiddleware, compose } from 'redux';
|
||||
import thunk from 'redux-thunk';
|
||||
|
||||
import rootReducer from 'src/dashboard/reducers/index';
|
||||
|
||||
import mockState from './mockState';
|
||||
import { dashboardLayoutWithTabs } from './mockDashboardLayout';
|
||||
import { sliceId } from './mockChartQueries';
|
||||
import { dashboardFilters } from './mockDashboardFilters';
|
||||
|
||||
export const getMockStore = () =>
|
||||
createStore(rootReducer, mockState, compose(applyMiddleware(thunk)));
|
||||
|
||||
export const mockStore = getMockStore();
|
||||
|
||||
export const getMockStoreWithTabs = () =>
|
||||
createStore(
|
||||
rootReducer,
|
||||
{
|
||||
...mockState,
|
||||
dashboardLayout: dashboardLayoutWithTabs,
|
||||
dashboardFilters: {},
|
||||
},
|
||||
compose(applyMiddleware(thunk)),
|
||||
);
|
||||
|
||||
export const mockStoreWithTabs = getMockStoreWithTabs();
|
||||
|
||||
export const sliceIdWithAppliedFilter = sliceId + 1;
|
||||
export const sliceIdWithRejectedFilter = sliceId + 2;
|
||||
|
||||
// has one chart with a filter that has been applied,
|
||||
// one chart with a filter that has been rejected,
|
||||
// and one chart with no filters set.
|
||||
export const getMockStoreWithFilters = () =>
|
||||
createStore(rootReducer, {
|
||||
...mockState,
|
||||
dashboardFilters,
|
||||
charts: {
|
||||
...mockState.charts,
|
||||
[sliceIdWithAppliedFilter]: {
|
||||
...mockState.charts[sliceId],
|
||||
queryResponse: {
|
||||
status: 'success',
|
||||
applied_filters: [{ column: 'region' }],
|
||||
rejected_filters: [],
|
||||
},
|
||||
},
|
||||
[sliceIdWithRejectedFilter]: {
|
||||
...mockState.charts[sliceId],
|
||||
queryResponse: {
|
||||
status: 'success',
|
||||
applied_filters: [],
|
||||
rejected_filters: [{ column: 'region', reason: 'not_in_datasource' }],
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user