Commit Graph

1426 Commits

Author SHA1 Message Date
Tom Ratcliffe
11ed882c84 Add mock server handlers necessary for Silences 2024-04-29 14:15:48 +01:00
Tom Ratcliffe
8f27ec2521 Add silences RTK Query API 2024-04-29 14:15:48 +01:00
Ashley Harrison
c151a97110
Chore: Enable no-unreduced-motion and fix errors (#86572)
* enable `no-unreduced-motion` in betterer

* move all animation calls inside handleReducedMotion

* fix violations + enable rule

* update rule README

* remove unnecessary transition from <Collapse>

* remove handleReducedMotion utility and add handleMotion to theme

* update to use new theme value

* handle Dropdown and IconButton

* handle AppChromeMenu and update lint message

* keep rotation at a reduced speed

* handle DashboardLoading
2024-04-29 13:12:36 +01:00
Sonia Aguilar
a68df4be88
Alerting: Skip flaky test (#86921)
Skip flacky test
2024-04-25 13:43:37 +01:00
Tom Ratcliffe
f43762f39a Remove (most) occurrences of HorizontalGroup within Alerting 2024-04-25 12:54:41 +01:00
Erik Sundell
0140dfdddf
Chore: Add e2e selectors to alert rule page (#86909)
wip
2024-04-25 10:00:11 +02:00
Tom Ratcliffe
0582e05f8f Add PoC for different MSW approach 2024-04-24 15:57:11 +01:00
Marcus Andersson
804c726413
PluginExtensions: Make the extensions registry reactive (#83085)
* feat: add a reactive extension registry

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* feat: add hooks to work with the reactive registry

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* feat: start using the reactive registry

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* feat: update the "command palette" extension point to use the hook

* feat: update the "alerting" extension point to use the hooks

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* feat: update the "explore" extension point to use the hooks

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* feat: update the "datasources config" extension point to use the hooks

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* feat: update the "panel menu" extension point to use the hooks

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* feat: update the "pyroscope datasource" extension point to use the hooks

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* feat: update the "user profile page" extension point to use the hooks

* chore: update betterer

* fix: update the hooks to not re-render unnecessarily

* chore: remove the old `createPluginExtensionRegistry` impementation

* chore: add "TODO" for `PanelMenuBehaviour` extension point

* feat: update the return value of the hooks to contain a `{ isLoading }` param

* tests: add more tests for the usePluginExtensions() hook

* fix: exclude the cloud-home-app from being non-awaited

* refactor: use uuidv4() for random ID generation (for the registry object)

* fix: linting issue

* feat: use the hooks for the new alerting extension point

* feat: use `useMemo()` for `AlertInstanceAction` extension point context

---------

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2024-04-24 09:33:16 +02:00
Sonia Aguilar
68564b1940
Alerting: Gops labels integration (#85467)
* Show list of labels on the alert rule form in a more visual way, and use a modal for managing them

* fix test

* Fix more tests

* Show orange badge when no labels are selected

* Remove unused datasource property in LabelsField

* Remove unused div and add comment

* Use button instead of icon for editing labels

* Use subform for labels

* Move logic fetching labels from different places in a separate hook

* Fix tests

* remove unused getLabelInput const in test

* Add ellispis and tooltip for long labels and move labels list in modal to the bottom

* Use text instead of badge when no using labels

* Fix tests after adding ellipsis and tooltip to the labels

* simplify styles

* Fix fetching values from gops when new key is used

* Address pr review comments

* Address pr review comments part2

* Fix tag on rtkq

* Remove color for no labels selected text

* Disable already used keys in the labels sub form

* Fix typo

* use the UseFieldArrayRemove type from react-hook-form

* Update some styles and text in the labels modal

* Address some review comments (nits)

* Address review comments part1

* Move logic getting labels in useCombinedLabels hook

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2024-04-23 14:38:31 +02:00
Ashley Harrison
fc45b56d9d
EmptyState: Apply call-to-action variant in core (#86448)
* apply empty state in a bunch of places

* fix unit tests

* put alert back on top

* add data-testids so e2e tests keep working

* remove info boxes

* fix annotations empty state alignment with new maxWidth
2024-04-22 17:01:24 +01:00
Konrad Lalik
7caa30bc2e
Alerting: Add plugins extension point to alerting home page (#85725)
* Add basic extension point to alerting home page

* Remove home page scenes app. Improve plugins styles

* Remove unused code

* Fix home page rendering when no plugins registered

* Add row-based integrations component

* Add missing margins

* Rollback the Box component changes

* Remove unused import
2024-04-22 13:42:11 +02:00
Konrad Lalik
1b930c341d
Alerting: Fix max_alerts field handling (#86651)
Fix max_alerts field parsing
2024-04-22 12:25:04 +02:00
Santiago
9ed616a7b3
Alerting: Fix typo ('Alert manager' -> 'Alertmanager') (#86608)
* Alerting: Fix typo ('Alert manager' -> 'Alertmanager')

* fix front-end test
2024-04-19 20:53:51 +02:00
Konrad Lalik
344cea1725
Alerting: Fix external Alertmanager settings payload (#86413)
* Remove helper properties from the AM config object

* Make the omitTemporaryIdentifiers a pure function

* Add formValuesToCloudReceiver test

* Remove immer produce to prevent object freezing
2024-04-18 15:55:13 +02:00
Tom Ratcliffe
a5c75c5ffb Remove explicit imports of whatwg-fetch from individual test files 2024-04-18 12:23:38 +01:00
Tom Ratcliffe
ab605e37df Remove unnecessary server.listen() 2024-04-18 09:04:53 +01:00
Tom Ratcliffe
ef5c4b69f3 Remove unused msw import 2024-04-18 09:04:53 +01:00
Tom Ratcliffe
de4510cc70 Reuse setupMswServer for alerting tests 2024-04-18 09:04:53 +01:00
Tom Ratcliffe
2674043cef Add whatwg-fetch and fixes to alerting tests that break when polyfill is added 2024-04-18 09:04:53 +01:00
Konrad Lalik
9614126cb7
Alerting: Fix instances link when served from subpath (#86432)
Fix instances link when served from subpath
2024-04-18 08:56:30 +02:00
Konrad Lalik
acd3e83c1c
Alerting: Take receivers into account when custom grouping Alertmanager groups (#86127)
* Take receiver into account when custom grouping Alertmanager alert groups

* Fix and add tests
2024-04-17 08:55:01 +02:00
Brendan O'Handley
f85470d652
Prometheus: Use the frontend package in Prometheus and remove feature toggle (#86080)
* add history links for monaco completion provider folder

* add history links for monaco query field folder

* add history links for components folder

* add history links for configuration folder

* add history links for dashboard json folder

* add history links for gcopypaste folder

* add history link for variableMigration

* add history link for querybuilder/components/metrics-modal folder

* add history link for querybuilder/components/promqail folder

* add history links for querybuilder/components folder

* add history links for querybuilder/hooks folder

* add history links for querybuilder/shared folder

* add history links for querybuilder folder

* add history links for querycache folder

* add history links for src folder

* use frontend package and custom auth in module.ts

* remove files and fix import issues

* remove usePrometheusFrontendPackage

* remove extra files

* update betterer

* remove extra files after rebase

* fix betterer for rebase

* fix e2e flakiness
2024-04-15 16:45:23 -05:00
Tobias Skarhed
f1f02207f2
Alerting: Improve heading accessibility (#85723)
* Change from h5 to Text component

* Fix goworksum error

* Add headings for contact points and notification policies

* Alert group h2

* Reset labels and move h2 to group by

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2024-04-12 16:19:47 +02:00
Tom Ratcliffe
ce5fc59d54 Use ActiveTab type for custom hook 2024-04-12 09:13:29 +01:00
Tom Ratcliffe
ccaf850c09 Refactor to useTabQueryParam 2024-04-12 09:13:29 +01:00
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
94ad66998f Send tab query param through when returning from template save 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
Tom Ratcliffe
a852b70953 Fix console.errors from edit group modal tests 2024-04-10 19:13:41 +01:00
Tom Ratcliffe
fff524b54c Make quick eval buttons in group edit set dirty state on form and handle invalid case 2024-04-10 19:13:41 +01:00
Tom Ratcliffe
584d2bcb91 Remove useEffect that was setting incorrect display value for pending period 2024-04-10 19:13:41 +01:00
Armand Grillet
212acb9bc5
Alerting: clarify alerting silences (#85853)
* Clarify alerting silences

* Update docs/sources/alerting/configure-notifications/create-silence.md

Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>

---------

Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
2024-04-10 18:30:21 +02:00
Ashley Harrison
3c69de6be5
Chore: removing some type assertions (#85839)
* fix some type assertions in loops

* some more cleanup

* some alerting fixes

* put comments in correct place to ignore rule

* couple more

* undo SilencesFilter changes
2024-04-10 14:54:31 +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
Adela Almasan
5f0ca1429b
Annotations: Fix annotation title (#85614) 2024-04-05 17:39:10 -05: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
Gilles De Mey
d3ee3c0a24
Alerting: Evaluation quick buttons (#85010)
Co-authored-by: Tom Ratcliffe <tomratcliffe@users.noreply.github.com>
2024-04-04 16:24:35 +02:00
Gilles De Mey
c41b0a71cf
Alerting: Add state history polling interval (#84837) 2024-04-04 14:06:15 +02:00
Tobias Skarhed
f387cff836
Accessibility: Default Icon to aria-hidden (#84362)
* Icon: aria hide icon, unless a label is set

* Update doc

* Remove weird auto import

* Fix fialing tests

* Add recommendation for Tooltip

* Consider more aria attributes to support Tooltip

* Handle tabIndex and aria-hidden case

* Add comment about aria-label
2024-04-04 12:07:50 +02:00
Tom Ratcliffe
0ec48cfdbd Add success toast for rule update back in 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
d585a5bc88 Rename tag for combined alert rules 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
1fcb264c87 Add InfoPausedRule back to alert detail view 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
20a1955026 Reuse StateTag for Paused state 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
0e87adbc97 Remove await from dispatch 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
ff8203a6cf Forward ref to StateTag so it can work with Tooltip 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
fb40c09eaf Reuse existing mock user method 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
2ca5e43a65 Remove superfluous alert from pause text 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
30471c340a Use verbose mutation from RTKQ for better IDE experience 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
28572102cf Use produce for pause payload generation and return early 2024-04-03 18:38:49 +01:00