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: Reorder new alert and export buttons #68418

Merged
merged 10 commits into from
May 31, 2023
Merged

Conversation

VikaCep
Copy link
Contributor

@VikaCep VikaCep commented May 12, 2023

What is this feature?

Moves the new alert rule button to the top and creates a dropdown to display the options to create a recording rule and export all rules.

Now each new rule option has its own path: Grafana and Loki/Mimir are under new/alerting while recording rules can be accessed from new/recording.

Why do we need this feature?

To group buttons in a more clear way.

Who is this feature for?

All users

Which issue(s) does this PR fix?:

Fixes #68093
Fixes #68185

2023-05-31 10 26 00

@VikaCep VikaCep self-assigned this May 12, 2023
@VikaCep VikaCep force-pushed the alerting/68093-alert-buttons branch from 8985d83 to c12cb7b Compare May 17, 2023 20:06
@VikaCep VikaCep added this to the 10.1.x milestone May 17, 2023
@VikaCep VikaCep added area/alerting Grafana Alerting no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes labels May 17, 2023
@VikaCep VikaCep marked this pull request as ready for review May 17, 2023 20:15
@VikaCep VikaCep requested a review from a team May 17, 2023 20:15
Copy link
Member

@soniaAguilarPeiron soniaAguilarPeiron left a comment

Choose a reason for hiding this comment

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

LGTM!🎉
I added a non blocking comment.

@konrad147
Copy link
Contributor

konrad147 commented May 23, 2023

Should we remove the Recording rule option from the rule type selection for alert rules? And then, remove the rule type selection altogether when the user clicks New recording rule?
I was under impression #68185 is about that.

@@ -235,6 +235,17 @@ const unifiedRoutes: RouteDescriptor[] = [
() => import(/* webpackChunkName: "AlertingRuleForm"*/ 'app/features/alerting/unified/RuleEditor')
),
},
{
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems to me the current number of routes is a bit confusing. We have

  • /alerting/new
  • /alerting/new/grafana
  • /alerting/new/cloud-alerting
  • /alerting/new/cloud-recording
    What if we have /alerting/new/alerting and /alerting/new/recording?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And what about Loki/Mimir? (currently cloud-alerting), shouldn't we add a new route for it as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think both Grafana and Loki/Mimir should be under /alerting/new/alerting.
My rationale is that you click Create Alert Rule or More -> Create recording rule so we have two different entry points. Additionally, if we remove the Recording rule from the rule type selection, this routing change makes more sense. Yet it makes less sense if we do not remove the Recording rule from the type selection.

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 sounds good to me, removed the button and changed the routes as you suggested 👍

@VikaCep VikaCep requested a review from a team as a code owner May 24, 2023 21:27
@VikaCep VikaCep requested review from ashharrison90, eledobleefe and konrad147 and removed request for a team May 24, 2023 21:27
Copy link
Contributor

@konrad147 konrad147 left a comment

Choose a reason for hiding this comment

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

LGTM! one nit

</LinkButton>
)}

<Dropdown overlay={newMenu}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we hide the dropdown if none of canCreateGrafanaRules, canCreateCloudRules, and canReadProvisioning is true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, done.

@VikaCep VikaCep removed the no-changelog Skip including change in changelog/release notes label May 31, 2023
@VikaCep VikaCep merged commit e796063 into main May 31, 2023
13 checks passed
@VikaCep VikaCep deleted the alerting/68093-alert-buttons branch May 31, 2023 13:56
@ricky-undeadcoders ricky-undeadcoders modified the milestones: 10.1.x, 10.1.0 Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Remove the recording rule from the alert rule creation workflow Alert list view: action buttons
5 participants