From 61147e92e94cf2982882fe0e34a97d22a2a3d8d7 Mon Sep 17 00:00:00 2001 From: cchaos Date: Wed, 18 Sep 2019 14:34:19 -0400 Subject: [PATCH 1/6] Upgraded EUI to 14.2.0 --- package.json | 2 +- .../plugins/kbn_tp_run_pipeline/package.json | 2 +- .../plugins/kbn_tp_custom_visualizations/package.json | 2 +- .../plugins/kbn_tp_embeddable_explorer/package.json | 2 +- .../plugins/kbn_tp_sample_panel_action/package.json | 2 +- .../plugins/kbn_tp_visualize_embedding/package.json | 2 +- x-pack/package.json | 2 +- yarn.lock | 8 ++++---- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 28df76f4b01307..4bbe0777d11c7d 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ "@babel/register": "^7.5.5", "@elastic/charts": "^12.0.2", "@elastic/datemath": "5.0.2", - "@elastic/eui": "14.0.0", + "@elastic/eui": "14.2.0", "@elastic/filesaver": "1.1.2", "@elastic/good": "8.1.1-kibana2", "@elastic/numeral": "2.3.3", diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json index 55cdc772671243..33e785083c7e32 100644 --- a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json +++ b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json @@ -7,7 +7,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "14.0.0", + "@elastic/eui": "14.2.0", "react": "^16.8.0", "react-dom": "^16.8.0" } diff --git a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json index b872f3dce6d300..8d3100e1249413 100644 --- a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json +++ b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json @@ -7,7 +7,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "14.0.0", + "@elastic/eui": "14.2.0", "react": "^16.8.0" } } diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json index 90109a70b1e787..f76a5f0c0a392a 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json @@ -8,7 +8,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "14.0.0", + "@elastic/eui": "14.2.0", "react": "^16.8.0" }, "scripts": { diff --git a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json index 1815075e20e40c..9d0d1c922c8a80 100644 --- a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json +++ b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json @@ -8,7 +8,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "14.0.0", + "@elastic/eui": "14.2.0", "react": "^16.8.0" }, "scripts": { diff --git a/test/plugin_functional/plugins/kbn_tp_visualize_embedding/package.json b/test/plugin_functional/plugins/kbn_tp_visualize_embedding/package.json index b995ddf0292921..567abd36cb2a43 100644 --- a/test/plugin_functional/plugins/kbn_tp_visualize_embedding/package.json +++ b/test/plugin_functional/plugins/kbn_tp_visualize_embedding/package.json @@ -7,7 +7,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "14.0.0", + "@elastic/eui": "14.2.0", "react": "^16.8.0", "react-dom": "^16.8.0" } diff --git a/x-pack/package.json b/x-pack/package.json index 2c0aab2fcf2c38..935509bc33a881 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -184,7 +184,7 @@ "@babel/runtime": "^7.5.5", "@elastic/ctags-langserver": "^0.1.9", "@elastic/datemath": "5.0.2", - "@elastic/eui": "14.0.0", + "@elastic/eui": "14.2.0", "@elastic/javascript-typescript-langserver": "^0.2.2", "@elastic/lsp-extension": "^0.1.2", "@elastic/maki": "6.1.0", diff --git a/yarn.lock b/yarn.lock index 15490dda3a0a53..c4712b5f11c59a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -983,10 +983,10 @@ tabbable "^1.1.0" uuid "^3.1.0" -"@elastic/eui@14.0.0": - version "14.0.0" - resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-14.0.0.tgz#4af6e687aec7b981a87dc4da15699f0d92ad17de" - integrity sha512-kU3WNPysOYZkgsrQOO1RmLgQmJWYmjVHw4w4HoliwLka2N9AtEYtNu+rFprkDwO7Pvd1lxb/mRPGdJ6NZtZdvA== +"@elastic/eui@14.2.0": + version "14.2.0" + resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-14.2.0.tgz#d6368250e7261c63c06443d3cf3f7cf800916ff2" + integrity sha512-6nCV/Q2Ek3zTUj549+cFFx5rpx4ZZ2pjmspPsBhUwsn685qzAPsCv4WB40u4mWBZtMRZagBN2q2M2YxZHSPBLw== dependencies: "@types/lodash" "^4.14.116" "@types/numeral" "^0.0.25" From ebb80af1795b6533ce3a7252f632cef4c1433199 Mon Sep 17 00:00:00 2001 From: cchaos Date: Wed, 18 Sep 2019 14:34:54 -0400 Subject: [PATCH 2/6] Remove form row + button shim --- src/legacy/core_plugins/kibana/public/index.scss | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/legacy/core_plugins/kibana/public/index.scss b/src/legacy/core_plugins/kibana/public/index.scss index 02a0dcd5a7c11a..c8a66f6c3913be 100644 --- a/src/legacy/core_plugins/kibana/public/index.scss +++ b/src/legacy/core_plugins/kibana/public/index.scss @@ -1,11 +1,5 @@ @import 'src/legacy/ui/public/styles/styling_constants'; -// Temporary shim to help with EuiFormRow spacing -// Will move to EUI -.euiFormRow + .euiButton { - margin-top: $euiSize; -} - // Public UI styles @import 'src/legacy/ui/public/index'; From 6c9b3c0cdb9ee67a3361c6cf0872c8703af4571f Mon Sep 17 00:00:00 2001 From: cchaos Date: Wed, 18 Sep 2019 14:35:06 -0400 Subject: [PATCH 3/6] Uncomment compressed prop from EuiComboBoxes --- .../ui/public/vis/editors/default/components/agg_select.tsx | 2 +- src/legacy/ui/public/vis/editors/default/controls/field.tsx | 2 +- .../ui/public/vis/editors/default/controls/time_interval.tsx | 2 +- .../public/components/metrics_explorer/chart_options.tsx | 4 ++-- .../infra/public/components/waffle/custom_field_panel.tsx | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/legacy/ui/public/vis/editors/default/components/agg_select.tsx b/src/legacy/ui/public/vis/editors/default/components/agg_select.tsx index dbda4bc38103ac..2934711b2357a9 100644 --- a/src/legacy/ui/public/vis/editors/default/components/agg_select.tsx +++ b/src/legacy/ui/public/vis/editors/default/components/agg_select.tsx @@ -142,7 +142,7 @@ function DefaultEditorAggSelect({ isClearable={false} isInvalid={showValidation ? !isValid : false} fullWidth={true} - // compressed + compressed /> ); diff --git a/src/legacy/ui/public/vis/editors/default/controls/field.tsx b/src/legacy/ui/public/vis/editors/default/controls/field.tsx index 6a4a787ac41d83..a96be3a14b7ef4 100644 --- a/src/legacy/ui/public/vis/editors/default/controls/field.tsx +++ b/src/legacy/ui/public/vis/editors/default/controls/field.tsx @@ -110,7 +110,7 @@ function FieldParamEditor({ compressed > Date: Wed, 18 Sep 2019 15:05:17 -0400 Subject: [PATCH 4/6] Fix and/or simplify prepend/append usages --- .../saved_query_management_component.tsx | 2 - .../default/controls/extended_bounds.tsx | 14 +- .../components/cron_editor/cron_daily.js | 50 ++---- .../components/cron_editor/cron_editor.js | 126 +++++++-------- .../components/cron_editor/cron_hourly.js | 35 ++-- .../components/cron_editor/cron_monthly.js | 64 ++------ .../components/cron_editor/cron_weekly.js | 64 ++------ .../components/cron_editor/cron_yearly.js | 86 +++------- .../public/indexpattern_plugin/datapanel.tsx | 14 +- .../job_create/steps/step_logistics.js | 149 ++++++++---------- .../policy_form/steps/step_logistics.tsx | 2 + .../action_fields/webhook_action_fields.tsx | 13 +- .../threshold_watch_edit.tsx | 1 + 13 files changed, 216 insertions(+), 404 deletions(-) diff --git a/src/legacy/core_plugins/data/public/search/search_bar/components/saved_query_management/saved_query_management_component.tsx b/src/legacy/core_plugins/data/public/search/search_bar/components/saved_query_management/saved_query_management_component.tsx index 273d40a12246c7..013941cb4ec95e 100644 --- a/src/legacy/core_plugins/data/public/search/search_bar/components/saved_query_management/saved_query_management_component.tsx +++ b/src/legacy/core_plugins/data/public/search/search_bar/components/saved_query_management/saved_query_management_component.tsx @@ -113,7 +113,6 @@ export const SavedQueryManagementComponent: FunctionComponent = ({ const savedQueryPopoverButton = ( { @@ -164,7 +163,6 @@ export const SavedQueryManagementComponent: FunctionComponent = ({ { diff --git a/src/legacy/ui/public/vis/editors/default/controls/extended_bounds.tsx b/src/legacy/ui/public/vis/editors/default/controls/extended_bounds.tsx index 7ef9fddb3c090c..ac102165ce7bb9 100644 --- a/src/legacy/ui/public/vis/editors/default/controls/extended_bounds.tsx +++ b/src/legacy/ui/public/vis/editors/default/controls/extended_bounds.tsx @@ -19,7 +19,7 @@ import React, { useEffect, ChangeEvent } from 'react'; -import { EuiFieldNumber, EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiText } from '@elastic/eui'; +import { EuiFieldNumber, EuiFlexGroup, EuiFlexItem, EuiFormRow } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { isUndefined } from 'lodash'; import { AggParamEditorProps } from '..'; @@ -95,11 +95,7 @@ function ExtendedBoundsParamEditor({ fullWidth={true} isInvalid={showValidation ? !isValid : false} aria-label={minLabel} - prepend={ - - {minLabel} - - } + prepend={minLabel} compressed /> @@ -111,11 +107,7 @@ function ExtendedBoundsParamEditor({ fullWidth={true} isInvalid={showValidation ? !isValid : false} aria-label={maxLabel} - prepend={ - - {maxLabel} - - } + prepend={maxLabel} compressed /> diff --git a/src/plugins/es_ui_shared/public/components/cron_editor/cron_daily.js b/src/plugins/es_ui_shared/public/components/cron_editor/cron_daily.js index c53071a644d692..4ac6b0b8a256a5 100644 --- a/src/plugins/es_ui_shared/public/components/cron_editor/cron_daily.js +++ b/src/plugins/es_ui_shared/public/components/cron_editor/cron_daily.js @@ -22,29 +22,14 @@ import PropTypes from 'prop-types'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; -import { - EuiFlexGroup, - EuiFlexItem, - EuiFormRow, - EuiSelect, - EuiText, -} from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiSelect } from '@elastic/eui'; -export const CronDaily = ({ - minute, - minuteOptions, - hour, - hourOptions, - onChange, -}) => ( +export const CronDaily = ({ minute, minuteOptions, hour, hourOptions, onChange }) => ( - )} + label={ + + } fullWidth data-test-subj="cronFrequencyConfiguration" > @@ -54,20 +39,13 @@ export const CronDaily = ({ options={hourOptions} value={hour} aria-label={i18n.translate('esUi.cronEditor.cronDaily.hourSelectLabel', { - defaultMessage: 'Hour' + defaultMessage: 'Hour', })} onChange={e => onChange({ hour: e.target.value })} fullWidth - prepend={( - - - - - - )} + prepend={i18n.translate('esUi.cronEditor.cronDaily.fieldHour.textAtLabel', { + defaultMessage: 'At', + })} data-test-subj="cronFrequencyDailyHourSelect" /> @@ -77,17 +55,11 @@ export const CronDaily = ({ options={minuteOptions} value={minute} aria-label={i18n.translate('esUi.cronEditor.cronDaily.minuteSelectLabel', { - defaultMessage: 'Minute' + defaultMessage: 'Minute', })} onChange={e => onChange({ minute: e.target.value })} fullWidth - prepend={( - - - : - - - )} + prepend=":" data-test-subj="cronFrequencyDailyMinuteSelect" /> diff --git a/src/plugins/es_ui_shared/public/components/cron_editor/cron_editor.js b/src/plugins/es_ui_shared/public/components/cron_editor/cron_editor.js index 64d6405603dd7d..576658882589fe 100644 --- a/src/plugins/es_ui_shared/public/components/cron_editor/cron_editor.js +++ b/src/plugins/es_ui_shared/public/components/cron_editor/cron_editor.js @@ -21,12 +21,9 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; import { padLeft } from 'lodash'; import { FormattedMessage } from '@kbn/i18n/react'; +import { i18n } from '@kbn/i18n'; -import { - EuiSelect, - EuiText, - EuiFormRow, -} from '@elastic/eui'; +import { EuiSelect, EuiFormRow } from '@elastic/eui'; import { getOrdinalValue, @@ -81,25 +78,32 @@ const MONTH_OPTIONS = makeSequence(1, 12).map(value => ({ text: getMonthName(value - 1), })); -const UNITS = [{ - value: MINUTE, - text: 'minute', -}, { - value: HOUR, - text: 'hour', -}, { - value: DAY, - text: 'day', -}, { - value: WEEK, - text: 'week', -}, { - value: MONTH, - text: 'month', -}, { - value: YEAR, - text: 'year', -}]; +const UNITS = [ + { + value: MINUTE, + text: 'minute', + }, + { + value: HOUR, + text: 'hour', + }, + { + value: DAY, + text: 'day', + }, + { + value: WEEK, + text: 'week', + }, + { + value: MONTH, + text: 'month', + }, + { + value: YEAR, + text: 'year', + }, +]; const frequencyToFieldsMap = { [MINUTE]: {}, @@ -185,7 +189,7 @@ export class CronEditor extends Component { frequency: PropTypes.string.isRequired, cronExpression: PropTypes.string.isRequired, onChange: PropTypes.func.isRequired, - } + }; static getDerivedStateFromProps(props) { const { cronExpression } = props; @@ -209,12 +213,15 @@ export class CronEditor extends Component { // Update fields which aren't editable with acceptable baseline values. const editableFields = Object.keys(frequencyToFieldsMap[frequency]); - const inheritedFields = editableFields.reduce((baselineFields, field) => { - if (fieldToPreferredValueMap[field] != null) { - baselineFields[field] = fieldToPreferredValueMap[field]; - } - return baselineFields; - }, { ...frequencyToBaselineFieldsMap[frequency] }); + const inheritedFields = editableFields.reduce( + (baselineFields, field) => { + if (fieldToPreferredValueMap[field] != null) { + baselineFields[field] = fieldToPreferredValueMap[field]; + } + return baselineFields; + }, + { ...frequencyToBaselineFieldsMap[frequency] } + ); const newCronExpression = cronPartsToExpression(inheritedFields); @@ -231,17 +238,20 @@ export class CronEditor extends Component { const editableFields = Object.keys(frequencyToFieldsMap[frequency]); const newFieldToPreferredValueMap = {}; - const editedFields = editableFields.reduce((accumFields, field) => { - if (fields[field] !== undefined) { - accumFields[field] = fields[field]; - // Once the user touches a field, we want to persist its value as the user changes - // the cron frequency. - newFieldToPreferredValueMap[field] = fields[field]; - } else { - accumFields[field] = this.state[field]; - } - return accumFields; - }, { ...frequencyToBaselineFieldsMap[frequency] }); + const editedFields = editableFields.reduce( + (accumFields, field) => { + if (fields[field] !== undefined) { + accumFields[field] = fields[field]; + // Once the user touches a field, we want to persist its value as the user changes + // the cron frequency. + newFieldToPreferredValueMap[field] = fields[field]; + } else { + accumFields[field] = this.state[field]; + } + return accumFields; + }, + { ...frequencyToBaselineFieldsMap[frequency] } + ); const newCronExpression = cronPartsToExpression(editedFields); @@ -251,20 +261,14 @@ export class CronEditor extends Component { fieldToPreferredValueMap: { ...fieldToPreferredValueMap, ...newFieldToPreferredValueMap, - } + }, }); }; renderForm() { const { frequency } = this.props; - const { - minute, - hour, - day, - date, - month, - } = this.state; + const { minute, hour, day, date, month } = this.state; switch (frequency) { case MINUTE: @@ -342,12 +346,9 @@ export class CronEditor extends Component { return ( - )} + label={ + + } fullWidth > this.onChangeFrequency(e.target.value)} fullWidth - prepend={( - - - - - - )} + prepend={i18n.translate('esUi.cronEditor.textEveryLabel', { + defaultMessage: 'Every', + })} data-test-subj="cronFrequencySelect" /> diff --git a/src/plugins/es_ui_shared/public/components/cron_editor/cron_hourly.js b/src/plugins/es_ui_shared/public/components/cron_editor/cron_hourly.js index a207998a7f73b2..194fccf1101741 100644 --- a/src/plugins/es_ui_shared/public/components/cron_editor/cron_hourly.js +++ b/src/plugins/es_ui_shared/public/components/cron_editor/cron_hourly.js @@ -20,26 +20,16 @@ import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from '@kbn/i18n/react'; +import { i18n } from '@kbn/i18n'; -import { - EuiFormRow, - EuiSelect, - EuiText, -} from '@elastic/eui'; +import { EuiFormRow, EuiSelect } from '@elastic/eui'; -export const CronHourly = ({ - minute, - minuteOptions, - onChange, -}) => ( +export const CronHourly = ({ minute, minuteOptions, onChange }) => ( - )} + label={ + + } fullWidth data-test-subj="cronFrequencyConfiguration" > @@ -48,16 +38,9 @@ export const CronHourly = ({ value={minute} onChange={e => onChange({ minute: e.target.value })} fullWidth - prepend={( - - - - - - )} + prepend={i18n.translate('esUi.cronEditor.cronHourly.fieldMinute.textAtLabel', { + defaultMessage: 'At', + })} data-test-subj="cronFrequencyHourlyMinuteSelect" /> diff --git a/src/plugins/es_ui_shared/public/components/cron_editor/cron_monthly.js b/src/plugins/es_ui_shared/public/components/cron_editor/cron_monthly.js index 0a5329924b970d..f3ffc082a4c600 100644 --- a/src/plugins/es_ui_shared/public/components/cron_editor/cron_monthly.js +++ b/src/plugins/es_ui_shared/public/components/cron_editor/cron_monthly.js @@ -22,13 +22,7 @@ import PropTypes from 'prop-types'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; -import { - EuiFlexGroup, - EuiFlexItem, - EuiFormRow, - EuiSelect, - EuiText, -} from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiSelect } from '@elastic/eui'; export const CronMonthly = ({ minute, @@ -41,12 +35,9 @@ export const CronMonthly = ({ }) => ( - )} + label={ + + } fullWidth data-test-subj="cronFrequencyConfiguration" > @@ -55,27 +46,17 @@ export const CronMonthly = ({ value={date} onChange={e => onChange({ date: e.target.value })} fullWidth - prepend={( - - - - - - )} + prepend={i18n.translate('esUi.cronEditor.cronMonthly.textOnTheLabel', { + defaultMessage: 'On the', + })} data-test-subj="cronFrequencyMonthlyDateSelect" /> - )} + label={ + + } fullWidth data-test-subj="cronFrequencyConfiguration" > @@ -85,20 +66,13 @@ export const CronMonthly = ({ options={hourOptions} value={hour} aria-label={i18n.translate('esUi.cronEditor.cronMonthly.hourSelectLabel', { - defaultMessage: 'Hour' + defaultMessage: 'Hour', })} onChange={e => onChange({ hour: e.target.value })} fullWidth - prepend={( - - - - - - )} + prepend={i18n.translate('esUi.cronEditor.cronMonthly.fieldHour.textAtLabel', { + defaultMessage: 'At', + })} data-test-subj="cronFrequencyMonthlyHourSelect" /> @@ -108,17 +82,11 @@ export const CronMonthly = ({ options={minuteOptions} value={minute} aria-label={i18n.translate('esUi.cronEditor.cronMonthly.minuteSelectLabel', { - defaultMessage: 'Minute' + defaultMessage: 'Minute', })} onChange={e => onChange({ minute: e.target.value })} fullWidth - prepend={( - - - : - - - )} + prepend=":" data-test-subj="cronFrequencyMonthlyMinuteSelect" /> diff --git a/src/plugins/es_ui_shared/public/components/cron_editor/cron_weekly.js b/src/plugins/es_ui_shared/public/components/cron_editor/cron_weekly.js index d04a8b2ecd0931..b328b5cb958b49 100644 --- a/src/plugins/es_ui_shared/public/components/cron_editor/cron_weekly.js +++ b/src/plugins/es_ui_shared/public/components/cron_editor/cron_weekly.js @@ -22,13 +22,7 @@ import PropTypes from 'prop-types'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; -import { - EuiFlexGroup, - EuiFlexItem, - EuiFormRow, - EuiSelect, - EuiText, -} from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiSelect } from '@elastic/eui'; export const CronWeekly = ({ minute, @@ -41,12 +35,9 @@ export const CronWeekly = ({ }) => ( - )} + label={ + + } fullWidth data-test-subj="cronFrequencyConfiguration" > @@ -55,27 +46,17 @@ export const CronWeekly = ({ value={day} onChange={e => onChange({ day: e.target.value })} fullWidth - prepend={( - - - - - - )} + prepend={i18n.translate('esUi.cronEditor.cronWeekly.textOnLabel', { + defaultMessage: 'On', + })} data-test-subj="cronFrequencyWeeklyDaySelect" /> - )} + label={ + + } fullWidth data-test-subj="cronFrequencyConfiguration" > @@ -85,20 +66,13 @@ export const CronWeekly = ({ options={hourOptions} value={hour} aria-label={i18n.translate('esUi.cronEditor.cronWeekly.hourSelectLabel', { - defaultMessage: 'Hour' + defaultMessage: 'Hour', })} onChange={e => onChange({ hour: e.target.value })} fullWidth - prepend={( - - - - - - )} + prepend={i18n.translate('esUi.cronEditor.cronWeekly.fieldHour.textAtLabel', { + defaultMessage: 'At', + })} data-test-subj="cronFrequencyWeeklyHourSelect" /> @@ -109,16 +83,10 @@ export const CronWeekly = ({ value={minute} onChange={e => onChange({ minute: e.target.value })} aria-label={i18n.translate('esUi.cronEditor.cronWeekly.minuteSelectLabel', { - defaultMessage: 'Minute' + defaultMessage: 'Minute', })} fullWidth - prepend={( - - - : - - - )} + prepend=":" data-test-subj="cronFrequencyWeeklyMinuteSelect" /> diff --git a/src/plugins/es_ui_shared/public/components/cron_editor/cron_yearly.js b/src/plugins/es_ui_shared/public/components/cron_editor/cron_yearly.js index 8a380a97b73ef8..26a57756273bd0 100644 --- a/src/plugins/es_ui_shared/public/components/cron_editor/cron_yearly.js +++ b/src/plugins/es_ui_shared/public/components/cron_editor/cron_yearly.js @@ -22,13 +22,7 @@ import PropTypes from 'prop-types'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; -import { - EuiFlexGroup, - EuiFlexItem, - EuiFormRow, - EuiSelect, - EuiText, -} from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiSelect } from '@elastic/eui'; export const CronYearly = ({ minute, @@ -43,12 +37,9 @@ export const CronYearly = ({ }) => ( - )} + label={ + + } fullWidth data-test-subj="cronFrequencyConfiguration" > @@ -57,27 +48,17 @@ export const CronYearly = ({ value={month} onChange={e => onChange({ month: e.target.value })} fullWidth - prepend={( - - - - - - )} + prepend={i18n.translate('esUi.cronEditor.cronYearly.fieldMonth.textInLabel', { + defaultMessage: 'In', + })} data-test-subj="cronFrequencyYearlyMonthSelect" /> - )} + label={ + + } fullWidth data-test-subj="cronFrequencyConfiguration" > @@ -86,27 +67,17 @@ export const CronYearly = ({ value={date} onChange={e => onChange({ date: e.target.value })} fullWidth - prepend={( - - - - - - )} + prepend={i18n.translate('esUi.cronEditor.cronYearly.fieldDate.textOnTheLabel', { + defaultMessage: 'On the', + })} data-test-subj="cronFrequencyYearlyDateSelect" /> - )} + label={ + + } fullWidth data-test-subj="cronFrequencyConfiguration" > @@ -116,20 +87,13 @@ export const CronYearly = ({ options={hourOptions} value={hour} aria-label={i18n.translate('esUi.cronEditor.cronYearly.hourSelectLabel', { - defaultMessage: 'Hour' + defaultMessage: 'Hour', })} onChange={e => onChange({ hour: e.target.value })} fullWidth - prepend={( - - - - - - )} + prepend={i18n.translate('esUi.cronEditor.cronYearly.fieldHour.textAtLabel', { + defaultMessage: 'At', + })} data-test-subj="cronFrequencyYearlyHourSelect" /> @@ -139,17 +103,11 @@ export const CronYearly = ({ options={minuteOptions} value={minute} aria-label={i18n.translate('esUi.cronEditor.cronYearly.minuteSelectLabel', { - defaultMessage: 'Minute' + defaultMessage: 'Minute', })} onChange={e => onChange({ minute: e.target.value })} fullWidth - prepend={( - - - : - - - )} + prepend=":" data-test-subj="cronFrequencyYearlyMinuteSelect" /> diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/datapanel.tsx b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/datapanel.tsx index b397479bf32fdf..9b7a3435d9e50f 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/datapanel.tsx +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/datapanel.tsx @@ -25,7 +25,7 @@ import { EuiText, EuiFormControlLayout, EuiSwitch, - EuiIcon, + EuiButtonIcon, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; @@ -419,8 +419,8 @@ export const InnerIndexPatternDataPanel = function InnerIndexPatternDataPanel({ setLocalState(s => ({ ...localState, isTypeFilterOpen: false })) } button={ - { setLocalState(s => ({ ...s, @@ -429,17 +429,15 @@ export const InnerIndexPatternDataPanel = function InnerIndexPatternDataPanel({ }} data-test-subj="lnsIndexPatternFiltersToggle" title={i18n.translate('xpack.lens.indexPatterns.toggleFiltersPopover', { - defaultMessage: 'Toggle filters for index pattern', + defaultMessage: 'Filters for index pattern', })} aria-label={i18n.translate( 'xpack.lens.indexPatterns.toggleFiltersPopover', { - defaultMessage: 'Toggle filters for index pattern', + defaultMessage: 'Filters for index pattern', } )} - > - - + /> } > diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/step_logistics.js b/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/step_logistics.js index 630e81a4235e49..c3cf39bec5fadc 100644 --- a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/step_logistics.js +++ b/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/step_logistics.js @@ -44,7 +44,7 @@ export class StepLogisticsUi extends Component { isValidatingIndexPattern: PropTypes.bool.isRequired, hasMatchingIndices: PropTypes.bool.isRequired, indexPatternAsyncErrors: PropTypes.array, - } + }; showAdvancedCron = () => { const { onFieldsChange } = this.props; @@ -66,12 +66,9 @@ export class StepLogisticsUi extends Component { }; renderIndexPatternHelpText() { - const { - isValidatingIndexPattern, - hasMatchingIndices, - } = this.props; + const { isValidatingIndexPattern, hasMatchingIndices } = this.props; - if(!isValidatingIndexPattern && hasMatchingIndices) { + if (!isValidatingIndexPattern && hasMatchingIndices) { return (

