Commit Graph

35 Commits

Author SHA1 Message Date
Ashley Harrison
50dd95c09b
Chore: Remove betterPageScrolling toggle (#89339)
* remove betterPageScrolling toggle

* add scrollTo test shim
2024-06-18 14:33:08 +01:00
Ashley Harrison
9bf3adabd8
Spinner: Change spinner icon when prefers-reduced-motion is set (#87641)
* change spinner icon when prefers-reduced-motion is set

* update mock

* remove outdated comment

* fix matchMedia mocks

* update spinner aria label
2024-05-13 11:32:02 +01:00
Jack Westbrook
d282b7a6f8
Grafana UI: Make it possible to bundle package with plugins (#76191)
* moved themecontext to data

* chore(grafana-ui): re-export ThemeContext from grafana/data for backwards compatibility

* Moved icon bundling to core.

* feat(plugins): share react-inlinesvg with plugins for grafana/ui bundling

* chore(codeowners): add generate-icon-bundle.js to file

* chore(storybook): update path to iconBundle file for theme

* feat(plugins): share i18n dependency via systemjs

* Make sure that icon bundle is initialized for tests.

* Removed comment.

* added tests for icon root.

* Removing the need of having an init variable.

* feat(grafana-ui): add icon svgs to bundle for projects that don't rely on grafana

---------

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2023-10-13 14:11:41 +02:00
Laura Fernández
b632eb33b9
Grafana UI: Text component show all text on hover when it is truncated (#68578) 2023-07-31 18:04:48 +02:00
Torkel Ödegaard
e7797ac439
SceneDashboard: Adds menu to panels, a start for inspect drawer state (#71194)
* Began work on panel menu

* SceneDashboard: Basic state handling for inspect panel

* Switched to using scene url sync instead

* Updated

* Update comment on hack

* Fixed url synnc issues and more / better DashboardsLoader tests

* Progress on test

* Updates

* Progress

* Progress

* Update

* Update

* Update

* Update

* Update scenes lib

* Update

* Update

---------

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2023-07-12 13:37:26 +02:00
Ashley Harrison
ff429c9af5
Navigation: Fix toolbar actions flickering on mobile (#70524)
* fix flickering overflow

* set everything to hidden by default

* extend intersectionobserver mock
2023-06-23 08:50:51 +01:00
Ashley Harrison
850f2baaf3
Chore: remove localStorage mock which doesn't work in node v18.16.0 (#66671)
remove localStorage mock which doesn't work in node v18.16.0
2023-04-17 14:40:32 +01:00
Ashley Harrison
92a750a732
Chore: convert last test to RTL and remove Enzyme references (#61918)
convert last test to RTL and remove enzyme references
2023-01-24 09:20:47 +00:00
Ryan McKinley
5888f53aab
Angular: auto-migrate graph panel when angular is disabled (#59247) 2022-11-23 13:32:52 -08:00
Sven Grossmann
6bc09a6390
Logs: Add Download logs button to log log-browser (#55163)
* move download functions to utils

* add downloads button

* removed unused export annotations

* changed button to `ToolbarButton`

* added tests and restructured download methods

* pin `blob-polyfill`

* add missing import

* changed type
2022-09-29 16:09:40 +02:00
Ashley Harrison
211c9991c5
Navigation: Add responsive behaviour to ToolbarButtonRow (#53739)
* hacky first attempt

* slightly cleaner...

* behaviour mostly working...

* remove unnecessary wrapper

* css tweaks

* much cleaner implementation with intersectionobserver

* set style props directly on children

* separate story, integrate when toggle is off

* improve story, integrate when toggle is on

* remove styles from DashNavTimeControls

* mock IntersectionObserver for all unit tests

* prettier

* don't use dropdown anymore

* add some basic documentation

* add right alignment to scenes toolbarbuttonrow

* just use the react children api to prevent duplicating children
2022-08-24 11:19:36 +01:00
Levente Balogh
d6d49d8ba3
DataSources: refactor datasource pages to be reusable (#51874)
* refactor: move utility functions out of the redux actions

* refactor: move password handlers to the feature root

* refactor: move API related functions to an api.ts

* refactor: move components under a /components folder

* refactor: move page containers under a /pages folder and extract components

* refactor: update mocks to be easier to reuse

* refactor: move tests into a state/tests/ subfolder

* refactor: expose 'initialState' for plugins

* refactor: move generic types to the root folder of the feature

* refactor: import path fixe

* refactor: update import paths for app routes

* chore: update betterer

* refactor: fix type errors due to changed mock functions

* chore: fix mocking context_srv in tests

* refactor: udpate imports to be more concise

* fix: update failing test because of mocks

* refactor: use the new `navId` prop where we can

* fix: use UID instead ID in datasource edit links

* fix:clean up Redux state when unmounting the edit page

* refactor: use `uid` instead of `id`

* refactor: always fetch the plugin details when editing a datasource

The deleted lines could provide performance benefits, although they also make the
implementation more prone to errors. (Mostly because we are storing the information
about the currently loaded plugin in a single field, and it was not validating if it
is for the latest one).

We are planning to introduce some kind of caching, but first we would like to clean up
the underlying state a bit (plugins & datasources.

* fix: add missing dispatch() wrapper for update datasource callback

* refactor: prefer using absolute import paths

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>

* fix: ESLINT import order issue

* refactor: put test files next to their files

* refactor: use implicit return types for components

* fix: remove caching from datasource fetching

I have introduced a cache to only fetch data-sources once, however as we
are missing a good logic for updating the instances in the Redux store
when they change (create, update, delete), this approach is not keeping the UI in sync.
Due to this reason I have removed the caching for now, and will reintroduce it once we have a
more robust client-side state logic.

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-07-20 09:25:09 +02:00
Josh Hunt
3c6e0e8ef8
Chore: ESlint import order (#44959)
* Add and configure eslint-plugin-import

* Fix the lint:ts npm command

* Autofix + prettier all the files

* Manually fix remaining files

* Move jquery code in jest-setup to external file to safely reorder imports

* Resolve issue caused by circular dependencies within Prometheus

* Update .betterer.results

* Fix missing // @ts-ignore

* ignore iconBundle.ts

* Fix missing // @ts-ignore
2022-04-22 14:33:13 +01:00
Artur Wierzbicki
f45eb309ef
Live: move centrifuge service to a web worker (#41090)
* Fix: make webpack pickup workers written in TS

* Add comlink to dependencies

* Temporary fix: copy paste `toDataQueryError` from @grafana/runtime to avoid web dependencies

* Implemented comlink-based centrifuge worker & worker proxy

* Temporary fix: implement comlink transferHandlers for subscriptions and streamingdataframes

* Move liveTimer filtering from CentrifugeService into GrafanaLiveService

* Switch from CentrifugeService to CentrifugeServiceWorkerProxy in GrafanaLive

* Naming fix

* Refactor: move liveTimer-based data filtering from GrafanaLiveService to CentrifugeServiceWorker

* observe dataStream on an async scheduler

* Fix: - Unsubscribe is now propagated from the main thread to the worker, - improve worker&workerProxy types

* Fix: Prettify types

* Fix: Add error & complete observers

* Docs: Add comment explaining the `subscriberTransferHandler`

* Fix: Replace `StreamingDataFrameHandler` with explicitly converting StreamingDataFrame to a DataFrameDTO

* Refactor: move liveTimer filtering to service.ts to make it easy to implement a `live-service-web-worker` feature flag

* Feat: add `live-service-web-worker` feature flag

* Fix: extract toDataQueryError.ts to a separate file within `@grafana-runtime` to avoid having a dependency from webworker to the whole package (@grafana-runtime/index.ts)

* Update public/app/features/dashboard/dashgrid/liveTimer.ts

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>

* Fix: fixed default import class in worker file

* Fix: cast worker as Endpoint

* Migrate from worker-loader to webpack native worker support v1 - broken prod build

* Fix: Use custom path in HtmlWebpackPlugin

* Fix: Loading workers from CDNs

* Fix: Avoid issues with jest ESM support by mocking `createWorker` files

* Fix: move the custom mockWorker rendering layout to `test/mocks`

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-11-09 21:05:01 +04:00
Hugo Häggmark
b4f00d6312
Variables: Only update panels that are impacted by variable change (#39420)
* Refactor: adds affectedPanelIds and fixes some bugs

* Refactor: Fixes all dependencies and affected panel ids

* Refactor: glue it together with events

* Chore: remove debug code

* Chore: remove unused events

* Chore: removes unused function

* Chore: reverts processRepeats

* Chore: update to use redux state

* Refactor: adds feature toggle in variables settings

* Refactor: adds appEvents to jest-setup

* Tests: adds tests for strict panel refresh logic

* Refactor: small refactor

* Refactor: moved to more events

* Tests: fixes test

* Refactor: makes sure we store strictPanelRefreshMode in dashboard model

* Refactor: reporting and adds tests

* Tests: fix broken tests

* Tests: fix broken initDashboard test

* Tests: fix broken Wrapper test

* Refactor: adds solution for $__all_variables

* Chore: updates to radio button

* Refactor: removes toggle and calculates threshold instead

* Chore: fix up tests

* Refactor: moving functions around

* Tests: fixes broken test

* Update public/app/features/dashboard/services/TimeSrv.ts

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

* Chore: fix after PR comments

* Chore: fix import and add comment

* Chore: update after PR comments

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
2021-11-09 12:30:04 +01:00
kay delaney
3a7c5a0755
Chore: Switch yarn 2 to plug-n-play strategy (#40300) 2021-10-27 14:21:07 +01:00
Torkel Ödegaard
54af57b8e6
VisualizationSelection: Real previews of suitable visualisation and options based on current data (#40527)
* Initial pass to move panel state to it's own, and make it by key not panel.id

* Progress

* Not making much progress, having panel.key be mutable is causing a lot of issues

* Think this is starting to work

* Began fixing tests

* Add selector

* Bug fixes and changes to cleanup, and fixing all flicking when switching library panels

* Removed console.log

* fixes after merge

* fixing tests

* fixing tests

* Added new test for changePlugin thunk

* Initial struture in place

* responding to state changes in another part of the state

* bha

* going in a different direction

* This is getting exciting

* minor

* More structure

* More real

* Added builder to reduce boiler plate

* Lots of progress

* Adding more visualizations

* More smarts

* tweaks

* suggestions

* Move to separate view

* Refactoring to builder concept

* Before hover preview test

* Increase line width in preview

* More suggestions

* Removed old elements of onSuggestVisualizations

* Don't call suggestion suppliers if there is no data

* Restore card styles to only borders

* Changing supplier interface to support data vs option suggestion scenario

* Renamed functions

* Add dynamic width support

* not sure about this

* Improve suggestions

* Improve suggestions

* Single grid/list

* Store vis select pane & size

* Prep for option suggestions

* more suggestions

* Name/title option for preview cards

* Improve barchart suggestions

* Support suggestions when there are no data

* Minor change

* reverted some changes

* Improve suggestions for stacking

* Removed size option

* starting on unit tests, hit cyclic dependency issue

* muuu

* First test for getting suggestion seems to work, going to bed

* add missing file

* A basis for more unit tests

* More tests

* More unit tests

* Fixed unit tests

* Update

* Some extreme scenarios

* Added basic e2e test

* Added another unit test for changePanelPlugin action

* More cleanup

* Minor tweak

* add wait to e2e test

* Renamed function and cleanup of unused function

* Adding search support and adding search test to e2e test
2021-10-25 13:55:06 +02:00
Leon Sorokin
9eac9aefde
GraphNG: uPlot 1.6.13 (#35844) 2021-06-17 13:20:27 -05:00
Dominik Prokop
8d339a279b
Eslint: no-duplicate-imports rule (bump grafana-eslint-config) (#30989)
* Eslint: no-duplicate-imports rule (bump grafana-eslint-config)

* Chore: Fix duplicate imports (#31041)

* Rebased this branch into eslint-no-duplicate-imports

* updated some changes

* merged uncaught duplicate imports

* fixes frontend test- I hope

* fixes e2e test- I hope

Co-authored-by: Uchechukwu Obasi <obasiuche62@gmail.com>
2021-02-11 13:45: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
Torkel Ödegaard
ec218de05e
React: Upgrading react to v17, wip (#29057)
* React: Upgrading react, wip

* build(grafana-ui): bump react to v17

* build: get enzyme running with react 17

* chore(grafana-ui): declare isMemo namedExport for rollup

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2020-11-18 19:37:17 +01:00
Tobias Skarhed
0c4dae321c
Migrations: Signup page (#21514)
* Start Angular migration

* Add SignupCtrl

* Change name signup

* Add backend call

* Put form in separate file

* Add form model

* Start using react-hook-forms

* Add FormModel to state

* Reduxify

* Connect nav with Redux

* Fix routing and navModel

* Fetch state options on mount

* Add default values and add button margin

* Add errror messages

* Fix title

* Remove files and cleanup

* Add Signup tests

* Add boot config assingnAutoOrg and verifyEmailEnabled

* Remove onmount call

* Remove ctrl and move everything to SignupForm

* Make routeParams optional for testing

* Remove name if it is empty

* Set username

* Make function component

* Fix subpath issues and add link button

* Move redux to SignupPage
2020-02-17 11:13:13 +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
96dbed5efc
Graph: introduce Tooltip to React graph (#20046) 2019-11-07 12:37:46 +01:00
Torkel Ödegaard
81dd57524d
Panels: Progress on new singlestat / BigValue (#19374)
* POC: friday hack

* exploring new singlestat styles

* minor changes

* Testing bizcharts

* style tweaks

* Updated

* minor progress

* updated

* Updated layout handling

* Updated editor

* added editor options

* adding mode

* progress on new display mode

* tweaks

* Added classic style

* Added final mode

* Minor tweak

* tweaks

* minor tweak

* Singlestat: Adjust colors for light theme

* fixed build issues with bizcharts

* fixed typescript issue

* updated snapshot

* Added demo dashboard
2019-10-04 12:01:42 +02:00
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
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
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
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
Patrick O'Carroll
b8d82df97e added no-angle-bracket-type-assertion rule and updatet files to follow rule (#13115) 2018-09-03 11:30:44 +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
314b645857
tslint: changing vars -> const (#13034) 2018-08-26 18:43:07 +02:00
Tobias Skarhed
72ecf72c45 Mock core in jest-setup 2018-06-12 16:14:22 +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