Commit Graph

404 Commits

Author SHA1 Message Date
Gilles De Mey
87cba8836f
Alerting: Expressions pipeline redesign (#54601) 2022-10-05 14:35:15 +02:00
Torkel Ödegaard
aa274500cf
TopNav: Fixes to page and plugin page handling (#56278)
* Added labels

* App page fixes

* Switch to switch

* Fixing sort position for Apps
2022-10-05 11:46:27 +02:00
Leo
4eea5d5190
Navigation: Use navid and pagnav in alert rules pages (#55722)
* add navid and pagenav to edit/add/view alert rules

* move ruleeditor smaller component to its own file

* fix form alignments with new layout

* fixed broken test

* reuse AlertingPageWrapper
2022-10-04 14:36:36 +02:00
Levente Balogh
cc6fae18db
BackendSrv: Make it possible to pass options to .get|post|patch... methods (#51316)
* feat: make it possible to pass in `options` to `.get()`, `.post()`, etc methods

* feat(Datasource): make it possible to specify `optinos` for `getResource()` and `postResource()`

* fix(BackendSrv): use partial `BackendSrvRequest`

* feat(Datasource): make it possible to set `options` for resource requests

* refactor(BackendSrv): remove internal usage of `.request()`

* fix(GettingStarted): remove unnecessary import

* fix: fix type issues by typing the delete dashboard response

* refactor: use more strict types for `params`

By reusing the type of `BackendSrvRequest.params`

* refactor: make the options paramater partial

* fix: extract `data` from the fetch response

* docs: update the deprecation notice or `BackendSrv.request()`

* refactor: use `.request()` as if it was private

* refactor: remove unnecessary change
2022-10-04 10:40:21 +02:00
renovate[bot]
bcd1c48a4d
Update dependency rollup-plugin-esbuild to v4.10.1 (#56191)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-03 16:27:37 +01:00
renovate[bot]
8f578d18ce
Update dependency rollup to v2.79.1 (#56187)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-03 16:42:55 +02:00
Jack Westbrook
b81f90cd0c
Toolkit: Fix script failures due to missing import paths (#55857)
* fix(toolkit): package without dist folder so config file paths are correct

* chore(packages): make sure to bundle readme, changelog and apache2 license

* refactor(packages): recursively copy src when prepacking toolkit

* chore(toolkit): lock down babel dependencies. use grafana-eslint-config@5 for TS4.8 support
2022-09-28 17:04:55 +02:00
Tania
4a4201ec92
Chore: Update versions (#55813) 2022-09-27 14:07:16 +02:00
Josh Hunt
d014a3a09b
Echo: Add support for Google Analytics 4 (#55446)
* user essentials mob! 🔱

lastFile:public/app/core/services/echo/backends/analytics/GA4Backend.ts

* user essentials mob! 🔱

* user essentials mob! 🔱

lastFile:public/app/core/services/echo/backends/analytics/GA4Backend.ts

* user essentials mob! 🔱

lastFile:public/app/core/services/echo/backends/analytics/GA4Backend.ts

* user essentials mob! 🔱

lastFile:public/app/app.ts

* user essentials mob! 🔱

Co-authored-by: eledobleefe <laura.fernandez@grafana.com>
Co-authored-by: Leodegario Pasakdal <leodegario.pasakdal@grafana.com>
2022-09-20 03:13:14 -07:00
Jo
3e2e9f93b9
Auth: Allow admins to manually change oauth user role if oauth_skip_org_role_update_sync is enabled (#55182)
* Auth: Allow admins to change oauth user info it it's not synced.

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

* Update public/app/features/admin/UserAdminPage.tsx

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

* Add missing import

* Simplify init

Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

* SAML: Add option to skip org role sync (#55230)

* SAML: Add option to skip org role sync

* Modify frontend accordingly

* Remove update from config option name

Co-authored-by: Jguer <joao.guerreiro@grafana.com>

* Remove update from config option name

Co-authored-by: Jguer <joao.guerreiro@grafana.com>

* Fix typo

Co-authored-by: Jguer <joao.guerreiro@grafana.com>

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
Co-authored-by: gamab <gabi.mabs@gmail.com>
Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
2022-09-15 12:06:09 -04:00
Marcus Andersson
c95b530502
DataSource: Adding possibility to hide queries from the inspector (#54892)
* adding the possibility to hide queries when they are executed via the DataSourceWithBackend.query
2022-09-13 13:27:16 +02:00
kay delaney
4c7732ad17
Chore: Upgrade Typescript to 4.8.2 (#54901)
* Chore: Upgrade typescript to 4.8.2
2022-09-09 16:17:58 +01:00
renovate[bot]
ad19f018a9
Update dependency esbuild to v0.15.7 (#54928)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-09 10:56:49 +01:00
Torkel Ödegaard
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
Timur Olzhabayev
b5b41988cf
Docs: Deprecating packages_api and removing it from our pipelines (#54473) 2022-09-01 18:15:44 +02:00
Giordano Ricci
26524e3ff1
GrafanaUI: Fix styles for invalid selects & DataSourcePicker (#53476)
* GrafanaUI: fix styles for invalid select & DataSourcePicker

* Apply suggestions from code review

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* fix focus issues & tests

* remove unused import

* TypeScript work in progress

* Move react select props to types.ts

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: eledobleefe <laura.fernandez@grafana.com>
Co-authored-by: joshhunt <josh@trtr.co>
2022-08-26 13:48:51 +01:00
renovate[bot]
6f72c4d10d
Update dependency @testing-library/user-event to v14.4.3 (#54292)
* Update dependency @testing-library/user-event to v14.4.3

* use ReturnType instead of using a nested import

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-08-26 13:30:34 +01:00
Karl Persson
4ff4aaab23
RBAC: Remove builtin role code (#53767)
* remove rbacBuiltInRoleAssignmentEnabled from frontendsettings

* RBAC: Remove RBACBuiltInRoleAssignmentEnabled

* RBAC: Remove code for builtin role

* RolePicker: Remove unused prop

* RolePicker: Rename builtinRole to basicRole

* RolePicker: Rename onBuiltinRoleChange to onBasicRoleChange

* RolePicker: Rename properties
2022-08-18 12:25:37 +02:00
Ivan Ortega Alba
38c690ecb0
Revert "Analytics: Use Fullstory to get behavioral data (#53732)" (#53762)
This reverts commit 961479b111.
2022-08-16 12:45:14 +02:00
Ivan Ortega Alba
961479b111
Analytics: Use Fullstory to get behavioral data (#53732) 2022-08-16 10:32:00 +02:00
Andres Martinez Gotor
a31d96d20a
Prometheus: Promote Azure auth flag to configuration (#53447) 2022-08-11 16:12:57 +02:00
owensmallwood
dc23643bee
Public Dashboards: Usage Insights (#52768) 2022-08-10 14:14:48 -03:00
kay delaney
1772bd4238
Chore: Reduce usage of v1 theme (#53245) 2022-08-08 16:37:06 +01:00
Jack Westbrook
d87bf30e9e
Build: Introduce ESM and Treeshaking to NPM package builds (#51517)
* Revert "Chore: Bump terser to fix security vulnerability (#53052)"

This reverts commit 7ae74d2a18.

* feat: use tsc and rollup directly with esbuild and publishConfig, files props

* refactor(grafana-data): fix isolatedModules re-export type error

* refactor(grafana-data): import paths from src not package name

* refactor(rollup): fix dts output.file

* chore(grafana-schema): delete dashboard_experimental.gen.ts - cannot work with isolatedModules

* refactor(grafana-e2e-selectors): fix export types isolatedModules error

* refactor(grafana-runtime): fix isolatedModules re-export type error

* refactor(grafana-ui): fix isolatedModules re-export type error

* feat(grafana-ui): use named imports for treeshaking

* refactor(grafana-ui): use named imports for treeshaking

* feat: react and react-dom as peerDeps for packages

* feat(grafana-ui): emotion packages as peerDeps

* feat(grafana-e2e): use tsc, rollup, esbuild for bundling

* chore(packages): clean up redundant dependencies

* chore(toolkit): deprecate unused package:build task

* chore(schema): put back dashboard_experimental and exclude to prevent isolatedModules error

* docs(packages): update readme

* chore(storybook): disable isolatedModules for builds

* chore: relax peerDeps for emotion and react

* revert(grafana-ui): put @emotion dependencies back

* refactor: replace relative package imports with package name

* build(packages): set emitDeclaration false for typecheck scripts to work

* test(publicdashboarddatasource): move test next to implementation. try to appease the betterer gods

* chore(storybook): override ts-node config for storybook compilation

* refactor(grafana-data): use ternary so babel doesnt complain about expecting flow types

* chore(toolkit): prefer files and publishConfig package.json props over copying

* build(npm): remove --contents dist arg from publishing commands

* chore(packages): introduce sideEffects prop to package.json to hint package can be treeshaken

* chore(packages): remove redundant index.js files

* feat(packages): set publishConfig.access to public

* feat(packages): use yarn berry and npm for packaging and publishing

* refactor(packages): simplify rollup configs

* chore(schema): add comment explaining need to exclude dashboard_experimental

* revert(toolkit): put back clean to prevent cli failures

* ci(packages): run packages:pack before a canary publish

* chore(gitignore): add npm-artifacts directory to ignore list

* test(publicdashboarddatasource): fix module mocking

* chore(packages): delete package.tgz when running clean

* chore(grafana-data): move dependencies from devDeps to prevent build resolution errors
2022-08-03 15:47:09 +02:00
Ieva
67d817ff48
update versions (#53167) 2022-08-02 11:55:46 -04:00
Josh Hunt
eaf6aea98f
Typed variables pt1: Use discriminated union for variable model (#52981)
* wip

* make diff easier to read

* Update template_srv getVariables to return new TypedVariableModel

* update VariableType to use the type from TypedVariableModel

* tidy things up
2022-08-02 10:15:25 +01:00
Konrad Lalik
f877f79bbc
Alerting: Show evaluation interval global limit warning (#52942)
Co-authored-by: George Robinson <george.robinson@grafana.com>
2022-08-01 15:01:14 +02:00
renovate[bot]
a4355bd6e4
Update Monthly patch updates (#52885)
* Update Monthly patch updates

* ignore updates to lezer-logql and @types/slate

* update lockfile

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-07-27 16:02:48 +01:00
Jo
c2d3c90bc8
Auth: Implement Token URL JWT Auth (#52662)
* Auth: check of auth_token in url and resolve user if present

* check if auth_token is passed in url

* Auth: Pass auth_token for request if present in path

* no need to decode token in index

* temp

* use loadURLToken and set authorization header

* cache token in memory and strip it from url

* Use loadURLToken

* Keep token in url

* strip sensitive query strings from url used by context logger

* adapt login by url to jwt token

* add jwt iframe devenv

* add jwt iframe devenv instructions

* add access note

* add test for cleaning request

* ensure jwt token is not carried into handlers

* do not reshuffle queries, might be important

* add correct db dump location

* prefer set token instead of cached token

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2022-07-27 16:10:47 +02:00
renovate[bot]
290b2e1ed0
Update grafana monorepo to v0.4.0 (#52805)
* Update grafana monorepo to v0.4.0

* update mock

* actually mock...

* typescript is hard...

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-07-27 09:21:13 +01:00
renovate[bot]
4d7e26abfd
Update dependency rollup to v2.77.1 (#52786)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-26 11:33:24 +01:00
kay delaney
c35c3abaa3
Chore: Bump typescript version to 4.7.4 (#52325)
* Chore: Bump typescript version to 4.7.4

* Bump related packages

* Revert eslint-plugin-react upgrade
2022-07-25 13:47:59 +01:00
renovate[bot]
044d8315de
Update dependency @testing-library/user-event to v14.3.0 (#52690)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-25 10:11:42 +01:00
Torkel Ödegaard
7947629f82
TopNav: Make dashboard toolbar actions work in new top nav (#51950)
* Initial work on new toolbar button

* Minor step

* Small progress

* Minor progress

* Minor fix

* removed console.log

* Removing stuff we don't need yet
2022-07-14 20:34:00 +02:00
owensmallwood
2aff83d4e1
Public Dashboards Bug: Permissions error on panel when using mixed datasource with Enterprise (#51930)
Fixes pubdash bug for enterprise when pubdash panel uses a mixed datasource
2022-07-07 15:58:11 -06:00
Torkel Ödegaard
935334cbda
Scene: POC for a future dashboard model and runtime (#50980)
* Playing around

* This is getting interesting

* Updates

* Updated

* Observable experiments

* This is tricky

* VizPanel panel renderer

* New model progress

* Maybe this could be something

* Updated

* Rename

* updates

* Updated

* Query runners? not sure

* Updated

* updates

* flex box layout starting to work

* Testing

* Tested an action

* Parent context sort of working

* Progress

* Progress

* Updated

* Starting to work

* Things are working

* Scene list, nested scene demo

* Progress on repeats

* Moving things

* Pretty big progress

* More things working

* Great progress

* Progress

* Name changing

* Minor tweaks

* Simplified sizing

* Move toggleDirection to SceneFlexLayout

* add feature flag (#50990)

* removed new useObservable hook

* Rename folder and feature toggle to scenes

* Caching scenes so you can go back to another scene without having to re-query data

* Fix issue with subs on re-mount

* Fixing test

* Added SceneCanvasText to play around with layout elements with size based on content

* Scene: Edit mode and component edit wrapper that handles selection  (#51078)

* First step for scene variables

* Started playing around with a scene edit mode

* Better way to set component

* Progress on edit mode

* Update

* Progress on edit mode

* Progress on editor

* Progress on editor

* Updates

* More working

* Progress

* Minor update

* removed unnessary file

* Moving things around

* Updated

* Making time range separate from time picker

* minor rename of methods

* The most basic variable start

* Minor renames

* Fixed interpolate issue if not found at closest level

* An embryo of event model and url sync handling

* Update url sync types

* Removed unnessary any type arg

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2022-07-07 08:53:02 +02:00
owensmallwood
0b4af38bfa
Public Dashboards: Query Caching (#51403)
* passes id and uid to PublicDashboardDatasource

* betterer results

* If for a public dashboard, return the PublicDashboardDataSource first or else getDatasourceSrv.get() will fail bc of no authed user.

Added some unit tests for resolving the uid from the many possible datasource types.

* updates betterer

* Exports DashboardService. Adds method to DashboardService to build anonymous user for use with public dashboards where there is no authed user. Adds method on dashboard_queries to get all dashboard uids from a dashboard.

* refactors to get unique datasource uids

* Adds tests for getting all unique datasource uids off a dashboard

* adds test for building anonymous user with read and query actions that are scoped to each datasource uid in the dashboard

* updates casing of DashboardService

* updates test case to have additional panel with a different datasource

* gives default interval to public dashboard data source
2022-07-06 12:42:39 -06:00
Ryan McKinley
281ed419a8
Chore: add generics to backendSrv (#51606) 2022-06-30 14:34:23 -04:00
Michael Mandrus
7ef21662f9
Plugins: Show that Secrets Manager Plugin is active in the UI (#50953)
* add special handling on the plugin gathering side to check whether secrets manager plugins are enabled or not

* show disabled badge in front end if the plugin is not enabled

* Only show error in disabled badge hover if one is present (otherwise it shows "undefined")

* refactor to make use of fields already available in the DTO

* fix typo

* if there is no error returned for the plugin, just show 'disabled'

* fix typo

* Update public/app/features/plugins/admin/components/Badges/PluginDisabledBadge.tsx

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

* Update frontendsettings.go

add clarifying comment

* fix unit test

* rework task to use new frontend property combined with plugin type to determine if the plugin should be disabled

* Update helpers.test.ts

revert test change

* fix unit test

* bogus commit to trigger precommit

* undo commit

* run precommit manually

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2022-06-29 08:48:23 -04:00
Timur Olzhabayev
7c886fb6f9
Frontend Logging: Integrate grafana javascript agent (#50801)
Add Grafana Javascript Agent integration to Grafana
2022-06-28 03:25:30 -04:00
Jeff Levin
d076bedb5e
public dashboards: finalize db schema & v1 feature complete (#50467)
This PR completes public dashboards v1 functionality and simplifies public dashboard conventions. It exists as a large PR so that we are not making constant changes to the database schema.

models.PublicDashboardConfig model replaced with models.PublicDashboard directly
dashboard_public_config table renamed to dashboard_public
models.Dashboard.IsPublic removed from the dashboard and replaced with models.PublicDashboard.isEnabled
Routing now uses a uuid v4 as an access token for viewing a public dashboard anonymously, PublicDashboard.Uid only used as database identifier
Frontend utilizes uuid for auth'd operations and access token for anonymous access
Default to time range defined on dashboard when viewing public dashboard
Add audit fields to public dashboard

Co-authored-by: Owen Smallwood <owen.smallwood@grafana.com>, Ezequiel Victorero <ezequiel.victorero@grafana.com>, Jesse Weaver <jesse.weaver@grafana.com>
2022-06-22 13:58:52 -08:00
Josh Hunt
26f6b91fd9
Chore: Type GA and Rudderstack analytics config (#51197)
* Chore: Type GA and Rudderstack analytics config

* rely on implicit unknown
2022-06-22 09:27:55 +01:00
Josh Hunt
98132fc7dc
Remove as any from requireActual usage (#51182) 2022-06-21 17:48:38 +01:00
Torkel Ödegaard
3a586a6053
PanelRenderer: Improves PanelRenderer performance (#51092)
* PanelRenderer: Improves PanelRenderer performance

* Minor refactor

* remove old func
2022-06-20 14:41:39 +02:00
renovate[bot]
dd98107201
Update dependency rollup to v2.75.6 (#50770)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-06-15 10:09:32 +01:00
Ashley Harrison
803473f479
Chore: Enable useUnknownInCatchVariables for stricter type checking in catch blocks (#50591)
* wrap a bunch of errors

* wrap more things!

* fix up some unit tests

* wrap more errors

* tiny bit of tidy up
2022-06-15 08:59:29 +01:00
Dimitris Sotirakis
443083c7df
Bump version: Update main branch version to 9.1.0-pre (#50803)
* Update main branch version to 9.1.0-pre

* Update yarn.lock
2022-06-14 09:06:14 -07:00
owensmallwood
1bb2d2599c
Public Dashboards: Pubdash panels get data from pubdash api (#50556)
* Public dashboard query API

* Create new API on service for building metric request

* Flesh out testing, implement BuildPublicDashboardMetricRequest

* Test for errors and missing panels

* WIP: Test for multiple datasources

* Refactor tests, add supporting code for multiple datasources

* Gets the panel data from the pubdash query api

* Adds tests to make sure we get the correct api url from retrieving panel data

* Public dashboard query API

* Create new API on service for building metric request

* Flesh out testing, implement BuildPublicDashboardMetricRequest

* Test for errors and missing panels

* WIP: Test for multiple datasources

* Refactor tests, add supporting code for multiple datasources

* Handle queries from multiple datasources

* Replace dashboard time range with pubdash time range settings

* Fix comments from review, build failure

* removes changes to DataSourceWithBackend.ts regarding getting the pubdash panel query url. Going to do this in a new class, PublicDashboardDataSource.ts

* Include pubdash Uid in dashboard meta

* Creates new PublicDashboardDataSource.ts and adds test

* Passes pubdash uid down to PanelQueryRunner.ts to a PublicDashboardDatasource can be chosen when were looking at a public dashboard

* removes comment

* checks for error when unmarshalling json

* Only replace dashboard time settings with pubdash time settings when pubdash time settings exist

* formatting and added comment

Co-authored-by: Jesse Weaver <jesse.weaver@grafana.com>
Co-authored-by: Jeff Levin <jeff@levinology.com>
2022-06-13 18:03:43 -06:00
Ryan McKinley
fdf67276ea
FeatureToggles: Support changing feature toggles with URL parameters (#50275) 2022-06-09 11:42:38 +02:00
renovate[bot]
0c32dec9e2
Update dependency @types/jest to v28 (#49249)
* Update dependency @types/jest to v28

* modern is now default!

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-06-06 14:45:02 +01:00