From 339ec2f3c00fe200b697fd40d531d0d8cad0b349 Mon Sep 17 00:00:00 2001 From: gabrielburnworth Date: Thu, 9 Jan 2020 15:36:49 -0800 Subject: [PATCH 1/3] fix farm event edit panel bug --- .../farm_designer/farm_designer_panels.scss | 2 + .../farm_events/edit_farm_event.tsx | 37 +++++++++++++------ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/frontend/css/farm_designer/farm_designer_panels.scss b/frontend/css/farm_designer/farm_designer_panels.scss index d2d096eb4..f00163816 100644 --- a/frontend/css/farm_designer/farm_designer_panels.scss +++ b/frontend/css/farm_designer/farm_designer_panels.scss @@ -421,6 +421,7 @@ } } +.edit-farm-event-panel, .add-farm-event-panel { input { background: $white; @@ -459,6 +460,7 @@ .edit-farm-event-panel button.red { margin-top: 1rem; margin-left: 1rem; + margin-right: 0.5rem; } .panel-nav { diff --git a/frontend/farm_designer/farm_events/edit_farm_event.tsx b/frontend/farm_designer/farm_events/edit_farm_event.tsx index f5350efa9..5a86238d3 100644 --- a/frontend/farm_designer/farm_events/edit_farm_event.tsx +++ b/frontend/farm_designer/farm_events/edit_farm_event.tsx @@ -6,6 +6,10 @@ import { history } from "../../history"; import { TaggedFarmEvent } from "farmbot"; import { EditFEForm } from "./edit_fe_form"; import { t } from "../../i18next_wrapper"; +import { Panel } from "../panel_header"; +import { + DesignerPanel, DesignerPanelHeader, DesignerPanelContent +} from "../designer_panel"; export class RawEditFarmEvent extends React.Component { redirect() { @@ -14,18 +18,27 @@ export class RawEditFarmEvent extends React.Component } renderForm(fe: TaggedFarmEvent) { - return ; + const panelName = "edit-farm-event"; + return + + + + + ; } render() { From 927ad8c54e6a62d0c472845a7ff50002fec24afb Mon Sep 17 00:00:00 2001 From: gabrielburnworth Date: Thu, 9 Jan 2020 17:30:59 -0800 Subject: [PATCH 2/3] dep updates (fe) --- lib/tasks/coverage.rake | 6 ++++++ package.json | 16 ++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/tasks/coverage.rake b/lib/tasks/coverage.rake index c911e6134..2aef7107c 100644 --- a/lib/tasks/coverage.rake +++ b/lib/tasks/coverage.rake @@ -162,6 +162,12 @@ namespace :coverage do .map { |x| x.split(FRACTION_DELIM).map(&:to_f) } .map { |x| Pair.new(*x) } + fallback_fraction = Pair.new(0, 1) + statements = statements || fallback_fraction + branches = branches || fallback_fraction + functions = functions || fallback_fraction + lines = lines || fallback_fraction + puts puts "This build: #{CURRENT_COMMIT}" puts "Statements: #{to_percent(statements)}%" diff --git a/package.json b/package.json index a6fdd16fe..896d59024 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ }, "scripts": { "coverage": "cat **/*lcov.info | ./node_modules/coveralls/bin/coveralls.js", - "test-very-slow": "node --expose-gc ./node_modules/.bin/jest -i --colors # low CPU/RAM usage", + "test-very-slow": "node --expose-gc ./node_modules/.bin/jest -i --colors --coverage # low CPU/RAM usage", "test-slow": "./node_modules/.bin/jest -w 6 --colors", "test": "./node_modules/.bin/jest -w 5 --no-coverage", "typecheck": "./node_modules/typescript/bin/tsc --noEmit", @@ -33,20 +33,20 @@ "@types/lodash": "4.14.149", "@types/markdown-it": "0.0.9", "@types/moxios": "0.4.9", - "@types/node": "13.1.2", + "@types/node": "13.1.6", "@types/promise-timeout": "1.3.0", "@types/react": "16.9.17", "@types/react-color": "3.0.1", "@types/react-dom": "16.9.4", "@types/react-redux": "7.1.5", - "axios": "0.19.0", + "axios": "0.19.1", "boxed_value": "1.0.0", "browser-speech": "1.1.1", "coveralls": "3.0.9", "enzyme": "3.11.0", "enzyme-adapter-react-16": "1.15.2", "farmbot": "9.0.1-rc0", - "i18next": "19.0.2", + "i18next": "19.0.3", "install": "0.13.0", "lodash": "4.17.15", "markdown-it": "10.0.0", @@ -54,13 +54,13 @@ "moment": "2.24.0", "moxios": "0.4.0", "mqtt": "3.0.0", - "npm": "6.13.4", + "npm": "6.13.6", "parcel-bundler": "1.12.4", "promise-timeout": "1.3.0", "raf": "3.4.1", "react": "16.12.0", "react-addons-test-utils": "15.6.2", - "react-color": "2.17.3", + "react-color": "2.18.0", "react-dom": "16.12.0", "react-joyride": "2.2.1", "react-redux": "7.1.3", @@ -69,10 +69,10 @@ "redux": "4.0.5", "redux-immutable-state-invariant": "2.1.0", "redux-thunk": "2.3.0", - "sass": "1.24.1", + "sass": "1.24.4", "sass-lint": "1.13.1", "takeme": "0.11.3", - "ts-jest": "24.2.0", + "ts-jest": "24.3.0", "ts-lint": "4.5.1", "tslint": "5.20.1", "typescript": "3.7.4", From 6227b17d16e22f7e7b1038f8a6eb1b2b8a848b7f Mon Sep 17 00:00:00 2001 From: Gabriel Burnworth Date: Thu, 9 Jan 2020 18:04:33 -0800 Subject: [PATCH 3/3] add fallback coverage value --- lib/tasks/coverage.rake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/tasks/coverage.rake b/lib/tasks/coverage.rake index 2aef7107c..be5af3cc7 100644 --- a/lib/tasks/coverage.rake +++ b/lib/tasks/coverage.rake @@ -10,6 +10,7 @@ BASE_BRANCHES = ["master", "staging"] CURRENT_COMMIT = ENV.fetch("CIRCLE_SHA1", "") CSS_SELECTOR = ".fraction" FRACTION_DELIM = "/" +FALLBACK_VALUE = 0.9772 # Fetch JSON over HTTP. Rails probably already has a helper for this :shrug: def open_json(url) @@ -162,7 +163,10 @@ namespace :coverage do .map { |x| x.split(FRACTION_DELIM).map(&:to_f) } .map { |x| Pair.new(*x) } - fallback_fraction = Pair.new(0, 1) + fallback_fraction = Pair.new(FALLBACK_VALUE, 1.0) + puts "!" * 50 if lines.nil? + puts "WARNING: USING FALLBACK VALUE (#{FALLBACK_VALUE})" if lines.nil? + puts "!" * 50 if lines.nil? statements = statements || fallback_fraction branches = branches || fallback_fraction functions = functions || fallback_fraction