Commit Graph

40 Commits

Author SHA1 Message Date
Tom Ratcliffe
d91e1a4e3a Refactor tab query param logic and add tests 2024-04-12 09:13:29 +01:00
Tom Ratcliffe
800a2e0228 Fix tests being stateful due to locationService 2024-04-12 09:13:29 +01:00
Tom Ratcliffe
933cc3f075 Tweak ContactPoints to use query param for tab selection 2024-04-12 09:13:29 +01:00
Sonia Aguilar
e234d098e9 Alerting: Get oncall metada only when we have alert manager configuration data (#85622)
* Get oncall metada from url in settings only when we have alert manager configuration

* Add test in useContactPointsWithStatus hook

* Fix tests
2024-04-09 09:02:44 +02:00
Konrad Lalik
9b4f88c6f6 Alerting: Improve template preview (#84798)
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2024-04-04 18:37:24 +03:00
Sonia Aguilar
b38436eeb0 Alerting: Fix used badge in contact points list (#84714)
Fix used badge in contact points list
2024-03-19 13:30:06 +01:00
Ashley Harrison
15194b41b4 Dropdown: Fix keyboard accessibility (#84683)
* fix dropdown keyboard a11y

* remove unnecessary css

* restore tabIndex to keep linting happy

* use Box in Menu

* fix unit test
2024-03-19 10:22:17 +00:00
Gilles De Mey
8765c48389 Alerting: Remove legacy alerting (#83671)
Removes legacy alerting, so long and thanks for all the fish! 🐟

---------

Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
Co-authored-by: Sonia Aguilar <soniaAguilarPeiron@users.noreply.github.com>
Co-authored-by: Armand Grillet <armandgrillet@users.noreply.github.com>
Co-authored-by: William Wernert <rwwiv@users.noreply.github.com>
Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2024-03-14 15:36:35 +01:00
Gilles De Mey
582fd53fac Alerting: Implement correct RBAC checks for creating new notification templates (#83767) 2024-03-01 18:09:14 +01:00
Sonia Aguilar
7b415cf79e Alerting: Skip fetching receivers status in the alert rule form (#82892) 2024-02-16 15:15:02 +01:00
Ashley Harrison
cf65d91ee9 Chore: upgrade to msw v2 (#82270)
* Update dependency msw to v2

* close

* minor fixes

* fetch import changes

* fix some alerting tests

* fix another alerting test

* fix systemjs tests

* don't return undefined in json mocks

* don't return undefined in json response

* add type

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-14 13:16:44 +00:00
Gilles De Mey
70aa8fe6b3 Alerting: Fix slack double pound and email summary (#82333) 2024-02-14 13:12:04 +01:00
Sonia Aguilar
3e93a0991f Alerting: Use new readonly permission endpoints for getting contact points and mute timings (#82132)
* use new read only contact points list endpoint in simplified routing section

* Dont use alertmanager endpoint to get groupby defaults

* Use the new read only endpoint for mute timings in route settings

* review suggestions

* Rename hook

* Use options in params for useContactPointsWithStatus hook

* Refactor useContactPointsWithStatus

* second part of the enhanceContactPointsWithMetadata refactor
2024-02-09 12:13:37 +01:00
Sonia Aguilar
cd0f299297 Alerting: Update logic for checking if contact point is being used (#81713)
Don't count autorgenerated policy in receiver level when checking if contact point is used
2024-02-01 17:04:41 +01:00
Sonia Aguilar
6218e28ee9 Alerting: Add refresh button to contact points selector in simplified routing section. (#80748)
* Add refresh button for contact points selector in simplified routing section

* Clear timeout when unmounting component

* Fix timeout not being correclty removed when component unmounts

* Update css field name

* Kepp loading spinner if refetching receivers takes more than one second

* Fix test snapshot in useContactPointsWithStatus hook

* refactor how we wait for the request response and the timeout to finish
2024-01-25 09:53:54 +02:00
Sonia Aguilar
f6f259f0b5 Alerting: Simplified routing part2 (#78671)
* wip

* WIP: Added some actions, timings and grouping

* WIP: remove reducer and use form fields instead

* Show defaults when using override in route settings

* Update alert rule model for simplified routing

* Use defaults in placeholders when overriding timings

* Add validation for contact point

* Add selected contact point details

* Refactor: extract components to separate files and reorg in subfolders

* Fix test

* Update revalidate mode in form

* Extract RuleEditorSectionBody outside NotificationStep component to avoid unmounting any time this one renders

* Remove reValidateMode option in form

* Fix after merging

* Address PR review comments part1

* Address PR review comments part2

* Create routeTimingsFields constant to reuse labels, descriptions and arial labels for the mute timing fields

* Move conditional rendering to the parent in AutomaticRooting and ManualAndAutomaticRouting

* Simplify AlertManagerManualRouting properties
2024-01-02 08:43:31 +01:00
Gilles De Mey
7cbf5ae78d Alerting: Remove old contact points view (#78704) 2023-11-30 13:37:14 +01:00
Sonia Aguilar
2acf153a26 Alerting: Simplify routing in alert form - part1 (#78040)
* Add routing option tabs

* Use alertingSimplifiedRouting feature toggle

* Move simplified routing tab to a separate component:SimplifiedRouting

* Populate contact point selector with the right values

* Show alert manager icons

* Fix descriptions

* Remove clear button on ContactPointSelector and save updated reducer state in the form

* Load contact points and manual option from rule data in RuleFormValues

* make contact point selector not clearable

* Refactor

* Add link to contact points view

* Move ContactPointSelector to a separate file

* Refactor: move hoook useReceiversMetadataMapByName to a separate file

* Update Need more info texts

* Address some PR review comments

* Use useContactPointsWithStatus hook and wrap each ContacPointSelector with AlertmanagerProvider

* use getAlertManagerDataSourcesByPermission instead of useGetAlertManagersMetadata in NotificationPreview

* Update enum

* Remove css style

* remove console

* update contact point selector

* file cleanup

* adds summary as description

* Update text in manual tab

* Fix preview routing not checking if alert manager can handle grafana alerts

* Fix typo

* remove unused location form field

* fix prettier

* fix test

* Remove unused location form field from AlertRuleNameInput

* Only use internal AlertManager for now

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2023-11-22 10:15:33 +01:00
Gilles De Mey
be436ec6f6 Alerting: Adds contact point sorting and searching (#77390) 2023-11-07 11:05:12 +01:00
Alex Khomenko
25779bb6e5 Stack: Use the component from grafana/ui (#77543)
* grafana/ui: Move Stack out of unstable

* grafana/ui: Replace imports

* Replace the import from experimental

* Cleanup

* Remove invalid prop

* Add flexGrow

* Remove Stack used in Field

* Remove import
2023-11-06 18:15:52 +02:00
Gilles De Mey
e61ebd4b06 Alerting: Do not show missing integration while loading oncall plugin status (#77710) 2023-11-06 15:51:36 +01:00
Gilles De Mey
06873f1be3 Alerting: Update message templates to notification templates nomenclature (#77374) 2023-10-30 16:23:14 +02:00
Gilles De Mey
e12e40fc24 Alerting: Contact Points v2 part IV (#76063) 2023-10-25 15:57:53 +02:00
Ieva
5e14d93530 Chore: remove hasAccess and hasAcessInMetadata (#76237)
* remove hasAccess and hasAcessInMetadata in favour of hasPermission and hasPermissionInMetadata

* test fixes

* more test fixes
2023-10-10 12:04:07 +01:00
Gilles De Mey
5a1580c659 Alerting: Contact points v2 part 3 (#72444) 2023-09-26 11:44:18 +03:00
Gilles De Mey
bd23d48660 Alerting: useAbilities hook (#72626) 2023-09-12 15:20:39 +02:00
Konrad Lalik
7baf9cc033 Alerting: Custom contact point for OnCall in Grafana AM (#72021) 2023-09-06 12:33:35 +02:00
Gilles De Mey
51a67b99f2 Alerting: Always invalidate the AM config after mutation (#73162) 2023-08-11 08:36:49 +02:00
Laura Fernández
7ec9a0c9da GLDS: Move Text component from the unstable package to grafana-ui (#72660) 2023-08-02 14:58:00 +02:00
Ashley Harrison
e0587dfb30 Chore: Replace deprecated usage of shape.borderRadius() (#72672)
* properly mark borderRadius() as deprecated, replace borderRadius() with default

* undo a couple of changes

* use radius.pill in FilterPill
2023-08-01 14:46:07 +01:00
Gilles De Mey
f10527cfe3 Alerting: Contact points v2 part 2 (#71135) 2023-07-27 13:28:00 +02:00
Matthew Jacobson
13121d3234 Alerting: Add contact point provisioning file export (#71692)
* Add contact point provisioning file export apis

* Regenerate api

* docs

* frontend

* add mock to tests

* Fix missing row-level export button on viewer role w/ prov. read

* Address review comments

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2023-07-20 14:35:56 -04:00
Laura Fernández
47f70bdb00 GLDS: Text component (#71439) 2023-07-20 12:59:42 +02:00
Gilles De Mey
fc5d43e1bf Alerting: refactor fetchAlertManagerConfigAction to use RTK Query (#71261) 2023-07-14 16:53:50 +02:00
Gilles De Mey
089305e399 Alerting: improve provisioning indicator for notification policies (#71160) 2023-07-07 14:00:53 +03:00
Gilles De Mey
368afc211c Alerting: Contact points v2 – part 1 (#70643) 2023-07-04 12:47:19 +02:00
Gilles De Mey
df3888ba60 Alerting: Refactor Alertmanager picker (#70720) 2023-07-04 13:07:05 +03:00
Konrad Lalik
9ebede1e18 Alerting: Display a warning when a contact point is not in use (#70506) 2023-06-26 11:05:44 +02:00
Virginia Cepeda
929d9eaa91 Alerting: Change how we display annotations in the rule form (#69338)
* Change how we display annotations in the rule form

* Allow to add custom annotations using a free text input

* Get dashboard and panel titles to display in the annotations section

* Add component to display dashboard and panel annotations as links

* Add styling to help tooltip

* Fix styling on annotations controls

* Fix tests

* Fix tests

* Remove unused imports

* Add component for custom annotations

* Display default annotations even if editing and they're empty

* Adjust tests

* Make conditional rendering more clear

* Fix tests

* Move annotation header to separate component

* Fix lint

* Show annotation fields in the right order

* Prevent showing custom annotation fields by default

* Don't display links to dashboard/panel if response fails

* Rename custom annotation header component

* Fix after rebase
2023-06-21 11:15:12 -03:00
Gilles De Mey
69b1153205 Alerting: Contact Points v2 feature flag (#70165) 2023-06-16 16:19:44 +02:00