- }
-
-
+
-
-
+ = 0 ? newDocCount : ''}
/>
-
+
-
+
{isSuccessor ? (
- ) => {
if (ev.type === 'click') {
@@ -175,7 +176,7 @@ export const DiscoverField = ({
defaultMessage: 'Remove field from table',
})}
>
- ) => {
diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_bucket.tsx b/src/plugins/discover/public/application/components/sidebar/discover_field_bucket.tsx
index 6a4dbe295e50..216c8502c03e 100644
--- a/src/plugins/discover/public/application/components/sidebar/discover_field_bucket.tsx
+++ b/src/plugins/discover/public/application/components/sidebar/discover_field_bucket.tsx
@@ -29,7 +29,7 @@
*/
import React from 'react';
-import { EuiText, EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui';
+import { EuiText, EuiSmallButtonIcon, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui';
import { i18n } from '@osd/i18n';
import { StringFieldProgressBar } from './string_progress_bar';
import { Bucket } from './types';
@@ -91,7 +91,7 @@ export function DiscoverFieldBucket({ field, bucket, onAddFilter }: Props) {
{field.filterable && (
- onAddFilter(field, bucket.value, '+')}
@@ -107,7 +107,7 @@ export function DiscoverFieldBucket({ field, bucket, onAddFilter }: Props) {
}}
className={'euiButtonIcon--auto'}
/>
- onAddFilter(field, bucket.value, '-')}
diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_search.tsx b/src/plugins/discover/public/application/components/sidebar/discover_field_search.tsx
index ec4bc5f2896d..b009864411e0 100644
--- a/src/plugins/discover/public/application/components/sidebar/discover_field_search.tsx
+++ b/src/plugins/discover/public/application/components/sidebar/discover_field_search.tsx
@@ -31,21 +31,21 @@
import React, { OptionHTMLAttributes, ReactNode, useState } from 'react';
import { i18n } from '@osd/i18n';
import {
- EuiFieldSearch,
+ EuiCompressedFieldSearch,
EuiFlexGroup,
EuiFlexItem,
EuiPopover,
EuiPopoverFooter,
EuiPopoverTitle,
EuiSelect,
- EuiSwitch,
+ EuiCompressedSwitch,
EuiSwitchEvent,
EuiForm,
EuiFormRow,
EuiButtonGroup,
EuiOutsideClickDetector,
EuiPanel,
- EuiFilterButton,
+ EuiSmallFilterButton,
EuiFilterGroup,
} from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
@@ -244,7 +244,7 @@ export function DiscoverFieldSearch({ onChange, value, types }: Props) {
{}} isDisabled={!isPopoverOpen}>
- 0}
@@ -282,7 +282,7 @@ export function DiscoverFieldSearch({ onChange, value, types }: Props) {
id="discover.fieldChooser.fieldFilterFacetButtonLabel"
defaultMessage="Filter by type"
/>
-
+
}
>
@@ -292,7 +292,7 @@ export function DiscoverFieldSearch({ onChange, value, types }: Props) {
{selectionPanel}
-
-
{title}
-
+
{expanded && (
void;
@@ -43,7 +43,7 @@ export function DocViewTableRowBtnCollapse({ onClick, isCollapsed }: Props) {
});
return (
-
-
-
-
}
>
-
-
@@ -60,7 +60,7 @@ exports[`render 1`] = `
id="discover.topNav.openSearchPanel.manageSearchesButtonLabel"
values={Object {}}
/>
-
+
diff --git a/src/plugins/discover/public/application/components/top_nav/open_search_panel.tsx b/src/plugins/discover/public/application/components/top_nav/open_search_panel.tsx
index 4e7af4cda6fb..1bc4da9a08cf 100644
--- a/src/plugins/discover/public/application/components/top_nav/open_search_panel.tsx
+++ b/src/plugins/discover/public/application/components/top_nav/open_search_panel.tsx
@@ -33,7 +33,7 @@ import rison from 'rison-node';
import { i18n } from '@osd/i18n';
import { FormattedMessage } from '@osd/i18n/react';
import {
- EuiButtonEmpty,
+ EuiSmallButtonEmpty,
EuiFlexGroup,
EuiFlexItem,
EuiFlyout,
@@ -100,8 +100,7 @@ export function OpenSearchPanel({ onClose, makeUrl }: Props) {
- {/* eslint-disable-next-line @elastic/eui/href-or-on-click */}
-
-
+
diff --git a/src/plugins/discover/public/application/components/uninitialized/uninitialized.tsx b/src/plugins/discover/public/application/components/uninitialized/uninitialized.tsx
index 9cc47b034d1e..0cac34828255 100644
--- a/src/plugins/discover/public/application/components/uninitialized/uninitialized.tsx
+++ b/src/plugins/discover/public/application/components/uninitialized/uninitialized.tsx
@@ -31,7 +31,7 @@
import React from 'react';
import { FormattedMessage, I18nProvider } from '@osd/i18n/react';
-import { EuiButton, EuiEmptyPrompt, EuiPage, EuiPageBody, EuiPageContent } from '@elastic/eui';
+import { EuiSmallButton, EuiEmptyPrompt, EuiPage, EuiPageBody, EuiPageContent } from '@elastic/eui';
interface Props {
onRefresh: () => void;
@@ -62,12 +62,12 @@ export const DiscoverUninitialized = ({ onRefresh }: Props) => {
}
actions={
-
+
-
+
}
/>
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 9511448f025a..5c5fcb358600 100644
--- a/src/plugins/discover/public/application/view_components/canvas/index.tsx
+++ b/src/plugins/discover/public/application/view_components/canvas/index.tsx
@@ -5,7 +5,13 @@
import { i18n } from '@osd/i18n';
import React, { useEffect, useState, useRef, useCallback } from 'react';
-import { EuiButtonIcon, EuiContextMenu, EuiPanel, EuiPopover, EuiSwitch } from '@elastic/eui';
+import {
+ EuiButtonIcon,
+ EuiContextMenu,
+ EuiPanel,
+ EuiPopover,
+ EuiCompressedSwitch,
+} from '@elastic/eui';
import { TopNav } from './top_nav';
import { ViewProps } from '../../../../../data_explorer/public';
import { DiscoverTable } from './discover_table';
@@ -136,7 +142,7 @@ export default function DiscoverCanvas({ setHeaderActionMenu, history }: ViewPro
title: 'Options',
content: (
- = ({
);
const button = (
-
-
+
}
isOpen={isCreateMenuOpen}
closePopover={closeCreateMenu}
diff --git a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_modal.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_modal.tsx
index e62644bd6a4d..1f1e97e83bf9 100644
--- a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_modal.tsx
+++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_modal.tsx
@@ -31,11 +31,11 @@
import React, { Component } from 'react';
import {
- EuiFormRow,
- EuiFieldText,
- EuiButton,
- EuiSwitch,
- EuiButtonEmpty,
+ EuiCompressedFormRow,
+ EuiCompressedFieldText,
+ EuiSmallButton,
+ EuiCompressedSwitch,
+ EuiSmallButtonEmpty,
EuiModalHeader,
EuiModalFooter,
EuiModalBody,
@@ -95,8 +95,8 @@ export class CustomizePanelModal extends Component {
-
-
+ {
}
onChange={this.onHideTitleToggle}
/>
-
-
+ {
}
)}
>
- {
}
)}
append={
- {
id="embeddableApi.customizePanel.modal.optionsMenuForm.resetCustomDashboardButtonLabel"
defaultMessage="Reset"
/>
-
+
}
/>
-
+
- this.props.cancel()}>
+ this.props.cancel()}>
-
+
-
+
-
+
);
diff --git a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_title_form.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_title_form.tsx
index eb3abc40b8b5..b3c05724ca9c 100644
--- a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_title_form.tsx
+++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_title_form.tsx
@@ -30,7 +30,7 @@
import React, { ChangeEvent } from 'react';
-import { EuiButtonEmpty, EuiFieldText, EuiFormRow } from '@elastic/eui';
+import { EuiSmallButtonEmpty, EuiCompressedFieldText, EuiCompressedFormRow } from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
import { i18n } from '@osd/i18n';
@@ -51,7 +51,7 @@ export function CustomizeTitleForm({
return (
-
-
-
+
-
+
-
+
);
}
diff --git a/src/plugins/embeddable/public/lib/panel/panel_header/panel_options_menu.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_options_menu.tsx
index d9582214034e..e45b18eba18a 100644
--- a/src/plugins/embeddable/public/lib/panel/panel_header/panel_options_menu.tsx
+++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_options_menu.tsx
@@ -32,7 +32,7 @@ import { i18n } from '@osd/i18n';
import React from 'react';
import {
- EuiButtonIcon,
+ EuiSmallButtonIcon,
EuiContextMenu,
EuiContextMenuPanelDescriptor,
EuiPopover,
@@ -101,7 +101,7 @@ export class PanelOptionsMenu extends React.Component {
-
-
+ this.setState({ message: e.target.value })}
/>
-
+
- Cancel
+ Cancel
- {
if (this.state.message) {
@@ -88,7 +88,7 @@ export class GetMessageModal extends Component {
fill
>
Done
-
+
);
diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card.tsx
index 7fb5a6195f6d..31bf4e0d6c6b 100644
--- a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card.tsx
+++ b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card.tsx
@@ -29,10 +29,10 @@
*/
import React from 'react';
-import { EuiCard, EuiFlexItem, EuiFlexGroup, EuiFormRow } from '@elastic/eui';
+import { EuiCard, EuiFlexItem, EuiFlexGroup, EuiCompressedFormRow } from '@elastic/eui';
import { Subscription } from 'rxjs';
-import { EuiButton } from '@elastic/eui';
+import { EuiSmallButton } from '@elastic/eui';
import * as Rx from 'rxjs';
import { UiActionsStart } from '../../../../../../ui_actions/public';
import { ContactCardEmbeddable, CONTACT_USER_TRIGGER } from './contact_card_embeddable';
@@ -97,11 +97,11 @@ export class ContactCardEmbeddableComponent extends React.Component (
-
-
+ {`Contact ${this.state.firstName}`}
-
+ >{`Contact ${this.state.firstName}`}
+
);
diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_initializer.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_initializer.tsx
index 28bf1c19a84b..3f7f12a893c5 100644
--- a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_initializer.tsx
+++ b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_initializer.tsx
@@ -30,14 +30,14 @@
import {
EuiForm,
- EuiFormRow,
- EuiFieldText,
+ EuiCompressedFormRow,
+ EuiCompressedFieldText,
EuiModalHeader,
EuiModalHeaderTitle,
EuiModalBody,
- EuiButton,
+ EuiSmallButton,
EuiModalFooter,
- EuiButtonEmpty,
+ EuiSmallButtonEmpty,
} from '@elastic/eui';
import React, { Component } from 'react';
@@ -66,29 +66,29 @@ export class ContactCardInitializer extends Component
-
-
+ this.setState({ firstName: e.target.value })}
/>
-
+
-
-
+ this.setState({ lastName: e.target.value })}
/>
-
+
- Cancel
+ Cancel
- {
if (this.state.firstName) {
@@ -101,7 +101,7 @@ export class ContactCardInitializer extends Component
Create
-
+
);
diff --git a/src/plugins/home/public/application/components/__snapshots__/sample_data_view_data_button.test.js.snap b/src/plugins/home/public/application/components/__snapshots__/sample_data_view_data_button.test.js.snap
index 5121818de049..5bcc020fe153 100644
--- a/src/plugins/home/public/application/components/__snapshots__/sample_data_view_data_button.test.js.snap
+++ b/src/plugins/home/public/application/components/__snapshots__/sample_data_view_data_button.test.js.snap
@@ -4,14 +4,14 @@ exports[`should render popover when appLinks is not empty 1`] = `
View data
-
+
}
closePopover={[Function]}
data-test-subj="launchSampleDataSetecommerce"
@@ -57,11 +57,11 @@ exports[`should render popover when appLinks is not empty 1`] = `
`;
exports[`should render simple button when appLinks is empty 1`] = `
-
View data
-
+
`;
diff --git a/src/plugins/home/public/application/components/_add_data.scss b/src/plugins/home/public/application/components/_add_data.scss
index 28805ab08830..114a70cc03d6 100644
--- a/src/plugins/home/public/application/components/_add_data.scss
+++ b/src/plugins/home/public/application/components/_add_data.scss
@@ -28,7 +28,7 @@
* under the License.
*/
-// Accounting for no `flush="both"` prop on EuiButtonEmpty
+// Accounting for no `flush="both"` prop on EuiSmallButtonEmpty
.homDataAdd__actionButton {
margin-right: 0;
}
diff --git a/src/plugins/home/public/application/components/homepage/homepage.tsx b/src/plugins/home/public/application/components/homepage/homepage.tsx
index aca9e9d9374b..c954f3787aa5 100644
--- a/src/plugins/home/public/application/components/homepage/homepage.tsx
+++ b/src/plugins/home/public/application/components/homepage/homepage.tsx
@@ -10,7 +10,7 @@ import { i18n } from '@osd/i18n';
import { FormattedMessage } from '@osd/i18n/react';
import {
EuiPageTemplate,
- EuiButtonEmpty,
+ EuiSmallButtonEmpty,
EuiHorizontalRule,
EuiFlexGroup,
EuiFlexItem,
@@ -232,22 +232,22 @@ export const Homepage = () => {
});
const sideItems: React.ReactNode[] = [
-
- ,
-
+ ,
+
- ,
- ,
+
- ,
+ ,
];
return (
diff --git a/src/plugins/home/public/application/components/new_theme_modal.tsx b/src/plugins/home/public/application/components/new_theme_modal.tsx
index e1520e3b67b1..e36dfa24f8b5 100644
--- a/src/plugins/home/public/application/components/new_theme_modal.tsx
+++ b/src/plugins/home/public/application/components/new_theme_modal.tsx
@@ -5,7 +5,7 @@
import React, { FC } from 'react';
import {
- EuiButton,
+ EuiSmallButton,
EuiFlexGroup,
EuiFlexItem,
EuiImage,
@@ -91,9 +91,9 @@ export const NewThemeModal: FC = ({ addBasePath, onClose }) => {
-
+
-
+
);
diff --git a/src/plugins/home/public/application/components/sample_data/index.tsx b/src/plugins/home/public/application/components/sample_data/index.tsx
index d8f92926294e..070c223cf878 100644
--- a/src/plugins/home/public/application/components/sample_data/index.tsx
+++ b/src/plugins/home/public/application/components/sample_data/index.tsx
@@ -38,8 +38,8 @@ import React from 'react';
import {
// @ts-ignore
EuiCard,
- EuiButton,
- EuiButtonEmpty,
+ EuiSmallButton,
+ EuiSmallButtonEmpty,
} from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
import { getServices } from '../../opensearch_dashboards_services';
@@ -72,16 +72,16 @@ export function SampleDataCard({ urlBasePath, onDecline, onConfirm }: Props) {
}
footer={
}
/>
diff --git a/src/plugins/home/public/application/components/sample_data_set_card.js b/src/plugins/home/public/application/components/sample_data_set_card.js
index 086484fa12c3..8e6e2138ee1e 100644
--- a/src/plugins/home/public/application/components/sample_data_set_card.js
+++ b/src/plugins/home/public/application/components/sample_data_set_card.js
@@ -32,8 +32,8 @@ import React from 'react';
import PropTypes from 'prop-types';
import {
EuiCard,
- EuiButton,
- EuiButtonEmpty,
+ EuiSmallButton,
+ EuiSmallButtonEmpty,
EuiFlexGroup,
EuiFlexItem,
EuiToolTip,
@@ -79,7 +79,7 @@ export class SampleDataSetCard extends React.Component {
return (
-
)}
-
+
-
)}
-
+
);
@@ -182,7 +182,7 @@ export class SampleDataSetCard extends React.Component {
}
>
-
-
+
diff --git a/src/plugins/home/public/application/components/sample_data_view_data_button.js b/src/plugins/home/public/application/components/sample_data_view_data_button.js
index 875917aa454d..acd78b7fb3b6 100644
--- a/src/plugins/home/public/application/components/sample_data_view_data_button.js
+++ b/src/plugins/home/public/application/components/sample_data_view_data_button.js
@@ -30,7 +30,7 @@
import React from 'react';
import PropTypes from 'prop-types';
-import { EuiButton, EuiContextMenu, EuiIcon, EuiPopover } from '@elastic/eui';
+import { EuiSmallButton, EuiContextMenu, EuiIcon, EuiPopover } from '@elastic/eui';
import { i18n } from '@osd/i18n';
import { getServices } from '../opensearch_dashboards_services';
@@ -73,13 +73,13 @@ export class SampleDataViewDataButton extends React.Component {
if (this.props.appLinks.length === 0) {
return (
-
{viewDataButtonLabel}
-
+
);
}
@@ -108,14 +108,14 @@ export class SampleDataViewDataButton extends React.Component {
},
];
const popoverButton = (
-
{viewDataButtonLabel}
-
+
);
return (
-
launch myapp
-
+
diff --git a/src/plugins/home/public/application/components/tutorial/__snapshots__/instruction_set.test.js.snap b/src/plugins/home/public/application/components/tutorial/__snapshots__/instruction_set.test.js.snap
index a9f9823047c0..a44bf6af01b7 100644
--- a/src/plugins/home/public/application/components/tutorial/__snapshots__/instruction_set.test.js.snap
+++ b/src/plugins/home/public/application/components/tutorial/__snapshots__/instruction_set.test.js.snap
@@ -162,12 +162,12 @@ exports[`statusCheckState checking status 1`] = `
-
custom btn label
-
+
-
custom btn label
-
+
-
custom btn label
-
+
-
custom btn label
-
+
-
custom btn label
-
+
-
-
+
-
Load OpenSearch Dashboards objects
-
+
-
-
-
-
-
+
+
+
+
+
@@ -465,13 +473,13 @@ exports[`bulkCreate should display success message when bulkCreate is successful
-
Load OpenSearch Dashboards objects
-
+
-
-
-
-
-
+
+
+
+
+
@@ -682,13 +698,13 @@ exports[`renders 1`] = `
-
Load OpenSearch Dashboards objects
-
+
-
+
{label}
-
+
diff --git a/src/plugins/home/public/application/components/tutorial/instruction_set.js b/src/plugins/home/public/application/components/tutorial/instruction_set.js
index dc4cf40c3802..cccd7b981543 100644
--- a/src/plugins/home/public/application/components/tutorial/instruction_set.js
+++ b/src/plugins/home/public/application/components/tutorial/instruction_set.js
@@ -41,9 +41,9 @@ import {
EuiSteps,
EuiFlexGroup,
EuiFlexItem,
- EuiButton,
+ EuiSmallButton,
EuiCallOut,
- EuiButtonEmpty,
+ EuiSmallButtonEmpty,
EuiTitle,
} from '@elastic/eui';
import * as StatusCheckStates from './status_check_states';
@@ -159,7 +159,7 @@ class InstructionSetUi extends React.Component {
-
@@ -169,7 +169,7 @@ class InstructionSetUi extends React.Component {
defaultMessage="Check status"
/>
)}
-
+
@@ -232,7 +232,7 @@ class InstructionSetUi extends React.Component {
defaultMessage: 'toggle command parameters visibility',
});
paramsVisibilityToggle = (
-
-
+
);
}
diff --git a/src/plugins/home/public/application/components/tutorial/introduction.js b/src/plugins/home/public/application/components/tutorial/introduction.js
index f66828039296..6fd6f9ce7e6f 100644
--- a/src/plugins/home/public/application/components/tutorial/introduction.js
+++ b/src/plugins/home/public/application/components/tutorial/introduction.js
@@ -37,7 +37,7 @@ import {
EuiFlexGroup,
EuiSpacer,
EuiImage,
- EuiButton,
+ EuiSmallButton,
EuiIcon,
EuiBetaBadge,
} from '@elastic/eui';
@@ -74,12 +74,12 @@ function IntroductionUI({
exportedFields = (
-
+
-
+
);
}
diff --git a/src/plugins/home/public/application/components/tutorial/saved_objects_installer.js b/src/plugins/home/public/application/components/tutorial/saved_objects_installer.js
index f93d13f649d9..da91381b6c3a 100644
--- a/src/plugins/home/public/application/components/tutorial/saved_objects_installer.js
+++ b/src/plugins/home/public/application/components/tutorial/saved_objects_installer.js
@@ -40,7 +40,7 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiText,
- EuiButton,
+ EuiSmallButton,
EuiSpacer,
EuiCallOut,
} from '@elastic/eui';
@@ -199,13 +199,13 @@ Click 'Confirm overwrite' to import and overwrite existing objects. Any changes
-
{this.state.buttonLabel}
-
+
diff --git a/src/plugins/index_pattern_management/public/components/create_button/create_button.tsx b/src/plugins/index_pattern_management/public/components/create_button/create_button.tsx
index a9e16ef51255..887b40190e30 100644
--- a/src/plugins/index_pattern_management/public/components/create_button/create_button.tsx
+++ b/src/plugins/index_pattern_management/public/components/create_button/create_button.tsx
@@ -32,6 +32,7 @@ import React, { Component, Fragment } from 'react';
import {
EuiBadge,
+ EuiSmallButton,
EuiButton,
EuiContextMenuItem,
EuiContextMenuPanel,
@@ -72,14 +73,14 @@ export class CreateButton extends Component {
if (options.length === 1) {
return (
-
{children}
-
+
);
}
diff --git a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/header.tsx b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/header.tsx
index b62aad739602..e676ffa328f2 100644
--- a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/header.tsx
+++ b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/header.tsx
@@ -6,7 +6,7 @@
import React, { Fragment, useState } from 'react';
import {
- EuiButton,
+ EuiSmallButton,
EuiFlexGroup,
EuiFlexItem,
EuiRadio,
@@ -212,7 +212,7 @@ export const Header: React.FC = (props: HeaderProps) => {
- = (props: HeaderProps) => {
id="indexPatternManagement.createIndexPattern.step.nextStepButton"
defaultMessage="Next step"
/>
-
+
diff --git a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_index_pattern/components/header/__snapshots__/header.test.tsx.snap b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_index_pattern/components/header/__snapshots__/header.test.tsx.snap
index 35804208c243..84841ecf6ba0 100644
--- a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_index_pattern/components/header/__snapshots__/header.test.tsx.snap
+++ b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_index_pattern/components/header/__snapshots__/header.test.tsx.snap
@@ -26,9 +26,9 @@ exports[`Header should mark the input as invalid 1`] = `
-
-
-
+
-
-
-
-
+
+
@@ -143,9 +143,9 @@ exports[`Header should render normally 1`] = `
-
-
-
+
-
-
-
-
+
+
diff --git a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_index_pattern/components/header/header.tsx b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_index_pattern/components/header/header.tsx
index 7c83d4209adb..ee3b2abe06b1 100644
--- a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_index_pattern/components/header/header.tsx
+++ b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_index_pattern/components/header/header.tsx
@@ -36,12 +36,12 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiSpacer,
- EuiButton,
+ EuiSmallButton,
EuiForm,
- EuiFormRow,
- EuiFieldText,
+ EuiCompressedFormRow,
+ EuiCompressedFieldText,
EuiSwitchEvent,
- EuiSwitch,
+ EuiCompressedSwitch,
} from '@elastic/eui';
import { i18n } from '@osd/i18n';
@@ -120,8 +120,8 @@ export const Header: React.FC = ({
onQueryChanged
)}
{showSystemIndices ? (
-
-
+ = ({
onChange={onChangeIncludingSystemIndices}
data-test-subj="showSystemAndHiddenIndices"
/>
-
+
) : null}
-
-
+ = ({
id="indexPatternManagement.createIndexPattern.step.nextStepButton"
defaultMessage="Next step"
/>
-
-
+
+
@@ -167,7 +167,7 @@ const renderIndexPatternInput = (
onQueryChanged: (e: React.ChangeEvent) => void
) => {
return (
-
}
>
-
-
+
);
};
@@ -221,7 +221,7 @@ const renderDataSourceAndIndexPatternInput = (
return (
-
-
-
+
{`.`}
diff --git a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.tsx b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.tsx
index 3853574f0ab7..48f748c03b7a 100644
--- a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.tsx
+++ b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.tsx
@@ -35,7 +35,7 @@ import {
EuiSwitchEvent,
EuiFlexGroup,
EuiFlexItem,
- EuiButtonEmpty,
+ EuiSmallButtonEmpty,
} from '@elastic/eui';
import { i18n } from '@osd/i18n';
import { FormattedMessage } from '@osd/i18n/react';
@@ -300,12 +300,12 @@ export class StepIndexPattern extends Component
-
+
-
+
);
diff --git a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/components/action_buttons/action_buttons.tsx b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/components/action_buttons/action_buttons.tsx
index baedecfbee01..f080e61dace7 100644
--- a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/components/action_buttons/action_buttons.tsx
+++ b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/components/action_buttons/action_buttons.tsx
@@ -30,7 +30,7 @@
import React from 'react';
-import { EuiFlexGroup, EuiFlexItem, EuiButton, EuiButtonEmpty } from '@elastic/eui';
+import { EuiFlexGroup, EuiFlexItem, EuiSmallButton, EuiSmallButtonEmpty } from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
@@ -45,15 +45,15 @@ export const ActionButtons = ({
}) => (
-
+
-
+
-
-
+
);
diff --git a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/components/advanced_options/__snapshots__/advanced_options.test.tsx.snap b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/components/advanced_options/__snapshots__/advanced_options.test.tsx.snap
index 6e1bf3116537..e96e9c87cacd 100644
--- a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/components/advanced_options/__snapshots__/advanced_options.test.tsx.snap
+++ b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/components/advanced_options/__snapshots__/advanced_options.test.tsx.snap
@@ -2,7 +2,7 @@
exports[`AdvancedOptions should hide if not showing 1`] = `
-
@@ -11,7 +11,7 @@ exports[`AdvancedOptions should hide if not showing 1`] = `
id="indexPatternManagement.createIndexPattern.stepTime.options.showButton"
values={Object {}}
/>
-
+
@@ -20,7 +20,7 @@ exports[`AdvancedOptions should hide if not showing 1`] = `
exports[`AdvancedOptions should render normally 1`] = `
-
@@ -29,14 +29,14 @@ exports[`AdvancedOptions should render normally 1`] = `
id="indexPatternManagement.createIndexPattern.stepTime.options.hideButton"
values={Object {}}
/>
-
+
-
-
-
+
`;
diff --git a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/components/advanced_options/advanced_options.tsx b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/components/advanced_options/advanced_options.tsx
index d1e7bc5c6b44..779b957f819d 100644
--- a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/components/advanced_options/advanced_options.tsx
+++ b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/components/advanced_options/advanced_options.tsx
@@ -30,7 +30,13 @@
import React from 'react';
-import { EuiForm, EuiFormRow, EuiFieldText, EuiButtonEmpty, EuiSpacer } from '@elastic/eui';
+import {
+ EuiForm,
+ EuiCompressedFormRow,
+ EuiCompressedFieldText,
+ EuiSmallButtonEmpty,
+ EuiSpacer,
+} from '@elastic/eui';
import { i18n } from '@osd/i18n';
import { FormattedMessage } from '@osd/i18n/react';
@@ -49,7 +55,7 @@ export const AdvancedOptions: React.FC = ({
onChangeIndexPatternId,
}) => (
-
@@ -64,11 +70,11 @@ export const AdvancedOptions: React.FC = ({
defaultMessage="Show advanced settings"
/>
)}
-
+
{isVisible ? (
-
+
) : null}
diff --git a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/components/time_field/__snapshots__/time_field.test.tsx.snap b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/components/time_field/__snapshots__/time_field.test.tsx.snap
index 73277b196362..c8e12dcb26bf 100644
--- a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/components/time_field/__snapshots__/time_field.test.tsx.snap
+++ b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/components/time_field/__snapshots__/time_field.test.tsx.snap
@@ -12,9 +12,9 @@ exports[`TimeField should render a loading state 1`] = `
-
-
-
+
`;
@@ -61,9 +61,9 @@ exports[`TimeField should render a selected time field 1`] = `
-
-
-
+
`;
@@ -123,9 +123,9 @@ exports[`TimeField should render normally 1`] = `
-
-
-
+
`;
diff --git a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/components/time_field/time_field.tsx b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/components/time_field/time_field.tsx
index 23d5d492004a..2c3f2665b28e 100644
--- a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/components/time_field/time_field.tsx
+++ b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/components/time_field/time_field.tsx
@@ -32,10 +32,10 @@ import React from 'react';
import {
EuiForm,
- EuiFormRow,
+ EuiCompressedFormRow,
EuiSpacer,
EuiLink,
- EuiSelect,
+ EuiCompressedSelect,
EuiText,
EuiLoadingSpinner,
} from '@elastic/eui';
@@ -72,7 +72,7 @@ export const TimeField: React.FC = ({
- = ({
}
>
{isLoading ? (
- = ({
disabled={true}
/>
) : (
- = ({
onChange={onTimeFieldChanged}
/>
)}
-
+
>
) : (
diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx
index f378bfea05c2..4bb917be4955 100644
--- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx
+++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx
@@ -30,7 +30,7 @@
import React from 'react';
import { i18n } from '@osd/i18n';
-import { EuiFlexGroup, EuiToolTip, EuiFlexItem, EuiTitle, EuiButtonIcon } from '@elastic/eui';
+import { EuiFlexGroup, EuiToolTip, EuiFlexItem, EuiTitle, EuiSmallButtonIcon } from '@elastic/eui';
import { IIndexPattern } from 'src/plugins/data/public';
interface IndexHeaderProps {
@@ -90,7 +90,7 @@ export function IndexHeader({
{defaultIndex !== indexPattern.id && setDefault && (
-
-
-
-
@@ -73,7 +73,7 @@ export const Header = withRouter(({ indexPatternId, history }: HeaderProps) => (
id="indexPatternManagement.editIndexPattern.scripted.addFieldButton"
defaultMessage="Add scripted field"
/>
-
+
));
diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/__snapshots__/add_filter.test.tsx.snap b/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/__snapshots__/add_filter.test.tsx.snap
index 92998bc3f07e..3582c174d261 100644
--- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/__snapshots__/add_filter.test.tsx.snap
+++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/__snapshots__/add_filter.test.tsx.snap
@@ -5,7 +5,7 @@ exports[`AddFilter should ignore strings with just spaces 1`] = `
-
-
@@ -22,7 +22,7 @@ exports[`AddFilter should ignore strings with just spaces 1`] = `
id="indexPatternManagement.editIndexPattern.source.addButtonLabel"
values={Object {}}
/>
-
+
`;
@@ -32,7 +32,7 @@ exports[`AddFilter should render normally 1`] = `
-
-
@@ -49,7 +49,7 @@ exports[`AddFilter should render normally 1`] = `
id="indexPatternManagement.editIndexPattern.source.addButtonLabel"
values={Object {}}
/>
-
+
`;
diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/add_filter.test.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/add_filter.test.tsx
index c0a4d9d0dd9e..8cc90bd71601 100644
--- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/add_filter.test.tsx
+++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/add_filter.test.tsx
@@ -44,8 +44,8 @@ describe('AddFilter', () => {
const onAddFilter = jest.fn();
const component = shallow();
- component.find('EuiFieldText').simulate('change', { target: { value: 'tim*' } });
- component.find('EuiButton').simulate('click');
+ component.find('EuiCompressedFieldText').simulate('change', { target: { value: 'tim*' } });
+ component.find('EuiSmallButton').simulate('click');
component.update();
expect(onAddFilter).toBeCalledWith('tim*');
@@ -55,7 +55,7 @@ describe('AddFilter', () => {
const component = shallow( {}} />);
// Set a value in the input field
- component.find('EuiFieldText').simulate('keypress', ' ');
+ component.find('EuiCompressedFieldText').simulate('keypress', ' ');
component.update();
expect(component).toMatchSnapshot();
diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/add_filter.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/add_filter.tsx
index 6c97af5c6fba..f7162ad38190 100644
--- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/add_filter.tsx
+++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/add_filter.tsx
@@ -32,7 +32,7 @@ import React, { useState, useCallback } from 'react';
import { i18n } from '@osd/i18n';
import { FormattedMessage } from '@osd/i18n/react';
-import { EuiFlexGroup, EuiFlexItem, EuiFieldText, EuiButton } from '@elastic/eui';
+import { EuiFlexGroup, EuiFlexItem, EuiCompressedFieldText, EuiSmallButton } from '@elastic/eui';
interface AddFilterProps {
onAddFilter: (filter: string) => void;
@@ -57,7 +57,7 @@ export const AddFilter = ({ onAddFilter }: AddFilterProps) => {
return (
- setFilter(e.target.value.trim())}
@@ -65,12 +65,12 @@ export const AddFilter = ({ onAddFilter }: AddFilterProps) => {
/>
-
+
-
+
);
diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.test.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.test.tsx
index 210f27f156ad..c3659ba9f6f5 100644
--- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.test.tsx
+++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.test.tsx
@@ -261,7 +261,7 @@ describe('Table', () => {
);
// Press the enter key
- filterNameTableCell.find('EuiFieldText').simulate('keydown', { key: keys.ENTER });
+ filterNameTableCell.find('EuiCompressedFieldText').simulate('keydown', { key: keys.ENTER });
expect(saveFilter).toBeCalled();
// It should reset
@@ -300,7 +300,7 @@ describe('Table', () => {
);
// Press the ESCAPE key
- filterNameTableCell.find('EuiFieldText').simulate('keydown', { key: keys.ESCAPE });
+ filterNameTableCell.find('EuiCompressedFieldText').simulate('keydown', { key: keys.ESCAPE });
expect(saveFilter).not.toBeCalled();
// It should reset
diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx
index 9ce6a01303fb..fa742a05eaaa 100644
--- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx
+++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx
@@ -34,7 +34,7 @@ import {
keys,
EuiBasicTableColumn,
EuiInMemoryTable,
- EuiFieldText,
+ EuiCompressedFieldText,
EuiButtonIcon,
RIGHT_ALIGNMENT,
} from '@elastic/eui';
@@ -148,7 +148,7 @@ export class Table extends Component {
render: (value, filter) => {
if (this.state.editingFilterId && this.state.editingFilterId === filter.clientId) {
return (
-
-
{type === TAB_INDEXED_FIELDS && indexedFieldTypes.length > 0 && (
- setIndexedFieldTypeFilter(e.target.value)}
@@ -152,7 +152,7 @@ export function Tabs({ indexPattern, saveIndexPattern, fields, history, location
)}
{type === TAB_SCRIPTED_FIELDS && scriptedFieldLanguages.length > 0 && (
- setScriptedFieldLanguageFilter(e.target.value)}
diff --git a/src/plugins/index_pattern_management/public/components/field_editor/__snapshots__/field_editor.test.tsx.snap b/src/plugins/index_pattern_management/public/components/field_editor/__snapshots__/field_editor.test.tsx.snap
index 9bc6c27803d1..bfd8575d42f0 100644
--- a/src/plugins/index_pattern_management/public/components/field_editor/__snapshots__/field_editor.test.tsx.snap
+++ b/src/plugins/index_pattern_management/public/components/field_editor/__snapshots__/field_editor.test.tsx.snap
@@ -36,25 +36,25 @@ exports[`FieldEditor should render create new scripted field correctly 1`] = `
lang="painless"
onClose={[Function]}
/>
-
-
-
-
+
-
-
-
+
-
-
-
+
}
>
-
-
-
+
-
-
-
+
-
-
+
+
-
-
+
+
-
-
+
-
@@ -220,10 +220,10 @@ exports[`FieldEditor should render create new scripted field correctly 1`] = `
id="indexPatternManagement.actions.cancelButton"
values={Object {}}
/>
-
+
-
+
-
-
-
-
+
-
-
-
+
}
>
-
-
-
+
-
-
-
+
-
-
+
+
-
-
+
+
-
-
+
-
@@ -438,7 +438,7 @@ exports[`FieldEditor should render edit scripted field correctly 1`] = `
id="indexPatternManagement.actions.cancelButton"
values={Object {}}
/>
-
+
-
@@ -456,12 +456,12 @@ exports[`FieldEditor should render edit scripted field correctly 1`] = `
id="indexPatternManagement.actions.deleteButton"
values={Object {}}
/>
-
+
-
+
-
@@ -539,19 +539,19 @@ exports[`FieldEditor should show conflict field warning 1`] = `
isInvalid={false}
label="Name"
>
-
-
-
+
-
-
-
+
-
-
-
+
}
>
-
-
-
+
-
-
-
+
-
-
+
+
-
-
+
+
-
-
+
-
@@ -717,10 +717,10 @@ exports[`FieldEditor should show conflict field warning 1`] = `
id="indexPatternManagement.actions.cancelButton"
values={Object {}}
/>
-
+
-
+
-
-
-
-
+
-
-
-
+
}
>
-
-
-
+
-
-
-
+
-
-
+
+
-
-
+
+
-
-
+
-
@@ -1016,7 +1016,7 @@ exports[`FieldEditor should show deprecated lang warning 1`] = `
id="indexPatternManagement.actions.cancelButton"
values={Object {}}
/>
-
+
-
@@ -1034,12 +1034,12 @@ exports[`FieldEditor should show deprecated lang warning 1`] = `
id="indexPatternManagement.actions.deleteButton"
values={Object {}}
/>
-
+
-
+
-
@@ -1117,19 +1117,19 @@ exports[`FieldEditor should show multiple type field warning with a table contai
isInvalid={false}
label="Name"
>
-
-
-
+
-
-
-
+
-
-
+
-
}
>
-
-
-
+
-
-
-
+
-
-
+
+
-
-
+
+
-
-
+
-
@@ -1351,10 +1351,10 @@ exports[`FieldEditor should show multiple type field warning with a table contai
id="indexPatternManagement.actions.cancelButton"
values={Object {}}
/>
-
+
-
+
-
-
-
+
{
return (
- {
this.onColorChange(
@@ -138,7 +144,7 @@ export class ColorFormatEditor extends DefaultFormatEditor {
return (
- {
this.onColorChange(
diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/date/__snapshots__/date.test.tsx.snap b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/date/__snapshots__/date.test.tsx.snap
index 48a7c3e013b1..e3fda2b89dd1 100644
--- a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/date/__snapshots__/date.test.tsx.snap
+++ b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/date/__snapshots__/date.test.tsx.snap
@@ -2,9 +2,9 @@
exports[`DateFormatEditor should render normally 1`] = `
-
-
-
+
-
}
>
-
-
+
);
diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/date_nanos/__snapshots__/date_nanos.test.tsx.snap b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/date_nanos/__snapshots__/date_nanos.test.tsx.snap
index 540c8ece9e35..cc8853f5c244 100644
--- a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/date_nanos/__snapshots__/date_nanos.test.tsx.snap
+++ b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/date_nanos/__snapshots__/date_nanos.test.tsx.snap
@@ -2,9 +2,9 @@
exports[`DateFormatEditor should render normally 1`] = `
-
-
-
+
-
}
>
-
-
+
);
diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/duration/__snapshots__/duration.test.tsx.snap b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/duration/__snapshots__/duration.test.tsx.snap
index c617c3b43039..990864e16aa6 100644
--- a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/duration/__snapshots__/duration.test.tsx.snap
+++ b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/duration/__snapshots__/duration.test.tsx.snap
@@ -2,9 +2,9 @@
exports[`DurationFormatEditor should render human readable output normally 1`] = `
-
-
-
-
+
-
-
+
-
-
-
-
+
-
-
-
+
-
-
-
+
-
-
+
-
- {
return {
@@ -133,8 +138,8 @@ export class DurationFormatEditor extends DefaultFormatEditor<
}}
isInvalid={!!error}
/>
-
-
+
- {
return {
@@ -156,10 +161,10 @@ export class DurationFormatEditor extends DefaultFormatEditor<
}}
isInvalid={!!error}
/>
-
+
{!(format as DurationFormat).isHuman() ? (
<>
-
-
-
-
-
+
+
-
+
>
) : null}
diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/number/__snapshots__/number.test.tsx.snap b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/number/__snapshots__/number.test.tsx.snap
index c73b5e718654..bee51dbfb7e2 100644
--- a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/number/__snapshots__/number.test.tsx.snap
+++ b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/number/__snapshots__/number.test.tsx.snap
@@ -2,9 +2,9 @@
exports[`NumberFormatEditor should render normally 1`] = `
-
-
-
+
-
- {
@@ -86,7 +92,7 @@ export class NumberFormatEditor extends DefaultFormatEditor
-
+
);
diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/percent/__snapshots__/percent.test.tsx.snap b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/percent/__snapshots__/percent.test.tsx.snap
index 16ce8ca9643e..af27d8ad5ad0 100644
--- a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/percent/__snapshots__/percent.test.tsx.snap
+++ b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/percent/__snapshots__/percent.test.tsx.snap
@@ -2,9 +2,9 @@
exports[`PercentFormatEditor should render normally 1`] = `
-
-
-
+
-
-
-
+
@@ -181,9 +181,9 @@ exports[`StaticLookupFormatEditor should render normally 1`] = `
-
-
-
+
diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/static_lookup/static_lookup.tsx b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/static_lookup/static_lookup.tsx
index a9dc931357ba..cf6f917d0977 100644
--- a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/static_lookup/static_lookup.tsx
+++ b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/static_lookup/static_lookup.tsx
@@ -30,7 +30,13 @@
import React, { Fragment } from 'react';
-import { EuiBasicTable, EuiButton, EuiFieldText, EuiFormRow, EuiSpacer } from '@elastic/eui';
+import {
+ EuiBasicTable,
+ EuiButton,
+ EuiCompressedFieldText,
+ EuiCompressedFormRow,
+ EuiSpacer,
+} from '@elastic/eui';
import { i18n } from '@osd/i18n';
import { FormattedMessage } from '@osd/i18n/react';
@@ -102,7 +108,7 @@ export class StaticLookupFormatEditor extends DefaultFormatEditor<
),
render: (value: number, item: StaticLookupItem) => {
return (
- {
this.onLookupChange(
@@ -126,7 +132,7 @@ export class StaticLookupFormatEditor extends DefaultFormatEditor<
),
render: (value: number, item: StaticLookupItem) => {
return (
- {
this.onLookupChange(
@@ -177,7 +183,7 @@ export class StaticLookupFormatEditor extends DefaultFormatEditor<
/>
-
}
>
-
-
+
);
diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/string/__snapshots__/string.test.tsx.snap b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/string/__snapshots__/string.test.tsx.snap
index f8048bad2b70..075a0465d6aa 100644
--- a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/string/__snapshots__/string.test.tsx.snap
+++ b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/string/__snapshots__/string.test.tsx.snap
@@ -2,9 +2,9 @@
exports[`StringFormatEditor should render normally 1`] = `
-
-
-
+
-
- {
@@ -90,7 +90,7 @@ export class StringFormatEditor extends DefaultFormatEditor
-
+
);
diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/truncate/__snapshots__/truncate.test.tsx.snap b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/truncate/__snapshots__/truncate.test.tsx.snap
index 2d1ee496d278..0108e1afdae6 100644
--- a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/truncate/__snapshots__/truncate.test.tsx.snap
+++ b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/truncate/__snapshots__/truncate.test.tsx.snap
@@ -2,9 +2,9 @@
exports[`TruncateFormatEditor should render normally 1`] = `
-
-
-
+
{
onError={onError}
/>
);
- const input = component.find(EuiFieldNumber);
+ const input = component.find(EuiCompressedFieldNumber);
const changeEvent = {
target: {
@@ -107,7 +107,7 @@ describe('TruncateFormatEditor', () => {
onError={onError}
/>
);
- const input = component.find(EuiFieldNumber);
+ const input = component.find(EuiCompressedFieldNumber);
const changeEvent = {
target: {
diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/truncate/truncate.tsx b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/truncate/truncate.tsx
index 3c1e040e76c3..bb1b2475715c 100644
--- a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/truncate/truncate.tsx
+++ b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/truncate/truncate.tsx
@@ -30,7 +30,7 @@
import React, { Fragment } from 'react';
-import { EuiFieldNumber, EuiFormRow } from '@elastic/eui';
+import { EuiCompressedFieldNumber, EuiCompressedFormRow } from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
import { DefaultFormatEditor, defaultState } from '../default';
@@ -56,7 +56,7 @@ export class TruncateFormatEditor extends DefaultFormatEditor
-
- {
@@ -80,7 +80,7 @@ export class TruncateFormatEditor extends DefaultFormatEditor
-
+
);
diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/url/__snapshots__/url.test.tsx.snap b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/url/__snapshots__/url.test.tsx.snap
index f862d0ebe847..0b7f71e71276 100644
--- a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/url/__snapshots__/url.test.tsx.snap
+++ b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/url/__snapshots__/url.test.tsx.snap
@@ -10,9 +10,9 @@ exports[`UrlFormatEditor should render label template help 1`] = `
isVisible={false}
onClose={[Function]}
/>
-
-
-
-
+
-
-
-
+
-
-
+
-
-
-
-
+
-
-
-
+
-
-
+
-
-
-
-
+
-
-
-
+
-
-
+
-
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
-
-
+
-
}
>
- {
this.onChange({ width: e.target.value });
}}
/>
-
-
+
}
>
- {
this.onChange({ height: e.target.value });
}}
/>
-
+
);
};
@@ -198,12 +198,12 @@ export class UrlFormatEditor extends DefaultFormatEditor<
isVisible={this.state.showUrlTemplateHelp}
onClose={this.hideUrlTemplateHelp}
/>
-
}
>
- {
@@ -216,10 +216,10 @@ export class UrlFormatEditor extends DefaultFormatEditor<
this.onTypeChange(e.target.value);
}}
/>
-
+
{formatParams.type === 'a' ? (
-
}
>
-
@@ -240,10 +240,10 @@ export class UrlFormatEditor extends DefaultFormatEditor<
this.onChange({ openLinkInCurrentTab: !e.target.checked });
}}
/>
-
+
) : null}
-
- {
this.onChange({ urlTemplate: e.target.value });
}}
/>
-
+
-
- {
this.onChange({ labelTemplate: e.target.value });
}}
/>
-
+
{formatParams.type === 'img' && this.renderWidthHeightParameters()}
diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/samples/__snapshots__/samples.test.tsx.snap b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/samples/__snapshots__/samples.test.tsx.snap
index 16f72a7ad8e5..15c9d1280dad 100644
--- a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/samples/__snapshots__/samples.test.tsx.snap
+++ b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/samples/__snapshots__/samples.test.tsx.snap
@@ -1,9 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`FormatEditorSamples should render normally 1`] = `
-
-
+
`;
exports[`FormatEditorSamples should render nothing if there are no samples 1`] = `""`;
diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/samples/samples.tsx b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/samples/samples.tsx
index 4361efef7b4c..4056fdcc8389 100644
--- a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/samples/samples.tsx
+++ b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/samples/samples.tsx
@@ -32,7 +32,7 @@ import './samples.scss';
import React, { PureComponent } from 'react';
-import { EuiBasicTable, EuiFormRow } from '@elastic/eui';
+import { EuiBasicTable, EuiCompressedFormRow } from '@elastic/eui';
import { i18n } from '@osd/i18n';
import { FormattedMessage } from '@osd/i18n/react';
@@ -83,7 +83,7 @@ export class FormatEditorSamples extends PureComponent
];
return samples.length ? (
-
}
@@ -94,7 +94,7 @@ export class FormatEditorSamples extends PureComponent
items={samples}
columns={columns}
/>
-
+
) : null;
}
}
diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx b/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx
index 905b2237d5c2..176e985ef09c 100644
--- a/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx
+++ b/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx
@@ -33,10 +33,10 @@ import './test_script.scss';
import React, { Component, Fragment } from 'react';
import {
- EuiButton,
+ EuiSmallButton,
EuiCodeBlock,
- EuiComboBox,
- EuiFormRow,
+ EuiCompressedComboBox,
+ EuiCompressedFormRow,
EuiText,
EuiSpacer,
EuiTitle,
@@ -232,13 +232,13 @@ export class TestScript extends Component {
return (
-
- {
data-test-subj="additionalFieldsSelect"
fullWidth
/>
-
+
{
onQuerySubmit={this.previewScript}
indexPatterns={[this.props.indexPattern]}
customSubmitButton={
- {
id="indexPatternManagement.testScript.submitButtonLabel"
defaultMessage="Run script"
/>
-
+
}
/>
diff --git a/src/plugins/index_pattern_management/public/components/field_editor/field_editor.test.tsx b/src/plugins/index_pattern_management/public/components/field_editor/field_editor.test.tsx
index bf59d08a10d7..de065a2730f9 100644
--- a/src/plugins/index_pattern_management/public/components/field_editor/field_editor.test.tsx
+++ b/src/plugins/index_pattern_management/public/components/field_editor/field_editor.test.tsx
@@ -40,24 +40,31 @@ import { createComponentWithContext } from '../test_utils';
jest.mock('@elastic/eui', () => ({
EuiBasicTable: 'eui-basic-table',
EuiButton: 'eui-button',
+ EuiSmallButton: 'eui-small-button',
EuiButtonEmpty: 'eui-button-empty',
+ EuiSmallButtonEmpty: 'eui-small-button-empty',
EuiCallOut: 'eui-call-out',
EuiCode: 'eui-code',
EuiCodeEditor: 'eui-code-editor',
EuiConfirmModal: 'eui-confirm-modal',
EuiFieldNumber: 'eui-field-number',
+ EuiCompressedFieldNumber: 'eui-compressed-field-number',
EuiFieldText: 'eui-field-text',
+ EuiCompressedFieldText: 'eui-compressed-field-text',
EuiFlexGroup: 'eui-flex-group',
EuiFlexItem: 'eui-flex-item',
EuiForm: 'eui-form',
EuiFormRow: 'eui-form-row',
+ EuiCompressedFormRow: 'eui-compressed-form-row',
EuiIcon: 'eui-icon',
EuiLink: 'eui-link',
EuiOverlayMask: 'eui-overlay-mask',
EuiSelect: 'eui-select',
+ EuiCompressedSelect: 'eui-compressed-select',
EuiSpacer: 'eui-spacer',
EuiText: 'eui-text',
EuiTextArea: 'eui-textArea',
+ EuiCompressedTextArea: 'eui-compressed-textArea',
htmlIdGenerator: () => 42,
euiPaletteColorBlind: () => ['red'],
}));
diff --git a/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx b/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx
index a29c637f6866..33eef159d1d8 100644
--- a/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx
+++ b/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx
@@ -33,21 +33,21 @@ import { intersection, union, get } from 'lodash';
import {
EuiBasicTable,
- EuiButton,
- EuiButtonEmpty,
+ EuiSmallButton,
+ EuiSmallButtonEmpty,
EuiCallOut,
EuiCode,
EuiCodeEditor,
EuiConfirmModal,
- EuiFieldNumber,
- EuiFieldText,
+ EuiCompressedFieldNumber,
+ EuiCompressedFieldText,
EuiFlexGroup,
EuiFlexItem,
EuiForm,
- EuiFormRow,
+ EuiCompressedFormRow,
EuiIcon,
EuiLink,
- EuiSelect,
+ EuiCompressedSelect,
EuiSpacer,
EuiText,
EUI_MODAL_CONFIRM_BUTTON,
@@ -295,7 +295,7 @@ export class FieldEditor extends PureComponent
-
-
+
) : null;
}
@@ -349,7 +349,7 @@ export class FieldEditor extends PureComponent
- {
return { value: lang, text: lang };
@@ -400,7 +400,7 @@ export class FieldEditor extends PureComponent
-
+
) : null;
}
@@ -408,10 +408,10 @@ export class FieldEditor extends PureComponent
- {
@@ -422,7 +422,7 @@ export class FieldEditor extends PureComponent
-
+
);
}
@@ -501,7 +501,7 @@ export class FieldEditor extends PureComponent
-
}
>
- {
return { value: fmt.id || '', text: fmt.title };
@@ -521,7 +521,7 @@ export class FieldEditor extends PureComponent
-
+
{fieldFormatId ? (
- {
this.onFieldChange('count', e.target.value ? Number(e.target.value) : '');
}}
/>
-
+
);
}
@@ -585,7 +585,7 @@ export class FieldEditor extends PureComponent
-
-
+
-
+
-
+
) : null;
}
@@ -693,10 +693,10 @@ export class FieldEditor extends PureComponent
+
-
)}
-
+
-
+
-
+
{!isCreating && spec.scripted ? (
-
+
-
+
) : null}
-
+
);
}
diff --git a/src/plugins/input_control_vis/public/components/editor/__snapshots__/controls_tab.test.tsx.snap b/src/plugins/input_control_vis/public/components/editor/__snapshots__/controls_tab.test.tsx.snap
index 08a8cd93749e..ead41e620732 100644
--- a/src/plugins/input_control_vis/public/components/editor/__snapshots__/controls_tab.test.tsx.snap
+++ b/src/plugins/input_control_vis/public/components/editor/__snapshots__/controls_tab.test.tsx.snap
@@ -128,16 +128,16 @@ exports[`renders ControlsTab 1`] = `
>
-
-
-
+
-
-
-
-
+
+
diff --git a/src/plugins/input_control_vis/public/components/editor/__snapshots__/list_control_editor.test.tsx.snap b/src/plugins/input_control_vis/public/components/editor/__snapshots__/list_control_editor.test.tsx.snap
index 776e569c8887..24957ee6752d 100644
--- a/src/plugins/input_control_vis/public/components/editor/__snapshots__/list_control_editor.test.tsx.snap
+++ b/src/plugins/input_control_vis/public/components/editor/__snapshots__/list_control_editor.test.tsx.snap
@@ -16,9 +16,9 @@ exports[`renders dynamic options should display disabled dynamic options with to
indexPatternId="mockIndexPattern"
onChange={[Function]}
/>
-
-
-
-
+
-
-
-
+
-
-
+
`;
@@ -127,9 +127,9 @@ exports[`renders dynamic options should display dynamic options for string field
indexPatternId="mockIndexPattern"
onChange={[Function]}
/>
-
-
-
-
+
-
-
+
`;
@@ -207,9 +207,9 @@ exports[`renders dynamic options should display size field when dynamic options
indexPatternId="mockIndexPattern"
onChange={[Function]}
/>
-
-
-
-
+
-
-
-
+
-
-
+
`;
@@ -318,9 +318,9 @@ exports[`renders should display chaining input when parents are provided 1`] = `
indexPatternId="indexPattern1"
onChange={[Function]}
/>
-
-
-
-
+
-
-
-
+
-
-
-
+
-
-
+
`;
diff --git a/src/plugins/input_control_vis/public/components/editor/__snapshots__/options_tab.test.tsx.snap b/src/plugins/input_control_vis/public/components/editor/__snapshots__/options_tab.test.tsx.snap
index 6edff2029266..2fe140d8b9f6 100644
--- a/src/plugins/input_control_vis/public/components/editor/__snapshots__/options_tab.test.tsx.snap
+++ b/src/plugins/input_control_vis/public/components/editor/__snapshots__/options_tab.test.tsx.snap
@@ -2,16 +2,16 @@
exports[`OptionsTab should renders OptionsTab 1`] = `
-
-
-
-
+
-
-
-
+
-
-
+
`;
diff --git a/src/plugins/input_control_vis/public/components/editor/__snapshots__/range_control_editor.test.tsx.snap b/src/plugins/input_control_vis/public/components/editor/__snapshots__/range_control_editor.test.tsx.snap
index 67480e68a6bc..22e5bd3bbd81 100644
--- a/src/plugins/input_control_vis/public/components/editor/__snapshots__/range_control_editor.test.tsx.snap
+++ b/src/plugins/input_control_vis/public/components/editor/__snapshots__/range_control_editor.test.tsx.snap
@@ -16,9 +16,9 @@ exports[`renders RangeControlEditor 1`] = `
indexPatternId="indexPattern1"
onChange={[Function]}
/>
-
-
-
-
+
-
-
+
`;
diff --git a/src/plugins/input_control_vis/public/components/editor/control_editor.tsx b/src/plugins/input_control_vis/public/components/editor/control_editor.tsx
index ab6804171744..9fd50d57d0ce 100644
--- a/src/plugins/input_control_vis/public/components/editor/control_editor.tsx
+++ b/src/plugins/input_control_vis/public/components/editor/control_editor.tsx
@@ -33,10 +33,10 @@ import { injectI18n, FormattedMessage, InjectedIntlProps } from '@osd/i18n/react
import {
EuiAccordion,
- EuiButtonIcon,
- EuiFieldText,
+ EuiSmallButtonIcon,
+ EuiCompressedFieldText,
EuiForm,
- EuiFormRow,
+ EuiCompressedFormRow,
EuiPanel,
EuiSpacer,
} from '@elastic/eui';
@@ -132,7 +132,7 @@ class ControlEditorUi extends PureComponent
-
}
>
-
-
+
+
{controlEditor}
@@ -152,7 +155,7 @@ class ControlEditorUi extends PureComponent
-
-
-
-
-
+
-
+
-
-
+
-
-
+
+
diff --git a/src/plugins/input_control_vis/public/components/editor/field_select.tsx b/src/plugins/input_control_vis/public/components/editor/field_select.tsx
index 6da76c7120a8..e4cc92d441bc 100644
--- a/src/plugins/input_control_vis/public/components/editor/field_select.tsx
+++ b/src/plugins/input_control_vis/public/components/editor/field_select.tsx
@@ -32,7 +32,7 @@ import _ from 'lodash';
import React, { Component } from 'react';
import { injectI18n, FormattedMessage, InjectedIntlProps } from '@osd/i18n/react';
-import { EuiFormRow, EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui';
+import { EuiCompressedFormRow, EuiCompressedComboBox, EuiComboBoxOptionOption } from '@elastic/eui';
import { IIndexPattern, IFieldType } from '../../../../data/public';
@@ -163,7 +163,7 @@ class FieldSelectUi extends Component {
}
return (
- {
/>
}
>
- {
onChange={this.onChange}
data-test-subj={selectId}
/>
-
+
);
}
}
diff --git a/src/plugins/input_control_vis/public/components/editor/index_pattern_select_form_row.tsx b/src/plugins/input_control_vis/public/components/editor/index_pattern_select_form_row.tsx
index 9bc6d177428c..e1a971365abf 100644
--- a/src/plugins/input_control_vis/public/components/editor/index_pattern_select_form_row.tsx
+++ b/src/plugins/input_control_vis/public/components/editor/index_pattern_select_form_row.tsx
@@ -30,7 +30,7 @@
import React, { ComponentType } from 'react';
import { injectI18n, InjectedIntlProps } from '@osd/i18n/react';
-import { EuiFormRow } from '@elastic/eui';
+import { EuiCompressedFormRow } from '@elastic/eui';
import { IndexPatternSelectProps } from 'src/plugins/data/public';
export type IndexPatternSelectFormRowUiProps = InjectedIntlProps & {
@@ -45,7 +45,7 @@ function IndexPatternSelectFormRowUi(props: IndexPatternSelectFormRowUiProps) {
const selectId = `indexPatternSelect-${controlIndex}`;
return (
-
-
+
);
}
diff --git a/src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx b/src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx
index d5e2ddbe532a..ce59be2cfc59 100644
--- a/src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx
+++ b/src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx
@@ -31,7 +31,12 @@
import React, { PureComponent, ComponentType } from 'react';
import { FormattedMessage } from '@osd/i18n/react';
-import { EuiFormRow, EuiFieldNumber, EuiSwitch, EuiSelect } from '@elastic/eui';
+import {
+ EuiCompressedFormRow,
+ EuiCompressedFieldNumber,
+ EuiCompressedSwitch,
+ EuiCompressedSelect,
+} from '@elastic/eui';
import { IndexPatternSelectFormRow } from './index_pattern_select_form_row';
import { FieldSelect } from './field_select';
@@ -58,7 +63,7 @@ interface ListControlEditorProps {
value: ControlParamsOptions[T]
) => void;
handleParentChange: (controlIndex: number, parent: string) => void;
- parentCandidates: React.ComponentProps['options'];
+ parentCandidates: React.ComponentProps['options'];
deps: InputControlVisDependencies;
}
@@ -159,7 +164,7 @@ export class ListControlEditor extends PureComponent<
if (this.props.parentCandidates && this.props.parentCandidates.length > 0) {
const parentCandidatesOptions = [{ value: '', text: '' }, ...this.props.parentCandidates];
options.push(
-
- {
this.props.handleParentChange(this.props.controlIndex, event.target.value);
}}
/>
-
+
);
}
options.push(
-
}
>
-
-
+
);
const dynamicOptionsHelpText = this.state.isStringField ? (
@@ -229,12 +234,12 @@ export class ListControlEditor extends PureComponent<
/>
);
options.push(
-
-
-
+
);
// size is not used when dynamic options is set
if (!this.props.controlParams.options.dynamicOptions || !this.state.isStringField) {
options.push(
-
}
>
- {
@@ -286,7 +291,7 @@ export class ListControlEditor extends PureComponent<
}}
data-test-subj="listControlSizeInput"
/>
-
+
);
}
diff --git a/src/plugins/input_control_vis/public/components/editor/options_tab.tsx b/src/plugins/input_control_vis/public/components/editor/options_tab.tsx
index f1081ffe46d1..c7db8ef1c470 100644
--- a/src/plugins/input_control_vis/public/components/editor/options_tab.tsx
+++ b/src/plugins/input_control_vis/public/components/editor/options_tab.tsx
@@ -30,7 +30,7 @@
import React, { PureComponent } from 'react';
-import { EuiForm, EuiFormRow, EuiSwitch } from '@elastic/eui';
+import { EuiForm, EuiCompressedFormRow, EuiCompressedSwitch } from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
import { EuiSwitchEvent } from '@elastic/eui';
@@ -64,8 +64,8 @@ export class OptionsTab extends PureComponent {
render() {
return (
-
-
+ {
onChange={this.handleUpdateFiltersChange}
data-test-subj="inputControlEditorUpdateFiltersOnChangeCheckbox"
/>
-
+
-
-
+ {
onChange={this.handleUseTimeFilter}
data-test-subj="inputControlEditorUseTimeFilterCheckbox"
/>
-
+
-
-
+ {
onChange={this.handlePinFilters}
data-test-subj="inputControlEditorPinFiltersCheckbox"
/>
-
+
);
}
diff --git a/src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx b/src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx
index d9e18b6fc835..b52bf15cfe19 100644
--- a/src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx
+++ b/src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx
@@ -30,7 +30,7 @@
import React, { Component, Fragment, ComponentType } from 'react';
-import { EuiFormRow, EuiFieldNumber } from '@elastic/eui';
+import { EuiCompressedFormRow, EuiCompressedFieldNumber } from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
import { IndexPatternSelectFormRow } from './index_pattern_select_form_row';
@@ -105,7 +105,7 @@ export class RangeControlEditor extends Component<
controlIndex={this.props.controlIndex}
/>
-
}
>
- {
this.props.handleOptionsChange(
@@ -125,9 +125,9 @@ export class RangeControlEditor extends Component<
}}
data-test-subj={`rangeControlSizeInput${this.props.controlIndex}`}
/>
-
+
-
}
>
- {
@@ -148,7 +148,7 @@ export class RangeControlEditor extends Component<
}}
data-test-subj={`rangeControlDecimalPlacesInput${this.props.controlIndex}`}
/>
-
+
);
}
diff --git a/src/plugins/input_control_vis/public/components/vis/__snapshots__/form_row.test.tsx.snap b/src/plugins/input_control_vis/public/components/vis/__snapshots__/form_row.test.tsx.snap
index ba183cc40b12..d036622a1d30 100644
--- a/src/plugins/input_control_vis/public/components/vis/__snapshots__/form_row.test.tsx.snap
+++ b/src/plugins/input_control_vis/public/components/vis/__snapshots__/form_row.test.tsx.snap
@@ -1,10 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders control with warning 1`] = `
-
My Control
-
+
`;
exports[`renders disabled control with tooltip 1`] = `
-
-
+
`;
exports[`renders enabled control 1`] = `
-
My Control
-
+
`;
diff --git a/src/plugins/input_control_vis/public/components/vis/__snapshots__/input_control_vis.test.tsx.snap b/src/plugins/input_control_vis/public/components/vis/__snapshots__/input_control_vis.test.tsx.snap
index 0826b1560410..e6adbb40587e 100644
--- a/src/plugins/input_control_vis/public/components/vis/__snapshots__/input_control_vis.test.tsx.snap
+++ b/src/plugins/input_control_vis/public/components/vis/__snapshots__/input_control_vis.test.tsx.snap
@@ -40,7 +40,7 @@ exports[`Apply and Cancel change btns enabled when there are changes 1`] = `
-
-
+
-
-
+
-
-
+
@@ -126,7 +126,7 @@ exports[`Clear btns enabled when there are values 1`] = `
-
-
+
-
-
+
-
-
+
@@ -212,7 +212,7 @@ exports[`Renders list control 1`] = `
-
-
+
-
-
+
-
-
+
@@ -305,7 +305,7 @@ exports[`Renders range control 1`] = `
-
-
+
-
-
+
-
-
+
diff --git a/src/plugins/input_control_vis/public/components/vis/__snapshots__/list_control.test.tsx.snap b/src/plugins/input_control_vis/public/components/vis/__snapshots__/list_control.test.tsx.snap
index eab52795fefa..fb4097dd0848 100644
--- a/src/plugins/input_control_vis/public/components/vis/__snapshots__/list_control.test.tsx.snap
+++ b/src/plugins/input_control_vis/public/components/vis/__snapshots__/list_control.test.tsx.snap
@@ -7,7 +7,7 @@ exports[`disableMsg 1`] = `
id="mock-list-control"
label="list control"
>
-
-
+
{control}
-
+
);
}
diff --git a/src/plugins/input_control_vis/public/components/vis/input_control_vis.tsx b/src/plugins/input_control_vis/public/components/vis/input_control_vis.tsx
index 31f2a1f76cfb..ba62854ddfef 100644
--- a/src/plugins/input_control_vis/public/components/vis/input_control_vis.tsx
+++ b/src/plugins/input_control_vis/public/components/vis/input_control_vis.tsx
@@ -29,7 +29,7 @@
*/
import React, { Component } from 'react';
-import { EuiButton, EuiButtonEmpty, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
+import { EuiSmallButton, EuiSmallButtonEmpty, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
import { CONTROL_TYPES } from '../../editor_utils';
import { ListControl } from '../../control/list_control_factory';
@@ -129,7 +129,7 @@ export class InputControlVis extends Component {
return (
- {
id="inputControl.vis.inputControlVis.applyChangesButtonLabel"
defaultMessage="Apply changes"
/>
-
+
- {
id="inputControl.vis.inputControlVis.cancelChangesButtonLabel"
defaultMessage="Cancel changes"
/>
-
+
- {
id="inputControl.vis.inputControlVis.clearFormButtonLabel"
defaultMessage="Clear form"
/>
-
+
);
diff --git a/src/plugins/input_control_vis/public/components/vis/list_control.tsx b/src/plugins/input_control_vis/public/components/vis/list_control.tsx
index f4713b3ac8d6..ce24b5a03366 100644
--- a/src/plugins/input_control_vis/public/components/vis/list_control.tsx
+++ b/src/plugins/input_control_vis/public/components/vis/list_control.tsx
@@ -32,7 +32,7 @@ import React, { PureComponent } from 'react';
import _ from 'lodash';
import { injectI18n, InjectedIntlProps } from '@osd/i18n/react';
-import { EuiFieldText, EuiComboBox } from '@elastic/eui';
+import { EuiCompressedFieldText, EuiCompressedComboBox } from '@elastic/eui';
import { i18n } from '@osd/i18n';
import { FormRow } from './form_row';
@@ -123,7 +123,7 @@ class ListControlUi extends PureComponent
}
>
-
}
>
- {
diff --git a/src/plugins/newsfeed/public/components/flyout_list.tsx b/src/plugins/newsfeed/public/components/flyout_list.tsx
index 501a9b53607f..f16d09d02fac 100644
--- a/src/plugins/newsfeed/public/components/flyout_list.tsx
+++ b/src/plugins/newsfeed/public/components/flyout_list.tsx
@@ -37,7 +37,7 @@ import {
EuiFlyoutFooter,
EuiFlexGroup,
EuiFlexItem,
- EuiButtonEmpty,
+ EuiSmallButtonEmpty,
EuiText,
EuiBadge,
EuiHeaderAlert,
@@ -100,12 +100,12 @@ export const NewsfeedFlyout = () => {
-
+
-
+
{newsFetchResult ? (
diff --git a/src/plugins/opensearch_dashboards_overview/public/components/_overview.scss b/src/plugins/opensearch_dashboards_overview/public/components/_overview.scss
index 45dc59f59edb..3720cdd6c9a5 100644
--- a/src/plugins/opensearch_dashboards_overview/public/components/_overview.scss
+++ b/src/plugins/opensearch_dashboards_overview/public/components/_overview.scss
@@ -123,7 +123,7 @@
}
}
-// Accounting for no `flush="both"` prop on EuiButtonEmpty
+// Accounting for no `flush="both"` prop on EuiSmallButtonEmpty
.osdOverviewDataAdd__actionButton {
margin-right: 0;
}
diff --git a/src/plugins/opensearch_dashboards_overview/public/components/getting_started/__snapshots__/getting_started.test.tsx.snap b/src/plugins/opensearch_dashboards_overview/public/components/getting_started/__snapshots__/getting_started.test.tsx.snap
index 9df3bb12caec..da2c243b09fd 100644
--- a/src/plugins/opensearch_dashboards_overview/public/components/getting_started/__snapshots__/getting_started.test.tsx.snap
+++ b/src/plugins/opensearch_dashboards_overview/public/components/getting_started/__snapshots__/getting_started.test.tsx.snap
@@ -169,7 +169,7 @@ exports[`GettingStarted dark mode on 1`] = `
size="xl"
/>
-
-
+
@@ -364,7 +364,7 @@ exports[`GettingStarted render 1`] = `
size="xl"
/>
-
-
+
diff --git a/src/plugins/opensearch_dashboards_overview/public/components/getting_started/getting_started.tsx b/src/plugins/opensearch_dashboards_overview/public/components/getting_started/getting_started.tsx
index c222d48a4a60..58538e08d040 100644
--- a/src/plugins/opensearch_dashboards_overview/public/components/getting_started/getting_started.tsx
+++ b/src/plugins/opensearch_dashboards_overview/public/components/getting_started/getting_started.tsx
@@ -30,7 +30,7 @@
import React, { FC } from 'react';
import {
- EuiButton,
+ EuiSmallButton,
EuiCard,
EuiFlexGrid,
EuiFlexGroup,
@@ -114,7 +114,7 @@ export const GettingStarted: FC = ({ addBasePath, isDarkTheme, apps }) =>
- = ({ addBasePath, isDarkTheme, apps }) =>
defaultMessage="Add your data"
id="opensearchDashboardsOverview.gettingStarted.addDataButtonLabel"
/>
-
+
diff --git a/src/plugins/opensearch_dashboards_react/public/overview_page/overview_page_header/__snapshots__/overview_page_header.test.tsx.snap b/src/plugins/opensearch_dashboards_react/public/overview_page/overview_page_header/__snapshots__/overview_page_header.test.tsx.snap
index 3184a3a15bb2..468d8c9422c7 100644
--- a/src/plugins/opensearch_dashboards_react/public/overview_page/overview_page_header/__snapshots__/overview_page_header.test.tsx.snap
+++ b/src/plugins/opensearch_dashboards_react/public/overview_page/overview_page_header/__snapshots__/overview_page_header.test.tsx.snap
@@ -50,14 +50,14 @@ exports[`OverviewPageHeader renders with the toolbar by default 1`] = `
}
}
>
-
Add data
-
+
diff --git a/src/plugins/opensearch_dashboards_react/public/overview_page/overview_page_header/overview_page_header.tsx b/src/plugins/opensearch_dashboards_react/public/overview_page/overview_page_header/overview_page_header.tsx
index 54eb4f940eff..6a6d1aa75881 100644
--- a/src/plugins/opensearch_dashboards_react/public/overview_page/overview_page_header/overview_page_header.tsx
+++ b/src/plugins/opensearch_dashboards_react/public/overview_page/overview_page_header/overview_page_header.tsx
@@ -30,7 +30,7 @@
import React, { FC } from 'react';
import {
- EuiButtonEmpty,
+ EuiSmallButtonEmpty,
EuiFlexGroup,
EuiFlexItem,
EuiIcon,
@@ -113,7 +113,7 @@ export const OverviewPageHeader: FC = ({
- = ({
defaultMessage: 'Add data',
}
)}
-
+
{showManagementLink && isManagementEnabled ? (
- = ({
defaultMessage: 'Manage',
}
)}
-
+
) : null}
@@ -152,7 +152,7 @@ export const OverviewPageHeader: FC = ({
{showDevToolsLink && isDevToolsEnabled ? (
- = ({
defaultMessage: 'Dev tools',
}
)}
-
+
) : null}
diff --git a/src/plugins/opensearch_dashboards_react/public/table_list_view/table_list_view.tsx b/src/plugins/opensearch_dashboards_react/public/table_list_view/table_list_view.tsx
index e737fb2ec73e..a472461e0e3c 100644
--- a/src/plugins/opensearch_dashboards_react/public/table_list_view/table_list_view.tsx
+++ b/src/plugins/opensearch_dashboards_react/public/table_list_view/table_list_view.tsx
@@ -40,7 +40,7 @@ import {
EuiLink,
EuiFlexGroup,
EuiFlexItem,
- EuiButton,
+ EuiSmallButton,
EuiSpacer,
EuiConfirmModal,
EuiCallOut,
@@ -391,7 +391,7 @@ class TableListView extends React.Component
-
+
);
}
@@ -501,7 +501,7 @@ class TableListView extends React.Component
-
-
+
) : (
false
diff --git a/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_daily.js b/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_daily.js
index d1419ef9464a..7bdd16ea3ff4 100644
--- a/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_daily.js
+++ b/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_daily.js
@@ -33,11 +33,11 @@ import PropTypes from 'prop-types';
import { FormattedMessage } from '@osd/i18n/react';
import { i18n } from '@osd/i18n';
-import { EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiSelect } from '@elastic/eui';
+import { EuiFlexGroup, EuiFlexItem, EuiCompressedFormRow, EuiCompressedSelect } from '@elastic/eui';
export const CronDaily = ({ minute, minuteOptions, hour, hourOptions, onChange }) => (
-
-
-
-
+
);
diff --git a/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_editor.js b/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_editor.js
index ac3896087c6a..c409933983e1 100644
--- a/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_editor.js
+++ b/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_editor.js
@@ -34,7 +34,7 @@ import { padStart } from 'lodash';
import { FormattedMessage } from '@osd/i18n/react';
import { i18n } from '@osd/i18n';
-import { EuiSelect, EuiFormRow } from '@elastic/eui';
+import { EuiCompressedSelect, EuiCompressedFormRow } from '@elastic/eui';
import {
getOrdinalValue,
@@ -356,7 +356,7 @@ export class CronEditor extends Component {
return (
-
- this.onChangeFrequency(e.target.value)}
@@ -375,7 +375,7 @@ export class CronEditor extends Component {
})}
data-test-subj="cronFrequencySelect"
/>
-
+
{this.renderForm()}
diff --git a/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_hourly.js b/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_hourly.js
index 29fe59d29d1a..9c3ddb869055 100644
--- a/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_hourly.js
+++ b/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_hourly.js
@@ -33,11 +33,11 @@ import PropTypes from 'prop-types';
import { FormattedMessage } from '@osd/i18n/react';
import { i18n } from '@osd/i18n';
-import { EuiFormRow, EuiSelect } from '@elastic/eui';
+import { EuiCompressedFormRow, EuiCompressedSelect } from '@elastic/eui';
export const CronHourly = ({ minute, minuteOptions, onChange }) => (
- (
fullWidth
data-test-subj="cronFrequencyConfiguration"
>
- onChange({ minute: e.target.value })}
@@ -57,7 +57,7 @@ export const CronHourly = ({ minute, minuteOptions, onChange }) => (
})}
data-test-subj="cronFrequencyHourlyMinuteSelect"
/>
-
+
);
diff --git a/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_monthly.js b/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_monthly.js
index 88c56165a0cb..b9ae0e3dcabc 100644
--- a/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_monthly.js
+++ b/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_monthly.js
@@ -33,7 +33,7 @@ import PropTypes from 'prop-types';
import { FormattedMessage } from '@osd/i18n/react';
import { i18n } from '@osd/i18n';
-import { EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiSelect } from '@elastic/eui';
+import { EuiFlexGroup, EuiFlexItem, EuiCompressedFormRow, EuiCompressedSelect } from '@elastic/eui';
export const CronMonthly = ({
minute,
@@ -45,7 +45,7 @@ export const CronMonthly = ({
onChange,
}) => (
-
- onChange({ date: e.target.value })}
@@ -65,9 +65,9 @@ export const CronMonthly = ({
})}
data-test-subj="cronFrequencyMonthlyDateSelect"
/>
-
+
-
-
-
-
+
);
diff --git a/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_weekly.js b/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_weekly.js
index 6deb9725e8d9..f293e71584d3 100644
--- a/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_weekly.js
+++ b/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_weekly.js
@@ -33,7 +33,7 @@ import PropTypes from 'prop-types';
import { FormattedMessage } from '@osd/i18n/react';
import { i18n } from '@osd/i18n';
-import { EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiSelect } from '@elastic/eui';
+import { EuiFlexGroup, EuiFlexItem, EuiCompressedFormRow, EuiCompressedSelect } from '@elastic/eui';
export const CronWeekly = ({
minute,
@@ -45,7 +45,7 @@ export const CronWeekly = ({
onChange,
}) => (
-
- onChange({ day: e.target.value })}
@@ -65,9 +65,9 @@ export const CronWeekly = ({
})}
data-test-subj="cronFrequencyWeeklyDaySelect"
/>
-
+
-
-
- onChange({ minute: e.target.value })}
@@ -108,7 +108,7 @@ export const CronWeekly = ({
/>
-
+
);
diff --git a/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_yearly.js b/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_yearly.js
index 7cdaf7d309fc..6512d1998135 100644
--- a/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_yearly.js
+++ b/src/plugins/opensearch_ui_shared/public/components/cron_editor/cron_yearly.js
@@ -33,7 +33,7 @@ import PropTypes from 'prop-types';
import { FormattedMessage } from '@osd/i18n/react';
import { i18n } from '@osd/i18n';
-import { EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiSelect } from '@elastic/eui';
+import { EuiFlexGroup, EuiFlexItem, EuiCompressedFormRow, EuiCompressedSelect } from '@elastic/eui';
export const CronYearly = ({
minute,
@@ -47,7 +47,7 @@ export const CronYearly = ({
onChange,
}) => (
-
- onChange({ month: e.target.value })}
@@ -67,9 +67,9 @@ export const CronYearly = ({
})}
data-test-subj="cronFrequencyYearlyMonthSelect"
/>
-
+
-
- onChange({ date: e.target.value })}
@@ -89,9 +89,9 @@ export const CronYearly = ({
})}
data-test-subj="cronFrequencyYearlyDateSelect"
/>
-
+
-
-
-
-
+
);
diff --git a/src/plugins/opensearch_ui_shared/public/components/json_editor/json_editor.tsx b/src/plugins/opensearch_ui_shared/public/components/json_editor/json_editor.tsx
index 23a4d9812e2b..1eaa4d7f2801 100644
--- a/src/plugins/opensearch_ui_shared/public/components/json_editor/json_editor.tsx
+++ b/src/plugins/opensearch_ui_shared/public/components/json_editor/json_editor.tsx
@@ -29,7 +29,7 @@
*/
import React, { useCallback, useMemo } from 'react';
-import { EuiFormRow, EuiCodeEditor } from '@elastic/eui';
+import { EuiCompressedFormRow, EuiCodeEditor } from '@elastic/eui';
import { debounce } from 'lodash';
import { useJson, OnJsonEditorUpdateHandler } from './use_json';
@@ -92,7 +92,7 @@ function JsonEditorComp({
);
return (
- ({
onChange={onEuiCodeEditorChange}
{...euiCodeEditorProps}
/>
-
+
);
}
diff --git a/src/plugins/opensearch_ui_shared/public/forms/form_wizard/form_wizard_nav.tsx b/src/plugins/opensearch_ui_shared/public/forms/form_wizard/form_wizard_nav.tsx
index 9f6285f91560..79788682f927 100644
--- a/src/plugins/opensearch_ui_shared/public/forms/form_wizard/form_wizard_nav.tsx
+++ b/src/plugins/opensearch_ui_shared/public/forms/form_wizard/form_wizard_nav.tsx
@@ -30,7 +30,7 @@
import React from 'react';
import { i18n } from '@osd/i18n';
-import { EuiButton, EuiButtonEmpty, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
+import { EuiSmallButton, EuiSmallButtonEmpty, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
interface Props {
activeStepIndex: number;
@@ -90,20 +90,20 @@ export const FormWizardNav = ({
{/* Back button */}
{activeStepIndex > 0 ? (
-
{labels.back}
-
+
) : null}
{/* Next button */}
-
{nextButtonLabel}
-
+
diff --git a/src/plugins/opensearch_ui_shared/static/forms/components/fields/checkbox_field.tsx b/src/plugins/opensearch_ui_shared/static/forms/components/fields/checkbox_field.tsx
index 1fca26ddf4c2..c6c22afd8cfc 100644
--- a/src/plugins/opensearch_ui_shared/static/forms/components/fields/checkbox_field.tsx
+++ b/src/plugins/opensearch_ui_shared/static/forms/components/fields/checkbox_field.tsx
@@ -29,7 +29,7 @@
*/
import React from 'react';
-import { EuiFormRow, EuiCheckbox } from '@elastic/eui';
+import { EuiCompressedFormRow, EuiCompressedCheckbox } from '@elastic/eui';
import uuid from 'uuid';
import { FieldHook, getFieldValidityAndErrorMessage } from '../../hook_form_lib';
@@ -45,7 +45,7 @@ export const CheckBoxField = ({ field, euiFieldProps = {}, ...rest }: Props) =>
const { isInvalid, errorMessage } = getFieldValidityAndErrorMessage(field);
return (
-
data-test-subj={rest['data-test-subj']}
describedByIds={rest.idAria ? [rest.idAria] : undefined}
>
-
data-test-subj="input"
{...euiFieldProps}
/>
-
+
);
};
diff --git a/src/plugins/opensearch_ui_shared/static/forms/components/fields/combobox_field.tsx b/src/plugins/opensearch_ui_shared/static/forms/components/fields/combobox_field.tsx
index 78852a039d45..d6ddb27b020a 100644
--- a/src/plugins/opensearch_ui_shared/static/forms/components/fields/combobox_field.tsx
+++ b/src/plugins/opensearch_ui_shared/static/forms/components/fields/combobox_field.tsx
@@ -30,7 +30,7 @@
import React from 'react';
import { i18n } from '@osd/i18n';
-import { EuiFormRow, EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui';
+import { EuiCompressedFormRow, EuiCompressedComboBox, EuiComboBoxOptionOption } from '@elastic/eui';
import { FieldHook, VALIDATION_TYPES, FieldValidateResponse } from '../../hook_form_lib';
@@ -91,7 +91,7 @@ export const ComboBoxField = ({ field, euiFieldProps = {}, ...rest }: Props) =>
};
return (
-
data-test-subj={rest['data-test-subj']}
describedByIds={rest.idAria ? [rest.idAria] : undefined}
>
-
data-test-subj="input"
{...euiFieldProps}
/>
-
+
);
};
diff --git a/src/plugins/opensearch_ui_shared/static/forms/components/fields/multi_select_field.tsx b/src/plugins/opensearch_ui_shared/static/forms/components/fields/multi_select_field.tsx
index 53d34fda9477..ed79238fbcb4 100644
--- a/src/plugins/opensearch_ui_shared/static/forms/components/fields/multi_select_field.tsx
+++ b/src/plugins/opensearch_ui_shared/static/forms/components/fields/multi_select_field.tsx
@@ -29,7 +29,7 @@
*/
import React from 'react';
-import { EuiFormRow, EuiSelectable, EuiPanel } from '@elastic/eui';
+import { EuiCompressedFormRow, EuiSelectable, EuiPanel } from '@elastic/eui';
import { FieldHook, getFieldValidityAndErrorMessage } from '../../hook_form_lib';
@@ -44,7 +44,7 @@ export const MultiSelectField = ({ field, euiFieldProps = {}, ...rest }: Props)
const { isInvalid, errorMessage } = getFieldValidityAndErrorMessage(field);
return (
-
)}
-
+
);
};
diff --git a/src/plugins/opensearch_ui_shared/static/forms/components/fields/numeric_field.tsx b/src/plugins/opensearch_ui_shared/static/forms/components/fields/numeric_field.tsx
index 49ea107a825c..4f56dd319be5 100644
--- a/src/plugins/opensearch_ui_shared/static/forms/components/fields/numeric_field.tsx
+++ b/src/plugins/opensearch_ui_shared/static/forms/components/fields/numeric_field.tsx
@@ -29,7 +29,7 @@
*/
import React from 'react';
-import { EuiFormRow, EuiFieldNumber, EuiFieldNumberProps } from '@elastic/eui';
+import { EuiCompressedFormRow, EuiCompressedFieldNumber, EuiFieldNumberProps } from '@elastic/eui';
import { FieldHook, getFieldValidityAndErrorMessage } from '../../hook_form_lib';
@@ -44,7 +44,7 @@ export const NumericField = ({ field, euiFieldProps = {}, ...rest }: Props) => {
const { isInvalid, errorMessage } = getFieldValidityAndErrorMessage(field);
return (
- {
data-test-subj={rest['data-test-subj']}
describedByIds={rest.idAria ? [rest.idAria] : undefined}
>
- {
data-test-subj="input"
{...euiFieldProps}
/>
-
+
);
};
diff --git a/src/plugins/opensearch_ui_shared/static/forms/components/fields/radio_group_field.tsx b/src/plugins/opensearch_ui_shared/static/forms/components/fields/radio_group_field.tsx
index 2d84425996af..54675f09275f 100644
--- a/src/plugins/opensearch_ui_shared/static/forms/components/fields/radio_group_field.tsx
+++ b/src/plugins/opensearch_ui_shared/static/forms/components/fields/radio_group_field.tsx
@@ -29,7 +29,7 @@
*/
import React from 'react';
-import { EuiFormRow, EuiRadioGroup } from '@elastic/eui';
+import { EuiCompressedFormRow, EuiCompressedRadioGroup } from '@elastic/eui';
import { FieldHook, getFieldValidityAndErrorMessage } from '../../hook_form_lib';
@@ -44,7 +44,7 @@ export const RadioGroupField = ({ field, euiFieldProps = {}, ...rest }: Props) =
const { isInvalid, errorMessage } = getFieldValidityAndErrorMessage(field);
return (
-
-
-
+
);
};
diff --git a/src/plugins/opensearch_ui_shared/static/forms/components/fields/range_field.tsx b/src/plugins/opensearch_ui_shared/static/forms/components/fields/range_field.tsx
index 67810bb1a343..fcac6c5ec148 100644
--- a/src/plugins/opensearch_ui_shared/static/forms/components/fields/range_field.tsx
+++ b/src/plugins/opensearch_ui_shared/static/forms/components/fields/range_field.tsx
@@ -29,7 +29,7 @@
*/
import React, { useCallback } from 'react';
-import { EuiFormRow, EuiRange } from '@elastic/eui';
+import { EuiCompressedFormRow, EuiRange } from '@elastic/eui';
import { FieldHook, getFieldValidityAndErrorMessage } from '../../hook_form_lib';
@@ -55,7 +55,7 @@ export const RangeField = ({ field, euiFieldProps = {}, ...rest }: Props) => {
);
return (
- {
data-test-subj="range"
{...euiFieldProps}
/>
-
+
);
};
diff --git a/src/plugins/opensearch_ui_shared/static/forms/components/fields/select_field.tsx b/src/plugins/opensearch_ui_shared/static/forms/components/fields/select_field.tsx
index bf774f34a084..87f351ff7d90 100644
--- a/src/plugins/opensearch_ui_shared/static/forms/components/fields/select_field.tsx
+++ b/src/plugins/opensearch_ui_shared/static/forms/components/fields/select_field.tsx
@@ -29,7 +29,7 @@
*/
import React, { ReactNode, OptionHTMLAttributes } from 'react';
-import { EuiFormRow, EuiSelect } from '@elastic/eui';
+import { EuiCompressedFormRow, EuiCompressedSelect } from '@elastic/eui';
import { FieldHook, getFieldValidityAndErrorMessage } from '../../hook_form_lib';
@@ -49,7 +49,7 @@ export const SelectField = ({ field, euiFieldProps, ...rest }: Props) => {
const { isInvalid, errorMessage } = getFieldValidityAndErrorMessage(field);
return (
- {
data-test-subj={rest['data-test-subj']}
describedByIds={rest.idAria ? [rest.idAria] : undefined}
>
- {
@@ -69,6 +69,6 @@ export const SelectField = ({ field, euiFieldProps, ...rest }: Props) => {
data-test-subj="select"
{...euiFieldProps}
/>
-
+
);
};
diff --git a/src/plugins/opensearch_ui_shared/static/forms/components/fields/super_select_field.tsx b/src/plugins/opensearch_ui_shared/static/forms/components/fields/super_select_field.tsx
index 3518f275ccdc..6f10c53aa85c 100644
--- a/src/plugins/opensearch_ui_shared/static/forms/components/fields/super_select_field.tsx
+++ b/src/plugins/opensearch_ui_shared/static/forms/components/fields/super_select_field.tsx
@@ -29,7 +29,7 @@
*/
import React from 'react';
-import { EuiFormRow, EuiSuperSelect, EuiSuperSelectProps } from '@elastic/eui';
+import { EuiCompressedFormRow, EuiCompressedSuperSelect, EuiSuperSelectProps } from '@elastic/eui';
import { FieldHook, getFieldValidityAndErrorMessage } from '../../hook_form_lib';
@@ -47,7 +47,7 @@ export const SuperSelectField = ({ field, euiFieldProps = { options: [] }, ...re
const { isInvalid, errorMessage } = getFieldValidityAndErrorMessage(field);
return (
-
- {
@@ -66,6 +66,6 @@ export const SuperSelectField = ({ field, euiFieldProps = { options: [] }, ...re
data-test-subj="select"
{...euiFieldProps}
/>
-
+
);
};
diff --git a/src/plugins/opensearch_ui_shared/static/forms/components/fields/text_area_field.tsx b/src/plugins/opensearch_ui_shared/static/forms/components/fields/text_area_field.tsx
index 5aace9e6d031..ca71e8ae09ca 100644
--- a/src/plugins/opensearch_ui_shared/static/forms/components/fields/text_area_field.tsx
+++ b/src/plugins/opensearch_ui_shared/static/forms/components/fields/text_area_field.tsx
@@ -29,7 +29,7 @@
*/
import React from 'react';
-import { EuiFormRow, EuiTextArea } from '@elastic/eui';
+import { EuiCompressedFormRow, EuiCompressedTextArea } from '@elastic/eui';
import { FieldHook, getFieldValidityAndErrorMessage } from '../../hook_form_lib';
@@ -44,7 +44,7 @@ export const TextAreaField = ({ field, euiFieldProps = {}, ...rest }: Props) =>
const { isInvalid, errorMessage } = getFieldValidityAndErrorMessage(field);
return (
-
data-test-subj={rest['data-test-subj']}
describedByIds={rest.idAria ? [rest.idAria] : undefined}
>
-
data-test-subj="input"
{...euiFieldProps}
/>
-
+
);
};
diff --git a/src/plugins/opensearch_ui_shared/static/forms/components/fields/text_field.tsx b/src/plugins/opensearch_ui_shared/static/forms/components/fields/text_field.tsx
index 7666fede6aa2..93d13a16a518 100644
--- a/src/plugins/opensearch_ui_shared/static/forms/components/fields/text_field.tsx
+++ b/src/plugins/opensearch_ui_shared/static/forms/components/fields/text_field.tsx
@@ -29,7 +29,7 @@
*/
import React from 'react';
-import { EuiFormRow, EuiFieldText } from '@elastic/eui';
+import { EuiCompressedFormRow, EuiCompressedFieldText } from '@elastic/eui';
import { FieldHook, getFieldValidityAndErrorMessage } from '../../hook_form_lib';
@@ -44,7 +44,7 @@ export const TextField = ({ field, euiFieldProps = {}, ...rest }: Props) => {
const { isInvalid, errorMessage } = getFieldValidityAndErrorMessage(field);
return (
- {
data-test-subj={rest['data-test-subj']}
describedByIds={rest.idAria ? [rest.idAria] : undefined}
>
- {
data-test-subj="input"
{...euiFieldProps}
/>
-
+
);
};
diff --git a/src/plugins/opensearch_ui_shared/static/forms/components/fields/toggle_field.tsx b/src/plugins/opensearch_ui_shared/static/forms/components/fields/toggle_field.tsx
index b3da2fdb1ef7..7d8e241a5702 100644
--- a/src/plugins/opensearch_ui_shared/static/forms/components/fields/toggle_field.tsx
+++ b/src/plugins/opensearch_ui_shared/static/forms/components/fields/toggle_field.tsx
@@ -29,7 +29,7 @@
*/
import React from 'react';
-import { EuiFormRow, EuiSwitch, EuiSwitchEvent } from '@elastic/eui';
+import { EuiCompressedFormRow, EuiCompressedSwitch, EuiSwitchEvent } from '@elastic/eui';
import { FieldHook, getFieldValidityAndErrorMessage } from '../../hook_form_lib';
@@ -52,7 +52,7 @@ export const ToggleField = ({ field, euiFieldProps = {}, ...rest }: Props) => {
};
return (
- {
data-test-subj={rest['data-test-subj']}
describedByIds={rest.idAria ? [rest.idAria] : undefined}
>
-
-
+
);
};
diff --git a/src/plugins/saved_objects/public/finder/saved_object_finder.tsx b/src/plugins/saved_objects/public/finder/saved_object_finder.tsx
index 3d99b4e28e22..5c7f3f1ae031 100644
--- a/src/plugins/saved_objects/public/finder/saved_object_finder.tsx
+++ b/src/plugins/saved_objects/public/finder/saved_object_finder.tsx
@@ -36,8 +36,8 @@ import {
EuiContextMenuItem,
EuiContextMenuPanel,
EuiEmptyPrompt,
- EuiFieldSearch,
- EuiFilterButton,
+ EuiCompressedFieldSearch,
+ EuiSmallFilterButton,
EuiFilterGroup,
EuiFlexGroup,
EuiFlexItem,
@@ -376,7 +376,7 @@ class SavedObjectFinderUi extends React.Component<
return (
- this.setState({ sortOpen: false })}
button={
-
this.setState(({ sortOpen }) => ({
sortOpen: !sortOpen,
@@ -419,7 +419,7 @@ class SavedObjectFinderUi extends React.Component<
{i18n.translate('savedObjects.finder.sortButtonLabel', {
defaultMessage: 'Sort',
})}
-
+
}
>
this.setState({ filterOpen: false })}
button={
-
this.setState(({ filterOpen }) => ({
filterOpen: !filterOpen,
@@ -452,7 +452,7 @@ class SavedObjectFinderUi extends React.Component<
{i18n.translate('savedObjects.finder.filterButtonLabel', {
defaultMessage: 'Types',
})}
-
+
}
>
-
-
-
-
+
-
-
+
-
@@ -89,8 +89,8 @@ exports[`SavedObjectSaveModal should render matching snapshot 1`] = `
id="savedObjects.saveModal.cancelButtonLabel"
values={Object {}}
/>
-
-
+
Save
-
+
`;
diff --git a/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx b/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx
index 19277fd8080f..fcb013573ebc 100644
--- a/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx
+++ b/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx
@@ -30,21 +30,21 @@
import {
htmlIdGenerator,
- EuiButton,
- EuiButtonEmpty,
+ EuiSmallButton,
+ EuiSmallButtonEmpty,
EuiCallOut,
- EuiFieldText,
+ EuiCompressedFieldText,
EuiForm,
- EuiFormRow,
+ EuiCompressedFormRow,
EuiModal,
EuiModalBody,
EuiModalFooter,
EuiModalHeader,
EuiModalHeaderTitle,
EuiSpacer,
- EuiSwitch,
+ EuiCompressedSwitch,
EuiSwitchEvent,
- EuiTextArea,
+ EuiCompressedTextArea,
} from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
import React from 'react';
@@ -132,13 +132,13 @@ export class SavedObjectSaveModal extends React.Component
{this.renderCopyOnSave()}
-
}
>
-
isInvalid={(!isTitleDuplicateConfirmed && hasTitleDuplicate) || title.length === 0}
aria-describedby={this.state.hasTitleDuplicate ? duplicateWarningId : undefined}
/>
-
+
{this.renderViewDescription()}
@@ -158,12 +158,12 @@ export class SavedObjectSaveModal extends React.Component
-
+
-
+
{this.renderConfirmButton()}
@@ -177,7 +177,7 @@ export class SavedObjectSaveModal extends React.Component
}
return (
-
/>
}
>
-
-
+
);
};
@@ -266,7 +266,7 @@ export class SavedObjectSaveModal extends React.Component
}
return (
-
form="savedObjectSaveModalForm"
>
{confirmLabel}
-
+
);
};
@@ -322,7 +322,7 @@ export class SavedObjectSaveModal extends React.Component
return (
<>
-
-
-
+ {
@@ -95,7 +95,7 @@ export function SavedObjectSaveModalOrigin(props: OriginSaveModalProps) {
)
}
/>
-
+
);
} else {
diff --git a/src/plugins/saved_objects_management/public/management_section/object_view/components/field.tsx b/src/plugins/saved_objects_management/public/management_section/object_view/components/field.tsx
index a53e61a83d5d..a9b0630fc0da 100644
--- a/src/plugins/saved_objects_management/public/management_section/object_view/components/field.tsx
+++ b/src/plugins/saved_objects_management/public/management_section/object_view/components/field.tsx
@@ -29,7 +29,13 @@
*/
import React, { PureComponent } from 'react';
-import { EuiFieldNumber, EuiFieldText, EuiFormRow, EuiSwitch, EuiCodeEditor } from '@elastic/eui';
+import {
+ EuiCompressedFieldNumber,
+ EuiCompressedFieldText,
+ EuiCompressedFormRow,
+ EuiCompressedSwitch,
+ EuiCodeEditor,
+} from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
import { FieldState, FieldType } from '../../types';
@@ -47,9 +53,9 @@ export class Field extends PureComponent {
const { name } = this.props;
return (
-
+
{this.renderField()}
-
+
);
}
@@ -92,7 +98,7 @@ export class Field extends PureComponent {
switch (type) {
case 'number':
return (
- {
);
case 'boolean':
return (
- {
);
default:
return (
- {
{editionEnabled && (
- {
defaultMessage="Save { title } object"
values={{ title: service.type }}
/>
-
+
)}
- {
id="savedObjectsManagement.view.cancelButtonLabel"
defaultMessage="Cancel"
/>
-
+
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap
index 3cadcda91750..d01a503c2620 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap
@@ -244,9 +244,9 @@ exports[`SavedObjectsTable export should allow the user to choose when exporting
-
-
-
+
-
-
-
+
-
@@ -340,7 +340,7 @@ exports[`SavedObjectsTable export should allow the user to choose when exporting
id="savedObjectsManagement.objectsTable.exportObjectsConfirmModal.exportAllButtonLabel"
values={Object {}}
/>
-
+
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/flyout.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/flyout.test.tsx.snap
index 97616da2352b..094719482816 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/flyout.test.tsx.snap
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/flyout.test.tsx.snap
@@ -550,9 +550,9 @@ exports[`Flyout should render cluster selector and import options when datasourc
-
-
-
+
@@ -617,9 +617,9 @@ exports[`Flyout should render cluster selector and import options when datasourc
/>
-
-
+
@@ -705,9 +705,9 @@ exports[`Flyout should render import step 1`] = `
-
-
-
-
+
-
+
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/table.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/table.test.tsx.snap
index e22f7f3a0128..b39b8116078a 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/table.test.tsx.snap
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/table.test.tsx.snap
@@ -26,7 +26,7 @@ exports[`Table prevents saved objects from being deleted 1`] = `
onChange={[Function]}
toolsRight={
Array [
-
- ,
+ ,
-
+
}
closePopover={[Function]}
display="inlineBlock"
@@ -63,9 +63,9 @@ exports[`Table prevents saved objects from being deleted 1`] = `
ownFocus={true}
panelPaddingSize="m"
>
-
-
-
-
+
-
-
-
+
+
,
]
}
@@ -252,7 +252,7 @@ exports[`Table should render normally 1`] = `
onChange={[Function]}
toolsRight={
Array [
-
- ,
+ ,
-
+
}
closePopover={[Function]}
display="inlineBlock"
@@ -288,9 +288,9 @@ exports[`Table should render normally 1`] = `
ownFocus={true}
panelPaddingSize="m"
>
-
-
-
-
+
-
-
-
+
+
,
]
}
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.test.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.test.tsx
index d68f17a64f6c..f6bba9d62957 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.test.tsx
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.test.tsx
@@ -130,7 +130,7 @@ describe('Flyout', () => {
component.update();
expect(component.state('file')).toBe(undefined);
- component.find('EuiFilePicker').simulate('change', [mockFile]);
+ component.find('EuiCompressedFilePicker').simulate('change', [mockFile]);
expect(component.state('file')).toBe(mockFile);
});
@@ -143,9 +143,9 @@ describe('Flyout', () => {
component.update();
expect(component.state('file')).toBe(undefined);
- component.find('EuiFilePicker').simulate('change', [mockFile]);
+ component.find('EuiCompressedFilePicker').simulate('change', [mockFile]);
expect(component.state('file')).toBe(mockFile);
- component.find('EuiFilePicker').simulate('change', []);
+ component.find('EuiCompressedFilePicker').simulate('change', []);
expect(component.state('file')).toBe(undefined);
});
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx
index 4657b898208f..5f14a1c6b111 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx
@@ -40,10 +40,10 @@ import {
EuiText,
EuiTitle,
EuiForm,
- EuiFormRow,
- EuiFilePicker,
+ EuiCompressedFormRow,
+ EuiCompressedFilePicker,
EuiInMemoryTable,
- EuiSelect,
+ EuiCompressedSelect,
EuiFlexGroup,
EuiFlexItem,
EuiLoadingSpinner,
@@ -578,7 +578,7 @@ export class Flyout extends Component {
});
return (
- this.onIndexChanged(id, e)}
options={options}
@@ -765,7 +765,7 @@ export class Flyout extends Component {
return (
- {
/>
}
>
- {
}
onChange={this.setImportFile}
/>
-
+
{this.renderImportControl(importMode, isLegacyFile, dataSourceEnabled)}
@@ -802,7 +802,7 @@ export class Flyout extends Component {
return this.renderImportControlForDataSource(importMode, isLegacyFile);
}
return (
-
+
{
{ defaultMessage: 'Import options' }
)}
/>
-
+
);
}
@@ -840,7 +840,7 @@ export class Flyout extends Component {
/>
-
+
{
{ defaultMessage: 'Conflict management' }
)}
/>
-
+
);
}
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_mode_control.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_mode_control.tsx
index d0c800553996..996eaa2b1b50 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_mode_control.tsx
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_mode_control.tsx
@@ -33,7 +33,7 @@ import {
EuiFormFieldset,
EuiTitle,
EuiCheckableCard,
- EuiRadioGroup,
+ EuiCompressedRadioGroup,
EuiText,
EuiSpacer,
EuiFlexGroup,
@@ -108,7 +108,7 @@ const createLabel = ({ text, tooltip }: { text: string; tooltip: string }) => (
const overwriteRadio = (disabled: boolean, overwrite: boolean, onChange) => {
return (
- onChange({ overwrite: id === overwriteEnabled.id })}
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx
index 56606711db98..9effd038f49b 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx
@@ -34,15 +34,15 @@ import moment from 'moment';
import {
EuiSearchBar,
EuiBasicTable,
- EuiButton,
+ EuiSmallButton,
EuiIcon,
EuiLink,
EuiSpacer,
EuiToolTip,
EuiFormErrorText,
EuiPopover,
- EuiSwitch,
- EuiFormRow,
+ EuiCompressedSwitch,
+ EuiCompressedFormRow,
EuiText,
EuiTableFieldDataColumnType,
EuiTableActionsColumnType,
@@ -353,7 +353,7 @@ export class Table extends PureComponent {
}
const button = (
- {
id="savedObjectsManagement.objectsTable.table.exportPopoverButtonLabel"
defaultMessage="Export"
/>
-
+
);
const activeActionContents = this.state.activeAction?.render() ?? null;
@@ -376,7 +376,7 @@ export class Table extends PureComponent {
filters={filters as any}
onChange={this.onChange}
toolsRight={[
- {
id="savedObjectsManagement.objectsTable.table.deleteButtonLabel"
defaultMessage="Delete"
/>
- ,
+ ,
- {
/>
}
>
- {
checked={this.state.isIncludeReferencesDeepChecked}
onChange={this.toggleIsIncludeReferencesDeepChecked}
/>
-
-
-
+
+
+
-
-
+
+
,
]}
/>
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx
index 38f69a05b35c..28d320fc6fb6 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx
@@ -41,18 +41,18 @@ import {
EuiLoadingSpinner,
EuiOverlayMask,
EUI_MODAL_CONFIRM_BUTTON,
- EuiCheckboxGroup,
+ EuiCompressedCheckboxGroup,
EuiToolTip,
EuiPageContent,
- EuiSwitch,
+ EuiCompressedSwitch,
EuiModal,
EuiModalHeader,
EuiModalBody,
EuiModalFooter,
- EuiButtonEmpty,
- EuiButton,
+ EuiSmallButtonEmpty,
+ EuiSmallButton,
EuiModalHeaderTitle,
- EuiFormRow,
+ EuiCompressedFormRow,
EuiFlexGroup,
EuiFlexItem,
EuiText,
@@ -826,7 +826,7 @@ export class SavedObjectsTable extends Component
-
- {
@@ -851,9 +851,9 @@ export class SavedObjectsTable extends Component
-
+
-
-
+
-
+
-
+
-
+
diff --git a/src/plugins/share/public/components/__snapshots__/url_panel_content.test.tsx.snap b/src/plugins/share/public/components/__snapshots__/url_panel_content.test.tsx.snap
index f2ecc9a1ca07..9dff70770505 100644
--- a/src/plugins/share/public/components/__snapshots__/url_panel_content.test.tsx.snap
+++ b/src/plugins/share/public/components/__snapshots__/url_panel_content.test.tsx.snap
@@ -6,9 +6,9 @@ exports[`share url panel content render 1`] = `
className="osdShareContextMenu__finalPanel"
data-test-subj="shareUrlForm"
>
-
-
-
-
+
-
-
+
@@ -179,9 +179,9 @@ exports[`share url panel content should enable saved object export option when o
className="osdShareContextMenu__finalPanel"
data-test-subj="shareUrlForm"
>
-
-
-
-
+
-
-
+
@@ -341,9 +341,9 @@ exports[`share url panel content should hide short url section when allowShortUr
className="osdShareContextMenu__finalPanel"
data-test-subj="shareUrlForm"
>
-
-
-
+
@@ -458,9 +458,9 @@ exports[`should show url param extensions 1`] = `
className="osdShareContextMenu__finalPanel"
data-test-subj="shareUrlForm"
>
-
-
-
-
+
-
-
+
-
-
+
diff --git a/src/plugins/share/public/components/url_panel_content.test.tsx b/src/plugins/share/public/components/url_panel_content.test.tsx
index 32b59cdf2b5f..bd11af2ea457 100644
--- a/src/plugins/share/public/components/url_panel_content.test.tsx
+++ b/src/plugins/share/public/components/url_panel_content.test.tsx
@@ -28,7 +28,12 @@
* under the License.
*/
-import { EuiCopy, EuiRadioGroup, EuiSwitch, EuiSwitchEvent } from '@elastic/eui';
+import {
+ EuiCopy,
+ EuiCompressedRadioGroup,
+ EuiCompressedSwitch,
+ EuiSwitchEvent,
+} from '@elastic/eui';
jest.mock('../lib/url_shortener', () => ({ shortenUrl: jest.fn() }));
@@ -74,7 +79,9 @@ describe('share url panel content', () => {
/>
);
act(() => {
- component.find(EuiRadioGroup).prop('onChange')!(ExportUrlAsType.EXPORT_URL_AS_SAVED_OBJECT);
+ component.find(EuiCompressedRadioGroup).prop('onChange')!(
+ ExportUrlAsType.EXPORT_URL_AS_SAVED_OBJECT
+ );
});
expect(component.find(EuiCopy).prop('textToCopy')).toEqual(
'http://localhost:5601/app/myapp#/?_g=()'
@@ -95,7 +102,7 @@ describe('share url panel content', () => {
/>
);
await act(async () => {
- component.find(EuiSwitch).prop('onChange')!(({
+ component.find(EuiCompressedSwitch).prop('onChange')!(({
target: { checked: true },
} as unknown) as EuiSwitchEvent);
});
@@ -115,9 +122,11 @@ describe('share url panel content', () => {
/>
);
act(() => {
- component.find(EuiRadioGroup).prop('onChange')!(ExportUrlAsType.EXPORT_URL_AS_SAVED_OBJECT);
+ component.find(EuiCompressedRadioGroup).prop('onChange')!(
+ ExportUrlAsType.EXPORT_URL_AS_SAVED_OBJECT
+ );
});
- expect(component.exists(EuiSwitch)).toEqual(false);
+ expect(component.exists(EuiCompressedSwitch)).toEqual(false);
});
});
@@ -165,7 +174,9 @@ describe('share url panel content', () => {
/>
);
act(() => {
- component.find(EuiRadioGroup).prop('onChange')!(ExportUrlAsType.EXPORT_URL_AS_SAVED_OBJECT);
+ component.find(EuiCompressedRadioGroup).prop('onChange')!(
+ ExportUrlAsType.EXPORT_URL_AS_SAVED_OBJECT
+ );
});
expect(component.find(EuiCopy).prop('textToCopy')).toEqual(
asIframe('http://localhost:5601/app/myapp#/?embed=true&_g=()')
@@ -186,7 +197,7 @@ describe('share url panel content', () => {
/>
);
await act(async () => {
- component.find(EuiSwitch).prop('onChange')!(({
+ component.find(EuiCompressedSwitch).prop('onChange')!(({
target: { checked: true },
} as unknown) as EuiSwitchEvent);
});
@@ -207,9 +218,11 @@ describe('share url panel content', () => {
/>
);
act(() => {
- component.find(EuiRadioGroup).prop('onChange')!(ExportUrlAsType.EXPORT_URL_AS_SAVED_OBJECT);
+ component.find(EuiCompressedRadioGroup).prop('onChange')!(
+ ExportUrlAsType.EXPORT_URL_AS_SAVED_OBJECT
+ );
});
- expect(component.exists(EuiSwitch)).toEqual(false);
+ expect(component.exists(EuiCompressedSwitch)).toEqual(false);
});
});
});
diff --git a/src/plugins/share/public/components/url_panel_content.tsx b/src/plugins/share/public/components/url_panel_content.tsx
index e1d1b4270615..71bb65cfa22f 100644
--- a/src/plugins/share/public/components/url_panel_content.tsx
+++ b/src/plugins/share/public/components/url_panel_content.tsx
@@ -37,12 +37,12 @@ import {
EuiSpacer,
EuiFlexItem,
EuiForm,
- EuiFormRow,
+ EuiCompressedFormRow,
EuiText,
EuiIconTip,
EuiLoadingSpinner,
- EuiRadioGroup,
- EuiSwitch,
+ EuiCompressedRadioGroup,
+ EuiCompressedSwitch,
EuiSwitchEvent,
} from '@elastic/eui';
@@ -385,7 +385,7 @@ export class UrlPanelContent extends Component {
/>
) : undefined;
return (
- {
}
helpText={generateLinkAsHelp}
>
-
-
+
);
};
@@ -421,7 +421,7 @@ export class UrlPanelContent extends Component {
shortUrlLabel
);
const switchComponent = (
- {
);
return (
-
+
{this.renderWithIconTip(switchComponent, tipContent)}
-
+
);
};
@@ -467,9 +467,9 @@ export class UrlPanelContent extends Component {
return (
{this.props.urlParamExtensions.map(({ paramName, component: UrlParamComponent }) => (
-
+
-
+
))}
);
diff --git a/src/plugins/vis_augmenter/public/view_events_flyout/components/date_range_item.tsx b/src/plugins/vis_augmenter/public/view_events_flyout/components/date_range_item.tsx
index e2a7092f1e5f..1ae6bb7e5530 100644
--- a/src/plugins/vis_augmenter/public/view_events_flyout/components/date_range_item.tsx
+++ b/src/plugins/vis_augmenter/public/view_events_flyout/components/date_range_item.tsx
@@ -11,7 +11,7 @@ import {
EuiText,
EuiIcon,
prettyDuration,
- EuiButton,
+ EuiSmallButton,
} from '@elastic/eui';
import { TimeRange } from '../../../../data/common';
import { DATE_RANGE_FORMAT } from './view_events_flyout';
@@ -42,7 +42,7 @@ export function DateRangeItem(props: Props) {
{durationText}
- {
@@ -52,7 +52,7 @@ export function DateRangeItem(props: Props) {
data-test-subj="refreshButton"
>
Refresh
-
+
diff --git a/src/plugins/vis_builder/public/application/components/data_tab/dropbox.tsx b/src/plugins/vis_builder/public/application/components/data_tab/dropbox.tsx
index e5b46b589e0f..260b6e1261b8 100644
--- a/src/plugins/vis_builder/public/application/components/data_tab/dropbox.tsx
+++ b/src/plugins/vis_builder/public/application/components/data_tab/dropbox.tsx
@@ -5,10 +5,10 @@
import { i18n } from '@osd/i18n';
import {
- EuiButtonIcon,
+ EuiSmallButtonIcon,
EuiDraggable,
EuiDroppable,
- EuiFormRow,
+ EuiCompressedFormRow,
EuiPanel,
EuiText,
} from '@elastic/eui';
@@ -72,7 +72,7 @@ const DropboxComponent = ({
);
return (
-
+
-
-
)}
-
+
);
};
diff --git a/src/plugins/vis_builder/public/application/components/data_tab/field_bucket.tsx b/src/plugins/vis_builder/public/application/components/data_tab/field_bucket.tsx
index e724e5bf34b6..15fc947fa22f 100644
--- a/src/plugins/vis_builder/public/application/components/data_tab/field_bucket.tsx
+++ b/src/plugins/vis_builder/public/application/components/data_tab/field_bucket.tsx
@@ -6,7 +6,7 @@
import React from 'react';
import {
EuiText,
- EuiButtonIcon,
+ EuiSmallButtonIcon,
EuiFlexGroup,
EuiFlexItem,
EuiSpacer,
@@ -95,7 +95,7 @@ export function FieldBucket({ bucket, field }: FieldBucketProps) {
-
- {
return (
-
-
-
-
+
`;
diff --git a/src/plugins/vis_default_editor/public/components/controls/components/input_list.tsx b/src/plugins/vis_default_editor/public/components/controls/components/input_list.tsx
index 32b545c6dfba..bf2737af746a 100644
--- a/src/plugins/vis_default_editor/public/components/controls/components/input_list.tsx
+++ b/src/plugins/vis_default_editor/public/components/controls/components/input_list.tsx
@@ -31,7 +31,7 @@
import React, { useState, useEffect, Fragment, useCallback } from 'react';
import { isEmpty, isEqual, mapValues, omitBy, pick } from 'lodash';
import {
- EuiButtonIcon,
+ EuiSmallButtonIcon,
EuiFlexGroup,
EuiFlexItem,
EuiSpacer,
@@ -206,7 +206,7 @@ function InputList({ config, list, onChange, setValidity }: InputListProps) {
{config.renderInputRow(item, index, onChangeValue)}
-
- {
test('should call onDelete', () => {
const comp = shallow();
- comp.find('EuiButtonIcon').simulate('click');
+ comp.find('EuiSmallButtonIcon').simulate('click');
expect(defaultProps.onDelete).lastCalledWith(defaultProps.model.id);
});
diff --git a/src/plugins/vis_default_editor/public/components/controls/components/number_list/number_row.tsx b/src/plugins/vis_default_editor/public/components/controls/components/number_list/number_row.tsx
index 04fe0ea9f64e..4920109914f9 100644
--- a/src/plugins/vis_default_editor/public/components/controls/components/number_list/number_row.tsx
+++ b/src/plugins/vis_default_editor/public/components/controls/components/number_list/number_row.tsx
@@ -30,7 +30,7 @@
import React, { useCallback } from 'react';
-import { EuiFieldNumber, EuiFlexGroup, EuiFlexItem, EuiButtonIcon } from '@elastic/eui';
+import { EuiFieldNumber, EuiFlexGroup, EuiFlexItem, EuiSmallButtonIcon } from '@elastic/eui';
import { i18n } from '@osd/i18n';
import { NumberListRange } from './range';
@@ -106,7 +106,7 @@ function NumberRow({
/>
-
-
+
-
+
);
}
diff --git a/src/plugins/vis_default_editor/public/components/controls/filter.tsx b/src/plugins/vis_default_editor/public/components/controls/filter.tsx
index a258bb68ef40..1e759571be37 100644
--- a/src/plugins/vis_default_editor/public/components/controls/filter.tsx
+++ b/src/plugins/vis_default_editor/public/components/controls/filter.tsx
@@ -29,7 +29,14 @@
*/
import React, { useState } from 'react';
-import { EuiForm, EuiButtonIcon, EuiFieldText, EuiFormRow, EuiSpacer } from '@elastic/eui';
+import {
+ EuiForm,
+ EuiSmallButtonIcon,
+ EuiFieldText,
+ EuiCompressedFormRow,
+ EuiFormRow,
+ EuiSpacer,
+} from '@elastic/eui';
import { i18n } from '@osd/i18n';
import {
@@ -83,7 +90,7 @@ function FilterRow({
const FilterControl = (
- setShowCustomLabel(!showCustomLabel)}
/>
-
-
-
+
{showCustomLabel ? (
-
+
setValue(ev.target.checked)}
/>
-
+
);
}
diff --git a/src/plugins/vis_default_editor/public/components/controls/utils/agg_utils.ts b/src/plugins/vis_default_editor/public/components/controls/utils/agg_utils.ts
index 283b9be49494..58a5d5fb1f89 100644
--- a/src/plugins/vis_default_editor/public/components/controls/utils/agg_utils.ts
+++ b/src/plugins/vis_default_editor/public/components/controls/utils/agg_utils.ts
@@ -76,7 +76,7 @@ function useFallbackMetric(
}
/**
- * this makes an array of available options in appropriate format for EuiSelect,
+ * this makes an array of available options in appropriate format for EuiCompressedSelect,
* calculates if an option is disabled
*/
function useAvailableOptions(
diff --git a/src/plugins/vis_default_editor/public/components/sidebar/sidebar.tsx b/src/plugins/vis_default_editor/public/components/sidebar/sidebar.tsx
index 6cff260060a9..572c7924ccdb 100644
--- a/src/plugins/vis_default_editor/public/components/sidebar/sidebar.tsx
+++ b/src/plugins/vis_default_editor/public/components/sidebar/sidebar.tsx
@@ -31,7 +31,7 @@
import React, { useMemo, useState, useCallback, KeyboardEventHandler, useEffect } from 'react';
import { isEqual } from 'lodash';
import { i18n } from '@osd/i18n';
-import { keys, EuiButtonIcon, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
+import { keys, EuiSmallButtonIcon, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { EventEmitter } from 'events';
import {
@@ -243,7 +243,7 @@ function DefaultEditorSideBar({
-
-
- {
it('calls onAdd={handleAdd}', () => {
const handleAdd = jest.fn();
const wrapper = shallowWithIntl();
- wrapper.find('EuiButtonIcon').at(0).simulate('click');
+ wrapper.find('EuiSmallButtonIcon').at(0).simulate('click');
expect(handleAdd).toHaveBeenCalled();
});
it('calls onDelete={handleDelete}', () => {
const handleDelete = jest.fn();
const wrapper = shallowWithIntl();
- wrapper.find('EuiButtonIcon').at(1).simulate('click');
+ wrapper.find('EuiSmallButtonIcon').at(1).simulate('click');
expect(handleDelete).toHaveBeenCalled();
});
it('calls onClone={handleClone}', () => {
const handleClone = jest.fn();
const wrapper = shallowWithIntl();
- wrapper.find('EuiButtonIcon').at(0).simulate('click');
+ wrapper.find('EuiSmallButtonIcon').at(0).simulate('click');
expect(handleClone).toHaveBeenCalled();
});
diff --git a/src/plugins/vis_type_timeseries/public/application/components/add_delete_buttons.tsx b/src/plugins/vis_type_timeseries/public/application/components/add_delete_buttons.tsx
index caf5fe61394c..e2e03d03c8d3 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/add_delete_buttons.tsx
+++ b/src/plugins/vis_type_timeseries/public/application/components/add_delete_buttons.tsx
@@ -29,7 +29,7 @@
*/
import React, { MouseEvent } from 'react';
-import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui';
+import { EuiSmallButtonIcon, EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui';
import { i18n } from '@osd/i18n';
import { isBoolean } from 'lodash';
@@ -59,7 +59,7 @@ export function AddDeleteButtons(props: AddDeleteButtonsProps) {
return (
-
-
-
- {
const setup = (panelType: string, value: string) => {
@@ -59,7 +59,7 @@ describe('TSVB AggSelect', () => {
it('should only display filter ratio compattible aggs', () => {
const wrapper = setup('filter_ratio', 'avg');
- expect(wrapper.find(EuiComboBox).props().options).toMatchInlineSnapshot(`
+ expect(wrapper.find(EuiCompressedComboBox).props().options).toMatchInlineSnapshot(`
Array [
Object {
"label": "Average",
@@ -99,7 +99,7 @@ describe('TSVB AggSelect', () => {
it('should only display histogram compattible aggs', () => {
const wrapper = setup('histogram', 'avg');
- expect(wrapper.find(EuiComboBox).props().options).toMatchInlineSnapshot(`
+ expect(wrapper.find(EuiCompressedComboBox).props().options).toMatchInlineSnapshot(`
Array [
Object {
"label": "Average",
@@ -123,7 +123,7 @@ describe('TSVB AggSelect', () => {
it('should only display metrics compattible aggs', () => {
const wrapper = setup('metrics', 'avg');
- expect(wrapper.find(EuiComboBox).props().options).toMatchInlineSnapshot(`
+ expect(wrapper.find(EuiCompressedComboBox).props().options).toMatchInlineSnapshot(`
Array [
Object {
"label": "Average",
diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/agg_select.tsx b/src/plugins/vis_type_timeseries/public/application/components/aggs/agg_select.tsx
index e3fdc5a6c3f3..580d6be2e663 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/aggs/agg_select.tsx
+++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/agg_select.tsx
@@ -29,7 +29,7 @@
*/
import React from 'react';
-import { EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui';
+import { EuiCompressedComboBox, EuiComboBoxOptionOption } from '@elastic/eui';
import { i18n } from '@osd/i18n';
// @ts-ignore
import { isMetricEnabled } from '../../lib/check_ui_restrictions';
@@ -329,7 +329,7 @@ export function AggSelect(props: AggSelectUiProps) {
return (
-
-
}
>
-
-
+
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/cumulative_sum.js b/src/plugins/vis_type_timeseries/public/application/components/aggs/cumulative_sum.js
index 682c496cb64e..4337991c0410 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/aggs/cumulative_sum.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/cumulative_sum.js
@@ -41,7 +41,7 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiFormLabel,
- EuiFormRow,
+ EuiCompressedFormRow,
EuiSpacer,
} from '@elastic/eui';
@@ -77,7 +77,7 @@ export function CumulativeSumAgg(props) {
/>
-
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/derivative.js b/src/plugins/vis_type_timeseries/public/application/components/aggs/derivative.js
index 408ba9504ac1..04c44f5277a0 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/aggs/derivative.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/derivative.js
@@ -41,8 +41,8 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiFormLabel,
- EuiFieldText,
- EuiFormRow,
+ EuiCompressedFieldText,
+ EuiCompressedFormRow,
EuiSpacer,
} from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
@@ -87,7 +87,7 @@ export const DerivativeAgg = (props) => {
/>
- {
value={model.field}
fullWidth
/>
-
+
- {
}
fullWidth
>
-
-
+
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/field_select.js b/src/plugins/vis_type_timeseries/public/application/components/aggs/field_select.js
index cf426266d101..399b1bc35309 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/aggs/field_select.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/field_select.js
@@ -30,7 +30,7 @@
import PropTypes from 'prop-types';
import React from 'react';
-import { EuiComboBox } from '@elastic/eui';
+import { EuiCompressedComboBox } from '@elastic/eui';
import { injectI18n } from '@osd/i18n/react';
import { isFieldEnabled } from '../../lib/check_ui_restrictions';
import { i18n } from '@osd/i18n';
@@ -89,7 +89,7 @@ function FieldSelectUi({
}
return (
- {
- {
onChange={handleNumeratorQueryChange}
indexPatterns={[indexPattern]}
/>
-
+
- {
onChange={handleDenominatorQueryChange}
indexPatterns={[indexPattern]}
/>
-
+
@@ -172,7 +172,7 @@ export const FilterRatioAgg = (props) => {
{model.metric_agg !== 'count' ? (
- {
value={model.field}
onChange={handleSelectChange('field')}
/>
-
+
) : null}
diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/filter_ratio.test.js b/src/plugins/vis_type_timeseries/public/application/components/aggs/filter_ratio.test.js
index aeaf8fb883a0..90fffa17fa25 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/aggs/filter_ratio.test.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/filter_ratio.test.js
@@ -32,7 +32,7 @@ import React from 'react';
import { mountWithIntl } from 'test_utils/enzyme_helpers';
import { FilterRatioAgg } from './filter_ratio';
import { FIELDS, METRIC, SERIES, PANEL } from '../../../test_utils';
-import { EuiComboBox } from '@elastic/eui';
+import { EuiCompressedComboBox } from '@elastic/eui';
import { dataPluginMock } from '../../../../../data/public/mocks';
import { setDataStart } from '../../../services';
@@ -73,7 +73,7 @@ describe('TSVB Filter Ratio', () => {
field: 'histogram_value',
};
const wrapper = setup(metric);
- expect(wrapper.find(EuiComboBox).at(1).props().options).toMatchInlineSnapshot(`
+ expect(wrapper.find(EuiCompressedComboBox).at(1).props().options).toMatchInlineSnapshot(`
Array [
Object {
"label": "Average",
@@ -102,7 +102,7 @@ describe('TSVB Filter Ratio', () => {
field: '',
};
const wrapper = setup(metric);
- expect(wrapper.find(EuiComboBox).at(2).props().options).toMatchInlineSnapshot(`
+ expect(wrapper.find(EuiCompressedComboBox).at(2).props().options).toMatchInlineSnapshot(`
Array [
Object {
"label": "number",
@@ -128,7 +128,7 @@ describe('TSVB Filter Ratio', () => {
field: '',
};
const wrapper = setup(metric);
- expect(wrapper.find(EuiComboBox).at(2).props().options).toMatchInlineSnapshot(`
+ expect(wrapper.find(EuiCompressedComboBox).at(2).props().options).toMatchInlineSnapshot(`
Array [
Object {
"label": "date",
diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/math.js b/src/plugins/vis_type_timeseries/public/application/components/aggs/math.js
index 0049ca25b1f0..eb9737b7076e 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/aggs/math.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/math.js
@@ -42,9 +42,9 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiFormLabel,
- EuiTextArea,
+ EuiCompressedTextArea,
EuiLink,
- EuiFormRow,
+ EuiCompressedFormRow,
EuiCode,
EuiSpacer,
} from '@elastic/eui';
@@ -114,7 +114,7 @@ export function MathAgg(props) {
-
}
>
-
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/metric_select.js b/src/plugins/vis_type_timeseries/public/application/components/aggs/metric_select.js
index 3ab5ad8f939f..e47f8d98cc53 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/aggs/metric_select.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/metric_select.js
@@ -32,7 +32,7 @@ import PropTypes from 'prop-types';
import React from 'react';
import { includes } from 'lodash';
import { injectI18n } from '@osd/i18n/react';
-import { EuiComboBox } from '@elastic/eui';
+import { EuiCompressedComboBox } from '@elastic/eui';
import { calculateSiblings } from '../lib/calculate_siblings';
import { calculateLabel } from '../../../../common/calculate_label';
import { basicAggs } from '../../../../common/basic_aggs';
@@ -132,7 +132,7 @@ function MetricSelectUi(props) {
const selectedOptions = selectedOption ? [selectedOption] : [];
return (
- {
/>
- {
metric={model}
value={model.field}
/>
-
+
@@ -173,13 +173,13 @@ export const MovingAverageAgg = (props) => {
-
- {
onChange={handleSelectChange('model_type')}
singleSelection={{ asPlainText: true }}
/>
-
+
- {
onChange={handleNumberChange('window')}
value={model.window}
/>
-
+
@@ -230,75 +230,75 @@ export const MovingAverageAgg = (props) => {
{
-
-
-
+
}
{(model.model_type === MODEL_TYPES.WEIGHTED_EXPONENTIAL_DOUBLE ||
model.model_type === MODEL_TYPES.WEIGHTED_EXPONENTIAL_TRIPLE) && (
-
-
-
+
)}
{model.model_type === MODEL_TYPES.WEIGHTED_EXPONENTIAL_TRIPLE && (
-
-
-
+
-
-
-
+
-
- {
onChange={handleSelectChange('multiplicative')}
singleSelection={{ asPlainText: true }}
/>
-
+
)}
diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/percentile.js b/src/plugins/vis_type_timeseries/public/application/components/aggs/percentile.js
index 178606495c8b..2fd374cb2090 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/aggs/percentile.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/percentile.js
@@ -41,7 +41,7 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiFormLabel,
- EuiFormRow,
+ EuiCompressedFormRow,
} from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
import { OSD_FIELD_TYPES } from '../../../../../../plugins/data/public';
@@ -95,7 +95,7 @@ export function PercentileAgg(props) {
/>
-
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/percentile_rank/multi_value_row.tsx b/src/plugins/vis_type_timeseries/public/application/components/aggs/percentile_rank/multi_value_row.tsx
index c3aaaf48702f..21719c083ff8 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/aggs/percentile_rank/multi_value_row.tsx
+++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/percentile_rank/multi_value_row.tsx
@@ -33,7 +33,7 @@ import { get } from 'lodash';
import { FormattedMessage } from '@osd/i18n/react';
import {
htmlIdGenerator,
- EuiFieldNumber,
+ EuiCompressedFieldNumber,
EuiFlexGroup,
EuiFlexItem,
EuiFormLabel,
@@ -82,7 +82,7 @@ export const MultiValueRow = ({
- {
/>
- {
value={model.field}
onChange={handleSelectChange('field')}
/>
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/percentile_ui.js b/src/plugins/vis_type_timeseries/public/application/components/aggs/percentile_ui.js
index e5d33306bef3..2b7df466a968 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/aggs/percentile_ui.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/percentile_ui.js
@@ -39,8 +39,8 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiFormLabel,
- EuiComboBox,
- EuiFieldNumber,
+ EuiCompressedComboBox,
+ EuiCompressedFieldNumber,
} from '@elastic/eui';
import { injectI18n, FormattedMessage } from '@osd/i18n/react';
@@ -65,7 +65,7 @@ class PercentilesUi extends Component {
const percentileFieldNumber = (
-
-
-
- {
/>
- {
metric={model}
value={model.field}
/>
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/positive_rate.js b/src/plugins/vis_type_timeseries/public/application/components/aggs/positive_rate.js
index c187f57d5087..342d0a36523a 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/aggs/positive_rate.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/positive_rate.js
@@ -40,11 +40,11 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiFormLabel,
- EuiFormRow,
+ EuiCompressedFormRow,
EuiSpacer,
EuiText,
EuiLink,
- EuiComboBox,
+ EuiCompressedComboBox,
} from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
import { i18n } from '@osd/i18n';
@@ -121,7 +121,7 @@ export const PositiveRateAgg = (props) => {
/>
- {
uiRestrictions={props.uiRestrictions}
fullWidth
/>
-
+
- {
}
fullWidth
>
- {
singleSelection={{ asPlainText: true }}
selectedOptions={selectedUnitOptions}
/>
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/serial_diff.js b/src/plugins/vis_type_timeseries/public/application/components/aggs/serial_diff.js
index 5ecb003e56a4..b3fb682d7bb6 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/aggs/serial_diff.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/serial_diff.js
@@ -41,7 +41,7 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiFormLabel,
- EuiFormRow,
+ EuiCompressedFormRow,
EuiSpacer,
} from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
@@ -87,7 +87,7 @@ export const SerialDiffAgg = (props) => {
/>
- {
metric={model}
value={model.field}
/>
-
+
- {
value={model.lag}
type="text"
/>
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/series_agg.js b/src/plugins/vis_type_timeseries/public/application/components/aggs/series_agg.js
index a1b5c029db02..101204281e1e 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/aggs/series_agg.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/series_agg.js
@@ -39,9 +39,9 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiFormLabel,
- EuiComboBox,
+ EuiCompressedComboBox,
EuiTitle,
- EuiFormRow,
+ EuiCompressedFormRow,
EuiSpacer,
} from '@elastic/eui';
import { injectI18n, FormattedMessage } from '@osd/i18n/react';
@@ -172,7 +172,7 @@ function SeriesAggUi(props) {
/>
-
}
>
-
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/static.js b/src/plugins/vis_type_timeseries/public/application/components/aggs/static.js
index 6f41dd2e7d3e..3bd3fc849aab 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/aggs/static.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/static.js
@@ -40,8 +40,8 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiFormLabel,
- EuiFieldNumber,
- EuiFormRow,
+ EuiCompressedFieldNumber,
+ EuiCompressedFormRow,
EuiSpacer,
} from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
@@ -88,7 +88,7 @@ export const Static = (props) => {
/>
- {
/>
}
>
-
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/std_agg.js b/src/plugins/vis_type_timeseries/public/application/components/aggs/std_agg.js
index d99390c747af..79c8497dc5fb 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/aggs/std_agg.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/std_agg.js
@@ -39,7 +39,7 @@ import {
htmlIdGenerator,
EuiFlexGroup,
EuiFlexItem,
- EuiFormRow,
+ EuiCompressedFormRow,
EuiFormLabel,
EuiSpacer,
} from '@elastic/eui';
@@ -86,7 +86,7 @@ export function StandardAgg(props) {
{model.type !== 'count' ? (
-
@@ -103,7 +103,7 @@ export function StandardAgg(props) {
uiRestrictions={uiRestrictions}
fullWidth
/>
-
+
) : null}
diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/std_deviation.js b/src/plugins/vis_type_timeseries/public/application/components/aggs/std_deviation.js
index 35256ba27609..42f76ee308b3 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/aggs/std_deviation.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/std_deviation.js
@@ -41,9 +41,9 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiFormLabel,
- EuiComboBox,
- EuiFieldText,
- EuiFormRow,
+ EuiCompressedComboBox,
+ EuiCompressedFieldText,
+ EuiCompressedFormRow,
EuiSpacer,
} from '@elastic/eui';
import { injectI18n, FormattedMessage } from '@osd/i18n/react';
@@ -128,7 +128,7 @@ const StandardDeviationAggUi = (props) => {
/>
- {
value={model.field}
onChange={handleSelectChange('field')}
/>
-
+
- {
/>
}
>
-
-
+
+
- {
/>
}
>
-
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/std_sibling.js b/src/plugins/vis_type_timeseries/public/application/components/aggs/std_sibling.js
index 408de8b6773b..fbd6f029804c 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/aggs/std_sibling.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/std_sibling.js
@@ -40,10 +40,10 @@ import {
htmlIdGenerator,
EuiFlexGroup,
EuiFlexItem,
- EuiFieldText,
- EuiComboBox,
+ EuiCompressedFieldText,
+ EuiCompressedComboBox,
EuiFormLabel,
- EuiFormRow,
+ EuiCompressedFormRow,
EuiSpacer,
} from '@elastic/eui';
import { injectI18n, FormattedMessage } from '@osd/i18n/react';
@@ -62,14 +62,14 @@ const StandardSiblingAggUi = (props) => {
if (model.type === 'std_deviation_bucket') {
stdDev.sigma = (
-
}
>
-
-
+
+
);
@@ -109,19 +109,19 @@ const StandardSiblingAggUi = (props) => {
stdDev.mode = (
-
}
>
-
-
+
);
}
@@ -154,7 +154,7 @@ const StandardSiblingAggUi = (props) => {
/>
- {
metric={model}
value={model.field}
/>
-
+
{stdDev.sigma}
{stdDev.mode}
diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/top_hit.js b/src/plugins/vis_type_timeseries/public/application/components/aggs/top_hit.js
index fbe8614f8fe9..7580c1c881bd 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/aggs/top_hit.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/top_hit.js
@@ -41,9 +41,9 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiFormLabel,
- EuiComboBox,
+ EuiCompressedComboBox,
EuiSpacer,
- EuiFormRow,
+ EuiCompressedFormRow,
} from '@elastic/eui';
import { injectI18n, FormattedMessage } from '@osd/i18n/react';
import { OSD_FIELD_TYPES } from '../../../../../../plugins/data/public';
@@ -178,7 +178,7 @@ const TopHitAggUi = (props) => {
/>
-
@@ -192,7 +192,7 @@ const TopHitAggUi = (props) => {
value={model.field}
onChange={handleSelectChange('field')}
/>
-
+
@@ -200,7 +200,7 @@ const TopHitAggUi = (props) => {
-
@@ -215,10 +215,10 @@ const TopHitAggUi = (props) => {
value={model.size}
onChange={handleTextChange('size')}
/>
-
+
- {
/>
}
>
- {
onChange={handleSelectChange('agg_with')}
singleSelection={{ asPlainText: true }}
/>
-
+
- {
indexPattern={indexPattern}
fields={fields}
/>
-
+
-
}
>
- {
onChange={handleSelectChange('order')}
singleSelection={{ asPlainText: true }}
/>
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/vars.js b/src/plugins/vis_type_timeseries/public/application/components/aggs/vars.js
index 36eef85abac9..a1296d42599e 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/aggs/vars.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/vars.js
@@ -36,7 +36,7 @@ import _ from 'lodash';
import { AddDeleteButtons } from '../add_delete_buttons';
import { collectionActions } from '../lib/collection_actions';
import { MetricSelect } from './metric_select';
-import { EuiFlexGroup, EuiFlexItem, EuiFieldText } from '@elastic/eui';
+import { EuiFlexGroup, EuiFlexItem, EuiCompressedFieldText } from '@elastic/eui';
export const newVariable = (opts) => ({ id: uuid.v1(), name: '', field: '', ...opts });
@@ -63,7 +63,7 @@ export class CalculationVars extends Component {
-
-
-
-
+
-
-
+
@@ -175,7 +175,7 @@ export class AnnotationsEditor extends Component {
- this.handleQueryChange(model, query)}
indexPatterns={[model.index_pattern]}
/>
-
+
@@ -229,7 +229,7 @@ export class AnnotationsEditor extends Component {
-
-
+
-
-
-
+
-
-
-
+
@@ -315,12 +315,12 @@ export class AnnotationsEditor extends Component {
defaultMessage="Click the button below to create an annotation data source."
/>
-
+
-
+
);
} else {
diff --git a/src/plugins/vis_type_timeseries/public/application/components/color_rules.js b/src/plugins/vis_type_timeseries/public/application/components/color_rules.js
index d05b00819fd5..31b7c3e6ee2b 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/color_rules.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/color_rules.js
@@ -36,8 +36,8 @@ import { collectionActions } from './lib/collection_actions';
import { ColorPicker } from './color_picker';
import {
htmlIdGenerator,
- EuiComboBox,
- EuiFieldNumber,
+ EuiCompressedComboBox,
+ EuiCompressedFieldNumber,
EuiFormLabel,
EuiFlexGroup,
EuiFlexItem,
@@ -175,7 +175,7 @@ class ColorRulesUI extends Component {
-
-
-
-
+
-
+
-
}
>
-
-
+
-
}
>
-
-
+
{selectedTo && selectedTo.value !== 'humanize' && (
-
}
>
- (this.decimals = el)}
placeholder={DEFAULT_OUTPUT_PRECISION}
onChange={this.handleDurationChange('decimals')}
/>
-
+
)}
@@ -253,7 +253,7 @@ class DataFormatPickerUI extends Component {
if (defaultValue === 'custom') {
custom = (
-
}
>
- (this.custom = el)}
onChange={this.handleCustomChange}
/>
-
+
);
}
return (
-
-
+
-
+
{custom}
diff --git a/src/plugins/vis_type_timeseries/public/application/components/icon_select/__snapshots__/icon_select.test.js.snap b/src/plugins/vis_type_timeseries/public/application/components/icon_select/__snapshots__/icon_select.test.js.snap
index dd454231a9ac..da5615ae684f 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/icon_select/__snapshots__/icon_select.test.js.snap
+++ b/src/plugins/vis_type_timeseries/public/application/components/icon_select/__snapshots__/icon_select.test.js.snap
@@ -1,9 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`src/legacy/core_plugins/metrics/public/components/icon_select/icon_select.js should render and match a snapshot 1`] = `
- value === option.value) || ICONS[0];
return (
-
-
-
-
+
{i18n.translate('visTypeTimeseries.indexPattern.timeRange.hint', {
defaultMessage: `This setting controls the timespan used for matching documents.
@@ -174,7 +174,7 @@ export const IndexPattern = ({ fields, prefix, onChange, disabled, model: _model
{!!mdsEnabled && (
-
-
+
)}
-
-
-
+
-
-
+
- =1m are required values and must not be translated.',
})}
>
-
-
+
-
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/panel_config/gauge.js b/src/plugins/vis_type_timeseries/public/application/components/panel_config/gauge.js
index cf0130084720..d623915074a9 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/panel_config/gauge.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/panel_config/gauge.js
@@ -40,16 +40,16 @@ import uuid from 'uuid';
import { YesNo } from '../yes_no';
import {
htmlIdGenerator,
- EuiComboBox,
+ EuiCompressedComboBox,
EuiTabs,
EuiTab,
EuiPanel,
EuiFlexGroup,
EuiFlexItem,
- EuiFormRow,
+ EuiCompressedFormRow,
EuiFormLabel,
EuiSpacer,
- EuiFieldNumber,
+ EuiCompressedFieldNumber,
EuiTitle,
EuiHorizontalRule,
} from '@elastic/eui';
@@ -154,7 +154,7 @@ class GaugePanelConfigUi extends Component {
- this.props.onChange({ filter })}
indexPatterns={[model.index_pattern || model.default_index_pattern]}
/>
-
+
@@ -206,7 +206,7 @@ class GaugePanelConfigUi extends Component {
-
-
+
-
}
>
-
-
+
-
}
>
-
-
+
-
}
>
-
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/panel_config/markdown.js b/src/plugins/vis_type_timeseries/public/application/components/panel_config/markdown.js
index 7162677609a1..8c605a31c8f0 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/panel_config/markdown.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/panel_config/markdown.js
@@ -40,13 +40,13 @@ import { MarkdownEditor } from '../markdown_editor';
import less from 'less/lib/less-browser';
import {
htmlIdGenerator,
- EuiComboBox,
+ EuiCompressedComboBox,
EuiTabs,
EuiTab,
EuiPanel,
EuiFlexGroup,
EuiFlexItem,
- EuiFormRow,
+ EuiCompressedFormRow,
EuiFormLabel,
EuiSpacer,
EuiTitle,
@@ -160,7 +160,7 @@ class MarkdownPanelConfigUi extends Component {
- this.props.onChange({ filter })}
indexPatterns={[model.index_pattern || model.default_index_pattern]}
/>
-
+
@@ -268,7 +268,7 @@ class MarkdownPanelConfigUi extends Component {
-
- this.props.onChange({ filter })}
indexPatterns={[model.index_pattern || model.default_index_pattern]}
/>
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/panel_config/table.js b/src/plugins/vis_type_timeseries/public/application/components/panel_config/table.js
index 0a51b3266e88..e5ce1e9f9865 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/panel_config/table.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/panel_config/table.js
@@ -44,10 +44,10 @@ import {
EuiPanel,
EuiFlexGroup,
EuiFlexItem,
- EuiFormRow,
+ EuiCompressedFormRow,
EuiFormLabel,
EuiSpacer,
- EuiFieldText,
+ EuiCompressedFieldText,
EuiTitle,
EuiHorizontalRule,
EuiCode,
@@ -117,7 +117,7 @@ export class TablePanelConfig extends Component {
-
-
+
-
-
-
+
-
-
+
@@ -201,7 +201,7 @@ export class TablePanelConfig extends Component {
-
}
>
-
-
+
@@ -237,7 +237,7 @@ export class TablePanelConfig extends Component {
- this.props.onChange({ filter })}
indexPatterns={[model.index_pattern || model.default_index_pattern]}
/>
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/panel_config/timeseries.js b/src/plugins/vis_type_timeseries/public/application/components/panel_config/timeseries.js
index d4eaec9c4da2..ac95f5450df1 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/panel_config/timeseries.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/panel_config/timeseries.js
@@ -39,16 +39,16 @@ import { ColorPicker } from '../color_picker';
import { YesNo } from '../yes_no';
import {
htmlIdGenerator,
- EuiComboBox,
+ EuiCompressedComboBox,
EuiTabs,
EuiTab,
EuiPanel,
EuiFlexGroup,
EuiFlexItem,
- EuiFormRow,
+ EuiCompressedFormRow,
EuiFormLabel,
EuiSpacer,
- EuiFieldText,
+ EuiCompressedFieldText,
EuiTitle,
EuiHorizontalRule,
} from '@elastic/eui';
@@ -210,7 +210,7 @@ class TimeseriesPanelConfigUi extends Component {
- this.props.onChange({ filter })}
indexPatterns={[model.index_pattern || model.default_index_pattern]}
/>
-
+
@@ -262,7 +262,7 @@ class TimeseriesPanelConfigUi extends Component {
-
}
>
-
-
+
+
-
}
>
-
-
+
+
-
}
>
-
-
+
-
}
>
-
-
+
@@ -369,7 +375,7 @@ class TimeseriesPanelConfigUi extends Component {
-
-
-
}
>
-
-
+
@@ -144,7 +144,7 @@ export class TopNPanelConfig extends Component {
- this.props.onChange({ filter })}
indexPatterns={[model.index_pattern || model.default_index_pattern]}
/>
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/series_config.js b/src/plugins/vis_type_timeseries/public/application/components/series_config.js
index 6d6f9df1c2d0..c82471e25444 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/series_config.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/series_config.js
@@ -39,8 +39,8 @@ import {
htmlIdGenerator,
EuiFlexGroup,
EuiFlexItem,
- EuiFieldText,
- EuiFormRow,
+ EuiCompressedFieldText,
+ EuiCompressedFormRow,
EuiCode,
EuiHorizontalRule,
EuiFormLabel,
@@ -67,7 +67,7 @@ export const SeriesConfig = (props) => {
- {
onChange={(filter) => props.onChange({ filter })}
indexPatterns={[seriesIndexPattern]}
/>
-
+
- {
}
fullWidth
>
-
-
+
- {
/>
}
>
-
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/splits/__snapshots__/terms.test.js.snap b/src/plugins/vis_type_timeseries/public/application/components/splits/__snapshots__/terms.test.js.snap
index 7126483afa9d..809e40002f5d 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/splits/__snapshots__/terms.test.js.snap
+++ b/src/plugins/vis_type_timeseries/public/application/components/splits/__snapshots__/terms.test.js.snap
@@ -4,9 +4,9 @@ exports[`src/legacy/core_plugins/metrics/public/components/splits/terms.test.js
-
-
+
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
-
-
+
-
-
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/splits/everything.js b/src/plugins/vis_type_timeseries/public/application/components/splits/everything.js
index c482e3763ac9..0a053415a1b0 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/splits/everything.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/splits/everything.js
@@ -32,7 +32,7 @@ import { createSelectHandler } from '../lib/create_select_handler';
import { GroupBySelect } from './group_by_select';
import PropTypes from 'prop-types';
import React from 'react';
-import { htmlIdGenerator, EuiFlexGroup, EuiFlexItem, EuiFormRow } from '@elastic/eui';
+import { htmlIdGenerator, EuiFlexGroup, EuiFlexItem, EuiCompressedFormRow } from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
export const SplitByEverything = (props) => {
@@ -42,7 +42,7 @@ export const SplitByEverything = (props) => {
return (
- {
onChange={handleSelectChange('split_mode')}
uiRestrictions={uiRestrictions}
/>
-
+
);
diff --git a/src/plugins/vis_type_timeseries/public/application/components/splits/filter.js b/src/plugins/vis_type_timeseries/public/application/components/splits/filter.js
index 8e615036f07c..70b3d78f833c 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/splits/filter.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/splits/filter.js
@@ -32,7 +32,7 @@ import { createSelectHandler } from '../lib/create_select_handler';
import { GroupBySelect } from './group_by_select';
import PropTypes from 'prop-types';
import React from 'react';
-import { htmlIdGenerator, EuiFlexGroup, EuiFlexItem, EuiFormRow } from '@elastic/eui';
+import { htmlIdGenerator, EuiFlexGroup, EuiFlexItem, EuiCompressedFormRow } from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
import { getDefaultQueryLanguage } from '../lib/get_default_query_language';
import { QueryBarWrapper } from '../query_bar_wrapper';
@@ -46,7 +46,7 @@ export const SplitByFilter = (props) => {
return (
- {
onChange={handleSelectChange('split_mode')}
uiRestrictions={uiRestrictions}
/>
-
+
- {
onChange={(filter) => onChange({ filter })}
indexPatterns={[indexPattern]}
/>
-
+
);
diff --git a/src/plugins/vis_type_timeseries/public/application/components/splits/filter_items.js b/src/plugins/vis_type_timeseries/public/application/components/splits/filter_items.js
index 7e1a392c2efb..09c5df0f2022 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/splits/filter_items.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/splits/filter_items.js
@@ -35,7 +35,7 @@ import { collectionActions } from '../lib/collection_actions';
import { AddDeleteButtons } from '../add_delete_buttons';
import { ColorPicker } from '../color_picker';
import uuid from 'uuid';
-import { EuiFieldText, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
+import { EuiCompressedFieldText, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { injectI18n } from '@osd/i18n/react';
import { getDefaultQueryLanguage } from '../lib/get_default_query_language';
import { QueryBarWrapper } from '../query_bar_wrapper';
@@ -98,7 +98,7 @@ class FilterItemsUi extends Component {
/>
- {
@@ -44,7 +44,7 @@ export const SplitByFilters = (props) => {
- {
onChange={handleSelectChange('split_mode')}
uiRestrictions={uiRestrictions}
/>
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/splits/group_by_select.js b/src/plugins/vis_type_timeseries/public/application/components/splits/group_by_select.js
index 10b0891ada5d..bb10d95993d0 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/splits/group_by_select.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/splits/group_by_select.js
@@ -30,7 +30,7 @@
import PropTypes from 'prop-types';
import React from 'react';
-import { EuiComboBox } from '@elastic/eui';
+import { EuiCompressedComboBox } from '@elastic/eui';
import { injectI18n } from '@osd/i18n/react';
import { isGroupByFieldsEnabled } from '../../lib/check_ui_restrictions';
@@ -76,7 +76,7 @@ function GroupBySelectUi(props) {
});
return (
-
-
-
+
-
-
+
{selectedFieldType === FIELD_TYPES.STRING && (
-
}
>
-
-
+
-
}
>
-
-
+
)}
-
}
>
-
-
+
-
-
+
-
}
>
-
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/splits/terms.test.js b/src/plugins/vis_type_timeseries/public/application/components/splits/terms.test.js
index dc5e1f17c1ed..e2adcefa10cd 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/splits/terms.test.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/splits/terms.test.js
@@ -40,6 +40,10 @@ jest.mock('@elastic/eui', () => ({
EuiFieldNumber: jest.requireActual('@elastic/eui').EuiFieldNumber,
EuiComboBox: jest.requireActual('@elastic/eui').EuiComboBox,
EuiFieldText: jest.requireActual('@elastic/eui').EuiFieldText,
+ EuiCompressedFormRow: jest.requireActual('@elastic/eui').EuiCompressedFormRow,
+ EuiCompressedFieldNumber: jest.requireActual('@elastic/eui').EuiCompressedFieldNumber,
+ EuiCompressedComboBox: jest.requireActual('@elastic/eui').EuiCompressedComboBox,
+ EuiCompressedFieldText: jest.requireActual('@elastic/eui').EuiCompressedFieldText,
}));
describe('src/legacy/core_plugins/metrics/public/components/splits/terms.test.js', () => {
diff --git a/src/plugins/vis_type_timeseries/public/application/components/splits/unsupported_split.js b/src/plugins/vis_type_timeseries/public/application/components/splits/unsupported_split.js
index ca956553b8a9..d0abd503ef83 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/splits/unsupported_split.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/splits/unsupported_split.js
@@ -36,7 +36,7 @@ import {
htmlIdGenerator,
EuiFlexGroup,
EuiFlexItem,
- EuiFormRow,
+ EuiCompressedFormRow,
EuiCode,
EuiTitle,
} from '@elastic/eui';
@@ -50,7 +50,7 @@ export const SplitUnsupported = (props) => {
return (
- {
onChange={handleSelectChange('split_mode')}
uiRestrictions={uiRestrictions}
/>
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/vis_editor_visualization.js b/src/plugins/vis_type_timeseries/public/application/components/vis_editor_visualization.js
index 958ac1c76218..e3f979d2688d 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/vis_editor_visualization.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/vis_editor_visualization.js
@@ -31,7 +31,14 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { get } from 'lodash';
-import { keys, EuiFlexGroup, EuiFlexItem, EuiButton, EuiText, EuiSwitch } from '@elastic/eui';
+import {
+ keys,
+ EuiFlexGroup,
+ EuiFlexItem,
+ EuiButton,
+ EuiText,
+ EuiCompressedSwitch,
+} from '@elastic/eui';
import { FormattedMessage, injectI18n } from '@osd/i18n/react';
import {
getInterval,
@@ -203,7 +210,7 @@ class VisEditorVisualizationUI extends Component {
const applyButton = (
-
- {colorPicker}
-
-
-
-
-
-
-
-
-
+
@@ -180,7 +180,7 @@ class TableSeriesConfigUI extends Component {
- this.props.onChange({ filter })}
indexPatterns={[this.props.indexPatternForQuery]}
/>
-
+
@@ -219,7 +219,7 @@ class TableSeriesConfigUI extends Component {
-
@@ -232,10 +232,10 @@ class TableSeriesConfigUI extends Component {
onChange={handleSelectChange('aggregate_by')}
fullWidth
/>
-
+
-
-
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/vis_types/table/series.js b/src/plugins/vis_type_timeseries/public/application/components/vis_types/table/series.js
index b27590b84013..557233cf87b3 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/vis_types/table/series.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/vis_types/table/series.js
@@ -38,8 +38,8 @@ import {
EuiTab,
EuiFlexGroup,
EuiFlexItem,
- EuiFieldText,
- EuiButtonIcon,
+ EuiCompressedFieldText,
+ EuiSmallButtonIcon,
} from '@elastic/eui';
import { createTextHandler } from '../../lib/create_text_handler';
import { FormattedMessage, injectI18n } from '@osd/i18n/react';
@@ -124,7 +124,7 @@ function TableSeriesUI(props) {
-
-
-
}
>
-
-
+
-
}
>
-
-
+
-
}
>
-
-
+
-
}
>
-
-
+
-
}
>
-
-
+
@@ -284,7 +284,7 @@ export const TimeseriesConfig = injectI18n(function (props) {
type = (
-
}
>
-
-
+
-
}
>
-
-
+
-
}
>
-
-
+
-
}
>
-
-
+
);
@@ -372,7 +372,7 @@ export const TimeseriesConfig = injectI18n(function (props) {
-
-
-
+
- props.onChange({ filter })}
indexPatterns={[seriesIndexPattern]}
/>
-
+
@@ -434,7 +434,7 @@ export const TimeseriesConfig = injectI18n(function (props) {
-
}
>
-
-
+
@@ -462,7 +462,7 @@ export const TimeseriesConfig = injectI18n(function (props) {
-
}
>
-
-
+
@@ -496,7 +496,7 @@ export const TimeseriesConfig = injectI18n(function (props) {
-
-
+
-
-
+
-
}
>
-
-
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/series.js b/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/series.js
index 8930fc512aca..d79f98661287 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/series.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/series.js
@@ -40,8 +40,8 @@ import {
EuiTab,
EuiFlexGroup,
EuiFlexItem,
- EuiFieldText,
- EuiButtonIcon,
+ EuiCompressedFieldText,
+ EuiSmallButtonIcon,
} from '@elastic/eui';
import { Split } from '../../split';
import { createTextHandler } from '../../lib/create_text_handler';
@@ -148,7 +148,7 @@ const TimeseriesSeriesUI = injectI18n(function (props) {
- {colorPicker}
-
- {colorPicker}
-
-
- {
it('call onChange={handleChange} on yes', () => {
const handleChange = sinon.spy();
const wrapper = shallowWithIntl();
- wrapper.find('EuiRadio').first().simulate('change');
+ wrapper.find('EuiCompressedRadio').first().simulate('change');
expect(handleChange.calledOnce).to.equal(true);
expect(handleChange.firstCall.args[0]).to.eql({
test: 1,
@@ -48,7 +48,7 @@ describe('YesNo', () => {
it('call onChange={handleChange} on no', () => {
const handleChange = sinon.spy();
const wrapper = shallowWithIntl();
- wrapper.find('EuiRadio').last().simulate('change');
+ wrapper.find('EuiCompressedRadio').last().simulate('change');
expect(handleChange.calledOnce).to.equal(true);
expect(handleChange.firstCall.args[0]).to.eql({
test: 0,
diff --git a/src/plugins/vis_type_vega/public/components/vega_actions_menu.tsx b/src/plugins/vis_type_vega/public/components/vega_actions_menu.tsx
index e16fa393d3df..cb0f02c3b476 100644
--- a/src/plugins/vis_type_vega/public/components/vega_actions_menu.tsx
+++ b/src/plugins/vis_type_vega/public/components/vega_actions_menu.tsx
@@ -29,7 +29,12 @@
*/
import React, { useState, useCallback } from 'react';
-import { EuiButtonIcon, EuiContextMenuPanel, EuiContextMenuItem, EuiPopover } from '@elastic/eui';
+import {
+ EuiSmallButtonIcon,
+ EuiContextMenuPanel,
+ EuiContextMenuItem,
+ EuiPopover,
+} from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
import { i18n } from '@osd/i18n';
@@ -55,7 +60,7 @@ function VegaActionsMenu({ formatHJson, formatJson }: VegaActionsMenuProps) {
const closePopover = useCallback(() => setIsPopoverOpen(false), []);
const button = (
- {
- ({
label: item.id,
diff --git a/src/plugins/vis_type_vislib/public/components/options/metrics_axes/__snapshots__/value_axes_panel.test.tsx.snap b/src/plugins/vis_type_vislib/public/components/options/metrics_axes/__snapshots__/value_axes_panel.test.tsx.snap
index ed7ae45eed3a..621aab0a3dd3 100644
--- a/src/plugins/vis_type_vislib/public/components/options/metrics_axes/__snapshots__/value_axes_panel.test.tsx.snap
+++ b/src/plugins/vis_type_vislib/public/components/options/metrics_axes/__snapshots__/value_axes_panel.test.tsx.snap
@@ -32,7 +32,7 @@ exports[`ValueAxesPanel component should init with the default set of props 1`]
delay="regular"
position="bottom"
>
-
-
- (
- removeValueAxis(axis)}
@@ -134,7 +134,7 @@ function ValueAxesPanel(props: ValueAxesPanelProps) {
-
);
};
diff --git a/src/plugins/workspace/public/components/workspace_form/workspace_bottom_bar.tsx b/src/plugins/workspace/public/components/workspace_form/workspace_bottom_bar.tsx
index c189c937be45..79819a217de8 100644
--- a/src/plugins/workspace/public/components/workspace_form/workspace_bottom_bar.tsx
+++ b/src/plugins/workspace/public/components/workspace_form/workspace_bottom_bar.tsx
@@ -5,8 +5,8 @@
import {
EuiBottomBar,
- EuiButton,
- EuiButtonEmpty,
+ EuiSmallButton,
+ EuiSmallButtonEmpty,
EuiFlexGroup,
EuiFlexItem,
EuiSpacer,
@@ -54,7 +54,7 @@ export const WorkspaceBottomBar = ({
-
+
-
+
diff --git a/src/plugins/workspace/public/components/workspace_form/workspace_create_action_panel.tsx b/src/plugins/workspace/public/components/workspace_form/workspace_create_action_panel.tsx
index f10a80395488..a7824ffac428 100644
--- a/src/plugins/workspace/public/components/workspace_form/workspace_create_action_panel.tsx
+++ b/src/plugins/workspace/public/components/workspace_form/workspace_create_action_panel.tsx
@@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
-import { EuiButton, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
+import { EuiSmallButton, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { i18n } from '@osd/i18n';
import React, { useState, useCallback } from 'react';
import { ApplicationStart } from 'opensearch-dashboards/public';
@@ -26,17 +26,17 @@ export const WorkspaceCreateActionPanel = ({
<>
-
{i18n.translate('workspace.form.bottomBar.cancel', {
defaultMessage: 'Cancel',
})}
-
+
-
+
{isCancelModalVisible && (
diff --git a/src/plugins/workspace/public/components/workspace_form/workspace_enter_details_panel.tsx b/src/plugins/workspace/public/components/workspace_form/workspace_enter_details_panel.tsx
index 649890151204..88915665c8cb 100644
--- a/src/plugins/workspace/public/components/workspace_form/workspace_enter_details_panel.tsx
+++ b/src/plugins/workspace/public/components/workspace_form/workspace_enter_details_panel.tsx
@@ -5,11 +5,11 @@
import {
EuiColorPicker,
- EuiFieldText,
- EuiFormRow,
+ EuiCompressedFieldText,
+ EuiCompressedFormRow,
EuiSpacer,
EuiText,
- EuiTextArea,
+ EuiCompressedTextArea,
} from '@elastic/eui';
import { i18n } from '@osd/i18n';
import React from 'react';
@@ -39,7 +39,7 @@ export const EnterDetailsPanel = ({
}: EnterDetailsPanelProps) => {
return (
<>
-
-
-
-
+
Description - optional
@@ -74,7 +74,7 @@ export const EnterDetailsPanel = ({
'Help others understand the purpose of this workspace by providing an overview of the workspace you’re creating.',
})}
-
>
-
-
+
-
+
>
);
};
diff --git a/src/plugins/workspace/public/components/workspace_form/workspace_permission_setting_input.tsx b/src/plugins/workspace/public/components/workspace_form/workspace_permission_setting_input.tsx
index a33fddbc3a3c..8827f9bf9b74 100644
--- a/src/plugins/workspace/public/components/workspace_form/workspace_permission_setting_input.tsx
+++ b/src/plugins/workspace/public/components/workspace_form/workspace_permission_setting_input.tsx
@@ -6,7 +6,7 @@
import React, { useCallback, useMemo } from 'react';
import {
EuiFlexGroup,
- EuiComboBox,
+ EuiCompressedComboBox,
EuiFlexItem,
EuiButtonIcon,
EuiButtonGroup,
@@ -133,7 +133,7 @@ export const WorkspacePermissionSettingInput = ({
return (
-
-
<>>
-
+
-
<>>
-
+
{permissionSettings.map((item, index) => (
-
+
-
+
))}
-
+
);
};
diff --git a/src/plugins/workspace/public/components/workspace_form/workspace_use_case.tsx b/src/plugins/workspace/public/components/workspace_form/workspace_use_case.tsx
index e77f5b03c709..24568dfbfe8d 100644
--- a/src/plugins/workspace/public/components/workspace_form/workspace_use_case.tsx
+++ b/src/plugins/workspace/public/components/workspace_form/workspace_use_case.tsx
@@ -5,7 +5,13 @@
import React, { useCallback } from 'react';
import { i18n } from '@osd/i18n';
-import { EuiCheckableCard, EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiText } from '@elastic/eui';
+import {
+ EuiCheckableCard,
+ EuiFlexGroup,
+ EuiFlexItem,
+ EuiCompressedFormRow,
+ EuiText,
+} from '@elastic/eui';
import { DEFAULT_NAV_GROUPS } from '../../../../../core/public';
import { WorkspaceUseCase as WorkspaceUseCaseObject } from '../../types';
@@ -64,7 +70,7 @@ export const WorkspaceUseCase = ({
availableUseCases,
}: WorkspaceUseCaseProps) => {
return (
-
))}
-
+
);
};
diff --git a/src/plugins/workspace/public/components/workspace_list/index.tsx b/src/plugins/workspace/public/components/workspace_list/index.tsx
index 0d608a918473..3d6604122e48 100644
--- a/src/plugins/workspace/public/components/workspace_list/index.tsx
+++ b/src/plugins/workspace/public/components/workspace_list/index.tsx
@@ -10,7 +10,7 @@ import {
EuiPageHeader,
EuiPageContent,
EuiLink,
- EuiButton,
+ EuiSmallButton,
EuiInMemoryTable,
EuiSearchBarProps,
} from '@elastic/eui';
@@ -175,7 +175,7 @@ export const WorkspaceList = ({ registeredUseCases$ }: WorkspaceListProps) => {
toolsRight: [
...(isDashboardAdmin
? [
- {
{i18n.translate('workspace.workspaceList.buttons.createWorkspace', {
defaultMessage: 'Create workspace',
})}
- ,
+ ,
]
: []),
],
diff --git a/src/plugins/workspace/public/components/workspace_menu/workspace_menu.tsx b/src/plugins/workspace/public/components/workspace_menu/workspace_menu.tsx
index aadfab05900d..eae3ccc87152 100644
--- a/src/plugins/workspace/public/components/workspace_menu/workspace_menu.tsx
+++ b/src/plugins/workspace/public/components/workspace_menu/workspace_menu.tsx
@@ -19,6 +19,9 @@ import {
EuiListGroup,
EuiButtonIcon,
EuiButtonEmpty,
+ EuiSmallButton,
+ EuiSmallButtonIcon,
+ EuiSmallButtonEmpty,
EuiListGroupItem,
} from '@elastic/eui';
import { BehaviorSubject } from 'rxjs';
@@ -106,7 +109,7 @@ export const WorkspaceMenu = ({ coreStart, registeredUseCases$ }: Props) => {
};
const currentWorkspaceButton = currentWorkspace ? (
-
+
{
color={currentWorkspace.color}
initialsLength={2}
/>
-
+
) : (
- {
{getUseCase(currentWorkspace)?.title ?? ''}
- {
closePopover();
@@ -223,7 +226,7 @@ export const WorkspaceMenu = ({ coreStart, registeredUseCases$ }: Props) => {
}}
>
{manageWorkspaceButton}
-
+
>
) : (
@@ -235,7 +238,7 @@ export const WorkspaceMenu = ({ coreStart, registeredUseCases$ }: Props) => {
{currentWorkspaceName}
- {
closePopover();
@@ -243,7 +246,7 @@ export const WorkspaceMenu = ({ coreStart, registeredUseCases$ }: Props) => {
}}
>
{manageWorkspacesButton}
-
+
>
)}
diff --git a/src/test_utils/public/testbed/types.ts b/src/test_utils/public/testbed/types.ts
index 9df36d3f97e3..b4595e6140ad 100644
--- a/src/test_utils/public/testbed/types.ts
+++ b/src/test_utils/public/testbed/types.ts
@@ -104,8 +104,8 @@ export interface TestBed {
isAsync?: boolean
) => Promise | void;
/**
- * Set the value of a or a mocked
- * For the you need to mock it like this
+ * Set the value of a or a mocked
+ * For the you need to mock it like this
*
```typescript
jest.mock('@elastic/eui', () => {
@@ -113,7 +113,7 @@ export interface TestBed {
return {
...original,
- EuiSuperSelect: (props: any) => (
+ EuiCompressedSuperSelect: (props: any) => (
{
*/
selectCheckBox: (checkboxTestSubject: T, isChecked?: boolean) => void;
/**
- * Toggle the EuiSwitch
+ * Toggle the EuiCompressedSwitch
*
- * @param switchTestSubject The test subject of the EuiSwitch (can be a nested path. e.g. "myForm.mySwitch").
+ * @param switchTestSubject The test subject of the EuiCompressedSwitch (can be a nested path. e.g. "myForm.mySwitch").
*/
toggleEuiSwitch: (switchTestSubject: T, isChecked?: boolean) => void;
/**
diff --git a/test/functional/apps/dashboard/dashboard_saved_query.js b/test/functional/apps/dashboard/dashboard_saved_query.js
index a8d54afac776..c1995eaa2a45 100644
--- a/test/functional/apps/dashboard/dashboard_saved_query.js
+++ b/test/functional/apps/dashboard/dashboard_saved_query.js
@@ -58,7 +58,7 @@ export default function ({ getService, getPageObjects }) {
await savedQueryManagementComponent.openSavedQueryManagementComponent();
const descriptionText = await testSubjects.getVisibleText('saved-query-management-popover');
expect(descriptionText).to.eql(
- 'SAVED QUERIES\nThere are no saved queries. Save query text and filters that you want to use again.\nSave current query'
+ 'Saved Queries\nThere are no saved queries. Save query text and filters that you want to use again.\nSave current query'
);
});
diff --git a/test/interpreter_functional/plugins/osd_tp_run_pipeline/package.json b/test/interpreter_functional/plugins/osd_tp_run_pipeline/package.json
index 602da7bd57cd..ba4c2399729b 100644
--- a/test/interpreter_functional/plugins/osd_tp_run_pipeline/package.json
+++ b/test/interpreter_functional/plugins/osd_tp_run_pipeline/package.json
@@ -12,7 +12,7 @@
"build": "../../../../scripts/use_node ../../../../scripts/remove.js './target' && tsc"
},
"devDependencies": {
- "@elastic/eui": "npm:@opensearch-project/oui@1.5.1",
+ "@elastic/eui": "npm:@opensearch-project/oui@1.7.0",
"@osd/plugin-helpers": "1.0.0",
"react": "^16.14.0",
"react-dom": "^16.12.0",
diff --git a/test/plugin_functional/plugins/osd_sample_panel_action/package.json b/test/plugin_functional/plugins/osd_sample_panel_action/package.json
index 1a517e6ddcca..61b89d5b86f8 100644
--- a/test/plugin_functional/plugins/osd_sample_panel_action/package.json
+++ b/test/plugin_functional/plugins/osd_sample_panel_action/package.json
@@ -12,7 +12,7 @@
"build": "../../../../scripts/use_node ../../../../scripts/remove.js './target' && tsc"
},
"devDependencies": {
- "@elastic/eui": "npm:@opensearch-project/oui@1.5.1",
+ "@elastic/eui": "npm:@opensearch-project/oui@1.7.0",
"react": "^16.14.0",
"typescript": "4.0.2"
}
diff --git a/test/plugin_functional/plugins/osd_tp_custom_visualizations/package.json b/test/plugin_functional/plugins/osd_tp_custom_visualizations/package.json
index ee8b5f4a0597..594d0a7bbb9c 100644
--- a/test/plugin_functional/plugins/osd_tp_custom_visualizations/package.json
+++ b/test/plugin_functional/plugins/osd_tp_custom_visualizations/package.json
@@ -12,7 +12,7 @@
"build": "../../../../scripts/use_node ../../../../scripts/remove.js './target' && tsc"
},
"devDependencies": {
- "@elastic/eui": "npm:@opensearch-project/oui@1.5.1",
+ "@elastic/eui": "npm:@opensearch-project/oui@1.7.0",
"@osd/plugin-helpers": "1.0.0",
"react": "^16.14.0",
"typescript": "4.0.2"
diff --git a/test/plugin_functional/plugins/osd_tp_custom_visualizations/public/self_changing_vis/self_changing_editor.tsx b/test/plugin_functional/plugins/osd_tp_custom_visualizations/public/self_changing_vis/self_changing_editor.tsx
index 4e373f96a0b4..b87585b87766 100644
--- a/test/plugin_functional/plugins/osd_tp_custom_visualizations/public/self_changing_vis/self_changing_editor.tsx
+++ b/test/plugin_functional/plugins/osd_tp_custom_visualizations/public/self_changing_vis/self_changing_editor.tsx
@@ -30,7 +30,7 @@
import React from 'react';
-import { EuiFieldNumber, EuiFormRow } from '@elastic/eui';
+import { EuiCompressedFieldNumber, EuiCompressedFormRow } from '@elastic/eui';
import { VisOptionsProps } from 'src/plugins/vis_default_editor/public/vis_options_props';
interface CounterParams {
@@ -44,14 +44,14 @@ export class SelfChangingEditor extends React.Component
-
+
-
+
);
}
}
diff --git a/yarn.lock b/yarn.lock
index effb1d55a432..07d1a80296a5 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1307,20 +1307,15 @@
resolved "https://registry.yarnpkg.com/@elastic/eslint-plugin-eui/-/eslint-plugin-eui-0.0.2.tgz#56b9ef03984a05cc213772ae3713ea8ef47b0314"
integrity sha512-IoxURM5zraoQ7C8f+mJb9HYSENiZGgRVcG4tLQxE61yHNNRDXtGDWTZh8N1KIHcsqN1CEPETjuzBXkJYF/fDiQ==
-"@elastic/eui@npm:@opensearch-project/oui@1.5.1":
- version "1.5.1"
- resolved "https://registry.yarnpkg.com/@opensearch-project/oui/-/oui-1.5.1.tgz#15838314c4c8c63ba45d3abfa1bc08815a4e879b"
- integrity sha512-dnoKlHXAdO4K+Ice/iI/13yFzBOgJKugDlUcB9xwIc+JPRjPyGUX7U53GmKxNzU/2H9bH9WsAibsotCPSzMGNw==
+"@elastic/eui@npm:@opensearch-project/oui@1.7.0":
+ version "1.7.0"
+ resolved "https://registry.yarnpkg.com/@opensearch-project/oui/-/oui-1.7.0.tgz#f24cfb7fb4f18db607620919f70b4729b9ce27f9"
+ integrity sha512-HoWOS5kUbXoLn0I6+LC+V8aWblBTD2/x2kxvsvGQoBXXbfuWR+lphgqPdCetc4DCmvD/+jm0u3vRT2MYB6FQjw==
dependencies:
"@types/chroma-js" "^2.4.0"
- "@types/lodash" "4.14.192"
- "@types/numeral" "^2.0.2"
"@types/react-beautiful-dnd" "^13.1.3"
"@types/react-input-autosize" "^2.2.1"
- "@types/react-virtualized-auto-sizer" "^1.0.1"
"@types/react-window" "^1.8.5"
- "@types/refractor" "^3.0.0"
- "@types/resize-observer-browser" "^0.1.7"
chroma-js "^2.4.2"
classnames "^2.3.2"
lodash "^4.17.21"
@@ -1336,7 +1331,6 @@
react-virtualized-auto-sizer "1.0.7"
react-window "^1.8.9"
refractor "^3.6.0"
- rehype-raw "^5.0.0"
rehype-react "^6.0.0"
rehype-slug "^4.0.1"
rehype-stringify "^8.0.0"
@@ -3330,11 +3324,6 @@
"@types/node" "*"
"@types/webpack" "^4"
-"@types/lodash@4.14.192":
- version "4.14.192"
- resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.192.tgz#5790406361a2852d332d41635d927f1600811285"
- integrity sha512-km+Vyn3BYm5ytMO13k9KTp27O75rbQ0NFw+U//g+PX7VZyjCioXaRFisqSIJRECljcTv73G3i6BpglNGHgUQ5A==
-
"@types/lodash@^4.14.170":
version "4.14.181"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.181.tgz#d1d3740c379fda17ab175165ba04e2d03389385d"
@@ -3456,11 +3445,6 @@
resolved "https://registry.yarnpkg.com/@types/normalize-path/-/normalize-path-3.0.0.tgz#bb5c46cab77b93350b4cf8d7ff1153f47189ae31"
integrity sha512-Nd8y/5t/7CRakPYiyPzr/IAfYusy1FkcZYFEAcoMZkwpJv2n4Wm+olW+e7xBdHEXhOnWdG9ddbar0gqZWS4x5Q==
-"@types/numeral@^2.0.2":
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/@types/numeral/-/numeral-2.0.2.tgz#8ea2c4f4e64c0cc948ad7da375f6f827778a7912"
- integrity sha512-A8F30k2gYJ/6e07spSCPpkuZu79LCnkPTvqmIWQzNGcrzwFKpVOydG41lNt5wZXjSI149qjyzC2L1+F2PD/NUA==
-
"@types/ora@^1.3.5":
version "1.3.5"
resolved "https://registry.yarnpkg.com/@types/ora/-/ora-1.3.5.tgz#1a08bf64902c1473d3d47de58549a49e07140f1c"
@@ -3478,11 +3462,6 @@
resolved "https://registry.yarnpkg.com/@types/parse-link-header/-/parse-link-header-1.0.1.tgz#6eade790736a050b9242c7c6b2fceda9b3dc394a"
integrity sha512-E2+Go9rQgPbmpkeA2iFXTWSTxX38KXlXwcdiIbt71Oorqr+G5QtH4AhpuDdxwRVyiTzdUrHnaaIumW/LhiZwVg==
-"@types/parse5@^5.0.0":
- version "5.0.3"
- resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-5.0.3.tgz#e7b5aebbac150f8b5fdd4a46e7f0bd8e65e19109"
- integrity sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw==
-
"@types/pegjs@^0.10.1":
version "0.10.3"
resolved "https://registry.yarnpkg.com/@types/pegjs/-/pegjs-0.10.3.tgz#9e254036c6bf2254cd98caec447a1d79b6607bff"
@@ -3500,11 +3479,6 @@
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.4.tgz#5d9b63132df54d8909fce1c3f8ca260fdd693e17"
integrity sha512-ReVR2rLTV1kvtlWFyuot+d1pkpG2Fw/XKE3PDAdj57rbM97ttSp9JZ2UsP+2EHTylra9cUf6JA7tGwW1INzUrA==
-"@types/prismjs@*":
- version "1.26.0"
- resolved "https://registry.yarnpkg.com/@types/prismjs/-/prismjs-1.26.0.tgz#a1c3809b0ad61c62cac6d4e0c56d610c910b7654"
- integrity sha512-ZTaqn/qSqUuAq1YwvOFQfVW1AR/oQJlLSZVustdjwI+GZ8kr0MSHBj0tsXPW1EqHubx50gtBEjbPGsdZwQwCjQ==
-
"@types/prop-types@*", "@types/prop-types@^15.7.3":
version "15.7.4"
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.4.tgz#fcf7205c25dff795ee79af1e30da2c9790808f11"
@@ -3598,13 +3572,6 @@
dependencies:
"@types/react" "*"
-"@types/react-virtualized-auto-sizer@^1.0.1":
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/@types/react-virtualized-auto-sizer/-/react-virtualized-auto-sizer-1.0.1.tgz#b3187dae1dfc4c15880c9cfc5b45f2719ea6ebd4"
- integrity sha512-GH8sAnBEM5GV9LTeiz56r4ZhMOUSrP43tAQNSRVxNexDjcNKLCEtnxusAItg1owFUFE6k0NslV26gqVClVvong==
- dependencies:
- "@types/react" "*"
-
"@types/react-virtualized@^9.18.7":
version "9.21.20"
resolved "https://registry.yarnpkg.com/@types/react-virtualized/-/react-virtualized-9.21.20.tgz#756c78b5512a2a1804fdaf749a5f5cff3d805e5b"
@@ -3650,18 +3617,6 @@
dependencies:
redux "^4.0.5"
-"@types/refractor@^3.0.0":
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/@types/refractor/-/refractor-3.0.2.tgz#2d42128d59f78f84d2c799ffc5ab5cadbcba2d82"
- integrity sha512-2HMXuwGuOqzUG+KUTm9GDJCHl0LCBKsB5cg28ujEmVi/0qgTb6jOmkVSO5K48qXksyl2Fr3C0Q2VrgD4zbwyXg==
- dependencies:
- "@types/prismjs" "*"
-
-"@types/resize-observer-browser@^0.1.7":
- version "0.1.7"
- resolved "https://registry.yarnpkg.com/@types/resize-observer-browser/-/resize-observer-browser-0.1.7.tgz#294aaadf24ac6580b8fbd1fe3ab7b59fe85f9ef3"
- integrity sha512-G9eN0Sn0ii9PWQ3Vl72jDPgeJwRWhv2Qk/nQkJuWmRmOB4HX3/BhD5SE1dZs/hzPZL/WKnvF0RHdTSG54QJFyg==
-
"@types/responselike@*", "@types/responselike@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29"
@@ -9253,18 +9208,6 @@ hast-to-hyperscript@^9.0.0:
unist-util-is "^4.0.0"
web-namespaces "^1.0.0"
-hast-util-from-parse5@^6.0.0:
- version "6.0.1"
- resolved "https://registry.yarnpkg.com/hast-util-from-parse5/-/hast-util-from-parse5-6.0.1.tgz#554e34abdeea25ac76f5bd950a1f0180e0b3bc2a"
- integrity sha512-jeJUWiN5pSxW12Rh01smtVkZgZr33wBokLzKLwinYOUfSzm1Nl/c3GUGebDyOKjdsRgMvoVbV0VpAcpjF4NrJA==
- dependencies:
- "@types/parse5" "^5.0.0"
- hastscript "^6.0.0"
- property-information "^5.0.0"
- vfile "^4.0.0"
- vfile-location "^3.2.0"
- web-namespaces "^1.0.0"
-
hast-util-has-property@^1.0.0:
version "1.0.4"
resolved "https://registry.yarnpkg.com/hast-util-has-property/-/hast-util-has-property-1.0.4.tgz#9f137565fad6082524b382c1e7d7d33ca5059f36"
@@ -9285,23 +9228,6 @@ hast-util-parse-selector@^2.0.0:
resolved "https://registry.yarnpkg.com/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz#d57c23f4da16ae3c63b3b6ca4616683313499c3a"
integrity sha512-7j6mrk/qqkSehsM92wQjdIgWM2/BW61u/53G6xmC8i1OmEdKLHbk419QKQUjz6LglWsfqoiHmyMRkP1BGjecNQ==
-hast-util-raw@^6.1.0:
- version "6.1.0"
- resolved "https://registry.yarnpkg.com/hast-util-raw/-/hast-util-raw-6.1.0.tgz#e16a3c2642f65cc7c480c165400a40d604ab75d0"
- integrity sha512-5FoZLDHBpka20OlZZ4I/+RBw5piVQ8iI1doEvffQhx5CbCyTtP8UCq8Tw6NmTAMtXgsQxmhW7Ly8OdFre5/YMQ==
- dependencies:
- "@types/hast" "^2.0.0"
- hast-util-from-parse5 "^6.0.0"
- hast-util-to-parse5 "^6.0.0"
- html-void-elements "^1.0.0"
- parse5 "^6.0.0"
- unist-util-position "^3.0.0"
- unist-util-visit "^2.0.0"
- vfile "^4.0.0"
- web-namespaces "^1.0.0"
- xtend "^4.0.0"
- zwitch "^1.0.0"
-
hast-util-to-html@^7.1.1:
version "7.1.3"
resolved "https://registry.yarnpkg.com/hast-util-to-html/-/hast-util-to-html-7.1.3.tgz#9f339ca9bea71246e565fc79ff7dbfe98bb50f5e"
@@ -9318,17 +9244,6 @@ hast-util-to-html@^7.1.1:
unist-util-is "^4.0.0"
xtend "^4.0.0"
-hast-util-to-parse5@^6.0.0:
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/hast-util-to-parse5/-/hast-util-to-parse5-6.0.0.tgz#1ec44650b631d72952066cea9b1445df699f8479"
- integrity sha512-Lu5m6Lgm/fWuz8eWnrKezHtVY83JeRGaNQ2kn9aJgqaxvVkFCZQBEhgodZUDUvoodgyROHDb3r5IxAEdl6suJQ==
- dependencies:
- hast-to-hyperscript "^9.0.0"
- property-information "^5.0.0"
- web-namespaces "^1.0.0"
- xtend "^4.0.0"
- zwitch "^1.0.0"
-
hast-util-to-string@^1.0.0:
version "1.0.4"
resolved "https://registry.yarnpkg.com/hast-util-to-string/-/hast-util-to-string-1.0.4.tgz#9b24c114866bdb9478927d7e9c36a485ac728378"
@@ -13084,7 +12999,7 @@ parse5-htmlparser2-tree-adapter@^6.0.1:
dependencies:
parse5 "^6.0.1"
-parse5@6.0.1, parse5@^6.0.0, parse5@^6.0.1:
+parse5@6.0.1, parse5@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b"
integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==
@@ -14314,13 +14229,6 @@ regjsparser@^0.9.1:
dependencies:
jsesc "~0.5.0"
-rehype-raw@^5.0.0:
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/rehype-raw/-/rehype-raw-5.1.0.tgz#66d5e8d7188ada2d31bc137bc19a1000cf2c6b7e"
- integrity sha512-MDvHAb/5mUnif2R+0IPCYJU8WjHa9UzGtM/F4AVy5GixPlDZ1z3HacYy4xojDU+uBa+0X/3PIfyQI26/2ljJNA==
- dependencies:
- hast-util-raw "^6.1.0"
-
rehype-react@^6.0.0:
version "6.2.1"
resolved "https://registry.yarnpkg.com/rehype-react/-/rehype-react-6.2.1.tgz#9b9bf188451ad6f63796b784fe1f51165c67b73a"
@@ -17422,7 +17330,7 @@ vfile-location@^2.0.0:
resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-2.0.6.tgz#8a274f39411b8719ea5728802e10d9e0dff1519e"
integrity sha512-sSFdyCP3G6Ka0CEmN83A2YCMKIieHx0EDaj5IDP4g1pa5ZJ4FJDvpO0WODLxo4LUX4oe52gmSCK7Jw4SBghqxA==
-vfile-location@^3.0.0, vfile-location@^3.2.0:
+vfile-location@^3.0.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-3.2.0.tgz#d8e41fbcbd406063669ebf6c33d56ae8721d0f3c"
integrity sha512-aLEIZKv/oxuCDZ8lkJGhuhztf/BW4M+iHdCwglA/eWc+vtuRFJj8EtgceYFX4LRjOhCAAiNHsKGssC6onJ+jbA==
@@ -18119,8 +18027,3 @@ zlib@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/zlib/-/zlib-1.0.5.tgz#6e7c972fc371c645a6afb03ab14769def114fcc0"
integrity sha1-bnyXL8NxxkWmr7A6sUdp3vEU/MA=
-
-zwitch@^1.0.0:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-1.0.5.tgz#d11d7381ffed16b742f6af7b3f223d5cd9fe9920"
- integrity sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==
From 2af3947e990108f0f7d0dcd172a909db6a55ad2a Mon Sep 17 00:00:00 2001
From: "opensearch-trigger-bot[bot]"
<98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Date: Wed, 24 Jul 2024 12:48:12 +0800
Subject: [PATCH 07/12] [Workspace] Copy selected/all saved objects (#6478)
(#7429)
* [Worksapce][UI] duplicate selected/all saved objects
* fix test error
* optimize code transfer memory
* revert useless modify
* optimize the code
* add test id
* Changeset file for PR #6478 created/updated
* According the last mockup to optimize the code
* Delete useless code
* Optimize the code
* optimize code
* delete useless code
* Optimize user experience
* Solve the test snapshot error
* modefy the ui text
* support copy result flyout
* optimize the code
* optimize the code
---------
(cherry picked from commit 9abde5c91b86bdcedde315f8ea7f650ffadac20e)
Signed-off-by: yubonluo
Signed-off-by: github-actions[bot]
Co-authored-by: github-actions[bot]
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
---
changelogs/fragments/6478.yml | 2 +
.../saved_objects_management/public/index.ts | 10 +-
.../lib/duplicate_saved_objects.test.ts | 71 ++
.../public/lib/duplicate_saved_objects.ts | 21 +
.../public/lib/index.ts | 1 +
.../public/management_section/index.ts | 1 +
.../saved_objects_table.test.tsx.snap | 613 +++++++++++++++++-
.../duplicate_modal.test.tsx.snap | 252 +++++++
.../duplicate_result_flyout.test.tsx.snap | 375 +++++++++++
.../__snapshots__/header.test.tsx.snap | 111 +++-
.../__snapshots__/table.test.tsx.snap | 250 +++++++
.../components/duplicate_modal.test.tsx | 175 +++++
.../components/duplicate_modal.tsx | 223 +++++++
.../duplicate_result_flyout.test.tsx | 98 +++
.../components/duplicate_result_flyout.tsx | 232 +++++++
.../objects_table/components/header.test.tsx | 38 +-
.../objects_table/components/header.tsx | 29 +-
.../objects_table/components/index.ts | 2 +
.../objects_table/components/table.test.tsx | 22 +
.../objects_table/components/table.tsx | 46 +-
.../objects_table/components/utils.test.tsx | 82 +++
.../objects_table/components/utils.ts | 40 ++
.../management_section/objects_table/index.ts | 1 +
.../saved_objects_table.test.mocks.ts | 5 +
.../saved_objects_table.test.tsx | 227 +++++++
.../objects_table/saved_objects_table.tsx | 231 ++++++-
.../public/management_section/types.ts | 3 +
.../workspace_column/workspace_column.tsx | 2 +-
.../workspace/public/workspace_client.test.ts | 25 +
.../workspace/public/workspace_client.ts | 18 +-
.../workspace/server/routes/duplicate.ts | 1 +
src/plugins/workspace/server/types.ts | 2 +
.../workspace/server/workspace_client.ts | 1 +
33 files changed, 3156 insertions(+), 54 deletions(-)
create mode 100644 changelogs/fragments/6478.yml
create mode 100644 src/plugins/saved_objects_management/public/lib/duplicate_saved_objects.test.ts
create mode 100644 src/plugins/saved_objects_management/public/lib/duplicate_saved_objects.ts
create mode 100644 src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/duplicate_modal.test.tsx.snap
create mode 100644 src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/duplicate_result_flyout.test.tsx.snap
create mode 100644 src/plugins/saved_objects_management/public/management_section/objects_table/components/duplicate_modal.test.tsx
create mode 100644 src/plugins/saved_objects_management/public/management_section/objects_table/components/duplicate_modal.tsx
create mode 100644 src/plugins/saved_objects_management/public/management_section/objects_table/components/duplicate_result_flyout.test.tsx
create mode 100644 src/plugins/saved_objects_management/public/management_section/objects_table/components/duplicate_result_flyout.tsx
create mode 100644 src/plugins/saved_objects_management/public/management_section/objects_table/components/utils.test.tsx
create mode 100644 src/plugins/saved_objects_management/public/management_section/objects_table/components/utils.ts
diff --git a/changelogs/fragments/6478.yml b/changelogs/fragments/6478.yml
new file mode 100644
index 000000000000..d8009500a060
--- /dev/null
+++ b/changelogs/fragments/6478.yml
@@ -0,0 +1,2 @@
+feat:
+- [Workspace] Duplicate selected/all saved objects ([#6478](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6478))
\ No newline at end of file
diff --git a/src/plugins/saved_objects_management/public/index.ts b/src/plugins/saved_objects_management/public/index.ts
index 317b3079efa0..ba04384a28a2 100644
--- a/src/plugins/saved_objects_management/public/index.ts
+++ b/src/plugins/saved_objects_management/public/index.ts
@@ -46,11 +46,17 @@ export {
ISavedObjectsManagementServiceRegistry,
SavedObjectsManagementServiceRegistryEntry,
} from './services';
-export { ProcessedImportResponse, processImportResponse, FailedImport } from './lib';
+export {
+ ProcessedImportResponse,
+ processImportResponse,
+ FailedImport,
+ duplicateSavedObjects,
+ getSavedObjectLabel,
+} from './lib';
export { SavedObjectRelation, SavedObjectWithMetadata, SavedObjectMetadata } from './types';
export { SAVED_OBJECT_DELETE_TRIGGER, savedObjectDeleteTrigger } from './triggers';
export { SavedObjectDeleteContext } from './ui_actions_bootstrap';
-
+export { SavedObjectsDuplicateModal } from './management_section';
export function plugin(initializerContext: PluginInitializerContext) {
return new SavedObjectsManagementPlugin();
}
diff --git a/src/plugins/saved_objects_management/public/lib/duplicate_saved_objects.test.ts b/src/plugins/saved_objects_management/public/lib/duplicate_saved_objects.test.ts
new file mode 100644
index 000000000000..def28a431551
--- /dev/null
+++ b/src/plugins/saved_objects_management/public/lib/duplicate_saved_objects.test.ts
@@ -0,0 +1,71 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+import { httpServiceMock } from '../../../../core/public/mocks';
+import { duplicateSavedObjects } from './duplicate_saved_objects';
+
+describe('copy saved objects', () => {
+ const httpClient = httpServiceMock.createStartContract();
+ const objects = [
+ { type: 'dashboard', id: '1' },
+ { type: 'visualization', id: '2' },
+ ];
+ const targetWorkspace = '1';
+
+ it('make http call with all parameter provided', async () => {
+ const includeReferencesDeep = true;
+ await duplicateSavedObjects(httpClient, objects, targetWorkspace, includeReferencesDeep);
+ expect(httpClient.post).toMatchInlineSnapshot(`
+ [MockFunction] {
+ "calls": Array [
+ Array [
+ "/api/workspaces/_duplicate_saved_objects",
+ Object {
+ "body": "{\\"objects\\":[{\\"type\\":\\"dashboard\\",\\"id\\":\\"1\\"},{\\"type\\":\\"visualization\\",\\"id\\":\\"2\\"}],\\"includeReferencesDeep\\":true,\\"targetWorkspace\\":\\"1\\"}",
+ },
+ ],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ ],
+ }
+ `);
+ });
+
+ it('make http call without includeReferencesDeep parameter provided', async () => {
+ await duplicateSavedObjects(httpClient, objects, targetWorkspace);
+ expect(httpClient.post).toMatchInlineSnapshot(`
+ [MockFunction] {
+ "calls": Array [
+ Array [
+ "/api/workspaces/_duplicate_saved_objects",
+ Object {
+ "body": "{\\"objects\\":[{\\"type\\":\\"dashboard\\",\\"id\\":\\"1\\"},{\\"type\\":\\"visualization\\",\\"id\\":\\"2\\"}],\\"includeReferencesDeep\\":true,\\"targetWorkspace\\":\\"1\\"}",
+ },
+ ],
+ Array [
+ "/api/workspaces/_duplicate_saved_objects",
+ Object {
+ "body": "{\\"objects\\":[{\\"type\\":\\"dashboard\\",\\"id\\":\\"1\\"},{\\"type\\":\\"visualization\\",\\"id\\":\\"2\\"}],\\"includeReferencesDeep\\":true,\\"targetWorkspace\\":\\"1\\"}",
+ },
+ ],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ ],
+ }
+ `);
+ });
+});
diff --git a/src/plugins/saved_objects_management/public/lib/duplicate_saved_objects.ts b/src/plugins/saved_objects_management/public/lib/duplicate_saved_objects.ts
new file mode 100644
index 000000000000..560e0c1fddb3
--- /dev/null
+++ b/src/plugins/saved_objects_management/public/lib/duplicate_saved_objects.ts
@@ -0,0 +1,21 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+import { HttpStart } from 'src/core/public';
+
+export async function duplicateSavedObjects(
+ http: HttpStart,
+ objects: any[],
+ targetWorkspace: string,
+ includeReferencesDeep: boolean = true
+) {
+ return await http.post('/api/workspaces/_duplicate_saved_objects', {
+ body: JSON.stringify({
+ objects,
+ includeReferencesDeep,
+ targetWorkspace,
+ }),
+ });
+}
diff --git a/src/plugins/saved_objects_management/public/lib/index.ts b/src/plugins/saved_objects_management/public/lib/index.ts
index fae58cad3eb2..80630b8780e7 100644
--- a/src/plugins/saved_objects_management/public/lib/index.ts
+++ b/src/plugins/saved_objects_management/public/lib/index.ts
@@ -57,3 +57,4 @@ export { extractExportDetails, SavedObjectsExportResultDetails } from './extract
export { createFieldList } from './create_field_list';
export { getAllowedTypes } from './get_allowed_types';
export { filterQuery } from './filter_query';
+export { duplicateSavedObjects } from './duplicate_saved_objects';
diff --git a/src/plugins/saved_objects_management/public/management_section/index.ts b/src/plugins/saved_objects_management/public/management_section/index.ts
index 333bee71b0c0..25488f636741 100644
--- a/src/plugins/saved_objects_management/public/management_section/index.ts
+++ b/src/plugins/saved_objects_management/public/management_section/index.ts
@@ -29,3 +29,4 @@
*/
export { mountManagementSection } from './mount_section';
+export { SavedObjectsDuplicateModal } from './objects_table';
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap
index d01a503c2620..45deb7c2f2f4 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap
@@ -226,6 +226,611 @@ exports[`SavedObjectsTable delete should show error toast when failing to delete
`;
+exports[`SavedObjectsTable duplicate should allow the user to choose on header when duplicating all 1`] = `
+
+`;
+
+exports[`SavedObjectsTable duplicate should allow the user to choose on table when duplicating all 1`] = `
+
+`;
+
+exports[`SavedObjectsTable duplicate should allow the user to choose on table when duplicating single 1`] = `
+
+`;
+
exports[`SavedObjectsTable export should allow the user to choose when exporting all 1`] = `
`;
+
+exports[`SavedObjectsTable should unmount normally 1`] = `""`;
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/duplicate_modal.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/duplicate_modal.test.tsx.snap
new file mode 100644
index 000000000000..1e8c8acc083b
--- /dev/null
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/duplicate_modal.test.tsx.snap
@@ -0,0 +1,252 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`DuplicateModal should Unmount normally 1`] = `""`;
+
+exports[`DuplicateModal should render normally 1`] = `
+HTMLCollection [
+
+
+
+
+
+
+
+
+
+
+ ,
+]
+`;
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/duplicate_result_flyout.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/duplicate_result_flyout.test.tsx.snap
new file mode 100644
index 000000000000..b82303876131
--- /dev/null
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/duplicate_result_flyout.test.tsx.snap
@@ -0,0 +1,375 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`DuplicateResultFlyout copy count is null 1`] = `
+HTMLCollection [
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0 saved objects copied
+
+
+
+
+
+
+
+
+
+
+ ,
+]
+`;
+
+exports[`DuplicateResultFlyout renders the flyout with correct title and result 1`] = `
+HTMLCollection [
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 4 saved objects copied
+
+
+
+
+
+
+
+ 2 Successful
+
+
+
+
+
+
+ 2 Error copying file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Failed Config Title
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Successful Visualization Title
+
+
+
+
+
+
+
+
+
+
+
+ ,
+]
+`;
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/header.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/header.test.tsx.snap
index 926932968083..cf2bac1ec93e 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/header.test.tsx.snap
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/header.test.tsx.snap
@@ -39,13 +39,112 @@ exports[`Header should render normally 1`] = `
size="s"
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[`Header should render normally when showDuplicateAll is undefined 1`] = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/table.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/table.test.tsx.snap
index b39b8116078a..48dcf32c4eda 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/table.test.tsx.snap
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/table.test.tsx.snap
@@ -26,6 +26,7 @@ exports[`Table prevents saved objects from being deleted 1`] = `
onChange={[Function]}
toolsRight={
Array [
+ ,
`;
+exports[`Table should call onDuplicateSingle when show duplicate 1`] = `
+
+
+
+
+
+ ,
+
+
+ ,
+
+
+
+ }
+ closePopover={[Function]}
+ display="inlineBlock"
+ hasArrow={true}
+ isOpen={false}
+ ownFocus={true}
+ panelPaddingSize="m"
+ >
+
+ }
+ labelType="label"
+ >
+
+ }
+ name="includeReferencesDeep"
+ onChange={[Function]}
+ />
+
+
+
+
+
+
+ ,
+ ]
+ }
+ />
+
+
+
+
+
+`;
+
exports[`Table should render normally 1`] = `
,
void;
+}
+
+describe('DuplicateModal', () => {
+ let duplicateProps: Props;
+ let http: ReturnType;
+ let notifications: ReturnType;
+ let workspaces: ReturnType;
+ const selectedSavedObjects: SavedObjectWithMetadata[] = [
+ {
+ id: '1',
+ type: 'dashboard',
+ workspaces: ['workspace1'],
+ attributes: {},
+ references: [],
+ meta: {
+ title: 'Dashboard_1',
+ icon: 'dashboardApp',
+ },
+ },
+ {
+ id: '2',
+ type: 'visualization',
+ workspaces: ['workspace2'],
+ attributes: {},
+ references: [],
+ meta: {
+ title: 'Visualization',
+ icon: 'visualizationApp',
+ },
+ },
+ {
+ id: '3',
+ type: 'dashboard',
+ workspaces: ['workspace2'],
+ attributes: {},
+ references: [],
+ meta: {
+ title: 'Dashboard_2',
+ },
+ },
+ ];
+ const workspaceList: WorkspaceAttribute[] = [
+ {
+ id: 'workspace1',
+ name: 'foo',
+ },
+ {
+ id: 'workspace2',
+ name: 'bar',
+ },
+ ];
+ beforeEach(() => {
+ http = httpServiceMock.createStartContract();
+ notifications = notificationServiceMock.createStartContract();
+ workspaces = workspacesServiceMock.createStartContract();
+
+ duplicateProps = {
+ onDuplicate: jest.fn(),
+ onClose: jest.fn(),
+ http,
+ workspaces,
+ notifications,
+ selectedSavedObjects,
+ };
+ });
+
+ afterEach(() => {
+ jest.clearAllMocks();
+ });
+
+ it('should render normally', async () => {
+ render();
+ expect(document.children).toMatchSnapshot();
+ });
+
+ it('should Unmount normally', async () => {
+ const component = shallowWithI18nProvider();
+ expect(component.unmount()).toMatchSnapshot();
+ });
+
+ it('should show all target workspace options when not in any workspace', async () => {
+ workspaces.workspaceList$.next(workspaceList);
+ workspaces.currentWorkspaceId$.next('');
+ workspaces.currentWorkspace$.next(null);
+ duplicateProps = { ...duplicateProps, workspaces };
+ const component = shallowWithI18nProvider();
+ await new Promise((resolve) => process.nextTick(resolve));
+ component.update();
+ const options = component.find('EuiComboBox').prop('options') as WorkspaceOption[];
+ expect(options.length).toEqual(2);
+ expect(options[0].label).toEqual('foo');
+ expect(options[1].label).toEqual('bar');
+ });
+
+ it('should display the suffix (current) in target workspace options when it is the current workspace', async () => {
+ workspaces.workspaceList$.next(workspaceList);
+ workspaces.currentWorkspaceId$.next('workspace1');
+ workspaces.currentWorkspace$.next({
+ id: 'workspace1',
+ name: 'foo',
+ });
+ duplicateProps = { ...duplicateProps, workspaces };
+ const component = shallowWithI18nProvider();
+ await new Promise((resolve) => process.nextTick(resolve));
+ component.update();
+ const options = component.find('EuiComboBox').prop('options') as WorkspaceOption[];
+ expect(options.length).toEqual(2);
+ expect(options[0].label).toEqual('foo (current)');
+ expect(options[1].label).toEqual('bar');
+ });
+
+ it('should uncheck duplicate related objects', async () => {
+ const component = shallowWithI18nProvider();
+
+ const euiCheckbox = component.find('EuiCheckbox').at(0);
+ expect(euiCheckbox.prop('checked')).toEqual(true);
+ expect(euiCheckbox.prop('id')).toEqual('includeReferencesDeep');
+ expect(component.state('isIncludeReferencesDeepChecked')).toEqual(true);
+
+ euiCheckbox.simulate('change', { target: { checked: false } });
+ expect(component.state('isIncludeReferencesDeepChecked')).toEqual(false);
+ });
+
+ it('should call onClose function when cancle button is clicked', () => {
+ const component = shallowWithI18nProvider();
+ component.find('[data-test-subj="duplicateCancelButton"]').simulate('click');
+ expect(duplicateProps.onClose).toHaveBeenCalled();
+ });
+
+ it('should call onDuplicate function when confirm button is clicked', () => {
+ workspaces.workspaceList$.next(workspaceList);
+ workspaces.currentWorkspaceId$.next('');
+ workspaces.currentWorkspace$.next(null);
+ duplicateProps = { ...duplicateProps, workspaces };
+ const component = shallowWithI18nProvider();
+ const comboBox = component.find('EuiComboBox');
+ comboBox.simulate('change', [{ label: 'bar', key: 'workspace2', value: workspaceList[1] }]);
+ const confirmButton = component.find('[data-test-subj="duplicateConfirmButton"]');
+ expect(confirmButton.prop('isLoading')).toBe(false);
+ expect(confirmButton.prop('disabled')).toBe(false);
+ confirmButton.simulate('click');
+ expect(duplicateProps.onDuplicate).toHaveBeenCalled();
+ });
+
+ it('should not change isLoading when isMounted is false ', async () => {
+ const component = shallowWithI18nProvider();
+ const comboBox = component.find('EuiComboBox');
+ comboBox.simulate('change', [{ label: 'bar', key: 'workspace2', value: workspaceList[1] }]);
+ const confirmButton = component.find('[data-test-subj="duplicateConfirmButton"]');
+ (component.instance() as any).isMounted = false;
+ confirmButton.simulate('click');
+ expect(duplicateProps.onDuplicate).toHaveBeenCalled();
+ expect(component.state('isLoading')).toBe(true);
+ });
+});
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/duplicate_modal.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/duplicate_modal.tsx
new file mode 100644
index 000000000000..072934a919a2
--- /dev/null
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/duplicate_modal.tsx
@@ -0,0 +1,223 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+import React from 'react';
+import { FormattedMessage } from '@osd/i18n/react';
+import {
+ EuiButton,
+ EuiButtonEmpty,
+ EuiModal,
+ EuiModalBody,
+ EuiModalFooter,
+ EuiModalHeader,
+ EuiModalHeaderTitle,
+ EuiSpacer,
+ EuiComboBox,
+ EuiFormRow,
+ EuiCheckbox,
+ EuiText,
+} from '@elastic/eui';
+import { HttpSetup, NotificationsStart, WorkspacesStart } from 'opensearch-dashboards/public';
+import { i18n } from '@osd/i18n';
+import { WorkspaceOption, getTargetWorkspacesOptions } from './utils';
+import { DuplicateObject } from '../../types';
+
+export interface ShowDuplicateModalProps {
+ onDuplicate: (
+ savedObjects: DuplicateObject[],
+ includeReferencesDeep: boolean,
+ targetWorkspace: string,
+ targetWorkspaceName: string
+ ) => Promise;
+ http: HttpSetup;
+ workspaces: WorkspacesStart;
+ notifications: NotificationsStart;
+ selectedSavedObjects: DuplicateObject[];
+ onClose: () => void;
+}
+
+interface State {
+ allSelectedObjects: DuplicateObject[];
+ workspaceOptions: WorkspaceOption[];
+ targetWorkspaceOption: WorkspaceOption[];
+ isLoading: boolean;
+ isIncludeReferencesDeepChecked: boolean;
+}
+
+export class SavedObjectsDuplicateModal extends React.Component {
+ private isMounted = false;
+
+ constructor(props: ShowDuplicateModalProps) {
+ super(props);
+
+ const { workspaces } = props;
+ const currentWorkspace = workspaces.currentWorkspace$.value;
+ const targetWorkspacesOptions = getTargetWorkspacesOptions(workspaces, currentWorkspace!);
+
+ this.state = {
+ allSelectedObjects: props.selectedSavedObjects,
+ workspaceOptions: targetWorkspacesOptions,
+ targetWorkspaceOption: [],
+ isLoading: false,
+ isIncludeReferencesDeepChecked: true,
+ };
+ this.isMounted = true;
+ }
+
+ componentWillUnmount() {
+ this.isMounted = false;
+ }
+
+ duplicateSavedObjects = async (savedObjects: DuplicateObject[]) => {
+ const selectedWorkspace = this.state.targetWorkspaceOption[0];
+ if (!selectedWorkspace) {
+ return;
+ }
+ const targetWorkspace = selectedWorkspace.key;
+ const targetWorkspaceName = selectedWorkspace.label;
+
+ this.setState({
+ isLoading: true,
+ });
+
+ await this.props.onDuplicate(
+ savedObjects,
+ this.state.isIncludeReferencesDeepChecked,
+ targetWorkspace!,
+ targetWorkspaceName
+ );
+
+ if (this.isMounted) {
+ this.setState({
+ isLoading: false,
+ });
+ }
+ };
+
+ onTargetWorkspaceChange = (targetWorkspaceOption: WorkspaceOption[]) => {
+ this.setState({
+ targetWorkspaceOption,
+ });
+ };
+
+ changeIncludeReferencesDeep = (e: React.ChangeEvent) => {
+ this.setState({
+ isIncludeReferencesDeepChecked: e.target.checked,
+ });
+ };
+
+ render() {
+ const {
+ workspaceOptions,
+ targetWorkspaceOption,
+ isIncludeReferencesDeepChecked,
+ allSelectedObjects,
+ } = this.state;
+ const { onClose } = this.props;
+ const targetWorkspaceId = targetWorkspaceOption?.at(0)?.key;
+
+ return (
+
+
+
+
+
+
+
+
+
+ <>
+
+ {i18n.translate(
+ 'savedObjectsManagement.objectsTable.duplicateModal.targetWorkspaceNotice',
+ {
+ defaultMessage: `Move copied saved object${
+ allSelectedObjects.length > 1 ? `s` : ``
+ } to the selected workspace.`,
+ }
+ )}
+
+
+
+ >
+
+
+
+
+
+ <>
+
+
+ >
+
+
+
+
+
+
+
+
+ this.duplicateSavedObjects(allSelectedObjects)}
+ isLoading={this.state.isLoading}
+ disabled={!targetWorkspaceId}
+ >
+
+
+
+
+ );
+ }
+}
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/duplicate_result_flyout.test.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/duplicate_result_flyout.test.tsx
new file mode 100644
index 000000000000..146a578ef03c
--- /dev/null
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/duplicate_result_flyout.test.tsx
@@ -0,0 +1,98 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+import { SavedObjectsImportError, SavedObjectsImportSuccess } from 'opensearch-dashboards/public';
+import { DuplicateResultFlyout, DuplicateResultFlyoutProps } from './duplicate_result_flyout';
+import { fireEvent, render, screen } from '@testing-library/react';
+import React from 'react';
+
+describe('DuplicateResultFlyout', () => {
+ const failedCopies: SavedObjectsImportError[] = [
+ {
+ type: 'config',
+ id: '1',
+ meta: { title: 'Failed Config Title' },
+ error: { type: 'unknown', message: 'An error occurred', statusCode: 500 },
+ },
+ {
+ type: 'dashboard',
+ id: '2',
+ meta: {},
+ error: { type: 'unsupported_type' },
+ },
+ ];
+ const successfulCopies: SavedObjectsImportSuccess[] = [
+ {
+ type: 'visualization',
+ id: '3',
+ meta: { title: 'Successful Visualization Title' },
+ },
+ {
+ type: 'search',
+ id: '4',
+ meta: {},
+ },
+ ];
+ const workspaceName = 'targetWorkspace';
+ const onCloseMock = jest.fn();
+ const duplicateResultFlyoutProps: DuplicateResultFlyoutProps = {
+ workspaceName,
+ failedCopies,
+ successfulCopies,
+ onClose: onCloseMock,
+ };
+
+ afterEach(() => {
+ jest.clearAllMocks();
+ });
+
+ it('renders the flyout with correct title and result', () => {
+ render();
+ expect(document.children).toMatchSnapshot();
+
+ // Check title
+ expect(screen.getByText('Copy saved objects to targetWorkspace')).toBeInTheDocument();
+
+ // Check result counts
+ expect(screen.getByText('4 saved objects copied')).toBeInTheDocument();
+ expect(screen.getByText('2 Successful')).toBeInTheDocument();
+ expect(screen.getByText('2 Error copying file')).toBeInTheDocument();
+
+ // Check successful copy icon and message
+ expect(screen.getByLabelText('visualization')).toBeInTheDocument();
+ expect(screen.getByText('Successful Visualization Title')).toBeInTheDocument();
+
+ expect(screen.getByLabelText('search')).toBeInTheDocument();
+ expect(screen.getByText('search [id=4]')).toBeInTheDocument();
+
+ // Check failed copy icon and message
+ expect(screen.getByLabelText('dashboard')).toBeInTheDocument();
+ expect(screen.getByText('dashboard [id=2]')).toBeInTheDocument();
+
+ expect(screen.getByLabelText('config')).toBeInTheDocument();
+ expect(screen.getByText('Failed Config Title')).toBeInTheDocument();
+ });
+
+ it('calls onClose when the close button is clicked', () => {
+ render();
+
+ const closeButton = screen.getByTestId('euiFlyoutCloseButton');
+ fireEvent.click(closeButton);
+
+ expect(onCloseMock).toHaveBeenCalledTimes(1);
+ });
+
+ it('copy count is null', () => {
+ render(
+
+ );
+ expect(document.children).toMatchSnapshot();
+ });
+});
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/duplicate_result_flyout.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/duplicate_result_flyout.tsx
new file mode 100644
index 000000000000..f1efcad4317d
--- /dev/null
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/duplicate_result_flyout.tsx
@@ -0,0 +1,232 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+import './import_summary.scss';
+import {
+ EuiFlexGroup,
+ EuiFlexItem,
+ EuiFlyout,
+ EuiFlyoutBody,
+ EuiFlyoutHeader,
+ EuiHorizontalRule,
+ EuiIcon,
+ EuiIconTip,
+ EuiSpacer,
+ EuiText,
+ EuiTitle,
+ EuiToolTip,
+} from '@elastic/eui';
+import _ from 'lodash';
+import React, { Fragment } from 'react';
+import { i18n } from '@osd/i18n';
+import { SavedObjectsImportError, SavedObjectsImportSuccess } from 'opensearch-dashboards/public';
+import { FormattedMessage } from '@osd/i18n/react';
+import { getSavedObjectLabel } from '../../..';
+import { getDefaultTitle } from '../../../lib';
+
+interface CopyItem {
+ type: string;
+ id: string;
+ title: string;
+ icon: string;
+ outcome: 'copied' | 'error';
+ errorMessage?: string;
+}
+
+export interface CopyResultProps {
+ failedCopies: SavedObjectsImportError[];
+ successfulCopies: SavedObjectsImportSuccess[];
+}
+
+export interface DuplicateResultFlyoutProps {
+ workspaceName: string;
+ failedCopies: SavedObjectsImportError[];
+ successfulCopies: SavedObjectsImportSuccess[];
+ onClose: () => void;
+}
+
+interface State {
+ isLoading: boolean;
+}
+
+const DEFAULT_ICON = 'apps';
+
+const unsupportedTypeErrorMessage = i18n.translate(
+ 'savedObjectsManagement.objectsTable.copyResult.unsupportedTypeError',
+ { defaultMessage: 'Unsupported object type' }
+);
+
+const getErrorMessage = ({ error }: SavedObjectsImportError) => {
+ if (error.type === 'unknown') {
+ return error.message;
+ } else if (error.type === 'unsupported_type') {
+ return unsupportedTypeErrorMessage;
+ }
+};
+
+export class DuplicateResultFlyout extends React.Component {
+ constructor(props: DuplicateResultFlyoutProps) {
+ super(props);
+ this.state = { isLoading: false };
+ }
+
+ getCountIndicators(copyItems: CopyItem[]) {
+ if (!copyItems.length) {
+ return null;
+ }
+
+ const outcomeCounts = copyItems.reduce(
+ (acc, { outcome }) => acc.set(outcome, (acc.get(outcome) ?? 0) + 1),
+ new Map()
+ );
+ const copiedCount = outcomeCounts.get('copied');
+ const errorCount = outcomeCounts.get('error');
+
+ return (
+
+ {copiedCount && (
+
+
+
+
+
+
+
+ )}
+ {errorCount && (
+
+
+
+
+
+
+
+ )}
+
+ );
+ }
+
+ getStatusIndicator({ outcome, errorMessage = 'Error' }: CopyItem) {
+ switch (outcome) {
+ case 'copied':
+ return (
+
+ );
+ case 'error':
+ return (
+
+ );
+ }
+ }
+
+ mapFailedCopy(failure: SavedObjectsImportError): CopyItem {
+ const { type, id, meta } = failure;
+ const title = meta.title || getDefaultTitle({ type, id });
+ const icon = meta.icon || DEFAULT_ICON;
+ const errorMessage = getErrorMessage(failure);
+ return { type, id, title, icon, outcome: 'error', errorMessage };
+ }
+
+ mapCopySuccess(obj: SavedObjectsImportSuccess): CopyItem {
+ const { type, id, meta } = obj;
+ const title = meta.title || getDefaultTitle(obj);
+ const icon = meta.icon || DEFAULT_ICON;
+ return { type, id, title, icon, outcome: 'copied' };
+ }
+
+ copyResult({ failedCopies, successfulCopies }: CopyResultProps) {
+ const copyItems: CopyItem[] = _.sortBy(
+ [
+ ...failedCopies.map((object) => this.mapFailedCopy(object)),
+ ...successfulCopies.map((object) => this.mapCopySuccess(object)),
+ ],
+ ['type', 'title']
+ );
+
+ return (
+
+
+
+
+
+
+
+ {this.getCountIndicators(copyItems)}
+
+ {copyItems.map((item, index) => {
+ const { type, title, icon } = item;
+ return (
+
+
+
+
+
+
+
+
+
+ {title}
+
+
+
+
+ {this.getStatusIndicator(item)}
+
+
+ );
+ })}
+
+ );
+ }
+
+ render() {
+ const { onClose, failedCopies, successfulCopies, workspaceName } = this.props;
+ return (
+
+
+
+
+
+
+ {this.copyResult({ failedCopies, successfulCopies })}
+
+ );
+ }
+}
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/header.test.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/header.test.tsx
index 1b0f40e9cd02..da6f241f382c 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/header.test.tsx
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/header.test.tsx
@@ -38,12 +38,48 @@ describe('Header', () => {
onExportAll: () => {},
onImport: () => {},
onRefresh: () => {},
- totalCount: 4,
+ onDuplicate: () => {},
+ objectCount: 4,
filteredCount: 2,
+ showDuplicateAll: false,
};
const component = shallow();
expect(component).toMatchSnapshot();
});
+
+ it('should render normally when showDuplicateAll is undefined', () => {
+ const props = {
+ onExportAll: () => {},
+ onImport: () => {},
+ onRefresh: () => {},
+ onDuplicate: () => {},
+ objectCount: 4,
+ filteredCount: 2,
+ showDuplicateAll: undefined,
+ };
+
+ const component = shallow();
+
+ expect(component).toMatchSnapshot();
+ });
+});
+
+describe('Header - workspace enabled', () => {
+ it('should render `Duplicate All` button when workspace enabled', () => {
+ const props = {
+ onExportAll: () => {},
+ onImport: () => {},
+ onRefresh: () => {},
+ onDuplicate: () => {},
+ objectCount: 4,
+ filteredCount: 2,
+ showDuplicateAll: true,
+ };
+
+ const component = shallow();
+
+ expect(component.find('EuiButtonEmpty[data-test-subj="duplicateObjects"]').exists()).toBe(true);
+ });
});
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/header.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/header.tsx
index bf2244cd984a..f83cdfaf69f2 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/header.tsx
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/header.tsx
@@ -42,13 +42,17 @@ import { FormattedMessage } from '@osd/i18n/react';
export const Header = ({
onExportAll,
onImport,
+ onDuplicate,
onRefresh,
- filteredCount,
+ objectCount,
+ showDuplicateAll = false,
}: {
onExportAll: () => void;
onImport: () => void;
+ onDuplicate: () => void;
onRefresh: () => void;
- filteredCount: number;
+ objectCount: number;
+ showDuplicateAll: boolean;
}) => (
@@ -65,6 +69,22 @@ export const Header = ({
+ {showDuplicateAll && (
+
+
+
+
+
+ )}
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/index.ts b/src/plugins/saved_objects_management/public/management_section/objects_table/components/index.ts
index 75e2f60c04f0..766def0786e0 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/index.ts
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/index.ts
@@ -32,3 +32,5 @@ export { Header } from './header';
export { Table } from './table';
export { Flyout } from './flyout';
export { Relationships } from './relationships';
+export { SavedObjectsDuplicateModal } from './duplicate_modal';
+export { DuplicateResultFlyout } from './duplicate_result_flyout';
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.test.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.test.tsx
index 3cc6d04cfac2..e9b5595dd45d 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.test.tsx
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.test.tsx
@@ -107,6 +107,9 @@ const defaultProps: TableProps = {
isSearching: false,
onShowRelationships: () => {},
canDelete: true,
+ onDuplicate: () => {},
+ onDuplicateSingle: () => {},
+ showDuplicate: false,
};
describe('Table', () => {
@@ -224,4 +227,23 @@ describe('Table', () => {
someAction.onClick();
expect(onActionRefresh).toHaveBeenCalled();
});
+
+ it('should call onDuplicateSingle when show duplicate', () => {
+ const onDuplicateSingle = jest.fn();
+ const showDuplicate = true;
+ const customizedProps = { ...defaultProps, onDuplicateSingle, showDuplicate };
+ const component = shallowWithI18nProvider();
+ expect(component).toMatchSnapshot();
+
+ const table = component.find('EuiBasicTable');
+ const columns = table.prop('columns') as any[];
+ const actionColumn = columns.find((x) => x.hasOwnProperty('actions')) as { actions: any[] };
+ const duplicateAction = actionColumn.actions.find(
+ (x) => x['data-test-subj'] === 'savedObjectsTableAction-duplicate'
+ );
+
+ expect(onDuplicateSingle).not.toHaveBeenCalled();
+ duplicateAction.onClick();
+ expect(onDuplicateSingle).toHaveBeenCalled();
+ });
});
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx
index 9effd038f49b..968ce9162434 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx
@@ -46,6 +46,7 @@ import {
EuiText,
EuiTableFieldDataColumnType,
EuiTableActionsColumnType,
+ EuiSearchBarProps,
} from '@elastic/eui';
import { i18n } from '@osd/i18n';
import { FormattedMessage } from '@osd/i18n/react';
@@ -67,9 +68,11 @@ export interface TableProps {
selectionConfig: {
onSelectionChange: (selection: SavedObjectWithMetadata[]) => void;
};
- filters: any[];
+ filters: EuiSearchBarProps['filters'];
canDelete: boolean;
onDelete: () => void;
+ onDuplicate: () => void;
+ onDuplicateSingle: (object: SavedObjectWithMetadata) => void;
onActionRefresh: (object: SavedObjectWithMetadata) => void;
onExport: (includeReferencesDeep: boolean) => void;
goInspectObject: (obj: SavedObjectWithMetadata) => void;
@@ -86,6 +89,7 @@ export interface TableProps {
dateFormat: string;
availableWorkspaces?: WorkspaceAttribute[];
currentWorkspaceId?: string;
+ showDuplicate: boolean;
}
interface TableState {
@@ -170,6 +174,8 @@ export class Table extends PureComponent {
filters,
selectionConfig: selection,
onDelete,
+ onDuplicate,
+ onDuplicateSingle,
onActionRefresh,
selectedSavedObjects,
onTableChange,
@@ -182,6 +188,7 @@ export class Table extends PureComponent {
dateFormat,
availableWorkspaces,
currentWorkspaceId,
+ showDuplicate,
} = this.props;
const visibleWsIds = availableWorkspaces?.map((ws) => ws.id) || [];
@@ -312,6 +319,25 @@ export class Table extends PureComponent {
onClick: (object) => onShowRelationships(object),
'data-test-subj': 'savedObjectsTableAction-relationships',
},
+ ...(showDuplicate
+ ? [
+ {
+ name: i18n.translate(
+ 'savedObjectsManagement.objectsTable.table.columnActions.duplicateActionName',
+ { defaultMessage: 'Copy to...' }
+ ),
+ description: i18n.translate(
+ 'savedObjectsManagement.objectsTable.table.columnActions.duplicateActionDescription',
+ { defaultMessage: 'Copy this saved object' }
+ ),
+ type: 'icon',
+ icon: 'copy',
+ onClick: (object: SavedObjectWithMetadata) => onDuplicateSingle(object),
+ available: (object: SavedObjectWithMetadata) => object.type !== 'config',
+ 'data-test-subj': 'savedObjectsTableAction-duplicate',
+ },
+ ]
+ : []),
...actionRegistry.getAll().map((action) => {
return {
...action.euiAction,
@@ -368,14 +394,30 @@ export class Table extends PureComponent {
const activeActionContents = this.state.activeAction?.render() ?? null;
+ const duplicateButton = (
+
+
+
+ );
+
return (
{activeActionContents}
{showDuplicate && duplicateButton}>,
{
+ it('should covert workspace to option', () => {
+ const workspace: WorkspaceAttribute = {
+ id: '1',
+ name: 'Workspace 1',
+ };
+ const workspaceOption: WorkspaceOption = workspaceToOption(workspace);
+ expect(workspaceOption.label).toBe(workspace.name);
+ expect(workspaceOption.key).toBe(workspace.id);
+ expect(workspaceOption.value).toBe(workspace);
+ });
+
+ it('should add suffix when workspace is current workspace', () => {
+ const workspace: WorkspaceAttribute = {
+ id: '1',
+ name: 'Workspace 1',
+ };
+ const workspaceOption: WorkspaceOption = workspaceToOption(workspace, '1');
+ expect(workspaceOption.label).toBe('Workspace 1 (current)');
+ expect(workspaceOption.key).toBe(workspace.id);
+ expect(workspaceOption.value).toBe(workspace);
+ });
+
+ it('should get correct target workspace options in a workspace', () => {
+ const workspaces: WorkspacesStart = {
+ currentWorkspaceId$: new BehaviorSubject('1'),
+ currentWorkspace$: new BehaviorSubject({
+ id: '1',
+ name: 'Workspace 1',
+ }),
+ workspaceList$: new BehaviorSubject([
+ { id: '1', name: 'Workspace 1', readonly: false },
+ { id: '2', name: 'Workspace 2', readonly: false },
+ { id: '3', name: 'Workspace 3', readonly: true },
+ ]),
+ initialized$: new BehaviorSubject(true),
+ };
+ const optionContainCurrent: WorkspaceOption[] = getTargetWorkspacesOptions(workspaces, {
+ id: '1',
+ name: 'Workspace 1',
+ readonly: false,
+ });
+ expect(optionContainCurrent.length).toBe(2);
+ expect(optionContainCurrent[0].key).toBe('1');
+ expect(optionContainCurrent[0].label).toBe('Workspace 1 (current)');
+
+ expect(optionContainCurrent[1].key).toBe('2');
+ expect(optionContainCurrent[1].label).toBe('Workspace 2');
+ });
+
+ it('should get correct target workspace options not in a workspace', () => {
+ const workspaces: WorkspacesStart = {
+ currentWorkspaceId$: new BehaviorSubject(''),
+ currentWorkspace$: new BehaviorSubject({
+ id: '',
+ name: '',
+ }),
+ workspaceList$: new BehaviorSubject([
+ { id: '1', name: 'Workspace 1', readonly: false },
+ { id: '2', name: 'Workspace 2', readonly: false },
+ { id: '3', name: 'Workspace 3', readonly: true },
+ ]),
+ initialized$: new BehaviorSubject(true),
+ };
+
+ const workspaceOption: WorkspaceOption[] = getTargetWorkspacesOptions(workspaces);
+ expect(workspaceOption.length).toBe(2);
+ expect(workspaceOption[0].key).toBe('1');
+ expect(workspaceOption[0].label).toBe('Workspace 1');
+ expect(workspaceOption[1].key).toBe('2');
+ expect(workspaceOption[1].label).toBe('Workspace 2');
+ });
+});
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/utils.ts b/src/plugins/saved_objects_management/public/management_section/objects_table/components/utils.ts
new file mode 100644
index 000000000000..a7a5b8b77852
--- /dev/null
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/utils.ts
@@ -0,0 +1,40 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+import { EuiComboBoxOptionOption } from '@elastic/eui';
+import { WorkspaceObject, WorkspacesStart } from 'opensearch-dashboards/public';
+
+export type WorkspaceOption = EuiComboBoxOptionOption;
+
+// Convert workspace to option which can be displayed in the drop-down box.
+export function workspaceToOption(
+ workspace: WorkspaceObject,
+ currentWorkspaceId?: string
+): WorkspaceOption {
+ // add (current) after current workspace name
+ let workspaceName = workspace.name;
+ if (workspace.id === currentWorkspaceId) {
+ workspaceName += ' (current)';
+ }
+ return {
+ label: workspaceName,
+ key: workspace.id,
+ value: workspace,
+ };
+}
+
+export function getTargetWorkspacesOptions(
+ workspaces: WorkspacesStart,
+ currentWorkspace?: WorkspaceObject
+): WorkspaceOption[] {
+ const currentWorkspaceId = currentWorkspace?.id;
+ const workspaceList = workspaces.workspaceList$.value;
+ const targetWorkspaces = workspaceList.filter(
+ (workspace) => workspace.id !== currentWorkspaceId && !workspace.readonly
+ );
+ // current workspace is the first option
+ if (currentWorkspace && !currentWorkspace.readonly) targetWorkspaces.unshift(currentWorkspace);
+ return targetWorkspaces.map((workspace) => workspaceToOption(workspace, currentWorkspaceId));
+}
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/index.ts b/src/plugins/saved_objects_management/public/management_section/objects_table/index.ts
index b2153648057f..2375151af1db 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/index.ts
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/index.ts
@@ -29,3 +29,4 @@
*/
export { SavedObjectsTable } from './saved_objects_table';
+export { SavedObjectsDuplicateModal } from './components';
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.mocks.ts b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.mocks.ts
index b856b8662479..f91c7103eeac 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.mocks.ts
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.mocks.ts
@@ -80,3 +80,8 @@ export const getRelationshipsMock = jest.fn();
jest.doMock('../../lib/get_relationships', () => ({
getRelationships: getRelationshipsMock,
}));
+
+export const getDuplicateSavedObjectsMock = jest.fn();
+jest.doMock('../../lib/duplicate_saved_objects', () => ({
+ duplicateSavedObjects: getDuplicateSavedObjectsMock,
+}));
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.tsx
index a33a59786617..f8d7e7b8b9ef 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.tsx
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.tsx
@@ -33,6 +33,7 @@ import {
fetchExportByTypeAndSearchMock,
fetchExportObjectsMock,
findObjectsMock,
+ getDuplicateSavedObjectsMock,
getRelationshipsMock,
getSavedObjectCountsMock,
saveAsMock,
@@ -241,6 +242,22 @@ describe('SavedObjectsTable', () => {
expect(component).toMatchSnapshot();
});
+ it('should unmount normally', async () => {
+ const component = shallowRender();
+ const mockDebouncedFetchObjects = {
+ cancel: jest.fn(),
+ flush: jest.fn(),
+ };
+ component.instance().debouncedFetchObjects = mockDebouncedFetchObjects as any;
+ // Ensure all promises resolve
+ await new Promise((resolve) => process.nextTick(resolve));
+ // Ensure the state changes are reflected
+ // component.update();
+
+ component.unmount();
+ expect(component).toMatchSnapshot();
+ });
+
it('should add danger toast when find fails', async () => {
findObjectsMock.mockImplementation(() => {
throw new Error('Simulated find error');
@@ -858,4 +875,214 @@ describe('SavedObjectsTable', () => {
});
});
});
+
+ describe('duplicate', () => {
+ const applications = applicationServiceMock.createStartContract();
+ applications.capabilities = {
+ navLinks: {},
+ management: {},
+ catalogue: {},
+ savedObjectsManagement: {
+ read: true,
+ edit: false,
+ delete: false,
+ },
+ workspaces: {
+ enabled: true,
+ },
+ };
+
+ const workspaceList: WorkspaceObject[] = [
+ {
+ id: 'workspace1',
+ name: 'foo',
+ },
+ {
+ id: 'workspace2',
+ name: 'bar',
+ },
+ ];
+
+ const mockSelectedSavedObjects = [
+ { id: '1', type: 'dashboard', references: [], attributes: [], meta: { title: 'object-1' } },
+ { id: '2', type: 'dashboard', references: [], attributes: [], meta: { title: 'object-2' } },
+ ] as SavedObjectWithMetadata[];
+
+ beforeEach(() => {
+ workspaces.workspaceList$.next(workspaceList);
+ workspaces.currentWorkspaceId$.next('workspace1');
+ workspaces.currentWorkspace$.next(workspaceList[0]);
+ });
+
+ it('should duplicate selected objects', async () => {
+ getDuplicateSavedObjectsMock.mockImplementation(() => ({ success: true }));
+
+ const component = shallowRender({ applications, workspaces });
+ component.setState({ isShowingDuplicateModal: true });
+
+ // Ensure all promises resolve
+ await new Promise((resolve) => process.nextTick(resolve));
+ // Ensure the state changes are reflected
+ component.update();
+
+ expect(component.state('isShowingDuplicateModal')).toEqual(true);
+ expect(component.find('SavedObjectsDuplicateModal').length).toEqual(1);
+
+ await component.instance().onDuplicate(mockSelectedSavedObjects, false, 'workspace2', 'bar');
+
+ expect(getDuplicateSavedObjectsMock).toHaveBeenCalledWith(
+ http,
+ [
+ { id: '1', type: 'dashboard' },
+ { id: '2', type: 'dashboard' },
+ ],
+ 'workspace2',
+ false
+ );
+ component.update();
+
+ expect(component.state('isShowingDuplicateResultFlyout')).toEqual(true);
+ expect(component.find('DuplicateResultFlyout').length).toEqual(1);
+ });
+
+ it('should duplicate single object', async () => {
+ getDuplicateSavedObjectsMock.mockImplementation(() => ({ success: true }));
+
+ const component = shallowRender({ applications, workspaces });
+ component.setState({ isShowingDuplicateModal: true });
+
+ // Ensure all promises resolve
+ await new Promise((resolve) => process.nextTick(resolve));
+ // Ensure the state changes are reflected
+ component.update();
+
+ await component
+ .instance()
+ .onDuplicate([mockSelectedSavedObjects[0]], true, 'workspace2', 'bar');
+
+ expect(getDuplicateSavedObjectsMock).toHaveBeenCalledWith(
+ http,
+ [{ id: '1', type: 'dashboard' }],
+ 'workspace2',
+ true
+ );
+ component.update();
+
+ expect(component.state('isShowingDuplicateResultFlyout')).toEqual(true);
+ expect(component.find('DuplicateResultFlyout').length).toEqual(1);
+ });
+
+ it('should show result flyout when duplicating success and failure coexist', async () => {
+ const component = shallowRender({ applications, workspaces });
+ component.setState({ isShowingDuplicateModal: true });
+
+ // Ensure all promises resolve
+ await new Promise((resolve) => process.nextTick(resolve));
+ // Ensure the state changes are reflected
+ component.update();
+
+ getDuplicateSavedObjectsMock.mockImplementationOnce(() => ({
+ success: false,
+ successCount: 1,
+ successResults: [{ id: '1' }],
+ errors: [{ id: '2' }],
+ }));
+
+ await component.instance().onDuplicate(mockSelectedSavedObjects, false, 'workspace2', 'bar');
+
+ expect(getDuplicateSavedObjectsMock).toHaveBeenCalledWith(
+ http,
+ [
+ { id: '1', type: 'dashboard' },
+ { id: '2', type: 'dashboard' },
+ ],
+ 'workspace2',
+ false
+ );
+ component.update();
+
+ expect(component.state('isShowingDuplicateResultFlyout')).toEqual(true);
+ expect(component.find('DuplicateResultFlyout').length).toEqual(1);
+ });
+
+ it('should catch error when duplicating selected object is fail', async () => {
+ getDuplicateSavedObjectsMock.mockImplementationOnce(() => undefined);
+
+ const component = shallowRender({ applications, workspaces });
+ component.setState({ isShowingDuplicateModal: true });
+
+ // Ensure all promises resolve
+ await new Promise((resolve) => process.nextTick(resolve));
+ // Ensure the state changes are reflected
+ component.update();
+
+ await component.instance().onDuplicate(mockSelectedSavedObjects, false, 'workspace2', 'bar');
+
+ expect(getDuplicateSavedObjectsMock).toHaveBeenCalledWith(
+ http,
+ [
+ { id: '1', type: 'dashboard' },
+ { id: '2', type: 'dashboard' },
+ ],
+ 'workspace2',
+ false
+ );
+ component.update();
+
+ expect(notifications.toasts.addDanger).toHaveBeenCalledWith({
+ title: 'Unable to copy 2 saved objects.',
+ });
+ });
+
+ it('should allow the user to choose on header when duplicating all', async () => {
+ const component = shallowRender({ applications, workspaces });
+
+ // Ensure all promises resolve
+ await new Promise((resolve) => process.nextTick(resolve));
+ // Ensure the state changes are reflected
+ component.update();
+
+ const header = component.find('Header') as any;
+ expect(header.prop('showDuplicateAll')).toEqual(true);
+ header.prop('onDuplicate')();
+
+ await new Promise((resolve) => process.nextTick(resolve));
+ component.update();
+
+ expect(component.state('isShowingDuplicateModal')).toEqual(true);
+ expect(component.find('SavedObjectsDuplicateModal')).toMatchSnapshot();
+ });
+
+ it('should allow the user to choose on table when duplicating all', async () => {
+ const component = shallowRender({ applications, workspaces });
+
+ // Ensure all promises resolve
+ await new Promise((resolve) => process.nextTick(resolve));
+ // Ensure the state changes are reflected
+ component.update();
+
+ const table = component.find('Table') as any;
+ table.prop('onDuplicate')();
+ component.update();
+
+ expect(component.state('isShowingDuplicateModal')).toEqual(true);
+ expect(component.find('SavedObjectsDuplicateModal')).toMatchSnapshot();
+ });
+
+ it('should allow the user to choose on table when duplicating single', async () => {
+ const component = shallowRender({ applications, workspaces });
+
+ // Ensure all promises resolve
+ await new Promise((resolve) => process.nextTick(resolve));
+ // Ensure the state changes are reflected
+ component.update();
+
+ const table = component.find('Table') as any;
+ table.prop('onDuplicateSingle')([{ id: '1', type: 'dashboard', workspaces: ['workspace1'] }]);
+ component.update();
+
+ expect(component.state('isShowingDuplicateModal')).toEqual(true);
+ expect(component.find('SavedObjectsDuplicateModal')).toMatchSnapshot();
+ });
+ });
});
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx
index 28d320fc6fb6..7b9f1a09b49b 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx
@@ -55,6 +55,7 @@ import {
EuiCompressedFormRow,
EuiFlexGroup,
EuiFlexItem,
+ EuiSearchBarProps,
EuiText,
} from '@elastic/eui';
import { i18n } from '@osd/i18n';
@@ -69,6 +70,8 @@ import {
ApplicationStart,
WorkspacesStart,
WorkspaceAttribute,
+ SavedObjectsImportSuccess,
+ SavedObjectsImportError,
} from 'src/core/public';
import { Subscription } from 'rxjs';
import { RedirectAppLinks } from '../../../../opensearch_dashboards_react/public';
@@ -86,6 +89,7 @@ import {
findObject,
extractExportDetails,
SavedObjectsExportResultDetails,
+ duplicateSavedObjects,
} from '../../lib';
import { SavedObjectWithMetadata } from '../../types';
import {
@@ -94,15 +98,22 @@ import {
SavedObjectsManagementColumnServiceStart,
SavedObjectsManagementNamespaceServiceStart,
} from '../../services';
-import { Header, Table, Flyout, Relationships } from './components';
+import {
+ Header,
+ Table,
+ Flyout,
+ Relationships,
+ SavedObjectsDuplicateModal,
+ DuplicateResultFlyout,
+} from './components';
import { DataPublicPluginStart } from '../../../../../plugins/data/public';
+import { DuplicateObject } from '../types';
import { formatWorkspaceIdParams } from '../../utils';
interface ExportAllOption {
id: string;
label: string;
}
-
export interface SavedObjectsTableProps {
allowedTypes: string[];
serviceRegistry: ISavedObjectsManagementServiceRegistry;
@@ -133,7 +144,9 @@ export interface SavedObjectsTableState {
savedObjectCounts: Record>;
activeQuery: Query;
selectedSavedObjects: SavedObjectWithMetadata[];
+ duplicateSelectedSavedObjects: DuplicateObject[];
isShowingImportFlyout: boolean;
+ isShowingDuplicateModal: boolean;
isSearching: boolean;
filteredItemCount: number;
isShowingRelationships: boolean;
@@ -147,6 +160,10 @@ export interface SavedObjectsTableState {
currentWorkspaceId?: string;
workspaceEnabled: boolean;
availableWorkspaces?: WorkspaceAttribute[];
+ isShowingDuplicateResultFlyout: boolean;
+ failedCopies: SavedObjectsImportError[];
+ successfulCopies: SavedObjectsImportSuccess[];
+ targetWorkspaceName: string;
}
export class SavedObjectsTable extends Component {
private _isMounted = false;
@@ -169,7 +186,9 @@ export class SavedObjectsTable extends Component>,
activeQuery: Query.parse(''),
selectedSavedObjects: [],
+ duplicateSelectedSavedObjects: [],
isShowingImportFlyout: false,
+ isShowingDuplicateModal: false,
isSearching: false,
filteredItemCount: 0,
isShowingRelationships: false,
@@ -183,9 +202,46 @@ export class SavedObjectsTable extends Component ns.id) || [];
+ if (availableNamespaces.length) {
+ const filteredNamespaces = filterQuery(availableNamespaces, visibleNamespaces);
+ findOptions.namespaces = filteredNamespaces;
+ }
+
+ if (visibleWorkspaces?.length) {
+ findOptions.workspaces = this.workspaceNamesToIds(visibleWorkspaces);
+ }
+
+ if (findOptions.type.length > 1) {
+ findOptions.sortField = 'type';
+ }
+
+ return findOptions;
+ }
+
private get workspaceIdQuery() {
const { currentWorkspaceId, workspaceEnabled } = this.state;
// workspace is turned off
@@ -332,37 +388,11 @@ export class SavedObjectsTable extends Component {
- const { activeQuery: query, page, perPage } = this.state;
- const { notifications, http, allowedTypes, namespaceRegistry } = this.props;
- const { queryText, visibleTypes, visibleNamespaces, visibleWorkspaces } = parseQuery(query);
- const filteredTypes = filterQuery(allowedTypes, visibleTypes);
- // "searchFields" is missing from the "findOptions" but gets injected via the API.
- // The API extracts the fields from each uiExports.savedObjectsManagement "defaultSearchField" attribute
- const findOptions: SavedObjectsFindOptions = formatWorkspaceIdParams({
- search: queryText ? `${queryText}*` : undefined,
- perPage,
- page: page + 1,
- fields: ['id'],
- type: filteredTypes,
- workspaces: this.workspaceIdQuery,
- });
-
- const availableNamespaces = namespaceRegistry.getAll()?.map((ns) => ns.id) || [];
- if (availableNamespaces.length) {
- const filteredNamespaces = filterQuery(availableNamespaces, visibleNamespaces);
- findOptions.namespaces = filteredNamespaces;
- }
-
- if (visibleWorkspaces?.length) {
- findOptions.workspaces = this.workspaceNamesToIds(visibleWorkspaces);
- }
-
- if (findOptions.type.length > 1) {
- findOptions.sortField = 'type';
- }
+ const { activeQuery: query } = this.state;
+ const { notifications, http } = this.props;
try {
- const resp = await findObjects(http, findOptions);
+ const resp = await findObjects(http, this.findOptions);
if (!this._isMounted) {
return;
}
@@ -666,6 +696,120 @@ export class SavedObjectsTable extends Component {
+ this.setState({ isShowingDuplicateModal: false });
+ };
+
+ onDuplicateAll = async () => {
+ const { notifications, http } = this.props;
+ const findOptions = this.findOptions;
+ findOptions.perPage = 9999;
+ findOptions.page = 1;
+
+ try {
+ const resp = await findObjects(http, findOptions);
+ const duplicateObjects = resp.savedObjects.map((obj) => ({
+ id: obj.id,
+ type: obj.type,
+ meta: obj.meta,
+ workspaces: obj.workspaces,
+ }));
+ this.setState({
+ duplicateSelectedSavedObjects: duplicateObjects,
+ isShowingDuplicateModal: true,
+ });
+ } catch (error) {
+ notifications.toasts.addDanger({
+ title: i18n.translate(
+ 'savedObjectsManagement.objectsTable.unableFindSavedObjectsNotificationMessage',
+ { defaultMessage: 'Unable find saved objects' }
+ ),
+ text: `${error}`,
+ });
+ }
+ };
+
+ onDuplicate = async (
+ savedObjects: DuplicateObject[],
+ includeReferencesDeep: boolean,
+ targetWorkspace: string,
+ targetWorkspaceName: string
+ ) => {
+ const { http, notifications } = this.props;
+ const objectsToDuplicate = savedObjects.map((obj) => ({ id: obj.id, type: obj.type }));
+ let result;
+ try {
+ result = await duplicateSavedObjects(
+ http,
+ objectsToDuplicate,
+ targetWorkspace,
+ includeReferencesDeep
+ );
+
+ this.setState({
+ isShowingDuplicateResultFlyout: true,
+ failedCopies: result.success ? [] : result.errors,
+ successfulCopies: result.successCount > 0 ? result.successResults : [],
+ targetWorkspaceName,
+ });
+ } catch (e) {
+ notifications.toasts.addDanger({
+ title: i18n.translate('savedObjectsManagement.objectsTable.duplicate.dangerNotification', {
+ defaultMessage:
+ 'Unable to copy {errorCount, plural, one {# saved object} other {# saved objects}}.',
+ values: { errorCount: savedObjects.length },
+ }),
+ });
+ }
+ this.hideDuplicateModal();
+ await this.refreshObjects();
+ };
+
+ renderDuplicateModal() {
+ const { isShowingDuplicateModal, duplicateSelectedSavedObjects } = this.state;
+
+ if (!isShowingDuplicateModal) {
+ return null;
+ }
+
+ return (
+
+ );
+ }
+
+ hideDuplicateResultFlyout = () => {
+ this.setState({ isShowingDuplicateResultFlyout: false });
+ };
+
+ renderDuplicateResultFlyout() {
+ const {
+ isShowingDuplicateResultFlyout,
+ targetWorkspaceName,
+ failedCopies,
+ successfulCopies,
+ } = this.state;
+
+ if (!isShowingDuplicateResultFlyout) {
+ return null;
+ }
+
+ return (
+
+ );
+ }
+
renderRelationships() {
if (!this.state.isShowingRelationships) {
return null;
@@ -919,7 +1063,7 @@ export class SavedObjectsTable extends Component this.setState({ isShowingExportAllOptionsModal: true })}
onImport={this.showImportFlyout}
+ showDuplicateAll={this.state.workspaceEnabled}
+ onDuplicate={this.onDuplicateAll}
onRefresh={this.refreshObjects}
- filteredCount={filteredItemCount}
+ objectCount={savedObjects.length}
/>
@@ -1006,6 +1156,18 @@ export class SavedObjectsTable extends Component
+ this.setState({
+ isShowingDuplicateModal: true,
+ duplicateSelectedSavedObjects: selectedSavedObjects,
+ })
+ }
+ onDuplicateSingle={(object) =>
+ this.setState({
+ duplicateSelectedSavedObjects: [object],
+ isShowingDuplicateModal: true,
+ })
+ }
onActionRefresh={this.refreshObject}
goInspectObject={this.props.goInspectObject}
pageIndex={page}
@@ -1018,6 +1180,7 @@ export class SavedObjectsTable extends Component
diff --git a/src/plugins/saved_objects_management/public/management_section/types.ts b/src/plugins/saved_objects_management/public/management_section/types.ts
index 77fcc824fef4..e8bf3e203c8c 100644
--- a/src/plugins/saved_objects_management/public/management_section/types.ts
+++ b/src/plugins/saved_objects_management/public/management_section/types.ts
@@ -29,6 +29,7 @@
*/
import { SavedObjectReference } from '../../../../core/types';
+import { SavedObjectWithMetadata } from '../../common';
export interface ObjectField {
type: FieldType;
@@ -47,3 +48,5 @@ export interface SubmittedFormData {
attributes: any;
references: SavedObjectReference[];
}
+
+export type DuplicateObject = Pick;
diff --git a/src/plugins/workspace/public/components/workspace_column/workspace_column.tsx b/src/plugins/workspace/public/components/workspace_column/workspace_column.tsx
index 3d964009ee86..4391f8d2c858 100644
--- a/src/plugins/workspace/public/components/workspace_column/workspace_column.tsx
+++ b/src/plugins/workspace/public/components/workspace_column/workspace_column.tsx
@@ -36,7 +36,7 @@ export function getWorkspaceColumn(
align: 'left',
field: 'workspaces',
name: i18n.translate('savedObjectsManagement.objectsTable.table.columnWorkspacesName', {
- defaultMessage: 'Workspaces',
+ defaultMessage: 'Workspace',
}),
render: (workspaces: string[]) => {
return ;
diff --git a/src/plugins/workspace/public/workspace_client.test.ts b/src/plugins/workspace/public/workspace_client.test.ts
index c18ed3db64e7..a36c68ff3bf3 100644
--- a/src/plugins/workspace/public/workspace_client.test.ts
+++ b/src/plugins/workspace/public/workspace_client.test.ts
@@ -178,6 +178,7 @@ describe('#WorkspaceClient', () => {
expect(workspaceMock.workspaceList$.getValue()).toEqual([
{
id: 'foo',
+ readonly: false,
},
]);
expect(httpSetupMock.fetch).toBeCalledWith('/api/workspaces/_list', {
@@ -209,4 +210,28 @@ describe('#WorkspaceClient', () => {
});
expect(workspaceMock.workspaceList$.getValue()).toEqual([]);
});
+
+ it('#init with resultWithWritePermission is not success ', async () => {
+ const { workspaceClient, httpSetupMock, workspaceMock } = getWorkspaceClient();
+ httpSetupMock.fetch
+ .mockResolvedValueOnce({
+ success: true,
+ result: {
+ workspaces: [
+ {
+ id: 'foo',
+ name: 'foo',
+ },
+ ],
+ total: 1,
+ per_page: 999,
+ page: 1,
+ },
+ })
+ .mockResolvedValueOnce({
+ success: false,
+ });
+ await workspaceClient.init();
+ expect(workspaceMock.workspaceList$.getValue()).toEqual([]);
+ });
});
diff --git a/src/plugins/workspace/public/workspace_client.ts b/src/plugins/workspace/public/workspace_client.ts
index e62f9518916f..d9931f95c135 100644
--- a/src/plugins/workspace/public/workspace_client.ts
+++ b/src/plugins/workspace/public/workspace_client.ts
@@ -11,6 +11,7 @@ import {
WorkspaceAttribute,
WorkspacesSetup,
} from '../../../core/public';
+import { WorkspacePermissionMode } from '../common/constants';
import { SavedObjectPermissions, WorkspaceAttributeWithPermission } from '../../../core/types';
const WORKSPACES_API_BASE_URL = '/api/workspaces';
@@ -38,6 +39,7 @@ interface WorkspaceFindOptions {
searchFields?: string[];
sortField?: string;
sortOrder?: string;
+ permissionModes?: WorkspacePermissionMode[];
}
/**
@@ -118,7 +120,20 @@ export class WorkspaceClient {
});
if (result?.success) {
- this.workspaces.workspaceList$.next(result.result.workspaces);
+ const resultWithWritePermission = await this.list({
+ perPage: 999,
+ permissionModes: [WorkspacePermissionMode.LibraryWrite],
+ });
+ if (resultWithWritePermission?.success) {
+ const workspaceIdsWithWritePermission = resultWithWritePermission.result.workspaces.map(
+ (workspace: WorkspaceAttribute) => workspace.id
+ );
+ const workspaces = result.result.workspaces.map((workspace: WorkspaceAttribute) => ({
+ ...workspace,
+ readonly: !workspaceIdsWithWritePermission.includes(workspace.id),
+ }));
+ this.workspaces.workspaceList$.next(workspaces);
+ }
} else {
this.workspaces.workspaceList$.next([]);
}
@@ -233,6 +248,7 @@ export class WorkspaceClient {
* @property {integer} [options.page=1]
* @property {integer} [options.perPage=20]
* @property {array} options.fields
+ * @property {string array} permissionModes
* @returns A find result with workspaces matching the specified search.
*/
public list(
diff --git a/src/plugins/workspace/server/routes/duplicate.ts b/src/plugins/workspace/server/routes/duplicate.ts
index 001f924c31bb..dbd9a8d5c9c6 100644
--- a/src/plugins/workspace/server/routes/duplicate.ts
+++ b/src/plugins/workspace/server/routes/duplicate.ts
@@ -90,6 +90,7 @@ export const registerDuplicateRoute = (
overwrite: false,
createNewCopies: true,
workspaces: [targetWorkspace],
+ dataSourceEnabled: true,
});
return res.ok({ body: result });
diff --git a/src/plugins/workspace/server/types.ts b/src/plugins/workspace/server/types.ts
index 82d4bc594a7e..5e88e5acb3ae 100644
--- a/src/plugins/workspace/server/types.ts
+++ b/src/plugins/workspace/server/types.ts
@@ -18,6 +18,7 @@ import {
export interface WorkspaceAttributeWithPermission extends WorkspaceAttribute {
permissions?: Permissions;
}
+import { WorkspacePermissionMode } from '../common/constants';
export interface WorkspaceFindOptions {
page?: number;
@@ -26,6 +27,7 @@ export interface WorkspaceFindOptions {
searchFields?: string[];
sortField?: string;
sortOrder?: string;
+ permissionModes?: WorkspacePermissionMode[];
}
export interface IRequestDetail {
diff --git a/src/plugins/workspace/server/workspace_client.ts b/src/plugins/workspace/server/workspace_client.ts
index 0b7d7c8a57c1..7cc8bcec6baa 100644
--- a/src/plugins/workspace/server/workspace_client.ts
+++ b/src/plugins/workspace/server/workspace_client.ts
@@ -174,6 +174,7 @@ export class WorkspaceClient implements IWorkspaceClientImpl {
{
...options,
type: WORKSPACE_TYPE,
+ ACLSearchParams: { permissionModes: options.permissionModes },
}
);
return {
From 365ddbbea478b2b8b36ddb0cf53d71f9b3a647fd Mon Sep 17 00:00:00 2001
From: "opensearch-trigger-bot[bot]"
<98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Date: Wed, 24 Jul 2024 10:52:13 -0700
Subject: [PATCH 08/12] Compress data source selector on (#7329) (#7412)
* management's data sources page
* dev tools
* home
* query enhancements
* saved object mgmt
* time series
(cherry picked from commit 3526f96f5889227fd79f3e671b3e3507a1a547d1)
Signed-off-by: Miki
Signed-off-by: github-actions[bot]
Co-authored-by: github-actions[bot]
Co-authored-by: ZilongX <99905560+ZilongX@users.noreply.github.com>
---
changelogs/fragments/7329.yml | 2 ++
...query_data_connections_table.test.tsx.snap | 25 ++++++++++---------
...ge_direct_query_data_connections_table.tsx | 1 +
src/plugins/dev_tools/public/application.tsx | 2 +-
.../components/tutorial_directory.js | 1 +
.../components/connections_bar.tsx | 1 +
.../__snapshots__/flyout.test.tsx.snap | 1 +
.../objects_table/components/flyout.tsx | 1 +
.../application/components/index_pattern.js | 1 +
9 files changed, 22 insertions(+), 13 deletions(-)
create mode 100644 changelogs/fragments/7329.yml
diff --git a/changelogs/fragments/7329.yml b/changelogs/fragments/7329.yml
new file mode 100644
index 000000000000..e30e73df5936
--- /dev/null
+++ b/changelogs/fragments/7329.yml
@@ -0,0 +1,2 @@
+feat:
+- Use compressed DataSourceSelector ([#7329](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7329))
diff --git a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_connection/__snapshots__/manage_direct_query_data_connections_table.test.tsx.snap b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_connection/__snapshots__/manage_direct_query_data_connections_table.test.tsx.snap
index 0de4a45d747d..83cfde5b9ef7 100644
--- a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_connection/__snapshots__/manage_direct_query_data_connections_table.test.tsx.snap
+++ b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_connection/__snapshots__/manage_direct_query_data_connections_table.test.tsx.snap
@@ -107,6 +107,7 @@ exports[`ManageDirectQueryDataConnectionsTable renders correctly 1`] = `
}
>
diff --git a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_connection/manage_direct_query_data_connections_table.tsx b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_connection/manage_direct_query_data_connections_table.tsx
index f4bc2974a9f6..54d3fe2fa573 100644
--- a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_connection/manage_direct_query_data_connections_table.tsx
+++ b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_data_connection/manage_direct_query_data_connections_table.tsx
@@ -234,6 +234,7 @@ export const ManageDirectQueryDataConnectionsTable: React.FC
)}
diff --git a/src/plugins/dev_tools/public/application.tsx b/src/plugins/dev_tools/public/application.tsx
index 6c4cae6e18cf..38d444665852 100644
--- a/src/plugins/dev_tools/public/application.tsx
+++ b/src/plugins/dev_tools/public/application.tsx
@@ -124,7 +124,7 @@ function DevToolsWrapper({
onSelectedDataSource={onChange}
disabled={!dataSourceEnabled}
fullWidth={false}
- compressed
+ compressed={true}
/>
);
diff --git a/src/plugins/home/public/application/components/tutorial_directory.js b/src/plugins/home/public/application/components/tutorial_directory.js
index 4d4cf4566d1f..d9ddcc167e05 100644
--- a/src/plugins/home/public/application/components/tutorial_directory.js
+++ b/src/plugins/home/public/application/components/tutorial_directory.js
@@ -240,6 +240,7 @@ class TutorialDirectoryUi extends React.Component {
disabled={!isDataSourceEnabled}
hideLocalCluster={isLocalClusterHidden}
uiSettings={getServices().uiSettings}
+ compressed={true}
/>
) : null;
diff --git a/src/plugins/query_enhancements/public/data_source_connection/components/connections_bar.tsx b/src/plugins/query_enhancements/public/data_source_connection/components/connections_bar.tsx
index d7590b278220..3fd592e50b31 100644
--- a/src/plugins/query_enhancements/public/data_source_connection/components/connections_bar.tsx
+++ b/src/plugins/query_enhancements/public/data_source_connection/components/connections_bar.tsx
@@ -81,6 +81,7 @@ export const ConnectionsBar: React.FC = ({ connectionsService,
notifications={toasts}
disabled={false}
fullWidth={false}
+ compressed={true}
removePrepend={true}
isClearable={false}
onSelectedDataSource={(dataSource) =>
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/flyout.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/flyout.test.tsx.snap
index 094719482816..4329f6164ff8 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/flyout.test.tsx.snap
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/flyout.test.tsx.snap
@@ -598,6 +598,7 @@ exports[`Flyout should render cluster selector and import options when datasourc
}
>
{
disabled={!this.props.dataSourceEnabled}
fullWidth={true}
isClearable={false}
+ compressed={true}
/>
diff --git a/src/plugins/vis_type_timeseries/public/application/components/index_pattern.js b/src/plugins/vis_type_timeseries/public/application/components/index_pattern.js
index f39771de11de..60f709b41c0c 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/index_pattern.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/index_pattern.js
@@ -189,6 +189,7 @@ export const IndexPattern = ({ fields, prefix, onChange, disabled, model: _model
}
disabled={false}
fullWidth={false}
+ compressed={true}
removePrepend={true}
isClearable={false}
/>
From 639a705efbb1ffc146468171aee381b4f1c3ccd0 Mon Sep 17 00:00:00 2001
From: "Qingyang(Abby) Hu"
Date: Wed, 24 Jul 2024 11:27:13 -0700
Subject: [PATCH 09/12] [Discover-next] remove plugin config toggle for data
enhancements (#7291) (#7293) (#7408)
* [Discover-next] remove plugin config toggle for data enhancements
Remove the data config toggle for enhancements and rely on the
UI settings for being enabled.
(cherry picked from commit 5761207dd2b673563db2638bfc475ecb6b246c0d)
Signed-off-by: Kawika Avilla
Signed-off-by: github-actions[bot]
Signed-off-by: Qingyang(Abby) Hu
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot]
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
---
.github/workflows/cypress_workflow.yml | 2 +-
changelogs/fragments/7314.yml | 2 ++
package.json | 2 +-
.../public/ui/query_editor/query_editor_top_row.tsx | 11 +----------
src/plugins/data/public/ui/settings/settings.ts | 2 +-
src/plugins/data/public/ui/ui_service.ts | 1 -
src/plugins/data/server/ui_settings.ts | 2 +-
.../query_enhancements/opensearch_dashboards.json | 4 ++--
test/common/config.js | 1 +
9 files changed, 10 insertions(+), 17 deletions(-)
create mode 100644 changelogs/fragments/7314.yml
diff --git a/.github/workflows/cypress_workflow.yml b/.github/workflows/cypress_workflow.yml
index 669f596df898..b404f9c46240 100644
--- a/.github/workflows/cypress_workflow.yml
+++ b/.github/workflows/cypress_workflow.yml
@@ -32,7 +32,7 @@ env:
TEST_REPO: ${{ inputs.test_repo != '' && inputs.test_repo || 'opensearch-project/opensearch-dashboards-functional-test' }}
TEST_BRANCH: "${{ inputs.test_branch != '' && inputs.test_branch || github.base_ref }}"
FTR_PATH: 'ftr'
- START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch --savedObjects.maxImportPayloadBytes=10485760 --server.maxPayloadBytes=1759977 --logging.json=false --data.search.aggs.shardDelay.enabled=true --csp.warnLegacyBrowsers=false'
+ START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch --savedObjects.maxImportPayloadBytes=10485760 --server.maxPayloadBytes=1759977 --logging.json=false --data.search.aggs.shardDelay.enabled=true --csp.warnLegacyBrowsers=false --uiSettings.overrides["query:enhancements:enabled"]=false'
OPENSEARCH_SNAPSHOT_CMD: 'node ../scripts/opensearch snapshot -E cluster.routing.allocation.disk.threshold_enabled=false'
CYPRESS_BROWSER: 'chromium'
CYPRESS_VISBUILDER_ENABLED: true
diff --git a/changelogs/fragments/7314.yml b/changelogs/fragments/7314.yml
new file mode 100644
index 000000000000..a3ff4b409d54
--- /dev/null
+++ b/changelogs/fragments/7314.yml
@@ -0,0 +1,2 @@
+fix:
+- Unused config setting and remove data sources as a required plugin. ([#7314](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7314))
\ No newline at end of file
diff --git a/package.json b/package.json
index b90aa1f3b246..b24c09ea6a67 100644
--- a/package.json
+++ b/package.json
@@ -63,7 +63,7 @@
"start": "scripts/use_node scripts/opensearch_dashboards --dev",
"start:docker": "scripts/use_node scripts/opensearch_dashboards --dev --opensearch.hosts=$OPENSEARCH_HOSTS --opensearch.ignoreVersionMismatch=true --server.host=$SERVER_HOST",
"start:security": "scripts/use_node scripts/opensearch_dashboards --dev --security",
- "start:enhancements": "scripts/use_node scripts/opensearch_dashboards --dev --data_source.enabled=true --uiSettings.overrides['query:enhancements:enabled']=true",
+ "start:enhancements": "scripts/use_node scripts/opensearch_dashboards --dev --uiSettings.overrides['query:enhancements:enabled']=true",
"debug": "scripts/use_node --nolazy --inspect scripts/opensearch_dashboards --dev",
"debug-break": "scripts/use_node --nolazy --inspect-brk scripts/opensearch_dashboards --dev",
"lint": "yarn run lint:es && yarn run lint:style",
diff --git a/src/plugins/data/public/ui/query_editor/query_editor_top_row.tsx b/src/plugins/data/public/ui/query_editor/query_editor_top_row.tsx
index bcd96b9b47dc..e5b7529f414b 100644
--- a/src/plugins/data/public/ui/query_editor/query_editor_top_row.tsx
+++ b/src/plugins/data/public/ui/query_editor/query_editor_top_row.tsx
@@ -191,16 +191,7 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) {
}
function isValidQuery(query: Query | undefined) {
- if (!query || !query.query) return false;
- return (
- !Array.isArray(props.indexPatterns!) ||
- compact(props.indexPatterns!).length === 0 ||
- fromUser(query!.query).includes(
- typeof props.indexPatterns[0] === 'string'
- ? props.indexPatterns[0]
- : props.indexPatterns[0].title
- )
- );
+ if (query && query.query) return true;
}
function getQueryStringInitialValue(language: string) {
diff --git a/src/plugins/data/public/ui/settings/settings.ts b/src/plugins/data/public/ui/settings/settings.ts
index f90bee5cf47e..df04d3dc6e7d 100644
--- a/src/plugins/data/public/ui/settings/settings.ts
+++ b/src/plugins/data/public/ui/settings/settings.ts
@@ -35,7 +35,7 @@ export class Settings {
private readonly queryEnhancements: Map,
private readonly queryEditorExtensionMap: Record
) {
- this.isEnabled = false;
+ this.isEnabled = true;
this.setUserQueryEnhancementsEnabled(this.isEnabled);
this.enhancedAppNames = this.isEnabled ? this.config.supportedAppNames : [];
}
diff --git a/src/plugins/data/public/ui/ui_service.ts b/src/plugins/data/public/ui/ui_service.ts
index 243490dc8201..1e0e6be8b78c 100644
--- a/src/plugins/data/public/ui/ui_service.ts
+++ b/src/plugins/data/public/ui/ui_service.ts
@@ -42,7 +42,6 @@ export class UiService implements Plugin {
return {
__enhance: (enhancements?: UiEnhancements) => {
if (!enhancements) return;
- if (!this.enhancementsConfig.enabled) return;
if (enhancements.query && enhancements.query.language) {
this.queryEnhancements.set(enhancements.query.language, enhancements.query);
}
diff --git a/src/plugins/data/server/ui_settings.ts b/src/plugins/data/server/ui_settings.ts
index dfe27d16c252..95439335e18e 100644
--- a/src/plugins/data/server/ui_settings.ts
+++ b/src/plugins/data/server/ui_settings.ts
@@ -709,7 +709,7 @@ export function getUiSettings(): Record> {
name: i18n.translate('data.advancedSettings.query.enhancements.enableTitle', {
defaultMessage: 'Enable query enhancements',
}),
- value: false,
+ value: true,
description: i18n.translate('data.advancedSettings.query.enhancements.enableText', {
defaultMessage: `
Experimental:
diff --git a/src/plugins/query_enhancements/opensearch_dashboards.json b/src/plugins/query_enhancements/opensearch_dashboards.json
index e6ed7e2e0a17..b09494aab0ca 100644
--- a/src/plugins/query_enhancements/opensearch_dashboards.json
+++ b/src/plugins/query_enhancements/opensearch_dashboards.json
@@ -3,7 +3,7 @@
"version": "opensearchDashboards",
"server": true,
"ui": true,
- "requiredPlugins": ["data", "opensearchDashboardsReact", "opensearchDashboardsUtils", "dataSource", "dataSourceManagement", "savedObjects", "uiActions"],
- "optionalPlugins": []
+ "requiredPlugins": ["data", "opensearchDashboardsReact", "opensearchDashboardsUtils", "dataSourceManagement", "savedObjects", "uiActions"],
+ "optionalPlugins": ["dataSource"]
}
diff --git a/test/common/config.js b/test/common/config.js
index 5a9d121ad631..5793e01d823a 100644
--- a/test/common/config.js
+++ b/test/common/config.js
@@ -79,6 +79,7 @@ export default function () {
`--opensearchDashboards.branding.mark.defaultUrl=https://opensearch.org/assets/brand/SVG/Mark/opensearch_mark_default.svg`,
`--opensearchDashboards.branding.mark.darkModeUrl=https://opensearch.org/assets/brand/SVG/Mark/opensearch_mark_darkmode.svg`,
`--opensearchDashboards.branding.applicationTitle=OpenSearch`,
+ `--uiSettings.overrides['query:enhancements:enabled']=false`,
],
},
services,
From 1ff5401c662f43a2afe588de3903447a9fa62816 Mon Sep 17 00:00:00 2001
From: "opensearch-trigger-bot[bot]"
<98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Date: Wed, 24 Jul 2024 14:24:43 -0700
Subject: [PATCH 10/12] fix(queryEnhancements): fix dataSource.id reference to
enable tests (#7272) (#7406)
(cherry picked from commit c8496f83bf92f8a8230bc0ddbed218a5480dd49b)
Signed-off-by: Joshua Li
Signed-off-by: github-actions[bot]
Co-authored-by: github-actions[bot]
Co-authored-by: Kawika Avilla
Co-authored-by: Yulong Ruan
---
.../components/query_assist_bar.tsx | 2 +-
.../utils/create_extension.test.tsx | 5 +----
.../query_assist/utils/create_extension.tsx | 2 +-
.../server/routes/query_assist/agents.test.ts | 22 +++++++++++--------
.../query_enhancements/server/types.ts | 7 ++++--
5 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/src/plugins/query_enhancements/public/query_assist/components/query_assist_bar.tsx b/src/plugins/query_enhancements/public/query_assist/components/query_assist_bar.tsx
index 84ac854c980f..e87e74ce2998 100644
--- a/src/plugins/query_enhancements/public/query_assist/components/query_assist_bar.tsx
+++ b/src/plugins/query_enhancements/public/query_assist/components/query_assist_bar.tsx
@@ -45,7 +45,7 @@ export const QueryAssistBar: React.FC = (props) => {
const subscription = props.connectionsService
.getSelectedConnection$()
.subscribe((connection) => {
- dataSourceIdRef.current = connection?.id;
+ dataSourceIdRef.current = connection?.dataSource.id;
});
return () => subscription.unsubscribe();
}, [props.connectionsService]);
diff --git a/src/plugins/query_enhancements/public/query_assist/utils/create_extension.test.tsx b/src/plugins/query_enhancements/public/query_assist/utils/create_extension.test.tsx
index ea568959152d..41fc36dd71c7 100644
--- a/src/plugins/query_enhancements/public/query_assist/utils/create_extension.test.tsx
+++ b/src/plugins/query_enhancements/public/query_assist/utils/create_extension.test.tsx
@@ -24,13 +24,10 @@ const httpMock = coreSetupMock.http;
jest.mock('../components', () => ({
QueryAssistBar: jest.fn(() => QueryAssistBar ),
-}));
-
-jest.mock('../components/query_assist_banner', () => ({
QueryAssistBanner: jest.fn(() => QueryAssistBanner ),
}));
-describe.skip('CreateExtension', () => {
+describe('CreateExtension', () => {
afterEach(() => {
jest.clearAllMocks();
});
diff --git a/src/plugins/query_enhancements/public/query_assist/utils/create_extension.tsx b/src/plugins/query_enhancements/public/query_assist/utils/create_extension.tsx
index bd990b57f5a7..e088457a0717 100644
--- a/src/plugins/query_enhancements/public/query_assist/utils/create_extension.tsx
+++ b/src/plugins/query_enhancements/public/query_assist/utils/create_extension.tsx
@@ -28,7 +28,7 @@ const getAvailableLanguages$ = (
connectionsService.getSelectedConnection$().pipe(
distinctUntilChanged(),
switchMap(async (connection) => {
- const dataSourceId = connection?.id;
+ const dataSourceId = connection?.dataSource.id;
const cached = availableLanguagesByDataSource.get(dataSourceId);
if (cached !== undefined) return cached;
const languages = await http
diff --git a/src/plugins/query_enhancements/server/routes/query_assist/agents.test.ts b/src/plugins/query_enhancements/server/routes/query_assist/agents.test.ts
index f22bdb148368..5e31191c9c97 100644
--- a/src/plugins/query_enhancements/server/routes/query_assist/agents.test.ts
+++ b/src/plugins/query_enhancements/server/routes/query_assist/agents.test.ts
@@ -5,25 +5,29 @@
import { ApiResponse } from '@opensearch-project/opensearch';
import { ResponseError } from '@opensearch-project/opensearch/lib/errors';
+import { loggerMock } from '@osd/logging/target/mocks';
import { RequestHandlerContext } from 'src/core/server';
-// // eslint-disable-next-line @osd/eslint/no-restricted-paths
-// import { CoreRouteHandlerContext } from 'src/core/server/core_route_handler_context';
import { coreMock } from '../../../../../core/server/mocks';
-import { loggerMock } from '@osd/logging/target/mocks';
import { getAgentIdByConfig, requestAgentByConfig } from './agents';
-describe.skip('Agents helper functions', () => {
- // const coreContext = new CoreRouteHandlerContext(
- // coreMock.createInternalStart(),
- // httpServerMock.createOpenSearchDashboardsRequest()
- // );
+describe('Agents helper functions', () => {
const coreContext = coreMock.createRequestHandlerContext();
const client = coreContext.opensearch.client.asCurrentUser;
const mockedTransport = client.transport.request as jest.Mock;
const context: RequestHandlerContext = {
core: coreContext,
+ // @ts-ignore
dataSource: jest.fn(),
- query_assist: { dataSourceEnabled: false, logger: loggerMock.create() },
+ query_assist: {
+ dataSourceEnabled: false,
+ logger: loggerMock.create(),
+ configPromise: Promise.resolve({
+ enabled: true,
+ queryAssist: {
+ supportedLanguages: [{ language: 'PPL', agentConfig: 'testConfig' }],
+ },
+ }),
+ },
};
afterEach(() => {
diff --git a/src/plugins/query_enhancements/server/types.ts b/src/plugins/query_enhancements/server/types.ts
index 2ab716b98928..1ad76c7bbf85 100644
--- a/src/plugins/query_enhancements/server/types.ts
+++ b/src/plugins/query_enhancements/server/types.ts
@@ -51,7 +51,10 @@ export interface FacetRequest {
};
}
-declare module '../../../core/server' {
+// TODO declaring it in core changes the interface for every reference. we only
+// need this declaration in query_enhancements, but it doesn't seem possible
+// https://github.com/opensearch-project/OpenSearch-Dashboards/issues/4274
+/* declare module '../../../core/server' {
interface RequestHandlerContext {
query_assist: {
logger: Logger;
@@ -64,4 +67,4 @@ declare module '../../../core/server' {
dataSourceEnabled: boolean;
};
}
-}
+} */
From 9b2f26433cfc914dc2d8049fae645d4afcf026b8 Mon Sep 17 00:00:00 2001
From: "Qingyang(Abby) Hu"
Date: Wed, 24 Jul 2024 14:40:21 -0700
Subject: [PATCH 11/12] New Query Enhancement UI (#7309) (#7457)
* UI changes
* update snapshots
* styling
* correct license
* more cleanup
* more styling and update snapshots
---------
Signed-off-by: abbyhu2000
---
changelogs/fragments/7309.yml | 2 +
.../language_selector.test.tsx.snap | 1103 +++++++++++++++++
.../ui/query_editor/_language_selector.scss | 23 +-
.../public/ui/query_editor/_query_editor.scss | 43 +-
.../query_editor/language_selector.test.tsx | 18 +-
.../ui/query_editor/language_selector.tsx | 82 +-
.../public/ui/query_editor/query_editor.tsx | 246 +++-
.../query_editor_btn_collapse.tsx | 31 +
.../query_editor_extension.tsx | 1 -
.../ui/query_editor/query_editor_top_row.tsx | 23 +-
.../saved_query_management_component.tsx | 1 -
.../public/search/ppl_search_interceptor.ts | 15 +-
.../public/search/sql_search_interceptor.ts | 7 +-
13 files changed, 1502 insertions(+), 93 deletions(-)
create mode 100644 changelogs/fragments/7309.yml
create mode 100644 src/plugins/data/public/ui/query_editor/__snapshots__/language_selector.test.tsx.snap
create mode 100644 src/plugins/data/public/ui/query_editor/query_editor_btn_collapse.tsx
diff --git a/changelogs/fragments/7309.yml b/changelogs/fragments/7309.yml
new file mode 100644
index 000000000000..0925eb170794
--- /dev/null
+++ b/changelogs/fragments/7309.yml
@@ -0,0 +1,2 @@
+feat:
+- Update query enhancement UI ([#7309](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7309))
\ No newline at end of file
diff --git a/src/plugins/data/public/ui/query_editor/__snapshots__/language_selector.test.tsx.snap b/src/plugins/data/public/ui/query_editor/__snapshots__/language_selector.test.tsx.snap
new file mode 100644
index 000000000000..031b12033176
--- /dev/null
+++ b/src/plugins/data/public/ui/query_editor/__snapshots__/language_selector.test.tsx.snap
@@ -0,0 +1,1103 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`LanguageSelector should select DQL if language is kuery 1`] = `
+
+
+
+ DQL
+
+ }
+ className="languageSelector"
+ closePopover={[Function]}
+ display="inlineBlock"
+ hasArrow={true}
+ isOpen={false}
+ ownFocus={true}
+ panelPaddingSize="none"
+ >
+
+
+
+
+
+
+
+ DQL
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[`LanguageSelector should select lucene if language is lucene 1`] = `
+
+
+
+ Lucene
+
+ }
+ className="languageSelector"
+ closePopover={[Function]}
+ display="inlineBlock"
+ hasArrow={true}
+ isOpen={false}
+ ownFocus={true}
+ panelPaddingSize="none"
+ >
+
+
+
+
+
+
+
+ Lucene
+
+
+
+
+
+
+
+
+
+
+`;
diff --git a/src/plugins/data/public/ui/query_editor/_language_selector.scss b/src/plugins/data/public/ui/query_editor/_language_selector.scss
index 2c44dc60ea23..d7847a96f0a2 100644
--- a/src/plugins/data/public/ui/query_editor/_language_selector.scss
+++ b/src/plugins/data/public/ui/query_editor/_language_selector.scss
@@ -3,6 +3,25 @@
* SPDX-License-Identifier: Apache-2.0
*/
.languageSelector {
- min-width: 140px;
- border-bottom: $euiBorderThin !important;
+ height: 100%;
+
+ .languageSelector__button {
+ &:hover {
+ text-decoration: none; // Prevents text underline on hover
+ }
+ }
+
+ * {
+ font-size: small;
+ }
+}
+
+.languageSelector__menuItem {
+ padding-left: 2px;
+ padding-right: 2px;
+ align-items: center;
+
+ &:hover {
+ text-decoration: none; // Prevents text underline on hover
+ }
}
diff --git a/src/plugins/data/public/ui/query_editor/_query_editor.scss b/src/plugins/data/public/ui/query_editor/_query_editor.scss
index 80ddd42fede5..8fc81308b533 100644
--- a/src/plugins/data/public/ui/query_editor/_query_editor.scss
+++ b/src/plugins/data/public/ui/query_editor/_query_editor.scss
@@ -15,14 +15,32 @@
// overflow: auto;
}
-.osdQueryEditor__languageWrapper {
- :first-child {
- box-shadow: none !important;
- height: 100%;
- border-radius: 0;
+.osdQueryEditorFooter-isHidden {
+ display: none;
+}
+
+.osdQueryEditorFooter {
+ color: $euiTextSubduedColor; // Apply the subdued color to all text in this class
+ height: 25px;
+
+ * {
+ color: inherit;
+ font-size: $euiFontSizeXS;
+ align-items: center;
}
}
+.osdQueryEditor__collapseWrapper {
+ box-shadow: $euiTextSubduedColor;
+}
+
+.osdQueryEditor__languageWrapper {
+ align-items: center;
+ justify-content: center;
+ max-height: 40px;
+ border: $euiBorderThin;
+}
+
.osdQueryEditor__dataSourceWrapper {
.dataSourceSelect {
border-bottom: $euiBorderThin !important;
@@ -42,6 +60,7 @@
.osdQueryEditor__dataSetWrapper {
.dataExplorerDSSelect {
border-bottom: $euiBorderThin !important;
+ max-width: 375px;
div:is([class$="--group"]) {
padding: 0 !important;
@@ -53,6 +72,20 @@
}
}
+.osdQueryEditor__prependWrapper {
+ box-shadow: $euiTextSubduedColor;
+}
+
+.osdQueryEditor__prependWrapper-isCollapsed {
+ box-shadow: none;
+}
+
+.osdQueryEditor--updateButtonWrapper {
+ :first-child {
+ min-width: 0 !important;
+ }
+}
+
@include euiBreakpoint("xs", "s") {
.osdQueryEditor--withDatePicker {
> :first-child {
diff --git a/src/plugins/data/public/ui/query_editor/language_selector.test.tsx b/src/plugins/data/public/ui/query_editor/language_selector.test.tsx
index 709678e29d66..f61134211a40 100644
--- a/src/plugins/data/public/ui/query_editor/language_selector.test.tsx
+++ b/src/plugins/data/public/ui/query_editor/language_selector.test.tsx
@@ -53,14 +53,7 @@ describe('LanguageSelector', () => {
},
})
);
- const euiComboBox = component.find(EuiCompressedComboBox);
- expect(euiComboBox.prop('selectedOptions')).toEqual(
- expect.arrayContaining([
- {
- label: 'Lucene',
- },
- ])
- );
+ expect(component).toMatchSnapshot();
});
it('should select DQL if language is kuery', () => {
@@ -72,13 +65,6 @@ describe('LanguageSelector', () => {
},
})
);
- const euiComboBox = component.find(EuiCompressedComboBox);
- expect(euiComboBox.prop('selectedOptions')).toEqual(
- expect.arrayContaining([
- {
- label: 'DQL',
- },
- ])
- );
+ expect(component).toMatchSnapshot();
});
});
diff --git a/src/plugins/data/public/ui/query_editor/language_selector.tsx b/src/plugins/data/public/ui/query_editor/language_selector.tsx
index 0f35b84ff599..ce7c1e17178d 100644
--- a/src/plugins/data/public/ui/query_editor/language_selector.tsx
+++ b/src/plugins/data/public/ui/query_editor/language_selector.tsx
@@ -4,19 +4,22 @@
*/
import {
- EuiCompressedComboBox,
- EuiComboBoxOptionOption,
PopoverAnchorPosition,
+ EuiContextMenuPanel,
+ EuiPopover,
+ EuiButtonEmpty,
+ EuiContextMenuItem,
} from '@elastic/eui';
import { i18n } from '@osd/i18n';
-import React from 'react';
+import React, { useState } from 'react';
import { getUiService } from '../../services';
-interface Props {
+export interface QueryLanguageSelectorProps {
language: string;
onSelectLanguage: (newLanguage: string) => void;
anchorPosition?: PopoverAnchorPosition;
appName?: string;
+ isFooter?: boolean;
}
const mapExternalLanguageToOptions = (language: string) => {
@@ -26,7 +29,13 @@ const mapExternalLanguageToOptions = (language: string) => {
};
};
-export const QueryLanguageSelector = (props: Props) => {
+export const QueryLanguageSelector = (props: QueryLanguageSelectorProps) => {
+ const [isPopoverOpen, setPopover] = useState(false);
+
+ const onButtonClick = () => {
+ setPopover(!isPopoverOpen);
+ };
+
const dqlLabel = i18n.translate('data.query.queryEditor.dqlLanguageName', {
defaultMessage: 'DQL',
});
@@ -34,7 +43,7 @@ export const QueryLanguageSelector = (props: Props) => {
defaultMessage: 'Lucene',
});
- const languageOptions: EuiComboBoxOptionOption[] = [
+ const languageOptions = [
{
label: dqlLabel,
value: 'kuery',
@@ -68,25 +77,58 @@ export const QueryLanguageSelector = (props: Props) => {
)?.label as string) ?? languageOptions[0].label,
};
- const handleLanguageChange = (newLanguage: EuiComboBoxOptionOption[]) => {
- const queryLanguage = newLanguage[0].value as string;
- props.onSelectLanguage(queryLanguage);
- uiService.Settings.setUserQueryLanguage(queryLanguage);
+ const handleLanguageChange = (newLanguage: string) => {
+ props.onSelectLanguage(newLanguage);
+ uiService.Settings.setUserQueryLanguage(newLanguage);
};
uiService.Settings.setUserQueryLanguage(props.language);
+ const languageOptionsMenu = languageOptions.map((language) => {
+ return (
+ {
+ setPopover(false);
+ handleLanguageChange(language.value);
+ }}
+ >
+ {language.label}
+
+ );
+ });
return (
-
+ button={
+
+ {selectedLanguage.label}
+
+ }
+ isOpen={isPopoverOpen}
+ closePopover={() => setPopover(false)}
+ panelPaddingSize="none"
+ anchorPosition={props.anchorPosition ?? 'downLeft'}
+ >
+ option.label === selectedLanguage.label
+ )}
+ size="s"
+ items={languageOptionsMenu}
+ />
+
);
};
+
+// Needed for React.lazy
+// eslint-disable-next-line import/no-default-export
+export default QueryLanguageSelector;
diff --git a/src/plugins/data/public/ui/query_editor/query_editor.tsx b/src/plugins/data/public/ui/query_editor/query_editor.tsx
index 19c4c527038c..9302f397eb09 100644
--- a/src/plugins/data/public/ui/query_editor/query_editor.tsx
+++ b/src/plugins/data/public/ui/query_editor/query_editor.tsx
@@ -3,12 +3,27 @@
* SPDX-License-Identifier: Apache-2.0
*/
-import { EuiFlexGroup, EuiFlexItem, htmlIdGenerator, PopoverAnchorPosition } from '@elastic/eui';
+import {
+ EuiFlexGroup,
+ EuiFlexItem,
+ EuiForm,
+ EuiFormRow,
+ htmlIdGenerator,
+ PopoverAnchorPosition,
+} from '@elastic/eui';
import classNames from 'classnames';
import { isEqual } from 'lodash';
import React, { Component, createRef, RefObject } from 'react';
+import { monaco } from '@osd/monaco';
import { Settings } from '..';
-import { DataSource, IDataPluginServices, IIndexPattern, Query, TimeRange } from '../..';
+import {
+ DataSource,
+ IDataPluginServices,
+ IFieldType,
+ IIndexPattern,
+ Query,
+ TimeRange,
+} from '../..';
import {
CodeEditor,
OpenSearchDashboardsReactContextValue,
@@ -20,13 +35,15 @@ import { DataSettings } from '../types';
import { fetchIndexPatterns } from './fetch_index_patterns';
import { QueryLanguageSelector } from './language_selector';
import { QueryEditorExtensions } from './query_editor_extensions';
-
+import { QueryEditorBtnCollapse } from './query_editor_btn_collapse';
export interface QueryEditorProps {
indexPatterns: Array;
dataSource?: DataSource;
query: Query;
+ container?: HTMLDivElement;
dataSourceContainerRef?: React.RefCallback;
containerRef?: React.RefCallback;
+ languageSelectorContainerRef?: React.RefCallback;
settings: Settings;
disableAutoFocus?: boolean;
screenTitle?: string;
@@ -47,6 +64,8 @@ export interface QueryEditorProps {
queryLanguage?: string;
headerClassName?: string;
bannerClassName?: string;
+ footerClassName?: string;
+ filterBar?: any;
}
interface Props extends QueryEditorProps {
@@ -60,6 +79,9 @@ interface State {
index: number | null;
suggestions: QuerySuggestion[];
indexPatterns: IIndexPattern[];
+ isCollapsed: boolean;
+ timeStamp: IFieldType | null;
+ lineCount: number | undefined;
}
const KEY_CODES = {
@@ -85,9 +107,12 @@ export default class QueryEditorUI extends Component {
index: null,
suggestions: [],
indexPatterns: [],
+ isCollapsed: false, // default to expand mode
+ timeStamp: null,
+ lineCount: undefined,
};
- public inputRef: HTMLElement | null = null;
+ public inputRef: monaco.editor.IStandaloneCodeEditor | null = null;
private persistedLog: PersistedLog | undefined;
private abortController?: AbortController;
@@ -175,6 +200,12 @@ export default class QueryEditorUI extends Component {
private onInputChange = (value: string) => {
this.onQueryStringChange(value);
+
+ if (!this.inputRef) return;
+
+ const currentLineCount = this.inputRef.getModel()?.getLineCount();
+ if (this.state.lineCount === currentLineCount) return;
+ this.setState({ lineCount: currentLineCount });
};
private onClickInput = (event: React.MouseEvent) => {
@@ -284,10 +315,65 @@ export default class QueryEditorUI extends Component {
}
};
+ editorDidMount = (editor: monaco.editor.IStandaloneCodeEditor) => {
+ this.setState({ lineCount: editor.getModel()?.getLineCount() });
+ this.inputRef = editor;
+ };
+
+ private onSingleLineInputChange = (value: string) => {
+ // Replace new lines with an empty string to prevent multi-line input
+ this.onQueryStringChange(value.replace(/[\r\n]+/gm, ''));
+
+ this.setState({ lineCount: undefined });
+ };
+
+ singleLineEditorDidMount = (editor: monaco.editor.IStandaloneCodeEditor) => {
+ this.inputRef = editor;
+
+ const editorNode = editor.getDomNode();
+ if (editorNode) {
+ const containerId = 'single-line-editor-wrapper';
+ const style = document.createElement('style');
+ const customCursorHeight = 20;
+ // eslint-disable-next-line no-unsanitized/property
+ style.innerHTML = `
+ .${containerId} .monaco-editor .view-lines {
+ padding-left: 15px;
+ }
+ .${containerId} .monaco-editor .cursor {
+ height: ${customCursorHeight}px !important;
+ margin-top: ${(38 - customCursorHeight) / 2}px !important;
+ }
+ `;
+
+ document.head.appendChild(style);
+ }
+ const handleEnterPress = () => {
+ this.onSubmit(this.props.query);
+ };
+
+ const disposable = editor.onKeyDown((e) => {
+ if (e.keyCode === monaco.KeyCode.Enter) {
+ // Prevent default Enter key behavior
+ e.preventDefault();
+ handleEnterPress();
+ }
+ });
+
+ // Optional: Cleanup on component unmount
+ return () => {
+ disposable.dispose();
+ };
+ };
+
public render() {
const className = classNames(this.props.className);
const headerClassName = classNames('osdQueryEditorHeader', this.props.headerClassName);
const bannerClassName = classNames('osdQueryEditorBanner', this.props.bannerClassName);
+ const footerClassName = classNames('osdQueryEditorFooter', this.props.footerClassName);
+
+ const useQueryEditor =
+ this.props.query.language !== 'kuery' && this.props.query.language !== 'lucene';
return (
@@ -295,48 +381,142 @@ export default class QueryEditorUI extends Component {
- {this.props.prepend}
+
+ this.setState({ isCollapsed: !this.state.isCollapsed })}
+ isCollapsed={!this.state.isCollapsed}
+ />
+
{this.state.isDataSourcesVisible && (
-
+
)}
-
-
-
+
{this.state.isDataSetsVisible && (
-
+
)}
+
+
+ {(this.state.isCollapsed || !useQueryEditor) && (
+
+
+
+
+
+ )}
+ {!useQueryEditor && (
+
+
+
+
+
+ )}
+
+
+
+ {this.props.prepend}
+
+
-
+ {!this.state.isCollapsed && useQueryEditor && (
+
+ )}
+
+
+
+
+
+
+
+
+ {this.state.lineCount} {this.state.lineCount === 1 ? 'line' : 'lines'}
+
+
+ {typeof this.props.indexPatterns?.[0] !== 'string' &&
+ '@' + this.props.indexPatterns?.[0].timeFieldName}
+
+
+
+
+ {!this.state.isCollapsed && (
+ {this.props.filterBar}
+ )}
{this.renderQueryEditorExtensions()}
diff --git a/src/plugins/data/public/ui/query_editor/query_editor_btn_collapse.tsx b/src/plugins/data/public/ui/query_editor/query_editor_btn_collapse.tsx
new file mode 100644
index 000000000000..1bde59570fdd
--- /dev/null
+++ b/src/plugins/data/public/ui/query_editor/query_editor_btn_collapse.tsx
@@ -0,0 +1,31 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+import React from 'react';
+import { i18n } from '@osd/i18n';
+import { EuiToolTip, EuiButtonIcon } from '@elastic/eui';
+
+export interface Props {
+ onClick: () => void;
+ isCollapsed: boolean;
+}
+
+export function QueryEditorBtnCollapse({ onClick, isCollapsed }: Props) {
+ const label = i18n.translate('queryEditor.collapse', {
+ defaultMessage: 'Toggle query editor',
+ });
+ return (
+
+
+
+ );
+}
diff --git a/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extension.tsx b/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extension.tsx
index f684aebea1d9..78b402df7c65 100644
--- a/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extension.tsx
+++ b/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extension.tsx
@@ -61,7 +61,6 @@ export interface QueryEditorExtensionConfig {
*/
getBanner?: (dependencies: QueryEditorExtensionDependencies) => React.ReactElement | null;
}
-
const QueryEditorExtensionPortal: React.FC<{ container: Element }> = (props) => {
if (!props.children) return null;
diff --git a/src/plugins/data/public/ui/query_editor/query_editor_top_row.tsx b/src/plugins/data/public/ui/query_editor/query_editor_top_row.tsx
index e5b7529f414b..8304fdc252ee 100644
--- a/src/plugins/data/public/ui/query_editor/query_editor_top_row.tsx
+++ b/src/plugins/data/public/ui/query_editor/query_editor_top_row.tsx
@@ -4,11 +4,11 @@
*/
import dateMath from '@elastic/datemath';
import {
+ EuiButton,
EuiCompressedFieldText,
EuiFlexGroup,
EuiFlexItem,
EuiSuperDatePicker,
- EuiSuperUpdateButton,
OnRefreshProps,
prettyDuration,
} from '@elastic/eui';
@@ -28,7 +28,7 @@ import {
withOpenSearchDashboards,
} from '../../../../opensearch_dashboards_react/public';
import { UI_SETTINGS } from '../../../common';
-import { fromUser, getQueryLog, PersistedLog } from '../../query';
+import { getQueryLog, PersistedLog } from '../../query';
import { Settings } from '../types';
import { NoDataPopover } from './no_data_popover';
import QueryEditorUI from './query_editor';
@@ -235,6 +235,7 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) {
className="osdQueryEditor"
dataTestSubj={props.dataTestSubj}
queryLanguage={queryLanguage}
+ filterBar={props.filterBar}
/>
);
@@ -275,13 +276,16 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) {
const button = props.customSubmitButton ? (
React.cloneElement(props.customSubmitButton, { onClick: onClickSubmitButton })
) : (
-
+ className="euiSuperUpdateButton"
+ iconType="play"
+ >
+ {props.isDirty ? 'Refresh' : 'Run'}
+
);
if (!shouldRenderDatePicker()) {
@@ -363,12 +367,15 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) {
direction="column"
justifyContent="flexEnd"
>
+
+
+ {renderUpdateButton()}
+
+
{renderQueryEditor()}
-
- {props.filterBar}
+
{renderSharingMetaFields()}
- {renderUpdateButton()}
diff --git a/src/plugins/data/public/ui/saved_query_management/saved_query_management_component.tsx b/src/plugins/data/public/ui/saved_query_management/saved_query_management_component.tsx
index 77643ac6413d..4e4dd26cec47 100644
--- a/src/plugins/data/public/ui/saved_query_management/saved_query_management_component.tsx
+++ b/src/plugins/data/public/ui/saved_query_management/saved_query_management_component.tsx
@@ -183,7 +183,6 @@ export function SavedQueryManagementComponent({
data-test-subj="saved-query-management-popover-button"
>
-
);
diff --git a/src/plugins/query_enhancements/public/search/ppl_search_interceptor.ts b/src/plugins/query_enhancements/public/search/ppl_search_interceptor.ts
index aac50de3bb98..bca9961fea3b 100644
--- a/src/plugins/query_enhancements/public/search/ppl_search_interceptor.ts
+++ b/src/plugins/query_enhancements/public/search/ppl_search_interceptor.ts
@@ -5,6 +5,7 @@
import { trimEnd } from 'lodash';
import { Observable, throwError } from 'rxjs';
+import { i18n } from '@osd/i18n';
import { concatMap } from 'rxjs/operators';
import {
DataFrameAggConfig,
@@ -147,7 +148,15 @@ export class PPLSearchInterceptor extends SearchInterceptor {
const dataFrame = getRawDataFrame(searchRequest);
if (!dataFrame) {
- return throwError(this.handleSearchError('DataFrame is not defined', request, signal!));
+ return throwError(
+ this.handleSearchError(
+ {
+ stack: 'DataFrame is not defined',
+ },
+ request,
+ signal!
+ )
+ );
}
let queryString = dataFrame.meta?.queryConfig?.qs ?? getRawQueryString(searchRequest) ?? '';
@@ -171,6 +180,10 @@ export class PPLSearchInterceptor extends SearchInterceptor {
return fetchDataFrame(dfContext, queryString, dataFrame).pipe(
concatMap((response) => {
const df = response.body;
+ if (df.error) {
+ const jsError = new Error(df.error.response);
+ return throwError(jsError);
+ }
const timeField = getTimeField(df, aggConfig);
if (timeField) {
const timeFilter = getTimeFilter(timeField);
diff --git a/src/plugins/query_enhancements/public/search/sql_search_interceptor.ts b/src/plugins/query_enhancements/public/search/sql_search_interceptor.ts
index c4dd7409faf6..5a3b8278c65a 100644
--- a/src/plugins/query_enhancements/public/search/sql_search_interceptor.ts
+++ b/src/plugins/query_enhancements/public/search/sql_search_interceptor.ts
@@ -71,12 +71,7 @@ export class SQLSearchInterceptor extends SearchInterceptor {
const df = response.body;
if (df.error) {
const jsError = new Error(df.error.response);
- this.deps.toasts.addError(jsError, {
- title: i18n.translate('queryEnhancements.sqlQueryError', {
- defaultMessage: 'Could not complete the SQL query',
- }),
- toastMessage: df.error.msg,
- });
+ return throwError(jsError);
}
return fetchDataFrame(dfContext, queryString, df);
})
From 4429721f61563936d68149c9f2596b1c1c17eefa Mon Sep 17 00:00:00 2001
From: Anan Zhuang
Date: Wed, 24 Jul 2024 23:39:54 +0000
Subject: [PATCH 12/12] Revert "Fix access control tab fetching for remote
cluster (#7456)"
This reverts commit d152ced81aed6538cdf2d436bc6f96a3af9864a3.
---
.../connection_detail/access_control_tab.tsx | 13 ++++++-------
.../direct_query_connection_detail.tsx | 1 -
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/access_control_tab.tsx b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/access_control_tab.tsx
index 187b13fdc6f5..696c8dc7148a 100644
--- a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/access_control_tab.tsx
+++ b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/access_control_tab.tsx
@@ -25,7 +25,6 @@ interface AccessControlTabProps {
connector: string;
properties: unknown;
allowedRoles: string[];
- dataSourceMDSId: string;
}
export const AccessControlTab = (props: AccessControlTabProps) => {
@@ -35,17 +34,17 @@ export const AccessControlTab = (props: AccessControlTabProps) => {
const { http } = useOpenSearchDashboards().services;
useEffect(() => {
- http
- .get(SECURITY_ROLES, { query: { dataSourceId: props.dataSourceMDSId } })
- .then((data) => {
+ http!
+ .get(SECURITY_ROLES)
+ .then((data) =>
setRoles(
Object.keys(data.data).map((key) => {
return { label: key };
})
- );
- })
+ )
+ )
.catch((err) => setHasSecurityAccess(false));
- }, [http, props.dataSourceMDSId]);
+ }, [http]);
const [selectedQueryPermissionRoles, setSelectedQueryPermissionRoles] = useState(
props.allowedRoles.map((role) => {
diff --git a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/direct_query_connection_detail.tsx b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/direct_query_connection_detail.tsx
index 212d8f394afc..bc0869dfc2e5 100644
--- a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/direct_query_connection_detail.tsx
+++ b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/direct_query_connection_detail.tsx
@@ -397,7 +397,6 @@ export const DirectQueryDataConnectionDetail: React.FC
),
},
|