Issue FarmBot#1379 Updates to Execute sequence step.
parent
427cbab172
commit
cfc7baf587
|
@ -25,7 +25,7 @@ describe("<SequenceSelectBox />", () => {
|
|||
|
||||
it("renders", () => {
|
||||
const wrapper = mount(<SequenceSelectBox {...fakeProps()} />);
|
||||
expect(wrapper.text()).toEqual("None");
|
||||
expect(wrapper.text()).toEqual("Select a sequence");
|
||||
});
|
||||
|
||||
it("returns list: none selected", () => {
|
||||
|
|
|
@ -3,6 +3,7 @@ import { isNumber } from "lodash";
|
|||
import { ResourceIndex } from "../resources/interfaces";
|
||||
import { selectAllSequences, findSequenceById } from "../resources/selectors";
|
||||
import { FBSelect, DropDownItem } from "../ui/index";
|
||||
import { t } from "../i18next_wrapper";
|
||||
|
||||
export interface SequenceSelectBoxProps {
|
||||
onChange(selection: DropDownItem): void;
|
||||
|
@ -40,5 +41,6 @@ export function SequenceSelectBox(props: SequenceSelectBoxProps) {
|
|||
return <FBSelect
|
||||
onChange={props.onChange}
|
||||
selectedItem={selectedSequence()}
|
||||
list={sequenceDropDownList()} />;
|
||||
list={sequenceDropDownList()}
|
||||
customNullLabel={t("Select a sequence")} />;
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ describe("renderCeleryNode()", () => {
|
|||
},
|
||||
{
|
||||
node: { kind: "execute", args: { sequence_id: 0 } } as Execute,
|
||||
expected: "Sequence"
|
||||
expected: "Select a sequence"
|
||||
},
|
||||
{
|
||||
node: {
|
||||
|
|
|
@ -43,12 +43,9 @@ describe("<ExecuteBlock/>", () => {
|
|||
it("renders inputs", () => {
|
||||
const block = mount(<ExecuteBlock {...fakeProps()} />);
|
||||
const inputs = block.find("input");
|
||||
const labels = block.find("label");
|
||||
expect(inputs.length).toEqual(1);
|
||||
expect(labels.length).toEqual(1);
|
||||
expect(inputs.first().props().placeholder).toEqual("Execute Sequence");
|
||||
expect(labels.at(0).text()).toEqual("Sequence");
|
||||
expect(block.text()).toContain("None");
|
||||
expect(block.text()).toContain("Select a sequence");
|
||||
});
|
||||
|
||||
it("renders inputs when sequence has a variable", () => {
|
||||
|
@ -56,12 +53,9 @@ describe("<ExecuteBlock/>", () => {
|
|||
p.shouldDisplay = () => true;
|
||||
const block = mount(<ExecuteBlock {...p} />);
|
||||
const inputs = block.find("input");
|
||||
const labels = block.find("label");
|
||||
expect(inputs.length).toEqual(1);
|
||||
expect(labels.length).toEqual(1);
|
||||
expect(inputs.first().props().placeholder).toEqual("Execute Sequence");
|
||||
expect(labels.at(0).text()).toEqual("Sequence");
|
||||
expect(block.text()).toContain("None");
|
||||
expect(block.text()).toContain("Select a sequence");
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ import {
|
|||
} from "../locals_list/variable_support";
|
||||
import { AllowedVariableNodes } from "../locals_list/locals_list_support";
|
||||
import { isNumber } from "lodash";
|
||||
import { t } from "../../i18next_wrapper";
|
||||
|
||||
/** Replaces the execute step body with a new array of variables. */
|
||||
const assignVariable = (props: ExecBlockParams) =>
|
||||
|
@ -102,8 +101,7 @@ export class RefactoredExecuteBlock
|
|||
confirmStepDeletion={this.props.confirmStepDeletion} />
|
||||
<StepContent className={className}>
|
||||
<Row>
|
||||
<Col xs={12}>
|
||||
<label>{t("Sequence")}</label>
|
||||
<Col xs={6}>
|
||||
<SequenceSelectBox
|
||||
onChange={this.changeSelection}
|
||||
resources={resources}
|
||||
|
@ -112,7 +110,7 @@ export class RefactoredExecuteBlock
|
|||
</Row>
|
||||
<Row>
|
||||
{!!calledSequenceVariableData &&
|
||||
<Col xs={12}>
|
||||
<Col xs={6}>
|
||||
<LocalsList
|
||||
bodyVariables={currentStep.body}
|
||||
variableData={calledSequenceVariableData}
|
||||
|
|
Loading…
Reference in New Issue