File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -119,13 +119,19 @@ local xtd = import 'github.com/jsonnet-libs/xtd/main.libsonnet';
119119 g.panel.timeSeries.fieldOverride.byQuery.new(name)
120120 + g.panel.timeSeries.fieldOverride.byQuery.withPropertiesFromOptions(
121121 g.panel.timeSeries.standardOptions.withUnit(self .unit)
122- + g.panel.timeSeries.standardOptions.withMappings(this.getValueMappings(sourceMaps))
122+ +
123+ (if std.length (this.getValueMappings(sourceMaps)) > 0 then
124+ g.panel.timeSeries.standardOptions.withMappings(this.getValueMappings(sourceMaps))
125+ else {})
123126 )
124127 else if override == 'byName' then
125128 g.panel.timeSeries.fieldOverride.byName.new(name)
126129 + g.panel.timeSeries.fieldOverride.byName.withPropertiesFromOptions(
127130 g.panel.timeSeries.standardOptions.withUnit(self .unit)
128- + g.panel.timeSeries.standardOptions.withMappings(this.getValueMappings(sourceMaps))
131+ +
132+ (if std.length (this.getValueMappings(sourceMaps)) > 0 then
133+ g.panel.timeSeries.standardOptions.withMappings(this.getValueMappings(sourceMaps))
134+ else {})
129135 )
130136 else error 'Unknown override type, only "byName", "byQuery" are supported.' ,
131137 ],
You can’t perform that action at this time.
0 commit comments