Add "noUnusedLocals": true to tsconfig
parent
28ce2fa09b
commit
7cc6f8a345
|
@ -1,4 +1,3 @@
|
||||||
import * as React from "react";
|
|
||||||
import { noop } from "lodash";
|
import { noop } from "lodash";
|
||||||
import { Everything } from "../interfaces";
|
import { Everything } from "../interfaces";
|
||||||
import { location } from "./fake_state/location";
|
import { location } from "./fake_state/location";
|
||||||
|
@ -8,8 +7,6 @@ import { bot } from "./fake_state/bot";
|
||||||
import { config } from "./fake_state/config";
|
import { config } from "./fake_state/config";
|
||||||
import { draggable } from "./fake_state/draggable";
|
import { draggable } from "./fake_state/draggable";
|
||||||
import { resources } from "./fake_state/resources";
|
import { resources } from "./fake_state/resources";
|
||||||
import { createStore } from "redux";
|
|
||||||
import { rootReducer } from "../redux/root_reducer";
|
|
||||||
|
|
||||||
/** Factory function for empty state object. */
|
/** Factory function for empty state object. */
|
||||||
export function fakeState(dispatcher: Function = noop): Everything {
|
export function fakeState(dispatcher: Function = noop): Everything {
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
import { resourceReducer, emptyState } from "../resources/reducer";
|
import { resourceReducer, emptyState } from "../resources/reducer";
|
||||||
import { TaggedResource } from "../resources/tagged_resources";
|
import { TaggedResource } from "../resources/tagged_resources";
|
||||||
import * as _ from "lodash";
|
import * as _ from "lodash";
|
||||||
import { createStore } from "redux";
|
|
||||||
import { RestResources } from "../resources/interfaces";
|
|
||||||
import { ReduxAction } from "../redux/interfaces";
|
|
||||||
|
|
||||||
export let FAKE_RESOURCES: TaggedResource[] = [
|
export let FAKE_RESOURCES: TaggedResource[] = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,17 +1,9 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { ControlsPopup } from "../controls_popup";
|
import { ControlsPopup } from "../controls_popup";
|
||||||
import { mount } from "enzyme";
|
import { mount } from "enzyme";
|
||||||
import { State } from "../controls_popup";
|
|
||||||
import { DirectionButton } from "../controls/direction_button";
|
|
||||||
|
|
||||||
describe("<ControlsPopup />", () => {
|
describe("<ControlsPopup />", () => {
|
||||||
let wrapper = mount(<ControlsPopup dispatch={jest.fn()} />);
|
let wrapper = mount(<ControlsPopup dispatch={jest.fn()} />);
|
||||||
let button = mount(<DirectionButton
|
|
||||||
axis="x"
|
|
||||||
direction="left"
|
|
||||||
isInverted={false}
|
|
||||||
steps={1000}
|
|
||||||
/>);
|
|
||||||
|
|
||||||
it("Has a false initial state", () => {
|
it("Has a false initial state", () => {
|
||||||
expect(wrapper.state("isOpen")).toBeFalsy();
|
expect(wrapper.state("isOpen")).toBeFalsy();
|
||||||
|
|
|
@ -2,7 +2,6 @@ import {
|
||||||
buildResourceIndex,
|
buildResourceIndex,
|
||||||
FAKE_RESOURCES
|
FAKE_RESOURCES
|
||||||
} from "../__test_support__/resource_index_builder";
|
} from "../__test_support__/resource_index_builder";
|
||||||
import { betterCompact } from "../util";
|
|
||||||
import { TaggedFarmEvent } from "../resources/tagged_resources";
|
import { TaggedFarmEvent } from "../resources/tagged_resources";
|
||||||
|
|
||||||
const STUB_RESOURCE: TaggedFarmEvent = {
|
const STUB_RESOURCE: TaggedFarmEvent = {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { deleteUser } from "../actions";
|
|
||||||
import { API } from "../../api/api";
|
import { API } from "../../api/api";
|
||||||
import * as moxios from "moxios";
|
import * as moxios from "moxios";
|
||||||
|
import { deleteUser } from "../actions";
|
||||||
|
|
||||||
describe("deleteUser()", () => {
|
describe("deleteUser()", () => {
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
|
@ -20,7 +20,7 @@ describe("deleteUser()", () => {
|
||||||
let dispatch = jest.fn();
|
let dispatch = jest.fn();
|
||||||
let getState = jest.fn();
|
let getState = jest.fn();
|
||||||
getState.mockImplementation(() => ({ auth: {} }));
|
getState.mockImplementation(() => ({ auth: {} }));
|
||||||
let result = thunk(dispatch, getState);
|
thunk(dispatch, getState);
|
||||||
moxios.wait(function () {
|
moxios.wait(function () {
|
||||||
let request = moxios.requests.mostRecent();
|
let request = moxios.requests.mostRecent();
|
||||||
request.respondWith({
|
request.respondWith({
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { AuthState, User } from "../auth/interfaces";
|
import { User } from "../auth/interfaces";
|
||||||
import { TaggedUser } from "../resources/tagged_resources";
|
import { TaggedUser } from "../resources/tagged_resources";
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
|
|
|
@ -17,7 +17,6 @@ import { ResourceIndex } from "../resources/interfaces";
|
||||||
import { SequenceBodyItem } from "farmbot/dist";
|
import { SequenceBodyItem } from "farmbot/dist";
|
||||||
import * as _ from "lodash";
|
import * as _ from "lodash";
|
||||||
import { Actions } from "../constants";
|
import { Actions } from "../constants";
|
||||||
let WHOAH = "COOL";
|
|
||||||
|
|
||||||
export function edit(tr: TaggedResource, changes: Partial<typeof tr.body>):
|
export function edit(tr: TaggedResource, changes: Partial<typeof tr.body>):
|
||||||
ReduxAction<EditResourceParams> {
|
ReduxAction<EditResourceParams> {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import * as React from "react";
|
|
||||||
import { mount } from "enzyme";
|
import { mount } from "enzyme";
|
||||||
import { AxisDisplayGroup } from "../axis_display_group";
|
import { AxisDisplayGroup } from "../axis_display_group";
|
||||||
import { bot } from "../../__test_support__/fake_state/bot";
|
import { bot } from "../../__test_support__/fake_state/bot";
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { isNaN } from "lodash";
|
import { AxisInputBoxProps } from "./interfaces";
|
||||||
import { AxisInputBoxProps, AxisInputBoxState } from "./interfaces";
|
|
||||||
import { Col, BlurableInput } from "../ui/index";
|
import { Col, BlurableInput } from "../ui/index";
|
||||||
import { isUndefined } from "lodash";
|
import { isUndefined } from "lodash";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { connect } from "react-redux";
|
|
||||||
|
|
||||||
import { DirectionButton } from "./controls/direction_button";
|
import { DirectionButton } from "./controls/direction_button";
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { Farmbot } from "farmbot";
|
import { Farmbot } from "farmbot";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import * as Axios from "axios";
|
|
||||||
import * as _ from "lodash";
|
import * as _ from "lodash";
|
||||||
import { success, warning, info, error } from "farmbot-toastr";
|
import { success, warning, info, error } from "farmbot-toastr";
|
||||||
import { devices } from "../device";
|
import { devices } from "../device";
|
||||||
|
@ -145,7 +144,6 @@ export let saveAccountChanges: Thunk = function (dispatch, getState) {
|
||||||
};
|
};
|
||||||
|
|
||||||
let commandErr = (noun = "Command") => () => {
|
let commandErr = (noun = "Command") => () => {
|
||||||
let msg = noun + " request failed.";
|
|
||||||
console.info("Took longer than 6 seconds: " + noun);
|
console.info("Took longer than 6 seconds: " + noun);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -373,10 +371,10 @@ const TOAST: ALLOWED_CHANNEL_NAMES = "toast";
|
||||||
|
|
||||||
function maybeShowLog(log: Log) {
|
function maybeShowLog(log: Log) {
|
||||||
let chanList = _.get(log, CHANNELS, ["ERROR FETCHING CHANNELS"]);
|
let chanList = _.get(log, CHANNELS, ["ERROR FETCHING CHANNELS"]);
|
||||||
let t = log.meta.type as ALLOWED_MESSAGE_TYPES;
|
let m = log.meta.type as ALLOWED_MESSAGE_TYPES;
|
||||||
const TITLE = "New message from bot";
|
const TITLE = "New message from bot";
|
||||||
if (chanList.includes(TOAST)) {
|
if (chanList.includes(TOAST)) {
|
||||||
switch (t) {
|
switch (m) {
|
||||||
case "success":
|
case "success":
|
||||||
return success(log.message, TITLE);
|
return success(log.message, TITLE);
|
||||||
case "busy":
|
case "busy":
|
||||||
|
|
|
@ -18,9 +18,9 @@ describe("<HomingRow />", () => {
|
||||||
it("calls device", () => {
|
it("calls device", () => {
|
||||||
let { mock } = devices.current.calibrate as jest.Mock<{}>;
|
let { mock } = devices.current.calibrate as jest.Mock<{}>;
|
||||||
let result = mount(<CalibrationRow hardware={bot.hardware.mcu_params} />);
|
let result = mount(<CalibrationRow hardware={bot.hardware.mcu_params} />);
|
||||||
let thunkx = result.find("LockableButton").at(0).simulate("click");
|
result.find("LockableButton").at(0).simulate("click");
|
||||||
let thunky = result.find("LockableButton").at(1).simulate("click");
|
result.find("LockableButton").at(1).simulate("click");
|
||||||
let thunkz = result.find("LockableButton").at(2).simulate("click");
|
result.find("LockableButton").at(2).simulate("click");
|
||||||
expect(mock.calls.length).toEqual(2);
|
expect(mock.calls.length).toEqual(2);
|
||||||
expect(mock.calls[0][0].axis).toEqual("x");
|
expect(mock.calls[0][0].axis).toEqual("x");
|
||||||
expect(mock.calls[1][0].axis).toEqual("y");
|
expect(mock.calls[1][0].axis).toEqual("y");
|
||||||
|
|
|
@ -31,9 +31,9 @@ describe("<HomingRow />", () => {
|
||||||
it("calls device", () => {
|
it("calls device", () => {
|
||||||
let { mock } = devices.current.findHome as jest.Mock<{}>;
|
let { mock } = devices.current.findHome as jest.Mock<{}>;
|
||||||
let result = mount(<HomingRow hardware={bot.hardware.mcu_params} />);
|
let result = mount(<HomingRow hardware={bot.hardware.mcu_params} />);
|
||||||
let thunkx = result.find("LockableButton").at(0).simulate("click");
|
result.find("LockableButton").at(0).simulate("click");
|
||||||
let thunky = result.find("LockableButton").at(1).simulate("click");
|
result.find("LockableButton").at(1).simulate("click");
|
||||||
let thunkz = result.find("LockableButton").at(2).simulate("click");
|
result.find("LockableButton").at(2).simulate("click");
|
||||||
expect(mock.calls.length).toEqual(2);
|
expect(mock.calls.length).toEqual(2);
|
||||||
expect(mock.calls[0][0].axis).toEqual("x");
|
expect(mock.calls[0][0].axis).toEqual("x");
|
||||||
expect(mock.calls[1][0].axis).toEqual("y");
|
expect(mock.calls[1][0].axis).toEqual("y");
|
||||||
|
|
|
@ -8,7 +8,6 @@ jest.mock("../../../device", () => ({
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { mount } from "enzyme";
|
import { mount } from "enzyme";
|
||||||
import { ZeroRow } from "../zero_row";
|
import { ZeroRow } from "../zero_row";
|
||||||
import { bot } from "../../../__test_support__/fake_state/bot";
|
|
||||||
import { devices } from "../../../device";
|
import { devices } from "../../../device";
|
||||||
|
|
||||||
describe("<HomingRow />", () => {
|
describe("<HomingRow />", () => {
|
||||||
|
@ -18,9 +17,9 @@ describe("<HomingRow />", () => {
|
||||||
it("calls device", () => {
|
it("calls device", () => {
|
||||||
let { mock } = devices.current.setZero as jest.Mock<{}>;
|
let { mock } = devices.current.setZero as jest.Mock<{}>;
|
||||||
let result = mount(<ZeroRow />);
|
let result = mount(<ZeroRow />);
|
||||||
let thunkx = result.find("ZeroButton").at(0).simulate("click");
|
result.find("ZeroButton").at(0).simulate("click");
|
||||||
let thunky = result.find("ZeroButton").at(1).simulate("click");
|
result.find("ZeroButton").at(1).simulate("click");
|
||||||
let thunkz = result.find("ZeroButton").at(2).simulate("click");
|
result.find("ZeroButton").at(2).simulate("click");
|
||||||
expect(mock.calls.length).toEqual(3);
|
expect(mock.calls.length).toEqual(3);
|
||||||
expect(mock.calls[0][0]).toEqual("x");
|
expect(mock.calls[0][0]).toEqual("x");
|
||||||
expect(mock.calls[1][0]).toEqual("y");
|
expect(mock.calls[1][0]).toEqual("y");
|
||||||
|
|
|
@ -9,7 +9,6 @@ export function BooleanMCUInputGroup(props: BooleanMCUInputGroupProps) {
|
||||||
|
|
||||||
let {
|
let {
|
||||||
bot,
|
bot,
|
||||||
dispatch,
|
|
||||||
tooltip,
|
tooltip,
|
||||||
name,
|
name,
|
||||||
x,
|
x,
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { t } from "i18next";
|
|
||||||
import { MCUFactoryReset } from "../actions";
|
import { MCUFactoryReset } from "../actions";
|
||||||
import { Widget, WidgetHeader, WidgetBody } from "../../ui/index";
|
import { Widget, WidgetHeader, WidgetBody } from "../../ui/index";
|
||||||
import { HardwareSettingsProps } from "../interfaces";
|
import { HardwareSettingsProps } from "../interfaces";
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import { BotStateTree } from "farmbot";
|
import { BotStateTree } from "farmbot";
|
||||||
import {
|
import {
|
||||||
ALLOWED_MESSAGE_TYPES,
|
|
||||||
McuParamName,
|
McuParamName,
|
||||||
ConfigurationName,
|
ConfigurationName,
|
||||||
Dictionary,
|
Dictionary,
|
||||||
|
@ -34,17 +33,6 @@ export interface DeviceAccountSettings {
|
||||||
name: string;
|
name: string;
|
||||||
webcam_url?: string;
|
webcam_url?: string;
|
||||||
timezone?: string | undefined;
|
timezone?: string | undefined;
|
||||||
};
|
|
||||||
|
|
||||||
/** Meta information about a log message. */
|
|
||||||
interface Meta {
|
|
||||||
type: ALLOWED_MESSAGE_TYPES;
|
|
||||||
/** Bot Position X */
|
|
||||||
x: number | undefined;
|
|
||||||
/** Bot Position Y */
|
|
||||||
y: number | undefined;
|
|
||||||
/** Bot Position Z */
|
|
||||||
z: number | undefined;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BotState {
|
export interface BotState {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/// <reference path="../typings/index.d.ts" />
|
/// <reference path="../typings/index.d.ts" />
|
||||||
import * as React from "react";
|
|
||||||
import { RootComponent } from "./routes";
|
import { RootComponent } from "./routes";
|
||||||
import { store } from "./redux/store";
|
import { store } from "./redux/store";
|
||||||
import { ready } from "./config/actions";
|
import { ready } from "./config/actions";
|
||||||
|
|
|
@ -3,7 +3,6 @@ import { fakeFarmEvent, fakeSequence } from "../../../__test_support__/fake_stat
|
||||||
import { mount } from "enzyme";
|
import { mount } from "enzyme";
|
||||||
import { EditFEForm, EditFEProps, FarmEventViewModel, recombine } from "../edit_fe_form";
|
import { EditFEForm, EditFEProps, FarmEventViewModel, recombine } from "../edit_fe_form";
|
||||||
import { isString } from "lodash";
|
import { isString } from "lodash";
|
||||||
import { TightlyCoupledFarmEventDropDown } from "../map_state_to_props_add_edit";
|
|
||||||
|
|
||||||
describe("<FarmEventForm/>", () => {
|
describe("<FarmEventForm/>", () => {
|
||||||
let props = (): EditFEForm["props"] => ({
|
let props = (): EditFEForm["props"] => ({
|
||||||
|
|
|
@ -2,7 +2,6 @@ import * as React from "react";
|
||||||
import { RepeatFormProps, FarmEventRepeatForm } from "../farm_event_repeat_form";
|
import { RepeatFormProps, FarmEventRepeatForm } from "../farm_event_repeat_form";
|
||||||
import { betterMerge } from "../../../util";
|
import { betterMerge } from "../../../util";
|
||||||
import { shallow, ShallowWrapper, render } from "enzyme";
|
import { shallow, ShallowWrapper, render } from "enzyme";
|
||||||
import { FBSelectProps } from "../../../ui/new_fb_select";
|
|
||||||
import { get } from "lodash";
|
import { get } from "lodash";
|
||||||
|
|
||||||
const DEFAULTS: RepeatFormProps = {
|
const DEFAULTS: RepeatFormProps = {
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
import { fakeState } from "../../../__test_support__/fake_state";
|
|
||||||
import { mapResourcesToCalendar } from "../map_state_to_props";
|
import { mapResourcesToCalendar } from "../map_state_to_props";
|
||||||
import { ResourceIndex } from "../../../resources/interfaces";
|
|
||||||
import { buildResourceIndex } from "../../../__test_support__/resource_index_builder";
|
import { buildResourceIndex } from "../../../__test_support__/resource_index_builder";
|
||||||
import { TaggedResource } from "../../../resources/tagged_resources";
|
import { TaggedResource } from "../../../resources/tagged_resources";
|
||||||
import * as moment from "moment";
|
|
||||||
|
|
||||||
describe("mapResourcesToCalendar()", () => {
|
describe("mapResourcesToCalendar()", () => {
|
||||||
it("returns a `Calendar` instance when given a resource index and unix time.",
|
it("returns a `Calendar` instance when given a resource index and unix time.",
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import { maybeWarnAboutMissedTasks } from "../util";
|
|
||||||
|
|
||||||
describe("utils", () => {
|
describe("utils", () => {
|
||||||
it("warns about missed tasks", () => {
|
it("warns about missed tasks", () => {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { Calendar } from "../index";
|
import { Calendar } from "../index";
|
||||||
import * as moment from "moment";
|
|
||||||
import { occurrence } from "../occurrence";
|
import { occurrence } from "../occurrence";
|
||||||
import {
|
import {
|
||||||
TIME,
|
TIME,
|
||||||
|
|
|
@ -54,7 +54,6 @@ describe("scheduler", () => {
|
||||||
"repeat": 2,
|
"repeat": 2,
|
||||||
"time_unit": "daily",
|
"time_unit": "daily",
|
||||||
};
|
};
|
||||||
let now = moment("2017-08-01T19:22:38.502Z");
|
|
||||||
let intervalSeconds = farmEventIntervalSeconds(fakeEvent.repeat,
|
let intervalSeconds = farmEventIntervalSeconds(fakeEvent.repeat,
|
||||||
fakeEvent.time_unit as TimeUnit);
|
fakeEvent.time_unit as TimeUnit);
|
||||||
let result = scheduler({
|
let result = scheduler({
|
||||||
|
@ -85,7 +84,6 @@ it("schedules a FarmEvent", () => {
|
||||||
"repeat": 2,
|
"repeat": 2,
|
||||||
"time_unit": "daily",
|
"time_unit": "daily",
|
||||||
};
|
};
|
||||||
let now = moment("2017-08-01T19:22:38.502Z");
|
|
||||||
const EXPECTED = [
|
const EXPECTED = [
|
||||||
moment("2017-08-01T17:30:00.000Z"),
|
moment("2017-08-01T17:30:00.000Z"),
|
||||||
moment("2017-08-03T17:30:00.000Z"),
|
moment("2017-08-03T17:30:00.000Z"),
|
||||||
|
|
|
@ -3,13 +3,6 @@ import { CalendarOccurrence, CalendarDay } from "../../interfaces";
|
||||||
import * as moment from "moment";
|
import * as moment from "moment";
|
||||||
import * as _ from "lodash";
|
import * as _ from "lodash";
|
||||||
|
|
||||||
interface CalendarData {
|
|
||||||
sortKey: number;
|
|
||||||
month: string;
|
|
||||||
day: number;
|
|
||||||
items: CalendarOccurrence[]
|
|
||||||
}
|
|
||||||
|
|
||||||
export class Calendar {
|
export class Calendar {
|
||||||
/** We sort by this attribute. Left as const so that the comiler can catch
|
/** We sort by this attribute. Left as const so that the comiler can catch
|
||||||
* name changes. */
|
* name changes. */
|
||||||
|
|
|
@ -53,11 +53,6 @@ const LOOKUP: Record<TimeUnit, unitOfTime.Base> = {
|
||||||
"yearly": "years",
|
"yearly": "years",
|
||||||
};
|
};
|
||||||
|
|
||||||
interface ConversionProps {
|
|
||||||
repeat: number;
|
|
||||||
time_unit: TimeUnit;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** GIVEN: A time unit (hourly, weekly, etc) and a repeat (number)
|
/** GIVEN: A time unit (hourly, weekly, etc) and a repeat (number)
|
||||||
* RETURNS: Number of seconds for interval.
|
* RETURNS: Number of seconds for interval.
|
||||||
* EXAMPLE: f(2, "minutely") => 120;
|
* EXAMPLE: f(2, "minutely") => 120;
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
import * as moment from "moment";
|
import { FarmEventWithExecutable } from "./interfaces";
|
||||||
import {
|
|
||||||
NewCalendarItem,
|
|
||||||
FarmEventWithSequence,
|
|
||||||
FarmEventWithExecutable,
|
|
||||||
FarmEventWithRegimen
|
|
||||||
} from "./interfaces";
|
|
||||||
import { ResourceIndex } from "../../../resources/interfaces";
|
import { ResourceIndex } from "../../../resources/interfaces";
|
||||||
import {
|
import {
|
||||||
selectAllFarmEvents,
|
selectAllFarmEvents,
|
||||||
|
|
|
@ -30,7 +30,7 @@ import {
|
||||||
import { DropDownItem } from "../../ui/fb_select";
|
import { DropDownItem } from "../../ui/fb_select";
|
||||||
import { history } from "../../history";
|
import { history } from "../../history";
|
||||||
// TIL: https://stackoverflow.com/a/24900248/1064917
|
// TIL: https://stackoverflow.com/a/24900248/1064917
|
||||||
import { betterMerge, fancyDebug } from "../../util";
|
import { betterMerge } from "../../util";
|
||||||
import { maybeWarnAboutMissedTasks } from "./util";
|
import { maybeWarnAboutMissedTasks } from "./util";
|
||||||
import { TzWarning } from "./tz_warning";
|
import { TzWarning } from "./tz_warning";
|
||||||
import { FarmEventRepeatForm } from "./farm_event_repeat_form";
|
import { FarmEventRepeatForm } from "./farm_event_repeat_form";
|
||||||
|
|
|
@ -2,7 +2,6 @@ import * as React from "react";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { Row, Col, BlurableInput, DropDownItem } from "../../ui/index";
|
import { Row, Col, BlurableInput, DropDownItem } from "../../ui/index";
|
||||||
import { FBSelect } from "../../ui/new_fb_select";
|
import { FBSelect } from "../../ui/new_fb_select";
|
||||||
import { betterMerge } from "../../util";
|
|
||||||
import { repeatOptions } from "./map_state_to_props_add_edit";
|
import { repeatOptions } from "./map_state_to_props_add_edit";
|
||||||
import { keyBy } from "lodash";
|
import { keyBy } from "lodash";
|
||||||
import { TimeUnit } from "../interfaces";
|
import { TimeUnit } from "../interfaces";
|
||||||
|
|
|
@ -2,10 +2,9 @@ import * as React from "react";
|
||||||
import { Link } from "react-router";
|
import { Link } from "react-router";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { Row, Col } from "../../ui";
|
import { Row } from "../../ui";
|
||||||
import { mapStateToProps } from "./map_state_to_props";
|
import { mapStateToProps } from "./map_state_to_props";
|
||||||
import { FarmEventProps, CalendarOccurrence } from "../interfaces";
|
import { FarmEventProps, CalendarOccurrence } from "../interfaces";
|
||||||
import { FBSelect } from "../../ui/new_fb_select";
|
|
||||||
import * as _ from "lodash";
|
import * as _ from "lodash";
|
||||||
|
|
||||||
export class PureFarmEvents extends React.Component<FarmEventProps, {}> {
|
export class PureFarmEvents extends React.Component<FarmEventProps, {}> {
|
||||||
|
|
|
@ -7,11 +7,10 @@ import { occurrence } from "./calendar/occurrence";
|
||||||
import { findSequenceById } from "../../resources/selectors";
|
import { findSequenceById } from "../../resources/selectors";
|
||||||
import { ResourceIndex } from "../../resources/interfaces";
|
import { ResourceIndex } from "../../resources/interfaces";
|
||||||
import { FarmEventWithRegimen, FarmEventWithSequence } from "./calendar/interfaces";
|
import { FarmEventWithRegimen, FarmEventWithSequence } from "./calendar/interfaces";
|
||||||
import { scheduler, farmEventIntervalSeconds, scheduleForFarmEvent } from "./calendar/scheduler";
|
import { scheduleForFarmEvent } from "./calendar/scheduler";
|
||||||
|
|
||||||
/** Prepares a FarmEvent[] for use with <FBSelect /> */
|
/** Prepares a FarmEvent[] for use with <FBSelect /> */
|
||||||
export function mapStateToProps(state: Everything): FarmEventProps {
|
export function mapStateToProps(state: Everything): FarmEventProps {
|
||||||
let x = joinFarmEventsToExecutable(state.resources.index);
|
|
||||||
let push = (state && state.router && state.router.push) || (() => { });
|
let push = (state && state.router && state.router.push) || (() => { });
|
||||||
let calendar = mapResourcesToCalendar(state.resources.index, moment.now());
|
let calendar = mapResourcesToCalendar(state.resources.index, moment.now());
|
||||||
let calendarRows = calendar.getAll();
|
let calendarRows = calendar.getAll();
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import { TaggedFarmEvent } from "../../resources/tagged_resources";
|
import { TaggedFarmEvent } from "../../resources/tagged_resources";
|
||||||
import { GetState } from "../../redux/interfaces";
|
import { GetState } from "../../redux/interfaces";
|
||||||
import { findRegimenById } from "../../resources/selectors";
|
|
||||||
import * as moment from "moment";
|
import * as moment from "moment";
|
||||||
import * as _ from "lodash";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PROBLEMS SOLVED:
|
* PROBLEMS SOLVED:
|
||||||
|
@ -17,13 +15,12 @@ import * as _ from "lodash";
|
||||||
*/
|
*/
|
||||||
export function maybeWarnAboutMissedTasks(tfe: TaggedFarmEvent, cb: Function) {
|
export function maybeWarnAboutMissedTasks(tfe: TaggedFarmEvent, cb: Function) {
|
||||||
return function (dispatch: Function, getState: GetState) {
|
return function (dispatch: Function, getState: GetState) {
|
||||||
let state = getState();
|
|
||||||
let fe = tfe.body;
|
let fe = tfe.body;
|
||||||
// STEP 1: Only do this check if it is a Regimen -
|
// STEP 1: Only do this check if it is a Regimen -
|
||||||
// sequences don't have this issue.
|
// sequences don't have this issue.
|
||||||
if (fe.executable_type === "Regimen") {
|
if (fe.executable_type === "Regimen") {
|
||||||
var NOW = moment();
|
let NOW = moment();
|
||||||
var START_TIME = moment(fe.start_time);
|
let START_TIME = moment(fe.start_time);
|
||||||
let TIMEFMT = "YYYY-MM-DD";
|
let TIMEFMT = "YYYY-MM-DD";
|
||||||
|
|
||||||
// STEP 2: Continue checking if the farm event is supposed to run today.
|
// STEP 2: Continue checking if the farm event is supposed to run today.
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Props } from "../interfaces";
|
|
||||||
import { getXYFromQuadrant } from "./util";
|
import { getXYFromQuadrant } from "./util";
|
||||||
import { BotOriginQuadrant } from "../interfaces";
|
import { BotOriginQuadrant } from "../interfaces";
|
||||||
import { BotState } from "../../devices/interfaces";
|
import { BotState } from "../../devices/interfaces";
|
||||||
|
@ -16,7 +15,7 @@ export class VirtualFarmBot extends
|
||||||
React.Component<VFBProps, Partial<VFBState>> {
|
React.Component<VFBProps, Partial<VFBState>> {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let { x, y, z } = this.props.bot.hardware.location_data.position;
|
let { x, y } = this.props.bot.hardware.location_data.position;
|
||||||
let { quadrant } = this.props;
|
let { quadrant } = this.props;
|
||||||
let { qx, qy } = getXYFromQuadrant((x || 0), (y || 0), quadrant);
|
let { qx, qy } = getXYFromQuadrant((x || 0), (y || 0), quadrant);
|
||||||
return <g>
|
return <g>
|
||||||
|
|
|
@ -64,7 +64,7 @@ export class GardenMap extends
|
||||||
if (el && map && page) {
|
if (el && map && page) {
|
||||||
let zoomLvl = parseFloat(window.getComputedStyle(map).zoom || DRAG_ERROR);
|
let zoomLvl = parseFloat(window.getComputedStyle(map).zoom || DRAG_ERROR);
|
||||||
let { pageX, pageY } = e;
|
let { pageX, pageY } = e;
|
||||||
let box = el.getBoundingClientRect();
|
// let box = el.getBoundingClientRect();
|
||||||
let crop = history.getCurrentLocation().pathname.split("/")[5];
|
let crop = history.getCurrentLocation().pathname.split("/")[5];
|
||||||
let OFEntry = this.findCrop(crop);
|
let OFEntry = this.findCrop(crop);
|
||||||
let params: ScreenToGardenParams = {
|
let params: ScreenToGardenParams = {
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { ImageWorkspace } from "../weed_detector/image_workspace";
|
||||||
import { ToolTips } from "../../constants";
|
import { ToolTips } from "../../constants";
|
||||||
import { envSave } from "../weed_detector/remote_env/actions";
|
import { envSave } from "../weed_detector/remote_env/actions";
|
||||||
import { WDENVKey } from "../weed_detector/remote_env/interfaces";
|
import { WDENVKey } from "../weed_detector/remote_env/interfaces";
|
||||||
import { devices } from "../../device";
|
|
||||||
import { selectImage } from "../images/actions";
|
import { selectImage } from "../images/actions";
|
||||||
import { calibrate, scanImage } from "./actions";
|
import { calibrate, scanImage } from "./actions";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { TaggedImage } from "../../resources/tagged_resources";
|
import { TaggedImage } from "../../resources/tagged_resources";
|
||||||
import { SyncStatus, Dictionary, FarmwareManifest } from "farmbot/dist";
|
|
||||||
import { WD_ENV } from "../weed_detector/remote_env/interfaces";
|
import { WD_ENV } from "../weed_detector/remote_env/interfaces";
|
||||||
|
|
||||||
export interface CameraCalibrationState {
|
export interface CameraCalibrationState {
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import "../../../unmock_i18next";
|
import "../../../unmock_i18next";
|
||||||
import * as React from "react";
|
|
||||||
import { ImageFlipper } from "../image_flipper";
|
import { ImageFlipper } from "../image_flipper";
|
||||||
import { fakeImages } from "../../../__test_support__/fake_state/images";
|
import { fakeImages } from "../../../__test_support__/fake_state/images";
|
||||||
import * as freeze from "deep-freeze";
|
|
||||||
import { TaggedImage } from "../../../resources/tagged_resources";
|
import { TaggedImage } from "../../../resources/tagged_resources";
|
||||||
import { defensiveClone } from "../../../util";
|
import { defensiveClone } from "../../../util";
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import * as _ from "lodash";
|
|
||||||
import * as moment from "moment";
|
|
||||||
import { ImageFlipperProps, ImageFlipperState } from "./interfaces";
|
import { ImageFlipperProps, ImageFlipperState } from "./interfaces";
|
||||||
import { safeStringFetch } from "../../util";
|
|
||||||
|
|
||||||
export const PLACEHOLDER_FARMBOT = "/placeholder_farmbot.jpg";
|
export const PLACEHOLDER_FARMBOT = "/placeholder_farmbot.jpg";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Page, Col, Row, Widget, WidgetHeader, WidgetBody } from "../ui/index";
|
import { Page, Col, Row } from "../ui/index";
|
||||||
import { FarmwarePanel } from "./farmware_panel";
|
import { FarmwarePanel } from "./farmware_panel";
|
||||||
import { mapStateToProps } from "./state_to_props";
|
import { mapStateToProps } from "./state_to_props";
|
||||||
import { Photos } from "./images/photos";
|
import { Photos } from "./images/photos";
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import * as React from "react";
|
|
||||||
import { ImageWorkspace } from "../image_workspace";
|
import { ImageWorkspace } from "../image_workspace";
|
||||||
|
|
||||||
describe("<Body/>", () => {
|
describe("<Body/>", () => {
|
||||||
|
|
|
@ -2,7 +2,7 @@ import * as _ from "lodash";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { success, error } from "farmbot-toastr";
|
import { success, error } from "farmbot-toastr";
|
||||||
import { Thunk, GetState } from "../../redux/interfaces";
|
import { Thunk } from "../../redux/interfaces";
|
||||||
import { API } from "../../api";
|
import { API } from "../../api";
|
||||||
import { Progress, ProgressCallback, HttpData } from "../../util";
|
import { Progress, ProgressCallback, HttpData } from "../../util";
|
||||||
import { GenericPointer } from "../../interfaces";
|
import { GenericPointer } from "../../interfaces";
|
||||||
|
|
|
@ -6,7 +6,6 @@ import { HSV } from "./interfaces";
|
||||||
import { WeedDetectorSlider } from "./slider";
|
import { WeedDetectorSlider } from "./slider";
|
||||||
import { TaggedImage } from "../../resources/tagged_resources";
|
import { TaggedImage } from "../../resources/tagged_resources";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import * as _ from "lodash";
|
|
||||||
|
|
||||||
const RANGES = {
|
const RANGES = {
|
||||||
H: { LOWEST: 0, HIGHEST: 179 },
|
H: { LOWEST: 0, HIGHEST: 179 },
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Pair } from "farmbot";
|
|
||||||
import { DetectorState, HSV } from "./interfaces";
|
import { DetectorState, HSV } from "./interfaces";
|
||||||
import { TitleBar } from "./title";
|
import { TitleBar } from "./title";
|
||||||
import { devices } from "../../device";
|
import { devices } from "../../device";
|
||||||
|
@ -13,9 +12,8 @@ import { FarmwareProps } from "../../devices/interfaces";
|
||||||
import { mapStateToProps } from "../../farmware/state_to_props";
|
import { mapStateToProps } from "../../farmware/state_to_props";
|
||||||
import { ToolTips } from "../../constants";
|
import { ToolTips } from "../../constants";
|
||||||
import { ImageWorkspace } from "./image_workspace";
|
import { ImageWorkspace } from "./image_workspace";
|
||||||
import { WD_ENV, WDENVKey as ENVKey, WDENVKey } from "./remote_env/interfaces";
|
import { WDENVKey as ENVKey } from "./remote_env/interfaces";
|
||||||
import { envGet } from "./remote_env/selectors";
|
import { envGet } from "./remote_env/selectors";
|
||||||
import { envSave } from "./remote_env/actions";
|
|
||||||
import { translateImageWorkspaceAndSave } from "./actions";
|
import { translateImageWorkspaceAndSave } from "./actions";
|
||||||
|
|
||||||
@connect(mapStateToProps)
|
@connect(mapStateToProps)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { formatEnvKey, parseEnvKey } from "../translators";
|
import { formatEnvKey, parseEnvKey } from "../translators";
|
||||||
import { SPECIAL_VALUES, getSpecialValue } from "../constants";
|
import { SPECIAL_VALUES, getSpecialValue } from "../constants";
|
||||||
import { WD_ENV, WDENVKey } from "../interfaces";
|
import { WDENVKey } from "../interfaces";
|
||||||
import { getDropdownSelection } from "../../selectors";
|
import { getDropdownSelection } from "../../selectors";
|
||||||
import { prepopulateEnv } from "../selectors";
|
import { prepopulateEnv } from "../selectors";
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ describe("getSpecialValue()", () => {
|
||||||
|
|
||||||
it("crashes on malformed inputs", () => {
|
it("crashes on malformed inputs", () => {
|
||||||
expect(() => {
|
expect(() => {
|
||||||
getSpecialValue("FOo_bar!!")
|
getSpecialValue("FOo_bar!!");
|
||||||
}).toThrow();
|
}).toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import * as _ from "lodash";
|
|
||||||
import { TRANSLATORS, DEFAULT_FORMATTER } from "./constants";
|
import { TRANSLATORS, DEFAULT_FORMATTER } from "./constants";
|
||||||
import { WDENVKey } from "./interfaces";
|
import { WDENVKey } from "./interfaces";
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import * as React from "react";
|
||||||
import {
|
import {
|
||||||
RangeSlider
|
RangeSlider
|
||||||
} from "@blueprintjs/core/dist/components/slider/rangeSlider";
|
} from "@blueprintjs/core/dist/components/slider/rangeSlider";
|
||||||
import { isNumber, get } from "lodash";
|
import { get } from "lodash";
|
||||||
|
|
||||||
interface SliderProps {
|
interface SliderProps {
|
||||||
onRelease(value: [number, number]): void;
|
onRelease(value: [number, number]): void;
|
||||||
|
@ -32,10 +32,7 @@ export class WeedDetectorSlider extends React.Component<SliderProps, State> {
|
||||||
render() {
|
render() {
|
||||||
let {
|
let {
|
||||||
highest,
|
highest,
|
||||||
lowest,
|
lowest
|
||||||
lowValue,
|
|
||||||
highValue,
|
|
||||||
onRelease
|
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
return <RangeSlider
|
return <RangeSlider
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import * as React from "react";
|
|
||||||
import { detectLanguage } from "../i18n";
|
import { detectLanguage } from "../i18n";
|
||||||
import { FrontPage } from "./front_page";
|
import { FrontPage } from "./front_page";
|
||||||
import * as i18next from "i18next";
|
import * as i18next from "i18next";
|
||||||
|
|
|
@ -12,7 +12,6 @@ import {
|
||||||
|
|
||||||
import { links } from "./nav/links";
|
import { links } from "./nav/links";
|
||||||
import { sync } from "./devices/actions";
|
import { sync } from "./devices/actions";
|
||||||
import { lastUrlChunk } from "./util";
|
|
||||||
import { history, push } from "./history";
|
import { history, push } from "./history";
|
||||||
import { Row, Col } from "./ui/index";
|
import { Row, Col } from "./ui/index";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { HttpData } from "./util";
|
|
||||||
|
|
||||||
function generateUrl(langCode: string) {
|
function generateUrl(langCode: string) {
|
||||||
let lang = langCode.slice(0, 2);
|
let lang = langCode.slice(0, 2);
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import * as Axios from "axios";
|
|
||||||
import { ResourceName, DataChangeType, Dictionary } from "farmbot/dist";
|
import { ResourceName, DataChangeType, Dictionary } from "farmbot/dist";
|
||||||
import { devices } from "./device";
|
import { devices } from "./device";
|
||||||
import { box } from "boxed_value";
|
import { box } from "boxed_value";
|
||||||
|
|
|
@ -10,7 +10,7 @@ import {
|
||||||
import { API } from "./api/index";
|
import { API } from "./api/index";
|
||||||
import { AuthState } from "./auth/interfaces";
|
import { AuthState } from "./auth/interfaces";
|
||||||
import * as _ from "lodash";
|
import * as _ from "lodash";
|
||||||
import axios, { AxiosRequestConfig, AxiosResponse } from "axios";
|
import { AxiosRequestConfig, AxiosResponse } from "axios";
|
||||||
|
|
||||||
export function responseFulfilled(input: AxiosResponse): AxiosResponse {
|
export function responseFulfilled(input: AxiosResponse): AxiosResponse {
|
||||||
let method = input.config.method;
|
let method = input.config.method;
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import * as React from "react";
|
|
||||||
|
|
||||||
describe("<NavBar", function () {
|
describe("<NavBar", function () {
|
||||||
it("renders helpful text", function () {
|
it("renders helpful text", function () {
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Link } from "react-router";
|
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import * as moment from "moment";
|
|
||||||
import { NavBarProps, NavBarState } from "./interfaces";
|
import { NavBarProps, NavBarState } from "./interfaces";
|
||||||
import { EStopButton } from "../devices/components/e_stop_btn";
|
import { EStopButton } from "../devices/components/e_stop_btn";
|
||||||
import { Session } from "../session";
|
import { Session } from "../session";
|
||||||
|
@ -16,7 +14,6 @@ import { MobileMenu } from "./mobile_menu";
|
||||||
import {
|
import {
|
||||||
Popover,
|
Popover,
|
||||||
Position,
|
Position,
|
||||||
Tooltip,
|
|
||||||
PopoverInteractionKind
|
PopoverInteractionKind
|
||||||
} from "@blueprintjs/core/dist";
|
} from "@blueprintjs/core/dist";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Link } from "react-router";
|
import { Link } from "react-router";
|
||||||
import { t } from "i18next";
|
|
||||||
|
|
||||||
import { history } from "../history";
|
import { history } from "../history";
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ jest.mock("axios", function () {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
import { cachedCrop, DATA_URI, OpenFarmAPI } from "../index";
|
import { cachedCrop, OpenFarmAPI } from "../index";
|
||||||
describe("cachedIcon()", () => {
|
describe("cachedIcon()", () => {
|
||||||
it("does an HTTP request if the icon can't be found locally", (done) => {
|
it("does an HTTP request if the icon can't be found locally", (done) => {
|
||||||
cachedCrop("lettuce")
|
cachedCrop("lettuce")
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { Dictionary } from "farmbot/dist";
|
import { Dictionary } from "farmbot/dist";
|
||||||
import * as _ from "lodash";
|
|
||||||
import { HttpData } from "../util";
|
import { HttpData } from "../util";
|
||||||
|
|
||||||
const BASE = "https://openfarm.cc/api/v1/crops/";
|
const BASE = "https://openfarm.cc/api/v1/crops/";
|
||||||
|
|
|
@ -2,7 +2,6 @@ import * as React from "react";
|
||||||
import { mount } from "enzyme";
|
import { mount } from "enzyme";
|
||||||
import { PasswordReset } from "../password_reset";
|
import { PasswordReset } from "../password_reset";
|
||||||
import * as moxios from "moxios";
|
import * as moxios from "moxios";
|
||||||
import { API } from "../../api/api";
|
|
||||||
import { State } from "../interfaces";
|
import { State } from "../interfaces";
|
||||||
|
|
||||||
describe("<PasswordReset/>", () => {
|
describe("<PasswordReset/>", () => {
|
||||||
|
|
|
@ -34,7 +34,7 @@ export function generateReducer<State>(initialState: State,
|
||||||
let clonedState = defensiveClone(state);
|
let clonedState = defensiveClone(state);
|
||||||
let clonedAction = defensiveClone(action);
|
let clonedAction = defensiveClone(action);
|
||||||
let result: State = handler(clonedState, clonedAction);
|
let result: State = handler(clonedState, clonedAction);
|
||||||
result = (afterEach || NOOP)(defensiveClone(result), action)
|
result = (afterEach || NOOP)(defensiveClone(result), action);
|
||||||
return defensiveClone(result);
|
return defensiveClone(result);
|
||||||
} as GeneratedReducer;
|
} as GeneratedReducer;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Regimen } from "./interfaces";
|
import { Regimen } from "./interfaces";
|
||||||
import { destroy, save, init, edit } from "../api/crud";
|
import { destroy, save, edit } from "../api/crud";
|
||||||
import { TaggedRegimen, isTaggedRegimen } from "../resources/tagged_resources";
|
import { TaggedRegimen, isTaggedRegimen } from "../resources/tagged_resources";
|
||||||
|
|
||||||
export function editRegimen(r: TaggedRegimen | undefined,
|
export function editRegimen(r: TaggedRegimen | undefined,
|
||||||
|
|
|
@ -9,7 +9,7 @@ describe("commitBulkEditor()", () => {
|
||||||
it("does nothing if no regimen is selected", () => {
|
it("does nothing if no regimen is selected", () => {
|
||||||
let getState = () => fakeState();
|
let getState = () => fakeState();
|
||||||
let dispatch = jest.fn();
|
let dispatch = jest.fn();
|
||||||
let results = commitBulkEditor()(dispatch, getState);
|
commitBulkEditor()(dispatch, getState);
|
||||||
expect(dispatch.mock.calls.length).toEqual(0);
|
expect(dispatch.mock.calls.length).toEqual(0);
|
||||||
expect(mockErr.mock.calls.length).toEqual(1);
|
expect(mockErr.mock.calls.length).toEqual(1);
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { isNaN, isNumber } from "lodash";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { error, warning } from "farmbot-toastr";
|
import { error, warning } from "farmbot-toastr";
|
||||||
import { ReduxAction, Thunk } from "../../redux/interfaces";
|
import { ReduxAction, Thunk } from "../../redux/interfaces";
|
||||||
import { ToggleDayParams, Week } from "./interfaces";
|
import { ToggleDayParams } from "./interfaces";
|
||||||
import { assertUuid, findSequence, findRegimen } from "../../resources/selectors";
|
import { assertUuid, findSequence, findRegimen } from "../../resources/selectors";
|
||||||
import { groupRegimenItemsByWeek } from "./group_regimen_items_by_week";
|
import { groupRegimenItemsByWeek } from "./group_regimen_items_by_week";
|
||||||
import { defensiveClone } from "../../util";
|
import { defensiveClone } from "../../util";
|
||||||
|
|
|
@ -47,7 +47,6 @@ export class BulkSchedulerWidget extends React.Component<BulkEditorProps, {}> {
|
||||||
render() {
|
render() {
|
||||||
let {
|
let {
|
||||||
dispatch,
|
dispatch,
|
||||||
selectedSequence,
|
|
||||||
dailyOffsetMs,
|
dailyOffsetMs,
|
||||||
weeks,
|
weeks,
|
||||||
sequences
|
sequences
|
||||||
|
|
|
@ -2,7 +2,6 @@ jest.unmock("../../../api/crud");
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { mount } from "enzyme";
|
import { mount } from "enzyme";
|
||||||
import { CopyButton } from "../copy_button";
|
import { CopyButton } from "../copy_button";
|
||||||
import { TaggedRegimen } from "../../../resources/tagged_resources";
|
|
||||||
import { fakeRegimen } from "../../../__test_support__/fake_state/resources";
|
import { fakeRegimen } from "../../../__test_support__/fake_state/resources";
|
||||||
|
|
||||||
describe("Copy button", () => {
|
describe("Copy button", () => {
|
||||||
|
|
|
@ -2,7 +2,7 @@ import * as React from "react";
|
||||||
import { RegimenNameInput } from "./regimen_name_input";
|
import { RegimenNameInput } from "./regimen_name_input";
|
||||||
import { ActiveEditorProps } from "./interfaces";
|
import { ActiveEditorProps } from "./interfaces";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { RegimenItem, RegimenItemCalendarRow } from "../interfaces";
|
import { RegimenItem } from "../interfaces";
|
||||||
import { TaggedRegimen } from "../../resources/tagged_resources";
|
import { TaggedRegimen } from "../../resources/tagged_resources";
|
||||||
import { defensiveClone } from "../../util";
|
import { defensiveClone } from "../../util";
|
||||||
import { overwrite } from "../../api/crud";
|
import { overwrite } from "../../api/crud";
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
import {
|
import {
|
||||||
RegimenItem,
|
|
||||||
RegimenProps,
|
RegimenProps,
|
||||||
CalendarRow,
|
CalendarRow,
|
||||||
RegimenItemCalendarRow,
|
RegimenItemCalendarRow
|
||||||
Regimen
|
|
||||||
} from "../interfaces";
|
} from "../interfaces";
|
||||||
import { AuthState } from "../../auth/interfaces";
|
import { AuthState } from "../../auth/interfaces";
|
||||||
import { BotState } from "../../devices/interfaces";
|
import { BotState } from "../../devices/interfaces";
|
||||||
|
@ -45,4 +43,4 @@ export interface CopyButtnProps {
|
||||||
|
|
||||||
export interface DeleteButtonProps extends RegimenProps {
|
export interface DeleteButtonProps extends RegimenProps {
|
||||||
baseUrl: string;
|
baseUrl: string;
|
||||||
};
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ export class RegimensList extends
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let { dispatch, regimen, regimens } = this.props;
|
let { dispatch, regimens } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="regimen-list">
|
<div className="regimen-list">
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Link } from "react-router";
|
import { Link } from "react-router";
|
||||||
import { RegimenListItemProps } from "../interfaces";
|
import { RegimenListItemProps } from "../interfaces";
|
||||||
import { isMobile, lastUrlChunk, urlFriendly } from "../../util";
|
import { lastUrlChunk, urlFriendly } from "../../util";
|
||||||
import { selectRegimen } from "../actions";
|
import { selectRegimen } from "../actions";
|
||||||
import {
|
import {
|
||||||
TaggedRegimen,
|
TaggedRegimen,
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { buildResourceIndex } from "../../__test_support__/resource_index_builder";
|
import { buildResourceIndex } from "../../__test_support__/resource_index_builder";
|
||||||
import { findSlotByToolId } from "../selectors";
|
import { findSlotByToolId } from "../selectors";
|
||||||
import { resourceReducer } from "../reducer";
|
import { resourceReducer } from "../reducer";
|
||||||
import { Actions } from "../../constants";
|
|
||||||
import { TaggedTool, TaggedToolSlotPointer } from "../tagged_resources";
|
import { TaggedTool, TaggedToolSlotPointer } from "../tagged_resources";
|
||||||
import { createOK } from "../actions";
|
import { createOK } from "../actions";
|
||||||
import { generateUuid } from "../util";
|
import { generateUuid } from "../util";
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
import * as _ from "lodash";
|
import * as _ from "lodash";
|
||||||
import * as moment from "moment";
|
|
||||||
import { generateReducer } from "../redux/generate_reducer";
|
import { generateReducer } from "../redux/generate_reducer";
|
||||||
import { RestResources, ResourceIndex } from "./interfaces";
|
import { RestResources, ResourceIndex } from "./interfaces";
|
||||||
import {
|
import {
|
||||||
TaggedResource,
|
TaggedResource,
|
||||||
ResourceName,
|
ResourceName,
|
||||||
sanityCheck,
|
sanityCheck,
|
||||||
isTaggedResource,
|
isTaggedResource
|
||||||
TaggedSequence
|
|
||||||
} from "./tagged_resources";
|
} from "./tagged_resources";
|
||||||
import { generateUuid, arrayWrap } from "./util";
|
import { generateUuid, arrayWrap } from "./util";
|
||||||
import { EditResourceParams } from "../api/interfaces";
|
import { EditResourceParams } from "../api/interfaces";
|
||||||
|
@ -32,7 +30,6 @@ import {
|
||||||
farmwareState
|
farmwareState
|
||||||
} from "../farmware/reducer";
|
} from "../farmware/reducer";
|
||||||
import { Actions } from "../constants";
|
import { Actions } from "../constants";
|
||||||
import { uuid as rando } from "farmbot/dist";
|
|
||||||
|
|
||||||
let consumerReducer = combineReducers<RestResources["consumers"]>({
|
let consumerReducer = combineReducers<RestResources["consumers"]>({
|
||||||
regimens,
|
regimens,
|
||||||
|
|
|
@ -27,8 +27,7 @@ import {
|
||||||
TaggedToolSlotPointer,
|
TaggedToolSlotPointer,
|
||||||
TaggedUser
|
TaggedUser
|
||||||
} from "./tagged_resources";
|
} from "./tagged_resources";
|
||||||
import { CowardlyDictionary, betterCompact, sortResourcesById, betterMerge } from "../util";
|
import { CowardlyDictionary, betterCompact, sortResourcesById } from "../util";
|
||||||
import { ToolSlotPointer } from "../interfaces";
|
|
||||||
type StringMap = CowardlyDictionary<string>;
|
type StringMap = CowardlyDictionary<string>;
|
||||||
|
|
||||||
export let findId = (index: ResourceIndex, kind: ResourceName, id: number) => {
|
export let findId = (index: ResourceIndex, kind: ResourceName, id: number) => {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { Dictionary } from "farmbot/dist";
|
||||||
import { betterCompact } from "../util";
|
import { betterCompact } from "../util";
|
||||||
import * as _ from "lodash";
|
import * as _ from "lodash";
|
||||||
|
|
||||||
var count = 0;
|
let count = 0;
|
||||||
export function generateUuid(id: number | undefined, kind: ResourceName) {
|
export function generateUuid(id: number | undefined, kind: ResourceName) {
|
||||||
return `${joinKindAndId(kind, id)}.${count++}`
|
return `${joinKindAndId(kind, id)}.${count++}`
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,14 +4,11 @@ import { InputDefault } from "../input_default";
|
||||||
import { mount } from "enzyme";
|
import { mount } from "enzyme";
|
||||||
import { TaggedSequence } from "../../../resources/tagged_resources";
|
import { TaggedSequence } from "../../../resources/tagged_resources";
|
||||||
import { MoveAbsolute } from "farmbot/dist";
|
import { MoveAbsolute } from "farmbot/dist";
|
||||||
import { updateStep } from "../../step_tiles/index";
|
|
||||||
import { fakeState } from "../../../__test_support__/fake_state";
|
|
||||||
import { Wrapper } from "../../../__test_support__/wrapper";
|
import { Wrapper } from "../../../__test_support__/wrapper";
|
||||||
|
|
||||||
describe("<InputDefault/>", () => {
|
describe("<InputDefault/>", () => {
|
||||||
it("updates the step", () => {
|
it("updates the step", () => {
|
||||||
let dispatcher = jest.fn();
|
let dispatcher = jest.fn();
|
||||||
let state = fakeState();
|
|
||||||
let step: MoveAbsolute = {
|
let step: MoveAbsolute = {
|
||||||
"kind": "move_absolute",
|
"kind": "move_absolute",
|
||||||
"args": {
|
"args": {
|
||||||
|
@ -57,7 +54,6 @@ describe("<InputDefault/>", () => {
|
||||||
dispatch={dispatcher}
|
dispatch={dispatcher}
|
||||||
sequence={tr} />
|
sequence={tr} />
|
||||||
</Wrapper>);
|
</Wrapper>);
|
||||||
let x: jest.Mock<{}> = (updateStep as any).mock;
|
|
||||||
let input = c.find("input").first();
|
let input = c.find("input").first();
|
||||||
input.simulate("change");
|
input.simulate("change");
|
||||||
input.simulate("blur");
|
input.simulate("blur");
|
||||||
|
|
|
@ -3,10 +3,6 @@ import { InputUnknown } from "./input_unknown";
|
||||||
import { InputDefault } from "./input_default";
|
import { InputDefault } from "./input_default";
|
||||||
import { StepInputProps } from "../interfaces";
|
import { StepInputProps } from "../interfaces";
|
||||||
|
|
||||||
type ArgType = "speed" | "pin_number" | "pin_value" | "pin_mode" | "operator"
|
|
||||||
| "x" | "y" | "z" | "stub" | "variable" | "label" | "milliseconds" | "message"
|
|
||||||
| "lhs" | "op" | "rhs" | "sequence_id" | "location";
|
|
||||||
|
|
||||||
export function StepInputBox(props: StepInputProps) {
|
export function StepInputBox(props: StepInputProps) {
|
||||||
switch (props.field) {
|
switch (props.field) {
|
||||||
case "label": case "lhs": case "message": case "milliseconds": case "op":
|
case "label": case "lhs": case "message": case "milliseconds": case "op":
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { editCurrentSequence } from "./actions";
|
||||||
import { renderCeleryNode, splice, move } from "./step_tiles/index";
|
import { renderCeleryNode, splice, move } from "./step_tiles/index";
|
||||||
import { ColorPicker } from "../ui";
|
import { ColorPicker } from "../ui";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { BlurableInput, Row, Col, SaveBtn, ToolTip } from "../ui";
|
import { BlurableInput, Row, Col, SaveBtn } from "../ui";
|
||||||
import { DropArea } from "../draggable/drop_area";
|
import { DropArea } from "../draggable/drop_area";
|
||||||
import { stepGet } from "../draggable/actions";
|
import { stepGet } from "../draggable/actions";
|
||||||
import { pushStep } from "./actions";
|
import { pushStep } from "./actions";
|
||||||
|
@ -15,7 +15,6 @@ import { copySequence } from "./actions";
|
||||||
import { TaggedSequence } from "../resources/tagged_resources";
|
import { TaggedSequence } from "../resources/tagged_resources";
|
||||||
import { save, edit, destroy } from "../api/crud";
|
import { save, edit, destroy } from "../api/crud";
|
||||||
import { GetState } from "../redux/interfaces";
|
import { GetState } from "../redux/interfaces";
|
||||||
import { ToolTips } from "../constants";
|
|
||||||
import { get } from "lodash";
|
import { get } from "lodash";
|
||||||
import { TestButton } from "./test_button";
|
import { TestButton } from "./test_button";
|
||||||
import { warning } from "farmbot-toastr";
|
import { warning } from "farmbot-toastr";
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Col } from "../ui/index";
|
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
|
|
||||||
/** The bottom half of the Sequence editor panel (when no Sequence is selected). */
|
/** The bottom half of the Sequence editor panel (when no Sequence is selected). */
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Link } from "react-router";
|
import { Link } from "react-router";
|
||||||
import * as _ from "lodash";
|
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { history, push } from "../history";
|
import { push } from "../history";
|
||||||
import { selectSequence } from "./actions";
|
import { selectSequence } from "./actions";
|
||||||
import { SequencesListProps, SequencesListState } from "./interfaces";
|
import { SequencesListProps, SequencesListState } from "./interfaces";
|
||||||
import {
|
import {
|
||||||
isMobile,
|
|
||||||
sortResourcesById,
|
sortResourcesById,
|
||||||
urlFriendly,
|
urlFriendly,
|
||||||
lastUrlChunk
|
lastUrlChunk
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { StepButtonParams } from "../../interfaces";
|
import { StepButtonParams } from "../../interfaces";
|
||||||
import { StepButton } from "../index";
|
import { StepButton } from "../index";
|
||||||
import { mount, shallow } from "enzyme";
|
import { shallow } from "enzyme";
|
||||||
import { fakeSequence } from "../../../__test_support__/fake_state/resources";
|
import { fakeSequence } from "../../../__test_support__/fake_state/resources";
|
||||||
import { ReduxAction } from "../../../redux/interfaces";
|
import { ReduxAction } from "../../../redux/interfaces";
|
||||||
import { EditResourceParams } from "../../../api/interfaces";
|
import { EditResourceParams } from "../../../api/interfaces";
|
||||||
|
|
|
@ -31,7 +31,6 @@ export function move({ step, sequence, to, from }: MoveParams) {
|
||||||
let next = defensiveClone(sequence);
|
let next = defensiveClone(sequence);
|
||||||
let seq = next.body;
|
let seq = next.body;
|
||||||
seq.body = seq.body || [];
|
seq.body = seq.body || [];
|
||||||
let both = [from, to];
|
|
||||||
// WEIRD EDGE CASE: TODO:
|
// WEIRD EDGE CASE: TODO:
|
||||||
// Works when from > to but not the other way around.
|
// Works when from > to but not the other way around.
|
||||||
// Wish I could use one function for both cases, but don't have
|
// Wish I could use one function for both cases, but don't have
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { SequenceBodyItem as Step, Dictionary } from "farmbot";
|
import { SequenceBodyItem as Step } from "farmbot";
|
||||||
import { addComment } from "../actions";
|
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { CowardlyDictionary } from "../../util";
|
import { CowardlyDictionary } from "../../util";
|
||||||
import { StepTitleBarProps } from "../interfaces";
|
import { StepTitleBarProps } from "../interfaces";
|
||||||
|
|
|
@ -53,9 +53,9 @@ export class RefactoredExecuteBlock extends React.Component<ExecBlockParams, {}>
|
||||||
.map(function (x) {
|
.map(function (x) {
|
||||||
let { id, name } = x.body;
|
let { id, name } = x.body;
|
||||||
if (_.isNumber(id) && (id !== p.currentStep.args.sequence_id)) {
|
if (_.isNumber(id) && (id !== p.currentStep.args.sequence_id)) {
|
||||||
output.push({ label: name, value: id })
|
output.push({ label: name, value: id });
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ export class RefactoredExecuteBlock extends React.Component<ExecBlockParams, {}>
|
||||||
let { sequence_id } = p.currentStep.args;
|
let { sequence_id } = p.currentStep.args;
|
||||||
if (sequence_id) {
|
if (sequence_id) {
|
||||||
let s = findSequenceById(p.resources, sequence_id);
|
let s = findSequenceById(p.resources, sequence_id);
|
||||||
return { label: s.body.name, value: (s.body.id as number) }
|
return { label: s.body.name, value: (s.body.id as number) };
|
||||||
} else {
|
} else {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { StepParams } from "../interfaces";
|
import { StepParams } from "../interfaces";
|
||||||
import { StepTitleBar } from "./step_title_bar";
|
import { StepTitleBar } from "./step_title_bar";
|
||||||
import { Help } from "../../ui";
|
|
||||||
import { splice, remove } from "./index";
|
import { splice, remove } from "./index";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { ToolTips } from "../../constants";
|
import { ToolTips } from "../../constants";
|
||||||
|
import { StepIconGroup } from "../step_icon_group";
|
||||||
|
|
||||||
export function TileExecuteScript({ dispatch, currentStep, index, currentSequence }: StepParams) {
|
export function TileExecuteScript({ dispatch, currentStep, index, currentSequence }: StepParams) {
|
||||||
if (currentStep.kind === "execute_script") {
|
if (currentStep.kind === "execute_script") {
|
||||||
|
@ -17,16 +17,14 @@ export function TileExecuteScript({ dispatch, currentStep, index, currentSequenc
|
||||||
dispatch={dispatch}
|
dispatch={dispatch}
|
||||||
step={currentStep}
|
step={currentStep}
|
||||||
sequence={currentSequence} />
|
sequence={currentSequence} />
|
||||||
<i className="fa fa-arrows-v step-control" />
|
<StepIconGroup
|
||||||
<i className="fa fa-clone step-control"
|
onClone={() => dispatch(splice({
|
||||||
onClick={() => dispatch(splice({
|
|
||||||
step: currentStep,
|
step: currentStep,
|
||||||
index,
|
index,
|
||||||
sequence: currentSequence
|
sequence: currentSequence
|
||||||
}))} />
|
}))}
|
||||||
<i className="fa fa-trash step-control"
|
onTrash={() => remove({ dispatch, index, sequence: currentSequence })}
|
||||||
onClick={() => remove({ dispatch, index, sequence: currentSequence })} />
|
helpText={t(ToolTips.EXECUTE_SCRIPT)} />
|
||||||
<Help text={t(ToolTips.EXECUTE_SCRIPT)} />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,15 +2,14 @@ import * as React from "react";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { splice, remove } from "./index";
|
import { splice, remove } from "./index";
|
||||||
import { StepTitleBar } from "./step_title_bar";
|
import { StepTitleBar } from "./step_title_bar";
|
||||||
import { Help } from "../../ui";
|
|
||||||
import { FindHome, ALLOWED_AXIS } from "farmbot";
|
import { FindHome, ALLOWED_AXIS } from "farmbot";
|
||||||
import * as _ from "lodash";
|
|
||||||
import { StepParams } from "../interfaces";
|
import { StepParams } from "../interfaces";
|
||||||
import { TaggedSequence } from "../../resources/tagged_resources";
|
import { TaggedSequence } from "../../resources/tagged_resources";
|
||||||
import { ResourceIndex } from "../../resources/interfaces";
|
import { ResourceIndex } from "../../resources/interfaces";
|
||||||
import { edit, overwrite } from "../../api/crud";
|
import { overwrite } from "../../api/crud";
|
||||||
import { defensiveClone } from "../../util";
|
import { defensiveClone } from "../../util";
|
||||||
import { ToolTips } from "../../constants";
|
import { ToolTips } from "../../constants";
|
||||||
|
import { StepIconGroup } from "../step_icon_group";
|
||||||
|
|
||||||
export function TileFindHome(props: StepParams) {
|
export function TileFindHome(props: StepParams) {
|
||||||
if (props.currentStep.kind === "find_home") {
|
if (props.currentStep.kind === "find_home") {
|
||||||
|
@ -60,16 +59,14 @@ class InnerFindHome extends React.Component<FindHomeParams, {}> {
|
||||||
dispatch={dispatch}
|
dispatch={dispatch}
|
||||||
step={currentStep}
|
step={currentStep}
|
||||||
sequence={currentSequence} />
|
sequence={currentSequence} />
|
||||||
<i className="fa fa-arrows-v step-control" />
|
<StepIconGroup
|
||||||
<i className="fa fa-clone step-control"
|
onTrash={() => remove({ dispatch, index, sequence: currentSequence })}
|
||||||
onClick={() => dispatch(splice({
|
onClone={() => dispatch(splice({
|
||||||
step: currentStep,
|
step: currentStep,
|
||||||
sequence: currentSequence,
|
sequence: currentSequence,
|
||||||
index
|
index
|
||||||
}))} />
|
}))}
|
||||||
<i className="fa fa-trash step-control"
|
helpText={t(ToolTips.FIND_HOME)} />
|
||||||
onClick={() => remove({ dispatch, index, sequence: currentSequence })} />
|
|
||||||
<Help text={t(ToolTips.FIND_HOME)} />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -81,8 +78,8 @@ class InnerFindHome extends React.Component<FindHomeParams, {}> {
|
||||||
<div className="bottom-content">
|
<div className="bottom-content">
|
||||||
<div className="channel-fields">
|
<div className="channel-fields">
|
||||||
<form>
|
<form>
|
||||||
{AXIS_CHOICES.map((axis, index) => {
|
{AXIS_CHOICES.map((axis, i) => {
|
||||||
return <div key={index} style={{ display: "inline" }}>
|
return <div key={i} style={{ display: "inline" }}>
|
||||||
<label>
|
<label>
|
||||||
<input type="radio"
|
<input type="radio"
|
||||||
value={axis}
|
value={axis}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import * as _ from "lodash";
|
import * as _ from "lodash";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { DropDownItem, Help } from "../../../ui";
|
import { DropDownItem } from "../../../ui";
|
||||||
import { TaggedSequence } from "../../../resources/tagged_resources";
|
import { TaggedSequence } from "../../../resources/tagged_resources";
|
||||||
import { If, Execute, Nothing } from "farmbot/dist";
|
import { If, Execute, Nothing } from "farmbot/dist";
|
||||||
import { ResourceIndex } from "../../../resources/interfaces";
|
import { ResourceIndex } from "../../../resources/interfaces";
|
||||||
|
@ -16,6 +16,7 @@ import { overwrite } from "../../../api/crud";
|
||||||
import { NULL_CHOICE } from "../../../ui/fb_select";
|
import { NULL_CHOICE } from "../../../ui/fb_select";
|
||||||
import { range } from "lodash";
|
import { range } from "lodash";
|
||||||
import { ToolTips } from "../../../constants";
|
import { ToolTips } from "../../../constants";
|
||||||
|
import { StepIconGroup } from "../../step_icon_group";
|
||||||
|
|
||||||
export interface IfParams {
|
export interface IfParams {
|
||||||
currentSequence: TaggedSequence;
|
currentSequence: TaggedSequence;
|
||||||
|
@ -92,12 +93,10 @@ export function InnerIf(props: IfParams) {
|
||||||
dispatch={dispatch}
|
dispatch={dispatch}
|
||||||
step={currentStep}
|
step={currentStep}
|
||||||
sequence={currentSequence} />
|
sequence={currentSequence} />
|
||||||
<i className="fa fa-arrows-v step-control" />
|
<StepIconGroup
|
||||||
<i className="fa fa-clone step-control"
|
onClone={() => dispatch(splice(stuff))}
|
||||||
onClick={() => dispatch(splice(stuff))} />
|
onTrash={() => remove(stuff)}
|
||||||
<i className="fa fa-trash step-control"
|
helpText={t(ToolTips.IF)} />
|
||||||
onClick={() => remove(stuff)} />
|
|
||||||
<Help text={t(ToolTips.IF)} />
|
|
||||||
{recursive && (
|
{recursive && (
|
||||||
<span>
|
<span>
|
||||||
<i className="fa fa-exclamation-triangle"></i>
|
<i className="fa fa-exclamation-triangle"></i>
|
||||||
|
@ -128,7 +127,7 @@ export function InnerIf(props: IfParams) {
|
||||||
export let IfBlockDropDownHandler = (props: IfParams,
|
export let IfBlockDropDownHandler = (props: IfParams,
|
||||||
key: "_else" | "_then") => {
|
key: "_else" | "_then") => {
|
||||||
|
|
||||||
let { dispatch, currentSequence, currentStep, index } = props;
|
let { dispatch, index } = props;
|
||||||
let step = props.currentStep;
|
let step = props.currentStep;
|
||||||
let sequence = props.currentSequence;
|
let sequence = props.currentSequence;
|
||||||
let block = step.args[key];
|
let block = step.args[key];
|
||||||
|
|
|
@ -14,7 +14,6 @@ import {
|
||||||
Row,
|
Row,
|
||||||
Col,
|
Col,
|
||||||
} from "../../ui";
|
} from "../../ui";
|
||||||
import { StepInputBox } from "../inputs/step_input_box";
|
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { StepTitleBar } from "./step_title_bar";
|
import { StepTitleBar } from "./step_title_bar";
|
||||||
import {
|
import {
|
||||||
|
@ -33,6 +32,7 @@ import { Xyz } from "../../devices/interfaces";
|
||||||
import { TileMoveAbsSelect } from "./tile_move_absolute/select";
|
import { TileMoveAbsSelect } from "./tile_move_absolute/select";
|
||||||
import { InputBox } from "./tile_move_absolute/input_box";
|
import { InputBox } from "./tile_move_absolute/input_box";
|
||||||
import { ToolTips } from "../../constants";
|
import { ToolTips } from "../../constants";
|
||||||
|
import { StepIconGroup } from "../step_icon_group";
|
||||||
|
|
||||||
interface Args {
|
interface Args {
|
||||||
location: Tool | Coordinate | Point;
|
location: Tool | Coordinate | Point;
|
||||||
|
@ -133,21 +133,14 @@ export class TileMoveAbsolute extends Component<StepParams, MoveAbsState> {
|
||||||
<div className="step-header move-absolute-step">
|
<div className="step-header move-absolute-step">
|
||||||
<StepTitleBar index={index} dispatch={dispatch} step={currentStep}
|
<StepTitleBar index={index} dispatch={dispatch} step={currentStep}
|
||||||
sequence={currentSequence} />
|
sequence={currentSequence} />
|
||||||
<i className="fa fa-arrows-v step-control" />
|
<StepIconGroup
|
||||||
<i className="fa fa-clone step-control"
|
onClone={() => dispatch(splice({
|
||||||
onClick={() => dispatch(splice({
|
|
||||||
step: currentStep,
|
step: currentStep,
|
||||||
index,
|
index,
|
||||||
sequence: currentSequence
|
sequence: currentSequence
|
||||||
}))} />
|
}))}
|
||||||
<i className="fa fa-trash step-control"
|
onTrash={() => remove({ dispatch, index, sequence: currentSequence })}
|
||||||
onClick={() => remove({ dispatch, index, sequence: currentSequence })} />
|
helpText={t(ToolTips.MOVE_ABSOLUTE)} />
|
||||||
<div className="help">
|
|
||||||
<i className="fa fa-question-circle help-icon" />
|
|
||||||
<div className="help-text">
|
|
||||||
{t(ToolTips.MOVE_ABSOLUTE)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* figures out the corresponding Tool | Coordinate | Point */
|
* figures out the corresponding Tool | Coordinate | Point */
|
||||||
import { DropDownItem } from "../../../ui/index";
|
import { DropDownItem } from "../../../ui/index";
|
||||||
import { ResourceIndex } from "../../../resources/interfaces";
|
import { ResourceIndex } from "../../../resources/interfaces";
|
||||||
import { KnownGroupTag, LocationData, CALLBACK } from "./interfaces";
|
import { KnownGroupTag, LocationData } from "./interfaces";
|
||||||
import { findPointerByTypeAndId, findToolById } from "../../../resources/selectors";
|
import { findPointerByTypeAndId, findToolById } from "../../../resources/selectors";
|
||||||
|
|
||||||
/** Takes a DropDownItem and turns it into data suitable
|
/** Takes a DropDownItem and turns it into data suitable
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { StepTitleBar } from "./step_title_bar";
|
import { StepTitleBar } from "./step_title_bar";
|
||||||
import { Help } from "../../ui";
|
|
||||||
import { splice, remove } from "./index";
|
import { splice, remove } from "./index";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { StepInputBox } from "../inputs/step_input_box";
|
import { StepInputBox } from "../inputs/step_input_box";
|
||||||
import { StepParams } from "../interfaces";
|
import { StepParams } from "../interfaces";
|
||||||
import { ToolTips } from "../../constants";
|
import { ToolTips } from "../../constants";
|
||||||
|
import { StepIconGroup } from "../step_icon_group";
|
||||||
|
|
||||||
export function TileMoveRelative({ dispatch, currentStep, index, currentSequence }: StepParams) {
|
export function TileMoveRelative({ dispatch, currentStep, index, currentSequence }: StepParams) {
|
||||||
return (<div>
|
return (<div>
|
||||||
|
@ -18,16 +17,14 @@ export function TileMoveRelative({ dispatch, currentStep, index, currentSequence
|
||||||
dispatch={dispatch}
|
dispatch={dispatch}
|
||||||
step={currentStep}
|
step={currentStep}
|
||||||
sequence={currentSequence} />
|
sequence={currentSequence} />
|
||||||
<i className="fa fa-arrows-v step-control" />
|
<StepIconGroup
|
||||||
<i className="fa fa-clone step-control"
|
onClone={() => dispatch(splice({
|
||||||
onClick={() => dispatch(splice({
|
|
||||||
step: currentStep,
|
step: currentStep,
|
||||||
index,
|
index,
|
||||||
sequence: currentSequence
|
sequence: currentSequence
|
||||||
}))} />
|
}))}
|
||||||
<i className="fa fa-trash step-control"
|
onTrash={() => remove({ dispatch, index, sequence: currentSequence })}
|
||||||
onClick={() => remove({ dispatch, index, sequence: currentSequence })} />
|
helpText={t(ToolTips.MOVE_RELATIVE)} />
|
||||||
<Help text={t(ToolTips.MOVE_RELATIVE)} />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { StepTitleBar } from "./step_title_bar";
|
import { StepTitleBar } from "./step_title_bar";
|
||||||
import { splice, remove } from "./index";
|
import { splice, remove } from "./index";
|
||||||
import { Help } from "../../ui";
|
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { StepInputBox } from "../inputs/step_input_box";
|
import { StepInputBox } from "../inputs/step_input_box";
|
||||||
import { StepParams } from "../interfaces";
|
import { StepParams } from "../interfaces";
|
||||||
import { ToolTips } from "../../constants";
|
import { ToolTips } from "../../constants";
|
||||||
|
import { StepIconGroup } from "../step_icon_group";
|
||||||
|
|
||||||
export function TileReadPin({ dispatch, currentStep, index, currentSequence }: StepParams) {
|
export function TileReadPin({ dispatch, currentStep, index, currentSequence }: StepParams) {
|
||||||
return (<div>
|
return (<div>
|
||||||
|
@ -17,16 +17,14 @@ export function TileReadPin({ dispatch, currentStep, index, currentSequence }: S
|
||||||
dispatch={dispatch}
|
dispatch={dispatch}
|
||||||
step={currentStep}
|
step={currentStep}
|
||||||
sequence={currentSequence} />
|
sequence={currentSequence} />
|
||||||
<i className="fa fa-arrows-v step-control" />
|
<StepIconGroup
|
||||||
<i className="fa fa-clone step-control"
|
onClone={() => dispatch(splice({
|
||||||
onClick={() => dispatch(splice({
|
|
||||||
step: currentStep,
|
step: currentStep,
|
||||||
index,
|
index,
|
||||||
sequence: currentSequence
|
sequence: currentSequence
|
||||||
}))} />
|
}))}
|
||||||
<i className="fa fa-trash step-control"
|
onTrash={() => remove({ dispatch, index, sequence: currentSequence })}
|
||||||
onClick={() => remove({ dispatch, index, sequence: currentSequence })} />
|
helpText={t(ToolTips.READ_PIN)} />
|
||||||
<Help text={t(ToolTips.READ_PIN)} />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -64,4 +62,4 @@ export function TileReadPin({ dispatch, currentStep, index, currentSequence }: S
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>);
|
</div>);
|
||||||
};
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { splice, remove } from "./index";
|
import { splice, remove } from "./index";
|
||||||
import { StepTitleBar } from "./step_title_bar";
|
import { StepTitleBar } from "./step_title_bar";
|
||||||
import { Help, DropDownItem } from "../../ui";
|
import { DropDownItem } from "../../ui";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { StepInputBox } from "../inputs/step_input_box";
|
import { StepInputBox } from "../inputs/step_input_box";
|
||||||
import { SendMessage, ALLOWED_CHANNEL_NAMES } from "farmbot";
|
import { SendMessage, ALLOWED_CHANNEL_NAMES } from "farmbot";
|
||||||
|
@ -17,6 +17,7 @@ import {
|
||||||
EACH_CHANNEL,
|
EACH_CHANNEL,
|
||||||
channel
|
channel
|
||||||
} from "./tile_send_message_support";
|
} from "./tile_send_message_support";
|
||||||
|
import { StepIconGroup } from "../step_icon_group";
|
||||||
type ChannelName = ALLOWED_CHANNEL_NAMES;
|
type ChannelName = ALLOWED_CHANNEL_NAMES;
|
||||||
export function TileSendMessage(props: StepParams) {
|
export function TileSendMessage(props: StepParams) {
|
||||||
if (props.currentStep.kind === "send_message") {
|
if (props.currentStep.kind === "send_message") {
|
||||||
|
@ -41,16 +42,16 @@ interface SendMessageParams {
|
||||||
|
|
||||||
class RefactoredSendMessage extends React.Component<SendMessageParams, {}> {
|
class RefactoredSendMessage extends React.Component<SendMessageParams, {}> {
|
||||||
get args() { return this.props.currentStep.args; }
|
get args() { return this.props.currentStep.args; }
|
||||||
get message() { return this.args.message };
|
get message() { return this.args.message; }
|
||||||
get message_type() { return this.args.message_type }
|
get message_type() { return this.args.message_type; }
|
||||||
get step() { return this.props.currentStep; }
|
get step() { return this.props.currentStep; }
|
||||||
get dispatch() { return this.props.dispatch }
|
get dispatch() { return this.props.dispatch; }
|
||||||
get sequence() { return this.props.currentSequence; }
|
get sequence() { return this.props.currentSequence; }
|
||||||
get index() { return this.props.index }
|
get index() { return this.props.index; }
|
||||||
get currentSelection() {
|
get currentSelection() {
|
||||||
return { label: _.capitalize(this.message_type), value: this.message_type };
|
return { label: _.capitalize(this.message_type), value: this.message_type };
|
||||||
};
|
}
|
||||||
get channels() { return (this.step.body || []).map(x => x.args.channel_name) }
|
get channels() { return (this.step.body || []).map(x => x.args.channel_name); }
|
||||||
hasChannel = (name: ChannelName) => {
|
hasChannel = (name: ChannelName) => {
|
||||||
return this.channels.includes(name);
|
return this.channels.includes(name);
|
||||||
}
|
}
|
||||||
|
@ -80,7 +81,7 @@ class RefactoredSendMessage extends React.Component<SendMessageParams, {}> {
|
||||||
index: this.index,
|
index: this.index,
|
||||||
executor: (step: SendMessage) => {
|
executor: (step: SendMessage) => {
|
||||||
if (_.isString(x.value)) {
|
if (_.isString(x.value)) {
|
||||||
step.args.message_type = x.value
|
step.args.message_type = x.value;
|
||||||
} else {
|
} else {
|
||||||
throw new Error("Strings only in send_message.");
|
throw new Error("Strings only in send_message.");
|
||||||
}
|
}
|
||||||
|
@ -100,16 +101,14 @@ class RefactoredSendMessage extends React.Component<SendMessageParams, {}> {
|
||||||
dispatch={dispatch}
|
dispatch={dispatch}
|
||||||
step={currentStep}
|
step={currentStep}
|
||||||
sequence={currentSequence} />
|
sequence={currentSequence} />
|
||||||
<i className="fa fa-arrows-v step-control" />
|
<StepIconGroup
|
||||||
<i className="fa fa-clone step-control"
|
onClone={() => dispatch(splice({
|
||||||
onClick={() => dispatch(splice({
|
|
||||||
step: currentStep,
|
step: currentStep,
|
||||||
sequence: currentSequence,
|
sequence: currentSequence,
|
||||||
index
|
index
|
||||||
}))} />
|
}))}
|
||||||
<i className="fa fa-trash step-control"
|
onTrash={() => remove({ dispatch, index, sequence: currentSequence })}
|
||||||
onClick={() => remove({ dispatch, index, sequence: currentSequence })} />
|
helpText={t(ToolTips.SEND_MESSAGE)} />
|
||||||
<Help text={t(ToolTips.SEND_MESSAGE)} />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { StepParams } from "../interfaces";
|
import { StepParams } from "../interfaces";
|
||||||
import { StepTitleBar } from "./step_title_bar";
|
import { StepTitleBar } from "./step_title_bar";
|
||||||
import { Help } from "../../ui";
|
|
||||||
import { splice, remove } from "./index";
|
import { splice, remove } from "./index";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { Link } from "react-router";
|
import { Link } from "react-router";
|
||||||
import { ToolTips } from "../../constants";
|
import { ToolTips } from "../../constants";
|
||||||
|
import { StepIconGroup } from "../step_icon_group";
|
||||||
|
|
||||||
export function TileTakePhoto({ dispatch, currentStep, index, currentSequence }: StepParams) {
|
export function TileTakePhoto({ dispatch, currentStep, index, currentSequence }: StepParams) {
|
||||||
return (<div>
|
return (<div>
|
||||||
|
@ -17,16 +17,14 @@ export function TileTakePhoto({ dispatch, currentStep, index, currentSequence }:
|
||||||
dispatch={dispatch}
|
dispatch={dispatch}
|
||||||
step={currentStep}
|
step={currentStep}
|
||||||
sequence={currentSequence} />
|
sequence={currentSequence} />
|
||||||
<i className="fa fa-arrows-v step-control" />
|
<StepIconGroup
|
||||||
<i className="fa fa-clone step-control"
|
onClone={() => dispatch(splice({
|
||||||
onClick={() => dispatch(splice({
|
|
||||||
step: currentStep,
|
step: currentStep,
|
||||||
index,
|
index,
|
||||||
sequence: currentSequence
|
sequence: currentSequence
|
||||||
}))} />
|
}))}
|
||||||
<i className="fa fa-trash step-control"
|
onTrash={() => remove({ dispatch, index, sequence: currentSequence })}
|
||||||
onClick={() => remove({ dispatch, index, sequence: currentSequence })} />
|
helpText={t(ToolTips.TAKE_PHOTO)} />
|
||||||
<Help text={t(ToolTips.TAKE_PHOTO)} />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { StepTitleBar } from "./step_title_bar";
|
import { StepTitleBar } from "./step_title_bar";
|
||||||
import { Help } from "../../ui";
|
|
||||||
import { splice, remove } from "./index";
|
import { splice, remove } from "./index";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { StepInputBox } from "../inputs/step_input_box";
|
import { StepInputBox } from "../inputs/step_input_box";
|
||||||
import { StepParams } from "../interfaces";
|
import { StepParams } from "../interfaces";
|
||||||
import { ToolTips } from "../../constants";
|
import { ToolTips } from "../../constants";
|
||||||
|
import { StepIconGroup } from "../step_icon_group";
|
||||||
|
|
||||||
export function TileWait({ dispatch, currentStep, index, currentSequence }: StepParams) {
|
export function TileWait({ dispatch, currentStep, index, currentSequence }: StepParams) {
|
||||||
return (<div>
|
return (<div>
|
||||||
|
@ -17,16 +17,14 @@ export function TileWait({ dispatch, currentStep, index, currentSequence }: Step
|
||||||
dispatch={dispatch}
|
dispatch={dispatch}
|
||||||
step={currentStep}
|
step={currentStep}
|
||||||
sequence={currentSequence} />
|
sequence={currentSequence} />
|
||||||
<i className="fa fa-arrows-v step-control" />
|
<StepIconGroup
|
||||||
<i className="fa fa-clone step-control"
|
onClone={() => dispatch(splice({
|
||||||
onClick={() => dispatch(splice({
|
|
||||||
step: currentStep,
|
step: currentStep,
|
||||||
sequence: currentSequence,
|
sequence: currentSequence,
|
||||||
index
|
index
|
||||||
}))} />
|
}))}
|
||||||
<i className="fa fa-trash step-control"
|
onTrash={() => remove({ dispatch, index, sequence: currentSequence })}
|
||||||
onClick={() => remove({ dispatch, index, sequence: currentSequence })} />
|
helpText={t(ToolTips.WAIT)} />
|
||||||
<Help text={t(ToolTips.WAIT)} />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { StepTitleBar } from "./step_title_bar";
|
import { StepTitleBar } from "./step_title_bar";
|
||||||
import { Help } from "../../ui";
|
|
||||||
import { splice, remove } from "./index";
|
import { splice, remove } from "./index";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { StepInputBox } from "../inputs/step_input_box";
|
import { StepInputBox } from "../inputs/step_input_box";
|
||||||
import { StepParams } from "../interfaces";
|
import { StepParams } from "../interfaces";
|
||||||
import { ToolTips } from "../../constants";
|
import { ToolTips } from "../../constants";
|
||||||
|
import { StepIconGroup } from "../step_icon_group";
|
||||||
|
|
||||||
export function TileWritePin({ dispatch, currentStep, index, currentSequence }: StepParams) {
|
export function TileWritePin({ dispatch, currentStep, index, currentSequence }: StepParams) {
|
||||||
return (<div>
|
return (<div>
|
||||||
|
@ -17,16 +17,14 @@ export function TileWritePin({ dispatch, currentStep, index, currentSequence }:
|
||||||
dispatch={dispatch}
|
dispatch={dispatch}
|
||||||
step={currentStep}
|
step={currentStep}
|
||||||
sequence={currentSequence} />
|
sequence={currentSequence} />
|
||||||
<i className="fa fa-arrows-v step-control" />
|
<StepIconGroup
|
||||||
<i className="fa fa-clone step-control"
|
onClone={() => dispatch(splice({
|
||||||
onClick={() => dispatch(splice({
|
|
||||||
step: currentStep,
|
step: currentStep,
|
||||||
index,
|
index,
|
||||||
sequence: currentSequence
|
sequence: currentSequence
|
||||||
}))} />
|
}))}
|
||||||
<i className="fa fa-trash step-control"
|
onTrash={() => remove({ dispatch, index, sequence: currentSequence })}
|
||||||
onClick={() => remove({ dispatch, index, sequence: currentSequence })} />
|
helpText={t(ToolTips.WRITE_PIN)} />
|
||||||
<Help text={t(ToolTips.WRITE_PIN)} />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -21,7 +21,7 @@ export namespace Session {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
clear();
|
clear();
|
||||||
return undefined;
|
return undefined;
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Clear localstorage and sessionstorage. */
|
/** Clear localstorage and sessionstorage. */
|
||||||
|
|
|
@ -12,7 +12,7 @@ jest.mock("../../i18n", () => {
|
||||||
|
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Wow } from "../index";
|
import { Wow } from "../index";
|
||||||
import { mount, shallow } from "enzyme";
|
import { shallow } from "enzyme";
|
||||||
describe("<Wow/>", () => {
|
describe("<Wow/>", () => {
|
||||||
it("toggles server options", () => {
|
it("toggles server options", () => {
|
||||||
let x = shallow(<Wow />);
|
let x = shallow(<Wow />);
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import * as React from "react";
|
|
||||||
import { BackArrow } from "../back_arrow";
|
import { BackArrow } from "../back_arrow";
|
||||||
import { mount } from "enzyme";
|
import { mount } from "enzyme";
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import * as React from "react";
|
|
||||||
import { Help } from "../help";
|
import { Help } from "../help";
|
||||||
import { mount } from "enzyme";
|
import { mount } from "enzyme";
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import * as React from "react";
|
|
||||||
import { Markdown } from "../markdown";
|
import { Markdown } from "../markdown";
|
||||||
import { mount } from "enzyme";
|
import { mount } from "enzyme";
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import * as React from "react";
|
|
||||||
import { Page } from "../page";
|
import { Page } from "../page";
|
||||||
import { mount } from "enzyme";
|
import { mount } from "enzyme";
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import * as React from "react";
|
|
||||||
import { Saucer } from "../saucer";
|
import { Saucer } from "../saucer";
|
||||||
import { mount } from "enzyme";
|
import { mount } from "enzyme";
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import * as React from "react";
|
|
||||||
import { ToolTip } from "../tooltip";
|
import { ToolTip } from "../tooltip";
|
||||||
import { mount } from "enzyme";
|
import { mount } from "enzyme";
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import * as React from "react";
|
|
||||||
import { WidgetFooter } from "../widget_footer";
|
import { WidgetFooter } from "../widget_footer";
|
||||||
import { mount } from "enzyme";
|
import { mount } from "enzyme";
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue