Commit Graph

452 Commits

Author SHA1 Message Date
Hugo Häggmark
0598d60234
Tests: Adds throwUnhandledRejections to jest setup (#19398)
* Chore: Adds throwUnhandledRejections to jest setup

* Bring back @grafana/runtime import

* Fix broken metric metadata aggregation test
2019-09-25 05:10:11 -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
Ryan McKinley
62a808bf1f MixedDataSource: refactor, cleanup, and add tests (#18948)
* merge master

* move mixed datasource

* all responses in test

* fix tests/mocks

* remove ?
2019-09-09 11:29:37 +02:00
kay delaney
7985aa1e57
Performance/Webpack: Introduces more aggressive code-splitting and other perf improvements (#18544)
* Performance/Webpack: Introduces more aggressive code-splitting and other perf improvements
- Introduces dynamic imports for built-in plugins
- Uses dynamic imports for various packages (rst2html, brace)
- Introduces route-based dynamic imports
- Splits angular and moment into separate bundles
2019-09-03 09:29:02 +01: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
fcdc29746f
@grafana/data: export dateMath and rangeUtil (#17971) 2019-07-05 23:43:12 -07: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
kay delaney
164fb13d99
Explore: Adds orgId to URL for sharing purposes (#17895)
Also replaces one-off segment detection functions in explore.ts with general purpose function
Closes #15462
2019-07-03 16:36:12 +01: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
Johannes Schill
0412a28d2e TimePicker: New time picker dropdown & custom range UI (#16811)
* feat: Add new picker to DashNavTimeControls

* chore: noImplicitAny limit reached

* chore: noImplicityAny fix

* chore: Add momentUtc helper to avoid the isUtc conditionals

* chore: Move getRaw from Explore's time picker to grafana/ui utils and rename to getRawRange

* feat: Use helper functions to convert utc to browser time

* fix: Dont Select current value when pressing tab when using Time Picker

* fix: Add tabIndex to time range inputs so tab works smoothly and prevent mouseDown event to propagate to react-select

* fix: Add spacing to custom range labels

* fix: Updated snapshot

* fix: Re-adding getRaw() temporary to fix the build

* fix: Disable scroll event in Popper when we're using the TimePicker so the popup wont "follow" the menu

* fix: Move all "Last xxxx" quick ranges to the menu and show a "UTC" text when applicable

* fix: Add zoom functionality

* feat: Add logic to mark selected option as active

* fix: Add tooltip to zoom button

* fix: lint fix after rebase

* chore: Remove old time picker from DashNav

* TimePicker: minor design update

* chore: Move all time picker quick ranges to the menu

* fix: Remove the popover border-right, since the quick ranges are gone

* chore: Remove function not in use

* Fix: Close time picker on resize event

* Fix: Remove border bottom

* Fix: Use fa icons on prev/next arrows

* Fix: Pass ref from TimePicker to TimePickerOptionGroup so the popover will align as it should

* Fix: time picker ui adjustments to get better touch area on buttons

* Fix: Dont increase line height on large screens

* TimePicker: style updates

* Fix: Add more prominent colors for selected dates and fade out dates in previous/next month

* TimePicker: style updates2

* TimePicker: Big refactorings and style changes

* Removed use of Popper not sure we need that here?
* Made active selected item in the list have the "selected" checkmark
* Changed design of popover
* Changed design of and implementation of the Custom selection in the dropdown it did not feel like a item you
could select like the rest now the list is just a normal list

* TimePicker: Refactoring & style changes

* TimePicker: use same date format everywhere

* TimePicker: Calendar style updates

* TimePicker: fixed unit test

* fixed unit test

* TimeZone: refactoring time zone type

* TimePicker: refactoring

* TimePicker: finally to UTC to work

* TimePicker: better way to handle calendar utc dates

* TimePicker: Fixed tooltip issues

* Updated snapshot

* TimePicker: moved tooltip from DashNavControls into TimePicker
2019-06-24 14:39:59 +02:00
Tobias Skarhed
c9ad411d8e noImplicitAny: Fix basic errors (#17668)
* Fix basic noImplicitAny errors

* noImplicitAny HeatmapCtrl

* Update error limit
2019-06-19 19:59:03 +02:00
Ryan McKinley
401615847c
Build: add @grafana/data package (#17436)
first step in moving non-ui components to their own package
2019-06-18 08:17:27 -07: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
Ryan McKinley
1d7bb2a763 DataSourceApi: convert interface to abstract class (#16979)
* DataSourceApi as class

* add diff signature

* Prometheus: moved directUrl to jsonData
2019-05-10 11:37:43 +02:00
Hugo Häggmark
ceb9f0855b
Chore: Replaces moment with Grafanas DateTime (#16919)
* Wip: Initial commit

* Refactor: Replaces moment.utc(

* Refactor: replaces the last isMoment statements

* Refactor: Removes almost all moment imports

* Refactor: Moves moment_wrapper to grafana/ui

* Refactor: Renames momentWrapper

* Refactor: Removes one more moment import

* Refactor: Removes unitOfTime import

* Fix: Fixes Prettier error

* Refactor: Renames DateTimeType to DateTime

* Refactor: Renames isDateTimeType to isDateTime

* Refactor: Renames dateTime to dateTime

* Feature: Bans moment imports and types
2019-05-08 13:51:44 +02:00
Ryan McKinley
d881976c9d Refactor: move datemath to grafana/ui (#16890)
* move datemath to grafana/ui

* don't reference @grafana/ui from its own component
2019-05-06 12:36:42 +02:00
Ryan McKinley
26bd76b4c2
Refactor: move NavModel to @grafana/ui (#16813) 2019-04-30 07:46:46 -07:00
Ryan McKinley
5c2d38126d
Plugins: move PanelPluginMeta to grafana/ui (#16804) 2019-04-29 08:17:35 -07:00
Torkel Ödegaard
a4f5c54871
Chore: Fixed no implicit any Typescript errors (#16799) 2019-04-28 09:58:12 +02:00
Torkel Ödegaard
060e97bea8
Plugins: ReactPanelPlugin to VizPanelPlugin (#16779)
* Plugins: ReactPanelPlugin renamed

* Plugins: renamed PanelPlugin to PanelPluginMeta and VizPanelPlugin to PanelPlugin
2019-04-26 19:16:38 +02:00
Ryan McKinley
e7f56a74fc
Refactor: split PanelQueryRunner into runner and state (#16685)
* check for running

* split out panel state

* adding test file

* remove bad test
2019-04-19 15:11:55 -07:00
Ryan McKinley
4e54509dde
Refactor: improvements to PanelQueryRunner (#16678)
merged DataQueryOptions + DataRequestInfo info: DataQueryRequest
2019-04-18 21:56:27 -07:00
Johannes Schill
8370a182f7 Tech: Bump typescript and jest (#16354)
* chore: Bump Typescript to 3.4.1

* chore: Bump babel-jest, jest, ts-jest

* fix: Fix tests after typescript upgrade by disabling some typings

* chore: noImplicitAny

* chore: Bump typescript in @grafana/ui
2019-04-03 11:41:08 +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
Torkel Ödegaard
e3d33e6c4a chore: Removed implicit anys in react container and test helpers 2019-03-24 20:27:12 +01: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
Torkel Ödegaard
732ea8eea5 Graphite: fixed variable quoting when variable value is nummeric, fixes #2078 2019-03-22 12:57:07 +01:00
Hugo Häggmark
0eb2ca3ffd chore: Cleaning up implicit anys in DashboardExporter and tests
progress: #14714
2019-03-18 07:42:43 +01:00
Torkel Ödegaard
37496fe6a8 Fixed more typescript no implicit any issues 2019-03-12 17:55:01 +01:00
Torkel Ödegaard
ffdf747080 More files that has fixed with prettier 2019-02-13 11:39:41 +01:00
Marcus Efraimsson
bd48408e2d
Merge pull request #15215 from thatsparesh/13324-mssql-pass-timerange-for-template-variable-queries
mssql: pass timerange for template variable queries
2019-02-11 08:36:47 +01:00
thatsparesh
716db35fae remove unnecessary spy 2019-02-09 14:56:43 -06: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
Torkel Ödegaard
3d78cb4f8c
Merge pull request #15158 from grafana/hugoh/redux-poc
WIP: Reducing boilerplate code for Redux
2019-02-01 09:41:40 +01:00
Torkel Ödegaard
aafd4a339a Moved dashboard state components to state folder 2019-01-31 08:56:17 +01: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
8b68ba5cbb Minor refactoring and adding some typing 2019-01-29 20:49:54 +01:00
Torkel Ödegaard
5d17ad1103 more typings work around data query and data source 2019-01-18 18:59:32 +01:00
David Kaltschmidt
c1347e4ecb WIP babel 7 2018-10-29 12:20:10 +01:00
Torkel Ödegaard
a440d3510a renaming things in admin 2018-09-07 17:55:38 +02:00
Torkel Ödegaard
0aea60bf17 Merge branch 'master' into redux-poc2 2018-09-05 12:11:11 +02:00