-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPanel.example.yaml
More file actions
592 lines (592 loc) · 17.5 KB
/
Copy pathPanel.example.yaml
File metadata and controls
592 lines (592 loc) · 17.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
# Action not found
# Target: ensure the widget correctly handles missing action definition within "actions".
# Expected behavior: clicking the panel triggers an error notification ("The widget definition does not include an action ...").
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-no-action
namespace: krateo-system
spec:
widgetData:
title: Missing Action Example (on click)
clickActionId: click
actions: {}
items: []
resourcesRefs:
items: []
---
# Basic panel with title only
# Target: verify correct rendering of title text and base layout.
# Expected behavior: panel displays the title “Overview” with default style and no interactive behavior.
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-basic
namespace: krateo-system
spec:
widgetData:
title: Overview
items: []
actions: {}
resourcesRefs:
items: []
---
# Panel with icon and title
# Target: confirm correct alignment and rendering of icon with title.
# Expected behavior: icon appears to the left of the title with correct spacing and tooltip.
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-with-icon
namespace: krateo-system
spec:
widgetData:
title: System Status
icon:
name: fa-server
color: green
tooltip: Displays the current system status.
items: []
actions: {}
resourcesRefs:
items: []
---
# Panel with header sections
# Target: ensure proper rendering of left and right header text beneath the main title.
# Expected behavior: left and right aligned text display under the header section.
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-with-header
namespace: krateo-system
spec:
widgetData:
title: Node Information
headerLeft: 'Last updated: 2025-06-10'
headerRight: 'Status: Healthy'
items: []
actions: {}
resourcesRefs:
items: []
---
# Panel with tags and footer items
# Target: verify correct layout for tags and footer widgets.
# Expected behavior: panel footer shows tag list and embedded widgets from footer resource references.
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-footer-tags
namespace: krateo-system
spec:
widgetData:
title: Application Metrics
tags:
- frontend
- production
- v1.2.3
footer:
- resourceRefId: example-button-with-icon
items: []
actions: {}
resourcesRefs:
items:
- id: example-button-with-icon
apiVersion: widgets.templates.krateo.io/v1beta1
name: example-button-with-icon
namespace: krateo-system
resource: buttons
verb: GET
---
# Panel with multiple child widgets
# Target: ensure correct rendering of multiple resource items in the body.
# Expected behavior: both child widgets are rendered sequentially inside the panel body.
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-multiple-items
namespace: krateo-system
spec:
widgetData:
title: Dashboard Summary
items:
- resourceRefId: example-piechart-full-fill
- resourceRefId: example-table-basic
actions: {}
resourcesRefs:
items:
- id: example-piechart-full-fill
apiVersion: widgets.templates.krateo.io/v1beta1
name: example-piechart-full-fill
namespace: krateo-system
resource: piecharts
verb: GET
- id: example-table-basic
apiVersion: widgets.templates.krateo.io/v1beta1
name: example-table-basic
namespace: krateo-system
resource: tables
verb: GET
---
# navigate action - Navigation to another page using `path`
# Target: trigger navigation to a static route (`/barchart`) when the panel is clicked.
# Expected behavior: clicking the panel redirects the user to `/barchart`.
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-navigate-path
namespace: krateo-system
spec:
widgetData:
title: Navigate to BarChart
clickActionId: navigate-to-barchart
items: []
actions:
navigate:
- id: navigate-to-barchart
path: /barchart
type: navigate
resourcesRefs:
items: []
---
# navigate action - Navigation to another resource using `resourceRefId`
# Target: navigate to another dashboard resource identified by its ref ID.
# Expected behavior: clicking the panel triggers navigation to the target resource page.
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-navigate-resource
namespace: krateo-system
spec:
widgetData:
title: Navigate to Dashboard
clickActionId: navigate-dashboard
items: []
actions:
navigate:
- id: navigate-dashboard
type: navigate
resourceRefId: dashboard-page
resourcesRefs:
items:
- id: dashboard-page
apiVersion: widgets.templates.krateo.io/v1beta1
name: dashboard-page
namespace: krateo-system
resource: pages
verb: GET
---
# navigate action - Navigation to another resource using `resourceRefId` with URL path extension
# Target: navigate to another resource identified by its ref ID, setting a custom URL path prefix.
# Expected behavior: clicking the panel triggers navigation to the target resource page. The specified URL path prefix is displayed in the URL.
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-navigate-resource-url-path-extension
namespace: krateo-system
spec:
widgetData:
title: Navigate to Dashboard
clickActionId: navigate-dashboard
items: []
actions:
navigate:
- id: navigate-dashboard
type: navigate
resourceRefId: dashboard-page
resourceURLPathExtension: panel-dashboard
resourcesRefs:
items:
- id: dashboard-page
apiVersion: widgets.templates.krateo.io/v1beta1
name: dashboard-page
namespace: krateo-system
resource: pages
verb: GET
---
# navigate action - Navigation with confirmation prompt (`requireConfirmation: true`)
# Target: prevent accidental navigation by requiring explicit user confirmation.
# Expected behavior: before navigating, a confirmation dialog is shown; navigation proceeds only upon confirmation.
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-navigate-confirm
namespace: krateo-system
spec:
widgetData:
title: Navigate to Reports
clickActionId: navigate-reports
items: []
actions:
navigate:
- id: navigate-reports
path: /reports
type: navigate
requireConfirmation: true
resourcesRefs:
items: []
---
# navigate action - Navigation with loading indicator
# Target: provide visual feedback while navigation is being processed.
# Expected behavior: panel shows loading state during navigation.
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-navigate-loading
namespace: krateo-system
spec:
widgetData:
title: Navigate to BarChart with loading
clickActionId: navigate-barchart
items: []
actions:
navigate:
- id: navigate-barchart
path: /barchart
type: navigate
loading:
display: true
resourcesRefs:
items: []
---
# openDrawer - default size
# Target: verify that a drawer opens using a defined resource reference.
# Expected behavior: drawer opens at default width and displays resource contents.
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-open-drawer-default
namespace: krateo-system
spec:
widgetData:
title: Open Drawer Default
clickActionId: open-drawer-default
items: []
actions:
openDrawer:
- id: open-drawer-default
type: openDrawer
resourceRefId: example-markdown-basic
size: default
title: Default Drawer Example
resourcesRefs:
items:
- id: example-markdown-basic
apiVersion: widgets.templates.krateo.io/v1beta1
name: example-markdown-basic
namespace: krateo-system
resource: markdowns
verb: GET
---
# openDrawer - large size
# Target: verify that a drawer opens in large mode.
# Expected behavior: a large-size drawer opens with the defined title and resource content.
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-open-drawer-large
namespace: krateo-system
spec:
widgetData:
title: Open Drawer Large
clickActionId: open-drawer-large
items: []
actions:
openDrawer:
- id: open-drawer-large
type: openDrawer
resourceRefId: example-markdown-basic
size: large
title: Large Drawer Example
loading:
display: false
resourcesRefs:
items:
- id: example-markdown-basic
apiVersion: widgets.templates.krateo.io/v1beta1
name: example-markdown-basic
namespace: krateo-system
resource: markdowns
verb: GET
---
# openModal - default size
# Target: ensure that a modal dialog can be opened and displays the referenced resource.
# Expected behavior: modal appears at the default width and loads the resource correctly.
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-open-modal-default
namespace: krateo-system
spec:
widgetData:
title: Open Modal Default
clickActionId: open-modal-default
items: []
actions:
openModal:
- id: open-modal-default
type: openModal
resourceRefId: example-yamlviewer-simple-json
title: Default Modal Example
loading:
display: true
size: default
resourcesRefs:
items:
- id: example-yamlviewer-simple-json
apiVersion: widgets.templates.krateo.io/v1beta1
name: example-yamlviewer-simple-json
namespace: krateo-system
resource: yamlviewers
verb: GET
---
# openModal - large size with confirmation
# Target: ensure that the modal opens only after user confirmation when `requireConfirmation` is enabled.
# Expected behavior: confirmation prompt appears; modal opens after acceptance.
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-open-modal-large
namespace: krateo-system
spec:
widgetData:
title: Open Modal Large Confirm
clickActionId: open-modal-large-confirm
items: []
actions:
openModal:
- id: open-modal-large-confirm
type: openModal
resourceRefId: example-yamlviewer-simple-json
title: Confirmed Large Modal Example
size: large
requireConfirmation: true
loading:
display: false
resourcesRefs:
items:
- id: example-yamlviewer-simple-json
apiVersion: widgets.templates.krateo.io/v1beta1
name: example-yamlviewer-simple-json
namespace: krateo-system
resource: yamlviewers
verb: GET
---
# openModal - custom width
# Target: confirm that a modal can be displayed with a custom width setting.
# Expected behavior: modal expands to the defined custom width and shows the referenced resource.
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-open-modal-custom
namespace: krateo-system
spec:
widgetData:
title: Open Modal Custom Width
clickActionId: open-modal-custom
items: []
actions:
openModal:
- id: open-modal-custom
type: openModal
resourceRefId: example-yamlviewer-simple-json
title: Custom Width Modal Example
size: custom
customWidth: 30%
loading:
display: false
resourcesRefs:
items:
- id: example-yamlviewer-simple-json
apiVersion: widgets.templates.krateo.io/v1beta1
name: example-yamlviewer-simple-json
namespace: krateo-system
resource: yamlviewers
verb: GET
---
# openModal - fullscreen mode
# Target: verify that a modal can occupy the full viewport width when configured in fullscreen mode.
# Expected behavior: modal expands to fill the entire screen and displays its resource.
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-open-modal-fullscreen
namespace: krateo-system
spec:
widgetData:
title: Open Modal Fullscreen
clickActionId: open-modal-fullscreen
items: []
actions:
openModal:
- id: open-modal-fullscreen
type: openModal
resourceRefId: example-yamlviewer-simple-json
title: Fullscreen Modal Example
size: fullscreen
loading:
display: false
resourcesRefs:
items:
- id: example-yamlviewer-simple-json
apiVersion: widgets.templates.krateo.io/v1beta1
name: example-yamlviewer-simple-json
namespace: krateo-system
resource: yamlviewers
verb: GET
---
# externalNavigate — static URL, opens in new tab
# Target: clicking the panel opens an external URL in a new browser tab.
# Expected behavior: window.open is called with the static URL and target "_blank".
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-external-navigate-static
namespace: krateo-system
spec:
widgetData:
title: Open Grafana
clickActionId: open-grafana-panel
items: []
actions:
externalNavigate:
- id: open-grafana-panel
type: externalNavigate
url: https://grafana.example.com/dashboards
target: _blank
resourcesRefs:
items: []
---
# externalNavigate — JQ-interpolated URL using widget metadata
# Target: the URL is built at click time using the widget's own metadata.
# JQ context: { json: customPayload, widget } — widget metadata is at .widget.metadata.
# Expected behavior: the JQ expression resolves the widget name and opens the constructed URL.
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-external-navigate-jq
namespace: krateo-system
spec:
widgetData:
title: View in Argo CD
clickActionId: open-argocd-panel
items: []
actions:
externalNavigate:
- id: open-argocd-panel
type: externalNavigate
url: ${ "https://argocd.example.com/applications/" + .widget.metadata.name }
target: _blank
resourcesRefs:
items: []
---
# refresh — companion table used to visually confirm that refresh actions re-fetch data
kind: Table
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-refresh-companion-table
namespace: krateo-system
spec:
widgetData:
actions: {}
allowedResources: []
columns:
- valueKey: name
title: Name
- valueKey: status
title: Status
data:
- - valueKey: name
kind: jsonSchemaType
type: string
stringValue: "service-alpha"
- valueKey: status
kind: jsonSchemaType
type: string
stringValue: "Running"
- - valueKey: name
kind: jsonSchemaType
type: string
stringValue: "service-beta"
- valueKey: status
kind: jsonSchemaType
type: string
stringValue: "Pending"
resourcesRefs:
items: []
---
# refresh — invalidate all cached queries on panel click
# Target: clicking the panel triggers a full TanStack Query cache invalidation.
# Expected behavior: all widgets on the page are re-fetched; the companion table below
# visibly enters a loading state before rendering again.
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-refresh-all
namespace: krateo-system
spec:
widgetData:
title: Refresh All Data
clickActionId: refresh-all-panel
items: []
actions:
refresh:
- id: refresh-all-panel
type: refresh
loading:
display: true
resourcesRefs:
items: []
---
# refresh — scoped invalidation via resourcesRefsIds
# Target: clicking the panel only re-fetches the companion table referenced by resourcesRefsIds.
# Expected behavior: only the companion table reloads; other widgets stay cached.
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-refresh-by-resource-ref
namespace: krateo-system
spec:
widgetData:
title: Refresh Companion Table
clickActionId: refresh-by-resource-ref-panel
items: []
actions:
refresh:
- id: refresh-by-resource-ref-panel
type: refresh
resourcesRefsIds:
- companion-table
loading:
display: true
resourcesRefs:
items:
- id: companion-table
apiVersion: widgets.templates.krateo.io/v1beta1
name: example-panel-refresh-companion-table
namespace: krateo-system
resource: tables
verb: GET
---
# refresh — kind-level invalidation via widgetKinds
# Target: clicking the panel re-fetches all Table widgets on the page.
# Expected behavior: the companion table below reloads; Panel and Button widgets stay cached.
kind: Panel
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-panel-refresh-by-kind
namespace: krateo-system
spec:
widgetData:
title: Refresh All Tables
clickActionId: refresh-by-kind-panel
items: []
actions:
refresh:
- id: refresh-by-kind-panel
type: refresh
widgetKinds:
- Table
loading:
display: true
resourcesRefs:
items: []