From 6268ee7e8c4696ddfe0aa855d6b91acbb4d2549b Mon Sep 17 00:00:00 2001
From: Caroline Horn <549577+cchaos@users.noreply.github.com>
Date: Wed, 1 May 2019 15:19:55 -0400
Subject: [PATCH] Fix some EuiFlyout and EuiModal usages (#35829)
* Fix maps layer flyout
* Fixing some flyout headers with border and size
* Using euiOverflowShadow to remove warnings
* Fixed up some regular modal usages
* Added danger colors to EuiConfirmModals where necessary
---
.../__snapshots__/clone_modal.test.js.snap | 8 +-
.../public/dashboard/top_nav/clone_modal.js | 16 +--
.../source_filters_table.test.js.snap | 1 +
.../source_filters_table.js | 1 +
.../__snapshots__/objects_table.test.js.snap | 45 +++----
.../__snapshots__/flyout.test.js.snap | 119 ++++++++++++++----
.../objects_table/components/flyout/flyout.js | 8 +-
.../__snapshots__/relationships.test.js.snap | 40 ++++--
.../components/relationships/relationships.js | 4 +-
.../components/objects_table/objects_table.js | 45 ++++---
.../public/visualize/wizard/_dialog.scss | 27 +---
.../apply_filters/apply_filters_popover.tsx | 2 +-
.../components/saved_object_save_modal.tsx | 20 +--
.../public/sample_panel_action.tsx | 6 +-
.../components/tag/config_view/index.tsx | 2 +-
.../remove_lifecycle_confirm_modal.js | 1 +
.../components/detail_panel/detail_panel.js | 2 +-
.../source_configuration_flyout.tsx | 2 +-
.../public/components/layer_addpanel/view.js | 12 +-
.../__snapshots__/view.test.js.snap | 54 ++++----
.../components/layer_panel/_layer_panel.scss | 22 ++--
.../public/components/layer_panel/view.js | 19 +--
.../rule_editor_flyout.test.js.snap | 8 +-
.../rule_editor/rule_editor_flyout.js | 4 +-
.../delete_rule_modal.test.js.snap | 2 +-
.../select_rule_action/delete_rule_modal.js | 1 +
.../__snapshots__/import_modal.test.js.snap | 24 ++--
.../edit/import_modal/import_modal.js | 16 +--
.../edit/new_event_modal/new_event_modal.js | 16 +--
.../components/forecasting_modal/modal.js | 2 +-
.../report_info_button.test.tsx.snap | 24 ++--
.../public/components/report_info_button.tsx | 2 +-
32 files changed, 317 insertions(+), 238 deletions(-)
diff --git a/src/legacy/core_plugins/kibana/public/dashboard/top_nav/__snapshots__/clone_modal.test.js.snap b/src/legacy/core_plugins/kibana/public/dashboard/top_nav/__snapshots__/clone_modal.test.js.snap
index 2f454d73f3c58..213a949f7358f 100644
--- a/src/legacy/core_plugins/kibana/public/dashboard/top_nav/__snapshots__/clone_modal.test.js.snap
+++ b/src/legacy/core_plugins/kibana/public/dashboard/top_nav/__snapshots__/clone_modal.test.js.snap
@@ -11,7 +11,7 @@ exports[`renders DashboardCloneModal 1`] = `
@@ -40,13 +40,11 @@ exports[`renders DashboardCloneModal 1`] = `
/>
-
-
+
+
-
);
}
@@ -134,7 +136,7 @@ class DashboardCloneModalUi extends React.Component {
@@ -151,8 +153,6 @@ class DashboardCloneModalUi extends React.Component {
- {this.renderDuplicateTitleCallout()}
-
+ {this.renderDuplicateTitleCallout()}
+
-
@@ -172,7 +174,7 @@ class DashboardCloneModalUi extends React.Component {
id="kbn.dashboard.topNav.cloneModal.cancelButtonLabel"
defaultMessage="Cancel"
/>
-
+
}
+ buttonColor="danger"
confirmButtonText={
-
-
+
-
+ }
+ labelType="legend"
+ >
-
+
+
+ }
+ name="includeReferencesDeep"
+ onChange={[Function]}
+ />
-
-
- }
- name="includeReferencesDeep"
- onChange={[Function]}
- />
-
diff --git a/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/flyout/__jest__/__snapshots__/flyout.test.js.snap b/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/flyout/__jest__/__snapshots__/flyout.test.js.snap
index 0dbaf3fe5e9f2..18298e9ddab16 100644
--- a/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/flyout/__jest__/__snapshots__/flyout.test.js.snap
+++ b/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/flyout/__jest__/__snapshots__/flyout.test.js.snap
@@ -9,8 +9,12 @@ exports[`Flyout conflicts should allow conflict resolution 1`] = `
ownFocus={false}
size="s"
>
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
- }
->
-
- foobar
-
-
+Array [
+
+ }
+ >
+
+
+
+ ,
+
+ }
+ >
+
+
+
+ ,
+ }
+ }
+ />
+
+ ,
+
+ }
+ >
+
+ foobar
+
+ ,
+]
`;
exports[`Flyout should render import step 1`] = `
@@ -485,8 +548,12 @@ exports[`Flyout should render import step 1`] = `
ownFocus={false}
size="s"
>
-
-
+
+
)}
color="danger"
- iconType="cross"
>
{error}
@@ -879,6 +878,7 @@ class FlyoutUI extends Component {
defaultMessage: 'Overwrite',
},
)}
+ buttonColor="danger"
onCancel={this.overwriteSkipped.bind(this)}
onConfirm={this.overwriteConfirmed.bind(this)}
defaultFocusedButton={EUI_MODAL_CONFIRM_BUTTON}
@@ -896,8 +896,8 @@ class FlyoutUI extends Component {
return (
-
-
+
+
- {this.renderSubheader()}
+ {this.renderSubheader()}
{this.renderError()}
{this.renderBody()}
diff --git a/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/relationships/__jest__/__snapshots__/relationships.test.js.snap b/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/relationships/__jest__/__snapshots__/relationships.test.js.snap
index d4c0d6f44454a..9fcbce0f72725 100644
--- a/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/relationships/__jest__/__snapshots__/relationships.test.js.snap
+++ b/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/relationships/__jest__/__snapshots__/relationships.test.js.snap
@@ -9,8 +9,12 @@ exports[`Relationships should render dashboards normally 1`] = `
ownFocus={false}
size="m"
>
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
+ }
+ labelType="legend"
+ >
-
+
+
+ )}
+ checked={isIncludeReferencesDeepChecked}
+ onChange={this.changeIncludeReferencesDeep}
+ />
-
-
-
- )}
- checked={isIncludeReferencesDeepChecked}
- onChange={this.changeIncludeReferencesDeep}
- />
-
+
diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/_dialog.scss b/src/legacy/core_plugins/kibana/public/visualize/wizard/_dialog.scss
index 829c18c3644f0..3f6b9d3c4b789 100644
--- a/src/legacy/core_plugins/kibana/public/visualize/wizard/_dialog.scss
+++ b/src/legacy/core_plugins/kibana/public/visualize/wizard/_dialog.scss
@@ -25,32 +25,11 @@
}
.visNewVisDialog__typesWrapper {
+ @include euiOverflowShadow;
max-width: $euiSizeXXL * 10;
min-height: 0;
- padding-top: 2px; // Account for search field dropshadow
- padding-bottom: $euiSize;
- // Add overflow shadows via pseudo elements
- position: relative;
- &::before,
- &::after {
- content: "";
- display: block;
- position: absolute;
- height: $euiSizeXXL;
- left: 0;
- right: 0;
- pointer-events: none;
- }
-
- &::before {
- top: -$euiSizeXXL + 2px; // Account for search field dropshadow
- @include euiOverflowShadowBottom;
- }
-
- &::after {
- bottom: -$euiSizeL;
- @include euiOverflowShadowTop;
- }
+ margin-top: 2px; // Account for search field dropshadow
+ overflow: hidden;
}
.visNewVisDialog__types {
diff --git a/src/legacy/ui/public/apply_filters/apply_filters_popover.tsx b/src/legacy/ui/public/apply_filters/apply_filters_popover.tsx
index 67f78b0951f19..3b02eacdc6d25 100644
--- a/src/legacy/ui/public/apply_filters/apply_filters_popover.tsx
+++ b/src/legacy/ui/public/apply_filters/apply_filters_popover.tsx
@@ -100,7 +100,7 @@ export class ApplyFiltersPopover extends Component {
diff --git a/src/legacy/ui/public/saved_objects/components/saved_object_save_modal.tsx b/src/legacy/ui/public/saved_objects/components/saved_object_save_modal.tsx
index c79b0dca0d9b3..e744ac72430f4 100644
--- a/src/legacy/ui/public/saved_objects/components/saved_object_save_modal.tsx
+++ b/src/legacy/ui/public/saved_objects/components/saved_object_save_modal.tsx
@@ -242,21 +242,21 @@ export class SavedObjectSaveModal extends React.Component {
}
return (
-
- }
- >
+
+ }
/>
-
+
+
);
};
}
diff --git a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_action.tsx b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_action.tsx
index 3f04adc11a418..528bf16292f7c 100644
--- a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_action.tsx
+++ b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_action.tsx
@@ -41,12 +41,12 @@ class SamplePanelAction extends ContextMenuAction {
getNewPlatform().start.core.overlays.openFlyout(
-
- {embeddable.metadata.title}
+
+ {embeddable.metadata.title}
- This is a sample action
+ This is a sample action
,
{
diff --git a/x-pack/plugins/beats_management/public/components/tag/config_view/index.tsx b/x-pack/plugins/beats_management/public/components/tag/config_view/index.tsx
index f069b65223d5f..fe505eb8207d9 100644
--- a/x-pack/plugins/beats_management/public/components/tag/config_view/index.tsx
+++ b/x-pack/plugins/beats_management/public/components/tag/config_view/index.tsx
@@ -72,7 +72,7 @@ class ConfigViewUi extends React.Component {
}
return (
-
+
{this.editMode
diff --git a/x-pack/plugins/index_lifecycle_management/public/extend_index_management/components/remove_lifecycle_confirm_modal.js b/x-pack/plugins/index_lifecycle_management/public/extend_index_management/components/remove_lifecycle_confirm_modal.js
index 67d9c37e556f2..5a1f7f56ab51e 100644
--- a/x-pack/plugins/index_lifecycle_management/public/extend_index_management/components/remove_lifecycle_confirm_modal.js
+++ b/x-pack/plugins/index_lifecycle_management/public/extend_index_management/components/remove_lifecycle_confirm_modal.js
@@ -99,6 +99,7 @@ export class RemoveLifecyclePolicyConfirmModal extends Component {
defaultMessage="Cancel"
/>
}
+ buttonColor="danger"
confirmButtonText={
-
+
{indexName}{renderBadges(index)}
{index ? {this.renderTabs()} : null }
diff --git a/x-pack/plugins/infra/public/components/source_configuration/source_configuration_flyout.tsx b/x-pack/plugins/infra/public/components/source_configuration/source_configuration_flyout.tsx
index d5f3e0f3ada88..a49e7461a3fea 100644
--- a/x-pack/plugins/infra/public/components/source_configuration/source_configuration_flyout.tsx
+++ b/x-pack/plugins/infra/public/components/source_configuration/source_configuration_flyout.tsx
@@ -102,7 +102,7 @@ export const SourceConfigurationFlyout: React.FunctionComponent<
hideCloseButton
onClose={noop}
>
-
+
{shouldAllowEdit ? (
diff --git a/x-pack/plugins/maps/public/components/layer_addpanel/view.js b/x-pack/plugins/maps/public/components/layer_addpanel/view.js
index fa20d7e63726d..6af578ee5860f 100644
--- a/x-pack/plugins/maps/public/components/layer_addpanel/view.js
+++ b/x-pack/plugins/maps/public/components/layer_addpanel/view.js
@@ -17,7 +17,6 @@ import {
EuiCard,
EuiIcon,
EuiFlyoutHeader,
- EuiFlyoutBody,
EuiFlyoutFooter,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
@@ -182,12 +181,11 @@ export class AddLayerPanel extends Component {
-
- {this._renderAddLayerForm()}
-
+
+
+ {this._renderAddLayerForm()}
+
+
diff --git a/x-pack/plugins/maps/public/components/layer_panel/__snapshots__/view.test.js.snap b/x-pack/plugins/maps/public/components/layer_panel/__snapshots__/view.test.js.snap
index 7143b45311ee6..7faa589c303a8 100644
--- a/x-pack/plugins/maps/public/components/layer_panel/__snapshots__/view.test.js.snap
+++ b/x-pack/plugins/maps/public/components/layer_panel/__snapshots__/view.test.js.snap
@@ -77,35 +77,39 @@ exports[`LayerPanel is rendered 1`] = `
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+ />
+
+
diff --git a/x-pack/plugins/maps/public/components/layer_panel/_layer_panel.scss b/x-pack/plugins/maps/public/components/layer_panel/_layer_panel.scss
index c003a875733e3..b7c426bc90bc7 100644
--- a/x-pack/plugins/maps/public/components/layer_panel/_layer_panel.scss
+++ b/x-pack/plugins/maps/public/components/layer_panel/_layer_panel.scss
@@ -5,22 +5,27 @@
*/
.mapLayerPanel__header,
-.mapLayerPanel__body,
.mapLayerPanel__footer {
padding: $euiSize;
}
.mapLayerPanel__body {
- flex-basis: 1px; /* Fixes scrolling for Firefox */
+ @include euiOverflowShadow($euiPageBackgroundColor);
padding-bottom: 0; /* 1 */
+ flex-grow: 1;
+ flex-basis: 1px; /* Fixes scrolling for Firefox */
+ overflow-y: hidden;
- > *:last-child {
- margin-bottom: $euiSize; /* 1 */
- }
-}
+ .mapLayerPanel__bodyOverflow {
+ @include euiScrollBar;
+ height: 100%;
+ overflow-y: auto;
+ padding: $euiSize;
-.mapLayerPanel__header {
- @include euiOverflowShadowBottom;
+ > *:last-child {
+ margin-bottom: $euiSize; /* 1 */
+ }
+ }
}
.mapLayerPanel__sourceDetails {
@@ -32,6 +37,5 @@
}
.mapLayerPanel__footer {
- @include euiOverflowShadowTop;
border-top: $euiBorderThin;
}
diff --git a/x-pack/plugins/maps/public/components/layer_panel/view.js b/x-pack/plugins/maps/public/components/layer_panel/view.js
index 2fff3bf419873..b0e59a0757c21 100644
--- a/x-pack/plugins/maps/public/components/layer_panel/view.js
+++ b/x-pack/plugins/maps/public/components/layer_panel/view.js
@@ -20,7 +20,6 @@ import {
EuiPanel,
EuiFlexGroup,
EuiFlyoutHeader,
- EuiFlyoutBody,
EuiFlyoutFooter,
EuiSpacer,
EuiAccordion,
@@ -192,21 +191,23 @@ export class LayerPanel extends React.Component {
-
+
+
-
+
-
+
-
+
- {this._renderFilterSection()}
+ {this._renderFilterSection()}
- {this._renderJoinSection()}
+ {this._renderJoinSection()}
-
+
-
+
+
diff --git a/x-pack/plugins/ml/public/components/rule_editor/__snapshots__/rule_editor_flyout.test.js.snap b/x-pack/plugins/ml/public/components/rule_editor/__snapshots__/rule_editor_flyout.test.js.snap
index 420d459044a8a..917e71b84ae34 100644
--- a/x-pack/plugins/ml/public/components/rule_editor/__snapshots__/rule_editor_flyout.test.js.snap
+++ b/x-pack/plugins/ml/public/components/rule_editor/__snapshots__/rule_editor_flyout.test.js.snap
@@ -20,7 +20,7 @@ exports[`RuleEditorFlyout renders the flyout after adding a condition to a rule
hasBorder={true}
>
-
+
-
+
{(isCreate === true) ? (
}
onCancel={this.closeModal}
onConfirm={this.deleteRule}
+ buttonColor="danger"
cancelButtonText={
+
+
+
-
-
-
diff --git a/x-pack/plugins/ml/public/settings/calendars/edit/import_modal/import_modal.js b/x-pack/plugins/ml/public/settings/calendars/edit/import_modal/import_modal.js
index d1a1f2df87cdb..9f7b2b7250a45 100644
--- a/x-pack/plugins/ml/public/settings/calendars/edit/import_modal/import_modal.js
+++ b/x-pack/plugins/ml/public/settings/calendars/edit/import_modal/import_modal.js
@@ -198,6 +198,14 @@ export const ImportModal = injectI18n(class ImportModal extends Component {
+
+
+
-
-
-
diff --git a/x-pack/plugins/ml/public/settings/calendars/edit/new_event_modal/new_event_modal.js b/x-pack/plugins/ml/public/settings/calendars/edit/new_event_modal/new_event_modal.js
index 2c2f404e0c343..40bd91a3a2166 100644
--- a/x-pack/plugins/ml/public/settings/calendars/edit/new_event_modal/new_event_modal.js
+++ b/x-pack/plugins/ml/public/settings/calendars/edit/new_event_modal/new_event_modal.js
@@ -297,6 +297,14 @@ export const NewEventModal = injectI18n(class NewEventModal extends Component {
+
+
+
-
-
-
diff --git a/x-pack/plugins/ml/public/timeseriesexplorer/components/forecasting_modal/modal.js b/x-pack/plugins/ml/public/timeseriesexplorer/components/forecasting_modal/modal.js
index 7b62a4e496236..a9a747818f3d1 100644
--- a/x-pack/plugins/ml/public/timeseriesexplorer/components/forecasting_modal/modal.js
+++ b/x-pack/plugins/ml/public/timeseriesexplorer/components/forecasting_modal/modal.js
@@ -37,7 +37,7 @@ export function Modal(props) {
diff --git a/x-pack/plugins/reporting/public/components/__snapshots__/report_info_button.test.tsx.snap b/x-pack/plugins/reporting/public/components/__snapshots__/report_info_button.test.tsx.snap
index 85e9f7dad9298..51cc6747f7d21 100644
--- a/x-pack/plugins/reporting/public/components/__snapshots__/report_info_button.test.tsx.snap
+++ b/x-pack/plugins/reporting/public/components/__snapshots__/report_info_button.test.tsx.snap
@@ -178,7 +178,7 @@ Array [
class="euiFlyoutHeader euiFlyoutHeader--hasBorder"
>
Unable to fetch report info
@@ -242,7 +242,7 @@ Array [
class="euiFlyoutHeader euiFlyoutHeader--hasBorder"
>
Unable to fetch report info
@@ -334,10 +334,10 @@ Array [
className="euiFlyoutHeader euiFlyoutHeader--hasBorder"
>
Unable to fetch report info
@@ -451,10 +451,10 @@ Array [
className="euiFlyoutHeader euiFlyoutHeader--hasBorder"
>
Unable to fetch report info
@@ -617,7 +617,7 @@ Array [
class="euiFlyoutHeader euiFlyoutHeader--hasBorder"
>
Job Info
@@ -679,7 +679,7 @@ Array [
class="euiFlyoutHeader euiFlyoutHeader--hasBorder"
>
Job Info
@@ -769,10 +769,10 @@ Array [
className="euiFlyoutHeader euiFlyoutHeader--hasBorder"
>
Job Info
@@ -884,10 +884,10 @@ Array [
className="euiFlyoutHeader euiFlyoutHeader--hasBorder"
>
Job Info
diff --git a/x-pack/plugins/reporting/public/components/report_info_button.tsx b/x-pack/plugins/reporting/public/components/report_info_button.tsx
index 2e60a49148efb..7e8ebafe0b196 100644
--- a/x-pack/plugins/reporting/public/components/report_info_button.tsx
+++ b/x-pack/plugins/reporting/public/components/report_info_button.tsx
@@ -217,7 +217,7 @@ export class ReportInfoButton extends Component {
data-test-subj="reportInfoFlyout"
>
-
+
{this.state.calloutTitle}