fix commas

pull/1724/head
gabrielburnworth 2020-02-28 08:35:32 -08:00
parent 25d944e4b7
commit 4013291787
418 changed files with 726 additions and 728 deletions

View File

@ -54,5 +54,5 @@ export const fakeImages: TaggedImage[] = [
} }
}, },
"uuid": "Image.7.5" "uuid": "Image.7.5"
} },
]; ];

View File

@ -29,7 +29,7 @@ import {
} from "farmbot"; } from "farmbot";
import { fakeResource } from "../fake_resource"; import { fakeResource } from "../fake_resource";
import { import {
ExecutableType, PinBindingType, Folder ExecutableType, PinBindingType, Folder,
} from "farmbot/dist/resources/api_resources"; } from "farmbot/dist/resources/api_resources";
import { FirmwareConfig } from "farmbot/dist/resources/configs/firmware"; import { FirmwareConfig } from "farmbot/dist/resources/configs/firmware";
import { MessageType } from "../../sequences/interfaces"; import { MessageType } from "../../sequences/interfaces";

View File

@ -2,7 +2,7 @@ import { Coordinate } from "farmbot";
import { VariableNameSet } from "../resources/interfaces"; import { VariableNameSet } from "../resources/interfaces";
export const fakeVariableNameSet = ( export const fakeVariableNameSet = (
label = "parent", vector = { x: 0, y: 0, z: 0 } label = "parent", vector = { x: 0, y: 0, z: 0 },
): VariableNameSet => { ): VariableNameSet => {
const data_value: Coordinate = { const data_value: Coordinate = {
kind: "coordinate", args: vector kind: "coordinate", args: vector

View File

@ -1,6 +1,6 @@
import moment from "moment"; import moment from "moment";
import { import {
FarmEventWithExecutable FarmEventWithExecutable,
} from "../farm_designer/farm_events/calendar/interfaces"; } from "../farm_designer/farm_events/calendar/interfaces";
export const TIME = { export const TIME = {
@ -24,7 +24,7 @@ export const fakeFarmEventWithExecutable = (): FarmEventWithExecutable => {
color: "red", color: "red",
name: "faker", name: "faker",
kind: "sequence", kind: "sequence",
args: { version: 0, locals: { kind: "scope_declaration", args: {} }, } args: { version: 0, locals: { kind: "scope_declaration", args: {} } }
} }
}; };
}; };
@ -84,7 +84,7 @@ export const calendarRows = [
"subheading": "25", "subheading": "25",
"id": 79, "id": 79,
"childExecutableName": "Goto 0, 0, 0 123" "childExecutableName": "Goto 0, 0, 0 123"
} },
] ]
}, },
{ {
@ -171,7 +171,7 @@ export const calendarRows = [
"subheading": "25", "subheading": "25",
"id": 79, "id": 79,
"childExecutableName": "Goto 0, 0, 0 123" "childExecutableName": "Goto 0, 0, 0 123"
} },
] ]
}, },
{ {
@ -258,7 +258,7 @@ export const calendarRows = [
"subheading": "25", "subheading": "25",
"id": 79, "id": 79,
"childExecutableName": "Goto 0, 0, 0 123" "childExecutableName": "Goto 0, 0, 0 123"
} },
] ]
} },
]; ];

View File

@ -62,7 +62,7 @@ const tr0: TaggedResource = {
}, },
"speed": 100 "speed": 100
} }
} },
], ],
"args": { "args": {
"version": 4, "version": 4,
@ -287,7 +287,7 @@ const tr12: TaggedResource = {
"regimen_id": 11, "regimen_id": 11,
"sequence_id": 23, "sequence_id": 23,
"time_offset": 345900000 "time_offset": 345900000
} },
], ],
body: [], body: [],
}, },
@ -345,7 +345,7 @@ export const FAKE_RESOURCES: TaggedResource[] = [
tr0, tr0,
tr14, tr14,
tr15, tr15,
log log,
]; ];
const KIND: keyof TaggedResource = "kind"; // Safety first, kids. const KIND: keyof TaggedResource = "kind"; // Safety first, kids.
type ResourceGroupNumber = 0 | 1 | 2 | 3 | 4; type ResourceGroupNumber = 0 | 1 | 2 | 3 | 4;

View File

@ -9,11 +9,11 @@ import { RawApp as App, AppProps, mapStateToProps } from "../app";
import { mount } from "enzyme"; import { mount } from "enzyme";
import { bot } from "../__test_support__/fake_state/bot"; import { bot } from "../__test_support__/fake_state/bot";
import { import {
fakeUser, fakeWebAppConfig, fakeFbosConfig, fakeFarmwareEnv fakeUser, fakeWebAppConfig, fakeFbosConfig, fakeFarmwareEnv,
} from "../__test_support__/fake_state/resources"; } from "../__test_support__/fake_state/resources";
import { fakeState } from "../__test_support__/fake_state"; import { fakeState } from "../__test_support__/fake_state";
import { import {
buildResourceIndex buildResourceIndex,
} from "../__test_support__/resource_index_builder"; } from "../__test_support__/resource_index_builder";
import { ResourceName } from "farmbot"; import { ResourceName } from "farmbot";
import { fakeTimeSettings } from "../__test_support__/fake_time_settings"; import { fakeTimeSettings } from "../__test_support__/fake_time_settings";
@ -125,7 +125,7 @@ describe("<App />: NavBar", () => {
"Device", "Device",
"Sequences", "Sequences",
"Regimens", "Regimens",
"Farmware" "Farmware",
]; ];
strings.map(string => expect(t).toContain(string)); strings.map(string => expect(t).toContain(string));
wrapper.unmount(); wrapper.unmount();

View File

@ -10,7 +10,7 @@ jest.mock("../redux/store", () => {
}); });
jest.mock("../account/dev/dev_support", () => ({ jest.mock("../account/dev/dev_support", () => ({
DevSettings: { futureFeaturesEnabled: () => false, } DevSettings: { futureFeaturesEnabled: () => false }
})); }));
jest.mock("../config/actions", () => { jest.mock("../config/actions", () => {

View File

@ -19,7 +19,7 @@ jest.mock("../session", () => ({
})); }));
import { import {
responseFulfilled, isLocalRequest, requestFulfilled, responseRejected responseFulfilled, isLocalRequest, requestFulfilled, responseRejected,
} from "../interceptors"; } from "../interceptors";
import { AxiosResponse, Method } from "axios"; import { AxiosResponse, Method } from "axios";
import { uuid } from "farmbot"; import { uuid } from "farmbot";

View File

@ -9,7 +9,7 @@ jest.mock("axios", () => ({
})); }));
jest.mock("../session", () => ({ Session: { clear: jest.fn(), } })); jest.mock("../session", () => ({ Session: { clear: jest.fn() } }));
import { maybeRefreshToken } from "../refresh_token"; import { maybeRefreshToken } from "../refresh_token";
import { API } from "../api/index"; import { API } from "../api/index";

View File

@ -1,6 +1,6 @@
import { import {
buildResourceIndex, buildResourceIndex,
FAKE_RESOURCES FAKE_RESOURCES,
} from "../__test_support__/resource_index_builder"; } from "../__test_support__/resource_index_builder";
import { TaggedFarmEvent, SpecialStatus } from "farmbot"; import { TaggedFarmEvent, SpecialStatus } from "farmbot";

View File