@@ -128,37 +125,25 @@ export class StepLogisticsUi extends Component { } renderCronEditor() { - const { - fields, - onFieldsChange, - areStepErrorsVisible, - fieldErrors, - } = this.props; + const { fields, onFieldsChange, areStepErrorsVisible, fieldErrors } = this.props; - const { - rollupCron, - cronFrequency, - isAdvancedCronVisible, - fieldToPreferredValueMap, - } = fields; + const { rollupCron, cronFrequency, isAdvancedCronVisible, fieldToPreferredValueMap } = fields; - const { - rollupCron: errorRollupCron, - } = fieldErrors; + const { rollupCron: errorRollupCron } = fieldErrors; if (isAdvancedCronVisible) { return ( - )} + } error={errorRollupCron} isInvalid={Boolean(areStepErrorsVisible && errorRollupCron)} - helpText={( + helpText={

- )} + } fullWidth > onFieldsChange({ - rollupCron: cronExpression, - simpleRollupCron: cronExpression, - cronFrequency: frequency, - fieldToPreferredValueMap, - })} + onChange={({ cronExpression, frequency, fieldToPreferredValueMap }) => + onFieldsChange({ + rollupCron: cronExpression, + simpleRollupCron: cronExpression, + cronFrequency: frequency, + fieldToPreferredValueMap, + }) + } /> + + - +
); } @@ -233,13 +218,7 @@ export class StepLogisticsUi extends Component { indexPatternAsyncErrors, } = this.props; - const { - id, - indexPattern, - rollupIndex, - rollupPageSize, - rollupDelay, - } = fields; + const { id, indexPattern, rollupIndex, rollupPageSize, rollupDelay } = fields; const { id: errorId, @@ -295,7 +274,7 @@ export class StepLogisticsUi extends Component {

- )} - description={( + } + description={ - )} + } fullWidth > - )} + } error={errorId} isInvalid={Boolean(areStepErrorsVisible && errorId)} fullWidth @@ -335,7 +314,7 @@ export class StepLogisticsUi extends Component {

- )} - description={( + } + description={ - )} + } fullWidth > - )} - error={isValidatingIndexPattern ? undefined : (errorIndexPattern || indexPatternAsyncErrors)} - isInvalid={Boolean((areStepErrorsVisible && errorIndexPattern)) || Boolean(indexPatternAsyncErrors)} + } + error={ + isValidatingIndexPattern ? undefined : errorIndexPattern || indexPatternAsyncErrors + } + isInvalid={ + Boolean(areStepErrorsVisible && errorIndexPattern) || + Boolean(indexPatternAsyncErrors) + } helpText={this.renderIndexPatternHelpText()} fullWidth > onFieldsChange({ indexPattern: e.target.value })} - isInvalid={Boolean(areStepErrorsVisible && errorIndexPattern) || Boolean(indexPatternAsyncErrors)} + isInvalid={ + Boolean(areStepErrorsVisible && errorIndexPattern) || + Boolean(indexPatternAsyncErrors) + } isLoading={isValidatingIndexPattern} fullWidth data-test-subj="rollupIndexPattern" @@ -376,21 +363,21 @@ export class StepLogisticsUi extends Component { - )} + } error={errorRollupIndex} isInvalid={Boolean(areStepErrorsVisible && errorRollupIndex)} - helpText={( + helpText={ {indexIllegalCharacters} }} /> - )} + } fullWidth >

