Skip to content

Commit

Permalink
fix PR comments
Browse files Browse the repository at this point in the history
Signed-off-by: ananzh <[email protected]>
  • Loading branch information
ananzh committed Sep 21, 2023
1 parent c948857 commit 12465d3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 23 deletions.
12 changes: 0 additions & 12 deletions src/plugins/discover/public/embeddable/search_embeddable.scss

This file was deleted.

9 changes: 4 additions & 5 deletions src/plugins/discover/public/embeddable/search_embeddable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<I18nProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 12465d3

Please sign in to comment.