Commit Graph

24107 Commits

Author SHA1 Message Date
Ivana Huckova
62c824e3a4
Explore: Rich History (#22570)
* Explore: Refactor active buttons css

* Explore: Add query history button

* WIP: Creating drawer

* WIP: Create custom drawer (for now)

* Revert changes to Drawer.tsx

* WIP: Layout finished

* Rich History: Set up boilerplate for Settings

* WIP: Query history cards

* Refactor, split components

* Add resizability, interactivity

* Save history to local storage

* Visualise queries from queryhistory local storage

* Set up query history settings

* Refactor

* Create link, un-refactored verison

* Copyable url

* WIP: Add slider

* Commenting feature

* Slider filtration

* Add headings

* Hide Rich history behind feature toggle

* Cleaning up, refactors

* Update tests

* Implement getQueryDisplayText

* Update lockfile for new dependencies

* Update heading based on sorting

* Fix typescript strinctNullCheck errors

* Fix Forms, new forms

* Fixes based on provided feedback

* Fixes, splitting component into two

* Add tooltips, add delete history button

* Clicking on card adds queries to query rows

* Delete history, width of drawers

* UI/UX changes, updates

* Add number of queries to headings, box shadows

* Fix slider, remove feature toggle

* Fix typo in the beta announcement

* Fix how the rich history state is rendered when initialization

* Move updateFilters when activeDatasourceFilter onlyto RichHistory, remove duplicated code

* Fix typescript strictnull errors, not used variables errors
2020-03-10 15:08:15 +01:00
Torkel Ödegaard
da37f4c83f
XSS: Fixed history XSS issue (#22680) 2020-03-10 14:56:27 +01:00
Erik Sundell
cd012bdfb4
Fix caching problem (#22473) 2020-03-10 14:10:48 +01:00
Shavonn Brown
65370c5443
on update for checkbox and switch (#22656)
* on update for checkbox and switch

* use ? instead
2020-03-10 08:45:08 -04:00
Tobias Skarhed
7598d3fb43
Notification Channel: Make test button wider (#22653)
* Remove width
2020-03-10 13:17:03 +01:00
Marcus Efraimsson
c12245bbb3
Backend plugins: Updates due to changes in SDK (#22649)
Use v0.20.0 of SDK
2020-03-10 12:59:03 +01:00
Dominik Prokop
805abdfa2a
Make sure commit hook in FieldPropertiesEditor is invalidated when value changes (#22673) 2020-03-10 12:45:51 +01:00
Rob McGuire
17a14a8a48
Docs: Plugin.json: Fix property descriptions, add missing properties, add example (#22281)
* Fix property descriptions, add missing properties

Fixes incorrect property descriptions, adds missing properties, and adds an up-to-date example.

* Update logo descriptions

Updates the "large" and "small" logo descriptions to specify SVG image type requirement, and that they may be identical

* Update docs/sources/plugins/developing/plugin.json.md
2020-03-10 11:50:14 +01:00
Miguel Carvajal
6979b44592
Alerting: Fixed bad background color for default notifications in alert tab (#22660)
* fix: remove harcoded bg color

* added default info

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2020-03-10 11:24:23 +01:00
Torkel Ödegaard
4e25823705
Webpack: Updated terser plugin (#22669) 2020-03-10 11:09:45 +01:00
Alex Khomenko
5aeb367322
Core: DashboardPicker improvements (#22619)
* Refactor the picker to FC

* Remove redundant variable

* currentDashboardId => currentDashboard

* Make isClearable configurable

* Use useAsyncFn for options loading

* Move getDashboards outside of component
2020-03-10 11:16:56 +02:00
Alex Khomenko
385be77687
Storybook: Forms.Form docs (#22654)
* Add Select error message

* Update Form docs

* Tweak examples

* Fix docs
2020-03-10 10:23:35 +02:00
Marcus Andersson
cc813d71c6
Templating: Migrates some variable types from Angular to React/Redux (#22434)
* Refactor: Adds variables in state to TemplateSrv

* Refactor: Introduces some typings and structures

* Refactor: Introduces picker to adapter

* Refactor: Removes useState and introduces contains instead

* Refactor: Introduces Variable Editor

* Refactor: Adds uuid and simplifies state

* Refactor: Consolidates to VariableRenderer

* Refactor: Adds name change capability

* Refactor: Adds variableMiddleware

* Refactor: Adds ability to change Angular type to type in State

* Fix: Fixes so we check for duplicate names

* Refactor: Adds ability to change State type to type in Angular

* Refactor: Updates name in dashboard templating list

* Refactor: Adds label change to VariableEditor

* Refactor: Adds hide change to VariableEditor

* Refactor: Adds update ability

* Refactor: Adds tooltip

* Refactor: Adds SelectionOptionsEditor

* Refactor: Adds query editor and validation

* Refactor: Adds regex and sort to editor

* Refactor: Adds Selection options

* Refactor: Adds Varible Values Previewer

* Refactor: Changes from array in state to Record

* Refactor: Removes getVariableAtIndex from templateSrv

* Tests: Fixs broken tests

* Chore: Fixes duplicate merge import

* Refactor: Removes strict null errors

* Refactor: Adds duplicate variable

* Refactor: Adds remove variable

* Refactor: Adds change order of variables

* Refactor: Adds add new variable

* Chore: Fixes Prettier formatting

* Refactor: Adds VariablePicker

* Fixed so sub menu is displayed when we only have redux template variables.

* removed unused variable.

* tags will be visibile in the new react picker.

* added some nice colors to the tags.

* Added thunk for selecting a tag.

* Refactor: Cleans up templating state when dashboard unloads

* Refactor: Adds save capabilities for variables in state

* added possibility to select tag.

* Added so you can deselect a tag.

* Fixed issue with coloring on top.

* minor refactoring to make the code more slim.

* Refactor: Fixes dispatch return and copy of variable

* selecting options when tag i selected

* small refactoring.

* fixed so we use options.

* Refactor: Adds getValueForUrl capabilities

* first implementation of keyboard navigation on picker.

* removed comment.

* fixed so you can toggle all options.

* Refactor: Simplified state handling using Redux Toolkit and flat reducer structure

* Refactor: Adds sharedTemplatingReducer and queryVariableReducer

* Tests: Fixs broken tests

* Chore: Removes some strict null errors

* Tests: Fix broken tests

* Refactor: Splitted QueryVariablePicker into smaller components

* Refactor: Moves linktext and selected tags to component instead

* Fix: Fixes the ability to have multiple dropdowns opened at same time

* Fix: Fixes onKeyDown from prev refactor

* Refactor: Adds searchfilter searching

* Tests: Fixes after running e2e tests

* Refactor: Adds an attempt to solve dependencies at startup

* Refactor: Adds feature toggle

* Refactor: Resets all angular files to master

* Refactor: Move stuff to query folder

* Refactor: Initial commit for SubMenu component

* Refactor: Updated DashboardModel with new list

* Refactor: Adds feature toggle to dashboard model and friends

* Refactor: Adds picker to SubMenu

* Refactor: Fixes styling on SubMenu

* Refactor: Fixes processvariables

* Refactor: Initial EditorList skeleton

* Refactor: Refactors out VariableEditorList and VariableEditorContainer

* Refactor: Adds New variable functionality

* Refactor: Adds registred types

* Refactor: Adds edit existing variable functionality

* Refactor: Changes params to thunks

* Refactor: Small fix for cleaning up state when clicking update/add

* Refactor: Better typings for outer containers

* Refactor: Adds change order functionality

* Refactor: Removed notify angular args

* Change so the url is in sync with the redux template variables.

* Adding support for saving proper values and checking changes.

* Refactor: Adds duplicate variable functionality

* Feature: Adds remove variable functionality

* Refactor: Small refactor so e2e tests work as before

* Refactor: Returns null if no visible variables

* Refactor: Adds annotations to SubMenu

* Refactor: Fixes toggling of annotations in SubMenu

* added dashboard links to new submehu.

* Refactor: Small refactor breaking up into smaller components

* Fix: Fixes infinite recursive loop when changing varible name

* Templating: Do not mutate location query state

* Refactor: Fixes minor timing issue when adding new variable

* Refactor: removes initialization in variable_srv constructor

* Refactor: Suggestion on how to handle templating.list in DashboardExporter

* Refactor: Adds getVariables typings and changes ChangeTracker and ShareSnapshotCtrl

* Refactor: Adds getVariable on DashboardModel and changes DashboardMigrator

* Fix: Fixes repeated panels

* wip: starting to add custom variable type.

* Refactor: Merging two different toVariablePayload functions

* Tests: Fixes broken tests

* Fix: Reduces strict null errors

* Tests: Initial commit and fixes strange dependency order

* Tests: Covers sharedTemplatingReducer with tests

* Refactor: Rename state/index.ts => state/reducers.ts as every where else

* Refactor: Renames and moves adapters.ts

* Tests: Adds tests for templatingReducer

* Tests: Adds intitial tests for queryVariableReducer

* starting to ad custom variable.

* Tests: Adds more queryVariableReducer tests

* Added support for custom variable. Next up applying some DRY principles and refactoring.

* fixed compile issue.

* added todo.

* Tests: Fixes broken test

* Tests: Covers queryVariableReducer with tests and fixed a couple of bugs

* Fix: Fixes broken test

* Fix: Reduces strict null errors

* change so custom won't be depending on anything elese.

* fixed descriptions.

* removed unused dependency.

* Fixed issue when adding a new variable and editor is being unmount twice.

* fixed issue with select option loop.

* changed so we update query on typing in editor and removed it from component state.

* Moved runQuery up one level in the component tree.

* renamed action and moved it to custom actions.

* moved applyStateChanges to shared code.

* removed todo comment.

* first stab on moving picker to more general.

* Refactor: Changes so we always show variables type

* removed duplicate code regarding picker.

* Did some renamings.

* Feature: Adds text box variable type

* moved tests from query reducer to picker reducer.

* Removed picker from VariableState.

* removed reference to picker.

* Some more refactorings of the picker reducer + actions.

* Chore: Refactors away editor state to its own state slice (#22515)

* Refactor: Inital move, tests not working

* Tests: Adds editorReducer tests

* Refactor: Cleaning up

* Refactor: Moves logic to thunk instead

* Refactor: Initial commit

* Refactor: Combines reducers to one state

* Refactor: Adds combine reducers

* moved navigation logic flow to a thunk instead of in the component.

* fixed issue with rendering picker link.

* Refactor: Removes variable prop from templating.variables

* refactored and removed some more code.

* Feature: adds Constant variable type

* fixed so tags can be selected.

* Fix: fixes default hide for constant and enum order

* fixed so tags works again.

* Fix: fixes so we use Angular editor when newVariables is not defined

* Fix: fixes wrong hide default for Constant variable

* Fix: fixes bug when using duplicate button

* Fix: changes action id

* Tests: prepares for newVariables

* Chore: reduces strict null errors

* Refactor: removes uuidInEditorReducer for simplification

* Chore: changes after PR comments

* Chore: uses getConfig instead of config

* Tests: fixes so e2e tests check for feature toggle and fixed initLock bug

* Refactor: changes so sharedReducer uses createSlice instead

* Refactor: changes textBoxVariableReducer to use creactSlice instead

* Refactor: changes queryBoxVariableReducer to use creactSlice instead

* Refactor: changes customVariableReducer to use creactSlice instead

* Refactor: changes constantVariableReducer to use creactSlice instead

* Refactor: moves types to specific types.ts files instead

* changed so we use queryValue stored on the variable to populate options input when opening picker.

* Feature: adds the ability to test templating thunks using real store and middleware

* Chore: cleans up unused import

* excluded queryValue from the getSaveModel

* Refactor: adds whenAsyncActionIsDispatched to reduxTester

* Tests: adds initial tests for processVariables

* Added reducer tests for constant variable.

* added tests for custom reducer.

* added tets for texbox reducer.

* Tests: adds more tests for ProcessVariable

* Refactor: fixes processVariable flow so we do notrun updateOptions twice

* Tests: finishes tests for processVariables and removed skip test

* added actions tests for custom and constant.

* Tests: adds tests for setOptionFromUrl

* Tests: adds a naive variable mock builder

* Tests: adds tests for validateVariableSelectionState

* added tests for query variable actions.

* added last test for query actions.

* added more tests.

* some more tests.

* fixed typing errors.

* Fixed issues with variable tags.

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2020-03-10 08:53:41 +01:00
Alex Khomenko
88c3b719a1
Grafana UI: Fix Forms.Select onChangeWithEmpty (#22647)
* Sort props

* Add missing deps to useCallback
2020-03-10 08:41:38 +02:00
Chad Nedzlek
0e7c746a87
Azure Monitor: Fix app insights source to allow for new __timeFrom and __timeTo (#21879)
* Fix app insights source to allow for new __timeFrom and __timeTo

* Try fixing the switch
2020-03-10 00:55:41 +01:00
Steven Vachon
cd42b31da5
@grafana/e2e: install necessary dependencies for published package (#22657) 2020-03-09 14:16:09 -04:00
Dominik Prokop
0304493bd2
DashboardSave: Correctly overwrite dashboard when saving (#22650) 2020-03-09 18:16:10 +01:00
Torkel Ödegaard
5d8fc6a1a9
StatPanel: Fixes base color is being used for null values (#22646)
* StatPanel: Fixed color for null values

* StatPanels: Show base value for null values
2020-03-09 17:00:25 +01:00
Dominik Prokop
9d858220ce
FieldOverrides: Add value mappings editor to standard config properties registry (#22648) 2020-03-09 15:09:32 +01:00
hutuxian
9716289196
Docs: Update gauge.md (#22637)
Update the hierarchy of gauge.md
2020-03-09 08:19:05 +01:00
Diana Payton
e6aac7a36c
Docs: Create Intro grafana (#22522)
* Create add-a-data-source.md

* Added links to Add a data source

* Create intro-to-grafana.md

* Updated menu and files

* fixed link

* Update dashboards.md

* Updated enterprise links

* Update _index.md

* Update intro-to-grafana.md

* added content and links

* Update menu.yaml

* fixing links

* fixing links

* Update menu.yaml

* Updated index.md and what is grafana

* changed topic title

* Update getting_started.md

* Updated content

* Update docs/sources/guides/intro-to-grafana.md

Co-Authored-By: Marcus Olsson <accounts+github@marcus.se.net>

* Update docs/sources/guides/intro-to-grafana.md

Co-Authored-By: Marcus Olsson <accounts+github@marcus.se.net>

* Update docs/sources/guides/intro-to-grafana.md

Co-Authored-By: Marcus Olsson <accounts+github@marcus.se.net>

* Update intro-to-grafana.md

* changed file name

* Update _index.md

* Minor edits

* Update menu.yaml

* Update what-is-grafana.md

* Update what-is-grafana.md

* Fix: updates snapshots

* Revert "Fix: updates snapshots"

Co-authored-by: Marcus Olsson <accounts+github@marcus.se.net>
Co-authored-by: Lukas Siatka <lukasz.siatka@grafana.com>
2020-03-06 13:06:30 -08:00
Ryan McKinley
46fcf9bf08
Toolkit: wrap plugin signing stub with error checking (#22626) 2020-03-06 10:51:48 -08:00
Steven Vachon
aa7e6cf55f
@grafana/e2e: fix empty bundle files (#22607)
* Minor changes

* Revert CLI to JavaScript

... as Rollup is only accepts ESM modules and TypeScript would need to use the new incremental builds feature which causes weird Redux module errors.
2020-03-06 12:25:55 -05:00
Stephanie Closson
3745cccde6
Toolkit: include a github release utility (#22520)
* Adding git publish to toolkit

* grafana-toolkit new feature plugin:github-release

* Feedback from code review
1. Used async await and exec for executing commands
2. Using dist folder to get plugin information

* Reverting change to plugin.json back to original value.

* reverted changes to yarn.lock

* reverted changes to yarn.lock

* feedback from code review

* feedback from code review 2

* moved constants to recommended functions

* styling changes and reverting yarn.lock

* removing changes to package.json

* replced execLine with execa

* better error detection around the publish token

* made simpler with commitHash from build

* Testing showed a number of required changes:
- Make the sha configurable
  or through environment variable
  or through git config.
- Allow a release to be recreated
- Set name and repo from git config as this is what
ghr is expecting anyway.
- Appropriate errors if the user
  tries to run a release without
  doing a ci-build and ci-package first.

* Using spinner.
Took out extra dependencies out of project.json
wrote tests manually.

* Updated tests. Now passing

* Adding git publish to toolkit

* grafana-toolkit new feature plugin:github-release

* Feedback from code review
1. Used async await and exec for executing commands
2. Using dist folder to get plugin information

* Reverting change to plugin.json back to original value.

* reverted changes to yarn.lock

* reverted changes to yarn.lock

* feedback from code review

* feedback from code review 2

* moved constants to recommended functions

* styling changes and reverting yarn.lock

* removing changes to package.json

* replced execLine with execa

* better error detection around the publish token

* made simpler with commitHash from build

* Testing showed a number of required changes:
- Make the sha configurable
  or through environment variable
  or through git config.
- Allow a release to be recreated
- Set name and repo from git config as this is what
ghr is expecting anyway.
- Appropriate errors if the user
  tries to run a release without
  doing a ci-build and ci-package first.

* Using spinner.
Took out extra dependencies out of project.json
wrote tests manually.

* Updated tests. Now passing

* updated test for reducers, from master

* package.json and yarn.lock from master
2020-03-06 10:15:04 -07:00
Torkel Ödegaard
5a53c2d02b
Rendering: Have phantomjs wait a bit before rendering to give fonts a change to load (#22623) 2020-03-06 17:55:13 +01:00
Torkel Ödegaard
917860c4d3
Cascader: Do not override default width behavior (#22620)
* Cascader: Do not override default width behavior

* Fixed storybook
2020-03-06 16:21:46 +01:00
Diana Payton
733450c7b7
Update documentation-style-guide.md (#22581)
Added link to Google tech writing courses
2020-03-06 06:50:23 -08:00
Carl Bergquist
1dcfaf25fc
Adds signed in user to backend v2 plugins requests (#22584)
closes #12043
2020-03-06 14:37:36 +01:00
Jeet Parekh
c73a0007c7
CloudWatch: updated namespaces - Athena, DocDB, and Route53Resolver (#22604) 2020-03-06 10:41:29 +02:00
jonghyeon
0f6769665a
Graph: Improve point rendering performance (#22610)
this PR improves canvas rendering performance in drawSeriesPoints
2020-03-06 09:26:15 +01:00
Lukas Siatka
99daa4454b
Alerting: Fix state age test failures (#22606)
- use output from relative time instead of static string to prevent
clock issues
2020-03-06 00:28:20 +01:00
Diana Payton
6af45bf4ac
Docs: Update image_rendering.md (#22586)
Trying to fix the numbering in Run as standalone Node.js application.
2020-03-05 14:03:40 -08:00
Erik Sundell
5ad8a9722e
UI: Segment improvements (#22601)
* Trigger onchange in case user has edited a custom option, and then clicked outside the react select dropdown

* The width of the label is calculated so that the react select input field could get the same width. However, the react select input font is slightly wider, so we need to make that width a little bit larget than the label.
2020-03-05 20:19:43 +01:00
Carl Bergquist
0b86a371bb
remove section about alias imports (#22585)
this is not relevant anymore since we removed
all aliased imports.
2020-03-05 19:51:14 +01:00
Marcus Efraimsson
4ff613a432
Backend Plugins: Support handling of streaming resource response (#22580)
Use v0.19.0 of SDK.
Support handling of streaming resource response.
Disable gzip/compression middleware for resources 
to allow chunked/streaming response to clients the gzip
middleware had to be disabled since it buffers the full
response before sending it to the client.

Closes #22569

Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com>
2020-03-06 01:44:07 +07:00
Daniel Lee
f95c8b785c
Stackdriver: Migrate GCE default project (#22593)
* Ensure default project

* Remove debug logging

* Fix broken test

* Update snapshot
2020-03-05 17:53:41 +01:00
Ryan McKinley
e688f13535
Toolkit: plugin ci needs to cooperate better with make/mage (#22588)
* cleanup

* cleanup
2020-03-05 06:06:06 -08:00
Erik Sundell
0f8cfca4e6
surround CloudWatch dimension names with double quotes (#22222) 2020-03-05 14:15:45 +01:00
Marcus Andersson
d227353321
Fix: when reloading page make sure that time picker history is converted to dateTime. 2020-03-05 13:14:42 +01:00
Agnès Toulet
ea3d368e91
Core: add active users stat (#22563)
* Stats: add active user count query

* License: add info in settings

* Stats: Retrieve active users stats for different roles

+ Clean files and tests

* Stats: add dialect.Quote in queries

* Stats: improve tests (require instead of assert)

* Stats: improve tests (require instead of assert)
2020-03-05 12:34:44 +01:00
Marcus Efraimsson
c6cc840ceb
Chore: Modules tidy and vendor (#22578) 2020-03-05 00:45:05 +01:00
David
54a3f5fd87
Loki: use series API for stream facetting (#21332) 2020-03-04 17:17:02 +01:00
Marcus Efraimsson
2cf538a466
Testing code owners for backend code (#22572) 2020-03-04 17:08:07 +01:00
Shavonn Brown
b27985ef38
Azure Monitor: config editor updates, update sameas switch, fix test snaps (#22554)
* azure monitor config editor updates, do not show helper for sameas unless just switched, not create

* update snapshots
2020-03-04 09:11:11 -05:00
Alex Khomenko
c5ceae3808
Grafana-UI: Use value for Radio group id (#22568) 2020-03-04 15:31:01 +02:00
Alexander Zobnin
e1af933d4a
Chore: fix moment import in alerting tests (#22567)
* Chore: disable no-restricted-imports rule for moment

fix enterprise build

* Chore: get rid of moment, use dateTime in alerting tetst
2020-03-04 15:47:23 +03:00
Carl Bergquist
766d8a5888
avoid aliased import in cli (#22566) 2020-03-04 13:18:13 +01:00
Carl Bergquist
3fdd2648b1
Chore: Avoid aliasing importing models in api package (#22492) 2020-03-04 12:57:20 +01:00
Alexander Zobnin
fcaff011b1
ShareModal: able to extend tabs (#22537)
* ShareModal: use generic tab type

* ShareModal: able to extend with custom tabs

* ShareModal: able to extend dash/panel tabs separately

* grafana-ui: ModalTabContent component
2020-03-04 12:59:30 +03:00
Alexander Zobnin
9731ea9b89
Tests: fix alerting reducers tests (#22560) 2020-03-04 12:39:56 +03:00