From 12465d334f88a7f3503e5e6113c01ec9fd4ab637 Mon Sep 17 00:00:00 2001 From: ananzh Date: Thu, 21 Sep 2023 19:57:03 +0000 Subject: [PATCH] fix PR comments Signed-off-by: ananzh --- .../public/embeddable/search_embeddable.scss | 12 ------------ .../discover/public/embeddable/search_embeddable.tsx | 9 ++++----- .../embeddable/search_embeddable_component.tsx | 2 +- .../public/embeddable/search_embeddable_factory.tsx | 9 ++++----- 4 files changed, 9 insertions(+), 23 deletions(-) delete mode 100644 src/plugins/discover/public/embeddable/search_embeddable.scss diff --git a/src/plugins/discover/public/embeddable/search_embeddable.scss b/src/plugins/discover/public/embeddable/search_embeddable.scss deleted file mode 100644 index e953968495e7..000000000000 --- a/src/plugins/discover/public/embeddable/search_embeddable.scss +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 1. We want the osdDocTable__container to scroll only when embedded in an embeddable panel - * 2. Force a better looking scrollbar - */ -.embPanel { - .osdDocTable__container { - @include euiScrollBar; /* 2 */ - - flex: 1 1 0; /* 1 */ - overflow: auto; /* 1 */ - } -} diff --git a/src/plugins/discover/public/embeddable/search_embeddable.tsx b/src/plugins/discover/public/embeddable/search_embeddable.tsx index 001327345d2b..76b6b9f449c4 100644 --- a/src/plugins/discover/public/embeddable/search_embeddable.tsx +++ b/src/plugins/discover/public/embeddable/search_embeddable.tsx @@ -28,8 +28,7 @@ * under the License. */ -import './search_embeddable.scss'; -import _ from 'lodash'; +import { isEqual } from 'lodash'; import * as Rx from 'rxjs'; import { Subscription } from 'rxjs'; import React from 'react'; @@ -379,9 +378,9 @@ export class SearchEmbeddable private async pushContainerStateParamsToProps(searchProps: SearchProps) { const isFetchRequired = !opensearchFilters.onlyDisabledFiltersChanged(this.input.filters, this.prevFilters) || - !_.isEqual(this.prevQuery, this.input.query) || - !_.isEqual(this.prevTimeRange, this.input.timeRange) || - !_.isEqual(searchProps.sort, this.input.sort || this.savedSearch.sort); + !isEqual(this.prevQuery, this.input.query) || + !isEqual(this.prevTimeRange, this.input.timeRange) || + !isEqual(searchProps.sort, this.input.sort || this.savedSearch.sort); // If there is column or sort data on the panel, that means the original columns or sort settings have // been overridden in a dashboard. diff --git a/src/plugins/discover/public/embeddable/search_embeddable_component.tsx b/src/plugins/discover/public/embeddable/search_embeddable_component.tsx index 805d231049f8..c9a08844e9a0 100644 --- a/src/plugins/discover/public/embeddable/search_embeddable_component.tsx +++ b/src/plugins/discover/public/embeddable/search_embeddable_component.tsx @@ -38,7 +38,7 @@ export function SearchEmbeddableComponent({ searchProps }: SearchEmbeddableProps displayTimeColumn: searchProps.displayTimeColumn, services: searchProps.services, totalHitCount: searchProps.totalHitCount, - } as DiscoverEmbeddableProps & { totalHitCount: number }; + } as DiscoverEmbeddableProps; return ( diff --git a/src/plugins/discover/public/embeddable/search_embeddable_factory.tsx b/src/plugins/discover/public/embeddable/search_embeddable_factory.tsx index f4c325701ef5..8d99b87fbeb2 100644 --- a/src/plugins/discover/public/embeddable/search_embeddable_factory.tsx +++ b/src/plugins/discover/public/embeddable/search_embeddable_factory.tsx @@ -36,9 +36,8 @@ import { Container, ErrorEmbeddable, } from '../../../embeddable/public'; - import { TimeRange } from '../../../data/public'; - +import { SearchEmbeddable } from './search_embeddable'; import { SearchInput, SearchOutput } from './types'; import { SEARCH_EMBEDDABLE_TYPE } from './constants'; @@ -82,14 +81,14 @@ export class SearchEmbeddableFactory const services = getServices(); const filterManager = services.filterManager; const url = await services.getSavedSearchUrlById(savedObjectId); - const editUrl = services.addBasePath(`/app/discover${url}`); + const editUrl = services.addBasePath(`/app/data-explorer/discover${url}`); try { const savedObject = await services.getSavedSearchById(savedObjectId); const indexPattern = savedObject.searchSource.getField('index'); const { executeTriggerActions } = await this.getStartServices(); - const { SearchEmbeddable } = await import('./search_embeddable'); - return new SearchEmbeddable( + const { SearchEmbeddable: SearchEmbeddableClass } = await import('./search_embeddable'); + return new SearchEmbeddableClass( { savedSearch: savedObject, editUrl,