Skip to content

Commit

Permalink
Remove breakdownField
Browse files Browse the repository at this point in the history
  • Loading branch information
Heenawter committed Jul 9, 2024
1 parent 7ebcf02 commit 72c6f7c
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export const initializeSearchEmbeddableApi = async (
const headerRowHeight$ = new BehaviorSubject<number | undefined>(initialState.headerRowHeight);
const sort$ = new BehaviorSubject<SortOrder[] | undefined>(initialState.sort);
const sampleSize$ = new BehaviorSubject<number | undefined>(initialState.sampleSize);
const breakdownField$ = new BehaviorSubject<string | undefined>(initialState.breakdownField);
const savedSearchViewMode$ = new BehaviorSubject<VIEW_MODE | undefined>(initialState.viewMode);

/** This is the state that has to be fetched */
Expand All @@ -103,7 +102,6 @@ export const initializeSearchEmbeddableApi = async (
* treated as the source of truth
*/
const stateManager: SearchEmbeddableStateManager = {
breakdownField: breakdownField$,
columns: columns$,
columnsMeta: columnsMeta$,
headerRowHeight: headerRowHeight$,
Expand Down Expand Up @@ -162,7 +160,6 @@ export const initializeSearchEmbeddableApi = async (
return; // the view mode can't currently be changed from dashboard, so the setter is not necessary
},
],
breakdownField: [breakdownField$, (value) => breakdownField$.next(value)],
sort: [sort$, (value) => sort$.next(value), (a, b) => deepEqual(a, b)],
columns: [columns$, (value) => columns$.next(value), (a, b) => deepEqual(a, b)],
sampleSize: [
Expand Down
9 changes: 1 addition & 8 deletions src/plugins/discover/public/embeddable/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,7 @@ import { EDITABLE_SAVED_SEARCH_KEYS } from './constants';

export type SearchEmbeddableState = Pick<
SerializableSavedSearch,
| 'rowHeight'
| 'rowsPerPage'
| 'headerRowHeight'
| 'columns'
| 'sort'
| 'sampleSize'
| 'breakdownField'
| 'viewMode'
'rowHeight' | 'rowsPerPage' | 'headerRowHeight' | 'columns' | 'sort' | 'sampleSize' | 'viewMode'
> & {
rows: DataTableRecord[];
columnsMeta: DataTableColumnsMeta | undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ describe('getDiscoverLocatorParams', () => {
sort: savedSearchMock.sort,
viewMode: savedSearchMock.viewMode,
hideAggregatedPreview: savedSearchMock.hideAggregatedPreview,
breakdownField: savedSearchMock.breakdownField,
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const getDiscoverLocatorParams = (
sort: savedSearch?.sort,
viewMode: savedSearch?.viewMode,
hideAggregatedPreview: savedSearch?.hideAggregatedPreview,
breakdownField: savedSearch?.breakdownField,
};

return locatorParams;
Expand Down

0 comments on commit 72c6f7c

Please sign in to comment.