From 4edde35ab427c3d387c7be3fd004e1be8a23b9cf Mon Sep 17 00:00:00 2001 From: Rick Carlino Date: Mon, 27 Aug 2018 13:34:22 -0500 Subject: [PATCH] Corpus updates and type error fixes --- app/models/celery_script_settings_bag.rb | 6 ++-- package.json | 2 +- webpack/sequences/step_button_cluster.tsx | 5 ++-- .../sequences/step_tiles/mark_as/options.ts | 29 ++++++++++--------- yarn.lock | 12 ++++---- 5 files changed, 28 insertions(+), 26 deletions(-) diff --git a/app/models/celery_script_settings_bag.rb b/app/models/celery_script_settings_bag.rb index f6f01ba67..4390d141c 100644 --- a/app/models/celery_script_settings_bag.rb +++ b/app/models/celery_script_settings_bag.rb @@ -45,7 +45,7 @@ module CeleryScriptSettingsBag read_status reboot sync take_photo) STEPS = %w(_if execute execute_script find_home move_absolute move_relative read_pin send_message take_photo wait - write_pin resource_update) + write_pin transaction) BAD_ALLOWED_PIN_MODES = '"%s" is not a valid pin_mode. Allowed values: %s' BAD_LHS = 'Can not put "%s" into a left hand side (LHS) '\ 'argument. Allowed values: %s' @@ -248,7 +248,9 @@ module CeleryScriptSettingsBag .node(:set_servo_angle, [:pin_number, :pin_value], []) .node(:change_ownership, [], [:pair]) .node(:dump_info, [], []) - .node(:resource_update, [:resource_type, :resource_id, :label], [:pair]) + .node(:resource_update, [:resource_type, :resource_id], [:pair]) + .node(:resource_deletion, [:resource_type, :resource_id], []) + .node(:transaction, [:label], [:resource_update, :resource_deletion]) .node(:install_first_party_farmware, []) ANY_ARG_NAME = Corpus.as_json[:args].pluck("name").map(&:to_s) diff --git a/package.json b/package.json index f998fba79..99d09f7aa 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "css-loader": "1.0.0", "enzyme": "^3.1.0", "enzyme-adapter-react-16": "^1.1.0", - "farmbot": "https://github.com/RickCarlino/farmbot-js.git#8a5cd5b", + "farmbot": "https://github.com/RickCarlino/farmbot-js.git#b9b65d9", "farmbot-toastr": "^1.0.3", "fastclick": "^1.0.6", "file-loader": "1.1.11", diff --git a/webpack/sequences/step_button_cluster.tsx b/webpack/sequences/step_button_cluster.tsx index a3bdadc2a..12d9a9943 100644 --- a/webpack/sequences/step_button_cluster.tsx +++ b/webpack/sequences/step_button_cluster.tsx @@ -137,11 +137,10 @@ export function StepButtonCluster({ dispatch, current }: StepButtonProps) { dispatch={dispatch} current={current} step={{ - kind: "resource_update", + kind: "transaction", args: { resource_type: "Point", - resource_id: 0, - label: "mark_as" + resource_id: 0 } }} color="brown"> diff --git a/webpack/sequences/step_tiles/mark_as/options.ts b/webpack/sequences/step_tiles/mark_as/options.ts index d8dfee8f8..9d26208b7 100644 --- a/webpack/sequences/step_tiles/mark_as/options.ts +++ b/webpack/sequences/step_tiles/mark_as/options.ts @@ -1,16 +1,17 @@ -import { ResourceName, TaggedPlantPointer } from "farmbot"; -import { DropDownItem } from "../../../ui"; +// import { ResourceName, TaggedPlantPointer } from "farmbot"; +// import { DropDownItem } from "../../../ui"; -const OPTIONS: Partial> = { - "Tool": [], - "Plant": [], - "Point": [] -}; +// const OPTIONS: Partial> = { +// "Tool": [], +// "Plant": [], +// "Point": [] +// }; -const isWeed = (plant: TaggedPlantPointer) => { - const cb = plant.body.meta["created_by"]; - if (cb == "weed-detection") { - return true; - } - return false; -}; +// const isWeed = (plant: TaggedPlantPointer) => { +// const cb = plant.body.meta["created_by"]; +// if (cb == "weed-detection") { +// return true; +// } +// return false; +// }; +// // diff --git a/yarn.lock b/yarn.lock index d7a0adffc..31545d4ff 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2417,18 +2417,18 @@ farmbot-toastr@^1.0.0, farmbot-toastr@^1.0.3: farmbot-toastr "^1.0.0" typescript "^2.3.4" -"farmbot@https://github.com/RickCarlino/farmbot-js.git#0d25cfd": - version "6.5.0-rc4" - resolved "https://github.com/RickCarlino/farmbot-js.git#0d25cfd5a90b7c5bc297b7068498014236e3a46f" - dependencies: - mqtt "2.15.0" - "farmbot@https://github.com/RickCarlino/farmbot-js.git#8a5cd5b": version "6.5.0-rc4" resolved "https://github.com/RickCarlino/farmbot-js.git#8a5cd5bd907d2f73bfd879776010d16750b218b9" dependencies: mqtt "2.15.0" +"farmbot@https://github.com/RickCarlino/farmbot-js.git#b9b65d9": + version "6.5.0-rc5" + resolved "https://github.com/RickCarlino/farmbot-js.git#b9b65d949f7fe710afc48116207627bb270398a4" + dependencies: + mqtt "2.15.0" + fast-deep-equal@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614"