Commit Graph

3348 Commits

Author SHA1 Message Date
Will
caef39b6a4
Chore: fix typo (#38838) 2021-09-02 19:14:17 -07:00
nikki-kiga
9e7ad70e5d
FieldNamePicker: Add preview details for field type and values (#38768)
* add field type and values preview to picker

* add more details to description

* add icon to Select and specify icons for FieldType

* remove description
2021-09-02 17:04:02 -07:00
Friedrich Mäckle
8c8ccc8b91
Check navigator property exists before accessing it (#38745)
* Check navigator property exists before acecssing it

* fix: pass undefined to Intl.DateTimeFormat if no locale can be determined

* Update packages/grafana-data/src/datetime/formats.ts

replacing ternary by or

Co-authored-by: Ashley Harrison <ashharrison90@gmail.com>

Co-authored-by: Ashley Harrison <ashharrison90@gmail.com>
2021-09-02 11:47:25 +01:00
Dimitris Sotirakis
a5ce61b539
Chore: Update to alpine:3.14.2 (#38813)
* Update apline to 3.14.2

* Remove libcrypto1.1 libssl1.1 version dependencies

* Update grabpl version
2021-09-02 12:57:11 +03:00
Ryan McKinley
ae702caec6
Transformer: labels to fields should not also merge frames (#38671) 2021-09-01 20:18:50 +02:00
Scott Lepper
4f479de88e
Grafana UI: Table - add sticky table footer (#38094)
* table footer to allow showing summary data from the table panel
2021-08-31 12:37:10 -04: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
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
Dimitris Sotirakis
8e2ee0a1c8
Chore: Update to Golang 1.17 (#38608)
* Update to golang 1.17

* Further updates

* Run go mod tidy on go 1.17

* Apply suggestions from code review

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Use build-container:1.4.2

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-08-31 09:19:26 +03:00
Leon Sorokin
05e5b67a99
Colors: rename getThresholdRange() -> getGradientRange() (#38688)
* Colors: use visible y scale range for non-threshold gradients schemes

* rename instead
2021-08-30 15:04:02 -05:00
Zoltán Bedi
dbc7464e78
Toolkit: fix matchmedia missing (#38694) 2021-08-30 14:36:15 +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
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
Leon Sorokin
3c72f1678f
Colors: fix by-value/hex3 & Single color schemes in Gradient mode (#38656) 2021-08-27 15:06:28 -05:00
Leon Sorokin
4e2516d12a
GraphNG: fix crash when trying to diff missing timeRange prop (#38654) 2021-08-27 12:40:33 -05: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
Jack Westbrook
5898824a48
Chore: Fix version format (#38649) 2021-08-27 18:12:37 +02:00
Jack Westbrook
beeb8330c4
Chore: Update packages version to 8.2.0-pre (#38635)
* chore(packages): run packages:prepare script

* chore: update package.json version

* chore: put back semver compliant version
2021-08-27 17:01:19 +02:00
Marcus Efraimsson
0ef5831332
v8.2.0-pre.0 2021-08-27 10:39:53 +02:00
Jack Westbrook
5339275793
Grafana UI: Fix TS error property css is missing in type (#38078) 2021-08-26 16:00:52 +02:00
Ryan McKinley
9267014a45
Schema: export existing types in @grafana/data|ui (#38518) 2021-08-25 09:59:03 -07: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
Arve Knudsen
78596a6756
Migrate to Wire for dependency injection (#32289)
Fixes #30144

Co-authored-by: dsotirakis <sotirakis.dim@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
Co-authored-by: spinillos <selenepinillos@gmail.com>
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Co-authored-by: Leonard Gram <leo@xlson.com>
2021-08-25 15:11:22 +02: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
Patrick O'Carroll
84de946daa
changed opacity on disabled, secondary and secondary shade in both themes (#38453) 2021-08-25 09:47:46 +02: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
Leon Sorokin
403bbd0144
GraphNG: optimize measureText(), drop estimation for y-axis auto-sizing (#38475) 2021-08-24 00:11:19 -05:00
Ryan McKinley
425ec7ca9e
Schema: create a new schema package for basic models (#38409) 2021-08-23 13:03:41 -07:00
Alex Khomenko
49fdab7e43
grafana/ui: Clarify InlineField docs (#38100)
* grafana/ui: clarify InlineField docs

* grafana/ui: revert formatting

* grafana/ui: revert formatting[2]

* grafana/ui: do not format code samples

* grafana/ui: disable mdx formatting
2021-08-23 16:25:09 +03:00
Jack Westbrook
bafe16368a
Chore: Migrate CustomScrollbar to react-custom-scrollbars-2 (#38013) 2021-08-23 09:28:58 +02:00
Ryan McKinley
8c4c05493b
Dashboard: keep live timeseries moving left (v2) (#37769) 2021-08-20 14:48:55 -07:00
Ryan McKinley
b88f8bacf3
DataFrame: add frame type key to DataFrame structure (#38092) 2021-08-20 09:26:40 -07:00
Will Browne
ae17cce316
Plugins: Add Hide OAuth Forward config option (#36306)
* add prop

* add angular conf

* invert naming

* undo md changes

* fix wording

* y u fail 4 me

* refactor(datasourcesettings): rename hideForwardOAuthIdentityOption prop

* refactor(datasourcesettings): rename scope.hideForwardOAuthIdentityOption

* Update contribute/style-guides/e2e.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* feat(datasourcehttpsettings): add showForwardOAuthIdentityOption to angular wrappers & template

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-08-20 15:53:54 +02:00
Olof Bourghardt
5231660627
Explore: use GrafanaTheme2 (LiveLogs component) (#37452)
* Explore: use GrafanaTheme2

* Explore: add correct style values. Add theme.v1 to the styles that were uncertain

* Logs: add use of GrafanaTheme2 in varioius log components

* Styles: add some of the correct values recieved via feedback

* Add correct style values

* Update public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.tsx

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>

* Update public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.tsx

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>

* Update public/app/plugins/panel/dashlist/styles.ts

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>

* Explore: fix failing tests

* Explore: add styling values from v2

* Fix small type error

* Replace v1 styles with v2 styles

* Remove forgotten v1 values

* Remove more v1 style values

* Apply correct style value to LogRowMessage

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

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2021-08-20 14:53:03 +02:00
Kevin Minehart
b3c4b20953
Docker: Update base alpine version (fix CVE-2021-36159) (#38088)
* update base alpine version and update apk packages in Dockerfile

* update base alpine version

* don't need to apk update

* remove space

* Update to alpine 3.14.1

Co-authored-by: Malcolm Holmes <mdh@odoko.co.uk>
2021-08-20 12:54:03 +01:00
Jack Westbrook
d9a2dd8a4b
Chore: Align enzyme dependencies in root and jaeger workspace (#38006)
* chore: align enzyme dependencies in root and jaeger workspace

* chore(yarn): refresh lock file
2021-08-20 12:54:29 +02:00
Jack Westbrook
5ff3b7bf3f
Chore: Bump storybook to 6.3.7 (#38008) 2021-08-20 11:40:20 +02:00
Douglas Thrift
d18205ff20
Matchers: handle undefined with Is/Is not null (#38036) 2021-08-19 11:24:01 -07:00
Connor Lindsey
76b891b001
Tempo: Add Tempo search behind feature flag (#37765)
* Add Tempo search behind feature flag

* Add query fields for Tempo search

* Only show loki search if a logs-to-traces datasource is set up

* Refactor tempo search to use separate fields for service name, span name, and tags

* Add tests to buildSearchQuery

* Move search to separate component and rename type to native search

* Improve Tempo tokenizer syntax
2021-08-19 09:15:46 -06:00
Tobias Skarhed
1f091c448f
Template variables: Keyboard navigation improvements (#38001)
* Fix variable labels

* Add proper labeling for input

* Add ids to PickerRenderer

* Fix tests

* Update PR feedback

* OptionsPicker: Change to id

* Inherit aria attributes

* Add checkbox role

* Fix typo

* Add proper label reference

* Update role and label

* Prevent spreadng non-DOM attributes

* Move form layout to other component

* Remove haspopup

* Add testid to selector

* Add HTMLProps extension

* Use list

* Move styles outside of class

* Add cx
2021-08-19 16:28:25 +02:00
Jack Westbrook
e988d9b56d
Piechart: Update @visx dependencies to 2.1.0 and move to root package.json (#38000)
* chore: move visx dependencies to root package.json

* chore(piechart): bump visx dependencies to 2.1.0

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2021-08-19 14:49:09 +02:00
Hugo Häggmark
dba15190af
Chore: Upgrades rxjs to 7.3.0 (#37913)
* Chore: upgrades rxjs to 7.3.0

* Chore: replaces toPromise with lastValueFrom

* Chore: removes unused mock that caused test error

* Chore: fixes build error in PieChartPanel

* Chore: fixed build error in requestAllIndices

* Chore: fixes comment

* Chore: trying to reduce docs errors

* Chore: searches for explicit api extractor warnings

* Chore: updates rxjs-spy to 8.0.0

* Chore: reverts to main

* Chore: upgrade rxjs and rxjs-spy
2021-08-19 06:38:31 +02:00
An
7b813c81ac
revert: change to events canvas (#38023) 2021-08-18 15:47:25 -04:00
Leon Sorokin
49b129b110
GraphNG: fix mem leaks & avoid plot re-inits (#38017)
* State timeline: fix mem leak caused by excessive plot re-init

* Update PlotTooltipInterpolator type

* Do not reference config object in the setCursor hook

* fix excessive BarChart re-init caused by shallow diff of text config

* one less error

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-08-18 13:43:53 -05:00
Peter Holmberg
a7b22a73b6
Alerting: Add Copy link to Alert on View rule page (#37967)
* add button to page

* add url to getText

* reorder imports

* build url function

* remove log

* encode
2021-08-18 14:25:56 +02:00
Jack Westbrook
552ecfeda3
Chore: Update NPM packages with react peer deps (#36598)
* chore: bump npm packages with react peer deps

* chore: bump rc-cascader to 1.4.3

* chore: bump react-table to 7.7.0

* chore: bump types packages

* refactor(buttoncascader): use CascaderValueType (fixes typescript errors)

* refactor(cascader): use CascaderValueType (fixes typescript errors)

* chore: bump rc-drawer to 4.4.0

* refactor(drawer): update component to match rc-drawer 4.4.0 api changes

* refactor(cascader): provide backwards compatibility for component apis

* chore(react-test-renderer): bump to match react 17.0.1

* fix(drawer): defer opening RcDrawer so animations play correctly

* chore: bump rc-cascader to 1.5.0
2021-08-18 11:23:34 +02:00
Simon Podlipsky
9900f2ed48
Fix url util converting false into true (#37402)
A value of key-value pair is stripped for boolean values. While this is ok for `true`, it kind of inverts `false`
2021-08-18 10:10:29 +02:00
Domas
cb9912ec0a
Alerting: button to test contact point (#37475) 2021-08-18 10:16:35 +03:00
An
b028dbc537
EventsCanvas: Clean up action to avoid memory leak (#37592) 2021-08-17 17:29:24 -07:00
Ryan McKinley
2ff4b028c8
Core: move dimensions out of geomap into app/features (#37946) 2021-08-17 13:43:54 -07:00
Piotr Jamróz
d93d989a5a
Graphite: Migrate to React (part 4 & 5: group all components) (#37590)
* 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

* Section -> SegmentSection

* Simplify section styling

* Remove redundant div

* Simplify SegmentSection component

* Use theme.spacing

* Use empty label instead of a single space label

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-08-17 18:50:31 +02:00
Josh Hunt
1e221b6452
AzureMonitor: Show error message when subscriptions request fails in ConfigEditor (#37837)
* Fix jsdoc description for datasourceRequest

* Align default subscription width with other fields

* AzureMonitor: Show error message when requesting default subscriptions in ConfigEditor

* update snapshots:
2021-08-17 16:46:15 +01:00
Andrej Ocenas
11c848f00d
Tempo: Service map (#37661)
* Add prometheus queries

* Add stats

* Refactor transform

* Fix stat format

* Refactor transform

* Hide behind feature flag

* Better linking error messages

* Add test

* Add test for datasource

* Fix lint

* Make optionality checking more explicit
2021-08-17 15:48:29 +02:00
sam boyer
6aba592741
Schema: get all devenv dashboards passing validation (#37857)
* Strip nulls (again)

* Add stripnulls script

* Add transformations field

* Close FieldConfig struct; proper plugin validating

* s/graph/viz/ field in histogram dashboard

* Use ui.GraphFieldConfig in histogram model

* Add models for stat, gauge, barguage panel plugins

Also toss necessary shared types into cue/ui/gen.cue, with TODOs to move
them appropriately later.

* Add required license headers

* Heap of updates to cue UI components

* Fix barchart types and one old devenv input

* Use the GraphFieldConfig directly for timeseries

* Add models.cue for a few panel plugins

Barchart, state-timeline, and status-history

* Enable the test validating all devenv dashboards!!

* Fix effects of not checking after making comments

* Update packages/grafana-ui/src/options/models.gen.ts

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>

* Realign and unalign cue with ts types

* Update devenv test to sniff for null errors

Best option we have right now for helping people to know they need to
strip nulls from devenv dashboards.

* Add speculative default for barchart stacking

* Fixup some dated devenv dashboards

timeline-modes needed to be regenerated with the appropriate tooltip
values included, per typing requirements, and timeline-demo needed to
have the `mode` field removed, as it is not intended to be persisted.

* Add necessary missing options for various panels

* Regenerate devenv dashboards

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-08-17 07:11:57 -04:00
Will Browne
697ac937c6
fix with global config state (#37293) 2021-08-17 12:16:34 +02:00
Jack Westbrook
483c597740
Storybook: Fix Graph with Tooltip story (#37937) 2021-08-17 10:14:57 +02:00
Tobias Skarhed
89572926c3
Search: Make search icon keyboard navigable (#37865)
* Make search icon keyboard navigable

* Update text

* Update test

* Remove unused line

* Add global focus-visible styles for button
2021-08-16 15:51:44 +02:00
Maria Alexandra
1735f9a56b
Navigation: Add aria-label to top section links to improve a11y for screen readers (#36953) 2021-08-16 15:10:57 +02:00
Sergey Kostrukov
10cc9bda74
Toolkit: return original stack trace for webpack errors (#37814) 2021-08-14 13:49:56 -07:00
Leon Sorokin
0e3fb55caa
Tooltip: bring back optimized hoverpoint code (#37901) 2021-08-13 15:35:41 -05:00
Leon Sorokin
6a77cd43ae
GraphNG: refactor by-value color schemes (#37670)
* GraphNG: account for top canvas padding in gradient gen for color scheme/thresholds-by-value

* Updated test dashboard

* Added fix for issue when scaleMin was same as threshold

* fixed firefox issue

* revert docs changes

* update gdev dash for easier comparisons & regression spotting

* refactor

* optimize gradient re-gen/re-use and color more tinycolor.setAlpha() -> alpha(). update uPlot to dev build.

* fix percentage steps

* implement % threshold region rendering

* crisp threshold line rendering

* simplify

* WIP: hoverpoint dynamic color interpolation

* fix hover point color interp

* re-use gradient gen to draw threshold areas

* re-implement by-value color scales

* tweak comment

* mimic tinycolor behavior in colorManipulator.alpha() for empty colors

* explicitly disable hover points for BarChart and Histogram

* reduce test failures and required changes to tests

* fix barchart tests

* uPlot 1.6.15

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-08-13 09:38:04 -05:00
Ashley Harrison
d4098cf098
Select: Add menuShouldPortal to a couple that got missed (#37847) 2021-08-13 08:35:24 +01:00
ying-jeanne
d18bd03a82
Scuemeta: Fix cue schemas for panels (#37788)
* complete the data model of graph panel

* fix histogram graph

* fix timeseries panel type

* Update cue/ui/gen.cue

Co-authored-by: sam boyer <sam.boyer@grafana.com>

* fix graph/viz and gradientMode enum

* add the changes into cue component and remove fields for graph panel

Co-authored-by: sam boyer <sam.boyer@grafana.com>
2021-08-12 09:52:03 -04:00
Connor Lindsey
4a9fdb8b76
Add span duration to left panel in trace viewer (#37806) 2021-08-12 06:54:55 -06:00
Tobias Skarhed
b6ede8d96d
Chore: Low hanging a11y fruits (#37783)
* aria-label disallowed on header element

* A11y issues for Getting Started and panel header

* Add unique identifier to search navigation

* Add dashboard header markup

* Fix news panel low hanging fruits
2021-08-12 11:13:03 +02:00
Ryan McKinley
3205450210
Transformations: support a synchronous transformation pattern (#37780) 2021-08-11 01:25:33 -07:00
Ryan McKinley
36c798eb2f
Chore: define base panel type in @grafana/data (#37766) 2021-08-11 00:23:41 -07:00
Piotr Jamróz
31bb3522c8
Graphite: Migrate to React (part 3: migrate segments) (#37309)
* 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

* 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

* Use block docs for better doc generation

* Handle undefined values provided for autocomplete

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-08-11 09:13:55 +02:00
nikki-kiga
87b8a74576
Tooltip: display ms within minute time range (#37569)
* Tooltip: add hasMs flag for system dateTime format

* Tooltip: display ms in sub minute time range

* Tooltip: add field check, increase range on tests

* Add diffrentiating test

* minimize parsing to string values

Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
2021-08-10 13:54:44 -07:00
Tobias Skarhed
fa731f16bf
DashboardLinks: Screen reader accessibility #37682 2021-08-10 16:55:25 +02:00
Tobias Skarhed
5b575ae91f
TimeRangeOption: Make entire list item clickable #37730 2021-08-10 12:43:50 +02:00
Zoltán Bedi
ad6a4edfeb
UI: FileDropzone component to handle file list overwrite (#37685)
* UI: FileDropzone component to handle file list overwrite

* FileListItem: use type=button everywhere

* Update packages/grafana-ui/src/components/FileDropzone/FileDropzone.story.tsx

Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>

* FileListItem: add aria-hidden and change cancel text

* Update packages/grafana-ui/src/components/FileDropzone/FileListItem.test.tsx

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

Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2021-08-10 10:23:49 +02:00
Ivana Huckova
a02f9be0c6
Explore: Fix showing of full log context (#37442)
* Fix log context

* Update to auto values insted of unset

* Update comment

* Fix redundant left margin for non-wrapped logs

* Remove unused css styling

* Adjust width and height
2021-08-10 09:01:57 +02:00
Zoltán Bedi
33aeee60ff
Toolkit: Fix matchMedia not found error (#37643) 2021-08-10 07:34:35 +02:00
sam boyer
6ae5db5608
Adapt dashboard schema to validate on some devenv dashboards (#37594)
* Remove null values from JSON

* Specify the color field

* Add note about openness of custom field's struct

* Update schemaVersion

* Specify thresholds

* Add panel id

* Add maxDataPoints and interval

* Add mappings, albeit very under-specified

* Allow empty string for timezone field

This is probably not a good idea - same as allowing nulls.

* Allow false for refresh - otherwise, string

* Make threshold value optional

* Make interval optional

* Fix broken and changed decls in ui models

* Add models.cue for timeseries panel

* Fixups for home dashboard

* Add timeShift, timeFrom

* Abstract out #Target, rejigger comments
2021-08-10 00:49:58 +08:00
Alex Khomenko
a6a09add7a
DateTimePicker: Use TZ independent formatter (#37676) 2021-08-09 12:37:53 +03:00
Tobias Skarhed
2d33ddf37f
Dashboard: Accessible text for search links #37593 2021-08-09 09:59:29 +02:00
Zoltán Bedi
7e42bb5df0
Toolkit: rename deprecated tsConfig to tsconfig (#37630) 2021-08-06 14:04:42 +02:00
Ivana Huckova
ba76877d28
Datasource: Pass access type to data source instance settings (#37577)
* Pass Access info to datasourceInstance

* Update packages/grafana-data/src/types/datasource.ts

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

* Type access as direct | proxy

* Fix tests where mocking datasourceInstance, include access

* Pass access to data source instance mocks

* Update comment

* Pass access to data source instance mocks

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-08-06 09:24:35 +02:00
Leon Sorokin
cf1c2c374f
Tooltip: fix time label mismatched with cursor & hover points (#37615) 2021-08-05 22:33:26 -05:00
Gábor Farkas
9417e86316
Updated "react-use" package to newest version (#37579)
* package.json: updated react-use to newest version

* fixes (typescript and other)
2021-08-05 14:32:51 +02:00
Leon Sorokin
d49ce5ad47
GraphNG: optimize cursor (#37460) 2021-08-04 16:13:11 -05:00
Leon Sorokin
27b94139ed
XYCanvas: useMemo() for className gen (#37513) 2021-08-04 13:47:43 -05:00
Leon Sorokin
1fe3452886
Field: use 0-based field.state.seriesIndex (#37563) 2021-08-04 13:02:27 -05:00
An
968817b151
Geomap: Use set to order labels in reducer (#37509)
* shared location config

* shared locaiton config

* shared locaiton config

* remove file

* add alpha annotations

* chore: set is already ordered

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-08-04 12:07:59 -04:00
Alex Khomenko
1a46123dbf
TimeRangePicker: fix DOM nesting (#37550) 2021-08-04 17:04:31 +02:00
Ashley Harrison
8aa3845f70
Select: Make portalling the menu opt-in, but opt-in *everywhere* (#37501)
* Select: Don't portal by default

* Select: Portal all the Selects

* Fix indendentation in this comment

* Select: Remove @example docs until formatting is correct

* Docs: Add some documentation for the Select changes

* Update docs/sources/whatsnew/whats-new-in-v8-1.md

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* Update docs/sources/whatsnew/whats-new-in-v8-1.md

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* Update packages/grafana-ui/src/components/Select/types.ts

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* Update public/app/core/components/TransformersUI/configFromQuery/ConfigFromQueryTransformerEditor.tsx

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* Update public/app/core/components/TransformersUI/configFromQuery/ConfigFromQueryTransformerEditor.tsx

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* Update public/app/core/components/TransformersUI/configFromQuery/ConfigFromQueryTransformerEditor.tsx

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* Update public/app/core/components/TransformersUI/prepareTimeSeries/PrepareTimeSeriesEditor.tsx

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* Docs: Variants instead of varients

* Update public/app/core/components/TransformersUI/configFromQuery/ConfigFromQueryTransformerEditor.tsx

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
2021-08-04 15:47:53 +01:00
Jack Westbrook
cc7c54be0e
Plugins: Update Catalog Card UI (#37350)
* feat(catalog): lazy load and add alt text to plugin logos

* refactor(catalog): use plugin types, make sure data is available for new ui

* test(catalog): fix up tests after types refactor

* feat(catalog): introduce Tile and PluginBadge components for ui updates

* refactor(catalog): update PluginList to use new components, lazy load images, add creditcard icon

* test(catalog): update Browse.test types

* fix(catalog): if local and remote make sure to get the correct local plugin from array

* refactor(catalog): prefer grafana/ui components over custom Tile component

* chore(catalog): delete redundant components

* feat(catalog): introduce ascending descending name sort for Browse

* refactor(catalog): prefer theme spacing over hardcoded values

* refactor(catalog): update Local and Remote plugin types to match api responses

* fix(catalog): prefer local.hasUpdate and local.signature so updateable plugin signature is valid

* test(catalog): update test plugin mocks

* test(catalog): add tests for sorting and categorise

* test(catalog): add tests for plugin cards, remove grid component

* test(catalog): add tests for PluginBadges component

* refactor(catalog): change enterprise learn more link to open plugin page on website
2021-08-04 15:09:57 +02:00
Tobias Skarhed
aba7013ce5
TimeRangePicker: Accessiblity improvements (#36912)
* Add low hanging aria markup

* Add a list of radio buttons

* Add ref to put focus

* Add landmark markup

* Add labels to icon buttons

* Add radio button groupings

* Add keyboard focus styles

* Improve markup

* Update test selector

* Remove testid in favor of text

* Fiddle around with test labels

* Get correct testid selector

* Add aria-expanded to button

* Change order of quick select for keyboard nav

* Create headings for easier heading navigation

* Add another h3

* Add testid

* Use selectors in e2e test

* Add dataid selector for narrow absolute button

* Update e2e test with proper selectors

* Add more verbose aria-label

* Change editor to picker
2021-08-04 09:53:52 +02:00
Oscar Kilhed
e3fe4a2d11
GraphNG: make sure we update when children changes (#37333) 2021-08-04 09:07:00 +02:00
Leon Sorokin
0b7253406b
Portal: optimizations (#37459)
Co-authored-by: An Le <an.le@grafana.com>
2021-08-03 16:27:27 -05:00
Leon Sorokin
0d2cd90150
GraphNG: fix y axis autosizing (#37464) 2021-08-03 08:18:05 -05:00
Ashley Harrison
9934c883cc
Select: Expose menuPortalTarget on SelectBase (#37456)
* Select: Expose Select props for greater flexibility

* Select: only expose menuPortalTarget

* Select: Add deprecation notice for menuPortalTarget prop

* Select: Add deprecation warning to component
2021-08-03 11:55:09 +02:00
nikki-kiga
9fa8f5cc95
TooltipPlugin: add crosshair exception (#37285)
* TooltipPlugin: add crosshair exception

* TooltipPlugin: set active plot and add class

* Plot: hide cursor pts when not active in crosshair mode

* TooltipPlugin: clean up adding class

* TooltipPlugin: rename crosshair class

* rename class, move up to chart root element

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-08-02 11:25:51 -07:00
Connor Lindsey
6906a74179
Jaeger: Sync getTraceName improvements from upstream (#37408)
* Improve trace name resolution

* Use getTraceName in transformTraceData

* Improve getTraceName performance

* Change trace-viewer extension back to ts
2021-08-02 08:23:43 -06:00
Connor Lindsey
0699a04dcd
Refactor UNSAFE_component... from SpanGraph and VirtualizedTraceView (#37418) 2021-08-02 08:03:08 -06:00
Connor Lindsey
e4f0d269f4
Connor/jaeger misc sync (#37420)
* Avoid resize on mouse hover (KeyValueTable)

* Add null check for span.logs in filter-spans

* Display references unless it's a single CHILD_OF

* Identify uninstrumented services

* Improve span duration formatting
2021-08-02 06:28:20 -06:00
An
c564736c68
Transformers: allow label fields in the reduce processor (#37373)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-07-29 13:56:07 -07:00
Leon Sorokin
78f46e28c7
Stat: fix shared y scale range, reduce plot re-inits (#37324) 2021-07-28 22:42:18 -07:00
Ryan McKinley
ced26bc624
Geomap: implement basic tooltip support (#37318)
Co-authored-by: Bryan Uribe <buribe@hmc.edu>
2021-07-29 03:34:42 +02:00
Leon Sorokin
8b80d2256d
GraphNG: stack by % (#37127) 2021-07-28 20:31:07 -05:00
Ryan McKinley
5f41c2f334
Geomap: fix esri server config (#37283) 2021-07-27 22:26:42 -07:00
Piotr Jamróz
8d7e22e1bb
Graphite: Migrate to React (part 2B: migrate FunctionEditor) (#37070)
* 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

* Rename .tsx -> .ts

* Update types

* Use ?? instead of || + add test for mapping options

* Use const (let is not needed here)

* Revert test name change

* Allow removing only optional params and mark additional params as optional (only the first one is required)

* Use theme.typography.bodySmall.fontSize

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-07-27 13:10:39 +02:00
nikki-kiga
01e984c394
ColorPicker: display colors as rgba in input (#37231)
* SpectrumPalette: change input to display rgba string

* fieldOverrides: remove extra hex string check
2021-07-26 15:54:13 -07:00
An
154c380c8c
Geomap: configure legend on map (#37077)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-07-27 00:50:15 +02:00
Nathan Rodman
5f0bc252bc
Alerting: support label matcher syntax in alert rule list filter (#36408)
* Add filter parsing to rule list filters

* Add unit tests for label parsing

* Make label operators an enum

* add example for parsing function

* Update labels operator regex

* Add tests to rule list for filtering

* add additional test for testing alert instances filtering

* Use tooltip for query syntax example

* refactor to use Matchers for filtering

* Update docs for label filtering on rules list

* style fixes
2021-07-26 12:05:49 -07:00
Ryan McKinley
ffa0ef9b3d
Annotations: fire an event when changing annotations (#37175) 2021-07-26 20:57:52 +02:00
nikki-kiga
3e35021f7e
ColorPicker: return values as hex strings and update theme (#37173)
* Color: fix alpha calculation < 16/255 and State-timeline threshold alpha

* SpectrumPalette: Update to getColorByName

* ColorValueEditor: Update to theme2

* SpectrumPalette: Update to theme2

* ColorPickerPopover: Format hex color

* SpectrumPalette: Format hex color

* SpectrumPalette: Refactor hex color alpha helper

* SpectrumPalette: Fix import and update helper

* ColorPickerPopover: Fix test to not make lowercase

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-07-26 11:11:53 -07:00
Alex Khomenko
8c8d2fe08b
Use dateTime vs new Date() (#37210) 2021-07-26 18:18:15 +02:00
Connor Lindsey
b644ea9e6e
Loki: Add fuzzy search to label browser (#36864) 2021-07-26 08:04:03 -06:00
Zoltán Bedi
04a196da4b
UI: Dropzone component (#36646)
* Dropzone component

* Add file list

* Add progress, error and cancelation to filelistitem

* Update Dropzone component to support progress

Cancelation
Retry

* Update file name changes

* Rename to FileDropzone

* FileListItem tests

A11y updates for icon buttons
Use value formatter from grafana/data

* Add tests for FileDropzone

Review comments

* export FileDropzoneDefaultChildren

* Change primary text when multiple false

* Review comments addressed

* Extract remove file to constant

* No need to await after await
2021-07-26 13:21:35 +02:00
Leon Sorokin
f78452be30
Color: fix alpha calculation < 16/255 and State-timeline threshold alpha (#35911) 2021-07-23 20:50:47 -05:00
Leon Sorokin
4c3e197e26
TimeSeries: make cursor hover the nearest non-null/undefined datapoint (#34552) 2021-07-23 16:05:09 -05:00
nikki-kiga
a1bbe797df
StatPanel: Disable selection on Sparkline (#37125) 2021-07-22 15:12:31 -07:00
Sergey Kostrukov
4664cba935
Prometheus: Azure authentication in configuration UI (#35860)
* Azure authentication settings

* Persisting credentials

* Azure settings

* Prometheus-specific settings component

* Azure Prometheus Resource ID configuration

* DataSourceHttpSettings with extensibility for Azure

* Feature toggle for Azure auth

* Fix snapshot

* Update format of persisted credentials

* AzureSettings renamed to AzureAuthSettings
2021-07-22 19:53:49 +01:00
Tobias Skarhed
437424d5d6
Storybook: Add a11y addon (#36790)
* Storybook: Add a11y addon

* Update lockfile

* Bump Storybook addon versions

* Put Icon at top

* addon-knobs 6.3.0
2021-07-22 17:28:38 +02:00
Andrej Ocenas
93b4cc7035
Explore: Fix encoding of internal URLs (#36919)
* Encode internal explore url

* Fix tests

* Fix comma
2021-07-22 14:42:20 +02:00
Tobias Skarhed
8af83b8b78
IconButton: Put tooltip text as aria-label (#36760)
* Make tooltip prop aria-label

* Add ariaLabel prop
2021-07-22 13:56:25 +02:00
Ryan McKinley
9cd8e11c30
Geomap: add basic gazetteer support (#37082) 2021-07-21 23:41:27 -07:00
Dominik Prokop
40a87a7851
BarChart: use uPlot's native bars pathbuilder (#36725) 2021-07-22 00:50:59 +02:00
Leon Sorokin
395289f45d
GraphNG: uPlot 1.6.14 (#37045) 2021-07-21 15:27:22 -07:00
Ryan McKinley
e604e69d93
Geomap: default basemap config cleanup (#37069) 2021-07-21 13:48:20 -07:00
Atif Shoukat Ali
f699580b15
fix: utils deps (#36939) 2021-07-21 12:28:35 -07:00
Piotr Jamróz
0bf1a97262
Graphite: Migrate to React (part 2: migrate smaller AngularJS directives) (#36797)
* 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

* Simplify setting Segment Select min width

* Extract view logic to a helper and update types definitions

* Clean up types

* Update FuncDef types and add tests

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-07-21 20:09:00 +02:00
Eunice Kim
02b5a18da2
Geomaps: Add default base layer (#37043) 2021-07-21 10:20:30 -07:00
Eunice Kim
3b0d7fc00b
Geomap: Base layer server configuration (#37041) 2021-07-21 17:54:05 +02:00
Ryan McKinley
46eac518d3
Geomap: set value default on init (#36960) 2021-07-20 15:52:12 -07:00
Ashley Harrison
4f315bf48f
VizTooltip: Use previous positioning calculation (#36861)
* VizTooltip: Use previous positioning calculation

* VizTooltip: Don't need to check for tooltip width/height here

* VizTooltip: Disable pointer-events in the mixin

* VizTooltipContainer: Move pointerEvents to inline style to prevent breaking AnnotationMarker

* Move comment to correct place

* No need to change this
2021-07-20 14:49:50 +01:00
Ashley Harrison
220b964de5
Chore: Fix more TypeScript errors (#36918)
* TypeScript: Fix some strict typescript errors

* Fix more strict typescript errors

* Few more fixes

* Better string conversion

* update check script to 195
2021-07-20 09:57:03 +01:00
Sarah Zinger
f32d200fc0
E2E: Add support for data-test-id over aria labels and add importDashboard flow (#36483)
* E2E: Add support for data-testids and not just aria-labels.
2021-07-19 14:01:31 -04:00
Piotr Jamróz
ef689d0c24
SegmentSelect: Do not call onCloseMenu when a value was selected (#36905)
* Do not call onCloseMenu when a value was selected

Otherwise a wrong value might be picked up from the input in case when part of the value is in the input (used for filtering) and the actual value is selected.

* Add more docs
2021-07-19 19:57:09 +02:00
Ryan McKinley
85a14a0503
Geomap: configure size and color with different fields (#36825) 2021-07-19 19:16:42 +02:00
Ryan McKinley
d4fa2529c8
Geomap: make the geomap panel beta and label alpha layers (#36894) 2021-07-19 08:07:28 -07:00
Tharun Rajendran
ecd2c320ba
GlobalStyle: Add focus style for links (#36533)
* GlobalStyle: Add focus style for links

* GlobalStyle: show focus style only on visible
2021-07-19 16:17:45 +02:00
Tobias Skarhed
cfd06775c0
Dashboard: Add accessible landmark markup (#36753)
* Add landmark markup

* Make panel titles h2

* Descibe panel landmarks

* Add nav elements and heading 1

* Reset line height and remove margin

* Make focus styles visible

* Change nav to section

* Add desc

* Fix focus styles cutoff
2021-07-16 21:48:47 +02:00
nikki-kiga
2172920095
Tooltip: Make active series more noticeable (#36824)
* fix: make active series in tooltip more noticeable

* update font and spacing theme values
2021-07-16 11:28:35 -07:00
Olof Bourghardt
f4f2c197ae
Explore: Add switch to restructure logs for better readability (#36324)
* Add prettifyLogMessage to select components in test file

* Change entry depending on the value of prettifyLogMessage

* Add prettifyLogMessage to state

* Fix merge conflict

* Fixe bug where the log message wasn't parsed as JSON

* Implement function to restructure all logs

* Change elstic image version back to 7.7.1

* Add showCommonLabels that was missing

* Remove comment

* Put import of getParser together with the other imports

* Logs: fix bug where message isn't restructured if it contains ANSI code

* Logs: change label for switch to Restructure

* Remove unnecessary file

* Logs: added divider before switch component

* Add dividers between the different log options

* Remove unintentional changes

* Explore: remove dividers in log settings

* Explore: refactor for LogRowMessage for better readability

* remove unnecessary change

* Logs: fix bug where logs aren't restructured if they have highlights

* Logs: minor refactoring

* Logs: use memoizeOne to prevent parsing on every re-render

* Logs: calculate needsHilight inside renderLogMessage instead of outside

* Logs: fix bug where logs aren't prettified when wrap logs is disabled

* Explore: change name to prettify

* Remove console.log

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

* Dashboards: add switch to prettify log messages to the Logs fields

* Logs: make prettify only work for JSON logs

* Logs: fix bug with tests for logs

* Update public/app/plugins/panel/logs/module.tsx

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

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2021-07-16 15:08:47 +02:00
Piotr Jamróz
3778e9bbbd
SegmentSelect: Fix closing the menu on click out (#36816) 2021-07-16 08:39:06 +02:00
Ryan McKinley
8de218d5f1
Geomap: use a common configuration builder to find location fields (#36768) 2021-07-15 12:00:19 -07:00
Ashley Harrison
8c91b290ba
Select: Block scroll on select instead of trying to hide the menu (#36783) 2021-07-15 10:54:38 +01:00
Ryan McKinley
6d87b26d6c
OptionsUI: add standard field name picker (#36732) 2021-07-14 11:54:58 -07:00
Ashley Harrison
9cfb7d801f
Modal: Force modal content to overflow with scroll (#36754) 2021-07-14 15:35:34 +01:00
Ashley Harrison
54f8996acf
Select: Portal select menu to document.body (#36398)
* ValueMappings: Force overflowing modal content to scroll

* ValueMappings: Update unit tests

* Select: Portal Select to document.body, close menu on scroll

* Select: Fix tests + apply updates from https://github.com/grafana/grafana/pull/32833

* ValueMappingsEditorModal: Revert to using selectEvent in the tests

* Select: Fix remaining unit tests

* Portal: Rewrite Portal as a functional component so we can use useTheme2

* Modal: Remove modal styles from this PR

* Update E2E tests

* More unit test fixes

* Select: Fix remaining E2E tests

* Select: Create util method to select an option in tests
2021-07-14 14:04:23 +01:00
Ryan McKinley
92801d5fa1
Transformations: add 'prepare time series' transformer (#36737)
* adding transformer that will stretch a data frame from wide to long.

* added a UI for the stretch frames transformer.

* refactored according to feedback.

* removed unused dep.

* making sure it is being displayed.

* minor adjustments.

* move stretch to prepare

* improved readability of tests.

* refactored to use a function component syntax.

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2021-07-14 11:24:12 +02:00
Ryan McKinley
db5597ab9a
DataLinks: support 'onClick' from table panels (#36682) 2021-07-13 09:43:39 -07:00