Commit Graph

32 Commits

Author SHA1 Message Date
Josh Hunt
5361efc225
I18n: Migrate to I18next (#55845)
* Switch from lingui from i18next

* Change lingui messages to i18next messages

* Change lingui messages to i18next messages (grafana-ui)

* Init i18n for tests
2022-10-06 16:34:04 +01:00
Ashley Harrison
216565aa00
Chore: Upgrade to jest 28 (#49679)
* bump packages to jest 28

* changes needed for jest 28

* map react-colorful as well

* use customResolver and fix last test

* don't need react-colorful installed if we're using a custom resolver

* return correct thing in mock

* remove watchPathIgnorePatterns since we don't have node_modules anymore
2022-05-30 14:14:34 +01:00
Kristina
4393992775
Remove root/scripts directory from Jest root (#45410) 2022-02-16 07:15:31 -06:00
Josh Hunt
4f6d08f14b
I18N: Add Lingui core translation framework. (#41827)
* I18N: Add Core Lingui framework for translating the UI

* Make FieldSet accept ReactNode for the label, so it can be translated

* Translate a phrase in the User profile edit form

* Translate phrase

* run lingui compile before webpack builds

* init i18n more lazily

* i1n:compile in drone lint step

* wip for getting tests to work

* Use mock lingui/macros because its too hard to use the real macros in Jest...

* mock messages for tests

* use specific lingui version

* add comment for test helper

* we actually don't need the i18n setup in tests because we mock out <Trans />

* update package.json

* remove unneded imports

* revert back babel core version

* Create a I18nProvider wrapper
2021-12-15 17:00:37 +01:00
Ashley Harrison
cc9151d382
Dependencies: Jest 27 (#42681)
* Update jest monorepo

* Update version of marked so it doesn't throw an error, set testEnvironment

* Fix some unit tests

* Remove all these tests that aren't actually working...

* use spyOn instead of mocking the whole module

* Fix linting

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-03 17:09:25 +00:00
kay delaney
3a7c5a0755
Chore: Switch yarn 2 to plug-n-play strategy (#40300) 2021-10-27 14:21:07 +01:00
kay delaney
b2e94d0733
Chore: Migrate yarn from v1 to v2 (#39082)
* Chore: Migrate yarn from v1 to v2

Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
2021-10-08 15:19:10 +01:00
Ryan McKinley
8de218d5f1
Geomap: use a common configuration builder to find location fields (#36768) 2021-07-15 12:00:19 -07:00
Oscar Kilhed
060dccdbf5
Temporarily extend default jest timeout to alliviate stress on drone (#34369) 2021-05-19 12:40:10 +02:00
Ryan McKinley
7499efeef8
Icons: fix iconRoot url (#33243) 2021-04-23 09:06:19 +02: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
Andrej Ocenas
4169646c84
Chore: Set timezone for tests to non utc. (#28405)
* Set timezone for tests to non utc.

* Fix comment
2020-10-20 17:41:47 +02:00
Dominik Prokop
7db050d9a4
Include IANA timezone canonical name in TimeZoneInfo (#27591) 2020-09-17 08:59:20 +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
Alex Khomenko
6b2d44416d
Testing: Use React Testing Library (#27072)
* Add RTL

* Add setupTests.ts

* Refactor DashboardSearch tests
2020-08-20 16:21:42 +03: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
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
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
96dbed5efc
Graph: introduce Tooltip to React graph (#20046) 2019-11-07 12:37:46 +01:00
gotjosh
bc94f85dee
Improvement: Grafana release process minor improvements (#17661)
* Don't display changelog category title when no items

The output of the changelog is meant to be copy/pasted with ease. When a
changelog category does not contain items is better to not display title
at all thus avoiding having the manually modify the output as we include
it in the steps of the process.

* Introduce a CLI task to close milestones whilst doing a Grafana release

As part of a Grafana release, we need to eventually close the GitHub
milestone to indicate is done and remove all the cherry-pick labels from
issues/prs within the milestone to avoid our cherry-pick CLI command to
pick them up on the next release.

* Abstract the GitHub client into a module

* Introduce `GitHubClient` to all CLI tasks
2019-06-24 16:00:01 +01:00
Marcus Efraimsson
c2530be07d Build: Use isolated modules for ts-jest (#16786) 2019-04-26 19:14:48 +02:00
Torkel Ödegaard
0ff572efbf Testing moving out one type to grafana/ui 2018-12-23 08:28:37 +01:00
Torkel Ödegaard
52f583fee7 @grafana/ui lib now contains one components, seperate lint & tsc steps 2018-12-21 14:23:32 +01:00
Torkel Ödegaard
1ce9001141
upgrade of typescript and tslint and jest (#13223) 2018-09-11 13:48:13 +02:00
Tobias Skarhed
a65589a5fb Rename test files 2018-08-14 10:52:41 +02:00
Torkel Ödegaard
5981f67226 tech: enzyme container test working 2018-01-01 18:54:23 +01:00
Torkel Ödegaard
8160e68f93 fix: build & tests 2017-11-17 16:18:30 +01:00
Daniel Lee
b51b681400 build: fixes build and jest tests on Windows
Fixes #9790
2017-11-13 13:48:48 +01:00
Daniel Lee
c22097c95e build: disable jest on precommit hook -windows fix
Temporary fix until we get jest tests working on Windows
2017-10-23 13:03:06 +02: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