Skip to content

[Metrics UI] Fixes for editing alerts in alert management#64597

Merged
simianhacker merged 4 commits intoelastic:masterfrom
simianhacker:issue-64012-fix-alert-edit
Apr 28, 2020
Merged

[Metrics UI] Fixes for editing alerts in alert management#64597
simianhacker merged 4 commits intoelastic:masterfrom
simianhacker:issue-64012-fix-alert-edit

Conversation

@simianhacker
Copy link
Member

Summary

This PR closes #64012 by setting the sourceId when it's not properly set and this also fixes the missing filter and group-by fields.

@simianhacker simianhacker added release_note:fix Feature:Metrics UI Metrics UI feature v8.0.0 Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.8.0 v7.7.1 labels Apr 27, 2020
@simianhacker simianhacker requested a review from a team as a code owner April 27, 2020 22:55
@simianhacker simianhacker requested a review from phillipb April 27, 2020 22:55
Copy link
Contributor

@phillipb phillipb left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@phillipb phillipb left a comment

Choose a reason for hiding this comment

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

Oops

@simianhacker simianhacker requested a review from phillipb April 28, 2020 01:43
Copy link
Contributor

@phillipb phillipb left a comment

Choose a reason for hiding this comment

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

Can't clear the alert per selection on the edit screen.

compressed
>
<MetricsExplorerGroupBy
onChange={onGroupByChange}
Copy link
Contributor

Choose a reason for hiding this comment

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

There's actually a bug in the underlying alert library that won't let us setAlertParams('groupBy', undefined), so this is causing a bug with clearing out the group by field in edit. We should update:

setAlertParams('groupBy', group || undefined);
},
to be setAlertParams('groupBy', group || '');.

The bug in alerting is here:

case 'setAlertParams': {
const { key, value } = payload;
if (isEqual(alert.params[key], value)) {
return state;
} else {
return {
...state,
alert: {
...alert,
params: {
...alert.params,
[key]: value,
},
},
};
}
}
case 'setAlertActionParams': {

@simianhacker simianhacker requested a review from phillipb April 28, 2020 04:23
Copy link
Contributor

@phillipb phillipb left a comment

Choose a reason for hiding this comment

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

My bad, my comment wasn't clear enough.

}

setAlertParams('groupBy', md.currentOptions.groupBy);
setAlertParams('groupBy', md.currentOptions.groupBy || '');
Copy link
Contributor

Choose a reason for hiding this comment

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

This call was actually not the problem. The one that needs to be updated is the onGroupByChange here:

const onGroupByChange = useCallback(
(group: string | null) => {
setAlertParams('groupBy', group || undefined);
},
[setAlertParams]
);

@simianhacker simianhacker requested a review from phillipb April 28, 2020 13:07
Copy link
Contributor

@phillipb phillipb left a comment

Choose a reason for hiding this comment

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

LGTM

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@simianhacker simianhacker merged commit 4a04adf into elastic:master Apr 28, 2020
simianhacker added a commit to simianhacker/kibana that referenced this pull request Apr 28, 2020
)

* [Metrics UI] Fixes for editing alerts in alert management

* Change EuiFieldSearch to use onChange instead of onSearch

* Fixing groupBy

* Fixing the correct groupBy
simianhacker added a commit to simianhacker/kibana that referenced this pull request Apr 28, 2020
)

* [Metrics UI] Fixes for editing alerts in alert management

* Change EuiFieldSearch to use onChange instead of onSearch

* Fixing groupBy

* Fixing the correct groupBy
simianhacker added a commit that referenced this pull request Apr 28, 2020
…64671)

* [Metrics UI] Fixes for editing alerts in alert management

* Change EuiFieldSearch to use onChange instead of onSearch

* Fixing groupBy

* Fixing the correct groupBy
simianhacker added a commit that referenced this pull request Apr 28, 2020
…64672)

* [Metrics UI] Fixes for editing alerts in alert management

* Change EuiFieldSearch to use onChange instead of onSearch

* Fixing groupBy

* Fixing the correct groupBy
@simianhacker simianhacker deleted the issue-64012-fix-alert-edit branch April 17, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Metrics UI Metrics UI feature release_note:fix Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.7.1 v7.8.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kibana needs to display better error message to user if user tries to save metric threshold alert without all the values

3 participants