diff --git a/x-pack/platform/plugins/shared/osquery/public/actions/unified_history_table.test.tsx b/x-pack/platform/plugins/shared/osquery/public/actions/unified_history_table.test.tsx index e291692179b3c..441249d8f5d40 100644 --- a/x-pack/platform/plugins/shared/osquery/public/actions/unified_history_table.test.tsx +++ b/x-pack/platform/plugins/shared/osquery/public/actions/unified_history_table.test.tsx @@ -249,6 +249,15 @@ describe('UnifiedHistoryTable', () => { expect(screen.getByText('Rule')).toBeInTheDocument(); }); + it('run by column shows Elastic for rule row', () => { + const row = createMockRuleRow(); + mockHistory({ data: [row] }); + + renderWithProviders(); + + expect(screen.getByText('Elastic')).toBeInTheDocument(); + }); + it('details button has correct href for navigation', () => { const row = createMockLiveRow({ actionId: 'action-42' }); mockHistory({ data: [row] }); @@ -374,14 +383,13 @@ describe('UnifiedHistoryTable', () => { expect(screen.getByText('20')).toBeInTheDocument(); }); - it('run by column shows em dash for scheduled row', () => { + it('run by column shows Elastic for scheduled row', () => { const row = createMockScheduledRow(); mockHistory({ data: [row] }); renderWithProviders(); - const dashes = screen.getAllByText('\u2014'); - expect(dashes.length).toBeGreaterThanOrEqual(1); + expect(screen.getByText('Elastic')).toBeInTheDocument(); }); it('play button is not available for scheduled rows', () => { diff --git a/x-pack/platform/plugins/shared/osquery/public/actions/unified_history_table.tsx b/x-pack/platform/plugins/shared/osquery/public/actions/unified_history_table.tsx index 5adb7203ae531..756475e82d690 100644 --- a/x-pack/platform/plugins/shared/osquery/public/actions/unified_history_table.tsx +++ b/x-pack/platform/plugins/shared/osquery/public/actions/unified_history_table.tsx @@ -446,8 +446,8 @@ const UnifiedHistoryTableComponent = () => { const renderRunByColumn = useCallback( (_: unknown, row: UnifiedHistoryRow) => { - if (!isLiveRow(row)) { - return <>{'\u2014'}; + if (!isLiveRow(row) || !row.userId) { + return <>{'Elastic'}; } return ( diff --git a/x-pack/platform/plugins/shared/osquery/public/saved_queries/saved_queries_dropdown.tsx b/x-pack/platform/plugins/shared/osquery/public/saved_queries/saved_queries_dropdown.tsx index bb54e21f60289..2de329c64071d 100644 --- a/x-pack/platform/plugins/shared/osquery/public/saved_queries/saved_queries_dropdown.tsx +++ b/x-pack/platform/plugins/shared/osquery/public/saved_queries/saved_queries_dropdown.tsx @@ -13,6 +13,7 @@ import { QUERIES_DROPDOWN_LABEL, QUERIES_DROPDOWN_SEARCH_FIELD_LABEL } from './c import { OsquerySchemaLink } from '../components/osquery_schema_link'; import { useOsquerySchema } from '../common/hooks/use_osquery_schema'; import { useSavedQueries } from './use_saved_queries'; +import { useIsExperimentalFeatureEnabled } from '../common/experimental_features_context'; import type { SavedQuerySO } from '../routes/saved_queries/list'; const euiCodeBlockCss = { @@ -44,6 +45,7 @@ const SavedQueriesDropdownComponent: React.FC = ({ onChange, }) => { const { osqueryVersion } = useOsquerySchema(); + const isHistoryReworkEnabled = useIsExperimentalFeatureEnabled('queryHistoryRework'); const savedQueryId = useWatch({ name: 'savedQueryId' }); const context = useFormContext(); const { errors } = context.formState; @@ -94,12 +96,14 @@ const SavedQueriesDropdownComponent: React.FC = ({
{value.description}
- - {value.query.split('\n').join(' ')} - + {!isHistoryReworkEnabled && ( + + {value.query.split('\n').join(' ')} + + )} ), - [] + [isHistoryReworkEnabled] ); useEffect(() => { @@ -138,7 +142,7 @@ const SavedQueriesDropdownComponent: React.FC = ({ selectedOptions={selectedOptions} onChange={handleSavedQueryChange} renderOption={renderOption} - rowHeight={110} + rowHeight={isHistoryReworkEnabled ? 55 : 110} /> );