Commit Graph

42 Commits

Author SHA1 Message Date
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
Andrej Ocenas
5bed54170e
Chore: Split Explore redux code into multiple sections (#28819)
* Split main reducer from item reducer

* Move query related redux to separate file

* Split more parts and tests

* Fix import

* Remove unused code

* Update public/app/features/explore/state/datasource.ts

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

* Add section comments

* Rename ExploreItem to ExplorePane

* Fix imports

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2020-11-09 14:48:24 +01:00
Ivana Huckova
0f7a470138
Icon: Replace font awesome icons where possible (#28757)
* Replace font awesome icons where possible

* Implement small updates
2020-11-04 13:34:40 +01:00
Torkel Ödegaard
7f6e979056
Fixes typescript issues (#27565) 2020-09-14 10:02:25 +02:00
Hugo Häggmark
d633cc3c09
Tests: removes unused stuff and replaces monaco transpile with mock (#27324) 2020-09-03 08:54:46 +02:00
Hugo Häggmark
0755390286
MixedDatasource: Shows retrieved data even if a data source fails (#27024)
* MixedDatasource: Shows data for working data sources and error for erroneous

* Tests: remove funky import

* Tests: fixes types
2020-08-19 08:52:40 +02:00
Ryan McKinley
1a711e7df0
Panel Inspect: use monaco for json display (#25251) 2020-06-29 10:58:47 -07:00
Torkel Ödegaard
92a16d2e10
Transforms: Adds beta notice and updates transform descriptions (#24158)
* Transforms: Adds beta notice and updates transform descriptions

* Rename organize fields

* Webpack - enable images import

* Introduce FeatureState type

* Alow Container component grow/shrink config

* Enable svg import in main app

* Jest + webpack for svgs

* InfoBox refactor (+ added feature info box), Badge component introduced

* Update packages/grafana-ui/src/components/TransformersUI/FilterByNameTransformerEditor.tsx

Co-authored-by: Carl Bergquist <carl@grafana.com>

* Minor fixes

* Update packages/grafana-ui/src/components/TransformersUI/OrganizeFieldsTransformerEditor.tsx

Co-authored-by: Carl Bergquist <carl@grafana.com>

* Update packages/grafana-ui/src/components/TransformersUI/SeriesToFieldsTransformerEditor.tsx

Co-authored-by: Carl Bergquist <carl@grafana.com>

* fix typo

* Build storybook fixed

* Fix padding

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Carl Bergquist <carl@grafana.com>
2020-05-04 15:05:31 +02:00
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
Alexander Zobnin
d66e72fa67
Migration: Share dashboard/panel modal (#22436)
* ShareModal: refactor dashboard export modal

* Modal: show react modals with appEvents

* ShareModal: embed panel tab

* ShareModal: bind to shortcut (p s)

* grafana-ui: ClipboardButton component

* ShareModal: use ClipboardButton component

* ClipboardButton: add to storybook

* ShareModal: use event-based approach for dashboard share

* ShareModal: remove unused

* ModalReact: pass theme to the component

* ShareModal: styles clean up

* DashboardExporter: fix tests

* fixed whitespace betwen icon and link

* ShareModal: use theme from config

* Modal: tab header refactor

* ShareModal: tests

* ShareModal: fix share url rendering

* ShareModal: remove unused angular files

* Chore: fix strictNullChecks errors

* Modal: provide theme for event-based modal usage

* ShareModal: use ModalsController for opening modal

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2020-03-03 15:04:28 +03:00
Steven Vachon
f48169633c
TSLint → ESLint (#21006)
* Alphabetized tslint and tsconfig files

* Optimized tsconfig files

* Optimized editorconfig & prettier config files

… to reduce redundancy

* Switched to @grafana/tsconfig

… and:
* de-duped options
* removed options with default values

* Fixed nasty issue with types for nested slate-react

* Replaced TSLint with ESLint

* TSLint disables → ESLint disables

… also JSHint removals, which haven’t had an affect since it was replaced with TSLint.

* Compliances for ESLint, Prettier and TypeScript

* Updated lockfile
2020-02-08 02:40:04 +01:00
Dominik Prokop
9b7748ec13
Chore: Reorg packages (#20111)
Primarily- moving majority of the types and utils from @grafana/ui to @grafana/data

* Move types from grafana-ui to grafana-data

* Move valueFormats to grafana-data

* Move utils from grafana-ui to grafana-data

* Update imports in grafana-ui

* revert data's tsconfig change

* Update imports in grafana-runtime

* Fix import paths in grafana-ui

* Move rxjs to devDeps

* Core import updates batch 1

* Import updates batch 2

* Imports fix batch 3

* Imports fixes batch i don't know

* Fix imorts in grafana-toolkit

* Fix imports after master merge
2019-10-31 10:48:05 +01:00
Ivana Huckova
dabc848e11
Explore: Synchronise time ranges in split mode (#19274)
* Explore: create connected sync button when screen is splitted

* Explore: create attachable button to TimePicker

* WIP/Explore: set up redux boilerplate for synced state

* WIP/Explore: add toggling functionality to sync buttons

* WIP/Explore: Fix styling issue

* First pass solution working

* Explore: Clean up, update comments

* Explore: refactore Timepicker, remove newly introduced class names

* Explore: refactore ExploreTimeControls

* Explore: more semantic variables naming

* Explore: run query on syncable item when synced times activated

* Explore: Add tooltip to sync times button

* Explore: Remove typo

* Explore: check exploreId

* Explore: refactor ExploreTimeControls

* Explore: refactor to include suggested changes

* Explore: Create TimeSyncButton component, update colors

* Explore: Toggle tooltip, use stylesFactory
2019-10-08 18:55:53 +02:00
Torkel Ödegaard
0ec8303878 Panels: Skip re-rendering panel/visualisation in loading state (#19518)
* Loading states and partial rendering, set loading state in mixed data source, and do not render loading states for react panels

* Updated mixed data source tests
2019-10-01 01:22:41 -07: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
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
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
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
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
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
Ryan McKinley
26bd76b4c2
Refactor: move NavModel to @grafana/ui (#16813) 2019-04-30 07:46:46 -07: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
Torkel Ödegaard
ffdf747080 More files that has fixed with prettier 2019-02-13 11:39:41 +01:00
Torkel Ödegaard
a440d3510a renaming things in admin 2018-09-07 17:55:38 +02:00
Torkel Ödegaard
7b06800295 refactor: changed nav store to use nav index and selector instead of initNav action 2018-09-02 10:36:36 -07:00
Torkel Ödegaard
2ac202b22f moving things around 2018-09-02 07:11:21 -07:00
Torkel Ödegaard
9b978b7203
tslint: autofix of let -> const (#13033) 2018-08-26 17:14:40 +02:00
Marcus Efraimsson
d217688d5e folders: use new folder api in frontend 2018-02-01 22:32:26 +01:00
Marcus Efraimsson
ee9c408188 folders: changes needed due to merge 2018-02-01 13:21:24 +01:00
Daniel Lee
545d7b9477 dashfolders: convert folder settings to React 2018-01-11 15:42:45 +01:00
Torkel Ödegaard
5981f67226 tech: enzyme container test working 2018-01-01 18:54:23 +01:00
Torkel Ödegaard
8fd8853770 tech: progress on react pages 2017-12-28 17:03:40 +01:00
Torkel Ödegaard
c1fcfdb536 search: began writing test for new search 2017-11-02 16:54:33 +01:00
Torkel Ödegaard
7f83460f42 tests: migrated tests for link_srv to jest, #9666 2017-10-31 14:30:06 +01:00
Torkel Ödegaard
7aa753a25f tech: migrating elasticsearch to typescript 2017-09-28 12:52:39 +02:00
sanchitraizada
77c046aac6 Implement review feedback 2017-06-01 17:57:09 -04:00
Ben Tranter
b6e46c9eb8 History and Version Control for Dashboard Updates
A simple version control system for dashboards. Closes #1504.

Goals

1. To create a new dashboard version every time a dashboard is saved.
2. To allow users to view all versions of a given dashboard.
3. To allow users to rollback to a previous version of a dashboard.
4. To allow users to compare two versions of a dashboard.

Usage

Navigate to a dashboard, and click the settings cog. From there, click
the "Changelog" button to be brought to the Changelog view. In this
view, a table containing each version of a dashboard can be seen. Each
entry in the table represents a dashboard version. A selectable
checkbox, the version number, date created, name of the user who created
that version, and commit message is shown in the table, along with a
button that allows a user to restore to a previous version of that
dashboard. If a user wants to restore to a previous version of their
dashboard, they can do so by clicking the previously mentioned button.
If a user wants to compare two different versions of a dashboard, they
can do so by clicking the checkbox of two different dashboard versions,
then clicking the "Compare versions" button located below the dashboard.
From there, the user is brought to a view showing a summary of the
dashboard differences. Each summarized change contains a link that can
be clicked to take the user a JSON diff highlighting the changes line by
line.

Overview of Changes

Backend Changes

- A `dashboard_version` table was created to store each dashboard
  version, along with a dashboard version model and structs to represent
  the queries and commands necessary for the dashboard version API
  methods.
- API endpoints were created to support working with dashboard
  versions.
- Methods were added to create, update, read, and destroy dashboard
  versions in the database.
  - Logic was added to compute the diff between two versions, and
  display it to the user.
  - The dashboard migration logic was updated to save a "Version
  1" of each existing dashboard in the database.

Frontend Changes

- New views
- Methods to pull JSON and HTML from endpoints

New API Endpoints

Each endpoint requires the authorization header to be sent in
the format,

```
Authorization: Bearer <jwt>
```

where `<jwt>` is a JSON web token obtained from the Grafana
admin panel.

`GET "/api/dashboards/db/:dashboardId/versions?orderBy=<string>&limit=<int>&start=<int>"`

Get all dashboard versions for the given dashboard ID. Accepts
three URL parameters:

- `orderBy` String to order the results by. Possible values
  are `version`, `created`, `created_by`, `message`. Default
  is `versions`. Ordering is always in descending order.
- `limit` Maximum number of results to return
- `start` Position in results to start from

`GET "/api/dashboards/db/:dashboardId/versions/:id"`

Get an individual dashboard version by ID, for the given
dashboard ID.

`POST "/api/dashboards/db/:dashboardId/restore"`

Restore to the given dashboard version. Post body is of
content-type `application/json`, and must contain.

```json
{
  "dashboardId": <int>,
  "version": <int>
}
```

`GET "/api/dashboards/db/:dashboardId/compare/:versionA...:versionB"`

Compare two dashboard versions by ID for the given
dashboard ID, returning a JSON delta formatted
representation of the diff. The URL format follows
what GitHub does. For example, visiting
[/api/dashboards/db/18/compare/22...33](http://ec2-54-80-139-44.compute-1.amazonaws.com:3000/api/dashboards/db/18/compare/22...33)
will return the diff between versions 22 and 33 for
the dashboard ID 18.

Dependencies Added

- The Go package [gojsondiff](https://github.com/yudai/gojsondiff)
  was added and vendored.
2017-05-24 19:14:39 -04:00
Torkel Ödegaard
0b4552a8e7 fix(timerange): fix handling of invalid dates in from/to url parameters, fixes #3345 2015-12-04 10:32:23 +01:00
Torkel Ödegaard
fde11be279 Renamed src directory to public 2015-03-29 12:57:28 +02:00