Vliu put datasource in store (#1610)

* Move datasource from global store object to form_data

* Moved datasource_id  and datasource_name to form_data

* Refetch defaultFormData when switching datasource

* Fixed js tests
This commit is contained in:
vera-liu
2016-11-17 09:26:25 -08:00
committed by GitHub
parent ab5da5ba28
commit 4f7f437527
9 changed files with 76 additions and 48 deletions

View File

@@ -1,6 +1,5 @@
/* eslint camelcase: 0 */
const $ = window.$ = require('jquery');
export const SET_FIELD_OPTIONS = 'SET_FIELD_OPTIONS';
export function setFieldOptions(options) {
return { type: SET_FIELD_OPTIONS, options };
@@ -75,8 +74,8 @@ export function changeFilterValue(filter, value) {
}
export const SET_FIELD_VALUE = 'SET_FIELD_VALUE';
export function setFieldValue(key, value) {
return { type: SET_FIELD_VALUE, key, value };
export function setFieldValue(key, value, label) {
return { type: SET_FIELD_VALUE, key, value, label };
}
export const UPDATE_CHART = 'UPDATE_CHART';