Still debugging.

pull/376/head
Rick Carlino 2017-08-02 15:05:33 -05:00
parent 8754f38b56
commit d3239c602f
14 changed files with 21 additions and 25 deletions

View File

@ -5,7 +5,7 @@ import {
} from "../resources/tagged_resources";
import { generateUuid } from "../resources/util";
var ID_COUNTER = 0;
let ID_COUNTER = 0;
// tslint:disable-next-line:max-line-length
export function fakeResource<T extends Name,

View File

@ -11,6 +11,7 @@ import {
describe("util", () => {
describe("safeStringFetch", () => {
let data = {
// tslint:disable-next-line:no-null-keyword
"null": null,
"undefined": undefined,
"number": 0,

View File

@ -20,4 +20,3 @@ export function mapStateToProps(props: Everything): Props {
dispatch: () => { throw new Error("NEVER SHOULD HAPPEN"); }
};
}

View File

@ -48,7 +48,7 @@ export class API {
static parseURL(url: string): UrlInfo {
// Such an amazing hack!
var info = document.createElement("a");
let info = document.createElement("a");
info.href = url;
return info;
}

View File

@ -19,4 +19,3 @@ export let configReducer = generateReducer<ConfigState>(initialState)
s.host = payload.host;
return s;
});

View File

@ -20,4 +20,3 @@ export function mapStateToProps(props: Everything): Props {
peripherals
};
}

View File

@ -36,6 +36,14 @@ function incomingStatus(statusMessage: HardwareState) {
function isLog(x: object): x is Log {
return _.isObject(x) && _.isString(_.get(x, "message" as keyof Log));
}
let commandErr = (noun = "Command") => () => {
console.info("Took longer than 6 seconds: " + noun);
};
let commandOK = (noun = "Command") => () => {
let msg = noun + " request sent to device.";
success(msg, t("Request sent"));
};
export function checkControllerUpdates() {
let noun = "Check for Updates";
@ -143,15 +151,6 @@ export let saveAccountChanges: Thunk = function (dispatch, getState) {
return save(getDeviceAccountSettings(getState().resources.index));
};
let commandErr = (noun = "Command") => () => {
console.info("Took longer than 6 seconds: " + noun);
};
let commandOK = (noun = "Command") => () => {
let msg = noun + " request sent to device.";
success(msg, t("Request sent"));
};
export let fetchReleases =
(url: string) => (dispatch: Function, getState: Function) => {
axios

View File

@ -14,4 +14,3 @@ export function mapStateToProps(props: Everything): Props {
images: selectAllImages(props.resources.index)
};
}

View File

@ -13,6 +13,9 @@ export const links = [
{ name: "Farmware", icon: "crosshairs", slug: "farmware" }
];
// if (process.env.NODE_ENV !== "production") {
// links.push({ name: "X", icon: "leaf", slug: "debug" });
// }
export const NavLinks = () => {
let currPath = history.getCurrentLocation().pathname;
return (

View File

@ -6,7 +6,7 @@ import * as _ from "lodash";
let count = 0;
export function generateUuid(id: number | undefined, kind: ResourceName) {
return `${joinKindAndId(kind, id)}.${count++}`
return `${joinKindAndId(kind, id)}.${count++}`;
}
export function arrayWrap<T>(input: T | (T[])): T[] {

View File

@ -11,7 +11,7 @@ export function pushStep(step: SequenceBodyItem,
sequence: TaggedSequence) {
let next = defensiveClone(sequence);
next.body.body = next.body.body || [];
next.body.body.push(defensiveClone(step))
next.body.body.push(defensiveClone(step));
dispatch(overwrite(sequence, next.body));
}
@ -28,7 +28,7 @@ export function copySequence(payload: TaggedSequence) {
copy.body.name = copy.body.name + ` copy ${count++}`;
copy.uuid = "HEY REDUCER! Set this!";
dispatch(init(copy));
}
};
}
export function moveStep(step: Step,
@ -39,7 +39,7 @@ export function moveStep(step: Step,
type: "MOVE_STEP",
payload: { step, from, to }
};
}
};
}
export function changeStepSelect(

View File

@ -21,7 +21,7 @@ export function formatSelectedDropdown(ri: ResourceIndex, ld: LocationData): Dro
function toolbar(ri: ResourceIndex, ld: Tool): DropDownItem {
let tool = findToolById(ri, ld.args.tool_id).body;
let label = dropDownName("Tool", tool.name);
return { label, value: tool.id || -999 }
return { label, value: tool.id || -999 };
}
function point(ri: ResourceIndex, ld: Point): DropDownItem {
@ -39,7 +39,7 @@ function point(ri: ResourceIndex, ld: Point): DropDownItem {
label = dropDownName(p.pointer_type, p.name, { x: p.x, y: p.y, z: p.z });
break;
}
return { label, value: p.id || -999 }
return { label, value: p.id || -999 };
}
function other() { return NULL_CHOICE; }

View File

@ -16,7 +16,7 @@ export function generateList(input: ResourceIndex): DropDownItem[] {
let toolNameById = mapToolIdToName(input);
let SORT_KEY: keyof DropDownItem = "headingId";
let points = selectAllPoints(input)
.filter(x => (x.body.pointer_type !== "ToolSlot"))
.filter(x => (x.body.pointer_type !== "ToolSlot"));
let toolDDI = selectAllTools(input)
.filter(x => !!x.body.id)
.map(t => formatTools(t));

View File

@ -63,9 +63,6 @@
"no-shadowed-variable": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unused-locals": true,
"no-unused-parameters": true,
"no-unused-expression": true,
"no-unused-variable": [
true
],