* public dashboards: check to see if dashboard state is different from persisted on save
Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
* prevent recursion blowup in redux, attempt to reintroduce import e2e test
* try importing json like this instead?
* need the panel validation
* Update text so it finds Panel data instead of Dataframe JSON
* skip test for now
* Annotations: replaced dashboardId with dashboardUID when fetching annotations
* Annotations: Replaced dashboardID with dashboardUID when adding and updating annotations
* Annotations: Used dashboardUID for PanelChrome related methods
* Annotations: Used dashboarduid in annolistpanel
* Annotations: Used dashboardUID in graph plugin
* used boolean in canEditDashboard
* consolidate project, metric, and service
* CloudMonitor: make AlignmentPeriodLabel a tooltip
alignmentPeriodLabel now returns a string instead of component. This is
because as a <label> it would cause wrapping issues when the screen size
would change. It also isn't essential information _unless_ the user is
using a template variable for the Alignment period.
* refactor: remove any hard-coded widths for auto
* chore: use newly moved experimental comps in UI
* Toggle on the mixed mode option
* Ensure switching to mixed gives existing query prev datasource
* WIP - Populate datasource when switching between mixed and not
* WIP - handle change from mixed
* Remove preimport filter, refine filter to work for queries
* WIP debugging datasource transition
* Ensure creating a new query gets target data source if switching with no matches between
* Add mixed datasource to rich history display
* Cleanup console logs, add relevant comments
* Add feature toggle for mixed datasource
* Fix Wrapper tests
* Fix tests!
* Fix test types and add feature tracking
* Remove unnecessary default, remove explore/mixed workarounds for D2E
* Move display text logic to mixed datasource file
* Add in the default query parameters to a generated empty query
* Condense some code
* Apply suggestions from code review
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
* Auth: check of auth_token in url and resolve user if present
* check if auth_token is passed in url
* Auth: Pass auth_token for request if present in path
* no need to decode token in index
* temp
* use loadURLToken and set authorization header
* cache token in memory and strip it from url
* Use loadURLToken
* Keep token in url
* strip sensitive query strings from url used by context logger
* adapt login by url to jwt token
* add jwt iframe devenv
* add jwt iframe devenv instructions
* add access note
* add test for cleaning request
* ensure jwt token is not carried into handlers
* do not reshuffle queries, might be important
* add correct db dump location
* prefer set token instead of cached token
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
* add Examplars: false in collapsed view
* assign defaut value - false to switch
* add 3 tests for 3 possible cases
Co-authored-by: Taewoo Kim <taewookim@Taewoos-MacBook-Pro.local>
* Chore: Add dashboard uid as query parameter of Get annotation endpoint
* Update pkg/api/annotations.go
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
* update the dashboarUID
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
* 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
* Progress
* Example usage in application
* Add FocusScope
* REmove unused type
* simplify it by removing trigger property
* Use new Menu.Item way to access component
* refactor: convert .elapsed-time
* refactor: elapsedTime styling not required
* refactor: logs-rows styling not defined, remove classname
* refactor: logs-meta-item__labels styling not defined, remove classname
* refactor: transfer .label-slider styling to its own element
* refactor: clean up .slider styling
* refactor: muted styling not defined, remove classname
* refactor: transfer .space-between styling to its own element + clean up
* refactor: remove icon
* First pass at using datasource UID when appropriate
* Fix tests
* be more lenient with lookup to accomodate different URLs
* Make test setup get mock work like real datasource get
* Fix the typing issue and remaining tests
* Fix PR feedback
* Add support for IP line filter
* Add support for IP label filter
* Updates for Explain mode
* Update test
* Remove invalid options in LabelFilterIpMatches
* feat: show data-sources under the data-connections page
* refactor: add a constant for data-sources routes
* refactor: add a context that holds the currently active data-sources routes
* refactor: use the data-sources routes constant wherever possible
* refactor: use the data-sources routes context wherever possible
* feat(data-connections): add edit and new pages
* feat(data-connections): set the the custom routes via the context provider
* fix(data-connections): set the active tab properly
We needed to update the routes to match with the ones on the backend ("data-sources" vs "datasources"),
and we also needed to check if it is the default tab, in which case we would like to highlight the Datasources tab.
* tests: fix tests for Data Connections page
* fix: address rebase issues
* tests: find button based on role and text
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
* fix: add missing closing ) paren in tests
* refactor: use implicit return types for components
* tests: change role from "button" to "link"
* refactor: stop using unnecessary wrapper components
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
* Loki: Add hint for level-like label
* Add test to addToQuery
* Add tests
* Update tests
* Update copy
* Get log position in metrics query and add test
* Update
* Service accounts: Add a confirm modal for migration actions
* Handle the error case when migrating fails, reload page afterwards so that the tab disappears
The query inspector was experiencing some error pop-ups due
to errors encountered on metrics datasources configured with multiple
tenants.
e.g., team-a|team-b
This fix suppresses those errors so as to not mislead the user.
* 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>
* CloudMonitoring: add tests around experimental UI
I also reworked the annotation query editor UI a little bit to bring it
inline with how AzureMonitor's query editor looks.
Closes#44431
* Fix get legacy alert response
* Swagger: Fix get folder by UID response
* Fix conflicting swagger model Alert
Reanme legacy alerting swagger model to LegacyAlert to differentiate it
from the prometheus Alert
* Bump grafana-plugin-sdk-go
* Fix get folder response
* Use go-swagger command for merging the specifications and remove merge_specs script
* User Experience: apply the same pattern feedback for all copy to clipboard buttons
* add copy icon to all ClipboardButton use cases
* Change primary color for copy to clipboard in create token
* Add success button variant
* Remove copy confirmation from TableCellInspectModal because it's in the base component now
* Design tweaks to copy confirmation
- Only change the icon to tick to avoid the button changing size
- Change button to success green
- Only show copy confirmation state for 2 seconds
* revert TabelCellInspectModal text button back
* revert accidental change to ShareLink
Co-authored-by: joshhunt <josh@trtr.co>
* allow setting team managed permissions for service accounts
* Revert "allow setting team managed permissions for service accounts"
This reverts commit 7598626397.
* fix org user removal for OSS
* remove comment
* 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>
* FolderPage: Progress on folder page navigation
* Dashboard to adapt breadcrumbs when opening dashboard from file storage
* add warning when topnav is not enabled
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* ScenePanelRepeater: Fixes refreshes temporarily by setting key to guid
* Fixing issue with old state being returned by useState when the scene object instance changed (with same react key)
* Dashboard: Add guidance about reloaded needed for shared cursor/tooltip
* Dashboard: Added todo note for author of (#46581) impl
* Dashboard: prettier errors fixed for new text
* 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
* move sanitize test to its own test file
* add a test for renderTextPanelMarkdown to always sanitize
* setup TextPanel tests
* add tests to always sanitize Text Panel contents and always convert correctly to html/markdown
* Scenes: Support new top nav
* Page: Make Page component support new and old dashboard page layouts
* Pass scrollbar props
* Fixing flex layout for dashboard
* Updated title handling and test
* Initial work on new toolbar button
* Minor step
* Small progress
* Minor progress
* Minor fix
* removed console.log
* Removing stuff we don't need yet
* feat: make azure experimental the default
* feat: combine metrics query editor rows
fix: linter errors
* chore: remove test loop for DimensionFields test
* Set error message for certain template variable combinations
- Make use of setError method from query editor
- Update Azure Monitor error type
- Add test for case 2 from https://github.com/grafana/grafana/pull/51331
* Update template variable docs
* Fix lint issues
* Update docs/sources/datasources/azuremonitor/template-variables.md
Co-authored-by: Garrett Guillotte <100453168+gguillotte-grafana@users.noreply.github.com>
* PR comment updates
Co-authored-by: Garrett Guillotte <100453168+gguillotte-grafana@users.noreply.github.com>
* Alerting: Update default route groupBy to [grafana_folder, alertname]
Default group by for new routes and migrations is now [grafana_folder, alertname]
* Add NumberInput to core slider
* Change opacity interpretation
To be consistent with other layers, and CSS, opacity of 0 is fully
transparent and an opacity of 1 is fully opaque.
* Add state management for slider.
* Ensure number input step matches slider
* Style input width based on expected digits
* Improve styling for number input validation error
* 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>
* Ensure resource name is appended to URI
* Add storage account check to ensure default subresource is appended
* Update storage dashboard
* Bump storage version
* Remove ADX StreamingIngestRequestRate panel as the metric is unavailable
* Refactor condition for storage namespaces
* Add more tests for URI builder
* Do not migrate resource URI if resource name or metric definition uses template variables
* Revert change to metricNamespace
* Revert "Serviceaccounts: #48995
Do not display service accounts assigned to team (#48995)"
This reverts commit cbf71fbd7f.
* fix: test to not include more actions than necessary
* adding service accounts to teams - backend and frontend changes
* also support SA addition through the old team membership endpoints
* fix tests
* tests
* serviceaccounts permission tests
* serviceaccounts permission service tests run
* added back test that was removed by accident
* lint
* refactor: add testoptionsTeams
* fix a bug
* service account picker change
* explicitly set SA managed permissions to false for dash and folders
* lint
* allow team creator to list service accounts
Co-authored-by: IevaVasiljeva <ieva.vasiljeva@grafana.com>