* rename routes and fix access control for support bundles
* AccessControl: Hide menu if not authorized
* AccessControl: Add AC guards for create and delete
* lint
* feat: add draft version of validate button
* feat: add some styling and basics
* temp: intermediate result
* refactor: solve TODOs
* refactor: replace string in state
* refactor: replace error message style
* refactor: set validate state on change in ds
* refactor: add QueryRunner
* refactor: add QueryRunner
* temp: temporary status
* Emit PanelData to check if the query is valid
* refactor: clean up
* refactor: improve a11y of error message and adjust test
* Remove deprecated property call, change equality
* refactor: add changes from code review
* refactor: remove memory leak
* refactor: replace query runner
* refactor: adjust error handling
* refactor: move testing to related unit test
* refactor: clean up test for QueryEditorField
* refactor: clean up test for CorrelationsPage
* refactor: repair test
* refactor: clean up
* refactor: add refId in order avoid errors when running Loki queries
* refactor: replace buildQueryTransaction + set query to invalid if query is empty
* refactor: add empty query value to test cases
* refactor: end handleValidation after setIsValidQuery()
* refactor: refactor test
* refactor: fix last two tests
* refactor: modify validation
* refactor: add happy path
* refactor: clean up
* refactor: clean up tests (not final)
* refactor: further clean up
* refactor: add condition for failing
* refactor: finish clean up
* refactor: changes from code review
* refactor: add response state to condition
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
* refactor: fix prettier issue
* refactor: remove unused return
* refactor: replace change in queryAnalytics.ts
* refactor: remove correlations from query analytics
* refactor: remove unnecessary test preparation
* refactor: revert changes from commit 4997327
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
Co-authored-by: Kristina Durivage <kristina.durivage@grafana.com>
* WIP first attempt to query variable
* regex issue repro demo
* Refresh variable on time range change if refresh specified
* Instantiate variable runner when updating query variable options
* Simplify runners getTarget interface
* Fix issue with variable ot being updated correctly after other variable changed
* Add templateSrv.replace compatibility with query variable
* QueryVariable: use datasource variable as source
* use proper format
* Make sure variables set is correctly updated when query variable errors
* Do not destruct scopedVars when using sceneGraph.interpolate in templateSrv
* Add support for Legacy variables (metricFindQuery)
* Review
* Fix lint
* Test: Add unit for datasource by variable
* test: Add unit for datasource as var
* query: delegate interpolation to datasourceSrv
* Cleanup
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
* Update dependency @reduxjs/toolkit to v1.9.0
* fix types on mockToolkitActionCreator
* Fix external AM selector tests
* timeout added in shared public dashboard test
* Revert "timeout added in shared public dashboard test"
This reverts commit 205c295192.
* update to @reduxjs/toolkit@1.9.1
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
Co-authored-by: Juan Cabanas <juan.cabanas@grafana.com>
* 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
* First baby steps
* First baby steps
* No progress really
* Updates
* no progress
* refactoring
* Progress on sub menu and value selectors
* Some more tweaks
* Lots of progress
* Progress
* Updates
* Progress
* Tweaks
* Updates
* Updates to variable system
* Cleaner tests
* Update
* Some cleanup
* correct test name
* Renames and moves
* prop rename
* Fixed scene template interpolator
* More tests for SceneObjectBase and fixed issue in EventBus
* Updates
* More tweaks
* More refinements
* Fixed test
* Added test to EventBus
* Clone all scene object arrays
* Simplify
* tried to merge issue
* Update
* added more comments to interface
* temp progress
* Trying to simplify things, but struggling a bit
* Updated
* Tweaks
* Progress on fixing the select componenet and typing, and sharing code in a base class
* Updated
* Multi select
* Simpler loading state
* Update
* removed failOnConsole
* Removed old funcs
* Moved logic from update manage to MultiValueVariable
* Added tests for MultiValueVariable logic
* Made value a more abstract concept to support object values
* renamed func to getValueText
* Refactored and moved logic to VariableSet
* Added test for deactivation and query cancelling
* Tweaks
* Fixed lint issues
* Attach static generic data link to data frames in Explore
* WIP
* Always load correlations config when the query is run
This will be moved to Wrapper.tsx and called only once Explore is mounted
* remove comment
* Load the config when Explore is loaded
* Clean up
* Check for feature toggle, simplify cod
* Simplify the code
* Remove unused code
* Fix types
* Add a test for attaching links
* Revert package.json changes
* Display title provided in the correlation label
* Add missing mocks
* Fix tests
* Merge branch 'main' into ifrost/integration/attach-generic-data-link
# Conflicts:
# public/app/features/explore/Wrapper.tsx
# public/app/features/explore/state/main.ts
* Remove redundant async calls
* Do not block Wrapper before correlations are loaded (only delay the query)
* Test showing results after correlations are loaded
* Post-merge fix
* Use more consistent naming
* Avoid null assertions
Co-authored-by: Elfo404 <me@giordanoricci.com>
* Switch from lingui from i18next
* Change lingui messages to i18next messages
* Change lingui messages to i18next messages (grafana-ui)
* Init i18n for tests
* Initial progress
* Moving keybindingSrv to context
* Simplfy KioskMode
* Removed unused logic
* Make kiosk=tv behave as before but when topnav is enabled
* Minor fix
* Fixing tests
* Fixing bug with notice when entering kiosk mode
* Fixed test
* 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
* 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>
* 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
* 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
* 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
* I18n: Translate navigation items
* improve comment, remove console.log
* update mock macros
* Mark up all phrases for translation
* added deprecate text comment, moved translations to a seperate file
* use TestProvider in NavBarItem
* use TestProvider in nav tests
* remove text deprecation comment
* update translations
* 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
* Update dependency typescript to v4.5.4
* Changes needed to support new TypeScript version
* kick drone
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* 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
* Limit number of suggestions displayed in Graphite dropdowns
* Use limit API to reduce number of loaded tags for autocomplete
* Make tests more explicit