Commit Graph

13767 Commits

Author SHA1 Message Date
Piotr Jamróz
bd95856ff9
Graphite: Migrate to React (part 6: Remove AngularJS Query Editor) (#37919)
* Add UMLs

* Add rendered diagrams

* Move QueryCtrl to flux

* Remove redundant param in the reducer

* Use named imports for lodash and fix typing for GraphiteTagOperator

* Add missing async/await

* Extract providers to a separate file

* Clean up async await

* Rename controller functions back to main

* Simplify creating actions

* Re-order controller functions

* Separate helpers from actions

* Rename vars

* Simplify helpers

* Move controller methods to state reducers

* Remove docs (they are added in design doc)

* Move actions.ts to state folder

* Add docs

* Add old methods stubs for easier review

* Check how state dependencies will be mapped

* Rename state to store

* Rename state to store

* Rewrite spec tests for Graphite Query Controller

* Update docs

* Update docs

* Add GraphiteTextEditor

* Add play button

* Add AddGraphiteFunction

* Use Segment to simplify AddGraphiteFunction

* Memoize function defs

* Fix useCallback deps

* Update public/app/plugins/datasource/graphite/state/helpers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/helpers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/helpers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Add more type definitions

* Remove submitOnClickAwayOption

This behavior is actually needed to remove parameters in functions

* Load function definitions before parsing the target on initial load

* Add button padding

* Fix loading function definitions

* Change targetChanged to updateQuery to avoid mutating state directly

It's also needed for extra refresh/runQuery execution as handleTargetChanged doesn't handle changing the raw query

* Fix updating query after adding a function

* Simplify updating function params

* Migrate function editor to react

* Simplify setting Segment Select min width

* Remove unnecessary changes to SegmentInput

* Extract view logic to a helper and update types definitions

* Clean up types

* Update FuncDef types and add tests

* Show red border for unknown functions

* Autofocus on new params

* Extract params mapping to a helper

* Split code between params and function editor

* Focus on the first param when a function is added even if it's an optional argument

* Add function editor tests

* Remove todo marker

* Fix adding new functions

* Allow empty value in selects for removing function params

* Add placeholders and fix styling

* Add more docs

* Create basic implementation for metrics and tags

* Post merge fixes

These files are not .ts

* Remove mapping to Angular dropdowns

* Simplify mapping tag names, values and operators

* Simplify mapping metrics

* Fix removing tags and autocomplete

* Simplify debouncing providers

* Ensure options are loaded twice and segment is opened

* Remove focusing new segments logic (not supported by React's segment)

* Clean up

* Move debouncing to components

* Simplify mapping to selectable options

* Add docs

* Group all components

* Remove unused controller methods

* Create Dispatch context

* Group Series and Tags Sections

* Create Functions section

* Create Section component

* use getStyles

* remove redundant async/await

* Remove

* remove redundant async/await

* Remove console.log and silent test console output

* Do not display the name of the selected dropdown option

* Move Section to grafana-ui

* Update storybook

* Simplify SectionLabel

* Fix Influx tests

* Fix API Extractor warnings

* Fix API Extractor warnings

* Do not show hidden functions

* Use block docs for better doc generation

* Handle undefined values provided for autocomplete

* Basic integration

* Move creating state to context.tsx

* Update tests

* Rename test

* Clean up dependencies

panel.targets is not needed for interpolation - it happens in the data source itself. It was used only to show query ref in the the dropdown for the segment.

* Update time range when it changes

* Change action name

* Simplify segments cloning

* Remove redundant variable

* Use styles instead of direct css

* Update docs

* Remove angular wrappers

* Remove redundant tests

* Section -> SegmentSection

* Simplify section styling

* Remove redundant div

* Fix unit tests

* Simplify SegmentSection component

* Use theme.spacing

* Use empty label instead of a single space label

* Remove targetFull

It was used in the past two store the query interpolated with sub-queries inside the model and send both to the backed (interpolated and not interpolated). This has been changed though - the logic has been moved away from model to the data source where interpolation happens and now only interpolated query is passed meaning targetFull is not needed anymore.

* Revert "Remove targetFull"

This reverts commit 499f8b33

* Bring back calculating targetFull

* Clean up

* Add missing dep

* Add missing dep in tests

* Fix time range synchronization

* Fix warning message

* Remove unused type

* Synchronize changes to the query

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-09-02 10:18:14 +02:00
Piotr Jamróz
f941390631
Deprecate browser access mode for the Graphite data source. (#38783)
* Deprecate browser access mode for Graphite

* Update docs

* Update copy
2021-09-02 10:16:17 +02:00
Ryan McKinley
ae702caec6
Transformer: labels to fields should not also merge frames (#38671) 2021-09-01 20:18:50 +02:00
Ashley Harrison
205c672417
Sidemenu: Refactor TopSectionItem and BottomNavLinks into SideMenuItem (#38755)
* Sidemenu: Refactor TopSectionItem and BottomNavLinks into SideMenuItem

* Update failing snapshot

* BottomSection: Convert tests to RTL + add some extra unit tests
2021-09-01 17:16:50 +01:00
Ryan McKinley
e980f8531a
StateTimeline: merge threshold values (#35073) 2021-09-01 17:43:57 +02:00
Ryan McKinley
7af2d1a629
Dashboards: support merging in new panels and options (#37905) 2021-09-01 08:03:56 -07:00
Alex Khomenko
ea8d9d77f4
Admin: User list tweaks (#38750)
* Setup filter

* Enable filtering users by active in last 30 days

* Add loading state

* Update last active age strings

* Tweak user list

* Use theme spacing

* Improve table's accessibility

* Add more aria-labels
2021-09-01 16:53:58 +03:00
Gabriel MABILLE
9f29241a0c
AccessControl: add one-dimensional permissions to datasources (#38070)
* AccessControl: add one-dimensional permissions to datasources in the backend

* AccessControl: add one-dimensional permissions to datasources in the frontend (#38080)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-09-01 15:18:17 +02:00
Uchechukwu Obasi
4e8ab0512c
PlayList: add delete functionality to remove playlist (#38120)
* WIP: add delete functionality to playlist

* fixes deleted item to be removed instantly without manual refresh

* update confirmModal to reference playlist name

* refactor confirmModal message to be clear enough

* WIP: some unit tests for the playlistPage

* added more tests and did some cleanup

* some code refactoring

* adds ability for user roles to control playlist delete

* some abstraction to cleanup code

* modified alert message for delete button to correspond with action

* tried a better approach to modify the alert message

* fixes playlist lookup on each render

* update handlers to not use anonymous function

* exposed getBackendSrv().get api to fetch all playlist

* used better naming convention

* removes unecessary async/await construct

* some code refactoring

* used the correct param structure
2021-09-01 13:23:57 +01:00
Dominik Prokop
326455a9b8
Annotation tooltip: Bring back links styles (#38780) 2021-09-01 13:30:30 +02:00
Hugo Häggmark
55e20bbf04
LibraryPanels: Separates name from panel title (#38707)
* LibraryPanels: Separates name from panel title

* WIP

* Chore: fixes update for duplicate lib panels

* Chore: reverts implementation

* Chore: show library options only for library panels

* Chore: ui fixes after PR comments

* Chore: fixes issue when creating library panels
2021-09-01 13:27:43 +02:00
Alex Khomenko
7f27a2e1af
Add licensing card background images (#38774) 2021-09-01 10:46:03 +03:00
Hugo Häggmark
38ca27428d
LibraryPanels: Removes library panel icon from the panel header (#38749) 2021-09-01 06:14:21 +02:00
Nathan Rodman
ad610a1916
Alerting: Fix bug for default value in silence matcher (#38735) 2021-08-31 20:51:36 -07:00
Jack Westbrook
fec50115b0
Chore: Bump dangerously-set-html-content to 1.0.9 (#38622) 2021-08-31 14:10:56 +02:00
Gábor Farkas
a5d11a3bef
Prometheus: monaco-based query-editor-field, first step (#37251)
* prometheus: add monaco-based query-field

for now it is behind a feature-flag

* added new trigger character

* better separate grafana-specifc and prom-specific code

* better styling

* more styling

* more styling

* simpler monaco-import

* better imports

* simplified code

* simplified type imports

* refactor: group completion-provider files together

* renamed type

* simplify type-import

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>

* handle no-metric-name autocompletes

* updated comment

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2021-08-31 13:46:13 +02:00
Jack Westbrook
8d3b31ff23
Build: Upgrade Webpack 5 (#36444)
* build(webpack): bump to v5 and successful yarn start compilation

* build(webpack): update postcss dependencies

* build(webpack): silence warnings about hash renamed to fullhash

* build(webpack): enable persistent cache to store generated webpack modules / chunks

* build(webpack): prefer eslintWebpackPlugin over tschecker so eslint doesn't block typechecking

* chore(yarn): run yarn-deduplicate to clean up dependencies

* chore(yarn): refresh lock file after clean install

* build(webpack): prefer output.clean over CleanWebpackPlugin

* build(webpack): prefer esbuild over babel-loader for dev config

* build(babel): turn off cache compression to improve build performance

* build(webpack): get production builds working

* build(webpack): remove phantomJS (removed from grafana in v7) specific loader

* build(webpack): put back babel for dev builds no performance gain in using esbuild in webpack

* build(webpack): prefer terser and optimise css plugins for prod. slower but smaller bundles

* build(webpack): clean up redundant code. inform postcss about node_modules

* build(webpack): remove deprecation warnings flag

* build(webpack): bump packages, dev performance optimisations, attempt to get hot working

* chore(storybook): use webpack 5 for dev and production builds

* build(storybook): speed up dev build

* chore(yarn): refresh lock file

* chore(webpack): bump webpack and related deps to latest

* refactor(webpack): put back inline-source-map, move start scripts out of grafana toolkit

* feat(webpack): prefer react-refresh over react-hot-loader

* build(webpack): update webpack.hot to use react-refresh

* chore: remove react-hot-loader from codebase

* refactor(queryeditorrow): fix circular dependency causing react-fast-refresh errors

* revert(webpack): remove stats.errorDetails from common config

* build(webpack): bump to v5 and successful yarn start compilation

* build(webpack): update postcss dependencies

* build(webpack): silence warnings about hash renamed to fullhash

* build(webpack): enable persistent cache to store generated webpack modules / chunks

* build(webpack): prefer eslintWebpackPlugin over tschecker so eslint doesn't block typechecking

* chore(yarn): run yarn-deduplicate to clean up dependencies

* chore(yarn): refresh lock file after clean install

* build(webpack): prefer output.clean over CleanWebpackPlugin

* build(webpack): prefer esbuild over babel-loader for dev config

* build(babel): turn off cache compression to improve build performance

* build(webpack): get production builds working

* build(webpack): remove phantomJS (removed from grafana in v7) specific loader

* build(webpack): put back babel for dev builds no performance gain in using esbuild in webpack

* build(webpack): prefer terser and optimise css plugins for prod. slower but smaller bundles

* build(webpack): clean up redundant code. inform postcss about node_modules

* build(webpack): remove deprecation warnings flag

* build(webpack): bump packages, dev performance optimisations, attempt to get hot working

* chore(storybook): use webpack 5 for dev and production builds

* build(storybook): speed up dev build

* chore(yarn): refresh lock file

* chore(webpack): bump webpack and related deps to latest

* refactor(webpack): put back inline-source-map, move start scripts out of grafana toolkit

* feat(webpack): prefer react-refresh over react-hot-loader

* build(webpack): update webpack.hot to use react-refresh

* chore: remove react-hot-loader from codebase

* refactor(queryeditorrow): fix circular dependency causing react-fast-refresh errors

* revert(webpack): remove stats.errorDetails from common config

* revert(webpack): remove include from babel-loader so symlinks (enterprise) work as before

* refactor(webpack): fix deprecation warnings in prod builds

* fix(storybook): fix failing builds due to replacing css-optimise webpack plugin

* fix(storybook): use raw-loader for svg icons

* build(webpack): fix dev script colors error

* chore(webpack): bump css-loader and react-refresh-webpack-plugin to latest versions

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2021-08-31 12:55:05 +02:00
Ashley Harrison
b40d48258d
Sidemenu: Fix logout button (#38747) 2021-08-31 11:33:38 +01:00
Ashley Harrison
7a242afcd6
Sidemenu: Refactor BottomNavLinks to use SideMenuDropDown (#38598)
* Sidemenu: Attempt to refactor BottomNavLinks to use SideMenuDropDown

* BottomNavLinks: Rewrite existing enzyme tests in RTL

* BottomNavLinks: Use object spreading instead of slicing
2021-08-31 10:37:51 +01:00
shuotli
f1529b83a2
[Azure monitor] Support variables for Azure Resource Group subscription picker (#38620) 2021-08-31 09:15:35 +02:00
Ryan McKinley
f567bef0bf
Geomap: hide legend for markers with single threshold (#38734) 2021-08-30 23:22:19 -07:00
Levente Balogh
82c038bd06
Plugins Catalog: add signature information to details (#38558)
* refaactor: extract the tab labels into a const

* feat: list - show signature badge for enterprise plugins as well

* feat(plugins): add a component for showing plugin signature details

* feat: add a component for showing signature info under details

* feat: add a component for displaying signature info in details header

* feat: extract the plugin details header into a separate component

* feat: show signature information on the plugins details page

* refactor(Plugins): use an enum instead of an object

* refactor(Plugins): use more strict typing for tabs

* refactor(Plugins): use function declaration instead of fat-arrow for components

* fix(Plugins): fix typo

* fix: make installed plugin config an optional param again

* refactor: cache plugin meta requests

* refactor: move PLUGIN_TAB_LABELS to the types module
2021-08-30 14:00:11 +02:00
Peter Holmberg
74afe809af
Alerting: Add DateTimePicker on view rule page (#38592)
* export datetimepicker

* minor fixes to the datetime picker

* correct datetime to picker

* move datetime calc to function

* set maxDate

* set maxDate

* wrap in useCallback
2021-08-30 11:42:37 +02:00
Zoltán Bedi
38b398feb4
Fix: panel crash after esc (#38646) 2021-08-30 09:57:07 +02:00
Alex Khomenko
d90c822e69
Fix key prop when rendering options (#38595) 2021-08-30 06:59:51 +02:00
Oscar Kilhed
b248c119ef
TimeSeries: Use graph min/max for percentage threshold (#38528)
* TimeSeries: Use graph min/max as baseis for percentage threshold calculation.

* respect hard and soft axis limits for % threshold steps

* revert state-timeline changes

* enable by-threshold coloring in histogram and barchart

* revert yMin

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-08-29 15:46:17 -05:00
sam boyer
96557ecadc
Change cuetsy annotation "targetType" to "kind" (#38564)
Mirrors change made upstream in cuetsy
2021-08-29 14:29:06 -04:00
nikki-kiga
a54a139176
Transformations: Convert field types to time string number or boolean (#38517)
* outline string to time

add stringToTime transformer

start to add format

add type and dateformat

rename stringToTime to fieldConversion

add more type support and use FieldNamePicker

add field conversion transformation

* adjust for performance feedback

rename and adjust labels and widths

shorten labels and null values

rename to convertFieldType

update test

* make updates
2021-08-27 13:49:31 -07:00
Dominik Prokop
1be53b4f3b
TimeSeries: Add per-axis grid visibility toggle (#38502)
* Allow grid lines visibility control to XYChart and TimeSeries

* Move grid lines config to field config (axis)

* Fix merge

* Auto grid mode

* Fix ts

* Align naming

* Update packages/grafana-ui/src/components/uPlot/config/UPlotConfigBuilder.test.ts

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>

* Update packages/grafana-ui/src/components/uPlot/config/UPlotConfigBuilder.test.ts

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>

* remove 'grid' from props diff array since field.config.custom.* is handled by structureRev diffing

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-08-27 12:30:42 -05:00
Giordano Ricci
b5e4a0a39a
Elasticsearch: Only show numbers in histogram field autocomplete (#38631) 2021-08-27 17:19:44 +01:00
Olof Bourghardt
8da634f780
Loki: add tests for addAdHocFilters (#38594)
* Loki: add tests for addAdHocFilters

* Change description of test

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

* Replace ADD_FILTER with "=" operator in test description

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

* Loki: refafctor test for addAdHocFilter

* Loki: refactor tests for better readability

* Remove comments

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2021-08-27 17:06:22 +02:00
Giordano Ricci
eaca54a9f2
Elasticsearch: change terms default min_doc_count to 1 (#38632) 2021-08-27 14:22:12 +01:00
Olof Bourghardt
458bced826
Jaeger: fix bug where query is executed twice (#38550)
* Jaeger: add empty callback to QueryField onBlur to stop query from being run twice

* Jaeger: add wait call on 500ms to accomodate for debouncing by the QueryField component
2021-08-27 10:36:18 +02:00
Alex Khomenko
a15e33e693
Admin: remove Redux from ServerStats (#38581)
* Admin: remove Redux from ServerStats

* Admin: Fix import
2021-08-27 11:09:17 +03:00
Jack Westbrook
2cb141d4ec
Plugins: Refactor installation buttons component (#37642)
* refactor(catalog): split out installcontrols into multiple components

* test(catalog): update tests for plugindetails page

* refactor(catalog): rename installcontrols -> index

* refactor(catalog): remove redundant curlies

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

* tests(plugindetails): fix assertions and naming of tests

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

* refactor(installcontrols): prefer enum over duplicate union type, rename disabled prop

* refactor(installcontrols): use PluginStatus enum for installcontrols pluginStatus

* refactor(installcontrols): remove redundant curlies

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2021-08-26 17:15:43 +02:00
Domas
2847f25781
Alerting: UI to edit cortex/loki namespace & group names, group eval interval (#38543) 2021-08-26 16:40:27 +03:00
Ashley Harrison
a583f7e160
Sidemenu: Refactor SideMenuDropDown (#38554)
* SideMenuDropDown: Refactor to be more component-ey + rewrite tests in RTL

* SideMenuDropDown: Rename childLinks -> items

* Rename mockChildLinks -> mockItems as well
2021-08-26 14:08:27 +01:00
Torkel Ödegaard
d5ed4e9c8c
Geomap: Minor style fixes (#38532)
* Fixed hover font-weight, option casing, and added simple test dashboard with 3 panels

* Update theme colors

* Style tweaks to legend

* Updated

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-08-26 10:17:03 +02:00
Ryan McKinley
9267014a45
Schema: export existing types in @grafana/data|ui (#38518) 2021-08-25 09:59:03 -07:00
Connor Lindsey
76ade24f2f
Add catch around JSON trace upload for more error handling (#38520) 2021-08-25 10:08:46 -06:00
Ivana Huckova
d1b6132302
Loki: Fix ad-hoc filter when used with parser (#38542)
* Fix ad hoc filter when used with parser

* Update
2021-08-25 16:08:41 +02:00
Patrick O'Carroll
2e772d41a7
Themes: align hover and focus opacity (#38498)
* new warning and success color in light theme, slight tweak to primary text

* changed hover opacity to the same as focues opacity

* Updated generated files

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2021-08-25 15:34:19 +02:00
Ashley Harrison
b30882bd2b
Sidemenu: Refactor DropDownChild (#38509)
* DropDownChild: Refactor DropDownChild to be more component-like

* Rewrite tests in RTL

* Let's not do this just yet...
2021-08-25 14:27:04 +01:00
sam boyer
e61bc33163
Move dashboard scuemata to grafana-schema (#38470)
* Relocate dashboard scuemata to grafana-schema

* Update assorted tests, vars with dashboard path

* Remove crufty commented var

* Not sure...why that failed

* Remove prefix from base dashboard path var

* Move cue/ui remnants into grafana-schema

* Update import paths in plugin models

* Remove mudball, add package statements

* Remove cuegen.sh

Wooooo we ain't got no codegen

* Revert "Remove mudball, add package statements"

This reverts commit 9bed3098f1.

* Tidy up all the cue files

* Move dashboard scuemata into scuemata/ subdir

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-08-25 06:55:04 -04:00
Olof Bourghardt
a19ad25eaa
Jaeger: support running queries with keyboard shortcut (#37958)
* Jaeger: add QueryField component

* Remove unused imports

* Fix e2e test so that it checks for QueryField component

* Remove comments

* Fix failing e2e test
2021-08-25 11:30:32 +02:00
Ashley Harrison
7c97b9d03f
QueryEditor: Don't use _.defaults as it mutates the query prop directly (#37965)
* QueryEditor: Don't use _.defaults as it mutates the query prop directly

* QueryEditor: Update the query type on mount if none exists

* QueryEditor: Mutate in the constructor instead of render

* Apply defaults immutably in render
2021-08-25 10:19:02 +01:00
Alex Khomenko
6e639f3c72
Admin: Update stats page UI (#38014)
* Add StatCard

* Style cards

* Update types

* Add tests

* Move stats tab into licencing

* Prevent UI jumps when loading stats

* Fix merge conflicts

* Revert docs format
2021-08-24 19:13:48 +03:00
Ryan McKinley
fcceb5716d
Schema: move existing grafana/ui models into schema (#38469) 2021-08-24 08:22:34 -07:00
Patrick O'Carroll
8fb4882a01
Light theme palette update (#38487)
* new warning and success color in light theme, slight tweak to primary text

* Update generated light theme scss

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2021-08-24 13:23:01 +02:00
Domas
9d8f61c738
Alerting: allow creating/editing recording rules for Loki and Cortex (#38064) 2021-08-24 10:31:56 +02:00