web: edit report and edit dashboard
This commit is contained in:
@@ -19,7 +19,7 @@ type InitialState = IChartInput & {
|
||||
// First approach: define the initial state using that type
|
||||
const initialState: InitialState = {
|
||||
dirty: false,
|
||||
name: 'screen_view',
|
||||
name: 'Untitled',
|
||||
chartType: 'linear',
|
||||
interval: 'day',
|
||||
breakdowns: [],
|
||||
@@ -30,7 +30,7 @@ const initialState: InitialState = {
|
||||
};
|
||||
|
||||
export const reportSlice = createSlice({
|
||||
name: 'counter',
|
||||
name: 'report',
|
||||
initialState,
|
||||
reducers: {
|
||||
resetDirty(state) {
|
||||
@@ -50,6 +50,10 @@ export const reportSlice = createSlice({
|
||||
dirty: false,
|
||||
};
|
||||
},
|
||||
setName(state, action: PayloadAction<string>) {
|
||||
state.dirty = true;
|
||||
state.name = action.payload;
|
||||
},
|
||||
// Events
|
||||
addEvent: (state, action: PayloadAction<Omit<IChartEvent, 'id'>>) => {
|
||||
state.dirty = true;
|
||||
@@ -162,6 +166,7 @@ export const reportSlice = createSlice({
|
||||
export const {
|
||||
reset,
|
||||
setReport,
|
||||
setName,
|
||||
addEvent,
|
||||
removeEvent,
|
||||
changeEvent,
|
||||
|
||||
Reference in New Issue
Block a user