Skip to content

Commit

Permalink
add data-shared-item tag (#5119)
Browse files Browse the repository at this point in the history
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
  • Loading branch information
abbyhu2000 authored Sep 26, 2023
1 parent da3c209 commit 1e94295
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export interface DataGridTableProps {
sort: SortOrder[];
displayTimeColumn: boolean;
services: DiscoverServices;
title?: string;
description?: string;
isToolbarVisible?: boolean;
isContextView?: boolean;
isLoading?: boolean;
Expand All @@ -46,6 +48,8 @@ export const DataGridTable = ({
sort,
rows,
displayTimeColumn,
title = '',
description = '',
isToolbarVisible = true,
isContextView = false,
isLoading = false,
Expand Down Expand Up @@ -168,7 +172,12 @@ export const DataGridTable = ({
indexPattern,
}}
>
<div data-render-complete={!isLoading} data-shared-item="">
<div
data-render-complete={!isLoading}
data-shared-item=""
data-title={title}
data-description={description}
>
<EuiPanel hasBorder={false} hasShadow={false} paddingSize="s" color="transparent">
<EuiPanel paddingSize="s" style={{ height: '100%' }}>
{table}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
useDispatch,
useSelector,
} from '../../utils/state_management';
import { ResultStatus, SearchData } from '../utils/use_search';
import { ResultStatus, SearchData, useSearch } from '../utils/use_search';
import { IndexPatternField, opensearchFilters } from '../../../../../data/public';
import { DocViewFilterFn } from '../../doc_views/doc_views_types';
import { SortOrder } from '../../../saved_searches/types';
Expand Down Expand Up @@ -71,6 +71,7 @@ export const DiscoverTable = ({ history }: Props) => {
);

const { rows } = fetchState || {};
const { savedSearch } = useSearch(services);

useEffect(() => {
const subscription = data$.subscribe((next) => {
Expand Down Expand Up @@ -107,6 +108,8 @@ export const DiscoverTable = ({ history }: Props) => {
rows={rows}
displayTimeColumn={displayTimeColumn}
services={services}
title={savedSearch?.id ? savedSearch.title : ''}
description={savedSearch?.id ? savedSearch.description : ''}
/>
);
};
2 changes: 2 additions & 0 deletions src/plugins/discover/public/embeddable/search_embeddable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export interface SearchProps {
isLoading?: boolean;
displayTimeColumn?: boolean;
services: DiscoverServices;
title?: string;
}

interface SearchEmbeddableConfig {
Expand Down Expand Up @@ -226,6 +227,7 @@ export class SearchEmbeddable
inspectorAdapters: this.inspectorAdaptors,
rows: [],
description: this.savedSearch.description,
title: this.savedSearch.title,
services: this.services,
indexPattern,
isLoading: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export function SearchEmbeddableComponent({ searchProps }: SearchEmbeddableProps
displayTimeColumn: searchProps.displayTimeColumn,
services: searchProps.services,
totalHitCount: searchProps.totalHitCount,
title: searchProps.title,
description: searchProps.description,
} as DiscoverEmbeddableProps;

return (
Expand Down
3 changes: 2 additions & 1 deletion test/functional/apps/dashboard/dashboard_query_bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.dashboard.loadSavedDashboard('dashboard with filter');
});

it('causes panels to reload when refresh is clicked', async () => {
// https://github.com/opensearch-project/OpenSearch-Dashboards/issues/5116
it.skip('causes panels to reload when refresh is clicked', async () => {
await opensearchArchiver.unload('dashboard/current/data');

await queryBar.clickQuerySubmitButton();
Expand Down

0 comments on commit 1e94295

Please sign in to comment.