Compare commits
8 Commits
Author | SHA1 | Date |
---|---|---|
Rick Carlino | be38ad830a | |
Rick Carlino | 4f03626d5f | |
Rick Carlino | bc68f3e79f | |
Rick Carlino | bce0700cd9 | |
Rick Carlino | 9f1cf4eedd | |
Rick Carlino | afceaf25e0 | |
Rick Carlino | e5389b747e | |
Rick Carlino | a5b1d5631e |
|
@ -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
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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") {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue