Commit Graph

55 Commits

Author SHA1 Message Date
Ashley Harrison
47f8717149
React: Use new JSX transform (#88802)
* update eslint, tsconfig + esbuild to handle new jsx transform

* remove thing that breaks the new jsx transform

* remove react imports

* adjust grafana-icons build

* is this the correct syntax?

* try this

* well this was much easier than expected...

* change grafana-plugin-configs webpack config

* fixes

* fix lockfile

* fix 2 more violations

* use path.resolve instead of require.resolve

* remove react import

* fix react imports

* more fixes

* remove React import

* remove import React from docs

* remove another react import
2024-06-25 12:43:47 +01:00
Konrad Lalik
93870c1cd8
Alerting: Use new endpoints to fetch single GMA rule on view and edit pages (#87625) 2024-05-30 12:55:06 +02:00
Ashley Harrison
670960f70c
Chore: Upgrade redux (#86877)
* update packages

* fix type errors

* upgrade redux toolkit as well

* don't need eslint-disable command

* remove comment

* fix unit tests

* call rtk query selector directly

* remove unnecessary checks
2024-05-10 14:28:51 +01:00
Tom Ratcliffe
8f0f0387b8 Simplify providers used for test utils method
For now, keep the providers down to just what was already in TestProvider
2024-04-16 12:23:50 +01:00
Tom Ratcliffe
0f88075e4c Mark TestProvider as deprecated
(up for discussion, depending on adoption of test utils. Alternative approach could be to re-use TestProvider in test-utils)
2024-04-16 12:23:50 +01:00
Ashley Harrison
b3cff22db3
Chore: Improve types (#85659)
* fixing some types

* more type fixes

* few more

* last couple

* tiny tweak
2024-04-08 09:56:21 +01:00
Torkel Ödegaard
e90b87589f
ModalsContext: Unify modals context and manager (#84916)
* ModalsContext: Unify modals context and manager

* Clear on location change

* fixes

* Update

* use generics to avoid anys

---------

Co-authored-by: joshhunt <josh@trtr.co>
2024-03-28 13:26:57 +01:00
Sonia Aguilar
0e7c0d25fe
Alerting: Add test for creating an alert rule with simplified routing. (#80610)
* Add test for creating an alert rule with simplified routing

* Fix mocking folders after merging from main (folder uid change)
2024-03-11 08:47:56 +01:00
Sergej-Vlasov
3605d85c4c
Dashboards: Remove advancedDataSourcePicker feature toggle (#81790)
* remove advancedDataSourcePicker feature toggle from DataSourcePickerWithPrompt

* remove advancedDataSourcePicker toggle from DataSourcePicker and adjust tests that relied on old picker

* adjust failing tests in QueryVariableEditorForm

* move DataSourceDropdown to DataSourcePicker file

* covert style declaration syntax to object style in DataSourcePicker

* remove advancedDataSourcePicker  feature flag from registry

* remove .only from test

* adjust QueryVariableEditor test to avoid console.error
2024-02-06 09:20:07 +00:00
Ashley Harrison
d1e52d4788
Chore: type fixes (#77618)
* type fixes

* couple more

* just a couple more

* small fixes to prometheus typings

* improve some more datasource types
2023-11-06 11:28:44 +00:00
Sonia Aguilar
1456b26075
Alerting: Fix being redirected to list view when clicking Save rule button (#75510)
* Fix: dont allow 'Save rule' button and let 'Save rule and exit' in case of new rule

* Fix tests
2023-10-03 14:55:42 +02:00
Gilles De Mey
a2c93bb8bc
Alerting: Alert creation UI changes (#73835) 2023-09-06 13:24:48 +02:00
Sonia Aguilar
718401d250
Alerting: Add smart type selection when creating a new alert rule (#71071)
* Add smart type selection when creating a new alert rule

* Auto switch when switch button has not been clicked yet

* remove unnecessay code after the last refacgtor

* Refactor

* Remove unneeded prop

* Move SmartAlertTypeDetector to its own file

* Fix tests

* Refactor: new useSetExpressionAndDataSource hook

* Fix expressions not been propagated when switching from one type to another

* Change texts

* Update tests

* Update text in switch button

* Update texts and tests

* Refactor: move code to getCanSwitch new method

* Move smart alert after queries and remove auto-switch

* Remove expressions and restore them when switching between grafana and cloud type

* Rename previous expression state

* Fix tests

* Add data source name for data source-managed alert selection

* Update reducer when changing cloud data source

* PR review suggestions

* PR review suggestions 2nd part

* PR review suggestions 3th part

* Fix canSwitch

* Update texts on smart alert

---------

Co-authored-by: Virginia Cepeda <virginia.cepeda@grafana.com>
2023-07-13 17:02:47 +02:00
Giordano Ricci
d3450d75a4
Explore: URL migrations & improved state management (#69692)
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2023-06-21 10:06:28 +01:00
Virginia Cepeda
e796063a1e
Alerting: Reorder new alert and export buttons (#68418)
* Add component for rule creation and dropdown

* Make each route type have a different path

* Remove unneeded import

* Fix tests

* Rename CreateRuleButton to MoreActionRuleButtons

* Remove Recording Rule option from new rule form

* Use alerting and recording for path params on new rules

* Fix tests

* Only show new button if permissions are granted

* Fix tests
2023-05-31 10:56:54 -03:00
Sonia Aguilar
49ff85ef54
Alerting: Fix action buttons label and placement in several views following standard and being consistent with the rest of the ui (#67799)
* Fix action buttons label and placement in several views following standard and being consistent with the rest of the ui

* Update public/app/features/alerting/unified/components/mute-timings/MuteTimingForm.tsx

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>

* Fix secondary buttons to not have outline

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2023-05-04 17:05:26 +02:00
Ryan McKinley
39c04a8e36
Chore: Remove deprecated dashboardId from panel query runner (#64786) 2023-04-14 16:50:10 -07:00
Ryan McKinley
36e8ca7f13
Dashboards: Unify angular auto-migration code (#63915) 2023-03-27 18:11:45 +03:00
Torkel Ödegaard
b8e7ef48d0
AppChrome: Unify logic for chromeless pages that should not have NavBar, CommandPalette, Search etc (#62281)
* Keybindings: No global keybindings on chromeless pages

* simplify condition

* Refactoring

* Align name and file

* Move logic into AppChrome

* minor fix

* Update Page.tsx

* Fixing test

* Fixed tests

* More fixes

* Fixed more tests

* Fixing final test

* Fixed search in old nav
2023-02-02 09:53:06 +01:00
Dominik Prokop
c3c4a57c79
grafana/data: Move getPanelOptionsWithDefaults from core (#60813)
* grafana/data: Move getPanelOptionsWithDefaults from core

* Add internal comments
2022-12-29 05:48:22 -08:00
Sonia Aguilar
55055d0b9b
Alerting: Fix RuleEditor flaky test for existing grafana managed alert (#59780)
* Fix RuleEditor flaky test for existing grafana managed alert

* Fix RuleEditor flaky test for creating a new grafana managed alert

* Fix tests for cloud rules

* Split tests for different rule types

* Move common clickSelectOption method to helpers

* Remove from RuleEditorCloudRules.test.tsx  a repeated cloud rule test

* Move existing grafana rule test case to a new file

* Split RuleEditorCloudRules test: move checking only allowed data sources test case to a new test file

* Re-use common ui const

* Re-use renderRuleEditor method

* Create getDiscoverFeaturesMock to reduce code
2022-12-07 16:15:33 +01:00
Ashley Harrison
191ca1df86
Chore: some type fixes (#59030)
some type fixes
2022-11-29 15:52:08 +00:00
renovate[bot]
909d0f4ced
Update Monthly patch updates (#58002)
* Update Monthly patch updates

* update typescript sdk, add ignore for emotion css prop

* fix unit tests

* type fixes

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-11-02 12:05:32 +00:00
kay delaney
e85917f041
Chore/React18: Update component prop types (#56898) 2022-10-14 10:24:32 +01:00
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
Josh Hunt
62a3f2ed32
Chore: Align on 'internationalization' for feature name (#52585)
* rename internationalization docs

* Move localisation.tsx to internationalization/index.tsx
2022-07-21 06:31:08 -04:00
Josh Hunt
bc7ed4baab
Chore: use jest.mocked in favor of type assertions/any (#51156)
* use jest.mocked instead of yucky any

* remove more anys in favor of jest.mocked

* fix stray unused variables
2022-06-21 13:47:33 +01:00
Josh Hunt
47abf44224
Chore: SharedPreferences tests (#51132)
* Add a test assertion function to make testing a little bit easier

* Add tests for SharedPreferences

* Remove some tests from UserProfileEditPage because we're testing SharedPreferences directly now
2022-06-21 09:36:34 +01:00
Jack Westbrook
ccd75d72f8
Chore: Remove react-testing-lib from bundles (#50442)
* refactor(selectoptiontest): move helper function out of grafana/ui so testing-lib isn't in bundle

* test(selectoptionintest): update import location of helper function

* test(amroutes): put back missing selectOptionInTest helper

* test(selectoptionintest): clean up remaining file imports / exports

* test(queryeditor): fix failing import

* refactor(grafana-ui): reuse selectOptionInTest in SelectBase test
2022-06-09 11:10:48 +02:00
Will Browne
abfc711c53
Plugins: Remove deprecated /api/tsdb/query metrics endpoint (#49916)
* remove /api/tsdb/query

* revert changes to alert rules

* regenerate spec based on 9.0.x
2022-06-01 13:05:15 +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
Hugo Häggmark
dbec2b02fd
Variables: move state tree into a keyed state (#44642)
* Variables: move state tree into a keyed state

* Update public/app/features/variables/state/transactionReducer.ts

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

* Chore: fix prettier error

* Chore: renamed slices and lastUid

* Chore: rename toUidAction

* Chore: rename dashboardVariableReducer

* Chore: rename state prop back to templating

* Chore renames variable.dashboardUid

* Chore: rename toDashboardVariableIdentifier

* Chore: rename getDashboardVariable

* Chore: rename getDashboardVariablesState

* Chore: rename getDashboardVariables

* Chore: some more renames

* Chore: small clean up

* Chore: small rename

* Chore: removes unused function

* Chore: rename VariableModel.stateKey

* Chore: rename KeyedVariableIdentifier.stateKey

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
Co-authored-by: kay delaney <kay@grafana.com>
Co-authored-by: Alexandra Vargas <alexa1866@gmail.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-02-18 06:06:04 +01:00
Josh Hunt
c7a5d2c5c7
Chore: Remove our typeAsJestMock in favor of jest.mocked (#45114) 2022-02-09 23:50:59 +01:00
renovate[bot]
d87cd6f26c
Update dependency prettier to v2.5.1 (#43473)
* Update dependency prettier to v2.5.1

* prettier fixes

* chore(toolkit): bump prettier to 2.5.1

* style(eslint): bump grafana config to 2.5.2 in core and toolkit

* style(mssql-datasource): fix no-inferrable-types eslint errors

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2022-02-02 12:02:32 +00:00
Josh Hunt
36983d8d3b
Chore: Mark up User Profile page for translation (#43874)
* Mark up User profile page for translation

* Extract new messages

* updated selectors

* update selectors

* wip TestProvider

* update tests

* fix field labels

* extract new messages

* don't store date objects in redux state

* don't store date objects in redux state
2022-01-17 16:58:49 +00:00
Domas
a56293142a
Alerting: unified alerting frontend (#32708) 2021-04-07 08:42:43 +03:00
Torkel Ödegaard
9d6c8f8512
PanelEdit: v8 Panel Edit UX (#32124)
* Initial commit

* Progress

* Update

* Progress

* updates

* Minor fix

* fixed ts issue

* fixed e2e tests

* More explorations

* Making progress

* Panel options and field options unified

* With nested categories

* Starting to find something

* fix paddings

* Progress

* Breakthrough ux layout

* Progress

* Updates

* New way of composing options with search

* added regex search

* Refactoring to react note tree

* Show overrides

* Adding overrides radio button support

* Added popular view

* Separate stat/gauge/bargauge options into value options and display options

* Initial work on getting library panels into viz picker flow

* Fixed issues switching to panel library panel

* Move search input put of LibraryPanelsView

* Changing design again to have content inside boxes

* Style updates

* Refactoring to fix scroll issue

* Option category naming

* Fixed FilterInput issue

* Updated snapshots

* Fix padding

* Updated viz picker design

* Unify library panel an viz picker card

* Updated card with delete action

* Major refactoring back to an object model instead of searching and filtering react node tree

* More refactoring

* Show option category in label when searching

* Nice logic for categories rendering when searching or when only child

* Make getSuggestions more lazy for DataLinksEditor

* Add missing repeat options and handle conditional options

* Prepping options category to be more flexibly and control state from outside

* Added option count to search result

* Minor style tweak

* Added button to close viz picker

* Rewrote overrides to enable searching overrides

* New search engine and tests

* Searching overrides works

* Hide radio buttons while searching

* Added angular options back

* Added memoize for all options so they are not rebuilt for every search key stroke

* Added back support for category counters

* Started unit test work

* Refactoring and base popular options list

* Initial update to e2e test, more coming to add e2e test for search features

* Minor fix

* Review updates

* Fixing category open states

* Unit test progress

* Do not show visualization list mode radio button if library panels is not enabled

* Use boolean

* More unit tests

* Increase library panels per page count and give search focus when switching list mode

* field config change test and search test

* Feedback updates

* Minor tweaks

* Minor refactorings

* More minimal override collapse state
2021-03-25 08:33:13 +01: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
15033d0011
PanelOptions: Refactoring applying panel and field options out of PanelModel and add property clean up for properties not in field config registry (#30389)
* PanelOptions: Refactoring on applying panel and field options from PanelModel

* Progress

* Filtering out props

* downgraded prettier

* Fixes

* Initial simple remember and restore for custom and overrides

* clearing custom options and overrides and restoring works

* actually use the function

* Added type for options cache

* minor fix

* Updated with new prettier

* Added old field config to panel type change handler

* Update public/app/features/dashboard/state/getPanelOptionsWithDefaults.test.ts

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2021-01-20 16:06:29 +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
Dominik Prokop
332f2f1ae8
Field Config API: Add ability to hide field option or disable it from the overrides (#29879)
* Add ability to hide field option or disable it from the overrides

* Rename options

* Tests
2020-12-17 09:20:47 +01:00
Dominik Prokop
683ce69347
Link suppliers: getLinks API update (#29757)
* ContextMenuPlugin WIP

* Remove Add annotations menu item from graph context menu

* ts ifx

* WIP

* Tests updates

* ts check fix

* Fix rebase

* Use replace function in angular graph data links
2020-12-15 13:29:37 +01:00
Hugo Häggmark
b904e0c621
Chore: Removes observableTester (#29369) 2020-11-26 10:32:02 +01:00
Hugo Häggmark
f9281742d7
CloudMonitoring: Support request cancellation properly (#28847) 2020-11-19 14:09:08 +01:00
Hugo Häggmark
de1b2bdc4c
Transformations: Use Observable (#27584)
* WIP: changes transformer API to Observable

* Refactor: changes ResultProcessor

* WIP: TransformationUI

* wip

* Refactor: Cleaning up code in CalculateFieldTransformerEditorProps

* Refactor: pushing editor and input output down to TransformationEditor

* Refactor: renaming props

* Refactor: makes transformDataFrame more readable

* Refactor: fixes editor issues

* Refactor: changes after merge with master and first tests

* Tests: completes the tests for the Explore changes

* Tests: fixes all transform tests

* Tests: fixed annotations test

* Tests: fixed typechecks

* Refactor: changes transform interface to MonoTypeOperatorFunction

* Chore: cleans up typings

* Update packages/grafana-data/src/transformations/transformDataFrame.ts

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* Tests: fixes broken tests

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2020-10-06 07:55:09 +02:00
Hugo Häggmark
a587bf4f56
Postgres: Support request cancellation properly (Uses new backendSrv.fetch Observable request API) (#27478)
* Postgres: Replaces dataSourceRequest with fetch

* Postgres: Replaces dataSourceRequest with fetch

* Tests: removes unnecessary import
2020-09-15 08:06:04 +02:00
Hugo Häggmark
8ec2aa02c6
Loki: Replaces dataSourceRequest with fetch (#27265)
* Loki: Replaces dataSourceRequest with fetch

* Update public/app/plugins/datasource/loki/datasource.ts

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

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2020-09-01 06:21:21 +02:00
Hugo Häggmark
c7ffc1199c
Variables: turns on newVariables as a new default (#23272)
* Variables: turns on newVariables as default

* Chore: adds default templating state

* Some small refactorings to get the template_srv tests to get green when toggle is enabled by default.

* Refactor: adds getVariables dependency to DashboardModel

* Tests: fixes StackDriver tests

* Tests: updates snapshots

* Tests: updates snapshot for DashboardGrid.test.tsx

* Tests: fixes DashboardModel.test.ts

* fixed initDashboard tests.

* renamed variable.

* changed so we use the templating.list when running the migration work.

* changed so we always returns the variables in sorted order.

* Tests: fixed cloudwatch tests

* added so we set the global template variable props.

* Fixed tests and added moved logic to complete templateSrv variables.

* removed unneccesary updateIndex.

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2020-04-03 09:38:14 +02:00
Torkel Ödegaard
45b7de1910
Explore: Moves PromContext from query level to DataQueryRequest level (#21260)
Closes #19598

Fixes bug introduced recently where the new PromQueryEditor did not preserve
the PromContext.Explore set on the query model by PromQueryField which caused
the table to be empty for Prometheus in explore.
2019-12-27 09:11:16 +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