mirror of
https://github.com/grafana/grafana.git
synced 2025-09-24 08:34:01 +08:00

* Chore: initial commit * Tests: fixes MetricsQueryEditor.test.tsx * Tests: fixes cloudwatch/specs/datasource.test.ts * Tests: fixes stackdriver/specs/datasource.test.ts * Tests: remove refrences to CustomVariable * Refactor: moves DefaultVariableQueryEditor * Refactor: moves utils * Refactor: moves types * Refactor: removes variableSrv * Refactor: removes feature toggle newVariables * Refactor: removes valueSelectDropDown * Chore: removes GeneralTabCtrl * Chore: migrates RowOptions * Refactor: adds RowOptionsButton * Refactor: makes the interface more explicit * Refactor: small changes * Refactor: changed type as it can be any variable type * Tests: fixes broken test * Refactor: changes after PR comments * Refactor: adds loading state and call to onChange in componentDidMount
25 lines
625 B
TypeScript
25 lines
625 B
TypeScript
import { OptionsVariableBuilder } from './optionsVariableBuilder';
|
|
import { IntervalVariableModel, VariableRefresh } from 'app/features/variables/types';
|
|
|
|
export class IntervalVariableBuilder extends OptionsVariableBuilder<IntervalVariableModel> {
|
|
withRefresh(refresh: VariableRefresh) {
|
|
this.variable.refresh = refresh;
|
|
return this;
|
|
}
|
|
|
|
withAuto(auto: boolean) {
|
|
this.variable.auto = auto;
|
|
return this;
|
|
}
|
|
|
|
withAutoCount(autoCount: number) {
|
|
this.variable.auto_count = autoCount;
|
|
return this;
|
|
}
|
|
|
|
withAutoMin(autoMin: string) {
|
|
this.variable.auto_min = autoMin;
|
|
return this;
|
|
}
|
|
}
|