Skip to content

Commit

Permalink
Merge pull request #1655 from FarmBot/step_changes
Browse files Browse the repository at this point in the history
Step changes
  • Loading branch information
RickCarlino committed Jan 8, 2020
2 parents a13272d + bc08514 commit db040aa
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 34 deletions.
2 changes: 1 addition & 1 deletion frontend/constants.ts
Expand Up @@ -297,7 +297,7 @@ export namespace ToolTips {
sequence or delete a weed after removing it.`);

export const REBOOT =
trim(`Power cycle FarmBot's onboard computer or microcontroller.`);
trim(`Power cycle FarmBot's onboard computer.`);

export const SET_SERVO_ANGLE =
trim(`Move a servo to the provided angle. An angle of 90 degrees
Expand Down
8 changes: 4 additions & 4 deletions frontend/css/steps.scss
Expand Up @@ -86,7 +86,7 @@
background: $brown;
}
&.send-message-step {
background: $red;
background: $brown;
}
&.find-home-step {
background: $blue;
Expand Down Expand Up @@ -131,7 +131,7 @@
background: $brown;
}
&.emergency-stop-step {
background: $brown;
background: $red;
}
&.reboot-step {
background: $brown;
Expand Down Expand Up @@ -188,7 +188,7 @@
background: $light_brown;
}
&.send-message-step {
background: $light_red;
background: $light_brown;
}
&.find-home-step {
background: $light_blue;
Expand Down Expand Up @@ -251,7 +251,7 @@
background: $light_brown;
}
&.emergency-stop-step {
background: $light_brown;
background: $light_red;
}
&.reboot-step {
background: $light_brown;
Expand Down
23 changes: 6 additions & 17 deletions frontend/sequences/step_button_cluster.tsx
Expand Up @@ -48,16 +48,6 @@ export function StepButtonCluster(props: StepButtonProps) {
color="orange">
{t("CONTROL PERIPHERAL")}
</StepButton>,
<StepButton {...commonStepProps}
step={{
kind: "toggle_pin",
args: {
pin_number: NOTHING_SELECTED
}
}}
color="orange">
{t("TOGGLE PERIPHERAL")}
</StepButton>,
<StepButton {...commonStepProps}
step={{
kind: "read_pin",
Expand Down Expand Up @@ -97,19 +87,19 @@ export function StepButtonCluster(props: StepButtonProps) {
message_type: MessageType.success
}
}}
color="red">
{t("SEND MESSAGE")}
</StepButton>,
<StepButton {...commonStepProps}
step={{ kind: "emergency_lock", args: {} }}
color="brown">
{t("E-STOP")}
{t("SEND MESSAGE")}
</StepButton>,
<StepButton {...commonStepProps}
step={{ kind: "reboot", args: { package: "farmbot_os" } }}
color="brown">
{t("REBOOT")}
</StepButton>,
<StepButton {...commonStepProps}
step={{ kind: "emergency_lock", args: {} }}
color="red">
{t("E-STOP")}
</StepButton>,
<StepButton{...commonStepProps}
step={{
kind: "find_home",
Expand Down Expand Up @@ -204,7 +194,6 @@ export function StepButtonCluster(props: StepButtonProps) {
{t("Mark As...")}
</StepButton>
);

return <div>
<Row>
<div className="step-button-cluster">
Expand Down
2 changes: 1 addition & 1 deletion frontend/sequences/step_tiles/__tests__/index_test.ts
Expand Up @@ -189,7 +189,7 @@ describe("renderCeleryNode()", () => {
},
{
node: { kind: "reboot", args: { package: "farmbot_os" } },
expected: "entire system"
expected: "power cycle farmbot's onboard computer."
},
{
node: { kind: "check_updates", args: { package: "farmbot_os" } },
Expand Down
3 changes: 1 addition & 2 deletions frontend/sequences/step_tiles/__tests__/tile_reboot_test.tsx
Expand Up @@ -32,8 +32,7 @@ describe("<TileReboot/>", () => {
it("renders", () => {
const el = render(<TileReboot {...fakeProps()} />);
const verbiage = el.text();
expect(verbiage).toContain("Entire system");
expect(verbiage).toContain("Just the Arduino");
expect(verbiage).toContain("Power cycle FarmBot's onboard computer.");
});

it("crashes if the step is of the wrong `kind`", () => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/sequences/step_tiles/tile_emergency_stop.tsx
Expand Up @@ -21,7 +21,7 @@ export function TileEmergencyStop(props: StepParams) {
<Row>
<Col xs={12}>
<p>
{t("Unlocking a device requires user intervention")}
{t("Unlocking a device requires user intervention.")}
</p>
</Col>
</Row>
Expand Down
18 changes: 10 additions & 8 deletions frontend/sequences/step_tiles/tile_reboot.tsx
Expand Up @@ -5,12 +5,11 @@ 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")
});
// 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") {
Expand Down Expand Up @@ -52,11 +51,14 @@ export function TileReboot(props: StepParams) {
index={index}
confirmStepDeletion={props.confirmStepDeletion} />
<StepContent className={className}>
<StepRadio
<p>
{t(ToolTips.REBOOT)}
</p>
{/* <StepRadio
choices={Object.keys(PACKAGE_CHOICES())}
choiceLabelLookup={PACKAGE_CHOICES()}
currentChoice={currentStep.args.package as ALLOWED_PACKAGES}
onChange={editTheRebootStep(props)} />
onChange={editTheRebootStep(props)} /> */}
</StepContent>
</StepWrapper>;
}

0 comments on commit db040aa

Please sign in to comment.