Add "noUnusedLocals": true to tsconfig

pull/373/head
Rick Carlino 2017-08-02 10:14:08 -05:00
parent 28ce2fa09b
commit 7cc6f8a345
108 changed files with 195 additions and 342 deletions

View File

@ -1,4 +1,3 @@
import * as React from "react";
import { noop } from "lodash";
import { Everything } from "../interfaces";
import { location } from "./fake_state/location";
@ -8,8 +7,6 @@ import { bot } from "./fake_state/bot";
import { config } from "./fake_state/config";
import { draggable } from "./fake_state/draggable";
import { resources } from "./fake_state/resources";
import { createStore } from "redux";
import { rootReducer } from "../redux/root_reducer";
/** Factory function for empty state object. */
export function fakeState(dispatcher: Function = noop): Everything {

View File

@ -1,9 +1,6 @@
import { resourceReducer, emptyState } from "../resources/reducer";
import { TaggedResource } from "../resources/tagged_resources";
import * as _ from "lodash";
import { createStore } from "redux";
import { RestResources } from "../resources/interfaces";
import { ReduxAction } from "../redux/interfaces";
export let FAKE_RESOURCES: TaggedResource[] = [
{

View File

@ -1,17 +1,9 @@
import * as React from "react";
import { ControlsPopup } from "../controls_popup";
import { mount } from "enzyme";
import { State } from "../controls_popup";
import { DirectionButton } from "../controls/direction_button";
describe("<ControlsPopup />", () => {
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", () => {
expect(wrapper.state("isOpen")).toBeFalsy();

View File

@ -2,7 +2,6 @@ import {
buildResourceIndex,
FAKE_RESOURCES
} from "../__test_support__/resource_index_builder";
import { betterCompact } from "../util";
import { TaggedFarmEvent } from "../resources/tagged_resources";
const STUB_RESOURCE: TaggedFarmEvent = {

View File

@ -1,6 +1,6 @@
import { deleteUser } from "../actions";
import { API } from "../../api/api";
import * as moxios from "moxios";
import { deleteUser } from "../actions";
describe("deleteUser()", () => {
beforeEach(function () {
@ -20,7 +20,7 @@ describe("deleteUser()", () => {
let dispatch = jest.fn();
let getState = jest.fn();
getState.mockImplementation(() => ({ auth: {} }));
let result = thunk(dispatch, getState);
thunk(dispatch, getState);
moxios.wait(function () {
let request = moxios.requests.mostRecent();
request.respondWith({

View File

@ -1,4 +1,4 @@
import { AuthState, User } from "../auth/interfaces";
import { User } from "../auth/interfaces";
import { TaggedUser } from "../resources/tagged_resources";
export interface Props {

View File

@ -17,7 +17,6 @@ import { ResourceIndex } from "../resources/interfaces";
import { SequenceBodyItem } from "farmbot/dist";
import * as _ from "lodash";
import { Actions } from "../constants";
let WHOAH = "COOL";
export function edit(tr: TaggedResource, changes: Partial<typeof tr.body>):
ReduxAction<EditResourceParams> {

View File

@ -1,4 +1,3 @@
import * as React from "react";
import { mount } from "enzyme";
import { AxisDisplayGroup } from "../axis_display_group";
import { bot } from "../../__test_support__/fake_state/bot";

View File

@ -1,6 +1,5 @@
import * as React from "react";
import { isNaN } from "lodash";
import { AxisInputBoxProps, AxisInputBoxState } from "./interfaces";
import { AxisInputBoxProps } from "./interfaces";
import { Col, BlurableInput } from "../ui/index";
import { isUndefined } from "lodash";

View File

@ -1,5 +1,4 @@
import * as React from "react";
import { connect } from "react-redux";
import { DirectionButton } from "./controls/direction_button";

View File

@ -1,7 +1,6 @@
import { Farmbot } from "farmbot";
import { t } from "i18next";
import axios from "axios";
import * as Axios from "axios";
import * as _ from "lodash";
import { success, warning, info, error } from "farmbot-toastr";
import { devices } from "../device";
@ -145,7 +144,6 @@ export let saveAccountChanges: Thunk = function (dispatch, getState) {
};
let commandErr = (noun = "Command") => () => {
let msg = noun + " request failed.";
console.info("Took longer than 6 seconds: " + noun);
};
@ -373,10 +371,10 @@ const TOAST: ALLOWED_CHANNEL_NAMES = "toast";
function maybeShowLog(log: Log) {
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";
if (chanList.includes(TOAST)) {
switch (t) {
switch (m) {
case "success":
return success(log.message, TITLE);
case "busy":

View File

@ -18,9 +18,9 @@ describe("<HomingRow />", () => {
it("calls device", () => {
let { mock } = devices.current.calibrate as jest.Mock<{}>;
let result = mount(<CalibrationRow hardware={bot.hardware.mcu_params} />);
let thunkx = result.find("LockableButton").at(0).simulate("click");
let thunky = result.find("LockableButton").at(1).simulate("click");
let thunkz = result.find("LockableButton").at(2).simulate("click");
result.find("LockableButton").at(0).simulate("click");
result.find("LockableButton").at(1).simulate("click");
result.find("LockableButton").at(2).simulate("click");
expect(mock.calls.length).toEqual(2);
expect(mock.calls[0][0].axis).toEqual("x");
expect(mock.calls[1][0].axis).toEqual("y");

View File

@ -31,9 +31,9 @@ describe("<HomingRow />", () => {
it("calls device", () => {
let { mock } = devices.current.findHome as jest.Mock<{}>;
let result = mount(<HomingRow hardware={bot.hardware.mcu_params} />);
let thunkx = result.find("LockableButton").at(0).simulate("click");
let thunky = result.find("LockableButton").at(1).simulate("click");
let thunkz = result.find("LockableButton").at(2).simulate("click");
result.find("LockableButton").at(0).simulate("click");
result.find("LockableButton").at(1).simulate("click");
result.find("LockableButton").at(2).simulate("click");
expect(mock.calls.length).toEqual(2);
expect(mock.calls[0][0].axis).toEqual("x");
expect(mock.calls[1][0].axis).toEqual("y");

View File

@ -8,7 +8,6 @@ jest.mock("../../../device", () => ({
import * as React from "react";
import { mount } from "enzyme";
import { ZeroRow } from "../zero_row";
import { bot } from "../../../__test_support__/fake_state/bot";
import { devices } from "../../../device";
describe("<HomingRow />", () => {
@ -18,9 +17,9 @@ describe("<HomingRow />", () => {
it("calls device", () => {
let { mock } = devices.current.setZero as jest.Mock<{}>;
let result = mount(<ZeroRow />);
let thunkx = result.find("ZeroButton").at(0).simulate("click");
let thunky = result.find("ZeroButton").at(1).simulate("click");
let thunkz = result.find("ZeroButton").at(2).simulate("click");
result.find("ZeroButton").at(0).simulate("click");
result.find("ZeroButton").at(1).simulate("click");
result.find("ZeroButton").at(2).simulate("click");
expect(mock.calls.length).toEqual(3);
expect(mock.calls[0][0]).toEqual("x");
expect(mock.calls[1][0]).toEqual("y");

View File

@ -9,7 +9,6 @@ export function BooleanMCUInputGroup(props: BooleanMCUInputGroupProps) {
let {
bot,
dispatch,
tooltip,
name,
x,

View File

@ -1,5 +1,4 @@
import * as React from "react";
import { t } from "i18next";
import { MCUFactoryReset } from "../actions";
import { Widget, WidgetHeader, WidgetBody } from "../../ui/index";
import { HardwareSettingsProps } from "../interfaces";

View File

@ -1,6 +1,5 @@
import { BotStateTree } from "farmbot";
import {
ALLOWED_MESSAGE_TYPES,
McuParamName,
ConfigurationName,
Dictionary,
@ -34,17 +33,6 @@ export interface DeviceAccountSettings {
name: string;
webcam_url?: string;
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 {

View File

@ -1,5 +1,4 @@
/// <reference path="../typings/index.d.ts" />
import * as React from "react";
import { RootComponent } from "./routes";
import { store } from "./redux/store";
import { ready } from "./config/actions";

View File

@ -3,7 +3,6 @@ import { fakeFarmEvent, fakeSequence } from "../../../__test_support__/fake_stat
import { mount } from "enzyme";
import { EditFEForm, EditFEProps, FarmEventViewModel, recombine } from "../edit_fe_form";
import { isString } from "lodash";
import { TightlyCoupledFarmEventDropDown } from "../map_state_to_props_add_edit";
describe("<FarmEventForm/>", () => {
let props = (): EditFEForm["props"] => ({

View File

@ -2,7 +2,6 @@ import * as React from "react";
import { RepeatFormProps, FarmEventRepeatForm } from "../farm_event_repeat_form";
import { betterMerge } from "../../../util";
import { shallow, ShallowWrapper, render } from "enzyme";
import { FBSelectProps } from "../../../ui/new_fb_select";
import { get } from "lodash";
const DEFAULTS: RepeatFormProps = {

View File

@ -1,9 +1,6 @@
import { fakeState } from "../../../__test_support__/fake_state";
import { mapResourcesToCalendar } from "../map_state_to_props";
import { ResourceIndex } from "../../../resources/interfaces";
import { buildResourceIndex } from "../../../__test_support__/resource_index_builder";
import { TaggedResource } from "../../../resources/tagged_resources";
import * as moment from "moment";
describe("mapResourcesToCalendar()", () => {
it("returns a `Calendar` instance when given a resource index and unix time.",

View File

@ -1,4 +1,3 @@
import { maybeWarnAboutMissedTasks } from "../util";
describe("utils", () => {
it("warns about missed tasks", () => {

View File

@ -1,5 +1,4 @@
import { Calendar } from "../index";
import * as moment from "moment";
import { occurrence } from "../occurrence";
import {
TIME,

View File

@ -54,7 +54,6 @@ describe("scheduler", () => {
"repeat": 2,
"time_unit": "daily",
};
let now = moment("2017-08-01T19:22:38.502Z");
let intervalSeconds = farmEventIntervalSeconds(fakeEvent.repeat,
fakeEvent.time_unit as TimeUnit);
let result = scheduler({
@ -85,7 +84,6 @@ it("schedules a FarmEvent", () => {
"repeat": 2,
"time_unit": "daily",
};
let now = moment("2017-08-01T19:22:38.502Z");
const EXPECTED = [
moment("2017-08-01T17:30:00.000Z"),
moment("2017-08-03T17:30:00.000Z"),

View File

@ -3,13 +3,6 @@ import { CalendarOccurrence, CalendarDay } from "../../interfaces";
import * as moment from "moment";
import * as _ from "lodash";
interface CalendarData {
sortKey: number;
month: string;
day: number;
items: CalendarOccurrence[]
}
export class Calendar {
/** We sort by this attribute. Left as const so that the comiler can catch
* name changes. */

View File

@ -53,11 +53,6 @@ const LOOKUP: Record<TimeUnit, unitOfTime.Base> = {
"yearly": "years",
};
interface ConversionProps {
repeat: number;
time_unit: TimeUnit;
}
/** GIVEN: A time unit (hourly, weekly, etc) and a repeat (number)
* RETURNS: Number of seconds for interval.
* EXAMPLE: f(2, "minutely") => 120;

View File

@ -1,10 +1,4 @@
import * as moment from "moment";
import {
NewCalendarItem,
FarmEventWithSequence,
FarmEventWithExecutable,
FarmEventWithRegimen
} from "./interfaces";
import { FarmEventWithExecutable } from "./interfaces";
import { ResourceIndex } from "../../../resources/interfaces";
import {
selectAllFarmEvents,

View File

@ -30,7 +30,7 @@ import {
import { DropDownItem } from "../../ui/fb_select";
import { history } from "../../history";
// TIL: https://stackoverflow.com/a/24900248/1064917
import { betterMerge, fancyDebug } from "../../util";
import { betterMerge } from "../../util";
import { maybeWarnAboutMissedTasks } from "./util";
import { TzWarning } from "./tz_warning";
import { FarmEventRepeatForm } from "./farm_event_repeat_form";

View File

@ -2,7 +2,6 @@ import * as React from "react";
import { t } from "i18next";
import { Row, Col, BlurableInput, DropDownItem } from "../../ui/index";
import { FBSelect } from "../../ui/new_fb_select";
import { betterMerge } from "../../util";
import { repeatOptions } from "./map_state_to_props_add_edit";
import { keyBy } from "lodash";
import { TimeUnit } from "../interfaces";

View File

@ -2,10 +2,9 @@ import * as React from "react";
import { Link } from "react-router";
import { connect } from "react-redux";
import { t } from "i18next";
import { Row, Col } from "../../ui";
import { Row } from "../../ui";
import { mapStateToProps } from "./map_state_to_props";
import { FarmEventProps, CalendarOccurrence } from "../interfaces";
import { FBSelect } from "../../ui/new_fb_select";
import * as _ from "lodash";
export class PureFarmEvents extends React.Component<FarmEventProps, {}> {

View File

@ -7,11 +7,10 @@ import { occurrence } from "./calendar/occurrence";
import { findSequenceById } from "../../resources/selectors";
import { ResourceIndex } from "../../resources/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 /> */
export function mapStateToProps(state: Everything): FarmEventProps {
let x = joinFarmEventsToExecutable(state.resources.index);
let push = (state && state.router && state.router.push) || (() => { });
let calendar = mapResourcesToCalendar(state.resources.index, moment.now());
let calendarRows = calendar.getAll();

View File

@ -1,8 +1,6 @@
import { TaggedFarmEvent } from "../../resources/tagged_resources";
import { GetState } from "../../redux/interfaces";
import { findRegimenById } from "../../resources/selectors";
import * as moment from "moment";
import * as _ from "lodash";
/**
* PROBLEMS SOLVED:
@ -17,13 +15,12 @@ import * as _ from "lodash";
*/
export function maybeWarnAboutMissedTasks(tfe: TaggedFarmEvent, cb: Function) {
return function (dispatch: Function, getState: GetState) {
let state = getState();
let fe = tfe.body;
// STEP 1: Only do this check if it is a Regimen -
// sequences don't have this issue.
if (fe.executable_type === "Regimen") {
var NOW = moment();
var START_TIME = moment(fe.start_time);
let NOW = moment();
let START_TIME = moment(fe.start_time);
let TIMEFMT = "YYYY-MM-DD";
// STEP 2: Continue checking if the farm event is supposed to run today.

View File

@ -1,5 +1,4 @@
import * as React from "react";
import { Props } from "../interfaces";
import { getXYFromQuadrant } from "./util";
import { BotOriginQuadrant } from "../interfaces";
import { BotState } from "../../devices/interfaces";
@ -16,7 +15,7 @@ export class VirtualFarmBot extends
React.Component<VFBProps, Partial<VFBState>> {
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 { qx, qy } = getXYFromQuadrant((x || 0), (y || 0), quadrant);
return <g>

View File

@ -64,7 +64,7 @@ export class GardenMap extends
if (el && map && page) {
let zoomLvl = parseFloat(window.getComputedStyle(map).zoom || DRAG_ERROR);
let { pageX, pageY } = e;
let box = el.getBoundingClientRect();
// let box = el.getBoundingClientRect();
let crop = history.getCurrentLocation().pathname.split("/")[5];
let OFEntry = this.findCrop(crop);
let params: ScreenToGardenParams = {

View File

@ -7,7 +7,6 @@ import { ImageWorkspace } from "../weed_detector/image_workspace";
import { ToolTips } from "../../constants";
import { envSave } from "../weed_detector/remote_env/actions";
import { WDENVKey } from "../weed_detector/remote_env/interfaces";
import { devices } from "../../device";
import { selectImage } from "../images/actions";
import { calibrate, scanImage } from "./actions";

View File

@ -1,5 +1,4 @@
import { TaggedImage } from "../../resources/tagged_resources";
import { SyncStatus, Dictionary, FarmwareManifest } from "farmbot/dist";
import { WD_ENV } from "../weed_detector/remote_env/interfaces";
export interface CameraCalibrationState {

View File

@ -1,8 +1,6 @@
import "../../../unmock_i18next";
import * as React from "react";
import { ImageFlipper } from "../image_flipper";
import { fakeImages } from "../../../__test_support__/fake_state/images";
import * as freeze from "deep-freeze";
import { TaggedImage } from "../../../resources/tagged_resources";
import { defensiveClone } from "../../../util";

View File

@ -1,9 +1,6 @@
import * as React from "react";
import { t } from "i18next";
import * as _ from "lodash";
import * as moment from "moment";
import { ImageFlipperProps, ImageFlipperState } from "./interfaces";
import { safeStringFetch } from "../../util";
export const PLACEHOLDER_FARMBOT = "/placeholder_farmbot.jpg";

View File

@ -1,6 +1,6 @@
import * as React from "react";
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 { mapStateToProps } from "./state_to_props";
import { Photos } from "./images/photos";

View File

@ -1,4 +1,3 @@
import * as React from "react";
import { ImageWorkspace } from "../image_workspace";
describe("<Body/>", () => {

View File

@ -2,7 +2,7 @@ import * as _ from "lodash";
import axios from "axios";
import { t } from "i18next";
import { success, error } from "farmbot-toastr";
import { Thunk, GetState } from "../../redux/interfaces";
import { Thunk } from "../../redux/interfaces";
import { API } from "../../api";
import { Progress, ProgressCallback, HttpData } from "../../util";
import { GenericPointer } from "../../interfaces";

View File

@ -6,7 +6,6 @@ import { HSV } from "./interfaces";
import { WeedDetectorSlider } from "./slider";
import { TaggedImage } from "../../resources/tagged_resources";
import { t } from "i18next";
import * as _ from "lodash";
const RANGES = {
H: { LOWEST: 0, HIGHEST: 179 },

View File

@ -1,6 +1,5 @@
import * as React from "react";
import { connect } from "react-redux";
import { Pair } from "farmbot";
import { DetectorState, HSV } from "./interfaces";
import { TitleBar } from "./title";
import { devices } from "../../device";
@ -13,9 +12,8 @@ import { FarmwareProps } from "../../devices/interfaces";
import { mapStateToProps } from "../../farmware/state_to_props";
import { ToolTips } from "../../constants";
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 { envSave } from "./remote_env/actions";
import { translateImageWorkspaceAndSave } from "./actions";
@connect(mapStateToProps)

View File

@ -1,6 +1,6 @@
import { formatEnvKey, parseEnvKey } from "../translators";
import { SPECIAL_VALUES, getSpecialValue } from "../constants";
import { WD_ENV, WDENVKey } from "../interfaces";
import { WDENVKey } from "../interfaces";
import { getDropdownSelection } from "../../selectors";
import { prepopulateEnv } from "../selectors";
@ -21,7 +21,7 @@ describe("getSpecialValue()", () => {
it("crashes on malformed inputs", () => {
expect(() => {
getSpecialValue("FOo_bar!!")
getSpecialValue("FOo_bar!!");
}).toThrow();
});
});

View File

@ -1,4 +1,3 @@
import * as _ from "lodash";
import { TRANSLATORS, DEFAULT_FORMATTER } from "./constants";
import { WDENVKey } from "./interfaces";

View File

@ -2,7 +2,7 @@ import * as React from "react";
import {
RangeSlider
} from "@blueprintjs/core/dist/components/slider/rangeSlider";
import { isNumber, get } from "lodash";
import { get } from "lodash";
interface SliderProps {
onRelease(value: [number, number]): void;
@ -32,10 +32,7 @@ export class WeedDetectorSlider extends React.Component<SliderProps, State> {
render() {
let {
highest,
lowest,
lowValue,
highValue,
onRelease
lowest
} = this.props;
return <RangeSlider

View File

@ -1,4 +1,3 @@
import * as React from "react";
import { detectLanguage } from "../i18n";
import { FrontPage } from "./front_page";
import * as i18next from "i18next";

View File

@ -12,7 +12,6 @@ import {
import { links } from "./nav/links";
import { sync } from "./devices/actions";
import { lastUrlChunk } from "./util";
import { history, push } from "./history";
import { Row, Col } from "./ui/index";

View File

@ -1,5 +1,4 @@
import axios from "axios";
import { HttpData } from "./util";
function generateUrl(langCode: string) {
let lang = langCode.slice(0, 2);

View File

@ -1,4 +1,3 @@
import * as Axios from "axios";
import { ResourceName, DataChangeType, Dictionary } from "farmbot/dist";
import { devices } from "./device";
import { box } from "boxed_value";

View File

@ -10,7 +10,7 @@ import {
import { API } from "./api/index";
import { AuthState } from "./auth/interfaces";
import * as _ from "lodash";
import axios, { AxiosRequestConfig, AxiosResponse } from "axios";
import { AxiosRequestConfig, AxiosResponse } from "axios";
export function responseFulfilled(input: AxiosResponse): AxiosResponse {
let method = input.config.method;

View File

@ -1,4 +1,3 @@
import * as React from "react";
describe("<NavBar", function () {
it("renders helpful text", function () {

View File

@ -1,7 +1,5 @@
import * as React from "react";
import { Link } from "react-router";
import { t } from "i18next";
import * as moment from "moment";
import { NavBarProps, NavBarState } from "./interfaces";
import { EStopButton } from "../devices/components/e_stop_btn";
import { Session } from "../session";
@ -16,7 +14,6 @@ import { MobileMenu } from "./mobile_menu";
import {
Popover,
Position,
Tooltip,
PopoverInteractionKind
} from "@blueprintjs/core/dist";

View File

@ -1,6 +1,5 @@
import * as React from "react";
import { Link } from "react-router";
import { t } from "i18next";
import { history } from "../history";

View File

@ -19,7 +19,7 @@ jest.mock("axios", function () {
};
});
import { cachedCrop, DATA_URI, OpenFarmAPI } from "../index";
import { cachedCrop, OpenFarmAPI } from "../index";
describe("cachedIcon()", () => {
it("does an HTTP request if the icon can't be found locally", (done) => {
cachedCrop("lettuce")

View File

@ -1,6 +1,5 @@
import axios from "axios";
import { Dictionary } from "farmbot/dist";
import * as _ from "lodash";
import { HttpData } from "../util";
const BASE = "https://openfarm.cc/api/v1/crops/";

View File

@ -2,7 +2,6 @@ import * as React from "react";
import { mount } from "enzyme";
import { PasswordReset } from "../password_reset";
import * as moxios from "moxios";
import { API } from "../../api/api";
import { State } from "../interfaces";
describe("<PasswordReset/>", () => {

View File

@ -34,7 +34,7 @@ export function generateReducer<State>(initialState: State,
let clonedState = defensiveClone(state);
let clonedAction = defensiveClone(action);
let result: State = handler(clonedState, clonedAction);
result = (afterEach || NOOP)(defensiveClone(result), action)
result = (afterEach || NOOP)(defensiveClone(result), action);
return defensiveClone(result);
} as GeneratedReducer;

View File

@ -1,5 +1,5 @@
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";
export function editRegimen(r: TaggedRegimen | undefined,

View File

@ -9,7 +9,7 @@ describe("commitBulkEditor()", () => {
it("does nothing if no regimen is selected", () => {
let getState = () => fakeState();
let dispatch = jest.fn();
let results = commitBulkEditor()(dispatch, getState);
commitBulkEditor()(dispatch, getState);
expect(dispatch.mock.calls.length).toEqual(0);
expect(mockErr.mock.calls.length).toEqual(1);
});

View File

@ -2,7 +2,7 @@ import { isNaN, isNumber } from "lodash";
import { t } from "i18next";
import { error, warning } from "farmbot-toastr";
import { ReduxAction, Thunk } from "../../redux/interfaces";
import { ToggleDayParams, Week } from "./interfaces";
import { ToggleDayParams } from "./interfaces";
import { assertUuid, findSequence, findRegimen } from "../../resources/selectors";
import { groupRegimenItemsByWeek } from "./group_regimen_items_by_week";
import { defensiveClone } from "../../util";

View File

@ -47,7 +47,6 @@ export class BulkSchedulerWidget extends React.Component<BulkEditorProps, {}> {
render() {
let {
dispatch,
selectedSequence,
dailyOffsetMs,
weeks,
sequences

View File

@ -2,7 +2,6 @@ jest.unmock("../../../api/crud");
import * as React from "react";
import { mount } from "enzyme";
import { CopyButton } from "../copy_button";
import { TaggedRegimen } from "../../../resources/tagged_resources";
import { fakeRegimen } from "../../../__test_support__/fake_state/resources";
describe("Copy button", () => {

View File

@ -2,7 +2,7 @@ import * as React from "react";
import { RegimenNameInput } from "./regimen_name_input";
import { ActiveEditorProps } from "./interfaces";
import { t } from "i18next";
import { RegimenItem, RegimenItemCalendarRow } from "../interfaces";
import { RegimenItem } from "../interfaces";
import { TaggedRegimen } from "../../resources/tagged_resources";
import { defensiveClone } from "../../util";
import { overwrite } from "../../api/crud";

View File

@ -1,9 +1,7 @@
import {
RegimenItem,
RegimenProps,
CalendarRow,
RegimenItemCalendarRow,
Regimen
RegimenItemCalendarRow
} from "../interfaces";
import { AuthState } from "../../auth/interfaces";
import { BotState } from "../../devices/interfaces";
@ -45,4 +43,4 @@ export interface CopyButtnProps {
export interface DeleteButtonProps extends RegimenProps {
baseUrl: string;
};
}

View File

@ -60,7 +60,7 @@ export class RegimensList extends
}
render() {
let { dispatch, regimen, regimens } = this.props;
let { dispatch, regimens } = this.props;
return (
<div className="regimen-list">

View File

@ -1,7 +1,7 @@
import * as React from "react";
import { Link } from "react-router";
import { RegimenListItemProps } from "../interfaces";
import { isMobile, lastUrlChunk, urlFriendly } from "../../util";
import { lastUrlChunk, urlFriendly } from "../../util";
import { selectRegimen } from "../actions";
import {
TaggedRegimen,

View File

@ -1,7 +1,6 @@
import { buildResourceIndex } from "../../__test_support__/resource_index_builder";
import { findSlotByToolId } from "../selectors";
import { resourceReducer } from "../reducer";
import { Actions } from "../../constants";
import { TaggedTool, TaggedToolSlotPointer } from "../tagged_resources";
import { createOK } from "../actions";
import { generateUuid } from "../util";

View File

@ -1,13 +1,11 @@
import * as _ from "lodash";
import * as moment from "moment";
import { generateReducer } from "../redux/generate_reducer";
import { RestResources, ResourceIndex } from "./interfaces";
import {
TaggedResource,
ResourceName,
sanityCheck,
isTaggedResource,
TaggedSequence
isTaggedResource
} from "./tagged_resources";
import { generateUuid, arrayWrap } from "./util";
import { EditResourceParams } from "../api/interfaces";
@ -32,7 +30,6 @@ import {
farmwareState
} from "../farmware/reducer";
import { Actions } from "../constants";
import { uuid as rando } from "farmbot/dist";
let consumerReducer = combineReducers<RestResources["consumers"]>({
regimens,

View File

@ -27,8 +27,7 @@ import {
TaggedToolSlotPointer,
TaggedUser
} from "./tagged_resources";
import { CowardlyDictionary, betterCompact, sortResourcesById, betterMerge } from "../util";
import { ToolSlotPointer } from "../interfaces";
import { CowardlyDictionary, betterCompact, sortResourcesById } from "../util";
type StringMap = CowardlyDictionary<string>;
export let findId = (index: ResourceIndex, kind: ResourceName, id: number) => {

View File

@ -4,7 +4,7 @@ import { Dictionary } from "farmbot/dist";
import { betterCompact } from "../util";
import * as _ from "lodash";
var count = 0;
let count = 0;
export function generateUuid(id: number | undefined, kind: ResourceName) {
return `${joinKindAndId(kind, id)}.${count++}`
}

View File

@ -4,14 +4,11 @@ import { InputDefault } from "../input_default";
import { mount } from "enzyme";
import { TaggedSequence } from "../../../resources/tagged_resources";
import { MoveAbsolute } from "farmbot/dist";
import { updateStep } from "../../step_tiles/index";
import { fakeState } from "../../../__test_support__/fake_state";
import { Wrapper } from "../../../__test_support__/wrapper";
describe("<InputDefault/>", () => {
it("updates the step", () => {
let dispatcher = jest.fn();
let state = fakeState();
let step: MoveAbsolute = {
"kind": "move_absolute",
"args": {
@ -57,7 +54,6 @@ describe("<InputDefault/>", () => {
dispatch={dispatcher}
sequence={tr} />
</Wrapper>);
let x: jest.Mock<{}> = (updateStep as any).mock;
let input = c.find("input").first();
input.simulate("change");
input.simulate("blur");

View File

@ -3,10 +3,6 @@ import { InputUnknown } from "./input_unknown";
import { InputDefault } from "./input_default";
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) {
switch (props.field) {
case "label": case "lhs": case "message": case "milliseconds": case "op":

View File

@ -6,7 +6,7 @@ import { editCurrentSequence } from "./actions";
import { renderCeleryNode, splice, move } from "./step_tiles/index";
import { ColorPicker } from "../ui";
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 { stepGet } from "../draggable/actions";
import { pushStep } from "./actions";
@ -15,7 +15,6 @@ import { copySequence } from "./actions";
import { TaggedSequence } from "../resources/tagged_resources";
import { save, edit, destroy } from "../api/crud";
import { GetState } from "../redux/interfaces";
import { ToolTips } from "../constants";
import { get } from "lodash";
import { TestButton } from "./test_button";
import { warning } from "farmbot-toastr";

View File

@ -1,5 +1,4 @@
import * as React from "react";
import { Col } from "../ui/index";
import { t } from "i18next";
/** The bottom half of the Sequence editor panel (when no Sequence is selected). */

View File

@ -1,12 +1,10 @@
import * as React from "react";
import { Link } from "react-router";
import * as _ from "lodash";
import { t } from "i18next";
import { history, push } from "../history";
import { push } from "../history";
import { selectSequence } from "./actions";
import { SequencesListProps, SequencesListState } from "./interfaces";
import {
isMobile,
sortResourcesById,
urlFriendly,
lastUrlChunk

View File

@ -1,7 +1,7 @@
import * as React from "react";
import { StepButtonParams } from "../../interfaces";
import { StepButton } from "../index";
import { mount, shallow } from "enzyme";
import { shallow } from "enzyme";
import { fakeSequence } from "../../../__test_support__/fake_state/resources";
import { ReduxAction } from "../../../redux/interfaces";
import { EditResourceParams } from "../../../api/interfaces";

View File

@ -31,7 +31,6 @@ export function move({ step, sequence, to, from }: MoveParams) {
let next = defensiveClone(sequence);
let seq = next.body;
seq.body = seq.body || [];
let both = [from, to];
// WEIRD EDGE CASE: TODO:
// Works when from > to but not the other way around.
// Wish I could use one function for both cases, but don't have

View File

@ -1,6 +1,5 @@
import * as React from "react";
import { SequenceBodyItem as Step, Dictionary } from "farmbot";
import { addComment } from "../actions";
import { SequenceBodyItem as Step } from "farmbot";
import { t } from "i18next";
import { CowardlyDictionary } from "../../util";
import { StepTitleBarProps } from "../interfaces";

View File

@ -53,9 +53,9 @@ export class RefactoredExecuteBlock extends React.Component<ExecBlockParams, {}>
.map(function (x) {
let { id, name } = x.body;
if (_.isNumber(id) && (id !== p.currentStep.args.sequence_id)) {
output.push({ label: name, value: id })
output.push({ label: name, value: id });
}
})
});
return output;
}
@ -71,7 +71,7 @@ export class RefactoredExecuteBlock extends React.Component<ExecBlockParams, {}>
let { sequence_id } = p.currentStep.args;
if (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 {
return undefined;
}

View File

@ -1,10 +1,10 @@
import * as React from "react";
import { StepParams } from "../interfaces";
import { StepTitleBar } from "./step_title_bar";
import { Help } from "../../ui";
import { splice, remove } from "./index";
import { t } from "i18next";
import { ToolTips } from "../../constants";
import { StepIconGroup } from "../step_icon_group";
export function TileExecuteScript({ dispatch, currentStep, index, currentSequence }: StepParams) {
if (currentStep.kind === "execute_script") {
@ -17,16 +17,14 @@ export function TileExecuteScript({ dispatch, currentStep, index, currentSequenc
dispatch={dispatch}
step={currentStep}
sequence={currentSequence} />
<i className="fa fa-arrows-v step-control" />
<i className="fa fa-clone step-control"
onClick={() => dispatch(splice({
<StepIconGroup
onClone={() => dispatch(splice({
step: currentStep,
index,
sequence: currentSequence
}))} />
<i className="fa fa-trash step-control"
onClick={() => remove({ dispatch, index, sequence: currentSequence })} />
<Help text={t(ToolTips.EXECUTE_SCRIPT)} />
}))}
onTrash={() => remove({ dispatch, index, sequence: currentSequence })}
helpText={t(ToolTips.EXECUTE_SCRIPT)} />
</div>
</div>
</div>

View File

@ -2,15 +2,14 @@ import * as React from "react";
import { t } from "i18next";
import { splice, remove } from "./index";
import { StepTitleBar } from "./step_title_bar";
import { Help } from "../../ui";
import { FindHome, ALLOWED_AXIS } from "farmbot";
import * as _ from "lodash";
import { StepParams } from "../interfaces";
import { TaggedSequence } from "../../resources/tagged_resources";
import { ResourceIndex } from "../../resources/interfaces";
import { edit, overwrite } from "../../api/crud";
import { overwrite } from "../../api/crud";
import { defensiveClone } from "../../util";
import { ToolTips } from "../../constants";
import { StepIconGroup } from "../step_icon_group";
export function TileFindHome(props: StepParams) {
if (props.currentStep.kind === "find_home") {
@ -60,16 +59,14 @@ class InnerFindHome extends React.Component<FindHomeParams, {}> {
dispatch={dispatch}
step={currentStep}
sequence={currentSequence} />
<i className="fa fa-arrows-v step-control" />
<i className="fa fa-clone step-control"
onClick={() => dispatch(splice({
<StepIconGroup
onTrash={() => remove({ dispatch, index, sequence: currentSequence })}
onClone={() => dispatch(splice({
step: currentStep,
sequence: currentSequence,
index
}))} />
<i className="fa fa-trash step-control"
onClick={() => remove({ dispatch, index, sequence: currentSequence })} />
<Help text={t(ToolTips.FIND_HOME)} />
}))}
helpText={t(ToolTips.FIND_HOME)} />
</div>
</div>
</div>
@ -81,8 +78,8 @@ class InnerFindHome extends React.Component<FindHomeParams, {}> {
<div className="bottom-content">
<div className="channel-fields">
<form>
{AXIS_CHOICES.map((axis, index) => {
return <div key={index} style={{ display: "inline" }}>
{AXIS_CHOICES.map((axis, i) => {
return <div key={i} style={{ display: "inline" }}>
<label>
<input type="radio"
value={axis}

View File

@ -1,7 +1,7 @@
import * as _ from "lodash";
import * as React from "react";
import { t } from "i18next";
import { DropDownItem, Help } from "../../../ui";
import { DropDownItem } from "../../../ui";
import { TaggedSequence } from "../../../resources/tagged_resources";
import { If, Execute, Nothing } from "farmbot/dist";
import { ResourceIndex } from "../../../resources/interfaces";
@ -16,6 +16,7 @@ import { overwrite } from "../../../api/crud";
import { NULL_CHOICE } from "../../../ui/fb_select";
import { range } from "lodash";
import { ToolTips } from "../../../constants";
import { StepIconGroup } from "../../step_icon_group";
export interface IfParams {
currentSequence: TaggedSequence;
@ -92,12 +93,10 @@ export function InnerIf(props: IfParams) {
dispatch={dispatch}
step={currentStep}
sequence={currentSequence} />
<i className="fa fa-arrows-v step-control" />
<i className="fa fa-clone step-control"
onClick={() => dispatch(splice(stuff))} />
<i className="fa fa-trash step-control"
onClick={() => remove(stuff)} />
<Help text={t(ToolTips.IF)} />
<StepIconGroup
onClone={() => dispatch(splice(stuff))}
onTrash={() => remove(stuff)}
helpText={t(ToolTips.IF)} />
{recursive && (
<span>
<i className="fa fa-exclamation-triangle"></i>
@ -128,7 +127,7 @@ export function InnerIf(props: IfParams) {
export let IfBlockDropDownHandler = (props: IfParams,
key: "_else" | "_then") => {
let { dispatch, currentSequence, currentStep, index } = props;
let { dispatch, index } = props;
let step = props.currentStep;
let sequence = props.currentSequence;
let block = step.args[key];

View File

@ -14,7 +14,6 @@ import {
Row,
Col,
} from "../../ui";
import { StepInputBox } from "../inputs/step_input_box";
import { t } from "i18next";
import { StepTitleBar } from "./step_title_bar";
import {
@ -33,6 +32,7 @@ import { Xyz } from "../../devices/interfaces";
import { TileMoveAbsSelect } from "./tile_move_absolute/select";
import { InputBox } from "./tile_move_absolute/input_box";
import { ToolTips } from "../../constants";
import { StepIconGroup } from "../step_icon_group";
interface Args {
location: Tool | Coordinate | Point;
@ -133,21 +133,14 @@ export class TileMoveAbsolute extends Component<StepParams, MoveAbsState> {
<div className="step-header move-absolute-step">
<StepTitleBar index={index} dispatch={dispatch} step={currentStep}
sequence={currentSequence} />
<i className="fa fa-arrows-v step-control" />
<i className="fa fa-clone step-control"
onClick={() => dispatch(splice({
<StepIconGroup
onClone={() => dispatch(splice({
step: currentStep,
index,
sequence: currentSequence
}))} />
<i className="fa fa-trash step-control"
onClick={() => remove({ dispatch, index, sequence: currentSequence })} />
<div className="help">
<i className="fa fa-question-circle help-icon" />
<div className="help-text">
{t(ToolTips.MOVE_ABSOLUTE)}
</div>
</div>
}))}
onTrash={() => remove({ dispatch, index, sequence: currentSequence })}
helpText={t(ToolTips.MOVE_ABSOLUTE)} />
</div>
</Col>
</Row>

View File

@ -2,7 +2,7 @@
* figures out the corresponding Tool | Coordinate | Point */
import { DropDownItem } from "../../../ui/index";
import { ResourceIndex } from "../../../resources/interfaces";
import { KnownGroupTag, LocationData, CALLBACK } from "./interfaces";
import { KnownGroupTag, LocationData } from "./interfaces";
import { findPointerByTypeAndId, findToolById } from "../../../resources/selectors";
/** Takes a DropDownItem and turns it into data suitable

View File

@ -1,12 +1,11 @@
import * as React from "react";
import { StepTitleBar } from "./step_title_bar";
import { Help } from "../../ui";
import { splice, remove } from "./index";
import { t } from "i18next";
import { StepInputBox } from "../inputs/step_input_box";
import { StepParams } from "../interfaces";
import { ToolTips } from "../../constants";
import { StepIconGroup } from "../step_icon_group";
export function TileMoveRelative({ dispatch, currentStep, index, currentSequence }: StepParams) {
return (<div>
@ -18,16 +17,14 @@ export function TileMoveRelative({ dispatch, currentStep, index, currentSequence
dispatch={dispatch}
step={currentStep}
sequence={currentSequence} />
<i className="fa fa-arrows-v step-control" />
<i className="fa fa-clone step-control"
onClick={() => dispatch(splice({
<StepIconGroup
onClone={() => dispatch(splice({
step: currentStep,
index,
sequence: currentSequence
}))} />
<i className="fa fa-trash step-control"
onClick={() => remove({ dispatch, index, sequence: currentSequence })} />
<Help text={t(ToolTips.MOVE_RELATIVE)} />
}))}
onTrash={() => remove({ dispatch, index, sequence: currentSequence })}
helpText={t(ToolTips.MOVE_RELATIVE)} />
</div>
</div>
</div>

View File

@ -1,11 +1,11 @@
import * as React from "react";
import { StepTitleBar } from "./step_title_bar";
import { splice, remove } from "./index";
import { Help } from "../../ui";
import { t } from "i18next";
import { StepInputBox } from "../inputs/step_input_box";
import { StepParams } from "../interfaces";
import { ToolTips } from "../../constants";
import { StepIconGroup } from "../step_icon_group";
export function TileReadPin({ dispatch, currentStep, index, currentSequence }: StepParams) {
return (<div>
@ -17,16 +17,14 @@ export function TileReadPin({ dispatch, currentStep, index, currentSequence }: S
dispatch={dispatch}
step={currentStep}
sequence={currentSequence} />
<i className="fa fa-arrows-v step-control" />
<i className="fa fa-clone step-control"
onClick={() => dispatch(splice({
<StepIconGroup
onClone={() => dispatch(splice({
step: currentStep,
index,
sequence: currentSequence
}))} />
<i className="fa fa-trash step-control"
onClick={() => remove({ dispatch, index, sequence: currentSequence })} />
<Help text={t(ToolTips.READ_PIN)} />
}))}
onTrash={() => remove({ dispatch, index, sequence: currentSequence })}
helpText={t(ToolTips.READ_PIN)} />
</div>
</div>
</div>
@ -64,4 +62,4 @@ export function TileReadPin({ dispatch, currentStep, index, currentSequence }: S
</div>
</div>
</div>);
};
}

View File

@ -1,7 +1,7 @@
import * as React from "react";
import { splice, remove } from "./index";
import { StepTitleBar } from "./step_title_bar";
import { Help, DropDownItem } from "../../ui";
import { DropDownItem } from "../../ui";
import { t } from "i18next";
import { StepInputBox } from "../inputs/step_input_box";
import { SendMessage, ALLOWED_CHANNEL_NAMES } from "farmbot";
@ -17,6 +17,7 @@ import {
EACH_CHANNEL,
channel
} from "./tile_send_message_support";
import { StepIconGroup } from "../step_icon_group";
type ChannelName = ALLOWED_CHANNEL_NAMES;
export function TileSendMessage(props: StepParams) {
if (props.currentStep.kind === "send_message") {
@ -41,16 +42,16 @@ interface SendMessageParams {
class RefactoredSendMessage extends React.Component<SendMessageParams, {}> {
get args() { return this.props.currentStep.args; }
get message() { return this.args.message };
get message_type() { return this.args.message_type }
get message() { return this.args.message; }
get message_type() { return this.args.message_type; }
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 index() { return this.props.index }
get index() { return this.props.index; }
get currentSelection() {
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) => {
return this.channels.includes(name);
}
@ -80,7 +81,7 @@ class RefactoredSendMessage extends React.Component<SendMessageParams, {}> {
index: this.index,
executor: (step: SendMessage) => {
if (_.isString(x.value)) {
step.args.message_type = x.value
step.args.message_type = x.value;
} else {
throw new Error("Strings only in send_message.");
}
@ -100,16 +101,14 @@ class RefactoredSendMessage extends React.Component<SendMessageParams, {}> {
dispatch={dispatch}
step={currentStep}
sequence={currentSequence} />
<i className="fa fa-arrows-v step-control" />
<i className="fa fa-clone step-control"
onClick={() => dispatch(splice({
<StepIconGroup
onClone={() => dispatch(splice({
step: currentStep,
sequence: currentSequence,
index
}))} />
<i className="fa fa-trash step-control"
onClick={() => remove({ dispatch, index, sequence: currentSequence })} />
<Help text={t(ToolTips.SEND_MESSAGE)} />
}))}
onTrash={() => remove({ dispatch, index, sequence: currentSequence })}
helpText={t(ToolTips.SEND_MESSAGE)} />
</div>
</div>
</div>

View File

@ -1,11 +1,11 @@
import * as React from "react";
import { StepParams } from "../interfaces";
import { StepTitleBar } from "./step_title_bar";
import { Help } from "../../ui";
import { splice, remove } from "./index";
import { t } from "i18next";
import { Link } from "react-router";
import { ToolTips } from "../../constants";
import { StepIconGroup } from "../step_icon_group";
export function TileTakePhoto({ dispatch, currentStep, index, currentSequence }: StepParams) {
return (<div>
@ -17,16 +17,14 @@ export function TileTakePhoto({ dispatch, currentStep, index, currentSequence }:
dispatch={dispatch}
step={currentStep}
sequence={currentSequence} />
<i className="fa fa-arrows-v step-control" />
<i className="fa fa-clone step-control"
onClick={() => dispatch(splice({
<StepIconGroup
onClone={() => dispatch(splice({
step: currentStep,
index,
sequence: currentSequence
}))} />
<i className="fa fa-trash step-control"
onClick={() => remove({ dispatch, index, sequence: currentSequence })} />
<Help text={t(ToolTips.TAKE_PHOTO)} />
}))}
onTrash={() => remove({ dispatch, index, sequence: currentSequence })}
helpText={t(ToolTips.TAKE_PHOTO)} />
</div>
</div>
</div>

View File

@ -1,11 +1,11 @@
import * as React from "react";
import { StepTitleBar } from "./step_title_bar";
import { Help } from "../../ui";
import { splice, remove } from "./index";
import { t } from "i18next";
import { StepInputBox } from "../inputs/step_input_box";
import { StepParams } from "../interfaces";
import { ToolTips } from "../../constants";
import { StepIconGroup } from "../step_icon_group";
export function TileWait({ dispatch, currentStep, index, currentSequence }: StepParams) {
return (<div>
@ -17,16 +17,14 @@ export function TileWait({ dispatch, currentStep, index, currentSequence }: Step
dispatch={dispatch}
step={currentStep}
sequence={currentSequence} />
<i className="fa fa-arrows-v step-control" />
<i className="fa fa-clone step-control"
onClick={() => dispatch(splice({
<StepIconGroup
onClone={() => dispatch(splice({
step: currentStep,
sequence: currentSequence,
index
}))} />
<i className="fa fa-trash step-control"
onClick={() => remove({ dispatch, index, sequence: currentSequence })} />
<Help text={t(ToolTips.WAIT)} />
}))}
onTrash={() => remove({ dispatch, index, sequence: currentSequence })}
helpText={t(ToolTips.WAIT)} />
</div>
</div>
</div>

View File

@ -1,11 +1,11 @@
import * as React from "react";
import { StepTitleBar } from "./step_title_bar";
import { Help } from "../../ui";
import { splice, remove } from "./index";
import { t } from "i18next";
import { StepInputBox } from "../inputs/step_input_box";
import { StepParams } from "../interfaces";
import { ToolTips } from "../../constants";
import { StepIconGroup } from "../step_icon_group";
export function TileWritePin({ dispatch, currentStep, index, currentSequence }: StepParams) {
return (<div>
@ -17,16 +17,14 @@ export function TileWritePin({ dispatch, currentStep, index, currentSequence }:
dispatch={dispatch}
step={currentStep}
sequence={currentSequence} />
<i className="fa fa-arrows-v step-control" />
<i className="fa fa-clone step-control"
onClick={() => dispatch(splice({
<StepIconGroup
onClone={() => dispatch(splice({
step: currentStep,
index,
sequence: currentSequence
}))} />
<i className="fa fa-trash step-control"
onClick={() => remove({ dispatch, index, sequence: currentSequence })} />
<Help text={t(ToolTips.WRITE_PIN)} />
}))}
onTrash={() => remove({ dispatch, index, sequence: currentSequence })}
helpText={t(ToolTips.WRITE_PIN)} />
</div>
</div>
</div>

View File

@ -21,7 +21,7 @@ export namespace Session {
} catch (error) {
clear();
return undefined;
};
}
}
/** Clear localstorage and sessionstorage. */

View File

@ -12,7 +12,7 @@ jest.mock("../../i18n", () => {
import * as React from "react";
import { Wow } from "../index";
import { mount, shallow } from "enzyme";
import { shallow } from "enzyme";
describe("<Wow/>", () => {
it("toggles server options", () => {
let x = shallow(<Wow />);

View File

@ -1,4 +1,3 @@
import * as React from "react";
import { BackArrow } from "../back_arrow";
import { mount } from "enzyme";

View File

@ -1,4 +1,3 @@
import * as React from "react";
import { Help } from "../help";
import { mount } from "enzyme";

View File

@ -1,4 +1,3 @@
import * as React from "react";
import { Markdown } from "../markdown";
import { mount } from "enzyme";

View File

@ -1,4 +1,3 @@
import * as React from "react";
import { Page } from "../page";
import { mount } from "enzyme";

View File

@ -1,4 +1,3 @@
import * as React from "react";
import { Saucer } from "../saucer";
import { mount } from "enzyme";

View File

@ -1,4 +1,3 @@
import * as React from "react";
import { ToolTip } from "../tooltip";
import { mount } from "enzyme";

View File

@ -1,4 +1,3 @@
import * as React from "react";
import { WidgetFooter } from "../widget_footer";
import { mount } from "enzyme";

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