Commit Graph

86 Commits

Author SHA1 Message Date
Alex Khomenko
6d95f2f1db
Chore: Update typescript to v4.2.4 (#33297)
* Update typescript to v4.2.4

* Update @types/slate

* Fix QueryVariableEditor.test.tsx

* Fix search-related type errors

* Fix Plugin pages type errors

* Fix missing initializer errors

* Update snapshot

* Revert tsconfig changes
2021-04-28 15:40:01 +03:00
Hugo Häggmark
c8b59b79c3
Chore: Fix strict errors, down to 340 (#32109)
* Chore: reduces misc reducerTester strict issues

* Chore: fixes various strict errors in reducer tests for ElasticSearch

* Chore: lowers errors in AzureMonitor DataSource tests
2021-03-19 13:10:03 +01:00
Alex Khomenko
8404d54277
Variables: Do not reset description on variable type change (#31933) 2021-03-12 13:49:19 +02:00
Hugo Häggmark
8744ad361b
Variables: Fixes so text format will show All instead of custom all (#30730) 2021-01-29 09:24:25 +01:00
Torkel Ödegaard
1d689888b0
Prettier: Upgrade to 2 (#30387)
* Updated package json but not updated source files

* Update eslint plugin

* updated files
2021-01-20 07:59:48 +01:00
Giordano Ricci
f5916260bd
Chore: Allow reducerTester to work with every data type & payload-less actions (#29241) 2020-11-20 13:11:52 +00:00
Hugo Häggmark
845bc7c444
Variables: Adds loading state and indicators (#27917)
* Refactor: Replaces initLock with state machine

* Refactor: removes some states for now

* Refactor: adds loading state in OptionsPicker

* Refactor: major refactor of load state

* Refactor: fixes updating graph in parallell

* Refactor: moves error handling to updateOptions

* Refactor: fixes the last cases

* Tests: disables variable e2e again

* Chore: removes nova config

* Refactor: small changes when going through the code again

* Refactor: fixes typings

* Refactor: changes after PR comments

* Refactor: split up onTimeRangeUpdated and fixed some error handling

* Tests: removes unused func

* Tests: fixes typing
2020-10-02 07:02:06 +02:00
Torkel Ödegaard
b7d26b12dd
Templating: Fix searchFilter issue in templating system (#25770) 2020-06-24 08:36:03 +02:00
Lukas Siatka
ba70b59f4c
DevEnv: update frontend dependencies - redux (#22143)
* DevEnv: updates @types/react-redux 7.1.2. -> 7.1.7

* DevEnv: updates react-redux 7.1.1 -> 7.1.3

* DevEnv: updates redux 4.0.4 -> 4.0.5

* DevEnv: updates @reduxjs/toolkit 1.2.1 -> 1.2.3

* DevEnv: updates @types/redux-mock-store 1.0.1 -> 1.0.2

* DevEvn: updates redux-mock-store 1.5.3 -> 1.5.4

* DevEnv: updates react-redux 7.1.3 -> 7.2.0

* DevEnv: updates @reduxjs/toolkit 1.2.3 -> 1.3.4

* DevEnv: updates redux middleware
2020-04-10 01:53:33 +02:00
Hugo Häggmark
9af04a49ea
Variables: replaces UUID with name for a more performant lookup in TemplateSrv (#22858)
* Refactor: renames uuid to id

* Refactor: misc renames

* Refactor: fixes renaming of variable

* Refactor: changes method accessed by templateSrv

* Refactor: fixes for NEW_VARIABLE_ID

* Refactor: rename flow refactor

* Tests: adds missing reducer and action tests

* Refactor: keeping tests consitent

* Chore: reorder imports

* Chore: removes uuid package

* Refactor: fixes imports
2020-03-23 13:45:08 +01:00
Marcus Andersson
a7a1406415
Variables: migrates ad hoc variable type to react/redux. (#22784)
* Refactor: moves all the newVariables part to features/variables directory

* Feature: adds datasource type

* Tests: adds reducer tests

* Tests: covers data source actions with tests

* Chore: reduces strict null errors

* boilerplate that will be replaced by real code.

* added old editor template.

* added initial version of ad hoc editor.

* added working (apart from add) version of the editor.

* Added placeholder for picker.

* Have a working UI. Need to connect it so we refresh the variables on changes.

* variable should be updated now.

* removed console.log

* made the url work.

* cleaned up the adapter.

* added possiblity to create filter directly from table.

* moved infotext from general reducer to extended value of adhoc.

* fixed strict null errors.

* fixed strict null errors.

* fixed issue where remove was displayed before being added.

* fixed issue with fragment key.

* changed so template_src is using the redux variables.

* minor refactorings.

* moved adhoc picker to adhoc variable.

* adding tests for reducer and fixed bug.

* added tests or urlparser.

* added tests for ad hoc actions.

* added more tests.

* added more tests.

* fixed strict null error.

* fixed copy n pase error.

* added utilit for getting new variable index.

* removed console.log

* added location to reducerTester type and created a module type for it.

* changed so we only have one builder pattern.

* fixed tests to use static expected values.

* fixed strict errors.

* fixed more strict errors.

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2020-03-23 09:00:36 +01:00
Hugo Häggmark
d953511e02
Variables: adds onTimeRangeUpdated to newVariables (#22821)
* Feature: adds onTimeRangeUpdated to newVariables

* Refactor: removes VariableWithRefresh and unused func

* Refactor: adds console output when something throws as well
2020-03-17 14:10:30 +01:00
Hugo Häggmark
fb789e8398
Variables: migrates interval variable type to React/Redux (#22797)
* Feature: migrates interval variable type to React/Redux
2020-03-16 13:45:51 +01: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
Hugo Häggmark
044bea0935
Chore: Fixes various strict null errors (#21763)
* Chore: Removes strict null checks in ReducerTester

* Chore: Fixes strict null errors in ConfigureStore

* Chore: Fixes strict null errors in reducer tests

* Chore: Fixes strict null errors in reducers tests

* Chore: Fixes strict null errors in reducers tests

* Chore: Fixes strict null errors in toggleLogActionsMiddleware

* Chore: Fixes strict null errors in navModelReducer

* Core: Fixes strict null errors in public/app/features/admin/state

* Chore: Fixes strict null errors in public/app/features/dashboard/state/reducers.test.ts

* Chore: Fixes strict null errors in public/app/features/explore/state/reducers.test.ts

* Chore: Fixes strict null errors in public/app/features/datasources/state/reducers.test.ts

* Chore: Fixes strict null errors in public/e2e-test/scenarios/templating/templatevariables-crud.test.ts

* Chore: Fixes strict null errors in public/app/features/dashboard/containers/DashboardPage.test.tsx
2020-01-28 09:13:56 +01:00
Hugo Häggmark
4f0fa776be
Chore: Migrates reducers and actions to Redux Toolkit (#21287)
* Refactor: Adds Redux Toolkit package

* Refactor: Uses configureStore from Redux Toolkit

* Refactor: Migrates applicationReducer

* Refactor: Migrates appNotificationsReducer

* Refactor: Migrates locationReducer

* Refactor: Migrates navModelReducer

* Refactor: Migrates teamsReducer and teamReducer

* Refactor: Migrates cleanUpAction

* Refactor: Migrates alertRulesReducer

* Refactor: Cleans up recursiveCleanState

* Refactor: Switched to Angular compatible reducers

* Refactor: Migrates folderReducer

* Refactor: Migrates dashboardReducer

* Migrates panelEditorReducer

* Refactor: Migrates dataSourcesReducer

* Refactor: Migrates usersReducer

* Refactor: Migrates organizationReducer

* Refactor: Migrates pluginsReducer

* Refactor: Migrates ldapReducer and ldapUserReducer

* Refactor: Migrates apiKeysReducer

* Refactor: Migrates exploreReducer and itemReducer

* Refactor: Removes actionCreatorFactory and reducerFactory

* Refactor: Moves mocks to test section

* Docs: Removes sections about home grown framework

* Update contribute/style-guides/redux.md

Co-Authored-By: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Refactor: Cleans up some code

* Refactor: Adds state typings

* Refactor: Cleans up typings

* Refactor: Adds comment about ImmerJs autoFreeze

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-01-13 08:03:22 +01:00
Hugo Häggmark
133ddc9afb
Feature: Adds connectWithCleanup HOC (#19629)
* Feature: Adds connectWithCleanup HOC

* Refactor: Small typings

* Refactor: Makes UseEffect run on Mount and UnMount only

* Refactor: Adds tests and rootReducer

* Refactor: Fixes adding of reducers on startup
2019-10-08 21:37:07 -07:00
Hugo Häggmark
3e603cd88a
Revert "Feature: Adds connectWithCleanup HOC (#19392)" (#19628)
This reverts commit 989f98efda.
2019-10-04 05:24:47 -07:00
Hugo Häggmark
989f98efda
Feature: Adds connectWithCleanup HOC (#19392)
* Feature: Adds connectWithCleanup HOC

* Refactor: Small typings

* Refactor: Makes UseEffect run on Mount and UnMount only

* Refactor: Adds tests and rootReducer
2019-10-04 04:37:16 -07:00
Hugo Häggmark
889f8e3131 PanelData: Adds timeRange prop to PanelData (#19361)
* Refactor: Adds newTimeRange property to PanelData

* Refactor: Handles timeRange prop after requests

* Refactor: Makes timeRange mandatory

* Refactor: Adds DefaultTimeRange
2019-09-25 11:19:17 +02:00
Hugo Häggmark
9bd6ed887c
Alerting: Prevents creating alerts from unsupported queries (#19250)
* Refactor: Makes PanelEditor use state and shows validation message on AlerTab

* Refactor: Makes validation message nicer looking

* Refactor: Changes imports

* Refactor: Removes conditional props

* Refactor: Changes after feedback from PR review

* Refactor: Removes unused action
2019-09-23 05:17:00 -07:00
Torkel Ödegaard
140ecbcf79
QueryProcessing: Observable query interface and RxJS for query & stream processing (#18899)
* I needed to learn some rxjs and understand this more, so just playing around

* Updated

* Removed all the complete calls

* Refactoring

* StreamHandler -> observable start

* progress

* simple singal works

* Handle update time range

* added error handling

* wrap old function

* minor changes

* handle data format in the subscribe function

* Use replay subject to return last value to subscribers

* Set loading state after no response in 50ms

* added missing file

* updated comment

* Added cancelation of network requests

* runRequest: Added unit test scenario framework

* Progress on tests

* minor refactor of unit tests

* updated test

* removed some old code

* Shared queries work again, and also became so much simplier

* unified query and observe methods

* implict any fix

* Fixed closed subject issue

* removed comment

* Use last returned data for loading state

* WIP: Explore to runRequest makover step1

* Minor progress

* Minor progress on explore and runRequest

* minor progress

* Things are starting to work in explore

* Updated prometheus to use new observable query response, greatly simplified code

* Revert refId change

* Found better solution for key/refId/requestId problem

* use observable with loki

* tests compile

* fix loki query prep

* Explore: correct first response handling

* Refactorings

* Refactoring

* Explore: Fixes LoadingState and GraphResults between runs (#18986)

* Refactor: Adds state to DataQueryResponse

* Fix: Fixes so we do not empty results before new data arrives
Fixes: #17409

* Transformations work

* observable test data

* remove single() from loki promise

* Fixed comment

* Explore: Fixes failing Loki and Prometheus unit tests (#18995)

* Tests: Makes datasource tests work again

* Fix: Fixes loki datasource so highligthing works

* Chore: Runs Prettier

* Fixed query runner tests

* Delay loading state indication to 200ms

* Fixed test

* fixed unit tests

* Clear cached calcs

* Fixed bug getProcesedDataFrames

* Fix the correct test is a better idea

* Fix: Fixes so queries in Explore are only run if Graph/Table is shown (#19000)

* Fix: Fixes so queries in Explore are only run if Graph/Table is shown
Fixes: #18618

* Refactor: Removes unnecessary condition

* PanelData: provide legacy data only when needed  (#19018)

* no legacy

* invert logic... now compiles

* merge getQueryResponseData and getDataRaw

* update comment about query editor

* use single getData() function

* only send legacy when it is used in explore

* pre process rather than post process

* pre process rather than post process

* Minor refactoring

* Add missing tags to test datasource response

* MixedDatasource: Adds query observable pattern to MixedDatasource (#19037)

* start mixed datasource

* Refactor: Refactors into observable parttern

* Tests: Fixes tests

* Tests: Removes console.log

* Refactor: Adds unique requestId
2019-09-12 17:28:46 +02:00
Hugo Häggmark
5ca643f2ba Explore: Use PanelQueryState to handle querying (#18694)
* WIP: inital POC

* Wip: Moving forward

* Wip

* Refactor: Makes loading indicator work for Prometheus

* Refactor: Reverts prom observable queries because they did not work for multiple targets

* Refactor: Transforms all epics into thunks

* Fix: Fixes scanning

* Fix: Fixes so that Instant and TimeSeries Prom query loads in parallel

* Fix: Fixes negation logic error

* Propagate errors in stream events, and close streams
2019-08-28 18:24:52 +02:00
Tobias Skarhed
1db9fff056 strictNullChecks: First batch (#18390)
* First batch of strictNullChecks

* Remove undefined

* Check an alternative solution

* Fix strict nullChecks

* Low hanging strictNullChecks

* Fixing strict nulls issues and more

* Minor change

* fixed unit test

* Fix feedback

* Update public/vendor/ansicolor/ansicolor.ts

Co-Authored-By: Dominik Prokop <dominik.prokop@grafana.com>

* Update public/vendor/ansicolor/ansicolor.ts

Co-Authored-By: Dominik Prokop <dominik.prokop@grafana.com>

* Update public/vendor/ansicolor/ansicolor.ts

Co-Authored-By: Dominik Prokop <dominik.prokop@grafana.com>

* Fix build errors
2019-08-12 16:11:06 +02:00
Hugo Häggmark
ead2d6e88f
Explore: Fixes incorrect handling of utc in timeEpic (#18386)
* Fix: Fixes incorrect handling of utc in timeEpic

* Chore: Renames dateTimeFromTimeZone to dateTimeForTimeZone
2019-08-06 10:43:53 +02:00
Ryan McKinley
3f15170914 Refactor: move some files to @grafana/data (#17952)
* moving to data WIP

* more refactoring

* add missing test

* mock full path

* remove sinon from grafana-ui
2019-07-06 08:05:53 +02:00
Hugo Häggmark
ead4b1f5c7
Explore: Uses new TimePicker from Grafana/UI (#17793)
* Wip: Intiail commit

* Refactor: Replaces TimePicker in Explore

* Refactor: Removes Angular TimePicker folder

* Refactor: Adds tests for getShiftedTimeRange

* Fix: Fixes invalid import to removed TimePicker

* Fix: Fixes dateTime tests

* Refactor: Reuses getShiftedTimeRange for both Explore and Dashboards

* Refactor: Shares getZoomedTimeRange between Explore and Dashboard
2019-06-28 12:07:55 +02:00
Tobias Skarhed
3045daedbd noImplicitAny: Reduce errors to 3800-ish (#17781)
* Reduce noImplicitAny errors to 3900-ish

* Fix lots of errors

* Add interface
2019-06-27 13:21:04 +02:00
Hugo Häggmark
2c5400c61e Explore: Parses and updates TimeSrv in one place in Explore (#17677)
* Wip: Adds timeEpic

* Refactor: Introduces absoluteRange in Explore state

* Refactor: Removes changeTime action

* Tests: Adds tests for timeEpic

* Refactor: Spells AbsoluteRange correctly
2019-06-25 13:44:19 +01:00
Hugo Häggmark
fb39831df2
Explore: Queries the datasource once per run query and uses DataStreamObserver (#17263)
* Refactor: Removes replaceUrl from actions

* Refactor: Moves saveState thunk to epic

* Refactor: Moves thunks to epics

* Wip: removes resulttype and queries once

* Refactor: LiveTailing uses observer in query

* Refactor: Creates epics folder for epics and move back actioncreators

* Tests: Adds tests for epics and reducer

* Fix: Checks for undefined as well

* Refactor: Cleans up previous live tailing implementation

* Chore: merge with master

* Fix: Fixes url issuses and prom graph in Panels

* Refactor: Removes supportsStreaming and adds sockets to DataSourcePluginMeta instead

* Refactor: Changes the way we create TimeSeries

* Refactor: Renames sockets to streaming

* Refactor: Changes the way Explore does incremental updates

* Refactor: Removes unused method

* Refactor: Adds back Loading indication
2019-06-03 14:54:32 +02:00
Hugo Häggmark
db48ec1f08
Explore: Adds Live option for supported datasources (#17062)
* Wip: Initial commit

* Refactor: Adds support in Loki datasource for streaming

* Refactor: Adds Live option to RefreshInterval

* Refactor: Adds styles to logrows

* Style: Reverses the order of Explore layout on Live

* Refactor: Adds LiveLogs component

* Tests: Adds tests for epics

* Style: Adds animation to Live in RefreshPicker

* Refactor: Adds ElapsedTime and progress line to LiveLogs

* Style: Adds specific colors to each theme

* Refactor: Adds support for Lokis new API

* Fix: Adds null to resulting empty array

* Refactor: Limits the rate of incoming messages from websockets

* Refactor: Throttles messages instead for simplicity

* Refactor: Optimizes row processing performance

* Refactor: Adds stop live button

* Fix: Fixes so that RefreshPicker shows the correct value when called programmatically

* Refactor: Merges with master and removes a console.log

* Refactor: Sorts rows in correct order and fixes minor UI issues

* Refactor: Adds minor improvments to sorting and container size
2019-05-20 13:28:23 +02:00
Hugo Häggmark
988b7c4dc3
Feat: Adds reconnect for failing datasource in Explore (#16226)
* Style: made outlined buttons and used it in Alert component

* Refactor: clean up state on load data source failure

* Refactor: test data source thunk created

* Refactor: move logic to changeDatasource and call that from intialize

* Refactor: move load explore datasources to own thunk

* Refactor: move logic to updateDatasourceInstanceAction

* Tests: reducer tests

* Test(Explore): Added tests and made thunkTester async

* Fix(Explore): Fixed so that we do not render StartPage if there is no StartPage

* Fix(Explore): Missed type in merge

* Refactor: Thunktester did not fail tests on async failures and prevented queires from running on datasource failures

* Feat: Fadein error alert to prevent flickering

* Feat: Refresh labels after reconnect

* Refactor: Move useLokiForceLabels into useLokiLabels from PR comments

* Feat: adds refresh metrics to Prometheus languageprovider

* Style: removes padding for connected datasources

* Chore: remove implicit anys
2019-04-01 07:38:00 +02:00
Hugo Häggmark
eedbc485dd
Makes it possible to navigate back/forward with browser buttons in Explore (#16150)
Make it possible to navigate back/forward with browser buttons in Explore
2019-03-22 15:24:30 +01:00
corpglory-dev
43b5eba8ee Add failing test 2019-02-06 18:33:24 +03:00
corpglory-dev
eb879062f9 Rename version_test to version.test 2019-02-06 18:32:22 +03:00
Hugo Häggmark
99b500c740 Removed then clauses, no need to test the test within the test 2019-01-31 07:48:33 +01:00
Hugo Häggmark
6a84a85a80 Added reducerTester, reducer tests and tests 2019-01-31 07:37:36 +01:00
Torkel Ödegaard
9b978b7203
tslint: autofix of let -> const (#13033) 2018-08-26 17:14:40 +02:00
Tobias Skarhed
a65589a5fb Rename test files 2018-08-14 10:52:41 +02:00
Tobias Skarhed
d91e9ddd22 Convert tests from Karma to Jest 2018-06-12 13:54:07 +02:00
Torkel Ödegaard
b5b93a68fc Merge branch 'master' into graphite-series-by-tags 2017-11-15 11:12:11 +01:00
Torkel Ödegaard
4aa227dd84 [Tech]: Start migrating to Jest for tests (#9610)
* tech: investigating karma + jest mix

* tech: migrating tests to jest

* tech: moved anoter test file to jest

* test: migrated two more test files to jest

* test: updated readme and made test fail to verify that it causes CI build failure

* tech: added code coverage for jest tests

* tech: testing codecov coverage

* tech: migrated more tests

* tech: migrated template srv to typescript and the tests to jest

* tech: minor build fix

* tech: build fixes

* build: another attempt at fixing go test with coverage
2017-10-22 07:03:26 +02:00
Alexander Zobnin
89aea278a9 graphite: improved version comparison 2017-10-20 15:50:44 +03:00
Alexander Zobnin
3184942aeb Fix NaN handling (#9469)
* graph: fix NaN formatting, #9012

* singlestat: prevent null value coloring, #9012, #8404

* timeseries: add tests for #9012 and move test file to TS
2017-10-10 14:25:57 +02:00
Torkel Ödegaard
42a0e9ebdf Merge branch 'day_rounding' of https://github.com/ctide/grafana into ctide-day_rounding2 2017-10-02 16:20:23 +02:00
Torkel Ödegaard
491fa6cad8 tech: more tslint rules 2017-09-21 17:23:31 +02:00
Torkel Ödegaard
b8d9722b4f tech: removing unused variables from typescript files, and making tslint rules more strict 2017-09-21 16:40:18 +02:00
Patrick O'Carroll
de17dcf3b0 Singlestat time (#9298)
* Added a timestamp option to single stat

* can now choose last time as value

* Finished last_time so it formats correctly, updated value stat

* fixed som issues, but still issue with testing

* Clean up after fake clock in test

* timezone-issue fix, fake time for from now test

* fix for timedifference
2017-09-21 13:34:51 +02:00
Alin Sinpalean
1076b75a21 Fix rounding of intervals (#9197)
* Prometheus: Fix actual step computation logic when a min_step is specified and the range is longer than min_step * 11000.

* Fix kbn.round_interval for exact intervals.

* Remove redundant 1d return, fix a couple of comments.

* Be more cautious with values close to 1d not rounding up to 1d. They may, because of the way the calculation uses 2 potentially different current time values.
2017-09-08 10:37:57 +02:00
Torkel Ödegaard
07e192ff47 change: more work on changing default group by time interval to min interval setting 2017-09-01 15:57:02 +02:00