mirror of
https://github.com/apache/superset.git
synced 2026-04-21 09:04:38 +00:00
Put formData in store (#1281)
* Put formData in store * Reform actions and reducers * Maded modifications based on comments:
This commit is contained in:
@@ -1,26 +1,13 @@
|
||||
const $ = window.$ = require('jquery');
|
||||
export const SET_DATASOURCE = 'SET_DATASOURCE';
|
||||
export const SET_VIZTYPE = 'SET_VIZTYPE';
|
||||
export const SET_TIME_COLUMN_OPTS = 'SET_TIME_COLUMN_OPTS';
|
||||
export const SET_TIME_GRAIN_OPTS = 'SET_TIME_GRAIN_OPTS';
|
||||
export const SET_TIME_COLUMN = 'SET_TIME_COLUMN';
|
||||
export const SET_TIME_GRAIN = 'SET_TIME_GRAIN';
|
||||
export const SET_SINCE = 'SET_SINCE';
|
||||
export const SET_UNTIL = 'SET_UNTIL';
|
||||
export const SET_GROUPBY_COLUMNS = 'SET_GROUPBY_COLUMNS';
|
||||
export const SET_GROUPBY_COLUMN_OPTS = 'SET_GROUPBY_COLUMN_OPTS';
|
||||
export const SET_METRICS = 'SET_METRICS';
|
||||
export const SET_METRICS_OPTS = 'SET_METRICS_OPTS';
|
||||
export const SET_COLUMN_OPTS = 'SET_COLUMN_OPTS';
|
||||
export const SET_NOT_GROUPBY_COLUMNS = 'SET_NOT_GROUPBY_COLUMNS';
|
||||
export const SET_ORDERING_OPTS = 'SET_ORDERING_OPTS';
|
||||
export const SET_ORDERINGS = 'SET_ORDERINGS';
|
||||
export const SET_TIME_STAMP_FORMAT = 'SET_TIME_STAMP_FORMAT';
|
||||
export const SET_ROW_LIMIT = 'SET_ROW_LIMIT';
|
||||
export const TOGGLE_SEARCHBOX = 'TOGGLE_SEARCHBOX';
|
||||
export const SET_FILTER_COLUMN_OPTS = 'SET_FILTER_COLUMN_OPTS';
|
||||
export const SET_WHERE_CLAUSE = 'SET_WHERE_CLAUSE';
|
||||
export const SET_HAVING_CLAUSE = 'SET_HAVING_CLAUSE';
|
||||
export const ADD_FILTER = 'ADD_FILTER';
|
||||
export const SET_FILTER = 'SET_FILTER';
|
||||
export const REMOVE_FILTER = 'REMOVE_FILTER';
|
||||
@@ -30,6 +17,7 @@ export const CHANGE_FILTER_VALUE = 'CHANGE_FILTER_VALUE';
|
||||
export const RESET_FORM_DATA = 'RESET_FORM_DATA';
|
||||
export const CLEAR_ALL_OPTS = 'CLEAR_ALL_OPTS';
|
||||
export const SET_DATASOURCE_TYPE = 'SET_DATASOURCE_TYPE';
|
||||
export const SET_FORM_DATA = 'SET_FORM_DATA';
|
||||
|
||||
export function setTimeColumnOpts(timeColumnOpts) {
|
||||
return { type: SET_TIME_COLUMN_OPTS, timeColumnOpts };
|
||||
@@ -131,62 +119,10 @@ export function setDatasource(datasourceId) {
|
||||
return { type: SET_DATASOURCE, datasourceId };
|
||||
}
|
||||
|
||||
export function setVizType(vizType) {
|
||||
return { type: SET_VIZTYPE, vizType };
|
||||
}
|
||||
|
||||
export function setTimeColumn(timeColumn) {
|
||||
return { type: SET_TIME_COLUMN, timeColumn };
|
||||
}
|
||||
|
||||
export function setTimeGrain(timeGrain) {
|
||||
return { type: SET_TIME_GRAIN, timeGrain };
|
||||
}
|
||||
|
||||
export function setSince(since) {
|
||||
return { type: SET_SINCE, since };
|
||||
}
|
||||
|
||||
export function setUntil(until) {
|
||||
return { type: SET_UNTIL, until };
|
||||
}
|
||||
|
||||
export function setGroupByColumns(groupByColumns) {
|
||||
return { type: SET_GROUPBY_COLUMNS, groupByColumns };
|
||||
}
|
||||
|
||||
export function setMetrics(metrics) {
|
||||
return { type: SET_METRICS, metrics };
|
||||
}
|
||||
|
||||
export function setNotGroupByColumns(columns) {
|
||||
return { type: SET_NOT_GROUPBY_COLUMNS, columns };
|
||||
}
|
||||
|
||||
export function setOrderings(orderings) {
|
||||
return { type: SET_ORDERINGS, orderings };
|
||||
}
|
||||
|
||||
export function setTimeStampFormat(timeStampFormat) {
|
||||
return { type: SET_TIME_STAMP_FORMAT, timeStampFormat };
|
||||
}
|
||||
|
||||
export function setRowLimit(rowLimit) {
|
||||
return { type: SET_ROW_LIMIT, rowLimit };
|
||||
}
|
||||
|
||||
export function toggleSearchBox(searchBox) {
|
||||
return { type: TOGGLE_SEARCHBOX, searchBox };
|
||||
}
|
||||
|
||||
export function setWhereClause(whereClause) {
|
||||
return { type: SET_WHERE_CLAUSE, whereClause };
|
||||
}
|
||||
|
||||
export function setHavingClause(havingClause) {
|
||||
return { type: SET_HAVING_CLAUSE, havingClause };
|
||||
}
|
||||
|
||||
export function addFilter(filter) {
|
||||
return { type: ADD_FILTER, filter };
|
||||
}
|
||||
@@ -206,3 +142,7 @@ export function changeFilterOp(filter, op) {
|
||||
export function changeFilterValue(filter, value) {
|
||||
return { type: CHANGE_FILTER_VALUE, filter, value };
|
||||
}
|
||||
|
||||
export function setFormData(key, value) {
|
||||
return { type: SET_FORM_DATA, key, value };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user