Merge pull request #11120 from influxdata/fix/save-view-properties
Ensure view retains cellID, and use cellID or id in updateVeiwpull/11161/head
commit
ef7d5a1928
|
@ -45,14 +45,16 @@ export const readView = (dashboardID: string, cellID: string) => async (
|
|||
export const updateView = (dashboardID: string, view: View) => async (
|
||||
dispatch: Dispatch<Action>
|
||||
): Promise<View> => {
|
||||
dispatch(setView(view.cellID, null, RemoteDataState.Loading))
|
||||
const viewID = view.cellID
|
||||
|
||||
dispatch(setView(viewID, null, RemoteDataState.Loading))
|
||||
|
||||
try {
|
||||
const newView = await updateViewAJAX(dashboardID, view.cellID, view)
|
||||
const newView = await updateViewAJAX(dashboardID, viewID, view)
|
||||
|
||||
dispatch(setView(view.cellID, newView, RemoteDataState.Done))
|
||||
dispatch(setView(viewID, newView, RemoteDataState.Done))
|
||||
return newView
|
||||
} catch {
|
||||
dispatch(setView(view.cellID, null, RemoteDataState.Error))
|
||||
dispatch(setView(viewID, null, RemoteDataState.Error))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -688,6 +688,8 @@ const convertView = (
|
|||
|
||||
newView.properties.queries = cloneDeep(view.properties.queries)
|
||||
newView.name = view.name
|
||||
newView.cellID = view.cellID
|
||||
newView.dashboardID = view.dashboardID
|
||||
newView.id = (view as any).id
|
||||
newView.links = (view as any).links
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ type Omit<K, V> = Pick<K, Exclude<keyof K, V>>
|
|||
|
||||
export type NewView<T extends ViewProperties = ViewProperties> = Omit<
|
||||
View<T>,
|
||||
'id' | 'links' | 'cellID' | 'dashboardID'
|
||||
'id' | 'links'
|
||||
>
|
||||
|
||||
export interface ViewLinks {
|
||||
|
|
Loading…
Reference in New Issue