apply redux for VisualizeModal (#2795)

* redux visualize modal

* redux visualize modal

- apply redux
- add unit test for connect container component
- fix lint error

* redux visualize modal

- apply redux
- add unit test for connect container component
- fix lint error
This commit is contained in:
Grace Guo
2017-05-24 11:58:54 -07:00
committed by GitHub
parent 69685b9dcc
commit d0a04cde49
6 changed files with 183 additions and 25 deletions

View File

@@ -251,6 +251,25 @@ export const sqlLabReducer = function (state, action) {
}
return Object.assign({}, state, { queries: newQueries, queriesLastUpdate });
},
[actions.CREATE_DATASOURCE_STARTED]() {
return Object.assign({}, state, {
isDatasourceLoading: true,
errorMessage: null,
});
},
[actions.CREATE_DATASOURCE_SUCCESS]() {
return Object.assign({}, state, {
isDatasourceLoading: false,
errorMessage: null,
datasource: action.datasource,
});
},
[actions.CREATE_DATASOURCE_FAILED]() {
return Object.assign({}, state, {
isDatasourceLoading: false,
errorMessage: action.err,
});
},
};
if (action.type in actionHandlers) {
return actionHandlers[action.type]();