Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Uptime] Update ML flyout to add cancel button #61627

Merged
merged 6 commits into from
Mar 30, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
update button
shahzad31 committed Mar 27, 2020
commit acc162e8cf9194c487e0b627fefab8218c243845

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
import React, { useContext } from 'react';
import {
EuiButton,
EuiButtonEmpty,
EuiFlexGroup,
EuiFlexItem,
EuiFlyout,
@@ -64,11 +65,20 @@ export function MLFlyoutView({ isCreatingJob, onClickCreate, onClose, canCreateM
<em>{labels.TAKE_SOME_TIME_TEXT}</em>
</p>
</EuiText>

<EuiSpacer />
</EuiFlyoutBody>
<EuiFlyoutFooter>
<EuiFlexGroup justifyContent="spaceBetween" alignItems="flexEnd">
<EuiFlexItem grow={true}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<EuiFlexItem grow={true}>
<EuiFlexItem grow={false}>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if i set this to false, create new button will take all the space.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i need to remove alignItems="flexEnd"

<EuiButtonEmpty
style={{ width: 100 }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure - why do we need to set the width?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was taking half width and hence was pusing cancel button to center, i think maybe i could have achieved this by using justifyContent to flexStart

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me check an EUI example to achieve this best using EUI

fullWidth={false}
onClick={() => onClose()}
disabled={isCreatingJob || isLoadingMLJob}
>
{labels.CANCEL_LABEL}
</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton
onClick={() => onClickCreate()}
Original file line number Diff line number Diff line change
@@ -124,6 +124,13 @@ export const CREATE_NEW_JOB = i18n.translate(
}
);

export const CANCEL_LABEL = i18n.translate(
'xpack.uptime.ml.enableAnomalyDetectionPanel.cancelLabel',
{
defaultMessage: 'Cancel',
}
);

export const CREAT_ML_JOB_DESC = i18n.translate(
'xpack.uptime.ml.enableAnomalyDetectionPanel.createMLJobDescription',
{