From 19eebde8e2116aa7ac17ccf341d5f27c15efdd16 Mon Sep 17 00:00:00 2001 From: gabrielburnworth Date: Mon, 24 Feb 2020 08:55:37 -0800 Subject: [PATCH 1/2] dep updates (fe) --- package.json | 22 +++++++++++----------- tsconfig.json | 1 - 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 58e964b81..58a807c65 100644 --- a/package.json +++ b/package.json @@ -24,18 +24,18 @@ "author": "farmbot.io", "license": "MIT", "dependencies": { - "@babel/core": "7.8.3", + "@babel/core": "7.8.4", "@blueprintjs/core": "3.23.1", "@blueprintjs/datetime": "3.15.2", "@blueprintjs/select": "3.11.2", - "@types/enzyme": "3.10.4", - "@types/jest": "24.9.1", + "@types/enzyme": "3.10.5", + "@types/jest": "25.1.3", "@types/lodash": "4.14.149", "@types/markdown-it": "0.0.9", "@types/moxios": "0.4.9", - "@types/node": "13.5.0", + "@types/node": "13.7.4", "@types/promise-timeout": "1.3.0", - "@types/react": "16.9.19", + "@types/react": "16.9.22", "@types/react-color": "3.0.1", "@types/react-dom": "16.9.5", "@types/react-redux": "7.1.7", @@ -46,7 +46,7 @@ "enzyme": "3.11.0", "enzyme-adapter-react-16": "1.15.2", "farmbot": "9.1.2", - "i18next": "19.0.3", + "i18next": "19.3.1", "install": "0.13.0", "lodash": "4.17.15", "markdown-it": "10.0.0", @@ -54,7 +54,7 @@ "moment": "2.24.0", "moxios": "0.4.0", "mqtt": "3.0.0", - "npm": "6.13.6", + "npm": "6.13.7", "parcel-bundler": "1.12.4", "promise-timeout": "1.3.0", "raf": "3.4.1", @@ -63,7 +63,7 @@ "react-color": "2.18.0", "react-dom": "16.12.0", "react-joyride": "2.2.1", - "react-redux": "7.1.3", + "react-redux": "7.2.0", "react-test-renderer": "16.12.0", "react-transition-group": "4.3.0", "redux": "4.0.5", @@ -71,10 +71,10 @@ "redux-thunk": "2.3.0", "sass-lint": "1.13.1", "takeme": "0.11.3", - "ts-jest": "25.0.0", + "ts-jest": "25.2.1", "ts-lint": "4.5.1", "tslint": "6.0.0", - "typescript": "3.7.5", + "typescript": "3.8.2", "which": "2.0.2" }, "devDependencies": { @@ -83,7 +83,7 @@ "jest-junit": "10.0.0", "jest-skipped-reporter": "0.0.5", "jshint": "2.11.0", - "madge": "3.6.0", + "madge": "3.7.0", "sass": "1.25.0" } } diff --git a/tsconfig.json b/tsconfig.json index 569f7f997..2c63ffef7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,5 @@ { "compilerOptions": { - "incremental": true, "lib": [ "es7", "dom", From 4a0035b9ebc5872dc5facc2d7f28b043702406a5 Mon Sep 17 00:00:00 2001 From: gabrielburnworth Date: Mon, 24 Feb 2020 08:55:57 -0800 Subject: [PATCH 2/2] minor bug fixes --- frontend/css/farm_designer/farm_designer_panels.scss | 4 ++-- .../devices/components/fbos_settings/fbos_details.tsx | 9 ++++++--- frontend/devices/connectivity/connectivity.tsx | 7 +++++-- .../__tests__/list_and_label_support_test.tsx | 4 +++- frontend/devices/pin_bindings/list_and_label_support.tsx | 2 +- .../tools/__tests__/tool_slot_edit_components_test.tsx | 1 + frontend/farm_designer/tools/index.tsx | 6 ++++-- .../farm_designer/tools/tool_slot_edit_components.tsx | 7 +++++-- 8 files changed, 27 insertions(+), 13 deletions(-) diff --git a/frontend/css/farm_designer/farm_designer_panels.scss b/frontend/css/farm_designer/farm_designer_panels.scss index a915f1f5e..6c5a5614d 100644 --- a/frontend/css/farm_designer/farm_designer_panels.scss +++ b/frontend/css/farm_designer/farm_designer_panels.scss @@ -552,7 +552,7 @@ } .tool-slots-panel-content, .tools-panel-content { - max-height: calc(100vh - 15rem); + max-height: calc(100vh - 19rem); overflow-y: auto; overflow-x: hidden; .tool-search-item, @@ -582,7 +582,7 @@ } } i { - line-height: 2.5rem; + line-height: 2rem; } } svg { diff --git a/frontend/devices/components/fbos_settings/fbos_details.tsx b/frontend/devices/components/fbos_settings/fbos_details.tsx index c4b138cbd..10cee6822 100644 --- a/frontend/devices/components/fbos_settings/fbos_details.tsx +++ b/frontend/devices/components/fbos_settings/fbos_details.tsx @@ -55,21 +55,24 @@ export function ChipTemperatureDisplay( interface WiFiStrengthDisplayProps { wifiStrength: number | undefined; wifiStrengthPercent?: number | undefined; + extraInfo?: boolean; } /** WiFi signal strength display row: label, strength, indicator. */ export function WiFiStrengthDisplay( - { wifiStrength, wifiStrengthPercent }: WiFiStrengthDisplayProps + { wifiStrength, wifiStrengthPercent, extraInfo }: WiFiStrengthDisplayProps ): JSX.Element { const percent = wifiStrength ? Math.round(-0.0154 * wifiStrength ** 2 - 0.4 * wifiStrength + 98) : 0; const dbString = `${wifiStrength || 0}dBm`; const percentString = `${wifiStrengthPercent || percent}%`; + const numberDisplay = + extraInfo ? `${percentString} (${dbString})` : percentString; return

{t("WiFi strength")}: - {wifiStrength ? `${dbString} (${percentString})` : "N/A"} + {wifiStrength ? numberDisplay : "N/A"}

{wifiStrength &&
@@ -287,7 +290,7 @@ export function FbosDetails(props: FbosDetailsProps) { {isNumber(disk_usage) &&

{t("Disk usage")}: {disk_usage}%

} {isNumber(cpu_usage) &&

{t("CPU usage")}: {cpu_usage}%

} - @@ -42,7 +44,8 @@ export class Connectivity
- +
diff --git a/frontend/devices/pin_bindings/__tests__/list_and_label_support_test.tsx b/frontend/devices/pin_bindings/__tests__/list_and_label_support_test.tsx index 6742019cf..24a8443b6 100644 --- a/frontend/devices/pin_bindings/__tests__/list_and_label_support_test.tsx +++ b/frontend/devices/pin_bindings/__tests__/list_and_label_support_test.tsx @@ -1,4 +1,6 @@ -import { sortByNameAndPin, ButtonPin, getSpecialActionLabel } from "../list_and_label_support"; +import { + sortByNameAndPin, ButtonPin, getSpecialActionLabel +} from "../list_and_label_support"; import { PinBindingSpecialAction } from "farmbot/dist/resources/api_resources"; describe("sortByNameAndPin()", () => { diff --git a/frontend/devices/pin_bindings/list_and_label_support.tsx b/frontend/devices/pin_bindings/list_and_label_support.tsx index ddc7be7c6..5d803b118 100644 --- a/frontend/devices/pin_bindings/list_and_label_support.tsx +++ b/frontend/devices/pin_bindings/list_and_label_support.tsx @@ -92,7 +92,7 @@ export const reservedPiGPIO = piI2c0Pins; const GPIO_PIN_LABELS = (): { [x: number]: string } => ({ [ButtonPin.estop]: t("Button {{ num }}: E-STOP", { num: 1 }), [ButtonPin.unlock]: t("Button {{ num }}: UNLOCK", { num: 2 }), - [ButtonPin.btn3]: t("Button {{ num }})", { num: 3 }), + [ButtonPin.btn3]: t("Button {{ num }}", { num: 3 }), [ButtonPin.btn4]: t("Button {{ num }}", { num: 4 }), [ButtonPin.btn5]: t("Button {{ num }}", { num: 5 }), }); diff --git a/frontend/farm_designer/tools/__tests__/tool_slot_edit_components_test.tsx b/frontend/farm_designer/tools/__tests__/tool_slot_edit_components_test.tsx index e75dbf479..1ee855342 100644 --- a/frontend/farm_designer/tools/__tests__/tool_slot_edit_components_test.tsx +++ b/frontend/farm_designer/tools/__tests__/tool_slot_edit_components_test.tsx @@ -62,6 +62,7 @@ describe("", () => { onChange: jest.fn(), filterSelectedTool: false, isActive: jest.fn(), + filterActiveTools: true, }); it("renders", () => { diff --git a/frontend/farm_designer/tools/index.tsx b/frontend/farm_designer/tools/index.tsx index 3e4adbb4b..222c4face 100644 --- a/frontend/farm_designer/tools/index.tsx +++ b/frontend/farm_designer/tools/index.tsx @@ -137,7 +137,8 @@ export class RawTools extends React.Component { this.props.dispatch(save(this.props.device.uuid)); }} isActive={this.props.isActive} - filterSelectedTool={true} /> + filterSelectedTool={true} + filterActiveTools={false} />

{t("status")}: {toolStatus(this.toolVerificationValue)}

diff --git a/frontend/farm_designer/tools/tool_slot_edit_components.tsx b/frontend/farm_designer/tools/tool_slot_edit_components.tsx index cf63a55e1..903088e82 100644 --- a/frontend/farm_designer/tools/tool_slot_edit_components.tsx +++ b/frontend/farm_designer/tools/tool_slot_edit_components.tsx @@ -57,6 +57,7 @@ export interface ToolSelectionProps { onChange(update: { tool_id: number }): void; filterSelectedTool: boolean; isActive(id: number | undefined): boolean; + filterActiveTools: boolean; } export const ToolSelection = (props: ToolSelectionProps) => @@ -64,7 +65,8 @@ export const ToolSelection = (props: ToolSelectionProps) => list={([NULL_CHOICE] as DropDownItem[]).concat(props.tools .filter(tool => !props.filterSelectedTool || tool.body.id != props.selectedTool?.body.id) - .filter(tool => !props.isActive(tool.body.id)) + .filter(tool => !props.filterActiveTools + || !props.isActive(tool.body.id)) .map(tool => ({ label: tool.body.name || "untitled", value: tool.body.id || 0, @@ -100,7 +102,8 @@ export const ToolInputRow = (props: ToolInputRowProps) => selectedTool={props.selectedTool} onChange={props.onChange} isActive={props.isActive} - filterSelectedTool={false} /> + filterSelectedTool={false} + filterActiveTools={true} />
;