* refactor(elastic-test): add datasource mock factory
* refactor(elastic-test): use new factory and attempt to fix some type issues
* refactor(elastic-test): type fixes
* refactor(elastic-test): update test with mock changes
* refactor(elastic-test): remove commented code
Git history should be more than enough to go back to previous revisions instead of keeping commented code.
* refactor(elastic-test): use mock factory and fix type issues in language provider test
* Chore: rename mock parameter
* Chore: remove unnecessary conditional
* Chore: remove ts-expect-error
* Change nav structure when topnav is enable to do initial tests with new information architecture
* Support for nested sections
* Updated
* sentance case
* Progress on plugin challange
* Rewrite to functional component
* Progress
* Updates
* Progress
* Progress on things
* missing file
* Fixing issue with runtime, need to use setter way to set component exposed via runtime
* Move PageLayoutType to grafana/data
* Fixing breadcrumb issue, adding more tests
* reverted backend change
* fix recursive issue with cleanup
* Fix panel option bugs and make tooltip options work
* Support multiple series in explicit mode. Rename XY/Explicit to Auto/Manual
* Fixes
* Fix
* Legend improvements
* Rewrite Pure Component to Function Component
* Add datalinks support
* Legend fixes and CR modifications
* Fix bugs that crash panel
* Revert "Add FocusScope to PanelEditor when open in the Dashboard Page so that a11y focus never catches invisible content. (#54400)"
This reverts commit ef32050508.
* Betterer <3
* remove annotation angular dependency and migrate annotations
* add nullish coalescing operator
* remove annotations angular partial
* make annotation queries code and errors more readable
* handle the betterer issue with '^ Unexpected any. Specify a different type' at top of file
* run precommits
* run prettier
* refactor(loki-test): move mock creation to mock module
* refactor(loki-test): allow to pass custom settings to the mock constructor
* refactor(loki-test): refactor mock factory in datasource test
* refactor(loki-test): revert change in undefined test case for dsMaxLines
* refactor(loki-test): move type assertion to mock definition
* refactor(loki-test): fix more type issues
* refactor(loki-explore-query-editor): refactor test to use createLokiDatasource() and fix type issues
* refactor(loki-test): replace makeMockLokiDatasource with metadataRequest factory
* fix: remove any
* fix(loki-test): fix remaining usages of any
* Fix: add missing exported type
* Adhoc variable: Correctly preselect datasource when provisioning
* Fix test
* Remove data sources from ad hoc variable state in favor of DataSourcePicker
* Scenes: Support new top nav
* Page: Make Page component support new and old dashboard page layouts
* Pass scrollbar props
* Fixing flex layout for dashboard
* Progress on dashboard settings working with topnav
* Updated
* Annotations working
* Starting to work fully
* Fix merge issue
* Fixed tests
* Added buttons to annotations editor
* Updating tests
* Move Page component to each page
* fixed general settings page
* Fixed versions
* Fixed annotation item page
* Variables section working
* Fixed tests
* Minor fixes to versions
* Update
* Fixing unit tests
* Adding add variable button
* Restore annotations edit form so it's the same as before
* Fixed semicolon in dashboard permissions
* Fixing unit tests
* Fixing tests
* Minor test update
* Fixing unit test
* Fixing e2e tests
* fix for e2e test
* fix a11y issues
* Changing places Settings -> General
* Trying to fix a11y
* I hope this fixes the e2e test
* Fixing merge issue
* tweak
* 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
* Add fixture-factories for all variable types
* clean up variable guards
* add tests for isMulti, hasCurrent, and hasOptions variable type guards
* create VariableSupport type to try and work around ts wonkiness
* migrate influxQL annotations to react and build new annotation editor
* use es-lint ignore for any type in migration
* changes for PR comments
* handle annotation editor on load error without query
* correct label for ann editor query
* add null coalesce operator and remove comment
* fix tooltip
* Disable direct access
* Hide access select if Server mode is already selected
* Update docs
* Add more tests
Co-authored-by: Beto Muniz <contato@betomuniz.com>
* wip
* make diff easier to read
* Update template_srv getVariables to return new TypedVariableModel
* update VariableType to use the type from TypedVariableModel
* tidy things up
* Chore: Use type-accurate mock variables in tests
* Chore: Type VariableState to use TypedVariableModel
* fix typo
* remove type assertion from template_srv.getVariables
* use typescript/no-redeclare for compatibility with ts overloads
* remove generics from getVariable() and overload it to only return undefined based on arguments
* update usages of getVariable()
* Remove generic from getInstanceState
* update usages of getInstanceState
* fix lint
* wip
* make diff easier to read
* Update template_srv getVariables to return new TypedVariableModel
* update VariableType to use the type from TypedVariableModel
* tidy things up
* Chore: Use type-accurate mock variables in tests
* Chore: Type VariableState to use TypedVariableModel
* fix typo
* remove type assertion from template_srv.getVariables
* use typescript/no-redeclare for compatibility with ts overloads
* remove generics from getVariable() and overload it to only return undefined based on arguments
* update usages of getVariable()
* Fix Interval variable options picker not working
* Geomap: add measuring tools
* Add measure type selection
* Add controls and state to measure overlay
* Override tooltip mouse events when menu active
* Move measure tools to top right
* Lay groundwork for units and consolidate measuring
* Create measure vector layer class
* Improve styling to match other overlay controls
* Consolidate styling and use theme2
* Update unit language and add km2
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
* Chore: add missing refId property to LokiQuery type
* Chore: fix types in Loki querybuilder state test
* Chore: remove unnecessary added property to LokiQuery
* Revert "Chore: Bump terser to fix security vulnerability (#53052)"
This reverts commit 7ae74d2a18.
* feat: use tsc and rollup directly with esbuild and publishConfig, files props
* refactor(grafana-data): fix isolatedModules re-export type error
* refactor(grafana-data): import paths from src not package name
* refactor(rollup): fix dts output.file
* chore(grafana-schema): delete dashboard_experimental.gen.ts - cannot work with isolatedModules
* refactor(grafana-e2e-selectors): fix export types isolatedModules error
* refactor(grafana-runtime): fix isolatedModules re-export type error
* refactor(grafana-ui): fix isolatedModules re-export type error
* feat(grafana-ui): use named imports for treeshaking
* refactor(grafana-ui): use named imports for treeshaking
* feat: react and react-dom as peerDeps for packages
* feat(grafana-ui): emotion packages as peerDeps
* feat(grafana-e2e): use tsc, rollup, esbuild for bundling
* chore(packages): clean up redundant dependencies
* chore(toolkit): deprecate unused package:build task
* chore(schema): put back dashboard_experimental and exclude to prevent isolatedModules error
* docs(packages): update readme
* chore(storybook): disable isolatedModules for builds
* chore: relax peerDeps for emotion and react
* revert(grafana-ui): put @emotion dependencies back
* refactor: replace relative package imports with package name
* build(packages): set emitDeclaration false for typecheck scripts to work
* test(publicdashboarddatasource): move test next to implementation. try to appease the betterer gods
* chore(storybook): override ts-node config for storybook compilation
* refactor(grafana-data): use ternary so babel doesnt complain about expecting flow types
* chore(toolkit): prefer files and publishConfig package.json props over copying
* build(npm): remove --contents dist arg from publishing commands
* chore(packages): introduce sideEffects prop to package.json to hint package can be treeshaken
* chore(packages): remove redundant index.js files
* feat(packages): set publishConfig.access to public
* feat(packages): use yarn berry and npm for packaging and publishing
* refactor(packages): simplify rollup configs
* chore(schema): add comment explaining need to exclude dashboard_experimental
* revert(toolkit): put back clean to prevent cli failures
* ci(packages): run packages:pack before a canary publish
* chore(gitignore): add npm-artifacts directory to ignore list
* test(publicdashboarddatasource): fix module mocking
* chore(packages): delete package.tgz when running clean
* chore(grafana-data): move dependencies from devDeps to prevent build resolution errors
* wip
* make diff easier to read
* Update template_srv getVariables to return new TypedVariableModel
* update VariableType to use the type from TypedVariableModel
* tidy things up
* Chore: Use type-accurate mock variables in tests
* Chore: Type VariableState to use TypedVariableModel
* fix typo
* remove type assertion from template_srv.getVariables
* undo whatever changes i did to swagger spec
* remove UseState + add support for controls in TimeOfDayPicker story
* remove UseState + add controls support in TimeRangeInput story
* Add documentation + fix error when clearing
* properly type range
* wip
* make diff easier to read
* Update template_srv getVariables to return new TypedVariableModel
* update VariableType to use the type from TypedVariableModel
* tidy things up
* Fix comment lines
* Introduce graphite variable editor
* Render results differently based on queryType
* Add comments and fallback values
* Unit tests for different type of graphite queries
* Use metrics/expand endpoint to retrieve metric names
* First stab at new page layouts behind feature toggle
* Simplifying PageHeader
* Progress on a new model that can more easily support new and old page layouts
* Progress
* rename folder
* Progress
* Minor change
* fixes
* Fixing tests
* Make breadcrumbs work
* Add tests for old Page component
* Adding tests for new Page component and behavior
* fixing page header test
* Fixed test
* Moving user profile routes to navId
* PageLayouts: Updates dashboards routes with navId
* added missing navId
* AppChrome outside route
* Renaming folder
* Minor fix
* Updated
* Fixing StoragePage
* Updated
* Updating translation ids
* Updated snapshot
* update nav translation ids (yes this is confusing)
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: joshhunt <josh@trtr.co>
* 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>
* Fix: sql plugins feature
* SQLDS: Use builtin annotation editor
Plus strict rule fixes
* MSSQL: Migrate query editor to React
* Make code editor work
* Make SQLOptions and SQLQuery in SQLDatasource and in Editor generic
* MSSQL: Fix ts issues
* Fix SQLDatasource refID
* Remove comment
* Revert "Make SQLOptions and SQLQuery in SQLDatasource and in Editor generic"
This reverts commit 1d15b4061a.
* Fix ts issues without generic
* TS
* refactor(Data Sources): rename file to follow naming convention
* refactor: use react-redux hooks for interacting with the store
* tests: update data-sources list related test files
* refactor: extract datasource list page contents
* refactor: pass dataSources to the DataSourcesList as a prop
* refactor: use proper typing for navIndex mocks
* Playing around
* This is getting interesting
* Updates
* Updated
* Observable experiments
* This is tricky
* VizPanel panel renderer
* New model progress
* Maybe this could be something
* Updated
* Rename
* updates
* Updated
* Query runners? not sure
* Updated
* updates
* flex box layout starting to work
* Testing
* Tested an action
* Parent context sort of working
* Progress
* Progress
* Updated
* Starting to work
* Things are working
* Scene list, nested scene demo
* Progress on repeats
* Moving things
* Pretty big progress
* More things working
* Great progress
* Progress
* Name changing
* Minor tweaks
* Simplified sizing
* Move toggleDirection to SceneFlexLayout
* add feature flag (#50990)
* removed new useObservable hook
* Rename folder and feature toggle to scenes
* Caching scenes so you can go back to another scene without having to re-query data
* Fix issue with subs on re-mount
* Fixing test
* Added SceneCanvasText to play around with layout elements with size based on content
* Scene: Edit mode and component edit wrapper that handles selection (#51078)
* First step for scene variables
* Started playing around with a scene edit mode
* Better way to set component
* Progress on edit mode
* Update
* Progress on edit mode
* Progress on editor
* Progress on editor
* Updates
* More working
* Progress
* Minor update
* removed unnessary file
* Moving things around
* Updated
* Making time range separate from time picker
* minor rename of methods
* The most basic variable start
* Minor renames
* Fixed interpolate issue if not found at closest level
* An embryo of event model and url sync handling
* Update url sync types
* Removed unnessary any type arg
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* passes id and uid to PublicDashboardDatasource
* betterer results
* If for a public dashboard, return the PublicDashboardDataSource first or else getDatasourceSrv.get() will fail bc of no authed user.
Added some unit tests for resolving the uid from the many possible datasource types.
* updates betterer
* Exports DashboardService. Adds method to DashboardService to build anonymous user for use with public dashboards where there is no authed user. Adds method on dashboard_queries to get all dashboard uids from a dashboard.
* refactors to get unique datasource uids
* Adds tests for getting all unique datasource uids off a dashboard
* adds test for building anonymous user with read and query actions that are scoped to each datasource uid in the dashboard
* updates casing of DashboardService
* updates test case to have additional panel with a different datasource
* gives default interval to public dashboard data source
* First stab at new page layouts behind feature toggle
* Simplifying PageHeader
* Progress on a new model that can more easily support new and old page layouts
* Progress
* rename folder
* Progress
* Minor change
* fixes
* Fixing tests
* Make breadcrumbs work
* Add tests for old Page component
* Adding tests for new Page component and behavior
* fixing page header test
* Fixed test
* AppChrome outside route
* Renaming folder
* Minor fix
* Updated
* Fixing StoragePage
* Fix for banners
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Add SpanBarSettings
* Add SpanBarSettings to Jaeger
* Add SpanBarSettings to Zipkin
* Updated title
* Add dropdown to select identifer and make duration a default option
* Show duration by default
* Add option to hide
* Move identifers into constants
* Add process
* Update text
* Update placeholders
* Text/meta data updates
* Added tests
* Added docs
* Update find
* Merge tag and prcoess options
* Update docs
* Updated tests
* Update betterer results and trace view to match
* Updated docs
* Import the mdx documentation file to PluginSignatureBadge.story.tsx and add to its export defaul
* Create the mdx file of PluginSignatureBadge with its information
* Fix signed PluginSignatureBadge status
* Modify text according to reviewer suggestions
* betterer
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Convert QueryOperationRow test to RTL
* Convert QueryOperationRow test to RTL
* Convert QueryOperationRow test to RTL
* Convert QueryOperationRow test to RTL
* Update QueryOperationRow.test.tsx
* update betterer
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Added mdx file for secret input
* Chore: Improve SecretInput story
* review related changes in docs
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* rewrite eslint test to not care about position of errors
* changing file contents shouldn't require a betterer.results update
* fix up eslint test
* fix the undocumented stories test
* ignore .test.ts files as well
A bug introduced by #49259 would crash the annotations view of a panel with a linked alert rule. States are now normalized so crashes won't occur and the base state is used instead.
* add special handling on the plugin gathering side to check whether secrets manager plugins are enabled or not
* show disabled badge in front end if the plugin is not enabled
* Only show error in disabled badge hover if one is present (otherwise it shows "undefined")
* refactor to make use of fields already available in the DTO
* fix typo
* if there is no error returned for the plugin, just show 'disabled'
* fix typo
* Update public/app/features/plugins/admin/components/Badges/PluginDisabledBadge.tsx
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* Update frontendsettings.go
add clarifying comment
* fix unit test
* rework task to use new frontend property combined with plugin type to determine if the plugin should be disabled
* Update helpers.test.ts
revert test change
* fix unit test
* bogus commit to trigger precommit
* undo commit
* run precommit manually
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* on a text panel first interpolate, then markdown, then sanitize;
* update devenv dashboard + e2e tests
* fix typo and undo changes in grafana/data
* handling of config option disableSanitizeHtml more readable when preparing markdown in text panel
* betterer
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Loki: Add e2e test for query builder
* Update
* Update test
* Update test
* Update test
* Update test
* Add more checks in test
* Update betterer
* Update betterer
* Add topnav in Route
* TopBar: Good progress on a approach that looks promising
* Added some elements to top level
* Get page nav from route
* Progress
* Making breadcrumbs slightly more real
* Updates
* Memoize selector
* Removed some console.log
* correctly type iconName
* betterer updates
* Change setting to hideNav
* Rename again
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Convert AccordianReferences test to RTL
* Convert AccordianReferences test to RTL
* Convert AccordianReferences test to RTL
* Convert AccordianReferences tests to RTL
* Convert AccordianReferences test to RTL
* fix betterer
* Convert AccordianReferences test to RTL
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* remove feature toggle, add empty state and fix bug with initial starring
* Extract empty message into lingui
* remove full stop
* add empty message in the backend
* remove unused import
* translate starred + empty starred states
* betterer changes
* piechart: support series override for hiding legend item
* piechart: add support for hiding values in multi tooltip
* tidy up variable names
* piechart: typing for hideFrom variable
* betterer fixes
* Table panel: Support multiple data links in default cell
* Table panel: Show data links for Image and JSONView cells
* Simplify DataLinksContextMenu api
* Betterer
* improve performance of transformMetricFindResponse
* use lodash uniqBy for postgres
* use lodash uniqBy for mysql
* use lodash uniqBy for mssql
* hopefully conform to import linting rules
* Added .betterer.results
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Victor Marin <victor.marin@grafana.com>