Compare commits

...

8 Commits
jebba ... hmm

Author SHA1 Message Date
Rick Carlino be38ad830a Merge branch 'master' of https://git.heroku.com/farmbot-staging into staging 2020-03-17 14:44:54 -05:00
Rick Carlino 4f03626d5f Merge branch 'master' into staging 2020-03-17 14:43:25 -05:00
Rick Carlino bc68f3e79f Merge branch 'staging' 2020-03-16 19:08:55 -05:00
Rick Carlino bce0700cd9
Merge pull request #1723 from FarmBot/staging
v9.2.0 - Jolly Juniper
2020-02-27 15:37:03 -06:00
Rick Carlino 9f1cf4eedd Loosen restriction on `package` attr of `flash_firmware`. 2020-02-20 18:13:46 -06:00
Rick Carlino afceaf25e0 Add test for flash_firmware node 2020-02-20 18:03:23 -06:00
Rick Carlino e5389b747e Begin work on 'flash firmware' button 2020-02-20 17:32:58 -06:00
Rick Carlino a5b1d5631e
Merge pull request #1701 from FarmBot/staging
v9.1.3 - Jolly Juniper
2020-02-20 12:57:33 -06:00
4 changed files with 140 additions and 115 deletions

View File

@ -251,7 +251,9 @@ module CeleryScriptSettingsBag
# outside of the API. If `package` _was_ declared as a native enum (rather
# than a string), it would cause false type errors in FE/FBJS.
blk: ->(node) do
unless node.parent.kind.to_s == "flash_firmware"
manual_enum(ALLOWED_PACKAGES, node, BAD_PACKAGE)
end
end,
},
axis: {
@ -529,7 +531,7 @@ module CeleryScriptSettingsBag
resource_id = n.args.fetch(:point_group_id).value
check_resource_type(n, "PointGroup", resource_id, Device.current)
end,
}
},
}.map { |(name, list)| Corpus.node(name, **list) }
HASH = Corpus.as_json

View File

@ -95,6 +95,11 @@ export function StepButtonCluster(props: StepButtonProps) {
color="brown">
{t("REBOOT")}
</StepButton>,
<StepButton {...commonStepProps}
step={{ kind: "flash_firmware", args: { package: "arduino_firmware" } }}
color="brown">
{t("REFLASH FIRMWARE")}
</StepButton>,
<StepButton {...commonStepProps}
step={{ kind: "emergency_lock", args: {} }}
color="red">

View File

@ -5,11 +5,6 @@ import { StepWrapper, StepHeader, StepContent } from "../step_ui/index";
import { t } from "../../i18next_wrapper";
import { ALLOWED_PACKAGES, SequenceBodyItem, Reboot } from "farmbot";
import { editStep } from "../../api/crud";
// import { StepRadio } from "../step_ui/step_radio";
// const PACKAGE_CHOICES = (): Record<ALLOWED_PACKAGES, string> => ({
// "arduino_firmware": t("Just the Arduino"),
// "farmbot_os": t("Entire system")
// });
function assertReboot(x: SequenceBodyItem): asserts x is Reboot {
if (x.kind !== "reboot") {

View File

@ -257,4 +257,27 @@ describe CeleryScript::Corpus do
expect(check.error.message).to eq("Can't find PointGroup with id of -1")
end
end
it "validates the `package` for flash_firmware" do
ok1 = CeleryScript::AstNode.new(**{
args: {
version: 20180209,
locals: {
kind: "scope_declaration",
args: {},
},
},
kind: "sequence",
body: [
{
kind: "flash_firmware",
args: {
package: "arduino_firmware",
},
},
],
})
check1 = CeleryScript::Checker.new(ok1, corpus, device)
expect(check1.valid?).to be_truthy
end
end