uncaught exception: undefined
parent
84affe3464
commit
e5bfa4997c
|
@ -1,40 +1,34 @@
|
|||
import * as React from "react";
|
||||
import { connect } from "react-redux";
|
||||
// import { TaggedSequence, TaggedFbosConfig } from "farmbot";
|
||||
import { TaggedSequence, TaggedFbosConfig } from "farmbot";
|
||||
import { Everything } from "../../../interfaces";
|
||||
// import { selectAllSequences } from "../../../resources/selectors";
|
||||
// import { getFbosConfig } from "../../../resources/getters";
|
||||
import { selectAllSequences } from "../../../resources/selectors";
|
||||
import { getFbosConfig } from "../../../resources/getters";
|
||||
|
||||
// interface Props {
|
||||
// fbosConfig: TaggedFbosConfig;
|
||||
// sequences: TaggedSequence[];
|
||||
// dispatch: Function;
|
||||
// }
|
||||
interface Props {
|
||||
fbosConfig: TaggedFbosConfig;
|
||||
sequences: TaggedSequence[];
|
||||
dispatch: Function;
|
||||
}
|
||||
|
||||
function mapStateToProps(_p: Everything) {
|
||||
return {};
|
||||
// const { index } = p.resources;
|
||||
// const fbosConfig = getFbosConfig(index);
|
||||
// if (fbosConfig) {
|
||||
// return {
|
||||
// fbosConfig,
|
||||
// sequences: selectAllSequences(index),
|
||||
// dispatch: p.dispatch,
|
||||
// };
|
||||
// } else {
|
||||
// throw new Error("No config found?");
|
||||
// }
|
||||
function mapStateToProps(p: Everything) {
|
||||
const { index } = p.resources;
|
||||
const fbosConfig = getFbosConfig(index);
|
||||
if (fbosConfig) {
|
||||
return {
|
||||
fbosConfig,
|
||||
sequences: selectAllSequences(index),
|
||||
dispatch: p.dispatch,
|
||||
};
|
||||
} else {
|
||||
throw new Error("No config found?");
|
||||
}
|
||||
}
|
||||
|
||||
@connect(mapStateToProps)
|
||||
export class BootSequenceSelector extends React.Component<{}, {}> {
|
||||
componentDidCatch() {
|
||||
return <div>Not ready</div>;
|
||||
}
|
||||
export class BootSequenceSelector extends React.Component<Props, {}> {
|
||||
|
||||
render() {
|
||||
return <div>
|
||||
Loading...
|
||||
</div>;
|
||||
return <div> Ey... </div>;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -196,18 +196,18 @@ const BEFORE_HOOKS: IndexerHook = {
|
|||
};
|
||||
|
||||
const AFTER_HOOKS: IndexerHook = {
|
||||
Device: (i) => {
|
||||
const conf = getFbosConfig(i);
|
||||
FbosConfig: (_i) => {
|
||||
// const conf = getFbosConfig(i);
|
||||
|
||||
if (conf && conf.body.boot_sequence_id) {
|
||||
const tracker = i.inUse["Sequence.FbosConfig"];
|
||||
const sequence =
|
||||
findByKindAndId(i, "Sequence", conf.body.boot_sequence_id);
|
||||
tracker[sequence.uuid] = tracker[sequence.uuid] || {};
|
||||
tracker[sequence.uuid][conf.uuid] = true;
|
||||
} else {
|
||||
i.inUse["Sequence.FbosConfig"] = {};
|
||||
}
|
||||
// if (conf && conf.body.boot_sequence_id) {
|
||||
// const tracker = i.inUse["Sequence.FbosConfig"];
|
||||
// const sequence =
|
||||
// findByKindAndId(i, "Sequence", conf.body.boot_sequence_id);
|
||||
// tracker[sequence.uuid] = tracker[sequence.uuid] || {};
|
||||
// tracker[sequence.uuid][conf.uuid] = true;
|
||||
// } else {
|
||||
// i.inUse["Sequence.FbosConfig"] = {};
|
||||
// }
|
||||
},
|
||||
FarmEvent: reindexAllFarmEventUsage,
|
||||
Sequence: reindexAllSequences,
|
||||
|
|
Loading…
Reference in New Issue