Skip to content

Commit

Permalink
[Transform] Add spacer, rename indices,
Browse files Browse the repository at this point in the history
  • Loading branch information
qn895 committed Jun 5, 2020
1 parent cd293f2 commit 8e7b21a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const ToastNotificationText: FC<ToastNotificationTextProps> = ({

const unformattedText = text.message ? text.message : text;
const formattedText = typeof unformattedText === 'object' ? JSON.stringify(text, null, 2) : text;
const textLength = previewTextLength || 140;
const textLength = previewTextLength ?? 140;
const previewText = `${formattedText.substring(0, textLength)}${
formattedText.length > textLength ? ' ...' : ''
}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export const useDeleteTransforms = () => {
const destinationIndex = status.destinationIndex;

// if we are only deleting one transform, show the success toast messages
if (!isBulk) {
if (!isBulk && status.transformDeleted) {
if (status.transformDeleted?.success) {
toastNotifications.addSuccess(
i18n.translate('xpack.transform.transformList.deleteTransformSuccessMessage', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiSwitch,
EuiSpacer,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { TRANSFORM_STATE } from '../../../../../../common';
Expand Down Expand Up @@ -99,18 +100,18 @@ export const DeleteAction: FC<DeleteActionProps> = ({ items, forceDisable }) =>
{
<EuiSwitch
data-test-subj="transformBulkDeleteIndexSwitch"
style={{ paddingBottom: 10 }}
label={i18n.translate(
'xpack.transform.actionDeleteTransform.bulkDeleteDestinationIndexTitle',
{
defaultMessage: 'Delete destination indexes',
defaultMessage: 'Delete destination indices',
}
)}
checked={deleteDestIndex}
onChange={toggleDeleteIndex}
/>
}
</EuiFlexItem>
<EuiSpacer size="s" />
<EuiFlexItem>
{
<EuiSwitch
Expand Down Expand Up @@ -143,7 +144,6 @@ export const DeleteAction: FC<DeleteActionProps> = ({ items, forceDisable }) =>
{userCanDeleteIndex && (
<EuiSwitch
data-test-subj="transformDeleteIndexSwitch"
style={{ paddingBottom: 10 }}
label={i18n.translate(
'xpack.transform.actionDeleteTransform.deleteDestinationIndexTitle',
{
Expand All @@ -156,8 +156,9 @@ export const DeleteAction: FC<DeleteActionProps> = ({ items, forceDisable }) =>
/>
)}
</EuiFlexItem>
<EuiFlexItem>
{userCanDeleteIndex && indexPatternExists && (
{userCanDeleteIndex && indexPatternExists && (
<EuiFlexItem>
<EuiSpacer size="s" />
<EuiSwitch
data-test-subj="transformDeleteIndexPatternSwitch"
label={i18n.translate(
Expand All @@ -170,8 +171,8 @@ export const DeleteAction: FC<DeleteActionProps> = ({ items, forceDisable }) =>
checked={deleteIndexPattern}
onChange={toggleDeleteIndexPattern}
/>
)}
</EuiFlexItem>
</EuiFlexItem>
)}
</EuiFlexGroup>
</>
);
Expand Down

0 comments on commit 8e7b21a

Please sign in to comment.