From c5f674e78a26e6f1a3db234bde3db3c41daa1d5b Mon Sep 17 00:00:00 2001 From: Matthias Wilhelm Date: Thu, 4 Aug 2022 21:12:22 +0200 Subject: [PATCH] Fix functional test --- .../public/embeddable/saved_search_embeddable.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx b/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx index b0107101768fe..6cb8ef93d360e 100644 --- a/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx +++ b/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx @@ -290,12 +290,13 @@ export class SavedSearchEmbeddable if (!dataView) { return; } + const sort = this.getSort(this.savedSearch.sort, dataView); const props: SearchProps = { columns: this.savedSearch.columns, dataView, isLoading: false, - sort: this.getSort(this.savedSearch.sort, dataView), + sort, rows: [], searchDescription: this.savedSearch.description, description: this.savedSearch.description, @@ -326,9 +327,9 @@ export class SavedSearchEmbeddable onSetColumns: (columns: string[]) => { this.updateInput({ columns }); }, - onSort: (sort: string[][]) => { + onSort: (nextSort: string[][]) => { const sortOrderArr: SortPairArr[] = []; - sort.forEach((arr) => { + nextSort.forEach((arr) => { sortOrderArr.push(arr as SortPairArr); }); this.updateInput({ sort: sortOrderArr }); @@ -421,7 +422,7 @@ export class SavedSearchEmbeddable ).columns; searchProps.sort = this.getSort( this.input.sort || this.savedSearch.sort, - this.searchProps?.dataView + searchProps?.dataView ); searchProps.sharedItemTitle = this.panelTitle;