Commit Graph

106 Commits

Author SHA1 Message Date
Torkel Ödegaard
693985a6ba
Plugins: Support es5 plugins extending es6 core classes (#32664)
* Plugins: Support es5 plugins extending es6 core classes

* Make all base classes backward compatible
2021-04-06 14:51:35 +02:00
Torkel Ödegaard
532b8d4bc2
Babel: @babel/plugin-transform-react-constant-elements to babel config to optimize react performance (#32629) 2021-04-06 09:24:19 +02:00
Ryan McKinley
c7ea96940a
Arrow: move arrow support from frontend to backend only (#32575) 2021-04-01 10:30:08 -07:00
Leon Sorokin
a080669151
Icons: use plain SVG files, load on-demand (#32387) 2021-04-01 09:09:56 -05:00
Torkel Ödegaard
7f6229494d
Babel: Target more modern browsers, updates browserlistrc (#32573)
* Babel: Target more modern browsers, updates browserlistrc

* Updates

* Fixed circular dependencies, grafana booted
2021-04-01 10:32:00 +02:00
Torkel Ödegaard
b0ffcfd558
Babel: Refactoring config so that it's shared and removes legacy plugin (#32559)
* Updated plugins

* Fixing stuff

* Update

* Fixing more stuff
2021-03-31 19:09:19 +02: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
Hugo Häggmark
602d8f601c
Chore: Changes source map devtool to inline-source-map (#30004) 2020-12-30 06:03:53 +01:00
Ivana Huckova
2a61d7ff9f
IntelliSense: Fix autocomplete and highlighting for Loki, Prometheus, Cloudwatch (#29381)
* Pass languages directly to SlatePrism plugin

* Update

* Remove unused variables

* Update packages/grafana-ui/src/components/DataLinks/DataLinkInput.tsx

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>

* Update public/app/plugins/datasource/prometheus/components/PromQueryField.tsx

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>

* Update public/app/plugins/datasource/prometheus/components/PromQueryField.tsx

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>

* Update public/app/plugins/datasource/loki/components/LokiQueryFieldForm.tsx

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>

* Update public/app/plugins/datasource/cloudwatch/components/LogsQueryField.tsx

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>

* Try Prism import instead of languages

* Update webpack

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
2020-12-02 14:09:55 +01:00
Jack Westbrook
0fc8426bf1
Chore: Bump storybook to v6 (#28926)
* Wip

* feat: get storybook and app building locally

* docs: comment webpack react alias

* build(grafana-ui): put back ts-loader

* build: prefer storybook essentials over actions and docs. bump dark-mode

* chore(storybook): migrate to latest config

* build: prevent test env throwing Invalid hook call errors

* chore: lodash resolves to package dependency rather than project

* use decorators as variable instead of function

* perf(storybook): reduce bundling time by splitting type check and compilation

* refactor(storybook): use sortOrder.order param to sort intro story first

* build: use yarn workspace command

* refactor(storybook): use previous knobs addon registration

* migrate button story to controls

* build(storybook): silence warnings in console

* build: bump storybook related ts packages

* style: remove trailing whitespace

* refactor(graphng): export interface for storybook

* controls migration guide

* fix typo

* docs(storybook): default docs to use dark theme as per current implementation

* revert(grafana-ui): put back react-is namedExport

this was changed for react 17 bump but causes rollup to fail during bundling

* chore: bump storybook to 6.1, enable fastRefresh, silence eslint prop-types

* docs(grafana-ui): move knobs -> controls migration guide to storybook style-guide

* chore(storybook): silence terminal warning about order of docs addon

* Update contribute/style-guides/storybook.md

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

* Apply documentation suggestions

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

* chore(storybook): bump to 6.1.2

Co-authored-by: Peter Holmberg <peter.hlmbrg@gmail.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2020-11-24 10:38:41 +01:00
ae3e
aa8d07f567
CodeEditor: added support for javascript language (#28818) 2020-11-09 10:37:06 +01:00
kay delaney
64304dafce
Webpack: Split out unicons and bizcharts (#28374) 2020-10-19 22:47:47 +01:00
Domas
bd9add72de
toolkit: expose maxWorkers option for plugin build & test tasks (#27724) 2020-10-01 10:50:56 +02:00
denominator
1d2b839a1d
Docs: Fix note format for documentation (#27940) 2020-09-30 12:45:07 -07:00
Zoltán Bedi
ae30482465
Chore: MEGA - Make Eslint Great Again 💅 (#26094)
* Fix lint error in types.ts

* Bump eslint and its deps to latest

* Add eslintignore and remove not needed eslintrcs

* Change webpack configs eslint config

* Update package.jsons and removed unused eslintrc files

* Chore yarn lint --fix 💅

* Add devenv to eslintignore

* Remove eslint disable comments for rules that are not used

* Remaining eslint fixes 💅

* Bump grafana/eslint-config 💥

* Modify package.json

No need for duplicate checks.

* Modify eslintignore to ignore data and dist folders

* Revert removing .eslintrc to make sure not to use certain packages

* Modify package.json to remove not needed command

* Use gitignore for ignoring paths
2020-08-11 17:52:44 +02:00
Ryan McKinley
bbd24cd93a
Monaco: add suggestions for template variables (#25921)
* now with suggestions

* using suggestions API

* using variable suggestions

* using variable suggestions

* show variables

* minor cleanup

* add @alpha warning

* Do not produce data variables if panel does not support queries

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-07-01 09:36:34 +02:00
Ryan McKinley
1a711e7df0
Panel Inspect: use monaco for json display (#25251) 2020-06-29 10:58:47 -07:00
Zoltán Bedi
c16890c22d
Chore: use fork-ts-checker plugin for eslint check (#25631)
* Use fork-ts-checker for eslint check

* Fix lint issue

* Add packages to lint

* Add comments to webpack configs
2020-06-22 16:15:29 +02: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
Peter Holmberg
e16213724c
DevEnv: Revert to clean stale assets (#23742) 2020-04-22 07:49:04 +02:00
Ivana Huckova
431f454d57
@grafana/ui: Create Icon component and replace part of the icons (#23402)
* Part1: Unicons implementation (#23197)

* Create a new Icon component

* Update icons in main sidebar

* Update icons in Useful links and in react components on  main site

* Update icons in Useful links and in main top navigation

* Adjust sizing

* Update panel navigation and timepicker

* Update icons in Panel menu

* NewPanelEditor: Fixed so that test alert rule works in new edit mode (#23179)

* Update icons in add panel widget

* Resolve merge conflict

* Fix part of the test errors and type errors

* Fix storybook errors

* Update getAvailableIcons import in storybook knobs

* Fix import path

* Fix SyntaxError: Cannot use import statement outside a module in test environment error

* Remove dynamic imports

* Remove types as using @ts-ignore

* Update snapshot test

* Add @iconscout/react-unicons to the shouldExclude list as it is blundled with es2015 syntax

* Remove color prop from icon, remove color implemetation in mono icons

* Update navbar styling

* Move toPascalCase to utils/string

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

* Resolve type errors resulted from merge

* Part2: Unicons implementation (#23266)

* Create a new Icon component

* Update icons in main sidebar

* Update icons in Useful links and in react components on  main site

* Update icons in Useful links and in main top navigation

* Adjust sizing

* Update panel navigation and timepicker

* Update icons in Panel menu

* Update icons in add panel widget

* Resolve merge conflict

* Fix part of the test errors and type errors

* Fix storybook errors

* Update getAvailableIcons import in storybook knobs

* Fix import path

* Fix SyntaxError: Cannot use import statement outside a module in test environment error

* Remove dynamic imports

* Remove types as using @ts-ignore

* Update snapshot test

* Add @iconscout/react-unicons to the shouldExclude list as it is blundled with es2015 syntax

* Implment icons in Tabs

* Implement icons in search items and  empty  list

* Update buttons

* Update button-related snapshot tests

* Update icons in modals and page headers

* Create anfular wrapper and update all icons on search screen

* Update sizing, remove colors, update snapshot tests

* Remove color prop from icon, remove color implemetation in mono icons

* Remove color props from monochrome icons

* Complete update of icons for search screen

* Update icons for infor tooltips, playlist, permissions

* Support temporarly font awesome icons used in enterprise grafana

* Part1: Unicons implementation (#23197)

* Create a new Icon component

* Update icons in main sidebar

* Update icons in Useful links and in react components on  main site

* Update icons in Useful links and in main top navigation

* Adjust sizing

* Update panel navigation and timepicker

* Update icons in Panel menu

* NewPanelEditor: Fixed so that test alert rule works in new edit mode (#23179)

* Update icons in add panel widget

* Resolve merge conflict

* Fix part of the test errors and type errors

* Fix storybook errors

* Update getAvailableIcons import in storybook knobs

* Fix import path

* Fix SyntaxError: Cannot use import statement outside a module in test environment error

* Remove dynamic imports

* Remove types as using @ts-ignore

* Update snapshot test

* Add @iconscout/react-unicons to the shouldExclude list as it is blundled with es2015 syntax

* Remove color prop from icon, remove color implemetation in mono icons

* Update navbar styling

* Move toPascalCase to utils/string

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

* Icons update

* Add optional chaining to for isFontAwesome variable

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

* Part3:  Unicons implementation (#23356)

* Create a new Icon component

* Update icons in main sidebar

* Update icons in Useful links and in react components on  main site

* Update icons in Useful links and in main top navigation

* Adjust sizing

* Update panel navigation and timepicker

* Update icons in Panel menu

* Update icons in add panel widget

* Resolve merge conflict

* Fix part of the test errors and type errors

* Fix storybook errors

* Update getAvailableIcons import in storybook knobs

* Fix import path

* Fix SyntaxError: Cannot use import statement outside a module in test environment error

* Remove dynamic imports

* Remove types as using @ts-ignore

* Update snapshot test

* Add @iconscout/react-unicons to the shouldExclude list as it is blundled with es2015 syntax

* Implment icons in Tabs

* Implement icons in search items and  empty  list

* Update buttons

* Update button-related snapshot tests

* Update icons in modals and page headers

* Create anfular wrapper and update all icons on search screen

* Update sizing, remove colors, update snapshot tests

* Remove color prop from icon, remove color implemetation in mono icons

* Remove color props from monochrome icons

* Complete update of icons for search screen

* Update icons for infor tooltips, playlist, permissions

* Support temporarly font awesome icons used in enterprise grafana

* Part1: Unicons implementation (#23197)

* Create a new Icon component

* Update icons in main sidebar

* Update icons in Useful links and in react components on  main site

* Update icons in Useful links and in main top navigation

* Adjust sizing

* Update panel navigation and timepicker

* Update icons in Panel menu

* NewPanelEditor: Fixed so that test alert rule works in new edit mode (#23179)

* Update icons in add panel widget

* Resolve merge conflict

* Fix part of the test errors and type errors

* Fix storybook errors

* Update getAvailableIcons import in storybook knobs

* Fix import path

* Fix SyntaxError: Cannot use import statement outside a module in test environment error

* Remove dynamic imports

* Remove types as using @ts-ignore

* Update snapshot test

* Add @iconscout/react-unicons to the shouldExclude list as it is blundled with es2015 syntax

* Remove color prop from icon, remove color implemetation in mono icons

* Update navbar styling

* Move toPascalCase to utils/string

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

* Update icons in Explore

* Update icons in alerting

* Update + and x buttons

* Update icons in configurations and settings

* Update close icons

* Update icons in rich history

* Update alert messages

* Add optional chaining to for isFontAwesome variable

* Remove icon mock, set up jest.config

* Fix navbar plus icon

* Fir enable-bacground to enableBackgournd

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

* Merge remote branch origin master to icons-unicons

* Revert "Merge remote branch origin master to icons-unicons"

This reverts commit 3f25d50a39.

* Size-up dashnav icons

* Fix alerting icons, panel headers, update tests

* Fix typecheck error

* Adjustments - add panel icon, spacing

* Set TerserPlugin sourceMap to false to prevent running out of memory when publishing storybook

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2020-04-08 14:33:31 +02:00
Andrej Ocenas
a4d4dd325f
Explore: Add trace UI to show traces from tracing datasources (#23047)
* Add integration with Jeager
Add Jaeger datasource and modify derived fields in loki to allow for opening a trace in Jager in separate split.
Modifies build so that this branch docker images are pushed to docker hub
Add a traceui dir with docker-compose and provision files for demoing.:wq

* Enable docker logger plugin to send logs to loki

* Add placeholder zipkin datasource

* Fixed rebase issues, added enhanceDataFrame to non-legacy code path

* Trace selector for jaeger query field

* Fix logs default mode for Loki

* Fix loading jaeger query field services on split

* Updated grafana image in traceui/compose file

* Fix prettier error

* Hide behind feature flag, clean up unused code.

* Fix tests

* Fix tests

* Cleanup code and review feedback

* Remove traceui directory

* Remove circle build changes

* Fix feature toggles object

* Fix merge issues

* Add trace ui in Explore

* WIP

* WIP

* WIP

* Make jaeger datasource return trace data instead of link

* Allow js in jest tests

* Return data from Jaeger datasource

* Take yarn.lock from master

* Fix missing component

* Update yarn lock

* Fix some ts and lint errors

* Fix merge

* Fix type errors

* Make tests pass again

* Add tests

* Fix es5 compatibility

Co-authored-by: David Kaltschmidt <david.kaltschmidt@gmail.com>
2020-04-02 13:34:16 +02:00
Torkel Ödegaard
f2337c9855
Webpack: Do not clean webpack output on every rebuild (#23157) 2020-03-28 06:40:29 +01:00
Dominik Prokop
6070f749c7
Webpack: Fix webpack for enterprise (#22863) 2020-03-18 11:18:48 +01:00
Andrej Ocenas
c64182d579
Webpack: Add relative node_modules path (#22806) 2020-03-16 15:44:23 +01:00
Lukas Siatka
6065b1b91d
DevEnv: updates import of CleanWebpackPlugin to named import (#22800) 2020-03-16 10:52:30 +01:00
Torkel Ödegaard
4e25823705
Webpack: Updated terser plugin (#22669) 2020-03-10 11:09:45 +01:00
Torkel Ödegaard
4f9b6c55c0
Webpack: Upgrade terser webpack plugin (#22332) 2020-02-20 11:38:37 +01:00
Ryan McKinley
2c9b321c48
FieldOverides: apply field overrides based on configuration (#22047)
* test apply

* test apply

* Move standard field config editor registry to grafana-data

* merge master

* Apply field config defaults

* Make field and dataFrameIndex optional on on FieldOverrideContext

* Apply custom field config overrides

* Gauge - make sure thresholds are set

* Move series and field scoped vars calculation

* Enable template variables interpolation in title fields

* Expose standars field configs from grafana ui via function

* Add missing option to the config for the min value to be derived from field values

* Fix ts issue

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-02-13 21:37:24 +01:00
Dominik Prokop
60ed1e9527
Increase ts fork check mem limit (#22118) 2020-02-12 12:08:37 +01: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
Steven Vachon
9005b484f0
Replace ts-loader with Babel (#21587)
* Applied prettier to relevant webpack configs

* Replaced ng-annotate with babel-plugin-angularjs-annotate

… and replaced ts-loader with @preset/typescript

* Removed redundant import

… that is problematic with Babel's module resolver

* Updated lockfile

* Traspile debug package to es5 for PhantomJS support

* Update babel to latest version

* Remove @babel/poolyfill and url search params polyfill

* Add ts-loader to grafana-ui dependencies

* Update prod webpack build to use cor-js 3

* Applied prettier to relevant webpack configs

* Replaced ng-annotate with babel-plugin-angularjs-annotate

… and replaced ts-loader with @preset/typescript

* Updated lockfile

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-01-30 10:54:11 +01:00
Dominik Prokop
814020c05c
Circle: Introduce es-check to branches & pr workflow (#21677)
* Transpile selected es6 node deps

* Add es-check to build-fast-frontend

* change es-check is used

* transpile react-hook-form
2020-01-23 08:33:39 +01:00
Dominik Prokop
8bc4ef3e9c Revert "Babel: use babel-loader instead of ts-loader, ng-annotate with babel-plugin-angularjs-annotate (#21554)" (#21570)
This reverts #21554 which caused problems with e2e.
This reverts commit e7e0d18bc8.
2020-01-17 15:52:56 +01:00
Steven Vachon
e7e0d18bc8 Babel: use babel-loader instead of ts-loader, ng-annotate with babel-plugin-angularjs-annotate (#21554)
* Applied prettier to some webpack configs

* Removed ng-annotate

… and used same annotation approach as webpack.hot.js

* Removed redundant import

… that is problematic with Babel's module resolver

* Updated lockfile

* Replace ts-loader with babel-loader in webpack.dev

* Change tslint-loade order in dev webpack config

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-01-17 12:36:46 +01:00
Dominik Prokop
178bb1d3ab Echo: mechanism for collecting custom events lazily (#20365)
* Introduce Echo for collecting frontend metrics

* Update public/app/core/services/echo/Echo.ts

Co-Authored-By: Peter Holmberg <peterholmberg@users.noreply.github.com>

* Custom meta when adding event

* Rename consumer to backend

* Remove buffer from Echo

* Minor tweaks

* Update package.json

* Update public/app/app.ts

* Update public/app/app.ts

* Collect paint metrics when collecting tti. Remove echoBackendFactory

* Update yarn.lock

* Move Echo interfaces to runtime

* progress on meta and echo

* Collect meta analytics events

* Move MetaanalyticsBackend to enterprise repo

* Fixed unit tests

* Removed unused type from test

* Fixed issues with chunk loading (reverted index-template changes)

* Restored changes

* Fixed webpack prod
2019-12-05 08:30:39 +01:00
kay delaney
6ea2d484b1
Webpack: Fix accidental double typechecking (#18881) 2019-09-04 10:17:49 +01: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
David
89abc77b22
Build: Optional skipping of typescript checking in dev bundler (#18772)
* Build: Removed typescript checking from dev bundler

- when switching branches and trying out features, TS checking and bundling are eating up a lot
of CPU
- most of us are using an editor with typechecking support
- this commit removes type checking from the dev bundler
- we still have type checking enabled as a precommit hook and as part of
the prod bundler

* Adds new npm script: start:noTsCheck
2019-08-30 14:02:31 +02:00
Oleg Gaidarenko
eac1459832
Build: watch and dev mode webpack improvements (#18153)
* Ignore `node_modules` in watch mode

* Simplify development setup
2019-07-20 07:46:41 +03:00
Torkel Ödegaard
2e59166daa
Fix: Autoprefixer is now working (#16351)
The autoprefixer not working broke the phantomjs backend png rendering

Fixes #16345
2019-04-02 18:15:30 +02:00
Johannes Schill
be3f9fcbfe fix: Use proper syntax for plugin-syntax-dynamic-import 2019-03-14 08:26:00 +01:00
Johannes Schill
bdce61d02a chore: Bump clean-webpack-plugin, html-webpack-harddisk-plugin, postcss-reporter 2019-03-14 08:25:56 +01:00
Johannes Schill
79f6b4f8e6 chore: Bump css-loader and remove minimize option since its removed in css-loader 2019-03-14 08:25:54 +01:00
Johannes Schill
76eff009d2 chore: Prod builds should not cache 2019-03-14 08:25:51 +01:00
Johannes Schill
8eab2bef33 chore: Replace Uglify with Terser 2019-03-14 08:25:51 +01:00
Johannes Schill
e3ddfccb61 fix: Move chunk splitting from prod to common so we get the same files in dev as prod 2019-03-05 13:29:54 +01:00
Torkel Ödegaard
5436c28448 Minor refactoring around theme access 2019-02-08 15:38:45 +01:00
Dominik Prokop
71576a634e Do not use js theme variables in sass (poor dev experience for now) 2019-02-08 14:06:06 +01:00
Dominik Prokop
5ba3b0aa2c Selecting theme variable variant helper function 2019-02-07 14:10:20 +01:00