mirror of
https://github.com/grafana/grafana.git
synced 2026-08-26 21:37:31 -05:00
CloudMigrations: Store parent folder name in cloud_migration_resource table (#94009)
* use name in fe * store parent folder name in local db * clean up * tiny test * trial react * rename to parent name * go lint * generate api and ts * go tests * rearrange * clean * update with suggestions from josh * make library elements work * updates from comments * global migration types * parent name for alter table
This commit is contained in:
@@ -385,11 +385,12 @@ func (cma *CloudMigrationAPI) GetSnapshot(c *contextmodel.ReqContext) response.R
|
||||
dtoResults := make([]MigrateDataResponseItemDTO, len(results))
|
||||
for i := 0; i < len(results); i++ {
|
||||
dtoResults[i] = MigrateDataResponseItemDTO{
|
||||
Name: results[i].Name,
|
||||
Type: MigrateDataType(results[i].Type),
|
||||
RefID: results[i].RefID,
|
||||
Status: ItemStatus(results[i].Status),
|
||||
Message: results[i].Error,
|
||||
Name: results[i].Name,
|
||||
Type: MigrateDataType(results[i].Type),
|
||||
RefID: results[i].RefID,
|
||||
Status: ItemStatus(results[i].Status),
|
||||
Message: results[i].Error,
|
||||
ParentName: results[i].ParentName,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -345,7 +345,7 @@ func TestCloudMigrationAPI_GetSnapshot(t *testing.T) {
|
||||
requestUrl: "/api/cloudmigration/migration/1234/snapshot/1",
|
||||
basicRole: org.RoleAdmin,
|
||||
expectedHttpResult: http.StatusOK,
|
||||
expectedBody: `{"uid":"fake_uid","status":"CREATING","sessionUid":"1234","created":"0001-01-01T00:00:00Z","finished":"0001-01-01T00:00:00Z","results":[],"stats":{"types":{},"statuses":{},"total":0}}`,
|
||||
expectedBody: `{"uid":"fake_uid","status":"CREATING","sessionUid":"1234","created":"0001-01-01T00:00:00Z","finished":"0001-01-01T00:00:00Z","results":[{"name":"dashboard name","parentName":"dashboard parent name","type":"DASHBOARD","refId":"123","status":"PENDING"},{"name":"datasource name","parentName":"dashboard parent name","type":"DATASOURCE","refId":"456","status":"OK"}],"stats":{"types":{},"statuses":{},"total":0}}`,
|
||||
},
|
||||
{
|
||||
desc: "should return 403 if no used is not admin",
|
||||
|
||||
@@ -106,7 +106,8 @@ type MigrateDataResponseDTO struct {
|
||||
}
|
||||
|
||||
type MigrateDataResponseItemDTO struct {
|
||||
Name string `json:"name"`
|
||||
Name string `json:"name"`
|
||||
ParentName string `json:"parentName"`
|
||||
// required:true
|
||||
Type MigrateDataType `json:"type"`
|
||||
// required:true
|
||||
|
||||
Reference in New Issue
Block a user