Skip to content

Commit 0ea4ad8

Browse files
authored
Playlists: Remove unused item field Title (#2380)
1 parent 6dd6e6d commit 0ea4ad8

File tree

3 files changed

+0
-21
lines changed

3 files changed

+0
-21
lines changed

docs/resources/playlist.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ resource "grafana_playlist" "test" {
5959
Required:
6060

6161
- `order` (Number)
62-
- `title` (String)
6362

6463
Optional:
6564

internal/resources/grafana/resource_playlist.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ func resourcePlaylist() *common.Resource {
5454
Type: schema.TypeInt,
5555
Required: true,
5656
},
57-
"title": {
58-
Type: schema.TypeString,
59-
Required: true,
60-
},
6157
"type": {
6258
Type: schema.TypeString,
6359
Optional: true,
@@ -179,7 +175,6 @@ func expandPlaylistItems(items []any) []*models.PlaylistItem {
179175
itemMap := item.(map[string]any)
180176
p := &models.PlaylistItem{
181177
Order: int64(itemMap["order"].(int)),
182-
Title: itemMap["title"].(string),
183178
}
184179
if v, ok := itemMap["type"].(string); ok {
185180
p.Type = v
@@ -205,7 +200,6 @@ func flattenPlaylistItems(items []*models.PlaylistItem) []any {
205200
"type": item.Type,
206201
"value": item.Value,
207202
"order": item.Order,
208-
"title": item.Title,
209203
}
210204
playlistItems = append(playlistItems, p)
211205
}

internal/resources/grafana/resource_playlist_test.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,9 @@ func TestAccPlaylist_basic(t *testing.T) {
3333
resource.TestCheckResourceAttr(paylistResource, "item.#", "2"),
3434
resource.TestCheckTypeSetElemNestedAttrs(paylistResource, "item.*", map[string]string{
3535
"order": "1",
36-
"title": "Terraform Dashboard By Tag",
3736
}),
3837
resource.TestCheckTypeSetElemNestedAttrs(paylistResource, "item.*", map[string]string{
3938
"order": "2",
40-
"title": "Terraform Dashboard By UID",
4139
}),
4240
testutils.CheckLister(paylistResource),
4341
),
@@ -85,13 +83,11 @@ func TestAccPlaylist_update(t *testing.T) {
8583
resource.TestCheckResourceAttr(paylistResource, "item.#", "2"),
8684
resource.TestCheckTypeSetElemNestedAttrs(paylistResource, "item.*", map[string]string{
8785
"order": "1",
88-
"title": "Terraform Dashboard By UID",
8986
"type": "dashboard_by_uid",
9087
"value": "uid-3",
9188
}),
9289
resource.TestCheckTypeSetElemNestedAttrs(paylistResource, "item.*", map[string]string{
9390
"order": "2",
94-
"title": "other",
9591
"type": "dashboard_by_uid",
9692
"value": "uid-1",
9793
}),
@@ -106,13 +102,11 @@ func TestAccPlaylist_update(t *testing.T) {
106102
resource.TestCheckResourceAttr(paylistResource, "item.#", "2"),
107103
resource.TestCheckTypeSetElemNestedAttrs(paylistResource, "item.*", map[string]string{
108104
"order": "1",
109-
"title": "Terraform Dashboard By UID",
110105
"type": "dashboard_by_uid",
111106
"value": "uid-4",
112107
}),
113108
resource.TestCheckTypeSetElemNestedAttrs(paylistResource, "item.*", map[string]string{
114109
"order": "2",
115-
"title": "other",
116110
"type": "dashboard_by_uid",
117111
"value": "uid-1",
118112
}),
@@ -173,11 +167,9 @@ func TestAccPlaylist_inOrg(t *testing.T) {
173167
resource.TestCheckResourceAttr(paylistResource, "item.#", "2"),
174168
resource.TestCheckTypeSetElemNestedAttrs(paylistResource, "item.*", map[string]string{
175169
"order": "1",
176-
"title": "Terraform Dashboard By Tag",
177170
}),
178171
resource.TestCheckTypeSetElemNestedAttrs(paylistResource, "item.*", map[string]string{
179172
"order": "2",
180-
"title": "Terraform Dashboard By UID",
181173
}),
182174
),
183175
},
@@ -215,12 +207,10 @@ resource "grafana_playlist" "test" {
215207
216208
item {
217209
order = 2
218-
title = "Terraform Dashboard By UID"
219210
}
220211
221212
item {
222213
order = 1
223-
title = "Terraform Dashboard By Tag"
224214
}
225215
226216
}
@@ -240,12 +230,10 @@ resource "grafana_playlist" "test" {
240230
241231
item {
242232
order = 2
243-
title = "Terraform Dashboard By UID"
244233
}
245234
246235
item {
247236
order = 1
248-
title = "Terraform Dashboard By Tag"
249237
}
250238
251239
}
@@ -260,14 +248,12 @@ resource "grafana_playlist" "test" {
260248
261249
item {
262250
order = 2
263-
title = "other"
264251
type = "dashboard_by_uid"
265252
value = "uid-1"
266253
}
267254
268255
item {
269256
order = 1
270-
title = "Terraform Dashboard By UID"
271257
type = "dashboard_by_uid"
272258
value = "uid-%[2]s"
273259
}

0 commit comments

Comments
 (0)