deps: Update thema, use CUE fork (#60496)
* deps: Update thema, use CUE fork * Remove superfluous openapi-codegen output * Update thema again to catch cuetsy changes * Rerun codegen with latest * Latest thema, removes cuetsy update * Latest of cuetsy * Update type usage * One last cuetsy rollback * Update playlist summary tests * More lint fixes * Remove TS veneer changes for VariableHide Co-authored-by: Clarity-89 <homes89@ukr.net>
This commit is contained in:
@@ -23,8 +23,8 @@ type Playlist struct {
|
||||
}
|
||||
|
||||
type PlaylistDTO = playlist.Playlist
|
||||
type PlaylistItemDTO = playlist.PlaylistItem
|
||||
type PlaylistItemType = playlist.PlaylistItemType
|
||||
type PlaylistItemDTO = playlist.Item
|
||||
type PlaylistItemType = playlist.ItemType
|
||||
|
||||
type PlaylistItem struct {
|
||||
Id int64 `db:"id"`
|
||||
|
||||
@@ -30,7 +30,7 @@ func summaryBuilder(ctx context.Context, uid string, body []byte) (*models.Entit
|
||||
|
||||
// TODO: fix model so this is not possible
|
||||
if obj.Items == nil {
|
||||
temp := make([]playlist.PlaylistItem, 0)
|
||||
temp := make([]playlist.Item, 0)
|
||||
obj.Items = &temp
|
||||
}
|
||||
|
||||
@@ -43,19 +43,19 @@ func summaryBuilder(ctx context.Context, uid string, body []byte) (*models.Entit
|
||||
|
||||
for _, item := range *obj.Items {
|
||||
switch item.Type {
|
||||
case playlist.PlaylistItemTypeDashboardByUid:
|
||||
case playlist.ItemTypeDashboardByUid:
|
||||
summary.References = append(summary.References, &models.EntityExternalReference{
|
||||
Kind: "dashboard",
|
||||
UID: item.Value,
|
||||
})
|
||||
|
||||
case playlist.PlaylistItemTypeDashboardByTag:
|
||||
case playlist.ItemTypeDashboardByTag:
|
||||
if summary.Labels == nil {
|
||||
summary.Labels = make(map[string]string, 0)
|
||||
}
|
||||
summary.Labels[item.Value] = ""
|
||||
|
||||
case playlist.PlaylistItemTypeDashboardById:
|
||||
case playlist.ItemTypeDashboardById:
|
||||
// obviously insufficient long term... but good to have an example :)
|
||||
summary.Error = &models.EntityErrorInfo{
|
||||
Message: "Playlist uses deprecated internal id system",
|
||||
|
||||
@@ -19,10 +19,10 @@ func TestPlaylistSummary(t *testing.T) {
|
||||
playlist := playlist.Playlist{
|
||||
Interval: "30s",
|
||||
Name: "test",
|
||||
Items: &[]playlist.PlaylistItem{
|
||||
{Type: playlist.PlaylistItemTypeDashboardByUid, Value: "D1"},
|
||||
{Type: playlist.PlaylistItemTypeDashboardByTag, Value: "tagA"},
|
||||
{Type: playlist.PlaylistItemTypeDashboardByUid, Value: "D3"},
|
||||
Items: &[]playlist.Item{
|
||||
{Type: playlist.ItemTypeDashboardByUid, Value: "D1"},
|
||||
{Type: playlist.ItemTypeDashboardByTag, Value: "tagA"},
|
||||
{Type: playlist.ItemTypeDashboardByUid, Value: "D3"},
|
||||
},
|
||||
}
|
||||
out, err := json.Marshal(playlist)
|
||||
|
||||
Reference in New Issue
Block a user