misc bug fixes

pull/1754/head
gabrielburnworth 2020-04-13 23:38:49 -07:00
parent 3c3b120b9b
commit ec757b1b29
4 changed files with 8 additions and 8 deletions

View File

@ -223,7 +223,7 @@ describe("<EditFEForm />", () => {
]}
findExecutable={jest.fn(() => seq)}
dispatch={jest.fn()}
repeatOptions={repeatOptions}
repeatOptions={repeatOptions()}
timeSettings={fakeTimeSettings()}
autoSyncEnabled={false}
resources={buildResourceIndex([]).index}

View File

@ -26,7 +26,7 @@ export interface FarmEventRepeatFormProps {
}
const indexKey: keyof DropDownItem = "value";
const OPTN_LOOKUP = keyBy(repeatOptions, indexKey);
const OPTN_LOOKUP = () => keyBy(repeatOptions(), indexKey);
export function FarmEventRepeatForm(props: FarmEventRepeatFormProps) {
const { disabled, fieldSet, repeat, endDate, endTime, timeUnit } = props;
@ -50,9 +50,9 @@ export function FarmEventRepeatForm(props: FarmEventRepeatFormProps) {
</Col>
<Col xs={8}>
<FBSelect
list={repeatOptions}
list={repeatOptions()}
onChange={ddi => fieldSet("timeUnit", "" + ddi.value)}
selectedItem={OPTN_LOOKUP[timeUnit] || OPTN_LOOKUP["daily"]} />
selectedItem={OPTN_LOOKUP()[timeUnit] || OPTN_LOOKUP()["daily"]} />
</Col>
</Row>
<label>

View File

@ -41,7 +41,7 @@ export const formatDate = (input: string, timeSettings: TimeSettings) => {
return moment(iso).utcOffset(timeSettings.utcOffset).format("YYYY-MM-DD");
};
export const repeatOptions = [
export const repeatOptions = () => [
{ label: t("Minutes"), value: "minutely", name: "time_unit" },
{ label: t("Hours"), value: "hourly", name: "time_unit" },
{ label: t("Days"), value: "daily", name: "time_unit" },
@ -147,7 +147,7 @@ export function mapStateToPropsAddEdit(props: Everything): AddEditFarmEventProps
sequencesById,
farmEventsById,
executableOptions: executableList,
repeatOptions,
repeatOptions: repeatOptions(),
handleTime,
farmEvents,
getFarmEvent,

View File

@ -38,10 +38,10 @@ export function TileAssertion(props: StepParams) {
</Row>
<Row>
<Col xs={6}>
<TypePart {...p} />
<TypePart key={JSON.stringify(props.currentSequence)} {...p} />
</Col>
<Col xs={6}>
<SequencePart {...p} />
<SequencePart key={JSON.stringify(props.currentSequence)} {...p} />
</Col>
</Row>
</StepContent>