Skip to content

Commit

Permalink
updating based on review
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar committed Mar 23, 2020
1 parent fdf874c commit 153d062
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function VisualizeAppController(
const visStateToEditorState = () => {
const savedVisState = visualizations.convertFromSerializedVis(vis.serialize());
return {
uiState: vis.uiState.getChanges(),
uiState: vis.uiState.toJSON(),
query: vis.data.searchSource.getOwnField('query') || defaultQuery,
filters: vis.data.searchSource.getOwnField('filter') || [],
vis: { ...savedVisState.visState, title: vis.title },
Expand Down Expand Up @@ -641,7 +641,7 @@ function VisualizeAppController(
savedVis.searchSource.setField('query', stateContainer.getState().query);
savedVis.searchSource.setField('filter', stateContainer.getState().filters);
savedVis.visState = stateContainer.getState().vis;
savedVis.uiStateJSON = angular.toJson($scope.uiState.getChanges());
savedVis.uiStateJSON = angular.toJson($scope.uiState.toJSON());
$appStatus.dirty = false;

return savedVis.save(saveOptions).then(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ export function useVisualizeAppState({ stateDefaults, kbnUrlStateStorage }: Argu
linked: false,
}),
updateVisState: state => newVisState => ({ ...state, vis: toObject(newVisState) }),
updateUiState: state => newUiState => ({ ...state, uiState: newUiState }),
updateFromSavedQuery: state => savedQuery => ({
...state,
savedQuery: savedQuery.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export interface VisualizeAppStateTransitions {
state: VisualizeAppState
) => ({ query, parentFilters }: { query?: Query; parentFilters?: Filter[] }) => VisualizeAppState;
updateVisState: (state: VisualizeAppState) => (vis: PureVisState) => VisualizeAppState;
updateUiState: (state: VisualizeAppState) => (uiState: PersistedState) => VisualizeAppState;
updateFromSavedQuery: (state: VisualizeAppState) => (savedQuery: SavedQuery) => VisualizeAppState;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export class Vis {
title: this.title,
type: this.type.name,
params: cloneDeep(this.params) as any,
uiState: this.uiState.getChanges(),
uiState: this.uiState.toJSON(),
data: {
aggs: aggs as any,
indexPattern: indexPattern ? indexPattern.id : undefined,
Expand Down

0 comments on commit 153d062

Please sign in to comment.