Edit Dashboard title and Slice title in place (#2940)

* Edit Dashboard title and Slice title in place

Add EditableTitle component into Dashboard and Explore view to support edit title inline.
This commit is contained in:
Grace Guo
2017-06-14 12:52:12 -07:00
committed by GitHub
parent da0a87a735
commit 8329ea2b9b
13 changed files with 302 additions and 15 deletions

View File

@@ -135,6 +135,10 @@ export const exploreReducer = function (state, action) {
}
return newState;
},
[actions.UPDATE_CHART_TITLE]() {
const updatedSlice = Object.assign({}, state.slice, { slice_name: action.slice_name });
return Object.assign({}, state, { slice: updatedSlice });
},
[actions.REMOVE_CHART_ALERT]() {
if (state.chartAlert !== null) {
return Object.assign({}, state, { chartAlert: null });
@@ -144,6 +148,9 @@ export const exploreReducer = function (state, action) {
[actions.SAVE_SLICE_FAILED]() {
return Object.assign({}, state, { saveModalAlert: 'Failed to save slice' });
},
[actions.SAVE_SLICE_SUCCESS](data) {
return Object.assign({}, state, { data });
},
[actions.REMOVE_SAVE_MODAL_ALERT]() {
return Object.assign({}, state, { saveModalAlert: null });
},