From c4bf151a303902c2301651202695f351f159abd8 Mon Sep 17 00:00:00 2001 From: Rick Carlino Date: Tue, 12 Dec 2017 10:03:04 -0600 Subject: [PATCH] [UNSTABLE] Type errors gone. NEXT: test suite --- webpack/api/api.ts | 15 --------------- webpack/controls/axis_input_box_group.tsx | 4 ++-- webpack/controls/peripherals/index.tsx | 4 ++-- webpack/devices/components/pin_bindings.tsx | 8 ++++---- .../farm_designer/farm_events/add_farm_event.tsx | 4 ++-- webpack/farm_designer/map/garden_map.tsx | 4 ++-- webpack/farmware/farmware_panel.tsx | 4 ++-- .../__tests__/image_workspace_test.tsx | 2 +- webpack/farmware/weed_detector/constants.ts | 2 +- webpack/farmware/weed_detector/farmbot_picker.tsx | 4 ++-- webpack/farmware/weed_detector/index.tsx | 4 ++-- webpack/front_page/front_page.tsx | 4 ++-- webpack/password_reset/password_reset.tsx | 4 ++-- webpack/tos_update/index.tsx | 4 ++-- webpack/ui/save_button.tsx | 8 ++++---- 15 files changed, 30 insertions(+), 45 deletions(-) diff --git a/webpack/api/api.ts b/webpack/api/api.ts index 50ef83d71..c7b06ad3e 100644 --- a/webpack/api/api.ts +++ b/webpack/api/api.ts @@ -72,27 +72,12 @@ export class API { /** "https:" or "http:". NO "//"! */ private readonly protocol: ProtocolString; - /** "localhost", "yahoo.com" */ - private readonly hostname: string; - /** "80", "443" or "" */ - private readonly port: string; - /** "/pathname/x/whatever" or "/foo/" */ - private readonly pathname: string; - /** "?foo=bar" */ - private readonly search: string; - /** "#hashfragment" */ - private readonly hash: string; /** "example.com:3000" */ private readonly host: string; constructor(input: string) { const url = API.parseURL(input); this.protocol = url.protocol as ProtocolString; - this.hostname = url.hostname; - this.port = url.port; - this.pathname = url.pathname; - this.search = url.search; - this.hash = url.hash; this.host = url.host; } diff --git a/webpack/controls/axis_input_box_group.tsx b/webpack/controls/axis_input_box_group.tsx index 3e43a49bc..e07ce22c7 100644 --- a/webpack/controls/axis_input_box_group.tsx +++ b/webpack/controls/axis_input_box_group.tsx @@ -11,8 +11,8 @@ import * as _ from "lodash"; export class AxisInputBoxGroup extends React.Component> { - constructor() { - super(); + constructor(props: AxisInputBoxGroupProps) { + super(props); this.state = {}; } diff --git a/webpack/controls/peripherals/index.tsx b/webpack/controls/peripherals/index.tsx index 14c512a84..04e1eb863 100644 --- a/webpack/controls/peripherals/index.tsx +++ b/webpack/controls/peripherals/index.tsx @@ -12,8 +12,8 @@ import { ToolTips } from "../../constants"; import * as _ from "lodash"; export class Peripherals extends React.Component { - constructor() { - super(); + constructor(props: PeripheralsProps) { + super(props); this.state = { isEditing: false }; } diff --git a/webpack/devices/components/pin_bindings.tsx b/webpack/devices/components/pin_bindings.tsx index 1327fce36..913f4c591 100644 --- a/webpack/devices/components/pin_bindings.tsx +++ b/webpack/devices/components/pin_bindings.tsx @@ -34,8 +34,8 @@ enum ColumnWidth { export class PinBindings extends React.Component { - constructor() { - super(); + constructor(props: PinBindingsProps) { + super(props); this.state = { isEditing: false, pinNumberInput: undefined, @@ -97,8 +97,8 @@ export class PinBindings {`Pi GPIO ${pin_number}`} - {findSequenceById( - resources, parseInt(sequence_id)).body.name} + {sequence_id ? findSequenceById( + resources, parseInt(sequence_id)).body.name : ""} ; }