setIsExpanded(!isExpanded)}
+ onClick={handleExpanding}
iconType={isExpanded ? 'arrowDown' : 'arrowRight'}
aria-label="Next"
data-test-subj="docTableExpandToggleColumn"
@@ -156,16 +160,16 @@ export const TableRow = ({
columns={columns}
indexPattern={indexPattern}
onRemoveColumn={(columnName: string) => {
- onRemoveColumn(columnName);
- onClose();
+ onRemoveColumn?.(columnName);
+ onClose?.();
}}
onAddColumn={(columnName: string) => {
- onAddColumn(columnName);
- onClose();
+ onAddColumn?.(columnName);
+ onClose?.();
}}
filter={(mapping, value, mode) => {
- onFilter(mapping, value, mode);
- onClose();
+ onFilter?.(mapping, value, mode);
+ onClose?.();
}}
/>
diff --git a/src/plugins/discover/public/application/components/doc_views/context_app.tsx b/src/plugins/discover/public/application/components/doc_views/context_app.tsx
index c3a6da2d8cef..da06db6417b6 100644
--- a/src/plugins/discover/public/application/components/doc_views/context_app.tsx
+++ b/src/plugins/discover/public/application/components/doc_views/context_app.tsx
@@ -6,7 +6,7 @@
import React, { useMemo, useCallback } from 'react';
import { SurrDocType } from './context/api/context';
import { ActionBar } from './context/components/action_bar/action_bar';
-import { CONTEXT_STEP_SETTING, DOC_HIDE_TIME_COLUMN_SETTING } from '../../../../common';
+import { CONTEXT_STEP_SETTING } from '../../../../common';
import { DiscoverViewServices } from '../../../build_services';
import { useOpenSearchDashboards } from '../../../../../opensearch_dashboards_react/public';
import { LOADING_STATUS } from './context/utils/context_query_state';
@@ -77,11 +77,6 @@ export function ContextApp({
return [[indexPattern.timeFieldName!, SortDirection.desc]];
}, [indexPattern]);
- const displayTimeColumn = useMemo(
- () => !uiSettings.get(DOC_HIDE_TIME_COLUMN_SETTING, false) && indexPattern?.isTimeBased(),
- [indexPattern, uiSettings]
- );
-
return (
<>
{}}
sort={sort}
rows={rows}
- displayTimeColumn={displayTimeColumn}
isToolbarVisible={false}
isContextView={true}
/>
diff --git a/src/plugins/discover/public/application/view_components/canvas/discover_table.tsx b/src/plugins/discover/public/application/view_components/canvas/discover_table.tsx
index ccf82e4ccba0..0fb2f80b7960 100644
--- a/src/plugins/discover/public/application/view_components/canvas/discover_table.tsx
+++ b/src/plugins/discover/public/application/view_components/canvas/discover_table.tsx
@@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
-import React, { useCallback, useMemo } from 'react';
+import React, { useCallback } from 'react';
import { DiscoverViewServices } from '../../../build_services';
import { useOpenSearchDashboards } from '../../../../../opensearch_dashboards_react/public';
import { DataGridTable } from '../../components/data_grid/data_grid_table';
@@ -20,7 +20,6 @@ import {
import { IndexPatternField, opensearchFilters } from '../../../../../data/public';
import { DocViewFilterFn } from '../../doc_views/doc_views_types';
import { SortOrder } from '../../../saved_searches/types';
-import { DOC_HIDE_TIME_COLUMN_SETTING } from '../../../../common';
import { OpenSearchSearchHit } from '../../doc_views/doc_views_types';
import { popularizeField } from '../../helpers/popularize_field';
@@ -32,7 +31,6 @@ interface Props {
export const DiscoverTable = ({ rows, scrollToTop }: Props) => {
const { services } = useOpenSearchDashboards();
const {
- uiSettings,
data: {
query: { filterManager },
},
@@ -85,10 +83,6 @@ export const DiscoverTable = ({ rows, scrollToTop }: Props) => {
},
[filterManager, indexPattern]
);
- const displayTimeColumn = useMemo(
- () => !!(!uiSettings.get(DOC_HIDE_TIME_COLUMN_SETTING, false) && indexPattern?.isTimeBased()),
- [indexPattern, uiSettings]
- );
if (indexPattern === undefined) {
// TODO: handle better
@@ -112,7 +106,6 @@ export const DiscoverTable = ({ rows, scrollToTop }: Props) => {
onSort={onSetSort}
sort={sort}
rows={rows}
- displayTimeColumn={displayTimeColumn}
title={savedSearch?.id ? savedSearch.title : ''}
description={savedSearch?.id ? savedSearch.description : ''}
scrollToTop={scrollToTop}
diff --git a/test/functional/apps/dashboard/dashboard_time_picker.js b/test/functional/apps/dashboard/dashboard_time_picker.js
index e5da381ec06e..bc2add60a33f 100644
--- a/test/functional/apps/dashboard/dashboard_time_picker.js
+++ b/test/functional/apps/dashboard/dashboard_time_picker.js
@@ -67,15 +67,15 @@ export default function ({ getService, getPageObjects }) {
name: 'saved search',
fields: ['bytes', 'agent'],
});
- // Current data grid loads 100 rows per page by default with inspect button and time range
- await dashboardExpect.savedSearchRowCountFromLegacyTable(100);
+ // DefaultDiscoverTable loads 10 rows initially
+ await dashboardExpect.rowCountFromDefaultDiscoverTable(10);
// Set to time range with no data
await PageObjects.timePicker.setAbsoluteRange(
'Jan 1, 2000 @ 00:00:00.000',
'Jan 1, 2000 @ 01:00:00.000'
);
- await dashboardExpect.savedSearchRowCountFromLegacyTable(0);
+ await dashboardExpect.rowCountFromDefaultDiscoverTable(0);
});
it('Timepicker start, end, interval values are set by url', async () => {
diff --git a/test/functional/apps/home/_sample_data.ts b/test/functional/apps/home/_sample_data.ts
index a790a884ccbe..20419a4730f5 100644
--- a/test/functional/apps/home/_sample_data.ts
+++ b/test/functional/apps/home/_sample_data.ts
@@ -126,7 +126,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
log.debug('Checking area, bar and heatmap charts rendered');
await dashboardExpect.seriesElementCount(15);
log.debug('Checking saved searches rendered');
- await dashboardExpect.savedSearchRowCountFromLegacyTable(100);
+ await dashboardExpect.rowCountFromDefaultDiscoverTable(10);
log.debug('Checking input controls rendered');
await dashboardExpect.inputControlItemCount(3);
log.debug('Checking tag cloud rendered');
diff --git a/test/functional/services/dashboard/expectations.ts b/test/functional/services/dashboard/expectations.ts
index 266517045747..daae5b623694 100644
--- a/test/functional/services/dashboard/expectations.ts
+++ b/test/functional/services/dashboard/expectations.ts
@@ -240,14 +240,15 @@ export function DashboardExpectProvider({ getService, getPageObjects }: FtrProvi
});
}
- async savedSearchRowCountFromLegacyTable(expectedCount: number) {
- log.debug(`DashboardExpect.savedSearchRowCount(${expectedCount})`);
+ async rowCountFromDefaultDiscoverTable(expectedCount: number) {
+ log.debug(`DashboardExpect.rowCountFromDefaultDiscoverTable(${expectedCount})`);
+ // Rows have no identifiers but we can count using the identifiers of the first cells in each data row
await retry.try(async () => {
- const savedSearchRows = await testSubjects.findAll(
- 'docTableExpandToggleColumn',
+ const firstCells = await find.allByCssSelector(
+ 'td[data-test-subj="docTableExpandToggleColumn"]',
findTimeout
);
- expect(savedSearchRows.length).to.be(expectedCount);
+ expect(firstCells.length).to.be(expectedCount);
});
}
diff --git a/yarn.lock b/yarn.lock
index 21be973b2291..3a400259abdf 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3244,10 +3244,10 @@
resolved "https://registry.yarnpkg.com/@types/delete-empty/-/delete-empty-2.0.0.tgz#1647ae9e68f708a6ba778531af667ec55bc61964"
integrity sha512-sq+kwx8zA9BSugT9N+Jr8/uWjbHMZ+N/meJEzRyT3gmLq/WMtx/iSIpvdpmBUi/cvXl6Kzpvve8G2ESkabFwmg==
-"@types/dompurify@^2.3.3":
- version "2.4.0"
- resolved "https://registry.yarnpkg.com/@types/dompurify/-/dompurify-2.4.0.tgz#fd9706392a88e0e0e6d367f3588482d817df0ab9"
- integrity sha512-IDBwO5IZhrKvHFUl+clZxgf3hn2b/lU6H1KaBShPkQyGJUQ0xwebezIPSuiyGwfz1UzJWQl4M7BDxtHtCCPlTg==
+"@types/dompurify@^3.0.5":
+ version "3.0.5"
+ resolved "https://registry.yarnpkg.com/@types/dompurify/-/dompurify-3.0.5.tgz#02069a2fcb89a163bacf1a788f73cb415dd75cb7"
+ integrity sha512-1Wg0g3BtQF7sSb27fJQAKck1HECM6zV1EB66j8JH9i3LCjYabJa0FSdiSgsD5K/RbrsR0SiraKacLB+T8ZVYAg==
dependencies:
"@types/trusted-types" "*"
@@ -7711,10 +7711,10 @@ domhandler@^4.0, domhandler@^4.0.0, domhandler@^4.2.0, domhandler@^4.2.2, domhan
dependencies:
domelementtype "^2.2.0"
-dompurify@^2.4.1:
- version "2.4.1"
- resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.4.1.tgz#f9cb1a275fde9af6f2d0a2644ef648dd6847b631"
- integrity sha512-ewwFzHzrrneRjxzmK6oVz/rZn9VWspGFRDb4/rRtIsM1n36t9AKma/ye8syCpcw+XJ25kOK/hOG7t1j2I2yBqA==
+dompurify@^3.0.11:
+ version "3.0.11"
+ resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.0.11.tgz#c163f5816eaac6aeef35dae2b77fca0504564efe"
+ integrity sha512-Fan4uMuyB26gFV3ovPoEoQbxRRPfTu3CvImyZnhGq5fsIEO+gEFLp45ISFt+kQBWsK5ulDdT0oV28jS1UrwQLg==
domutils@1.5.1:
version "1.5.1"
|