Feature flag for ota_update_hour
parent
e1780991d4
commit
0e2c016ef4
|
@ -43,7 +43,7 @@ describe("<FarmbotOsSettings />", () => {
|
|||
botToMqttStatus: "up",
|
||||
sourceFbosConfig: x =>
|
||||
({ value: bot.hardware.configuration[x], consistent: true }),
|
||||
shouldDisplay: jest.fn(),
|
||||
shouldDisplay: jest.fn(() => true),
|
||||
isValidFbosConfig: false,
|
||||
env: {},
|
||||
saveFarmwareEnv: jest.fn(),
|
||||
|
|
|
@ -138,6 +138,7 @@ export class FarmbotOsSettings
|
|||
timeSettings={this.props.timeSettings}
|
||||
sourceFbosConfig={sourceFbosConfig} />
|
||||
<AutoUpdateRow
|
||||
shouldDisplay={this.props.shouldDisplay}
|
||||
timeFormat={timeFormat}
|
||||
device={this.props.deviceAccount}
|
||||
dispatch={this.props.dispatch}
|
||||
|
|
|
@ -21,6 +21,7 @@ describe("<AutoUpdateRow/>", () => {
|
|||
|
||||
const fakeProps = (): AutoUpdateRowProps => ({
|
||||
timeFormat: "12h",
|
||||
shouldDisplay: jest.fn(() => true),
|
||||
device: fakeDevice(),
|
||||
dispatch: jest.fn(x => x(jest.fn(), () => state)),
|
||||
sourceFbosConfig: () => ({ value: 1, consistent: true })
|
||||
|
|
|
@ -7,15 +7,17 @@ import { Content } from "../../../constants";
|
|||
import { AutoUpdateRowProps } from "./interfaces";
|
||||
import { t } from "../../../i18next_wrapper";
|
||||
import { OtaTimeSelector, changeOtaHour } from "./ota_time_selector";
|
||||
import { Feature } from "../../interfaces";
|
||||
|
||||
export function AutoUpdateRow(props: AutoUpdateRowProps) {
|
||||
const osAutoUpdate = props.sourceFbosConfig("os_auto_update");
|
||||
|
||||
return <div>
|
||||
<OtaTimeSelector
|
||||
{props.shouldDisplay(Feature.ota_update_hour) && <OtaTimeSelector
|
||||
timeFormat={props.timeFormat}
|
||||
disabled={!osAutoUpdate.value}
|
||||
value={props.device.body.ota_hour}
|
||||
onChange={changeOtaHour(props.dispatch, props.device)} />
|
||||
onChange={changeOtaHour(props.dispatch, props.device)} />}
|
||||
<Row>
|
||||
<Col xs={ColWidth.label}>
|
||||
<label>
|
||||
|
|
|
@ -24,6 +24,7 @@ export interface AutoUpdateRowProps {
|
|||
timeFormat: PreferredHourFormat;
|
||||
sourceFbosConfig: SourceFbosConfig;
|
||||
device: TaggedDevice;
|
||||
shouldDisplay: ShouldDisplay;
|
||||
}
|
||||
|
||||
export interface CameraSelectionProps {
|
||||
|
|
|
@ -86,6 +86,7 @@ export enum Feature {
|
|||
mark_as_step = "mark_as_step",
|
||||
named_pins = "named_pins",
|
||||
none_firmware = "none_firmware",
|
||||
ota_update_hour = "ota_update_hour",
|
||||
rpi_led_control = "rpi_led_control",
|
||||
sensors = "sensors",
|
||||
use_update_channel = "use_update_channel",
|
||||
|
|
Loading…
Reference in New Issue