-
- Help drive future improvements by{' '}
-
- providing feedback
- {' '}
- about your experience.
-
-
- ),
- {
- title: i18n.translate('discover.localMenu.newTableConfirmModalTitle', {
- defaultMessage: 'Share your thoughts on the latest Discover features',
- }),
- cancelButtonText: 'Cancel',
- confirmButtonText: 'Turn off new features',
- defaultFocusedButton: 'confirm',
- }
- );
-
- if (confirmed) {
- setNewDiscoverSetting(false, storage);
- window.location.reload();
- }
- } else {
- // Save the new setting to localStorage
- setNewDiscoverSetting(true, storage);
- window.location.reload();
- }
- },
- iconType: isNewDiscover ? 'editorUndo' : 'cheer',
- };
-
return [
- newTable,
newSearch,
...(capabilities.discover?.save ? [saveSearch] : []),
openSearch,
diff --git a/src/plugins/discover/public/application/components/utils/local_storage.ts b/src/plugins/discover/public/application/components/utils/local_storage.ts
index 5e812de8e97..68bba0aafc9 100644
--- a/src/plugins/discover/public/application/components/utils/local_storage.ts
+++ b/src/plugins/discover/public/application/components/utils/local_storage.ts
@@ -9,9 +9,9 @@ export const NEW_DISCOVER_KEY = 'discover:newExpereince';
export const getNewDiscoverSetting = (storage: Storage): boolean => {
const storedValue = storage.get(NEW_DISCOVER_KEY);
- return storedValue !== null ? JSON.parse(storedValue) : false;
+ return storedValue !== null ? storedValue : false;
};
export const setNewDiscoverSetting = (value: boolean, storage: Storage) => {
- storage.set(NEW_DISCOVER_KEY, JSON.stringify(value));
+ storage.set(NEW_DISCOVER_KEY, value);
};
diff --git a/src/plugins/discover/public/application/view_components/canvas/discover_canvas.scss b/src/plugins/discover/public/application/view_components/canvas/discover_canvas.scss
index 36408bd8836..2c2c8dfe8eb 100644
--- a/src/plugins/discover/public/application/view_components/canvas/discover_canvas.scss
+++ b/src/plugins/discover/public/application/view_components/canvas/discover_canvas.scss
@@ -9,6 +9,13 @@
&_results {
margin-left: $euiSizeM;
+ position: relative;
+ }
+
+ &_options {
+ position: absolute;
+ top: 0;
+ right: 0;
}
}
diff --git a/src/plugins/discover/public/application/view_components/canvas/index.tsx b/src/plugins/discover/public/application/view_components/canvas/index.tsx
index 1c2681995f9..ab34878750a 100644
--- a/src/plugins/discover/public/application/view_components/canvas/index.tsx
+++ b/src/plugins/discover/public/application/view_components/canvas/index.tsx
@@ -4,7 +4,7 @@
*/
import React, { useEffect, useState, useRef, useCallback } from 'react';
-import { EuiPanel } from '@elastic/eui';
+import { EuiButtonIcon, EuiContextMenu, EuiPanel, EuiPopover, EuiSwitch } from '@elastic/eui';
import { TopNav } from './top_nav';
import { ViewProps } from '../../../../../data_explorer/public';
import { DiscoverTable } from './discover_table';
@@ -21,13 +21,14 @@ import { filterColumns } from '../utils/filter_columns';
import { DEFAULT_COLUMNS_SETTING, MODIFY_COLUMNS_ON_SWITCH } from '../../../../common';
import { OpenSearchSearchHit } from '../../../application/doc_views/doc_views_types';
import './discover_canvas.scss';
+import { getNewDiscoverSetting, setNewDiscoverSetting } from '../../components/utils/local_storage';
// eslint-disable-next-line import/no-default-export
export default function DiscoverCanvas({ setHeaderActionMenu, history }: ViewProps) {
const panelRef = useRef