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

[Alerting] Prompt for confirmation when saving alert with no action #79892

Merged
merged 10 commits into from
Oct 13, 2020

Conversation

ymao1
Copy link
Contributor

@ymao1 ymao1 commented Oct 7, 2020

Resolves #61522

Summary

When saving an alert, show confirmation modal if user is trying to save an alert with no actions. This will only occur for users with the ability to create actions. Users who don't have the ability to create actions will not be prompted.

Screen Shot 2020-10-07 at 2 32 52 PM

Checklist

Delete any items that are not applicable to this PR.

@ymao1 ymao1 added Feature:Alerting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.11.0 v8.0.0 labels Oct 8, 2020
@ymao1 ymao1 marked this pull request as ready for review October 8, 2020 00:38
@ymao1 ymao1 requested a review from a team as a code owner October 8, 2020 00:38
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

Copy link
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

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

Code LGTM. I left a few comments about the e2e test, but the rest looks awesome and works as expected 👍 . I will rely on @gchaps decision about the text for the confirmation modal.

Copy link
Contributor

@gmmorris gmmorris left a comment

Choose a reason for hiding this comment

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

Works as expected so LGTM 👍
Worth considering the comments on the e2e tests but no blockers as far as I'm concerned. :)

Comment on lines 79 to 85

it('can save alert', async () => {
await alerts.clickSaveAlertButton();
await alerts.clickSaveAlertsConfirmButton();
await pageObjects.common.closeToast();
});

Copy link
Contributor

Choose a reason for hiding this comment

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

It might be worth pinging the Uptime team just so they know about the changes to their tests.
I don't think they will get pinged automatically because we own the test suite.

@ymao1 ymao1 added the Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability label Oct 8, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

@ymao1 ymao1 self-assigned this Oct 8, 2020
@pmuellr
Copy link
Member

pmuellr commented Oct 8, 2020

I noticed this oddity, when I did a save with the "index" prompter open, and then pressed the save button which was enabled at the time. I wasn't even trying it, I think I fat-fingered enter there or something :-)

Seems like this is unrelated to this PR, it feels like that "index" prompter should be dismissed upon attempted Save, or Save should be disabled until the "index" prompter is dismissed. I think we have some other issues regarding these "expression" prompters, specifically around when they are dismissed, perhaps such scenarios are already being addressed in the expression editor bits. I'd kinda hate to even make a z-order change, just for this, as it feels like that could be brittle over time.

before hitting save

Alerts_-_Elastic - 1

after hitting save

Alerts_-_Elastic - 2

Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

LGTM, works as expected when creating a new alert.

I did notice this doesn't prompt when editing an existing alert. I think that's fine, but ... dunno. We're certainly looking at catching the "you didn't add any actions" upon create. And if for some reason, you had a reason to have an action-less alert, and got that prompter every time you saved it, it would be frustrating.

@ymao1
Copy link
Contributor Author

ymao1 commented Oct 8, 2020

I did notice this doesn't prompt when editing an existing alert. I think that's fine, but ... dunno. We're certainly looking at catching the "you didn't add any actions" upon create. And if for some reason, you had a reason to have an action-less alert, and got that prompter every time you saved it, it would be frustrating.

Agreed. I thought about adding it to the Edit flyout as well but I wasn't sure what the expected behavior should be when editing.

@ymao1
Copy link
Contributor Author

ymao1 commented Oct 8, 2020

I noticed this oddity, when I did a save with the "index" prompter open, and then pressed the save button which was enabled at the time. I wasn't even trying it, I think I fat-fingered enter there or something :-)

Should I make a separate ticket to address this?

@YulNaumenko
Copy link
Contributor

LGTM, works as expected when creating a new alert.

I did notice this doesn't prompt when editing an existing alert. I think that's fine, but ... dunno. We're certainly looking at catching the "you didn't add any actions" upon create. And if for some reason, you had a reason to have an action-less alert, and got that prompter every time you saved it, it would be frustrating.

I don't think that we should be prompted again in Edit, because it is something with what user have already agreed on and saved before. So +1 to left it as it is now.

@pmuellr
Copy link
Member

pmuellr commented Oct 12, 2020

I noticed this oddity, when I did a save with the "index" prompter open, and then pressed the save button which was enabled at the time. I wasn't even trying it, I think I fat-fingered enter there or something :-)

Should I make a separate ticket to address this?

Ya, I think so.

@ymao1
Copy link
Contributor Author

ymao1 commented Oct 12, 2020

@elasticmachine merge upstream

1 similar comment
@ymao1
Copy link
Contributor Author

ymao1 commented Oct 12, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

@kbn/optimizer bundle module count

id before after diff
triggersActionsUi 283 284 +1

async chunks size

id before after diff
triggersActionsUi 1.5MB 1.5MB +1.7KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@ymao1 ymao1 merged commit 7b00052 into elastic:master Oct 13, 2020
ymao1 added a commit to ymao1/kibana that referenced this pull request Oct 13, 2020
…lastic#79892)

* Adding save confirmation for new alerts with no associated actions

* Adding functional tests

* Fixing uptime alert test

* Fixing uptime alert test

* PR fixes

* Updating confirmation modal wording

Co-authored-by: Kibana Machine <[email protected]>
ymao1 added a commit that referenced this pull request Oct 13, 2020
…79892) (#80314)

* Adding save confirmation for new alerts with no associated actions

* Adding functional tests

* Fixing uptime alert test

* Fixing uptime alert test

* PR fixes

* Updating confirmation modal wording

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
@mikecote mikecote added release_note:enhancement and removed release_note:skip Skip the PR/issue when compiling release notes labels Dec 16, 2020
@ymao1 ymao1 deleted the alerting/save-alert-no-action branch February 4, 2021 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Alerting release_note:enhancement Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Alerting] Show a warning when creating an alert if no actions are defined
8 participants