Commit Graph

4621 Commits

Author SHA1 Message Date
Gabriel MABILLE
717bd4a6c0
RBAC: Add a feature toggle for primitives we provide to OnCall (#57289) 2022-10-19 18:10:09 +02:00
Ashley Harrison
96660992f4
Navigation: Ignore null children in ToolbarButtonRow (#57201)
* filter out any null buttons to prevent padding being added for them

* ignore null children in toolbarbuttonrow
2022-10-19 10:00:57 +01:00
owensmallwood
b2408dd7c5
Publicdasboards: Add annotations support (#56413)
adds annotations support for public dashboards
2022-10-18 19:48:20 -06:00
Torkel Ödegaard
69bfd923be
RefreshPicker: Fix issue clearing auto refresh (#57215) 2022-10-18 21:41:37 +02:00
Victor Marin
9c514748f7
Revert data links code for sorted vector case (#57175) 2022-10-18 08:59:53 -04:00
Gilles De Mey
423643aaa6
Alerting: use virtualized list of namespaces / groups for cloud rules (#56415) 2022-10-18 13:38:59 +02:00
Victor Marin
76d6e3c075
TimeseriesPanel: Fix variables in data links (#56729)
* TimeseriesPanel: Fix variables in data links

* Refactor variable fix for all Timeseries panels

* cr mods
2022-10-18 14:22:31 +03:00
Jack Westbrook
24c04740e3
Grafana UI: Export prop types for queryfield, modal and field components (#57097)
* chore(grafana-ui): export prop types for queryfield, modal and field components

* docs(migration-guide): add notes for react peerdependencies and additional type exposure

* Update docs/sources/developers/plugins/migration-guide.md

Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>

Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
2022-10-17 17:54:43 +02:00
kay delaney
ed71b7b884
Chore/React18: Remove enzyme slate tests and replace with e2e tests (#57095) 2022-10-17 16:31:59 +01:00
Jack Westbrook
fd0fcffc24
Toolkit: Fix Cannot use "import statement outside" error in tests (#57071) 2022-10-17 16:31:12 +02:00
kay delaney
5d53a983d8
React18: Update useCallback arg types where needed (#57084) 2022-10-17 14:52:12 +01:00
kay delaney
b1128e0b8c
Chore/React18: Update context types where needed (#57018) 2022-10-17 13:29:44 +01:00
Esteban Beltran
0abf04a20f
Toolkit: Remove unused close-milestone command (#57062)
* Toolkit: Remove unused close-milestone command

* Remove import line
2022-10-17 11:27:27 +02:00
Ashley Harrison
3cca8e3676
any/type assertion fixes (#57009) 2022-10-17 10:10:10 +01:00
Torkel Ödegaard
9f5e691994
Theme: Inter font (behind feature toggle) (#56441)
* Theme: Inter font change with new line-height

* Add it behind feature toggle

* make buildVariant easier to read + enforce integer multiples of 2 (#56486)

* Minor update

* Update

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-10-15 16:22:33 +02:00
kay delaney
64b0f8072b
Themes: Add color-scheme attribute to :root (#57001) 2022-10-14 16:30:07 +01:00
Josh Hunt
2e16d5499e
Dashboard: Add dashboard validation warning to save drawer (#55732)
* add api route for validating a dashboard json

* add feature flag for showDashboardValidationWarnings

* tidy up

* comments and messages

* swagger specs

* fix typo

* more swagger

* tests!

* tidy test a little bit

* no more ioutil

* api will return different status code depending on validation error

* clean up

* handle 4xx errors

* remove console.log

* fix backend tests

* tidy up

* Swagger: Exclude alpha endpoints

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2022-10-14 09:51:05 -04:00
GitStart
4ecc9f42ac
Last Table Column Not Centered (#56047)
Co-authored-by: gitstart <gitstart@gitstart.com>
Co-authored-by: gitstart <gitstart@users.noreply.github.com>
Co-authored-by: Nitesh Singh <nitesh.singh@gitstart.dev>
Co-authored-by: Thiago Nascimbeni <tnascimbeni@gmail.com>
Co-authored-by: Rubens Rafael <70234898+RubensRafael@users.noreply.github.com>
Co-authored-by: RubensRafael <rubensrafael2@live.com>
Co-authored-by: Rafael Toledo <87545086+Toledodev@users.noreply.github.com>
Co-authored-by: Matheus Muniz <87545749+matheusmuniz03@users.noreply.github.com>
Co-authored-by: Matheus Muniz <matheusmuniz100@hotmail.com>
Co-authored-by: Matheus Benini Ferreira <88898100+MatheusBeniniF@users.noreply.github.com>
Co-authored-by: Murilo Amaral <87545137+MuriloAmarals@users.noreply.github.com>

Co-authored-by: gitstart <gitstart@users.noreply.github.com>
Co-authored-by: gitstart <gitstart@gitstart.com>
Co-authored-by: Nitesh Singh <nitesh.singh@gitstart.dev>
Co-authored-by: Thiago Nascimbeni <tnascimbeni@gmail.com>
Co-authored-by: Rubens Rafael <70234898+RubensRafael@users.noreply.github.com>
Co-authored-by: RubensRafael <rubensrafael2@live.com>
Co-authored-by: Rafael Toledo <87545086+Toledodev@users.noreply.github.com>
Co-authored-by: Matheus Muniz <87545749+matheusmuniz03@users.noreply.github.com>
Co-authored-by: Matheus Muniz <matheusmuniz100@hotmail.com>
Co-authored-by: Matheus Benini Ferreira <88898100+MatheusBeniniF@users.noreply.github.com>
Co-authored-by: Murilo Amaral <87545137+MuriloAmarals@users.noreply.github.com>
2022-10-14 13:25:40 +03:00
Ashley Harrison
a904372269
Accessibility: enable rule jsx-a11y/no-noninteractive-element-to-interactive-role (#56870)
* enable rule `jsx-a11y/no-noninteractive-element-to-interactive-role` and switch to extending recommended preset

* fix unit tests

* better unit test
2022-10-14 11:02:01 +01:00
kay delaney
e85917f041
Chore/React18: Update component prop types (#56898) 2022-10-14 10:24:32 +01:00
kay delaney
e819ed0f51
PlotLegend: Memoize for better performance (#56123) 2022-10-14 09:51:27 +01:00
Joan López de la Franca Beltran
1ca5c347d3
Analytics: Add datasource UID to events (#56852)
* Analytics: Add datasource UID to events
2022-10-13 17:41:52 +02:00
ying-jeanne
80ede174dd
update the feature toggle usage in backend (#56787) 2022-10-12 13:43:35 +02:00
Gabriel MABILLE
10c080dad1
LDAP: Add skip_org_role_sync configuration option (#56679)
* LDAP: Add skip_org_role_sync option

* Document the new config option

* Nit on docs

* Update docs/sources/setup-grafana/configure-security/configure-authentication/ldap.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Docs suggestions

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Jguer <joao.guerreiro@grafana.com>

* Add test, Fix disabled user when no role

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Jguer <joao.guerreiro@grafana.com>
2022-10-12 13:33:33 +02:00
Victor Marin
48c27872af
TablePanel: Footer now updates values on column filtering (#56354)
* Table footer now updates values on column filtering

* Backwards compatibility
2022-10-12 07:57:49 +03:00
Leo
0a183d1ba2
Navigation: Mobile support for topnav items (#56568)
* add topbar layout and wrapper

* mobile support for topnav icons

* improved hooks implementation

* added tests for TopSearchBarSection

* support css overrides for select and valuepicker

* make singlevalue inherit the color from select
2022-10-11 14:24:02 +02:00
Ashley Harrison
90cf76e05e
Navigation: Integrate Explore actions into topnav (#56381)
* integrate Explore actions into topnav toolbar

* add keys

* fix unit test

* fix bug with ToolbarButtonRow overflow

* make the render function a bit more readable

* fix overflow not updating when children change
2022-10-11 12:59:17 +01:00
Leo
a91d77003d
AnnotationList: Support html content (#54916)
* support html content in annolistpanel

* improve panel tests

* add RenderUserContentAsHTML ui

* sanitize content
2022-10-11 13:35:03 +02:00
Gareth Dawson
10a34a041c
Add feature tracking for LogRow.tsx (#56656)
* Add feature tracking for LogRow.tsx

* Add type and logRowUid to reportInteraction

* Rename logs variable
2022-10-11 10:04:43 +01:00
GitStart
bc632f239d
Tempo: Tab button doesn't work when in the Tags field (#56458)
Co-authored-by: gitstart <gitstart@gitstart.com>
Co-authored-by: gitstart <gitstart@users.noreply.github.com>
Co-authored-by: Rubens Rafael <70234898+RubensRafael@users.noreply.github.com>
Co-authored-by: RubensRafael <rubensrafael2@live.com>
Co-authored-by: Rafael Toledo <87545086+Toledodev@users.noreply.github.com>
Co-authored-by: Matheus Muniz <87545749+matheusmuniz03@users.noreply.github.com>
Co-authored-by: Thiago Nascimbeni <tnascimbeni@gmail.com>
Co-authored-by: Matheus Muniz <matheusmuniz100@hotmail.com>
Co-authored-by: Nitesh Singh <nitesh.singh@gitstart.dev>
Co-authored-by: Matheus Benini Ferreira <88898100+MatheusBeniniF@users.noreply.github.com>
Co-authored-by: Murilo Amaral <87545137+MuriloAmarals@users.noreply.github.com>
2022-10-11 10:03:59 +01:00
Andres Martinez Gotor
8d9da34827
@grafana/ui: EditorField tooltip interactive (#56557) 2022-10-11 10:19:37 +02:00
Polina Boneva
129a5a29e7
PanelChrome: New Panel Header design Feature Flag (#56450)
* add feature toggle newPanelHeader

* add feature toggle newPanelHeader

* more explicit naming and description of PanelChrome feature flag
2022-10-10 18:03:16 +03:00
kay delaney
efed72096f
TagsInput: Prevent adding duplicate tags + refactor, restyle (#56485) 2022-10-10 15:56:02 +01:00
Alex Khomenko
d332747c38
TimeRangeInput: Fix clear button type (#56545) 2022-10-10 17:05:30 +03:00
Josh Hunt
d405f3a877
GrafanaUI: InputGroup: Fix invalid children borders (#56169)
* GrafanaUI: InputGroup: Fix invalid children borders

* tidy story

* zindex priority stack

* clarify comment

* fix inputgroup children type
2022-10-10 06:43:29 -04:00
Ryan McKinley
b24be6c0fc
ObjectStore: add a kind registry (#56507) 2022-10-08 12:05:46 -04:00
Artur Wierzbicki
bf264d2f76
Query library: requiresDevMode dummy backend (#56466)
* query library - dummy backend

* fix tests

* dont explicitly marshall backend dataresponse

* skip integration tests

* null check for tests

* added query library to codeowners

* null check for tests

* lint
2022-10-07 11:31:45 -07:00
Leo
9c50131c2c
Navigation: Added organisation switcher next to grafana logo (#56361)
* added org dropdown to topnav

* render icon and dropdown for mobile screen

* remove switch org from profile node

* adjust styles to be mobile first

* add test for select

* hide profile node only when topnav is on

* replace margin with gap instead

* improve tests

* add aria labels

* fix broken test
2022-10-07 17:52:13 +02:00
Ashley Harrison
ff41b9544b
Chore: more typing improvements to @grafana/ui (#56544)
* improve grafana-ui types

* more type improvements

* better useState type
2022-10-07 15:22:21 +01:00
Josh Hunt
891f9c00a1
I18n: Add lint rule to enforce correct i18n imports (#56487)
* I18n: Add lint rule to enforce correct i18n imports

* ignore in gui wrapper
2022-10-07 11:46:28 +01:00
Joey Tawadrous
74c809f544
Plugins: Introduce new Flame graph panel (#56376)
* Flamegraph

* Updated flame graph width/height values

* Fix top table rendering issue

* Add feature toggle for flamegraph in explore

* Update tests

* Hide flamegraph from dash panel viz list if feature toggle not enabled

* Show table if no flameGraphFrames

* Add flame graph to testdata ds

* Minor improvement
2022-10-07 11:39:14 +01:00
Victor Marin
b622a87aee
StateTimeline: Fix tooltip showing erroneously in shared crosshair dashboards (#55809)
* StateTimeline: Fix shared crosshair

* Fix for StatusHistory also
2022-10-07 08:56:15 +03:00
Leon Sorokin
21d9cf0db4
Thresholds: fix line rendering with multiple y axes (#56516) 2022-10-06 17:18:47 -06:00
Ryan McKinley
609abf00d1
ObjectStore: Write json as json when possible (#56433) 2022-10-06 15:48:53 -04:00
Josh Hunt
5361efc225
I18n: Migrate to I18next (#55845)
* Switch from lingui from i18next

* Change lingui messages to i18next messages

* Change lingui messages to i18next messages (grafana-ui)

* Init i18n for tests
2022-10-06 16:34:04 +01:00
Matias Chomicki
729ce8bb72
Loki: query editor using Monaco (#55391)
* loki: switch to a monaco-based query field, step 1 (#46291)

* loki: use monaco-logql (#46318)

* loki: use monaco-logql

* updated monaco-logql

* fix all the tests (#46327)

* loki: recommend parser (#46362)

* loki: recommend parser

* additional improvements

* more improvements

* type and lint fixes

* more improvements

* trigger autocomplete on focus

* rename

* loki: more smart features (#46414)

* loki: more smart features

* loki: updated syntax-highlight version

* better explanation (#46443)

* better explanation

* improved help-text

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

* Fix label

* feat(loki-monaco-editor): add monaco-logql as a dependency

* feat(loki-monaco-editor): add back range function removed during merge

* feat(loki-monaco-editor): sync imports with recent changes

* feat(loki-monaco-editor): add missing lang provider functions

* feat(loki-monaco-editor): fix imports

* feat(loki-monaco-editor): display monaco editor by default

Temporarily

* Chore: remove commented code

* Chore: minor refactor to NeverCaseError

* Chore: minor code cleanups

* feat(loki-monaco-editor): add history implementation

Will see how it behaves and base the history slicing on tangible feedback

* feat(loki-monaco-editor): turn completion data provider into a class

* Chore: fix missing imports

* feat(loki-monaco-editor): refactor data provider methods

Move complexity scattered everywhere to the provider

* Chore: clean up redundant code

* Chore: minor comments cleanup

* Chore: simplify override services

* Chore: rename callback

* feat(loki-monaco-editor): use query hints implementation to parse expression

* feat(loki-monaco-editor): improve function name

* Chore: remove superfluous variable in favor of destructuring

* Chore: remove unused imports

* Chore: make method async

* feat(loki-monaco-editor): fix deprecations and errors in situation

* feat(loki-monaco-editor): comment failing test case

* Chore: remove comment from test

* Chore: remove duplicated completion item

* Chore: fix linting issues

* Chore: update language provider test

* Chore: update datasource test

* feat(loki-monaco-editor): create feature flag

* feat(loki-monaco-editor): place the editor under a feature flag

* Chore: add completion unit test

* Chore: add completion data provider test

* Chore: remove unwanted export

* Chore: remove unused export

* Chore(loki-query-field): destructure all props

* chore(loki-completions): remove odd string

* fix(loki-completions): remove rate_interval

Not supported

* fix(loki-completions): remove line filters for after pipe case

We shouldn't offer line filters if we are after first pipe.

* refactor(loki-datasource): update default parameter

* fix(loki-syntax): remove outdated documentation

* Update capitalization in pkg/services/featuremgmt/registry.go

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

* refactor(situation): use node types instead of names

* Chore: comment line filters pending implementation

It's breaking the build due to a linting error.

* Chore: update feature flag test after capitalization change

* Revert "fix(loki-completions): remove line filters for after pipe case"

This reverts commit 3d003ca4bc.

* Revert "Chore: comment line filters pending implementation"

This reverts commit 84bfe76a6a.

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
Co-authored-by: Ivana Huckova <ivana.huckova@gmail.com>
2022-10-06 10:35:30 -04:00
Gábor Farkas
3a76c7aac3
grafana-ui: removed obsolete test that cause jest warnings (#56444) 2022-10-06 11:35:21 +00:00
Torkel Ödegaard
0958d9ba55
Theme: Change body line-height to fix alignment issue (#56442)
* Theme: Change body line-height to fix alignment issue

* Updates
2022-10-06 12:59:43 +02:00
Joe Blubaugh
b476ae62fb
Alerting: Write and Delete multiple alert instances. (#55350)
Prior to this change, all alert instance writes and deletes happened
individually, in their own database transaction. This change batches up
writes or deletes for a given rule's evaluation loop into a single
transaction before applying it.

These new transactions are off by default, guarded by the feature toggle "alertingBigTransactions"

Before:

```
goos: darwin
goarch: arm64
pkg: github.com/grafana/grafana/pkg/services/ngalert/store
BenchmarkAlertInstanceOperations-8           398           2991381 ns/op         1133537 B/op      27703 allocs/op
--- BENCH: BenchmarkAlertInstanceOperations-8
    util.go:127: alert definition: {orgID: 1, UID: FovKXiRVzm} with title: "an alert definition FTvFXmRVkz" interval: 60 created
    util.go:127: alert definition: {orgID: 1, UID: foDFXmRVkm} with title: "an alert definition fovFXmRVkz" interval: 60 created
    util.go:127: alert definition: {orgID: 1, UID: VQvFuigVkm} with title: "an alert definition VwDKXmR4kz" interval: 60 created
PASS
ok      github.com/grafana/grafana/pkg/services/ngalert/store   1.619s
```

After:

```
goos: darwin
goarch: arm64
pkg: github.com/grafana/grafana/pkg/services/ngalert/store
BenchmarkAlertInstanceOperations-8          1440            816484 ns/op          352297 B/op       6529 allocs/op
--- BENCH: BenchmarkAlertInstanceOperations-8
    util.go:127: alert definition: {orgID: 1, UID: 302r_igVzm} with title: "an alert definition q0h9lmR4zz" interval: 60 created
    util.go:127: alert definition: {orgID: 1, UID: 71hrlmR4km} with title: "an alert definition nJ29_mR4zz" interval: 60 created
    util.go:127: alert definition: {orgID: 1, UID: Cahr_mR4zm} with title: "an alert definition ja2rlmg4zz" interval: 60 created
PASS
ok      github.com/grafana/grafana/pkg/services/ngalert/store   1.383s
```

So we cut time by about 75% and memory allocations by about 60% when
storing and deleting 100 instances.
2022-10-06 14:22:58 +08:00
Leon Sorokin
8300702524
Search: fuzzy match dashboard names in frontend from full list (#55721) 2022-10-05 18:32:35 -04:00