53 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
abb885c585 I18n: Move eslint rule to package (#105860) 2025-05-29 16:11:59 +02:00
7bfa78c6e6 I18n: Update eslint rule to catch some untranslated object properties (#105072) 2025-05-28 21:14:43 +01: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
a2b06e2ec9 Internationalisation: More markup (#103970)
* more markup!

* fix tests

* use times symbol
2025-04-15 10:05:03 +01:00
dc5badd9b2 Internationalisation: More automatic markup (#102792)
* more automatic i18n markup

* better labels

* little bit of tidy up

* fix unit tests
2025-03-27 10:12:25 +00:00
1ca9910736 Grafana Data: Use package.json exports for internal code (#102696)
* refactor(frontend): rename all @grafana/data/src imports to @grafana/data

* feat(grafana-data): introduce internal entrypoint for sharing code only with grafana

* feat(grafana-data): add test entrypoint for data test utils usage in core

* refactor(frontend): update import paths to use grafana/data exports entrypoints

* docs(grafana-data): update comment in internal/index.ts

* refactor(frontend): prefer public namespaced exports over re-exporting via internal

* chore(frontend): fix a couple more weird paths that typescript complains about
2025-03-25 10:48:36 +01:00
7f9fa8c662 Grafana UI: Clearly separate multiple warnings by using HTML tags (#97979)
* Allow html in tooltips

* Display multiple warnings/infos properly with html

* Revert "Allow html in tooltips"

This reverts commit 5c7e965d2d554b693d4897e52cf6865e0c9b8374.

* Display multiple warnings/infos properly with html in ReactNode

* Fix lint

* Revise according to code review

* Revise according to code review part 2

* Revise according to code review part 3
2025-03-19 07:05:53 +01:00
5cd8547131 Revert "Grafana Data: Use package.json exports for internal code (#102286)
Revert "Grafana Data: Use package.json exports for internal code (#102036)"

This reverts commit 91116de790c6c59248abd262721c40f169be6661.
2025-03-17 12:26:59 +00:00
91116de790 Grafana Data: Use package.json exports for internal code (#102036)
* refactor(frontend): rename all @grafana/data/src imports to @grafana/data

* feat(grafana-data): introduce internal entrypoint for sharing code only with grafana

* feat(grafana-data): add test entrypoint for data test utils usage in core

* refactor(frontend): update import paths to use grafana/data exports entrypoints

* docs(grafana-data): update comment in internal/index.ts

* refactor(frontend): prefer public namespaced exports over re-exporting via internal
2025-03-17 11:27:17 +01:00
f3433fd472 RBAC: Remove accessControlOnCall feature toggle (#101222)
* RBAC: Remove accessControlOnCall feature toggle

* Leave the other one in place

* Tests

* frontend

* Readd empty ft to frontend test

* Remove legacy RBAC check

* Fix test

* no need for context

* Remove unused variable

* Remove unecessary param

* remove unecessary param from tests

* More tests :D
2025-02-25 13:44:40 +01:00
8a8e47fcea PluginExtensions: Added support for sharing functions (#98888)
* feat: add generic plugin extension functions

* updated betterer.

* Fixed type issues after sync with main.

* Remved extensions from datasource and panel.

* Added validation for extension function registry.

* Added tests and validation logic for function extensions registry.

* removed prop already existing on base.

* fixed lint error.

---------

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2025-02-13 10:18:55 +01:00
3589d9192d chore: use IRM plugin ID instead of OnCall / Incident if it's present… (#99742)
* chore: use IRM plugin ID instead of OnCall / Incident if it's present in the stack

* minor improvements

* fix unit tests

* Add IRM plugin discovery tests

---------

Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
2025-01-30 16:00:23 +01:00
cce943b3af Plugin Extensions: Only load app plugins when necessary (#86624)
* feat(plugins): automatically preload plugins

This PR enables auto-preloading for plugins when they are used
by an extension or extension-point. Once this change is merged plugins
that were only using "preload: true" in their plugin.json for using extensions
can remove it.

* fix: remove unused types

* fix: call `setComponentsFromLegacyExports()` after meta is initialised
2024-11-29 14:05:55 +01:00
7fe710b141 Routing: Update AppRootPage (#95052)
* Update router

* Fix rendering case

* Switch useLocation

* Remove redundant await
2024-10-24 10:50:48 +03:00
d730c66579 Routing: Remove useRouteMatch hook (#94152)
* Update useSilenceNavData.ts

* Update MuteTimings

* Update AppRootPage.tsx

* Cleanup props

* Remove empty file
2024-10-07 08:21:44 +03:00
586c95654d Routing: Update more components using props.match to use hooks (#93918)
* RuleViewed: Get params from hook

* ProviderConfigPage: Use hooks for redux logic

* Update NewDashboardWithDS

* Update StorageFolderPage

* Update StoragePage

* Cleanup

* Update PublicDashboardPage

* Update RuleEditor

* Update BrowseFolderAlertingPage

* Update BrowseFolderLibraryPanelsPage

* Update SoloPanelPage

* Fix test

* Add useParams mocks

* Update ServiceAccountPage

* Simplify mocks

* Update SignupInvited

* Update Playlist pages

* Update AdminEditOrgPage

* Update UserAdminPage

* Update Silences

* Update BrowseDashboardsPage

* Update GrafanaModifyExport

* Update AppRootPage

* Remove useParams mock

* Update PublicDashboardsPages

* Cleanup

* Update PublicDashboardPage.test

* Cleanup

* Update PublicDashboardScenePage.test.tsx

* Update imports

* Revert AppRootPage changes

* Add back AppRootPage changes
2024-10-01 16:29:11 +03:00
831493278f UI Extensions: Share the registries using a React context (#92014)
* feat: add a context for the extension registries

* feat: add a provider for registries to `AppWrapper`

* feat(extensions): add a read-only registry version

* feat: share the registry for exposed components using the context

* fix: tests

* feat: share the registry for added components using the context

* feat: share the addedLinks registry using react context

* use read-only registry versions
2024-09-10 10:42:07 +02:00
5e2ac24890 Sidecar: Add split view and basic APIs for extensions (#91648)
* Add split view and basic APIs to extensions

* Add comments

* Update public/app/AppWrapper.tsx

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>

* Moved the .grafana-app element and deduplicate some code

* Remove the provider variants of usePluginLinks/Components

* Change buildPluginSectionNav

* Update comment

* Use eventBus

* Remove non existent exports

* refactor: use a sidecar service to encapsulate the state

* Don't wrap single app in split wrapper

* Use hook splitter

* Remove inline styles

* Type the style props from useSplitter

* Move the overflow style changes to appWrapper

* Deduplicate some common top level providers

* Move modals

* Move routes wrappers to it's own file

* Use better css and add comments

* Remove query rows app extension point

* Fix test

---------

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2024-09-09 14:45:05 +02:00
adf1402ff8 Grafana/ui: Update Link component to react router 6 (#92976)
* Grafana/ui: Update Link component to react router 6

* Add compat package to grafana/ui
2024-09-09 13:54:43 +03:00
a1182b119e Chore: Remove deprecated layout components from Plugins Platform (#88523)
* Chore: Remove deprecated layout components from Plugins Platform

Resolves #86878

* Chore: Use `Box` instead of `div`
2024-07-23 14:16:26 +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
Jo
c5d1b295ec Plugins: Allow plugin page access granting via permissions (#82508)
* AccessControl: Check permissions on AppRootPage

* add frontend tests for app root permission checks

* add accesscontrol oncall ft to tests
2024-02-16 09:36:52 +01:00
572c182a81 Unify frontend monitoring (#80075)
* Unify frontend monitoring

* Add missing mock

* Add missing mock

* Keep source:sandbox

* Create separate logger for plugins/sql package

* chore: rename "logAlertingError" to "logError"

* Use internal Faro logging for debugging instead of redundant browser logging

* Post-merge fix

* Add more docs about debug levels

* Unify logger names

* Update packages/grafana-runtime/src/utils/logging.ts

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>

* Update packages/grafana-runtime/src/utils/logging.ts

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
2024-02-01 15:08:40 +01:00
5c67c4b082 Chore: Log error from App loading in console and faro (#79977)
* Chore: Log error from App loading in console and faro

* Add error spy for console
2024-01-03 15:51:31 +01:00
46142da4db Chore: Migrate from aria-label to data-testid in plugin-related tests (#79272)
* Update basicsettings for datasource

* Change aria-label for data-testid

* Update more tests

* Update betterer

* Remove unnecessary data-testid

* Put back aria label for some datasource selectors

* Try to use data-testid with alerts

* Update betterer
2023-12-11 15:05:54 +01:00
ea2b493937 Plugins: Share the plugin context with apps and ui-extensions (#77933)
* feat: share the plugin context with app plugins

* feat: share the plugin context ui-extension modals

* feat: pre-fetch the app plugin settings

* feat: expose more utility hooks for plugins

* fix: use `location.pathname` directly

Previously it was referenced by `pluginRoot.props.path`, which stops
working in case the `pluginRoot` element is wrapped with anything.
2023-11-14 08:35:40 +01:00
3a4f73338c Plugins: Show a not found error page when accessing an app for a not-found plugin (#77922)
* Plugins: Shows a not found error page when accesing an app for a non-found plugin

* Use loadingError in state to verify is a loading error
2023-11-09 15:33:25 +01:00
5108430aec Datasources: Filter plugin errors to only show datasource plugins (#74339)
* feat(plugins): allow filtering of plugin errors by plugin type

* refactor(plugins): migrate PluginsErrorsInfo component to use Alert component

* chore(plugins): remove redundant d3 import

* feat(datasources): filter plugin errors by plugin type

* refactor(plugins): pass plugin.type from selector rather than guess from pluginId

* refactor(plugins): move filtering to selector
2023-10-03 15:54:49 +02:00
44bf663942 Plugins: Check if the user has permissions to access the plugin custom page (#74664)
* Check if the user has permissions to access the plugin custom page

* If plugin does not have includes we should show the plugin

* chngaes after review, added the test for AppRootPage

* fix the type error

* add more test cases

* test: wrap location pushes to act() calls

* Add no existing role to test

* fix name of the test

* fix not existing role test

---------

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-09-14 16:38:33 +02:00
5099e88227 Transformation redesign (#70834)
Transformation redesign
2023-07-12 18:35:49 +02:00
ba92f6f98a AppRootPage: Reduce flickering while loading plugin (#66799)
* AppRootPage: Reduce flickering while loading

* Use current layout
2023-04-19 12:10:57 +02:00
4abe0249ba Chore: Clean up old navigation (#66287)
* remove code outside of the topnav feature flag

* delete NavBar folder

* remove topnav toggle from backend

* restructure AppChrome folder

* fix utils mock

* fix applinks tests

* remove tests since they're covered in e2e

* fix 1 of the approotpage tests

* Fix another dashboardpage test

* remove reverse portalling + test for plugins using deprecated onNavChanged method

* kick drone

* handle correlations
2023-04-14 09:43:11 +01:00
093498a03b Angular: Prevent angular from loading when disabled (#65755)
* Angular: Prevent angular from loading when disabled

* remove stuff
2023-04-03 10:45:22 +02:00
d710507bc5 Chore: Avoid explicit React.FC<Props> when possible (#64722) 2023-03-14 16:38:21 +02:00
f8d89eff56 Chore: fix type errors in tests (#63270)
* fix any's in tests

* fix more any's in tests

* more test type fixes

* fixing any's in tests part 3

* more test type fixes

* fixing test any's p5

* some tidy up

* fix template_srv
2023-02-14 16:46:42 +01:00
cd99bfec68 TopNav: Fixes breadcrumb issues and title for apps when topnav is disabled (#61835) 2023-01-23 11:03:28 +01:00
c3c4a57c79 grafana/data: Move getPanelOptionsWithDefaults from core (#60813)
* grafana/data: Move getPanelOptionsWithDefaults from core

* Add internal comments
2022-12-29 05:48:22 -08:00
c093a471e6 AppRootPage: Fix passing the queryParams (#58912)
* fix(AppRootPage): push the query params properly

* refactor: remove unnecessary changes in AppRootPage

* refactor(AppRootPage): use existing utility function
2022-11-17 10:09:06 -05:00
eb3ee35e1c Frontend Routing: Always render standalone plugin pages using the <AppRootPage> (#57771)
* chore: fix go lint issues

* feat(Routing): route standalone plugin pages to the `AppRoutePage`

* feat(plugin.json): introduce a new field called `isCorePage` for `includes`

* chore: add explanatory comments for types

* refactor(AppRootPage): receive the `pluginId` and `pluginSection` through the props

Now we are able to receive these as props as the pluginId is defined on navLinks
that are registered by plugins.

* chore: update teests for AppRootPage

* fix: remove rebase issue

* tests(applinks): add a test for checking isCorePage plugin page setting

* refactor(applinks): update tests to use FindById() and be more resilient to changes

* fix: Go lint issues

* refactor(routes): use cleaner types when working with plugin nav nodes

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

* chore: fix linting issues

* t: remove `isCorePage` field from includes

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2022-11-07 15:19:31 +01:00
a8c181bf6a Chore: Migrate usage of v1 theme to v2 (#58154) 2022-11-03 18:15:55 +00:00
b49713d323 Chore: Remove unused files (#57515) 2022-10-25 23:34:53 +01:00
dd9e1498f9 only render direct children on the landing page routes (#56720) 2022-10-12 10:01:33 +01:00
b4f73c9f09 PluginPages: Support plugin pages that don't belong to a section (#55904)
* Fixing pages that don't exist in navtree

* Fix test

* fix lint warning

* Fixes
2022-09-29 13:27:51 +02:00
e31cb93ec0 NavTree: Make it possible to configure where in nav tree plugins live (#55484)
* NewIA: Plugin nav config

* progress

* Progress

* Things are working

* Add monitoring node

* Add alerts and incidents

* added experiment with standalone page

* Refactoring by adding a type for navtree root

* First test working

* More tests

* more tests

* Progress on richer config and sorting

* Sort weight working

* Path config

* Improving logic for not including admin or cfg nodes, making it the last step so that enterprise can add admin nodes without having to worry about the section not existing

* fixed index routes

* removed file

* Fixes

* Fixing tests

* Fixing more tests and adding support for weight config

* Updates

* Remove unused fake

* More fixes

* Minor tweak

* Minor fix

* Can now control position using sortweight even when existing items have no sortweight

* Added tests for frontend standalone page logic

* more tests

* Remove unused fake and fixed lint issue

* Moving reading settings to navtree impl package

* remove nav_id setting prefix

* Remove old test file

* Fix trailing newline

* Fixed bug with adding nil node

* fixing lint issue

* remove some code we have to rethink

* move read settings to PrivideService and switch to util.SplitString
2022-09-28 08:29:35 +02:00
11de1dfe40 TopNav: Plugin page layouts / information architecture (#53174)
* Change nav structure when topnav is enable to do initial tests with new information architecture

* Support for nested sections

* Updated

* sentance case

* Progress on plugin challange

* Rewrite to functional component

* Progress

* Updates

* Progress

* Progress on things

* missing file

* Fixing issue with runtime, need to use setter way to set component exposed via runtime

* Move PageLayoutType to grafana/data

* Fixing breadcrumb issue, adding more tests

* reverted backend change

* fix recursive issue with cleanup
2022-09-05 14:56:08 +02:00
e5fba788d6 AppRootPage: Fixes issue navigating between two app plugin pages (#54519)
* AppRootPage: Fixes issue where it was not possible to navigate to another plugin

* Externalize react-router

* fixing test
2022-08-31 15:36:08 +02:00
b782d9aa12 GrafanaContext: Exploring a way to get rid of global scope singletons (#52128)
* Context start

* More progress on more generic react context for services

* Update

* Update Page test

* Fixing tests

* Moving to core app
2022-07-23 17:09:03 +02:00
4eb0a8a98e Plugins: Fixes navigation between different plugin pages (#52571) 2022-07-23 13:38:14 +02:00
1e85a6f4fd TopNav: New page layouts (#51510)
* First stab at new page layouts behind feature toggle

* Simplifying PageHeader

* Progress on a new model that can more easily support new and old page layouts

* Progress

* rename folder

* Progress

* Minor change

* fixes

* Fixing tests

* Make breadcrumbs work

* Add tests for old Page component

* Adding tests for new Page component and behavior

* fixing page header test

* Fixed test

* AppChrome outside route

* Renaming folder

* Minor fix

* Updated

* Fixing StoragePage

* Fix for banners

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-07-06 17:00:56 +02:00