12 Commits

Author SHA1 Message Date
2b8c74de2e i18n: removes useTranslate hook (#106556)
* i18n: removes useTranslate hook

* chore: fix duplicate imports

* chore: fix import sorting and hook dependencies
2025-06-12 11:03:52 +02:00
119d5897ea i18n: imports use @grafana/i18n (#105177)
* i18n: everything should target @grafana/i18n

* wip

* chore: updates after PR feedback

* Trigger build

* Trigger build

* Trigger build

* chore: skip flaky tests

* chore: skip flaky tests

* chore: skip flaky tests

* chore: skip flaky tests

* chore: skip flaky tests

* chore: skip flaky tests

* chore: revert all flaky tests

* chore: some incorrect usages of useTranslate
2025-05-15 09:17:14 +02:00
1c5545da04 Internationalisation: Check and mark up tooltip content prop (#104536)
* make lint rule check for "content"

* undo unnecessary translation
2025-04-30 14:40:15 +01:00
3e15459d20 Alerting: Enhance Ruler and Prometheus group synchronization (#99012)
* Add group actions menu

* Refactor modals to accept raw ruler group

* Use prometheus and ruler responses to dispaly GMA rules in the hierarchical view

* Add groups loader component for data source managed rules

* Improve rules matching algorithm for the search results

* Use plus and minus icons for reconciliation state

* loading spinner WIP for operations / transactions

* update comment

* Use ruler rules order when displaying a group, change rurler preload behaviour

* Add ruler-based ordering for GMA rules

* Refactor ruler API mocking

* Refactor rule components to accept ruler only rules

* Add tests for GrafanaGroupLoader

* Add tests for vanilla prom groups

* Unify data matching code, add tests for DS groups loader

* Fix errors after rebasing

* Improve handling of ruler group absence

* Fix cache key

* Add group action buttons for the new group pages

* Add new rule action buttons to the new list page

* Address PR feeback, component renaming, missing translations

* Unify groups and rules links and actions

* Fix new rule button

* Add rule list action buttons tests

* Fix lint errors

* Add redirect to rule details page on save

* Update FilterView tests

* Fix imports and remove unused code

* Improve type definitions, add pooling to Prom hooks, add inline docs

* Remove unused code of group modals

* Update translations

* Disable cache population for filter-view generators

* Add consistency check Alert to the RuleViewer when V2 list is enabled

* Disable UI errors in prom generator

* Improve missing datasouce handling

* Add missing translations

* Improve group loader tests, remove unused code

* Enhance Prometheus API query to include notification options

* Improve error handling, remove consistency check for vanilla prom data sources

* Address PR feedback, add new version of the useHasRuler hook

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2025-04-01 09:58:09 +02:00
c9f563e576 Grafana UI: Use package.json exports for internal code (#101815)
* feat(grafana-ui): introduce development exports to prevent importing from grafana/ui/src

* refactor(theme-generation): move theme templates into scripts so themes continue to build

* refactor(frontend): replace  grafana/ui paths that use nested src with /internal or /unstable

* chore(betterer): update better results file

* feat(grafana-ui): support enterprise, remove Text component from internal

* docs(packages): update readme with exporting code conventions
2025-03-12 14:14:32 +01:00
8055d69ad2 Alerting: Alert list - pagination and filtering part 1 (#96423)
* Add basic token-based paginated fetching

* Add 1:many relation between UI and API pages

* Fix pagination arrows

* Add pagination  to hierarchical view

* Add multidatasource filtering

* Improve flushing filtered rules, add better identifiers

* Fix pagination for data sources not supporting server side pagination

* Use alert rule loader on the filter view

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>

* use useTransition and update loader

* types

* Update ruleGruopIdentifier. Add actions and location to recording rules

* Update to the new API parameters

* Refactor iterator code

* Use ix to merge iterators

* Improve perf

* use AbortController to cancel loading pages

* remove iterops for now

* add comments

* add application and rulesource information to list view

* update test

* update list view functionality

* add emptystate

* automatically load more items when we get to the bottom of the page

* reduce number of loaders

* separate hook for useFilteredRulesIteratorProvider

* use useDeepCompareEffect to track filter state changes

* fix weird no results loading glitch

* fix rare case where changing filters wouldn't update the list

* add number of results to component

* Simplify FilterView rerendering

* add filter for dashboard

* Add tests for filtered view, use data source UID instead of names in the interator code

* Improve HTML semantics, extract a separate GroupedView component

* Split RuleList.v2 into multiple files

* Split tests into Filtered and Grouped view files

* PR feedback

* Improve error handling, add tests for GroupedView

* Improve types, small refactoring

* Improve rules setup

* Small improvements, v1 and v2 versions of the view type selector

* Remove yarn cache changes

* Import from test-utils

* Move groupIdentifiers, improve state param parsing

* reorder imports

* reorder imports

* update yarn resolution

* i18n

* Improve API mock, increase timeout limit

* Add tests for RuleList.v2

* Update tests

* Fix mocks in test

* Fix lint

* Fix data sources mock

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
2024-12-12 14:18:52 +01:00
b73ab15878 Alerting: New list view (Part 1) (#95039)
* initial commit

* update styles

* wip

* update list view

* update translations

* abstract components

* metadata separator

* refactor

* cleanup

* fix tests

* WIP

* translations

* refactor to use maps and type-safety

* WIP

* UI updates

* Rule action buttons early draft

* recording rules

* WIP typescript errors

* implement action button loading

* move section loader etc

* add placeholder for group actions

* Change files structure, remove CombinedRule from AlertRuleMenu

* Refactor fetching data sources with ruler

* Fix tests

* Unify data source features

* move files

* make actions column wider

* update translations

* Update tests to reflect code changes

* Remove direct buildinfo usages

* Fix useCanSilence hook

* Add missing translations, fix lint errors

* PR feedback

* update test

* Remove featureDiscovery mock from a test

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2024-11-18 10:48:15 +01:00
c42f42223a Alerting: New alert state list view (#94068) 2024-10-24 15:37:42 +03:00
8c702d4a6b Plugin extensions: Make sure core features use new hooks (#92723)
* use new extensions APIs across grafana core

* setup setPluginLinksHook

* fix tests

* fix mock

* fix more broken tests

* use plugin components hook

* remove unused func

* fix tests

* remove unused import
2024-09-13 09:23:18 +02:00
47f8717149 React: Use new JSX transform (#88802)
* update eslint, tsconfig + esbuild to handle new jsx transform

* remove thing that breaks the new jsx transform

* remove react imports

* adjust grafana-icons build

* is this the correct syntax?

* try this

* well this was much easier than expected...

* change grafana-plugin-configs webpack config

* fixes

* fix lockfile

* fix 2 more violations

* use path.resolve instead of require.resolve

* remove react import

* fix react imports

* more fixes

* remove React import

* remove import React from docs

* remove another react import
2024-06-25 12:43:47 +01:00
1cf1c5f03a Alerting: Add hide plugins rules filter (#87445)
* Add hide plugins rules filter

* Change the filter label and available values

* Setup plugins hook in tests

* Fix lint errors

* remove unused code
2024-05-15 14:09:56 +02:00
9369f07e32 Alerting: Immutable plugin rules and alerting plugins extensions (#86042)
* Add pluginsApi

* Add rule origin badge

* Make plugin provided rules read-only

* Add plugin settings caching, add plugin icon on the rule detail page

* Add basic extension point for custom plugin actions

* Add support for alerting and recording rule extensions

* Move plugin hooks to their own files

* Add plugin custom actions to the alert list more actions menu

* Add custom actions renderign test

* Add more tests

* Cleanup

* Use test-utils in RuleViewer tests

* Remove __grafana_origin label from the label autocomplete

* Remove pluginsApi

* Add plugin badge tooltip

* Update tests

* Add grafana origin constant key, remove unused code

* Hide the grafana origin label

* Fix typo, rename alerting extension points

* Unify private labels handling

* Add reactive plugins registry handling

* Update tests

* Fix tests

* Fix tests

* Fix panel tests

* Add getRuleOrigin tests

* Tests refactor, smalle improvements

* Rename rule origin to better reflect the intent

---------

Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
2024-04-30 10:34:52 +02:00