From 0eb9b9ef6fef5b977d2c82362b05f6311af9218f Mon Sep 17 00:00:00 2001 From: Marta Bondyra Date: Thu, 23 Jan 2020 18:36:14 +0100 Subject: [PATCH] refactor: copy change --- .../sections/settings/components/field/field.tsx | 2 -- .../sections/settings/components/form/form.tsx | 14 +++++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/legacy/core_plugins/kibana/public/management/sections/settings/components/field/field.tsx b/src/legacy/core_plugins/kibana/public/management/sections/settings/components/field/field.tsx index 2811cea9df9c5..7b291c017540a 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/settings/components/field/field.tsx +++ b/src/legacy/core_plugins/kibana/public/management/sections/settings/components/field/field.tsx @@ -45,8 +45,6 @@ import { EuiSwitch, EuiSwitchEvent, EuiToolTip, - EuiFlexGroup, - EuiFlexItem, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; diff --git a/src/legacy/core_plugins/kibana/public/management/sections/settings/components/form/form.tsx b/src/legacy/core_plugins/kibana/public/management/sections/settings/components/form/form.tsx index 788acb47cae5e..2be21bb64c310 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/settings/components/form/form.tsx +++ b/src/legacy/core_plugins/kibana/public/management/sections/settings/components/form/form.tsx @@ -74,11 +74,11 @@ export class Form extends PureComponent { .find(el => el.name === key); }; - getCountOfUnsavedSettings = (): number => { + getCountOfUnsavedChanges = (): number => { return Object.keys(this.state.unsavedChanges).length; }; - getCountOfHiddenUnsavedSettings = (): number => { + getCountOfHiddenUnsavedChanges = (): number => { const unsavedSettings = Object.keys(this.state.unsavedChanges).map(key => ({ name: key })); const displayedUnsavedCount = intersectionBy( unsavedSettings, @@ -123,7 +123,7 @@ export class Form extends PureComponent { }); }; - clearUnsaved = () => { + clearAllUnsaved = () => { this.setState({ unsavedChanges: {} }); }; @@ -165,7 +165,7 @@ export class Form extends PureComponent { try { await this.props.save(configToSave); - this.clearUnsaved(); + this.clearAllUnsaved(); if (requiresReload) { this.renderPageReloadToast(); } @@ -296,8 +296,8 @@ export class Form extends PureComponent { } renderBottomBar = () => { - const unsavedCount = this.getCountOfUnsavedSettings(); - const hiddenUnsavedCount = this.getCountOfHiddenUnsavedSettings(); + const unsavedCount = this.getCountOfUnsavedChanges(); + const hiddenUnsavedCount = this.getCountOfHiddenUnsavedChanges(); return ( @@ -330,7 +330,7 @@ export class Form extends PureComponent { color="ghost" size="s" iconType="cross" - onClick={this.clearUnsaved} + onClick={this.clearAllUnsaved} aria-label={i18n.translate('kbn.management.settings.form.cancelButtonAriaLabel', { defaultMessage: 'Cancel all changes', })}