@ -12,7 +12,7 @@ type Info = UnboundRouteConfig<{}, {}>;
const fakeCallback = ( const fakeCallback = (
component: ConnectedComponent, component: ConnectedComponent,
child: ConnectedComponent | undefined, child: ConnectedComponent | undefined,
info: Info info: Info,
) => { ) => {
if (info.$ == "*") { if (info.$ == "*") {
expect(component.name).toEqual("FourOhFour"); expect(component.name).toEqual("FourOhFour");

View File

@ -11,7 +11,7 @@ jest.mock("axios", () => ({
import { API } from "../../api"; import { API } from "../../api";
import { Content } from "../../constants"; import { Content } from "../../constants";
import { import {
requestAccountExport, generateFilename requestAccountExport, generateFilename,
} from "../request_account_export"; } from "../request_account_export";
import { success } from "../../toast/toast"; import { success } from "../../toast/toast";
import axios from "axios"; import axios from "axios";

View File

@ -3,7 +3,7 @@ import {
Widget, Widget,
WidgetHeader, WidgetHeader,
WidgetBody, WidgetBody,
SaveBtn SaveBtn,
} from "../../ui/index"; } from "../../ui/index";
import { SpecialStatus } from "farmbot"; import { SpecialStatus } from "farmbot";
import Axios from "axios"; import Axios from "axios";

View File

@ -1,6 +1,6 @@
import * as React from "react"; import * as React from "react";
import { import {
BlurableInput, Widget, WidgetHeader, WidgetBody, SaveBtn BlurableInput, Widget, WidgetHeader, WidgetBody, SaveBtn,
} from "../../ui/index"; } from "../../ui/index";
import { SettingsPropTypes } from "../interfaces"; import { SettingsPropTypes } from "../interfaces";
import { t } from "../../i18next_wrapper"; import { t } from "../../i18next_wrapper";

View File

@ -8,7 +8,7 @@ import { DevMode } from "../dev_mode";
import * as React from "react"; import * as React from "react";
import { range } from "lodash"; import { range } from "lodash";
import { import {
setWebAppConfigValue setWebAppConfigValue,
} from "../../../config_storage/actions"; } from "../../../config_storage/actions";
import { warning } from "../../../toast/toast"; import { warning } from "../../../toast/toast";

View File

@ -7,7 +7,7 @@ jest.mock("../../../config_storage/actions", () => ({
import * as React from "react"; import * as React from "react";
import { mount, shallow } from "enzyme"; import { mount, shallow } from "enzyme";
import { import {
DevWidget, DevWidgetFERow, DevWidgetFBOSRow, DevWidgetDelModeRow DevWidget, DevWidgetFERow, DevWidgetFBOSRow, DevWidgetDelModeRow,
} from "../dev_widget"; } from "../dev_widget";
import { DevSettings } from "../dev_support"; import { DevSettings } from "../dev_support";
import { setWebAppConfigValue } from "../../../config_storage/actions"; import { setWebAppConfigValue } from "../../../config_storage/actions";

View File

@ -1,6 +1,6 @@
import { store } from "../../redux/store"; import { store } from "../../redux/store";
import { import {
getWebAppConfigValue, setWebAppConfigValue getWebAppConfigValue, setWebAppConfigValue,
} from "../../config_storage/actions"; } from "../../config_storage/actions";
import { BooleanConfigKey } from "farmbot/dist/resources/configs/web_app"; import { BooleanConfigKey } from "farmbot/dist/resources/configs/web_app";

View File

@ -1,6 +1,6 @@
import * as React from "react"; import * as React from "react";
import { import {
Widget, WidgetHeader, WidgetBody, Row, Col, BlurableInput Widget, WidgetHeader, WidgetBody, Row, Col, BlurableInput,
} from "../../ui"; } from "../../ui";
import { ToggleButton } from "../../controls/toggle_button"; import { ToggleButton } from "../../controls/toggle_button";
import { setWebAppConfigValue } from "../../config_storage/actions"; import { setWebAppConfigValue } from "../../config_storage/actions";

View File

@ -1,7 +1,7 @@
import * as React from "react"; import * as React from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { import {
Settings, ChangePassword, ExportAccountPanel, DangerousDeleteWidget Settings, ChangePassword, ExportAccountPanel, DangerousDeleteWidget,
} from "./components"; } from "./components";
import { Props } from "./interfaces"; import { Props } from "./interfaces";
import { Page, Row, Col } from "../ui"; import { Page, Row, Col } from "../ui";

View File

@ -5,7 +5,7 @@ const mockFeatures = [
storageKey: "weedDetector", storageKey: "weedDetector",
callback: jest.fn(), callback: jest.fn(),
value: false value: false
} },
]; ];
const mocks = { const mocks = {

View File

@ -1,7 +1,7 @@
import { BooleanSetting } from "../../session_keys"; import { BooleanSetting } from "../../session_keys";
import { Content } from "../../constants"; import { Content } from "../../constants";
import { import {
GetWebAppConfigValue, setWebAppConfigValue GetWebAppConfigValue, setWebAppConfigValue,
} from "../../config_storage/actions"; } from "../../config_storage/actions";
import { BooleanConfigKey } from "farmbot/dist/resources/configs/web_app"; import { BooleanConfigKey } from "farmbot/dist/resources/configs/web_app";
import { t } from "../../i18next_wrapper"; import { t } from "../../i18next_wrapper";
@ -78,7 +78,7 @@ export const fetchLabFeatures =
storageKey: BooleanSetting.user_interface_read_only_mode, storageKey: BooleanSetting.user_interface_read_only_mode,
value: false, value: false,
displayInvert: false, displayInvert: false,
} },
].map(fetchSettingValue(getConfigValue))); ].map(fetchSettingValue(getConfigValue)));
/** Always allow toggling from true => false (deactivate). /** Always allow toggling from true => false (deactivate).

View File

@ -18,7 +18,7 @@ import { validBotLocationData, validFwConfig, validFbosConfig } from "./util";
import { BooleanSetting } from "./session_keys"; import { BooleanSetting } from "./session_keys";
import { getPathArray } from "./history"; import { getPathArray } from "./history";
import { import {
getWebAppConfigValue, GetWebAppConfigValue getWebAppConfigValue, GetWebAppConfigValue,
} from "./config_storage/actions"; } from "./config_storage/actions";
import { takeSortedLogs } from "./logs/state_to_props"; import { takeSortedLogs } from "./logs/state_to_props";
import { FirmwareConfig } from "farmbot/dist/resources/configs/firmware"; import { FirmwareConfig } from "farmbot/dist/resources/configs/firmware";
@ -99,7 +99,7 @@ const MUST_LOAD: ResourceName[] = [
"FarmEvent", "FarmEvent",
"Point", "Point",
"Device", "Device",
"Tool" // Sequence editor needs this for rendering. "Tool", // Sequence editor needs this for rendering.
]; ];
export class RawApp extends React.Component<AppProps, {}> { export class RawApp extends React.Component<AppProps, {}> {

View File

@ -1,7 +1,7 @@
import axios from "axios"; import axios from "axios";
import { import {
fetchReleases, fetchMinOsFeatureData, fetchReleases, fetchMinOsFeatureData,
fetchLatestGHBetaRelease fetchLatestGHBetaRelease,
} from "../devices/actions"; } from "../devices/actions";
import { AuthState } from "./interfaces"; import { AuthState } from "./interfaces";
import { ReduxAction } from "../redux/interfaces"; import { ReduxAction } from "../redux/interfaces";
@ -10,7 +10,7 @@ import { API } from "../api";
import { import {
responseFulfilled, responseFulfilled,
responseRejected, responseRejected,
requestFulfilled requestFulfilled,
} from "../interceptors"; } from "../interceptors";
import { Actions } from "../constants"; import { Actions } from "../constants";
import { connectDevice } from "../connectivity/connect_device"; import { connectDevice } from "../connectivity/connect_device";

View File

@ -1,5 +1,5 @@
import { import {
toggleWebAppBool, getWebAppConfigValue, setWebAppConfigValue toggleWebAppBool, getWebAppConfigValue, setWebAppConfigValue,
} from "../actions"; } from "../actions";
import { BooleanSetting, NumericSetting } from "../../session_keys"; import { BooleanSetting, NumericSetting } from "../../session_keys";
import { edit, save } from "../../api/crud"; import { edit, save } from "../../api/crud";

View File

@ -4,7 +4,7 @@ import {
BooleanConfigKey, BooleanConfigKey,
WebAppConfig, WebAppConfig,
NumberConfigKey, NumberConfigKey,
StringConfigKey StringConfigKey,
} from "farmbot/dist/resources/configs/web_app"; } from "farmbot/dist/resources/configs/web_app";
import { getWebAppConfig } from "../resources/getters"; import { getWebAppConfig } from "../resources/getters";

View File

@ -10,7 +10,7 @@ import { fakeState } from "../../__test_support__/fake_state";
import { GetState } from "../../redux/interfaces"; import { GetState } from "../../redux/interfaces";
import { handleInbound } from "../auto_sync_handle_inbound"; import { handleInbound } from "../auto_sync_handle_inbound";
import { import {
handleCreateOrUpdate handleCreateOrUpdate,
} from "../auto_sync"; } from "../auto_sync";
import { destroyOK } from "../../resources/actions"; import { destroyOK } from "../../resources/actions";
import { SkipMqttData, BadMqttData, UpdateMqttData, DeleteMqttData } from "../interfaces"; import { SkipMqttData, BadMqttData, UpdateMqttData, DeleteMqttData } from "../interfaces";

View File

@ -4,7 +4,7 @@ import {
asTaggedResource, asTaggedResource,
handleCreate, handleCreate,
handleUpdate, handleUpdate,
handleCreateOrUpdate handleCreateOrUpdate,
} from "../auto_sync"; } from "../auto_sync";
import { SpecialStatus, TaggedSequence } from "farmbot"; import { SpecialStatus, TaggedSequence } from "farmbot";
import { Actions } from "../../constants"; import { Actions } from "../../constants";

View File

@ -35,7 +35,7 @@ describe("attachEventListeners", () => {
].map(e => expect(dev.on).toHaveBeenCalledWith(e, expect.any(Function))); ].map(e => expect(dev.on).toHaveBeenCalledWith(e, expect.any(Function)));
[ [
"message", "message",
"reconnect" "reconnect",
].map(e => { ].map(e => {
if (dev.client) { if (dev.client) {
expect(dev.client.on).toHaveBeenCalledWith(e, expect.any(Function)); expect(dev.client.on).toHaveBeenCalledWith(e, expect.any(Function));

View File

@ -9,7 +9,7 @@ import {
incomingStatus, incomingStatus,
incomingLegacyStatus, incomingLegacyStatus,
onLegacyStatus, onLegacyStatus,
HACKY_FLAGS HACKY_FLAGS,
} from "../../connect_device"; } from "../../connect_device";
import { slowDown } from "../../slow_down"; import { slowDown } from "../../slow_down";
import { fakeState } from "../../../__test_support__/fake_state"; import { fakeState } from "../../../__test_support__/fake_state";

View File

@ -20,7 +20,7 @@ import { getDevice } from "../../device";
import { store } from "../../redux/store"; import { store } from "../../redux/store";
import { Actions } from "../../constants"; import { Actions } from "../../constants";
import { import {
startTracking, outstandingRequests, stopTracking, cleanUUID startTracking, outstandingRequests, stopTracking, cleanUUID,
} from "../data_consistency"; } from "../data_consistency";
const unprocessedUuid = "~UU.ID~"; const unprocessedUuid = "~UU.ID~";

View File

@ -8,7 +8,7 @@ jest.mock("../index", () => ({
import { import {
readPing, readPing,
startPinging, startPinging,
PING_INTERVAL PING_INTERVAL,
} from "../ping_mqtt"; } from "../ping_mqtt";
import { Farmbot, RpcRequest, RpcRequestBodyItem } from "farmbot"; import { Farmbot, RpcRequest, RpcRequestBodyItem } from "farmbot";
import { FarmBotInternalConfig } from "farmbot/dist/config"; import { FarmBotInternalConfig } from "farmbot/dist/config";

View File

@ -41,7 +41,7 @@ describe("connectivity reducer", () => {
it("broadcasts PING_OK", () => { it("broadcasts PING_OK", () => {
pingOK("yep", 123); pingOK("yep", 123);
expect(store.dispatch).toHaveBeenCalledWith({ expect(store.dispatch).toHaveBeenCalledWith({
payload: { at: 123, id: "yep", }, payload: { at: 123, id: "yep" },
type: "PING_OK", type: "PING_OK",
}); });
}); });

View File

@ -4,7 +4,7 @@ import { TaggedResource, SpecialStatus } from "farmbot";
import { overwrite, init } from "../api/crud"; import { overwrite, init } from "../api/crud";
import { handleInbound } from "./auto_sync_handle_inbound"; import { handleInbound } from "./auto_sync_handle_inbound";
import { import {
SyncPayload, MqttDataResult, Reason, UpdateMqttData SyncPayload, MqttDataResult, Reason, UpdateMqttData,
} from "./interfaces"; } from "./interfaces";
import { outstandingRequests } from "./data_consistency"; import { outstandingRequests } from "./data_consistency";
import { newTaggedResource } from "../sync/actions"; import { newTaggedResource } from "../sync/actions";

View File

@ -3,7 +3,7 @@ import {
actOnChannelName, actOnChannelName,
showLogOnScreen, showLogOnScreen,
speakLogAloud, speakLogAloud,
initLog initLog,
} from "./connect_device"; } from "./connect_device";
import { GetState } from "../redux/interfaces"; import { GetState } from "../redux/interfaces";
import { Log } from "farmbot/dist/resources/api_resources"; import { Log } from "farmbot/dist/resources/api_resources";

View File

@ -4,7 +4,7 @@ import {
dispatchNetworkUp, dispatchNetworkUp,
dispatchQosStart, dispatchQosStart,
pingOK, pingOK,
pingNO pingNO,
} from "./index"; } from "./index";
import { isNumber } from "lodash"; import { isNumber } from "lodash";
import axios from "axios"; import axios from "axios";

View File

@ -2,7 +2,7 @@ import { generateReducer } from "../redux/generate_reducer";
import { Actions } from "../constants"; import { Actions } from "../constants";
import { import {
ConnectionState, ConnectionState,
EdgeStatus EdgeStatus,
} from "./interfaces"; } from "./interfaces";
import { startPing, completePing, failPing } from "../devices/connectivity/qos"; import { startPing, completePing, failPing } from "../devices/connectivity/qos";

View File

@ -3,7 +3,7 @@ import { mount } from "enzyme";
import { RawControls as Controls } from "../controls"; import { RawControls as Controls } from "../controls";
import { bot } from "../../__test_support__/fake_state/bot"; import { bot } from "../../__test_support__/fake_state/bot";
import { import {
fakePeripheral, fakeWebcamFeed, fakeSensor fakePeripheral, fakeWebcamFeed, fakeSensor,
} from "../../__test_support__/fake_state/resources"; } from "../../__test_support__/fake_state/resources";
import { Dictionary } from "farmbot"; import { Dictionary } from "farmbot";
import { Props } from "../interfaces"; import { Props } from "../interfaces";

View File

@ -1,12 +1,12 @@
import { import {
BotState, Xyz, BotPosition, ShouldDisplay, UserEnv BotState, Xyz, BotPosition, ShouldDisplay, UserEnv,
} from "../devices/interfaces"; } from "../devices/interfaces";
import { Vector3, McuParams, FirmwareHardware } from "farmbot/dist"; import { Vector3, McuParams, FirmwareHardware } from "farmbot/dist";
import { import {
TaggedWebcamFeed, TaggedWebcamFeed,
TaggedPeripheral, TaggedPeripheral,
TaggedSensor, TaggedSensor,
TaggedSensorReading TaggedSensorReading,
} from "farmbot"; } from "farmbot";
import { NetworkState } from "../connectivity/interfaces"; import { NetworkState } from "../connectivity/interfaces";
import { GetWebAppConfigValue } from "../config_storage/actions"; import { GetWebAppConfigValue } from "../config_storage/actions";

View File

@ -1,5 +1,5 @@
import { import {
calcMicrostepsPerMm, calculateAxialLengths calcMicrostepsPerMm, calculateAxialLengths,
} from "../direction_axes_props"; } from "../direction_axes_props";
import { fakeFirmwareConfig } from "../../../__test_support__/fake_state/resources"; import { fakeFirmwareConfig } from "../../../__test_support__/fake_state/resources";

View File

@ -9,7 +9,7 @@ jest.mock("../../../device", () => ({
import * as React from "react"; import * as React from "react";
import { mount } from "enzyme"; import { mount } from "enzyme";
import { import {
DirectionButton, directionDisabled, calculateDistance DirectionButton, directionDisabled, calculateDistance,
} from "../direction_button"; } from "../direction_button";
import { DirectionButtonProps } from "../interfaces"; import { DirectionButtonProps } from "../interfaces";

View File

@ -9,7 +9,7 @@ import * as React from "react";
import { mount } from "enzyme"; import { mount } from "enzyme";
import { BooleanSetting } from "../../../session_keys"; import { BooleanSetting } from "../../../session_keys";
import { import {
moveWidgetSetting, MoveWidgetSettingsMenu, MoveWidgetSettingsMenuProps moveWidgetSetting, MoveWidgetSettingsMenu, MoveWidgetSettingsMenuProps,
} from "../settings_menu"; } from "../settings_menu";
describe("moveWidgetSetting()", () => { describe("moveWidgetSetting()", () => {

View File

@ -6,7 +6,7 @@ import { getDevice } from "../../device";
import { buildDirectionProps } from "./direction_axes_props"; import { buildDirectionProps } from "./direction_axes_props";
import { t } from "../../i18next_wrapper"; import { t } from "../../i18next_wrapper";
import { import {
cameraBtnProps cameraBtnProps,
} from "../../devices/components/fbos_settings/camera_selection"; } from "../../devices/components/fbos_settings/camera_selection";
const DEFAULT_STEP_SIZE = 100; const DEFAULT_STEP_SIZE = 100;

View File

@ -4,7 +4,7 @@ import moment from "moment";
import { BotLocationData, BotPosition } from "../../devices/interfaces"; import { BotLocationData, BotPosition } from "../../devices/interfaces";
import { trim } from "../../util"; import { trim } from "../../util";
import { import {
cloneDeep, max, get, isNumber, isEqual, takeRight, ceil, range cloneDeep, max, get, isNumber, isEqual, takeRight, ceil, range,
} from "lodash"; } from "lodash";
import { t } from "../../i18next_wrapper"; import { t } from "../../i18next_wrapper";

View File

@ -27,7 +27,7 @@ export interface MoveWidgetSettingsMenuProps {
} }
export const MoveWidgetSettingsMenu = ( export const MoveWidgetSettingsMenu = (
{ toggle, getValue, firmwareHardware }: MoveWidgetSettingsMenuProps { toggle, getValue, firmwareHardware }: MoveWidgetSettingsMenuProps,
) => { ) => {
const Setting = moveWidgetSetting(toggle, getValue); const Setting = moveWidgetSetting(toggle, getValue);
return <div className="move-settings-menu"> return <div className="move-settings-menu">

View File

@ -21,16 +21,13 @@ export class StepSizeSelector extends React.Component<StepSizeSelectorProps, {}>
render() { render() {
return <div className="move-amount-wrapper"> return <div className="move-amount-wrapper">
{ {this.props.choices.map((item: number, inx: number) =>
this.props.choices.map( <button key={inx}
(item: number, inx: number) => <button key={inx} title={t("{{ amount }}mm", { amount: item })}
title={t("{{ amount }}mm", { amount: item })} className={this.cssForIndex(item)}
className={this.cssForIndex(item)} onClick={() => this.props.selector(item)}>
onClick={() => this.props.selector(item)}> {item}
{item} </button>)}
</button>
)
}
</div>; </div>;
} }
} }

View File

@ -10,7 +10,7 @@ import { mount } from "enzyme";
import { PeripheralList } from "../peripheral_list"; import { PeripheralList } from "../peripheral_list";
import { import {
TaggedPeripheral, TaggedPeripheral,
SpecialStatus SpecialStatus,
} from "farmbot"; } from "farmbot";
import { Pins } from "farmbot/dist"; import { Pins } from "farmbot/dist";

View File

@ -51,7 +51,7 @@ export class Peripherals
newPeripheral = ( newPeripheral = (
pin: number | undefined = undefined, pin: number | undefined = undefined,
label = t("New Peripheral") label = t("New Peripheral"),
) => { ) => {
this.props.dispatch(init("Peripheral", { pin, label })); this.props.dispatch(init("Peripheral", { pin, label }));
}; };

View File

@ -26,6 +26,5 @@ export const PeripheralForm = (props: PeripheralFormProps) =>
dispatch={props.dispatch} dispatch={props.dispatch}
uuid={peripheral.uuid} /> uuid={peripheral.uuid} />
</Col> </Col>
</Row> </Row>)}
)}
</div>; </div>;

View File

@ -2,7 +2,7 @@ import * as React from "react";
import { edit } from "../api/crud"; import { edit } from "../api/crud";
import { FBSelect } from "../ui"; import { FBSelect } from "../ui";
import { import {
pinDropdowns pinDropdowns,
} from "../sequences/step_tiles/pin_and_peripheral_support"; } from "../sequences/step_tiles/pin_and_peripheral_support";
import { PIN_MODES } from "../sequences/step_tiles/tile_pin_support"; import { PIN_MODES } from "../sequences/step_tiles/tile_pin_support";
import { t } from "../i18next_wrapper"; import { t } from "../i18next_wrapper";

View File

@ -1,5 +1,5 @@
import { import {
fakeSensorReading, fakeSensor fakeSensorReading, fakeSensor,
} from "../../../__test_support__/fake_state/resources"; } from "../../../__test_support__/fake_state/resources";
import { filterSensorReadings } from "../filter_readings"; import { filterSensorReadings } from "../filter_readings";
import { SensorReadingsState } from "../interfaces"; import { SensorReadingsState } from "../interfaces";

View File

@ -3,7 +3,7 @@ import { mount } from "enzyme";
import { SensorReadingsPlot, calcTimeParams } from "../graph"; import { SensorReadingsPlot, calcTimeParams } from "../graph";
import { SensorReadingPlotProps } from "../interfaces"; import { SensorReadingPlotProps } from "../interfaces";
import { import {
fakeSensorReading fakeSensorReading,
} from "../../../__test_support__/fake_state/resources"; } from "../../../__test_support__/fake_state/resources";
import { fakeTimeSettings } from "../../../__test_support__/fake_time_settings"; import { fakeTimeSettings } from "../../../__test_support__/fake_time_settings";

View File

@ -3,7 +3,7 @@ import { mount } from "enzyme";
import { SensorReadings } from "../sensor_readings"; import { SensorReadings } from "../sensor_readings";
import { SensorReadingsProps } from "../interfaces"; import { SensorReadingsProps } from "../interfaces";
import { import {
fakeSensorReading, fakeSensor fakeSensorReading, fakeSensor,
} from "../../../__test_support__/fake_state/resources"; } from "../../../__test_support__/fake_state/resources";
import moment from "moment"; import moment from "moment";
import { fakeTimeSettings } from "../../../__test_support__/fake_time_settings"; import { fakeTimeSettings } from "../../../__test_support__/fake_time_settings";

View File

@ -3,7 +3,7 @@ import { mount } from "enzyme";
import { SensorReadingsTable } from "../table"; import { SensorReadingsTable } from "../table";
import { SensorReadingsTableProps } from "../interfaces"; import { SensorReadingsTableProps } from "../interfaces";
import { import {
fakeSensorReading, fakeSensor fakeSensorReading, fakeSensor,
} from "../../../__test_support__/fake_state/resources"; } from "../../../__test_support__/fake_state/resources";
import { fakeTimeSettings } from "../../../__test_support__/fake_time_settings"; import { fakeTimeSettings } from "../../../__test_support__/fake_time_settings";

View File

@ -1,7 +1,7 @@
import * as React from "react"; import * as React from "react";
import { mount, shallow } from "enzyme"; import { mount, shallow } from "enzyme";
import { import {
TimePeriodSelection, getEndDate, DateDisplay TimePeriodSelection, getEndDate, DateDisplay,
} from "../time_period_selection"; } from "../time_period_selection";
import { fakeSensorReading } from "../../../__test_support__/fake_state/resources"; import { fakeSensorReading } from "../../../__test_support__/fake_state/resources";
import { TimePeriodSelectionProps, DateDisplayProps } from "../interfaces"; import { TimePeriodSelectionProps, DateDisplayProps } from "../interfaces";

View File

@ -10,7 +10,7 @@ const oneDay = 3600 * 24;
export const calcEndOfPeriod = ( export const calcEndOfPeriod = (
timePeriod: number, timePeriod: number,
endDate: number, endDate: number,
period: "current" | "previous" period: "current" | "previous",
) => endDate + oneDay ) => endDate + oneDay
- timePeriod * (period === "current" ? 0 : 1); - timePeriod * (period === "current" ? 0 : 1);

View File

@ -4,7 +4,7 @@ import { SensorReadingsProps, SensorReadingsState } from "./interfaces";
import { SensorReadingsTable } from "./table"; import { SensorReadingsTable } from "./table";
import { filterSensorReadings } from "./filter_readings"; import { filterSensorReadings } from "./filter_readings";
import { import {
TimePeriodSelection, DateDisplay, getEndDate TimePeriodSelection, DateDisplay, getEndDate,
} from "./time_period_selection"; } from "./time_period_selection";
import { LocationSelection, LocationDisplay } from "./location_selection"; import { LocationSelection, LocationDisplay } from "./location_selection";
import { SensorSelection } from "./sensor_selection"; import { SensorSelection } from "./sensor_selection";

View File

@ -46,7 +46,7 @@ const SensorReadingDisplay =
const classNames = [ const classNames = [
"sensor-reading-display", "sensor-reading-display",
moistureSensor, toolSensor, moistureSensor, toolSensor,
mode ? "analog" : "digital" mode ? "analog" : "digital",
]; ];
return <div className={classNames.join(" ")}> return <div className={classNames.join(" ")}>
{isNumber(value) && value >= 0 && {isNumber(value) && value >= 0 &&

View File

@ -4,7 +4,7 @@ import {
selectAllWebcamFeeds, selectAllWebcamFeeds,
selectAllSensors, selectAllSensors,
selectAllSensorReadings, selectAllSensorReadings,
maybeGetTimeSettings maybeGetTimeSettings,
} from "../resources/selectors"; } from "../resources/selectors";
import { Props } from "./interfaces"; import { Props } from "./interfaces";
import { validFwConfig, validFbosConfig } from "../util"; import { validFwConfig, validFbosConfig } from "../util";

View File

@ -23,7 +23,7 @@ describe("<Edit/>", () => {
p.feeds[0].body.name, p.feeds[0].body.name,
p.feeds[0].body.url, p.feeds[0].body.url,
p.feeds[1].body.name, p.feeds[1].body.name,
p.feeds[1].body.url p.feeds[1].body.url,
].map(text => ].map(text =>
expect(wrapper.html()).toContain(text)); expect(wrapper.html()).toContain(text));
}); });

View File

@ -6,7 +6,7 @@ import { ControlsPopupProps } from "./controls/move/interfaces";
import { commandErr } from "./devices/actions"; import { commandErr } from "./devices/actions";
import { mapPanelClassName } from "./farm_designer/map/util"; import { mapPanelClassName } from "./farm_designer/map/util";
import { import {
cameraBtnProps cameraBtnProps,
} from "./devices/components/fbos_settings/camera_selection"; } from "./devices/components/fbos_settings/camera_selection";
import { t } from "./i18next_wrapper"; import { t } from "./i18next_wrapper";

View File

@ -32,11 +32,11 @@ jest.mock("axios", () => ({ get: jest.fn(() => mockGetRelease) }));
import * as actions from "../actions"; import * as actions from "../actions";
import { import {
fakeFirmwareConfig, fakeFbosConfig fakeFirmwareConfig, fakeFbosConfig,
} from "../../__test_support__/fake_state/resources"; } from "../../__test_support__/fake_state/resources";
import { fakeState } from "../../__test_support__/fake_state"; import { fakeState } from "../../__test_support__/fake_state";
import { import {
changeStepSize, commandErr changeStepSize, commandErr,
} from "../actions"; } from "../actions";
import { Actions } from "../../constants"; import { Actions } from "../../constants";
import { buildResourceIndex } from "../../__test_support__/resource_index_builder"; import { buildResourceIndex } from "../../__test_support__/resource_index_builder";

View File

@ -7,7 +7,7 @@ import { Props } from "../interfaces";
import { auth } from "../../__test_support__/fake_state/token"; import { auth } from "../../__test_support__/fake_state/token";
import { bot } from "../../__test_support__/fake_state/bot"; import { bot } from "../../__test_support__/fake_state/bot";
import { import {
fakeDevice, buildResourceIndex, FAKE_RESOURCES fakeDevice, buildResourceIndex, FAKE_RESOURCES,
} from "../../__test_support__/resource_index_builder"; } from "../../__test_support__/resource_index_builder";
import { FarmbotOsSettings } from "../components/farmbot_os_settings"; import { FarmbotOsSettings } from "../components/farmbot_os_settings";
import { fakeTimeSettings } from "../../__test_support__/fake_time_settings"; import { fakeTimeSettings } from "../../__test_support__/fake_time_settings";

View File

@ -2,7 +2,7 @@ import {
fakeFbosConfig, fakeFbosConfig,
fakeImage, fakeImage,
fakeFarmwareEnv, fakeFarmwareEnv,
fakeWebAppConfig fakeWebAppConfig,
} from "../../__test_support__/fake_state/resources"; } from "../../__test_support__/fake_state/resources";
let mockFbosConfig: TaggedFbosConfig | undefined = fakeFbosConfig(); let mockFbosConfig: TaggedFbosConfig | undefined = fakeFbosConfig();

View File

@ -3,7 +3,7 @@ import {
lessThan, lessThan,
mcuParamValidator, mcuParamValidator,
OK, OK,
McuErrors McuErrors,
} from "../update_interceptor"; } from "../update_interceptor";
describe("greaterThan() and lessThan()", () => { describe("greaterThan() and lessThan()", () => {

View File

@ -3,13 +3,13 @@ import { success, warning, info, error } from "../toast/toast";
import { getDevice } from "../device"; import { getDevice } from "../device";
import { Everything } from "../interfaces"; import { Everything } from "../interfaces";
import { import {
GithubRelease, MoveRelProps, MinOsFeatureLookup, SourceFwConfig, Axis GithubRelease, MoveRelProps, MinOsFeatureLookup, SourceFwConfig, Axis,
} from "./interfaces"; } from "./interfaces";
import { Thunk } from "../redux/interfaces"; import { Thunk } from "../redux/interfaces";
import { import {
McuParams, TaggedFirmwareConfig, ParameterApplication, McuParams, TaggedFirmwareConfig, ParameterApplication,
ALLOWED_PIN_MODES, ALLOWED_PIN_MODES,
FirmwareHardware FirmwareHardware,
} from "farmbot"; } from "farmbot";
import { ControlPanelState } from "../devices/interfaces"; import { ControlPanelState } from "../devices/interfaces";
import { oneOf, versionOK, trim } from "../util"; import { oneOf, versionOK, trim } from "../util";
@ -144,7 +144,7 @@ export function sync(): Thunk {
export function execSequence( export function execSequence(
sequenceId: number | undefined, sequenceId: number | undefined,
bodyVariables?: ParameterApplication[] bodyVariables?: ParameterApplication[],
) { ) {
const noun = t("Sequence execution"); const noun = t("Sequence execution");
if (sequenceId) { if (sequenceId) {
@ -287,7 +287,7 @@ export function MCUFactoryReset() {
export function settingToggle( export function settingToggle(
key: ConfigKey, key: ConfigKey,
sourceFwConfig: SourceFwConfig, sourceFwConfig: SourceFwConfig,
displayAlert?: string | undefined displayAlert?: string | undefined,
) { ) {
return function (dispatch: Function, getState: () => Everything) { return function (dispatch: Function, getState: () => Everything) {
if (displayAlert) { alert(trim(displayAlert)); } if (displayAlert) { alert(trim(displayAlert)); }
@ -325,7 +325,7 @@ export function pinToggle(pin_number: number) {
} }
export function readPin( export function readPin(
pin_number: number, label: string, pin_mode: ALLOWED_PIN_MODES pin_number: number, label: string, pin_mode: ALLOWED_PIN_MODES,
) { ) {
const noun = t("Read pin"); const noun = t("Read pin");
return getDevice() return getDevice()

View File

@ -1,5 +1,5 @@
import { import {
axisTrackingStatus, disabledAxisMap, enabledAxisMap axisTrackingStatus, disabledAxisMap, enabledAxisMap,
} from "../axis_tracking_status"; } from "../axis_tracking_status";
import { bot } from "../../../__test_support__/fake_state/bot"; import { bot } from "../../../__test_support__/fake_state/bot";
@ -16,7 +16,7 @@ const expected =
{ {
"axis": "z", "axis": "z",
"disabled": true "disabled": true
} },
]; ];
describe("axisTrackingStatus()", () => { describe("axisTrackingStatus()", () => {

View File

@ -9,7 +9,7 @@ import { BotConfigInputBox, BotConfigInputBoxProps } from "../bot_config_input_b
import { fakeState } from "../../../__test_support__/fake_state"; import { fakeState } from "../../../__test_support__/fake_state";
import { fakeFbosConfig } from "../../../__test_support__/fake_state/resources"; import { fakeFbosConfig } from "../../../__test_support__/fake_state/resources";
import { import {
buildResourceIndex buildResourceIndex,
} from "../../../__test_support__/resource_index_builder"; } from "../../../__test_support__/resource_index_builder";
import { edit, save } from "../../../api/crud"; import { edit, save } from "../../../api/crud";

View File

@ -6,11 +6,11 @@ import { Actions } from "../../../constants";
import { bot } from "../../../__test_support__/fake_state/bot"; import { bot } from "../../../__test_support__/fake_state/bot";
import { panelState } from "../../../__test_support__/control_panel_state"; import { panelState } from "../../../__test_support__/control_panel_state";
import { import {
fakeFirmwareConfig fakeFirmwareConfig,
} from "../../../__test_support__/fake_state/resources"; } from "../../../__test_support__/fake_state/resources";
import { clickButton } from "../../../__test_support__/helpers"; import { clickButton } from "../../../__test_support__/helpers";
import { import {
buildResourceIndex buildResourceIndex,
} from "../../../__test_support__/resource_index_builder"; } from "../../../__test_support__/resource_index_builder";
import type { FirmwareConfig } from "farmbot/dist/resources/configs/firmware"; import type { FirmwareConfig } from "farmbot/dist/resources/configs/firmware";
import { Color } from "../../../ui"; import { Color } from "../../../ui";

View File

@ -5,7 +5,7 @@ jest.mock("../../actions", () => ({
import * as React from "react"; import * as React from "react";
import { mount } from "enzyme"; import { mount } from "enzyme";
import { import {
Highlight, HighlightProps, maybeHighlight, maybeOpenPanel, highlight Highlight, HighlightProps, maybeHighlight, maybeOpenPanel, highlight,
} from "../maybe_highlight"; } from "../maybe_highlight";
import { DeviceSetting } from "../../../constants"; import { DeviceSetting } from "../../../constants";
import { panelState } from "../../../__test_support__/control_panel_state"; import { panelState } from "../../../__test_support__/control_panel_state";

View File

@ -7,7 +7,7 @@ import { PinGuardMCUInputGroupProps } from "../interfaces";
import { bot } from "../../../__test_support__/fake_state/bot"; import { bot } from "../../../__test_support__/fake_state/bot";
import { settingToggle } from "../../actions"; import { settingToggle } from "../../actions";
import { import {
buildResourceIndex buildResourceIndex,
} from "../../../__test_support__/resource_index_builder"; } from "../../../__test_support__/resource_index_builder";
describe("<PinGuardMCUInputGroup/>", () => { describe("<PinGuardMCUInputGroup/>", () => {

View File

@ -5,10 +5,10 @@ import { mount, shallow } from "enzyme";
import { PinNumberDropdown } from "../pin_number_dropdown"; import { PinNumberDropdown } from "../pin_number_dropdown";
import { PinGuardMCUInputGroupProps } from "../interfaces"; import { PinGuardMCUInputGroupProps } from "../interfaces";
import { import {
buildResourceIndex buildResourceIndex,
} from "../../../__test_support__/resource_index_builder"; } from "../../../__test_support__/resource_index_builder";
import { import {
fakeFirmwareConfig, fakePeripheral fakeFirmwareConfig, fakePeripheral,
} from "../../../__test_support__/fake_state/resources"; } from "../../../__test_support__/fake_state/resources";
import { TaggedFirmwareConfig } from "farmbot"; import { TaggedFirmwareConfig } from "farmbot";
import { FBSelect } from "../../../ui"; import { FBSelect } from "../../../ui";

View File

@ -2,7 +2,7 @@ import { sourceFbosConfigValue, sourceFwConfigValue } from "../source_config_val
import { bot } from "../../../__test_support__/fake_state/bot"; import { bot } from "../../../__test_support__/fake_state/bot";
import { import {
fakeFbosConfig, fakeFbosConfig,
fakeFirmwareConfig fakeFirmwareConfig,
} from "../../../__test_support__/fake_state/resources"; } from "../../../__test_support__/fake_state/resources";
describe("sourceFbosConfigValue()", () => { describe("sourceFbosConfigValue()", () => {

View File

@ -15,7 +15,7 @@ import { fakeState } from "../../../../__test_support__/fake_state";
import { edit, save } from "../../../../api/crud"; import { edit, save } from "../../../../api/crud";
import { fakeFbosConfig } from "../../../../__test_support__/fake_state/resources"; import { fakeFbosConfig } from "../../../../__test_support__/fake_state/resources";
import { import {
buildResourceIndex buildResourceIndex,
} from "../../../../__test_support__/resource_index_builder"; } from "../../../../__test_support__/resource_index_builder";
describe("<AutoSyncRow/>", () => { describe("<AutoSyncRow/>", () => {

View File

@ -11,7 +11,7 @@ import { fakeState } from "../../../../__test_support__/fake_state";
import { edit, save } from "../../../../api/crud"; import { edit, save } from "../../../../api/crud";
import { fakeFbosConfig } from "../../../../__test_support__/fake_state/resources"; import { fakeFbosConfig } from "../../../../__test_support__/fake_state/resources";
import { import {
buildResourceIndex buildResourceIndex,
} from "../../../../__test_support__/resource_index_builder"; } from "../../../../__test_support__/resource_index_builder";
describe("<AutoUpdateRow/>", () => { describe("<AutoUpdateRow/>", () => {

View File

@ -9,15 +9,15 @@ import { BoardType } from "../board_type";
import { BoardTypeProps } from "../interfaces"; import { BoardTypeProps } from "../interfaces";
import { fakeState } from "../../../../__test_support__/fake_state"; import { fakeState } from "../../../../__test_support__/fake_state";
import { import {
fakeFbosConfig fakeFbosConfig,
} from "../../../../__test_support__/fake_state/resources"; } from "../../../../__test_support__/fake_state/resources";
import { import {
buildResourceIndex buildResourceIndex,
} from "../../../../__test_support__/resource_index_builder"; } from "../../../../__test_support__/resource_index_builder";
import { edit, save } from "../../../../api/crud"; import { edit, save } from "../../../../api/crud";
import { bot } from "../../../../__test_support__/fake_state/bot"; import { bot } from "../../../../__test_support__/fake_state/bot";
import { import {
fakeTimeSettings fakeTimeSettings,
} from "../../../../__test_support__/fake_time_settings"; } from "../../../../__test_support__/fake_time_settings";
describe("<BoardType/>", () => { describe("<BoardType/>", () => {

View File

@ -1,12 +1,12 @@
import { import {
sequence2ddi, mapStateToProps, RawBootSequenceSelector sequence2ddi, mapStateToProps, RawBootSequenceSelector,
} from "../boot_sequence_selector"; } from "../boot_sequence_selector";
import { import {
fakeSequence, fakeFbosConfig fakeSequence, fakeFbosConfig,
} from "../../../../__test_support__/fake_state/resources"; } from "../../../../__test_support__/fake_state/resources";
import { fakeState } from "../../../../__test_support__/fake_state"; import { fakeState } from "../../../../__test_support__/fake_state";
import { import {
buildResourceIndex buildResourceIndex,
} from "../../../../__test_support__/resource_index_builder"; } from "../../../../__test_support__/resource_index_builder";
import React from "react"; import React from "react";
import { mount } from "enzyme"; import { mount } from "enzyme";

View File

@ -11,7 +11,7 @@ import { FbosDetailsProps } from "../interfaces";
import { fakeFbosConfig } from "../../../../__test_support__/fake_state/resources"; import { fakeFbosConfig } from "../../../../__test_support__/fake_state/resources";
import { fakeState } from "../../../../__test_support__/fake_state"; import { fakeState } from "../../../../__test_support__/fake_state";
import { import {
buildResourceIndex, fakeDevice buildResourceIndex, fakeDevice,
} from "../../../../__test_support__/resource_index_builder"; } from "../../../../__test_support__/resource_index_builder";
import { fakeTimeSettings } from "../../../../__test_support__/fake_time_settings"; import { fakeTimeSettings } from "../../../../__test_support__/fake_time_settings";
import { updateConfig } from "../../../actions"; import { updateConfig } from "../../../actions";

View File

@ -8,7 +8,7 @@ import {
FirmwareHardwareStatusDetailsProps, FirmwareHardwareStatusDetails, FirmwareHardwareStatusDetailsProps, FirmwareHardwareStatusDetails,
FirmwareHardwareStatusIconProps, FirmwareHardwareStatusIcon, FirmwareHardwareStatusIconProps, FirmwareHardwareStatusIcon,
FirmwareHardwareStatusProps, FirmwareHardwareStatus, FirmwareHardwareStatusProps, FirmwareHardwareStatus,
FirmwareActions, FirmwareActionsProps FirmwareActions, FirmwareActionsProps,
} from "../firmware_hardware_status"; } from "../firmware_hardware_status";
import { bot } from "../../../../__test_support__/fake_state/bot"; import { bot } from "../../../../__test_support__/fake_state/bot";
import { clickButton } from "../../../../__test_support__/helpers"; import { clickButton } from "../../../../__test_support__/helpers";

View File

@ -16,7 +16,7 @@ import { fakeState } from "../../../../__test_support__/fake_state";
import { clickButton } from "../../../../__test_support__/helpers"; import { clickButton } from "../../../../__test_support__/helpers";
import { fakeFbosConfig } from "../../../../__test_support__/fake_state/resources"; import { fakeFbosConfig } from "../../../../__test_support__/fake_state/resources";
import { import {
buildResourceIndex buildResourceIndex,
} from "../../../../__test_support__/resource_index_builder"; } from "../../../../__test_support__/resource_index_builder";
import { edit, save } from "../../../../api/crud"; import { edit, save } from "../../../../api/crud";

View File

@ -8,7 +8,7 @@ import { BoardTypeProps } from "./interfaces";
import { t } from "../../../i18next_wrapper"; import { t } from "../../../i18next_wrapper";
import { FirmwareHardwareStatus } from "./firmware_hardware_status"; import { FirmwareHardwareStatus } from "./firmware_hardware_status";
import { import {
isFwHardwareValue, getFirmwareChoices, FIRMWARE_CHOICES_DDI isFwHardwareValue, getFirmwareChoices, FIRMWARE_CHOICES_DDI,
} from "../firmware_hardware_support"; } from "../firmware_hardware_support";
import { Highlight } from "../maybe_highlight"; import { Highlight } from "../maybe_highlight";
import { DeviceSetting } from "../../../constants"; import { DeviceSetting } from "../../../constants";

View File

@ -1,7 +1,7 @@
import * as React from "react"; import * as React from "react";
import { DropDownItem, Row, Col, FBSelect } from "../../../ui/index"; import { DropDownItem, Row, Col, FBSelect } from "../../../ui/index";
import { import {
CameraSelectionProps, CameraSelectionState CameraSelectionProps, CameraSelectionState,
} from "./interfaces"; } from "./interfaces";
import { info, success, error } from "../../../toast/toast"; import { info, success, error } from "../../../toast/toast";
import { getDevice } from "../../../device"; import { getDevice } from "../../../device";

View File

@ -41,7 +41,7 @@ interface ChipTemperatureDisplayProps {
/** RPI CPU temperature display row: label, temperature, indicator. */ /** RPI CPU temperature display row: label, temperature, indicator. */
export function ChipTemperatureDisplay( export function ChipTemperatureDisplay(
{ chip, temperature }: ChipTemperatureDisplayProps { chip, temperature }: ChipTemperatureDisplayProps,
): JSX.Element { ): JSX.Element {
return <div className="chip-temp-display"> return <div className="chip-temp-display">
<p> <p>
@ -60,7 +60,7 @@ interface WiFiStrengthDisplayProps {
/** WiFi signal strength display row: label, strength, indicator. */ /** WiFi signal strength display row: label, strength, indicator. */
export function WiFiStrengthDisplay( export function WiFiStrengthDisplay(
{ wifiStrength, wifiStrengthPercent, extraInfo }: WiFiStrengthDisplayProps { wifiStrength, wifiStrengthPercent, extraInfo }: WiFiStrengthDisplayProps,
): JSX.Element { ): JSX.Element {
const percent = wifiStrength const percent = wifiStrength
? Math.round(-0.0154 * wifiStrength ** 2 - 0.4 * wifiStrength + 98) ? Math.round(-0.0154 * wifiStrength ** 2 - 0.4 * wifiStrength + 98)
@ -180,7 +180,7 @@ interface CommitDisplayProps {
/** GitHub commit display row: label, commit link. */ /** GitHub commit display row: label, commit link. */
const CommitDisplay = ( const CommitDisplay = (
{ title, repo, commit }: CommitDisplayProps { title, repo, commit }: CommitDisplayProps,
): JSX.Element => { ): JSX.Element => {
const shortCommit = shortenCommit(commit); const shortCommit = shortenCommit(commit);
return <p> return <p>
@ -222,7 +222,7 @@ export interface BetaReleaseOptInButtonProps {
/** Label and toggle button for opting in to FBOS beta releases. */ /** Label and toggle button for opting in to FBOS beta releases. */
export const BetaReleaseOptIn = ( export const BetaReleaseOptIn = (
{ dispatch, sourceFbosConfig }: BetaReleaseOptInButtonProps { dispatch, sourceFbosConfig }: BetaReleaseOptInButtonProps,
): JSX.Element => { ): JSX.Element => {
const betaOptIn = sourceFbosConfig("update_channel" as ConfigurationName).value; const betaOptIn = sourceFbosConfig("update_channel" as ConfigurationName).value;
return <fieldset className={"os-release-channel"}> return <fieldset className={"os-release-channel"}>

View File

@ -4,7 +4,7 @@ import {
SaveFarmwareEnv, SaveFarmwareEnv,
ShouldDisplay, ShouldDisplay,
SourceFbosConfig, SourceFbosConfig,
UserEnv UserEnv,
} from "../../interfaces"; } from "../../interfaces";
import { import {
Alert, Alert,

View File

@ -61,7 +61,7 @@ export function downloadProgress(job: JobProgress | undefined) {
const getLatestVersion = ( const getLatestVersion = (
currentOSVersion: string | undefined, currentOSVersion: string | undefined,
currentBetaOSVersion: string | undefined, currentBetaOSVersion: string | undefined,
betaOptIn: boolean betaOptIn: boolean,
): string | undefined => { ): string | undefined => {
if (!betaOptIn) { return currentOSVersion; } if (!betaOptIn) { return currentOSVersion; }
switch (semverCompare(currentOSVersion || "", currentBetaOSVersion || "")) { switch (semverCompare(currentOSVersion || "", currentBetaOSVersion || "")) {
@ -90,7 +90,7 @@ const betaCommitsAreEqual = (
/** Determine the FBOS update button state. */ /** Determine the FBOS update button state. */
const compareWithBotVersion = ( const compareWithBotVersion = (
candidate: string | undefined, candidate: string | undefined,
installedVersion: string | undefined installedVersion: string | undefined,
): UpdateButton => { ): UpdateButton => {
if (!isString(installedVersion)) { return UpdateButton.none; } if (!isString(installedVersion)) { return UpdateButton.none; }
if (!isString(candidate)) { return UpdateButton.unknown; } if (!isString(candidate)) { return UpdateButton.unknown; }
@ -108,14 +108,14 @@ const compareWithBotVersion = (
/** Installed version equal to latest. */ /** Installed version equal to latest. */
const equalToLatest = ( const equalToLatest = (
latest: string | undefined, latest: string | undefined,
installedVersion: string | undefined installedVersion: string | undefined,
): boolean => ): boolean =>
isString(installedVersion) && isString(latest) && isString(installedVersion) && isString(latest) &&
semverCompare(installedVersion, latest) === SemverResult.EQUAL; semverCompare(installedVersion, latest) === SemverResult.EQUAL;
/** Color, text, and hover text for update button: release version status. */ /** Color, text, and hover text for update button: release version status. */
const buttonVersionStatus = const buttonVersionStatus =
({ bot, betaOptIn }: { bot: BotState, betaOptIn: boolean, }): ButtonProps => { ({ bot, betaOptIn }: { bot: BotState, betaOptIn: boolean }): ButtonProps => {
// Information about available releases. // Information about available releases.
const { currentOSVersion, currentBetaOSVersion, currentBetaOSCommit } = bot; const { currentOSVersion, currentBetaOSVersion, currentBetaOSCommit } = bot;
// Currently installed FBOS version data. // Currently installed FBOS version data.

View File

@ -5,7 +5,7 @@ export const isFwHardwareValue = (x?: unknown): x is FirmwareHardware => {
"arduino", "arduino",
"farmduino", "farmduino_k14", "farmduino_k15", "farmduino", "farmduino_k14", "farmduino_k15",
"express_k10", "express_k10",
"none" "none",
]; ];
return !!values.includes(x as FirmwareHardware); return !!values.includes(x as FirmwareHardware);
}; };

View File

@ -11,7 +11,7 @@ import { EndStops } from "./hardware_settings/endstops";
import { Motors } from "./hardware_settings/motors"; import { Motors } from "./hardware_settings/motors";
import { SpacePanelHeader } from "./hardware_settings/space_panel_header"; import { SpacePanelHeader } from "./hardware_settings/space_panel_header";
import { import {
HomingAndCalibration HomingAndCalibration,
} from "./hardware_settings/homing_and_calibration"; } from "./hardware_settings/homing_and_calibration";
import { Popover, Position } from "@blueprintjs/core"; import { Popover, Position } from "@blueprintjs/core";
import { FwParamExportMenu } from "./hardware_settings/export_menu"; import { FwParamExportMenu } from "./hardware_settings/export_menu";

View File

@ -1,6 +1,6 @@
import * as React from "react"; import * as React from "react";
import { import {
EncoderType, EncoderTypeProps, LOOKUP, findByType, isEncoderValue EncoderType, EncoderTypeProps, LOOKUP, findByType, isEncoderValue,
} from "../encoder_type"; } from "../encoder_type";
import { shallow } from "enzyme"; import { shallow } from "enzyme";
import { FBSelect } from "../../../../ui/index"; import { FBSelect } from "../../../../ui/index";

View File

@ -12,10 +12,10 @@ import { bot } from "../../../../__test_support__/fake_state/bot";
import { edit, save } from "../../../../api/crud"; import { edit, save } from "../../../../api/crud";
import { fakeState } from "../../../../__test_support__/fake_state"; import { fakeState } from "../../../../__test_support__/fake_state";
import { import {
fakeFirmwareConfig fakeFirmwareConfig,
} from "../../../../__test_support__/fake_state/resources"; } from "../../../../__test_support__/fake_state/resources";
import { import {
buildResourceIndex buildResourceIndex,
} from "../../../../__test_support__/resource_index_builder"; } from "../../../../__test_support__/resource_index_builder";
describe("<ErrorHandling />", () => { describe("<ErrorHandling />", () => {

View File

@ -1,10 +1,10 @@
import * as React from "react"; import * as React from "react";
import { mount } from "enzyme"; import { mount } from "enzyme";
import { import {
FwParamExportMenu, condenseFwConfig, uncondenseFwConfig FwParamExportMenu, condenseFwConfig, uncondenseFwConfig,
} from "../export_menu"; } from "../export_menu";
import { import {
fakeFirmwareConfig fakeFirmwareConfig,
} from "../../../../__test_support__/fake_state/resources"; } from "../../../../__test_support__/fake_state/resources";
describe("<FwParamExportMenu />", () => { describe("<FwParamExportMenu />", () => {

View File

@ -16,7 +16,7 @@ import { HomingAndCalibration } from "../homing_and_calibration";
import { bot } from "../../../../__test_support__/fake_state/bot"; import { bot } from "../../../../__test_support__/fake_state/bot";
import { updateMCU } from "../../../actions"; import { updateMCU } from "../../../actions";
import { import {
fakeFirmwareConfig fakeFirmwareConfig,
} from "../../../../__test_support__/fake_state/resources"; } from "../../../../__test_support__/fake_state/resources";
import { error, warning } from "../../../../toast/toast"; import { error, warning } from "../../../../toast/toast";
import { inputEvent } from "../../../../__test_support__/fake_html_events"; import { inputEvent } from "../../../../__test_support__/fake_html_events";

View File

@ -11,10 +11,10 @@ import { McuParamName } from "farmbot";
import { panelState } from "../../../../__test_support__/control_panel_state"; import { panelState } from "../../../../__test_support__/control_panel_state";
import { fakeState } from "../../../../__test_support__/fake_state"; import { fakeState } from "../../../../__test_support__/fake_state";
import { import {
fakeFirmwareConfig fakeFirmwareConfig,
} from "../../../../__test_support__/fake_state/resources"; } from "../../../../__test_support__/fake_state/resources";
import { import {
buildResourceIndex buildResourceIndex,
} from "../../../../__test_support__/resource_index_builder"; } from "../../../../__test_support__/resource_index_builder";
import { edit, save } from "../../../../api/crud"; import { edit, save } from "../../../../api/crud";
@ -37,7 +37,7 @@ describe("<Motors/>", () => {
it("renders the base case", () => { it("renders the base case", () => {
const wrapper = render(<Motors {...fakeProps()} />); const wrapper = render(<Motors {...fakeProps()} />);
["Enable 2nd X Motor", ["Enable 2nd X Motor",
"Max Speed (mm/s)" "Max Speed (mm/s)",
].map(string => ].map(string =>
expect(wrapper.text().toLowerCase()).toContain(string.toLowerCase())); expect(wrapper.text().toLowerCase()).toContain(string.toLowerCase()));
}); });

View File

@ -4,7 +4,7 @@ import { PinBindings } from "../pin_bindings";
import { PinBindingsProps } from "../../interfaces"; import { PinBindingsProps } from "../../interfaces";
import { panelState } from "../../../../__test_support__/control_panel_state"; import { panelState } from "../../../../__test_support__/control_panel_state";
import { import {
buildResourceIndex buildResourceIndex,
} from "../../../../__test_support__/resource_index_builder"; } from "../../../../__test_support__/resource_index_builder";
describe("<PinBindings />", () => { describe("<PinBindings />", () => {

View File

@ -19,7 +19,7 @@ const OPTIONS = [LOOKUP[Encoder.differential], LOOKUP[Encoder.quadrature]];
const KEYS: McuParamName[] = [ const KEYS: McuParamName[] = [
"encoder_type_x", "encoder_type_x",
"encoder_type_y", "encoder_type_y",
"encoder_type_z" "encoder_type_z",
]; ];
export function isEncoderValue(x: unknown): x is Encoder { export function isEncoderValue(x: unknown): x is Encoder {

View File

@ -90,7 +90,6 @@ export const uncondenseFwConfig =
Object.entries(obj).map(([subKey, value]) => { Object.entries(obj).map(([subKey, value]) => {
const fwConfigKey = subKey != "" ? `${key}_${subKey}` : key; const fwConfigKey = subKey != "" ? `${key}_${subKey}` : key;
uncondensedFwConfig[fwConfigKey] = value; uncondensedFwConfig[fwConfigKey] = value;
} }));
));
return uncondensedFwConfig; return uncondensedFwConfig;
}; };

View File

@ -1,6 +1,6 @@
import { import {
BotState, Xyz, SourceFwConfig, BotState, Xyz, SourceFwConfig,
ControlPanelState, Axis ControlPanelState, Axis,
} from "../interfaces"; } from "../interfaces";
import { McuParamName, McuParams, FirmwareHardware } from "farmbot/dist"; import { McuParamName, McuParams, FirmwareHardware } from "farmbot/dist";
import { IntegerSize } from "../../util"; import { IntegerSize } from "../../util";

View File

@ -4,7 +4,7 @@ import { McuInputBoxProps } from "../interfaces";
import { updateMCU } from "../actions"; import { updateMCU } from "../actions";
import { BlurableInput } from "../../ui/index"; import { BlurableInput } from "../../ui/index";
import { import {
clampUnsignedInteger, IntegerSize, getMaxInputFromIntSize clampUnsignedInteger, IntegerSize, getMaxInputFromIntSize,
} from "../../util"; } from "../../util";
import { isUndefined } from "lodash"; import { isUndefined } from "lodash";

View File

@ -4,10 +4,10 @@ import { updateMCU } from "../actions";
import { isNumber } from "lodash"; import { isNumber } from "lodash";
import { t } from "../../i18next_wrapper"; import { t } from "../../i18next_wrapper";
import { import {
pinDropdowns, celery2DropDown, PinGroupName, PERIPHERAL_HEADING pinDropdowns, celery2DropDown, PinGroupName, PERIPHERAL_HEADING,
} from "../../sequences/step_tiles/pin_and_peripheral_support"; } from "../../sequences/step_tiles/pin_and_peripheral_support";
import { import {
selectAllPeripherals, selectAllSavedPeripherals selectAllPeripherals, selectAllSavedPeripherals,
} from "../../resources/selectors"; } from "../../resources/selectors";
import { Dictionary, NamedPin, McuParamName } from "farmbot"; import { Dictionary, NamedPin, McuParamName } from "farmbot";
import { ResourceIndex } from "../../resources/interfaces"; import { ResourceIndex } from "../../resources/interfaces";

View File

@ -1,12 +1,12 @@
import { import {
Configuration, ConfigurationName, McuParams, McuParamName Configuration, ConfigurationName, McuParams, McuParamName,
} from "farmbot"; } from "farmbot";
import { SourceFbosConfig, SourceFwConfig } from "../interfaces"; import { SourceFbosConfig, SourceFwConfig } from "../interfaces";
import { FbosConfig } from "farmbot/dist/resources/configs/fbos"; import { FbosConfig } from "farmbot/dist/resources/configs/fbos";
import { FirmwareConfig } from "farmbot/dist/resources/configs/firmware"; import { FirmwareConfig } from "farmbot/dist/resources/configs/firmware";
export const sourceFbosConfigValue = export const sourceFbosConfigValue =
(apiConfig: FbosConfig | undefined, botConfig: Configuration (apiConfig: FbosConfig | undefined, botConfig: Configuration,
): SourceFbosConfig => ): SourceFbosConfig =>
(setting: ConfigurationName) => { (setting: ConfigurationName) => {
const apiValue = apiConfig && apiConfig[setting as keyof FbosConfig]; const apiValue = apiConfig && apiConfig[setting as keyof FbosConfig];
@ -18,7 +18,7 @@ export const sourceFbosConfigValue =
}; };
export const sourceFwConfigValue = export const sourceFwConfigValue =
(apiConfig: FirmwareConfig | undefined, botConfig: McuParams (apiConfig: FirmwareConfig | undefined, botConfig: McuParams,
): SourceFwConfig => ): SourceFwConfig =>
(setting: McuParamName) => { (setting: McuParamName) => {
const apiValue = apiConfig && apiConfig[setting]; const apiValue = apiConfig && apiConfig[setting];

View File

@ -8,7 +8,7 @@ import {
getTextPosition, getTextPosition,
getLineProps, getLineProps,
DiagramNodes, DiagramNodes,
getConnectionColor getConnectionColor,
} from "../diagram"; } from "../diagram";
import { Color } from "../../../ui/index"; import { Color } from "../../../ui/index";
import { svgMount } from "../../../__test_support__/svg_mount"; import { svgMount } from "../../../__test_support__/svg_mount";

View File

@ -4,10 +4,10 @@ import {
completePing, completePing,
startPing, startPing,
failPing, failPing,
PingDictionary PingDictionary,
} from "../qos"; } from "../qos";
import { import {
fakePings fakePings,
} from "../../../__test_support__/fake_state/pings"; } from "../../../__test_support__/fake_state/pings";
describe("QoS helpers", () => { describe("QoS helpers", () => {

Some files were not shown because too many files have changed in this diff Show More