16 Commits

Author SHA1 Message Date
f9fb9d268f Restore dashboards: Add API client endpoints (#106435)
* Dashboards: Add restore endpoints to the API

* Fix unified api

* Fix resource version

* Add tests

* Update api

* Update type guards

* Update comments

* Add missing type

* Cleanup

* Move spec checking logic to v1 client

* Handle mixed versions in deleted dbs list

* Update tests

* comment

* type
2025-06-12 15:49:55 +03:00
2b8c74de2e i18n: removes useTranslate hook (#106556)
* i18n: removes useTranslate hook

* chore: fix duplicate imports

* chore: fix import sorting and hook dependencies
2025-06-12 11:03:52 +02:00
7bfa78c6e6 I18n: Update eslint rule to catch some untranslated object properties (#105072) 2025-05-28 21:14:43 +01:00
d11d8ec111 Dashboards: Make serializer a single source of truth for passing k8s props on save (#105576)
* make serializer a single source of truth for passing k8s props on save

* remove resourceVersion when updating

* don't pass result.version to resourceVersion

* remove k8s update on saveCompleted from dash scene
2025-05-21 07:24:41 -06:00
8cb9f0a36c Dashboard: Use metadata.generation for dash version in v1 (#105499) 2025-05-16 10:00:34 +03:00
da24ad06bd Provisioning: Hide full path for classic provisioing resources (#105440) 2025-05-15 16:01:12 +00:00
1114d33936 Dashboard export: Allow exports by resource and in YAML format (#104149)
* Dashboard export: Allow YAML export

* use js-yaml to fix ci errors

* add yaml transformation in the "Copy to cilpboard"

* simplify

* new ui for resource exports

* simplify

* Don't show export mode for v2 dashboard

* Add metadata, apiVersion, add logic for export type resources

* i18n; switch title to as code

* update export as file button

* Remove managedFields from metadata export

* Remove metadata fields that are not needed for sharing externally

* Copy

* fix legacy mode

* address bugs

* Update public/app/features/dashboard-scene/sharing/ExportButton/ExportMenu.tsx

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* i18n

* improve classic mode; rename

* Update public/app/features/dashboard-scene/sharing/ShareExportTab.tsx

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

* change order

---------

Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>
2025-05-01 09:06:07 -06:00
b09d79b21c K8s/Dashboard: Promote from alpha1 to beta1 (#104009) 2025-04-23 20:54:35 +03:00
af8a70bbab K8s/Permissions: Enable a grant-permissions annotation action to set default permissions (#102527)
* create permissions

* add key

* lint

* structure as a delayed callback

* legacy API hook

* merge main

* wired up

* and folders

* watch repos

* missing return statement

* Set the correct permissions

* add TestAfterCreatePermissionCreator

* do not add perms on folder create

* fix tests

* add annotation on create

* lint

* lint

* ensure we set permissions when the FT is disabled

* remove custom folder_storage

* fix lint

* change default

* lint

* lint

* fix: annotation

* ensure permissions are added on folder legacy

* remove folderstorage again

* fix tests

* add FT

* undo change to folder

* dashboard on create

* remove annotation for folder

* fix tests

* fix prepare after rebase

* fix tests

* fix tests

* fix tests

* lint

* address comments

* add test for prepareObjectForStorage

* add again skipIfMode as per comment

---------

Co-authored-by: Georges Chaudy <chaudyg@gmail.com>
2025-04-09 13:05:37 +02:00
c1cadc7d6f K8s/Client: Ignore validation from dashboards frontend v1 (#103641) 2025-04-09 11:08:33 +03:00
960c13c1e5 K8S Dashboards: Prevent duplicate dashboards when updating an existing dashboard (#102835)
* use metadata for k8s v1

* handle version and uid update in the api layer

* add test

* cleanup
2025-03-26 16:54:55 -06:00
3d1497b56a Schema V2: Replace resourceVersion usage with generation (#100080)
* Schema V2: Replace resourceVersion usage with generation

* revert auto generated files

---------

Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
2025-03-26 12:47:24 -06:00
35e3d26987 Dashboards: Do not throw error if backend cannot migrate schemaVersion to latest (#102357)
* Refactor migration error handling to use MinimumVersionError for schema version checks

- Updated migration logic to return MinimumVersionError instead of MigrationError for outdated schema versions.
- Enhanced MinimumVersionError message for clarity on migration constraints.
- Added tests for version error handling in the dashboard API to ensure proper error throwing for specific conversion errors.

* Fix tests and remove folder dependencies
2025-03-19 09:57:05 +02:00
bfedf0b512 Dashboard: Redirect between v1alpha1 and v2alpha1 depending on stored version (#101292)
* wip: Create a proxy state manager to avoid complexity

* Read path redirecting

* add tests for unified dashboard API

* add tests

* Contemplate both formats in DashboardProxy

* Fix force old

* Fix tests for proxy

* catch errors

* Save as V2 when dynamic dashboard is enabled

* Improve tests

* Remove feature toggle

* Use kubernetesDashboards for e2e suite

* Fix issue when loading snapshots

* Fix typescript errors

* Integrate with backend conversion error

* Remove legacy annotation

* fix snapshot loading; lint

* Add missing hideTimeControls

* fix test

* make setupDashboardAPI to all suites

* refactor getDashboardAPI

* Add tests

* fix DashboardScenePage tests

* fix tests

* fix go tests

* Refactor to understand better the need of transforming to v2 to compare

* Fix detect changes logic

* yes status from schema gen

---------

Co-authored-by: alexandra vargas <alexa1866@gmail.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
2025-03-12 11:43:32 -06:00
f910238185 Dashboards: Fix crashing dashboards after save (#102048) 2025-03-12 18:41:39 +02:00
be81314e21 Replace v0 by k8s v1 when kubernetesDashboards is enabled (#101033)
Use v1 by default when kubernetesDashboards is on
2025-02-20 12:42:59 +01:00