- )} - description={( + } + description={ - )} + } fullWidth > {this.renderCronEditor()}
- )} - description={( + } + description={ - )} + } fullWidth > - )} + } error={errorRollupPageSize} isInvalid={Boolean(areStepErrorsVisible && errorRollupPageSize)} fullWidth @@ -467,7 +454,7 @@ export class StepLogisticsUi extends Component {
- )} - description={( + } + description={ - )} + } fullWidth > - )} + } error={errorRollupDelay} isInvalid={Boolean(areStepErrorsVisible && errorRollupDelay)} - helpText={( + helpText={

- )} + } fullWidth > ; - } + }; } export const StepLogistics = injectI18n(StepLogisticsUi); diff --git a/x-pack/legacy/plugins/snapshot_restore/public/app/components/policy_form/steps/step_logistics.tsx b/x-pack/legacy/plugins/snapshot_restore/public/app/components/policy_form/steps/step_logistics.tsx index cde5d89fb5e64a..85307ae47b832f 100644 --- a/x-pack/legacy/plugins/snapshot_restore/public/app/components/policy_form/steps/step_logistics.tsx +++ b/x-pack/legacy/plugins/snapshot_restore/public/app/components/policy_form/steps/step_logistics.tsx @@ -450,6 +450,8 @@ export const PolicyStepLogistics: React.FunctionComponent = ({ }} /> + + { diff --git a/x-pack/legacy/plugins/watcher/public/sections/watch_edit/components/threshold_watch_edit/action_fields/webhook_action_fields.tsx b/x-pack/legacy/plugins/watcher/public/sections/watch_edit/components/threshold_watch_edit/action_fields/webhook_action_fields.tsx index d877ec1dbcbde9..c3784e1ca55169 100644 --- a/x-pack/legacy/plugins/watcher/public/sections/watch_edit/components/threshold_watch_edit/action_fields/webhook_action_fields.tsx +++ b/x-pack/legacy/plugins/watcher/public/sections/watch_edit/components/threshold_watch_edit/action_fields/webhook_action_fields.tsx @@ -14,7 +14,6 @@ import { EuiSelect, EuiFlexGroup, EuiFlexItem, - EuiText, EuiSpacer, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -112,11 +111,7 @@ export const WebhookActionFields: React.FunctionComponent = ({ )} > - : - - } + prepend=":" fullWidth name="port" value={port || ''} @@ -144,11 +139,7 @@ export const WebhookActionFields: React.FunctionComponent = ({ )} > - / - - } + prepend="/" fullWidth name="path" value={path || ''} diff --git a/x-pack/legacy/plugins/watcher/public/sections/watch_edit/components/threshold_watch_edit/threshold_watch_edit.tsx b/x-pack/legacy/plugins/watcher/public/sections/watch_edit/components/threshold_watch_edit/threshold_watch_edit.tsx index 1041213d355ba0..34c3e66e542b1d 100644 --- a/x-pack/legacy/plugins/watcher/public/sections/watch_edit/components/threshold_watch_edit/threshold_watch_edit.tsx +++ b/x-pack/legacy/plugins/watcher/public/sections/watch_edit/components/threshold_watch_edit/threshold_watch_edit.tsx @@ -273,6 +273,7 @@ export const ThresholdWatchEdit = ({ pageTitle }: { pageTitle: string }) => { }} /> + Date: Wed, 18 Sep 2019 15:22:35 -0400 Subject: [PATCH 5/6] snaps --- .../field/__snapshots__/field.test.js.snap | 4 -- .../__snapshots__/asset.examples.storyshot | 60 ++++++++----------- 2 files changed, 26 insertions(+), 38 deletions(-) diff --git a/src/legacy/core_plugins/kibana/public/management/sections/settings/components/field/__snapshots__/field.test.js.snap b/src/legacy/core_plugins/kibana/public/management/sections/settings/components/field/__snapshots__/field.test.js.snap index 8339ff292b57d8..1a5039bbb96f84 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/settings/components/field/__snapshots__/field.test.js.snap +++ b/src/legacy/core_plugins/kibana/public/management/sections/settings/components/field/__snapshots__/field.test.js.snap @@ -1007,8 +1007,6 @@ exports[`Field for image setting should render as read only with help text if ov allowFullScreen={true} alt="image:test:setting" aria-label="image test setting" - fullScreenIconColor="light" - size="original" url="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" />
@@ -1270,8 +1268,6 @@ exports[`Field for image setting should render user value if there is user value allowFullScreen={true} alt="image:test:setting" aria-label="image test setting" - fullScreenIconColor="light" - size="original" url="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" />
diff --git a/x-pack/legacy/plugins/canvas/public/components/asset_manager/__examples__/__snapshots__/asset.examples.storyshot b/x-pack/legacy/plugins/canvas/public/components/asset_manager/__examples__/__snapshots__/asset.examples.storyshot index fb63022f341d6e..5bb55dd1a8b60c 100644 --- a/x-pack/legacy/plugins/canvas/public/components/asset_manager/__examples__/__snapshots__/asset.examples.storyshot +++ b/x-pack/legacy/plugins/canvas/public/components/asset_manager/__examples__/__snapshots__/asset.examples.storyshot @@ -17,24 +17,20 @@ exports[`Storyshots components/Assets/Asset airplane 1`] = `
- + } + > + Asset thumbnail +
- + } + > + Asset thumbnail +
Date: Wed, 18 Sep 2019 14:52:44 -0600 Subject: [PATCH 6/6] Update two test files to correctly call EuiRange's onChange prop --- .../operations/definitions/date_histogram.test.tsx | 13 ++++++++----- .../operations/definitions/terms.test.tsx | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations/definitions/date_histogram.test.tsx b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations/definitions/date_histogram.test.tsx index ac9c9f48c7acb3..751c1c84aa8447 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations/definitions/date_histogram.test.tsx +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations/definitions/date_histogram.test.tsx @@ -411,11 +411,14 @@ describe('date_histogram', () => { /> ); - instance.find(EuiRange).prop('onChange')!({ - target: { - value: '2', - }, - } as React.ChangeEvent); + instance.find(EuiRange).prop('onChange')!( + { + target: { + value: '2', + }, + } as React.ChangeEvent, + true + ); expect(setStateSpy).toHaveBeenCalledWith({ ...state, layers: { diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations/definitions/terms.test.tsx b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations/definitions/terms.test.tsx index a0c7cdd69ff0d4..1040a26c3f7c46 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations/definitions/terms.test.tsx +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations/definitions/terms.test.tsx @@ -526,11 +526,14 @@ describe('terms', () => { /> ); - instance.find(EuiRange).prop('onChange')!({ - target: { - value: '7', - }, - } as React.ChangeEvent); + instance.find(EuiRange).prop('onChange')!( + { + target: { + value: '7', + }, + } as React.ChangeEvent, + true + ); expect(setStateSpy).toHaveBeenCalledWith({ ...state, layers: {