Skip to content

Commit

Permalink
Merge pull request #2 from michaelolo24/update-discover-saved-search-…
Browse files Browse the repository at this point in the history
…work

Update discover saved search work
  • Loading branch information
logeekal authored Sep 26, 2023
2 parents 6993479 + a393ff3 commit e99dc7d
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import { i18n } from '@kbn/i18n';
export const DISCOVER_SEARCH_SAVE_ERROR_TITLE = i18n.translate(
'xpack.securitySolution.timelines.discoverInTimeline.save_saved_search_error',
{
defaultMessage: 'Error while saving the Discover Saved Search',
defaultMessage: 'Error while saving the Discover search',
}
);

export const DISCOVER_SEARCH_SAVE_ERROR_UNKNOWN = i18n.translate(
'xpack.securitySolution.timelines.discoverInTimeline.save_saved_search_unknown_error',
{
defaultMessage: 'Unknown Error occurred while saving Discover Search',
defaultMessage: 'Unknown error occurred while saving Discover search',
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -1630,7 +1630,7 @@ export const mockTimelineResults: OpenTimelineResult[] = [
noteIds: ['noteId4'],
notes: [
{
note: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Magna ac placerat vestibulum lectus. Morbi tincidunt ornare massa eget egestas purus. Quis various quam quisque id diam. Nulla pellentesque dignissim enim sit amet.',
note: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Magna ac placerat vestibulum lectus. Morbi tincidunt ornare massa eget egestas purus. Quis varius quam quisque id diam. Nulla pellentesque dignissim enim sit amet.',
savedObjectId: 'noteId1',
updated: 1553700738 * 1000,
updatedBy: 'alice',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { useShallowEqualSelector } from '../../../../common/hooks/use_selector';
import { timelineDefaults } from '../../../store/timeline/defaults';
import { savedSearchComparator } from './utils';
import { setIsDiscoverSavedSearchLoaded } from '../../../store/timeline/actions';
import { GET_TIMELINE_DISCOVER_SAVED_SEARCH_TITLE } from './translations';

const HideSearchSessionIndicatorBreadcrumbIcon = createGlobalStyle`
[data-test-subj='searchSessionIndicator'] {
Expand Down Expand Up @@ -154,7 +155,7 @@ export const DiscoverTabContent: FC<DiscoverTabContentProps> = ({ timelineId })
refreshInterval: discoverStateContainer.current?.globalState.get()?.refreshInterval,
breakdownField: discoverStateContainer.current?.appState.getState().breakdownField,
rowsPerPage: discoverStateContainer.current?.appState.getState().rowsPerPage,
title: `Saved Search for timeline - ${title}`,
title: GET_TIMELINE_DISCOVER_SAVED_SEARCH_TITLE(title),
description,
};
}, [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { i18n } from '@kbn/i18n';

export const GET_TIMELINE_DISCOVER_SAVED_SEARCH_TITLE = (title: string) =>
i18n.translate('xpack.securitySolution.timelines.discoverInTimeline.savedSearchTitle', {
defaultMessage: 'Saved search for timeline - {title}',
values: { title },
});
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import {
openTimelineFromSettings,
} from '../../../../tasks/timeline';
import { LOADING_INDICATOR } from '../../../../screens/security_header';
import { enableDiscoverSQL } from '../../../../tasks/api_calls/kibana_advanced_settings';
import { STACK_MANAGEMENT_PAGE } from '../../../../screens/kibana_navigation';
import {
GET_SAVED_OBJECTS_TAGS_OPTION,
Expand Down Expand Up @@ -109,7 +108,6 @@ describe(
}
});
login();
enableDiscoverSQL();
visit(ALERTS_URL);
createNewTimeline();
gotToDiscoverTab();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,3 @@ export const disableRelatedIntegrations = () => {
export const disableExpandableFlyout = () => {
setKibanaSetting(ENABLE_EXPANDABLE_FLYOUT_SETTING, false);
};

export const enableDiscoverSQL = () => {
setKibanaSetting(ADVANCED_SETTINGS.DISCOVER_SQL, true);
};

export const disableDiscoverSQL = () => {
setKibanaSetting(ADVANCED_SETTINGS.DISCOVER_SQL, false);
};

0 comments on commit e99dc7d

Please sign in to comment.