@@ -3943,28 +3943,34 @@ class DashboardList(Panel):
3943
3943
searchQuery = attr .ib (default = '' , validator = instance_of (str ))
3944
3944
searchTags = attr .ib (default = attr .Factory (list ), validator = instance_of (list ))
3945
3945
overrides = attr .ib (default = attr .Factory (list ))
3946
+ folderUID = attr .ib (default = None , validator = optional (instance_of (str )))
3947
+
3948
+ def __attrs_post_init__ (self ):
3949
+ if self .folderUID is not None :
3950
+ self .showSearch = True
3946
3951
3947
3952
def to_json_data (self ):
3948
- return self .panel_json (
3949
- {
3950
- 'fieldConfig' : {
3951
- 'defaults' : {
3952
- 'custom' : {},
3953
- },
3954
- 'overrides' : self .overrides
3955
- },
3956
- 'options' : {
3957
- 'headings' : self .showHeadings ,
3958
- 'search' : self .showSearch ,
3959
- 'recent' : self .showRecent ,
3960
- 'starred' : self .showStarred ,
3961
- 'limit' : self .maxItems ,
3962
- 'query' : self .searchQuery ,
3963
- 'tags' : self .searchTags ,
3964
- 'type' : DASHBOARDLIST_TYPE ,
3953
+ panel_data = {
3954
+ 'fieldConfig' : {
3955
+ 'defaults' : {
3956
+ 'custom' : {},
3965
3957
},
3966
- }
3967
- )
3958
+ 'overrides' : self .overrides
3959
+ },
3960
+ 'options' : {
3961
+ 'headings' : self .showHeadings ,
3962
+ 'search' : self .showSearch ,
3963
+ 'recent' : self .showRecent ,
3964
+ 'starred' : self .showStarred ,
3965
+ 'limit' : self .maxItems ,
3966
+ 'query' : self .searchQuery ,
3967
+ 'tags' : self .searchTags ,
3968
+ 'type' : DASHBOARDLIST_TYPE ,
3969
+ },
3970
+ }
3971
+ if self .folderUID is not None :
3972
+ panel_data ['options' ]['folderUID' ] = self .folderUID
3973
+ return self .panel_json (panel_data )
3968
3974
3969
3975
3970
3976
@attr .s
0 commit comments