Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step changes #1655

Merged
merged 2 commits into from
Jan 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/constants.ts
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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>;
}