Commit 30a682a4 by Dominik Prokop Committed by GitHub

Do not break dashboard settings UI when time intervals end with trailing comma (#26126)

parent 2b6833d0
......@@ -255,7 +255,7 @@ export class SettingsCtrl {
};
onRefreshIntervalChange = (intervals: string[]) => {
this.dashboard.timepicker.refresh_intervals = intervals;
this.dashboard.timepicker.refresh_intervals = intervals.filter(i => i.trim() !== '');
};
onNowDelayChange = (nowDelay: string) => {
......
......@@ -112,7 +112,7 @@ export class TimePickerSettings extends PureComponent<Props, State> {
<div className="gf-form">
<span className="gf-form-label width-7">Auto-refresh</span>
<Input width={60} value={this.getRefreshIntervals()} onChange={this.onRefreshIntervalChange} />
<Input width={60} defaultValue={this.getRefreshIntervals()} onBlur={this.onRefreshIntervalChange} />
</div>
<div className="gf-form">
<span className="gf-form-label width-7">Now delay now-</span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment