Still debugging.
parent
8754f38b56
commit
d3239c602f
|
@ -5,7 +5,7 @@ import {
|
||||||
} from "../resources/tagged_resources";
|
} from "../resources/tagged_resources";
|
||||||
import { generateUuid } from "../resources/util";
|
import { generateUuid } from "../resources/util";
|
||||||
|
|
||||||
var ID_COUNTER = 0;
|
let ID_COUNTER = 0;
|
||||||
|
|
||||||
// tslint:disable-next-line:max-line-length
|
// tslint:disable-next-line:max-line-length
|
||||||
export function fakeResource<T extends Name,
|
export function fakeResource<T extends Name,
|
||||||
|
|
|
@ -11,6 +11,7 @@ import {
|
||||||
describe("util", () => {
|
describe("util", () => {
|
||||||
describe("safeStringFetch", () => {
|
describe("safeStringFetch", () => {
|
||||||
let data = {
|
let data = {
|
||||||
|
// tslint:disable-next-line:no-null-keyword
|
||||||
"null": null,
|
"null": null,
|
||||||
"undefined": undefined,
|
"undefined": undefined,
|
||||||
"number": 0,
|
"number": 0,
|
||||||
|
|
|
@ -20,4 +20,3 @@ export function mapStateToProps(props: Everything): Props {
|
||||||
dispatch: () => { throw new Error("NEVER SHOULD HAPPEN"); }
|
dispatch: () => { throw new Error("NEVER SHOULD HAPPEN"); }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ export class API {
|
||||||
|
|
||||||
static parseURL(url: string): UrlInfo {
|
static parseURL(url: string): UrlInfo {
|
||||||
// Such an amazing hack!
|
// Such an amazing hack!
|
||||||
var info = document.createElement("a");
|
let info = document.createElement("a");
|
||||||
info.href = url;
|
info.href = url;
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,4 +19,3 @@ export let configReducer = generateReducer<ConfigState>(initialState)
|
||||||
s.host = payload.host;
|
s.host = payload.host;
|
||||||
return s;
|
return s;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -20,4 +20,3 @@ export function mapStateToProps(props: Everything): Props {
|
||||||
peripherals
|
peripherals
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,14 @@ function incomingStatus(statusMessage: HardwareState) {
|
||||||
function isLog(x: object): x is Log {
|
function isLog(x: object): x is Log {
|
||||||
return _.isObject(x) && _.isString(_.get(x, "message" as keyof 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() {
|
export function checkControllerUpdates() {
|
||||||
let noun = "Check for Updates";
|
let noun = "Check for Updates";
|
||||||
|
@ -143,15 +151,6 @@ export let saveAccountChanges: Thunk = function (dispatch, getState) {
|
||||||
return save(getDeviceAccountSettings(getState().resources.index));
|
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 =
|
export let fetchReleases =
|
||||||
(url: string) => (dispatch: Function, getState: Function) => {
|
(url: string) => (dispatch: Function, getState: Function) => {
|
||||||
axios
|
axios
|
||||||
|
|
|
@ -14,4 +14,3 @@ export function mapStateToProps(props: Everything): Props {
|
||||||
images: selectAllImages(props.resources.index)
|
images: selectAllImages(props.resources.index)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,9 @@ export const links = [
|
||||||
{ name: "Farmware", icon: "crosshairs", slug: "farmware" }
|
{ name: "Farmware", icon: "crosshairs", slug: "farmware" }
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// if (process.env.NODE_ENV !== "production") {
|
||||||
|
// links.push({ name: "X", icon: "leaf", slug: "debug" });
|
||||||
|
// }
|
||||||
export const NavLinks = () => {
|
export const NavLinks = () => {
|
||||||
let currPath = history.getCurrentLocation().pathname;
|
let currPath = history.getCurrentLocation().pathname;
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -6,7 +6,7 @@ import * as _ from "lodash";
|
||||||
|
|
||||||
let 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++}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function arrayWrap<T>(input: T | (T[])): T[] {
|
export function arrayWrap<T>(input: T | (T[])): T[] {
|
||||||
|
|
|
@ -11,7 +11,7 @@ export function pushStep(step: SequenceBodyItem,
|
||||||
sequence: TaggedSequence) {
|
sequence: TaggedSequence) {
|
||||||
let next = defensiveClone(sequence);
|
let next = defensiveClone(sequence);
|
||||||
next.body.body = next.body.body || [];
|
next.body.body = next.body.body || [];
|
||||||
next.body.body.push(defensiveClone(step))
|
next.body.body.push(defensiveClone(step));
|
||||||
dispatch(overwrite(sequence, next.body));
|
dispatch(overwrite(sequence, next.body));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ export function copySequence(payload: TaggedSequence) {
|
||||||
copy.body.name = copy.body.name + ` copy ${count++}`;
|
copy.body.name = copy.body.name + ` copy ${count++}`;
|
||||||
copy.uuid = "HEY REDUCER! Set this!";
|
copy.uuid = "HEY REDUCER! Set this!";
|
||||||
dispatch(init(copy));
|
dispatch(init(copy));
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function moveStep(step: Step,
|
export function moveStep(step: Step,
|
||||||
|
@ -39,7 +39,7 @@ export function moveStep(step: Step,
|
||||||
type: "MOVE_STEP",
|
type: "MOVE_STEP",
|
||||||
payload: { step, from, to }
|
payload: { step, from, to }
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function changeStepSelect(
|
export function changeStepSelect(
|
||||||
|
|
|
@ -21,7 +21,7 @@ export function formatSelectedDropdown(ri: ResourceIndex, ld: LocationData): Dro
|
||||||
function toolbar(ri: ResourceIndex, ld: Tool): DropDownItem {
|
function toolbar(ri: ResourceIndex, ld: Tool): DropDownItem {
|
||||||
let tool = findToolById(ri, ld.args.tool_id).body;
|
let tool = findToolById(ri, ld.args.tool_id).body;
|
||||||
let label = dropDownName("Tool", tool.name);
|
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 {
|
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 });
|
label = dropDownName(p.pointer_type, p.name, { x: p.x, y: p.y, z: p.z });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return { label, value: p.id || -999 }
|
return { label, value: p.id || -999 };
|
||||||
}
|
}
|
||||||
|
|
||||||
function other() { return NULL_CHOICE; }
|
function other() { return NULL_CHOICE; }
|
||||||
|
|
|
@ -16,7 +16,7 @@ export function generateList(input: ResourceIndex): DropDownItem[] {
|
||||||
let toolNameById = mapToolIdToName(input);
|
let toolNameById = mapToolIdToName(input);
|
||||||
let SORT_KEY: keyof DropDownItem = "headingId";
|
let SORT_KEY: keyof DropDownItem = "headingId";
|
||||||
let points = selectAllPoints(input)
|
let points = selectAllPoints(input)
|
||||||
.filter(x => (x.body.pointer_type !== "ToolSlot"))
|
.filter(x => (x.body.pointer_type !== "ToolSlot"));
|
||||||
let toolDDI = selectAllTools(input)
|
let toolDDI = selectAllTools(input)
|
||||||
.filter(x => !!x.body.id)
|
.filter(x => !!x.body.id)
|
||||||
.map(t => formatTools(t));
|
.map(t => formatTools(t));
|
||||||
|
|
|
@ -63,9 +63,6 @@
|
||||||
"no-shadowed-variable": true,
|
"no-shadowed-variable": true,
|
||||||
"no-switch-case-fall-through": true,
|
"no-switch-case-fall-through": true,
|
||||||
"no-trailing-whitespace": true,
|
"no-trailing-whitespace": true,
|
||||||
"no-unused-locals": true,
|
|
||||||
"no-unused-parameters": true,
|
|
||||||
"no-unused-expression": true,
|
|
||||||
"no-unused-variable": [
|
"no-unused-variable": [
|
||||||
true
|
true
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in New Issue