mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 08:05:43 -06:00
Chore: Deprecate Id from Folder in DTOs (#77943)
* Chore: Deprecate Id from Folder in DTOs * chore: regen spec
This commit is contained in:
parent
ae326eaed1
commit
a640d9d395
@ -7,6 +7,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Folder struct {
|
type Folder struct {
|
||||||
|
// Deprecated: use Uid instead
|
||||||
Id int64 `json:"id"`
|
Id int64 `json:"id"`
|
||||||
Uid string `json:"uid"`
|
Uid string `json:"uid"`
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
|
@ -365,7 +365,7 @@ func (hs *HTTPServer) newToFolderDto(c *contextmodel.ReqContext, f *folder.Folde
|
|||||||
}
|
}
|
||||||
|
|
||||||
return dtos.Folder{
|
return dtos.Folder{
|
||||||
Id: f.ID,
|
Id: f.ID, // nolint:staticcheck
|
||||||
Uid: f.UID,
|
Uid: f.UID,
|
||||||
Title: f.Title,
|
Title: f.Title,
|
||||||
Url: f.URL,
|
Url: f.URL,
|
||||||
|
@ -145,6 +145,7 @@ func TestFoldersCreateAPIEndpoint(t *testing.T) {
|
|||||||
require.NoError(t, resp.Body.Close())
|
require.NoError(t, resp.Body.Close())
|
||||||
|
|
||||||
if tc.expectedCode == http.StatusOK {
|
if tc.expectedCode == http.StatusOK {
|
||||||
|
// nolint:staticcheck
|
||||||
assert.Equal(t, int64(1), folder.Id)
|
assert.Equal(t, int64(1), folder.Id)
|
||||||
assert.Equal(t, "uid", folder.Uid)
|
assert.Equal(t, "uid", folder.Uid)
|
||||||
assert.Equal(t, "Folder", folder.Title)
|
assert.Equal(t, "Folder", folder.Title)
|
||||||
@ -249,6 +250,7 @@ func TestFoldersUpdateAPIEndpoint(t *testing.T) {
|
|||||||
require.NoError(t, resp.Body.Close())
|
require.NoError(t, resp.Body.Close())
|
||||||
|
|
||||||
if tc.expectedCode == http.StatusOK {
|
if tc.expectedCode == http.StatusOK {
|
||||||
|
// nolint:staticcheck
|
||||||
assert.Equal(t, int64(1), folder.Id)
|
assert.Equal(t, int64(1), folder.Id)
|
||||||
assert.Equal(t, "uid", folder.Uid)
|
assert.Equal(t, "uid", folder.Uid)
|
||||||
assert.Equal(t, "Folder upd", folder.Title)
|
assert.Equal(t, "Folder upd", folder.Title)
|
||||||
|
@ -358,7 +358,7 @@ func TestIntegrationCreate(t *testing.T) {
|
|||||||
buf1 := &bytes.Buffer{}
|
buf1 := &bytes.Buffer{}
|
||||||
err = json.NewEncoder(buf1).Encode(dashboards.SaveDashboardCommand{
|
err = json.NewEncoder(buf1).Encode(dashboards.SaveDashboardCommand{
|
||||||
Dashboard: dashboardDataOne,
|
Dashboard: dashboardDataOne,
|
||||||
FolderID: folder.Id,
|
FolderID: folder.Id, // nolint:staticcheck
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
u := fmt.Sprintf("http://admin:admin@%s/api/dashboards/db", grafanaListedAddr)
|
u := fmt.Sprintf("http://admin:admin@%s/api/dashboards/db", grafanaListedAddr)
|
||||||
|
@ -14199,6 +14199,7 @@
|
|||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"id": {
|
"id": {
|
||||||
|
"description": "Deprecated: use Uid instead",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "int64"
|
"format": "int64"
|
||||||
},
|
},
|
||||||
|
@ -5272,6 +5272,7 @@
|
|||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"id": {
|
"id": {
|
||||||
|
"description": "Deprecated: use Uid instead",
|
||||||
"format": "int64",
|
"format": "int64",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user