WIP- changed a lot of names
parent
9670d56874
commit
217b7f4823
|
@ -2,7 +2,7 @@ import { TaggedImage } from "../../resources/tagged_resources";
|
|||
|
||||
export let fakeImages: TaggedImage[] = [
|
||||
{
|
||||
"kind": "images",
|
||||
"kind": "Image",
|
||||
"specialStatus": undefined,
|
||||
"body": {
|
||||
"id": 9,
|
||||
|
@ -20,7 +20,7 @@ export let fakeImages: TaggedImage[] = [
|
|||
"uuid": "images.9.3"
|
||||
},
|
||||
{
|
||||
"kind": "images",
|
||||
"kind": "Image",
|
||||
"specialStatus": undefined,
|
||||
"body": {
|
||||
"id": 8,
|
||||
|
@ -38,7 +38,7 @@ export let fakeImages: TaggedImage[] = [
|
|||
"uuid": "images.8.4"
|
||||
},
|
||||
{
|
||||
"kind": "images",
|
||||
"kind": "Image",
|
||||
"specialStatus": undefined,
|
||||
"body": {
|
||||
"id": 7,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Everything } from "../../interfaces";
|
||||
|
||||
export let peripherals: Everything["peripherals"] = {
|
||||
export let peripherals: Everything["Peripheral"] = {
|
||||
"isEditing": true
|
||||
};
|
||||
|
|
|
@ -12,7 +12,7 @@ export let resources: Everything["resources"] = buildResourceIndex();
|
|||
let idCounter = 1;
|
||||
|
||||
export function fakeSequence(): TaggedSequence {
|
||||
return fakeResource("sequences", {
|
||||
return fakeResource("Sequence", {
|
||||
args: { version: 4 },
|
||||
id: 12,
|
||||
color: "red",
|
||||
|
@ -23,7 +23,7 @@ export function fakeSequence(): TaggedSequence {
|
|||
}
|
||||
|
||||
export function fakeRegimen(): TaggedRegimen {
|
||||
return fakeResource("regimens", {
|
||||
return fakeResource("Regimen", {
|
||||
name: "Foo",
|
||||
color: "red",
|
||||
regimen_items: []
|
||||
|
@ -32,7 +32,7 @@ export function fakeRegimen(): TaggedRegimen {
|
|||
|
||||
export function fakeFarmEvent(exe_type: ExecutableType,
|
||||
exe_id: number): TaggedFarmEvent {
|
||||
return fakeResource("farm_events", {
|
||||
return fakeResource("FarmEvent", {
|
||||
"id": 21,
|
||||
"start_time": "2017-05-22T05:00:00.000Z",
|
||||
"end_time": "2017-05-30T05:00:00.000Z",
|
||||
|
@ -45,7 +45,7 @@ export function fakeFarmEvent(exe_type: ExecutableType,
|
|||
}
|
||||
|
||||
export function fakeImage(): TaggedImage {
|
||||
return fakeResource("images", {
|
||||
return fakeResource("Image", {
|
||||
id: idCounter++,
|
||||
device_id: 46,
|
||||
attachment_processed_at: undefined,
|
||||
|
@ -57,13 +57,13 @@ export function fakeImage(): TaggedImage {
|
|||
}
|
||||
|
||||
export function fakeTool(): TaggedTool {
|
||||
return fakeResource("tools", {
|
||||
return fakeResource("Tool", {
|
||||
name: "Foo"
|
||||
});
|
||||
}
|
||||
|
||||
export function fakeUser(): TaggedUser {
|
||||
return fakeResource("users", {
|
||||
return fakeResource("User", {
|
||||
id: idCounter++,
|
||||
device_id: 789,
|
||||
name: "Fake User 123",
|
||||
|
@ -74,7 +74,7 @@ export function fakeUser(): TaggedUser {
|
|||
}
|
||||
|
||||
export function fakeToolSlot(): TaggedToolSlotPointer {
|
||||
return fakeResource("points", {
|
||||
return fakeResource("Point", {
|
||||
name: "ToolSlot 1",
|
||||
pointer_type: "ToolSlot",
|
||||
tool_id: 1,
|
||||
|
@ -87,7 +87,7 @@ export function fakeToolSlot(): TaggedToolSlotPointer {
|
|||
}
|
||||
|
||||
export function fakePlant(): TaggedPlantPointer {
|
||||
return fakeResource("points", {
|
||||
return fakeResource("Point", {
|
||||
id: idCounter++,
|
||||
name: "Strawberry Plant 1",
|
||||
pointer_type: "Plant",
|
||||
|
@ -101,7 +101,7 @@ export function fakePlant(): TaggedPlantPointer {
|
|||
}
|
||||
|
||||
export function fakePoint(): TaggedGenericPointer {
|
||||
return fakeResource("points", {
|
||||
return fakeResource("Point", {
|
||||
id: idCounter++,
|
||||
name: "Point 1",
|
||||
pointer_type: "GenericPointer",
|
||||
|
@ -115,7 +115,7 @@ export function fakePoint(): TaggedGenericPointer {
|
|||
|
||||
export function fakeWebcamFeed(): TaggedWebcamFeed {
|
||||
const id = idCounter++;
|
||||
return fakeResource("webcam_feed", {
|
||||
return fakeResource("WebcamFeed", {
|
||||
id,
|
||||
created_at: "---",
|
||||
updated_at: "---",
|
||||
|
@ -125,7 +125,7 @@ export function fakeWebcamFeed(): TaggedWebcamFeed {
|
|||
}
|
||||
|
||||
export function fakePeripheral(): TaggedPeripheral {
|
||||
return fakeResource("peripherals", {
|
||||
return fakeResource("Peripheral", {
|
||||
id: idCounter++,
|
||||
label: "Fake Pin",
|
||||
pin: 1
|
||||
|
|
|
@ -4,7 +4,7 @@ import * as _ from "lodash";
|
|||
import { Actions } from "../constants";
|
||||
export function fakeDevice(): TaggedDevice {
|
||||
return {
|
||||
"kind": "device",
|
||||
"kind": "Device",
|
||||
"specialStatus": undefined,
|
||||
"body": {
|
||||
"id": 415,
|
||||
|
@ -15,7 +15,7 @@ export function fakeDevice(): TaggedDevice {
|
|||
}
|
||||
export let FAKE_RESOURCES: TaggedResource[] = [
|
||||
{
|
||||
"kind": "users",
|
||||
"kind": "User",
|
||||
"body": {
|
||||
"id": 152,
|
||||
"name": "FarmBot 1",
|
||||
|
@ -29,7 +29,7 @@ export let FAKE_RESOURCES: TaggedResource[] = [
|
|||
fakeDevice(),
|
||||
{
|
||||
"specialStatus": undefined,
|
||||
"kind": "farm_events",
|
||||
"kind": "FarmEvent",
|
||||
"body": {
|
||||
"id": 21,
|
||||
"start_time": "2017-05-22T05:00:00.000Z",
|
||||
|
@ -50,7 +50,7 @@ export let FAKE_RESOURCES: TaggedResource[] = [
|
|||
},
|
||||
{
|
||||
"specialStatus": undefined,
|
||||
"kind": "farm_events",
|
||||
"kind": "FarmEvent",
|
||||
"body": {
|
||||
"id": 22,
|
||||
"start_time": "2017-05-22T05:00:00.000Z",
|
||||
|
@ -68,7 +68,7 @@ export let FAKE_RESOURCES: TaggedResource[] = [
|
|||
},
|
||||
{
|
||||
"specialStatus": undefined,
|
||||
"kind": "images",
|
||||
"kind": "Image",
|
||||
"body": {
|
||||
"id": 415,
|
||||
"device_id": 415,
|
||||
|
@ -86,7 +86,7 @@ export let FAKE_RESOURCES: TaggedResource[] = [
|
|||
},
|
||||
{
|
||||
"specialStatus": undefined,
|
||||
"kind": "images",
|
||||
"kind": "Image",
|
||||
"body": {
|
||||
"id": 414,
|
||||
"device_id": 415,
|
||||
|
@ -104,7 +104,7 @@ export let FAKE_RESOURCES: TaggedResource[] = [
|
|||
},
|
||||
{
|
||||
"specialStatus": undefined,
|
||||
"kind": "peripherals",
|
||||
"kind": "Peripheral",
|
||||
"body": {
|
||||
"id": 11,
|
||||
"pin": 13,
|
||||
|
@ -115,7 +115,7 @@ export let FAKE_RESOURCES: TaggedResource[] = [
|
|||
},
|
||||
{
|
||||
"specialStatus": undefined,
|
||||
"kind": "points",
|
||||
"kind": "Point",
|
||||
"body": {
|
||||
"id": 1392,
|
||||
"created_at": "2017-05-24T20:41:19.804Z",
|
||||
|
@ -136,7 +136,7 @@ export let FAKE_RESOURCES: TaggedResource[] = [
|
|||
},
|
||||
{
|
||||
"specialStatus": undefined,
|
||||
"kind": "points",
|
||||
"kind": "Point",
|
||||
"body": {
|
||||
"id": 1393,
|
||||
"created_at": "2017-05-24T20:41:19.822Z",
|
||||
|
@ -157,7 +157,7 @@ export let FAKE_RESOURCES: TaggedResource[] = [
|
|||
},
|
||||
{
|
||||
"specialStatus": undefined,
|
||||
"kind": "points",
|
||||
"kind": "Point",
|
||||
"body": {
|
||||
"id": 1394,
|
||||
"created_at": "2017-05-24T20:41:19.855Z",
|
||||
|
@ -178,7 +178,7 @@ export let FAKE_RESOURCES: TaggedResource[] = [
|
|||
},
|
||||
{
|
||||
"specialStatus": undefined,
|
||||
"kind": "points",
|
||||
"kind": "Point",
|
||||
"body": {
|
||||
"id": 1395,
|
||||
"created_at": "2017-05-24T20:41:19.889Z",
|
||||
|
@ -198,7 +198,7 @@ export let FAKE_RESOURCES: TaggedResource[] = [
|
|||
"uuid": "points.1395.9"
|
||||
},
|
||||
{
|
||||
"kind": "points",
|
||||
"kind": "Point",
|
||||
"specialStatus": undefined,
|
||||
"body": {
|
||||
"id": 1396,
|
||||
|
@ -220,7 +220,7 @@ export let FAKE_RESOURCES: TaggedResource[] = [
|
|||
},
|
||||
{
|
||||
"specialStatus": undefined,
|
||||
"kind": "regimens",
|
||||
"kind": "Regimen",
|
||||
"body": {
|
||||
"id": 11,
|
||||
"name": "Test Regimen 456",
|
||||
|
@ -238,7 +238,7 @@ export let FAKE_RESOURCES: TaggedResource[] = [
|
|||
"uuid": "regimens.11.46"
|
||||
},
|
||||
{
|
||||
"kind": "sequences",
|
||||
"kind": "Sequence",
|
||||
"specialStatus": undefined,
|
||||
"body": {
|
||||
"id": 23,
|
||||
|
@ -279,7 +279,7 @@ export let FAKE_RESOURCES: TaggedResource[] = [
|
|||
},
|
||||
{
|
||||
"specialStatus": undefined,
|
||||
"kind": "tools",
|
||||
"kind": "Tool",
|
||||
"body": {
|
||||
"id": 14,
|
||||
"name": "Trench Digging Tool",
|
||||
|
@ -289,7 +289,7 @@ export let FAKE_RESOURCES: TaggedResource[] = [
|
|||
},
|
||||
{
|
||||
"specialStatus": undefined,
|
||||
"kind": "tools",
|
||||
"kind": "Tool",
|
||||
"body": {
|
||||
"id": 15,
|
||||
"name": "Berry Picking Tool",
|
||||
|
|
|
@ -10,7 +10,7 @@ export let user: User = {
|
|||
};
|
||||
|
||||
export let taggedUser: TaggedUser = {
|
||||
kind: "users",
|
||||
kind: "User",
|
||||
uuid: "1234-5678",
|
||||
specialStatus: undefined,
|
||||
body: {
|
||||
|
|
|
@ -40,11 +40,11 @@ describe("<App />: Controls Pop-Up", () => {
|
|||
controlsPopUp("designer", true);
|
||||
controlsPopUp("designer/plants", true);
|
||||
controlsPopUp("controls", false);
|
||||
controlsPopUp("device", true);
|
||||
controlsPopUp("sequences", true);
|
||||
controlsPopUp("Device", true);
|
||||
controlsPopUp("Sequence", true);
|
||||
controlsPopUp("sequences/for_regimens", true);
|
||||
controlsPopUp("regimens", false);
|
||||
controlsPopUp("tools", true);
|
||||
controlsPopUp("Regimen", false);
|
||||
controlsPopUp("Tool", true);
|
||||
controlsPopUp("farmware", true);
|
||||
controlsPopUp("account", false);
|
||||
|
||||
|
@ -68,14 +68,14 @@ describe.skip("<App />: Loading", () => {
|
|||
|
||||
it("MUST_LOADs partially loaded", () => {
|
||||
const p = fakeProps();
|
||||
p.loaded = ["sequences"];
|
||||
p.loaded = ["Sequence"];
|
||||
const wrapper = mount(<App {...p } />);
|
||||
expect(wrapper.html()).toContain("spinner");
|
||||
});
|
||||
|
||||
it("MUST_LOADs loaded", () => {
|
||||
const p = fakeProps();
|
||||
p.loaded = ["sequences", "regimens", "farm_events", "points"];
|
||||
p.loaded = ["Sequence", "Regimen", "FarmEvent", "Point"];
|
||||
const wrapper = mount(<App {...p } />);
|
||||
expect(wrapper.html()).not.toContain("spinner");
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@ import { TaggedFarmEvent } from "../resources/tagged_resources";
|
|||
|
||||
const STUB_RESOURCE: TaggedFarmEvent = {
|
||||
"uuid": "farm_events.0.435",
|
||||
"kind": "farm_events",
|
||||
"kind": "FarmEvent",
|
||||
"specialStatus": undefined,
|
||||
"body": {
|
||||
"id": 217,
|
||||
|
@ -31,7 +31,7 @@ test("buildResourceIndex - add a FarmEvent", () => {
|
|||
const db = buildResourceIndex([STUB_RESOURCE]);
|
||||
const fe = db.index.references[db.index.byKind.farm_events[0]];
|
||||
expect(fe).toBeTruthy();
|
||||
if (fe && fe.kind === "farm_events") {
|
||||
if (fe && fe.kind === "FarmEvent") {
|
||||
const { body } = fe;
|
||||
expect(body).toEqual(STUB_RESOURCE.body);
|
||||
} else {
|
||||
|
|
|
@ -23,7 +23,7 @@ describe("refresh()", () => {
|
|||
it("rejects malformed API data", (done) => {
|
||||
const device1: TaggedDevice = {
|
||||
"uuid": "device.6.1",
|
||||
"kind": "device",
|
||||
"kind": "Device",
|
||||
"specialStatus": undefined,
|
||||
"body": {
|
||||
"id": 6,
|
||||
|
|
|
@ -26,7 +26,7 @@ describe("successful refresh()", () => {
|
|||
it("re-downloads an existing resource", (done) => {
|
||||
const device1: TaggedDevice = {
|
||||
"uuid": "device.6.1",
|
||||
"kind": "device",
|
||||
"kind": "Device",
|
||||
"specialStatus": undefined,
|
||||
"body": {
|
||||
"id": 6,
|
||||
|
|
|
@ -217,11 +217,11 @@ function updateViaAjax(index: ResourceIndex,
|
|||
}
|
||||
|
||||
const MUST_CONFIRM_LIST: ResourceName[] = [
|
||||
"farm_events",
|
||||
"points",
|
||||
"sequences",
|
||||
"regimens",
|
||||
"images"
|
||||
"FarmEvent",
|
||||
"Point",
|
||||
"Sequence",
|
||||
"Regimen",
|
||||
"Image"
|
||||
];
|
||||
|
||||
const confirmationChecker = (resource: TaggedResource, force = false) =>
|
||||
|
|
|
@ -50,10 +50,10 @@ const LOAD_TIME_FAILURE_MS = 25000;
|
|||
* App will crash at load time if they are not pre-loaded.
|
||||
*/
|
||||
const MUST_LOAD: ResourceName[] = [
|
||||
"sequences",
|
||||
"regimens",
|
||||
"farm_events",
|
||||
"points"
|
||||
"Sequence",
|
||||
"Regimen",
|
||||
"FarmEvent",
|
||||
"Point"
|
||||
];
|
||||
|
||||
@connect(mapStateToProps)
|
||||
|
|
|
@ -103,9 +103,9 @@ describe("initLog", () => {
|
|||
it("creates a Redux action (new log)", () => {
|
||||
const log = fakeLog("error");
|
||||
const action = initLog(log);
|
||||
expect(action.payload.kind).toBe("logs");
|
||||
expect(action.payload.kind).toBe("Log");
|
||||
// expect(action.payload.specialStatus).toBe(undefined);
|
||||
if (action.payload.kind === "logs") {
|
||||
if (action.payload.kind === "Log") {
|
||||
expect(action.payload.body.message).toBe(log.message);
|
||||
} else {
|
||||
fail();
|
||||
|
|
|
@ -61,7 +61,7 @@ export function showLogOnScreen(log: Log) {
|
|||
}
|
||||
|
||||
export const initLog = (log: Log): ReduxAction<TaggedResource> => init({
|
||||
kind: "logs",
|
||||
kind: "Log",
|
||||
specialStatus: undefined,
|
||||
uuid: "MUST_CHANGE",
|
||||
body: log
|
||||
|
@ -143,7 +143,7 @@ const attachEventListeners =
|
|||
bot.on("online", onOnline);
|
||||
bot.on("offline", onOffline);
|
||||
bot.on("sent", onSent(bot.client));
|
||||
bot.on("logs", onLogs(dispatch));
|
||||
bot.on("Log", onLogs(dispatch));
|
||||
bot.on("status", onStatus(dispatch, getState));
|
||||
bot.on("malformed", onMalformed);
|
||||
readStatus().then(changeLastClientConnected(bot), noop);
|
||||
|
|
|
@ -9,6 +9,6 @@ describe("mapStateToProps()", () => {
|
|||
state.resources = buildResourceIndex([fakeUser()]);
|
||||
const result = mapStateToProps(state);
|
||||
expect(result.user).toBeTruthy();
|
||||
expect(result.user && result.user.kind).toBe("users");
|
||||
expect(result.user && result.user.kind).toBe("User");
|
||||
});
|
||||
});
|
||||
|
|
|
@ -28,7 +28,7 @@ describe("<Peripherals />", () => {
|
|||
|
||||
it("renders", () => {
|
||||
const wrapper = mount(<Peripherals {...fakeProps() } />);
|
||||
["Peripherals", "Edit", "Save", "Fake Pin", "1"].map(string =>
|
||||
["Peripheral", "Edit", "Save", "Fake Pin", "1"].map(string =>
|
||||
expect(wrapper.text()).toContain(string));
|
||||
const saveButton = wrapper.find("button").at(1);
|
||||
expect(saveButton.text()).toContain("Save");
|
||||
|
|
|
@ -9,7 +9,7 @@ describe("<PeripheralForm/>", function () {
|
|||
{
|
||||
uuid: "peripherals.2.2",
|
||||
specialStatus: undefined,
|
||||
kind: "peripherals",
|
||||
kind: "Peripheral",
|
||||
body: {
|
||||
id: 2,
|
||||
pin: 13,
|
||||
|
@ -19,7 +19,7 @@ describe("<PeripheralForm/>", function () {
|
|||
{
|
||||
uuid: "peripherals.1.1",
|
||||
specialStatus: undefined,
|
||||
kind: "peripherals",
|
||||
kind: "Peripheral",
|
||||
body: {
|
||||
id: 1,
|
||||
pin: 2,
|
||||
|
|
|
@ -20,7 +20,7 @@ describe("<PeripheralList/>", function () {
|
|||
const peripherals: TaggedPeripheral[] = [
|
||||
{
|
||||
uuid: "peripherals.2.2",
|
||||
kind: "peripherals",
|
||||
kind: "Peripheral",
|
||||
specialStatus: undefined,
|
||||
body: {
|
||||
id: 2,
|
||||
|
@ -30,7 +30,7 @@ describe("<PeripheralList/>", function () {
|
|||
},
|
||||
{
|
||||
uuid: "peripherals.1.1",
|
||||
kind: "peripherals",
|
||||
kind: "Peripheral",
|
||||
specialStatus: undefined,
|
||||
body: {
|
||||
id: 1,
|
||||
|
|
|
@ -60,7 +60,7 @@ export class Peripherals extends React.Component<PeripheralsProps, PeripheralSta
|
|||
return {
|
||||
uuid: "WILL_BE_CHANGED_BY_REDUCER",
|
||||
specialStatus: undefined,
|
||||
kind: "peripherals",
|
||||
kind: "Peripheral",
|
||||
body: { pin: 0, label: "New Peripheral" }
|
||||
};
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ export class Peripherals extends React.Component<PeripheralsProps, PeripheralSta
|
|||
const status = getArrayStatus(peripherals);
|
||||
|
||||
return <Widget className="peripherals-widget">
|
||||
<WidgetHeader title={"Peripherals"} helpText={ToolTips.PERIPHERALS}>
|
||||
<WidgetHeader title={"Peripheral"} helpText={ToolTips.PERIPHERALS}>
|
||||
<button
|
||||
className="fb-button gray"
|
||||
onClick={this.toggle}
|
||||
|
|
|
@ -15,7 +15,7 @@ type P = {
|
|||
};
|
||||
|
||||
const EMPTY_FEED: TaggedWebcamFeed = {
|
||||
kind: "webcam_feed",
|
||||
kind: "WebcamFeed",
|
||||
specialStatus: SpecialStatus.DIRTY,
|
||||
uuid: "",
|
||||
body: {
|
||||
|
|
|
@ -9,7 +9,7 @@ import { AuthState } from "../../../auth/interfaces";
|
|||
describe("<FarmbotOsSettings/>", () => {
|
||||
it("renders settings", () => {
|
||||
const osSettings = mount(<FarmbotOsSettings
|
||||
account={fakeResource("device", { id: 0, name: "" })}
|
||||
account={fakeResource("Device", { id: 0, name: "" })}
|
||||
dispatch={jest.fn()}
|
||||
bot={bot}
|
||||
auth={fakeState().auth as AuthState} />);
|
||||
|
|
|
@ -4,7 +4,7 @@ import { LastSeen } from "../last_seen_widget";
|
|||
import { mount } from "enzyme";
|
||||
import { SpecialStatus } from "../../../resources/tagged_resources";
|
||||
describe("<LastSeen/>", () => {
|
||||
const resource = () => fakeResource("device", {
|
||||
const resource = () => fakeResource("Device", {
|
||||
id: 1,
|
||||
name: "foo",
|
||||
last_saw_api: ""
|
||||
|
|
|
@ -19,7 +19,7 @@ describe("<AddFarmEvent />", () => {
|
|||
const sequence = fakeSequence();
|
||||
sequence.body.id = 1;
|
||||
const farmEvent = fakeFarmEvent("Sequence", 1);
|
||||
farmEvent.uuid = "farm_events";
|
||||
farmEvent.uuid = "FarmEvent";
|
||||
return {
|
||||
deviceTimezone: "",
|
||||
dispatch: jest.fn(),
|
||||
|
@ -39,7 +39,7 @@ describe("<AddFarmEvent />", () => {
|
|||
|
||||
it("renders", () => {
|
||||
const wrapper = mount(<AddFarmEvent {...fakeProps() } />);
|
||||
wrapper.setState({ uuid: "farm_events" });
|
||||
wrapper.setState({ uuid: "FarmEvent" });
|
||||
["Add Farm Event", "Sequence or Regimen", "fake"].map(string =>
|
||||
expect(wrapper.text()).toContain(string));
|
||||
});
|
||||
|
|
|
@ -45,11 +45,11 @@ export class AddFarmEvent
|
|||
componentDidMount() {
|
||||
if (this.executable) {
|
||||
const executable_type: ExecutableType =
|
||||
(this.executable.kind === "sequences") ? "Sequence" : "Regimen";
|
||||
(this.executable.kind === "Sequence") ? "Sequence" : "Regimen";
|
||||
const executable_id = this.executable.body.id || 1;
|
||||
const NOW = moment().toISOString();
|
||||
const action = init({
|
||||
kind: "farm_events",
|
||||
kind: "FarmEvent",
|
||||
specialStatus: SpecialStatus.DIRTY,
|
||||
uuid: "---",
|
||||
body: {
|
||||
|
|
|
@ -140,7 +140,7 @@ export class EditFEForm extends React.Component<EditFEProps, State> {
|
|||
|
||||
executableGet = (): DropDownItem => {
|
||||
const headingId: ExecutableType =
|
||||
(this.executable.kind === "sequences") ?
|
||||
(this.executable.kind === "Sequence") ?
|
||||
"Sequence" : "Regimen";
|
||||
return {
|
||||
value: this.executable.body.id || 0,
|
||||
|
|
|
@ -82,14 +82,14 @@ export function mapStateToPropsAddEdit(props: Everything): AddEditFarmEventProps
|
|||
const executableOptions: DropDownItem[] = [];
|
||||
|
||||
executableOptions.push({
|
||||
label: t("REGIMENS"),
|
||||
label: t("Regimen"),
|
||||
heading: true,
|
||||
value: 0,
|
||||
headingId: "Regimen"
|
||||
});
|
||||
|
||||
selectAllRegimens(props.resources.index).map(regimen => {
|
||||
if (regimen.kind === "regimens" && regimen.body.id) {
|
||||
if (regimen.kind === "Regimen" && regimen.body.id) {
|
||||
executableOptions.push({
|
||||
label: regimen.body.name,
|
||||
headingId: "Regimen",
|
||||
|
@ -99,14 +99,14 @@ export function mapStateToPropsAddEdit(props: Everything): AddEditFarmEventProps
|
|||
});
|
||||
|
||||
executableOptions.push({
|
||||
label: t("SEQUENCES"),
|
||||
label: t("Sequence"),
|
||||
heading: true,
|
||||
value: 0,
|
||||
headingId: "Sequence"
|
||||
});
|
||||
|
||||
selectAllSequences(props.resources.index).map(sequence => {
|
||||
if (sequence.kind === "sequences" && sequence.body.id) {
|
||||
if (sequence.kind === "Sequence" && sequence.body.id) {
|
||||
executableOptions.push({
|
||||
label: sequence.body.name,
|
||||
headingId: "Sequence",
|
||||
|
@ -146,7 +146,7 @@ export function mapStateToPropsAddEdit(props: Everything): AddEditFarmEventProps
|
|||
const getFarmEvent = (): TaggedFarmEvent | undefined => {
|
||||
const url = history.getCurrentLocation().pathname;
|
||||
const id = parseInt(url.split("/")[4]);
|
||||
if (id && hasId(props.resources.index, "farm_events", id)) {
|
||||
if (id && hasId(props.resources.index, "FarmEvent", id)) {
|
||||
return findFarmEventById(props.resources.index, id);
|
||||
} else {
|
||||
history.push("/app/designer/farm_events");
|
||||
|
|
|
@ -141,7 +141,7 @@ export class GardenMap extends
|
|||
error(t("Outside of planting area. Plants must be placed within the grid."));
|
||||
} else {
|
||||
const p: TaggedPlantPointer = {
|
||||
kind: "points",
|
||||
kind: "Point",
|
||||
uuid: "--never",
|
||||
specialStatus: undefined,
|
||||
body: Plant({
|
||||
|
|
|
@ -27,7 +27,7 @@ describe("<ToolSlotLayer/>", () => {
|
|||
z: 3,
|
||||
meta: {}
|
||||
};
|
||||
const toolSlot = fakeResource("points", ts);
|
||||
const toolSlot = fakeResource("Point", ts);
|
||||
return {
|
||||
visible: false,
|
||||
slots: [{ toolSlot, tool: undefined }],
|
||||
|
|
|
@ -11,8 +11,8 @@ export let METHOD_MAP: Dictionary<DataChangeType> = {
|
|||
};
|
||||
export let METHODS = ["post", "put", "patch", "delete"];
|
||||
export let RESOURCES: ResourceName[] = [
|
||||
"plants", "regimens", "peripherals", "logs", "sequences",
|
||||
"farm_events", "tool_slots", "tools", "points", "device"];
|
||||
"plants", "Regimen", "Peripheral", "Log", "Sequence",
|
||||
"FarmEvent", "tool_slots", "Tool", "Point", "Device"];
|
||||
|
||||
// PROBLEM: The bot doesn't know if the user has changed any of the data.
|
||||
// GOOD SOLUTION: Create a push notification system on the API.
|
||||
|
|
|
@ -6,10 +6,10 @@ import { NavLinksProps } from "./interfaces";
|
|||
export const links = [
|
||||
{ name: "Farm Designer", icon: "leaf", slug: "designer" },
|
||||
{ name: "Controls", icon: "keyboard-o", slug: "controls" },
|
||||
{ name: "Device", icon: "cog", slug: "device" },
|
||||
{ name: "Sequences", icon: "server", slug: "sequences" },
|
||||
{ name: "Regimens", icon: "calendar-check-o", slug: "regimens" },
|
||||
{ name: "Tools", icon: "wrench", slug: "tools" },
|
||||
{ name: "Device", icon: "cog", slug: "Device" },
|
||||
{ name: "Sequence", icon: "server", slug: "Sequence" },
|
||||
{ name: "Regimen", icon: "calendar-check-o", slug: "Regimen" },
|
||||
{ name: "Tool", icon: "wrench", slug: "Tool" },
|
||||
{ name: "Farmware", icon: "crosshairs", slug: "farmware" }
|
||||
];
|
||||
|
||||
|
|
|
@ -14,12 +14,12 @@ describe("editRegimen()", () => {
|
|||
it("calls edit", () => {
|
||||
const dispatch = jest.fn();
|
||||
const regimen = fakeRegimen();
|
||||
regimen.uuid = "regimens";
|
||||
regimen.uuid = "Regimen";
|
||||
editRegimen(regimen, {})(dispatch);
|
||||
expect(dispatch).toHaveBeenCalledWith({
|
||||
payload: {
|
||||
update: {},
|
||||
uuid: "regimens"
|
||||
uuid: "Regimen"
|
||||
},
|
||||
type: Actions.EDIT_RESOURCE
|
||||
});
|
||||
|
@ -36,7 +36,7 @@ describe("saveRegimen()", () => {
|
|||
expect(dispatch).toHaveBeenCalledWith({
|
||||
payload: {
|
||||
body: { color: "red", name: "Foo", regimen_items: [] },
|
||||
kind: "regimens",
|
||||
kind: "Regimen",
|
||||
uuid: state.resources.index.all[0]
|
||||
},
|
||||
type: Actions.SAVE_RESOURCE_START
|
||||
|
@ -65,7 +65,7 @@ describe("deleteRegimen()", () => {
|
|||
expect(dispatch).toHaveBeenCalledWith({
|
||||
payload: {
|
||||
body: { color: "red", name: "Foo", regimen_items: [] },
|
||||
kind: "regimens",
|
||||
kind: "Regimen",
|
||||
uuid: state.resources.index.all[0]
|
||||
},
|
||||
type: Actions.DESTROY_RESOURCE_OK
|
||||
|
@ -76,13 +76,13 @@ describe("deleteRegimen()", () => {
|
|||
describe("selectRegimen()", () => {
|
||||
it("selects regimen", () => {
|
||||
const regimen = fakeRegimen();
|
||||
regimen.uuid = "regimens";
|
||||
regimen.uuid = "Regimen";
|
||||
const action = selectRegimen(regimen);
|
||||
expect(action).toEqual({
|
||||
payload: {
|
||||
body: { color: "red", name: "Foo", regimen_items: [] },
|
||||
kind: "regimens",
|
||||
uuid: "regimens"
|
||||
kind: "Regimen",
|
||||
uuid: "Regimen"
|
||||
},
|
||||
type: Actions.SELECT_REGIMEN
|
||||
});
|
||||
|
|
|
@ -26,7 +26,7 @@ describe("<Regimens />", () => {
|
|||
calendar: []
|
||||
};
|
||||
const wrapper = mount(<Regimens {...fakeProps } />);
|
||||
["Regimens", "Regimen Editor", "Scheduler"].map(string =>
|
||||
["Regimen", "Regimen Editor", "Scheduler"].map(string =>
|
||||
expect(wrapper.text()).toContain(string));
|
||||
});
|
||||
});
|
||||
|
|
|
@ -78,7 +78,7 @@ describe("INIT_RESOURCE", () => {
|
|||
state.currentRegimen = undefined;
|
||||
const action = {
|
||||
type: Actions.INIT_RESOURCE,
|
||||
payload: { uuid: "regimens.4.56", kind: "regimens" }
|
||||
payload: { uuid: "regimens.4.56", kind: "Regimen" }
|
||||
};
|
||||
const nextState = regimensReducer(STATE, action);
|
||||
expect(nextState.currentRegimen).toBe(action.payload.uuid);
|
||||
|
@ -91,7 +91,7 @@ describe("SELECT_REGIMEN", () => {
|
|||
state.currentRegimen = undefined;
|
||||
const action = {
|
||||
type: Actions.SELECT_REGIMEN,
|
||||
payload: { uuid: "regimens.4.56", kind: "regimens" }
|
||||
payload: { uuid: "regimens.4.56", kind: "Regimen" }
|
||||
};
|
||||
const nextState = regimensReducer(STATE, action);
|
||||
expect(nextState.currentRegimen).toBe(action.payload.uuid);
|
||||
|
|
|
@ -15,7 +15,7 @@ describe("mapStateToProps()", () => {
|
|||
const fakeResources: TaggedResource[] = [
|
||||
{
|
||||
"specialStatus": undefined,
|
||||
"kind": "regimens",
|
||||
"kind": "Regimen",
|
||||
"body": {
|
||||
"id": 1,
|
||||
"name": "Test Regimen",
|
||||
|
@ -32,7 +32,7 @@ describe("mapStateToProps()", () => {
|
|||
"uuid": "N/A"
|
||||
},
|
||||
{
|
||||
"kind": "sequences",
|
||||
"kind": "Sequence",
|
||||
"specialStatus": undefined,
|
||||
"body": {
|
||||
"id": 1,
|
||||
|
|
|
@ -20,7 +20,7 @@ describe("commitBulkEditor()", () => {
|
|||
const fakeResources: TaggedResource[] = [
|
||||
{
|
||||
"specialStatus": undefined,
|
||||
"kind": "regimens",
|
||||
"kind": "Regimen",
|
||||
"body": {
|
||||
"id": 1,
|
||||
"name": "Test Regimen",
|
||||
|
@ -37,7 +37,7 @@ describe("commitBulkEditor()", () => {
|
|||
"uuid": "N/A"
|
||||
},
|
||||
{
|
||||
"kind": "sequences",
|
||||
"kind": "Sequence",
|
||||
"specialStatus": undefined,
|
||||
"body": {
|
||||
"id": 1,
|
||||
|
@ -146,9 +146,9 @@ describe("toggleDay()", () => {
|
|||
|
||||
describe("setSequence()", () => {
|
||||
it("returns action", () => {
|
||||
const action = setSequence("sequences");
|
||||
const action = setSequence("Sequence");
|
||||
expect(action).toEqual({
|
||||
payload: "sequences",
|
||||
payload: "Sequence",
|
||||
type: Actions.SET_SEQUENCE
|
||||
});
|
||||
});
|
||||
|
|
|
@ -68,9 +68,9 @@ describe("<BulkSchedulerWidget />", () => {
|
|||
p.dispatch = jest.fn();
|
||||
const wrapper = shallow(<BulkSchedulerWidget {...p } />);
|
||||
const sequenceInput = wrapper.find("FBSelect").first();
|
||||
sequenceInput.simulate("change", { value: "sequences" });
|
||||
sequenceInput.simulate("change", { value: "Sequence" });
|
||||
expect(p.dispatch).toHaveBeenCalledWith({
|
||||
payload: "sequences",
|
||||
payload: "Sequence",
|
||||
type: Actions.SET_SEQUENCE
|
||||
});
|
||||
});
|
||||
|
|
|
@ -58,7 +58,7 @@ export function toggleDay({ week, day }: ToggleDayParams) {
|
|||
}
|
||||
|
||||
export function setSequence(uuid: string): ReduxAction<string> {
|
||||
assertUuid("sequences", uuid);
|
||||
assertUuid("Sequence", uuid);
|
||||
return { type: Actions.SET_SEQUENCE, payload: uuid };
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import { mapStateToProps } from "./state_to_props";
|
|||
@connect(mapStateToProps)
|
||||
export class Regimens extends React.Component<Props, {}> {
|
||||
render() {
|
||||
return <Page className="regimens">
|
||||
return <Page className="Regimen">
|
||||
<Row>
|
||||
<Col sm={3}>
|
||||
<RegimensList
|
||||
|
|
|
@ -49,7 +49,7 @@ export interface RegimenProps {
|
|||
dispatch: Function;
|
||||
}
|
||||
|
||||
/** A list of "sequences" scheduled after a starting point (epoch). */
|
||||
/** A list of "Sequence" scheduled after a starting point (epoch). */
|
||||
export interface Regimen {
|
||||
id?: number;
|
||||
/** Friendly identifier for humans to easily identify regimens. */
|
||||
|
|
|
@ -27,7 +27,7 @@ describe("<AddRegimen/>", () => {
|
|||
const action = dispatch.mock.calls[0][0];
|
||||
expect(action.type).toEqual("INIT_RESOURCE");
|
||||
expect(action.payload).toBeTruthy();
|
||||
expect(action.payload.kind).toEqual("regimens");
|
||||
expect(action.payload.kind).toEqual("Regimen");
|
||||
});
|
||||
|
||||
it("has children (or defaults)");
|
||||
|
|
|
@ -16,7 +16,7 @@ describe("<RegimensList />", () => {
|
|||
}
|
||||
it("renders", () => {
|
||||
const wrapper = mount(<RegimensList {...fakeProps() } />);
|
||||
expect(wrapper.text()).toContain("Regimens");
|
||||
expect(wrapper.text()).toContain("Regimen");
|
||||
expect(wrapper.text()).toContain("Fake Regimen Fake Regimen");
|
||||
});
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import { init } from "../../api/crud";
|
|||
|
||||
function emptyRegimen(length: number): TaggedRegimen {
|
||||
return {
|
||||
kind: "regimens",
|
||||
kind: "Regimen",
|
||||
uuid: "NEVER",
|
||||
specialStatus: SpecialStatus.DIRTY,
|
||||
body: {
|
||||
|
|
|
@ -64,7 +64,7 @@ export class RegimensList extends
|
|||
return (
|
||||
<div className="regimen-list-panel">
|
||||
<h3>
|
||||
<i>{t("Regimens")}</i>
|
||||
<i>{t("Regimen")}</i>
|
||||
</h3>
|
||||
<ToolTip helpText={ToolTips.REGIMEN_LIST} />
|
||||
<AddRegimen dispatch={dispatch} length={regimens.length} />
|
||||
|
|
|
@ -48,7 +48,7 @@ export let regimensReducer = generateReducer<RegimenState>(initialState)
|
|||
return s;
|
||||
})
|
||||
.add<TaggedResource>(Actions.INIT_RESOURCE, (s, { payload }) => {
|
||||
if (payload.kind === "regimens") {
|
||||
if (payload.kind === "Regimen") {
|
||||
s.currentRegimen = payload.uuid;
|
||||
}
|
||||
return s;
|
||||
|
|
|
@ -69,7 +69,7 @@ function generateCalendar(regimen: TaggedRegimen,
|
|||
|
||||
const createRows = (index: ResourceIndex, dispatch: Function, regimen: TaggedRegimen) =>
|
||||
(item: RegimenItem): RegimenItemCalendarRow => {
|
||||
const uuid = findId(index, "sequences", item.sequence_id);
|
||||
const uuid = findId(index, "Sequence", item.sequence_id);
|
||||
const sequence = findSequence(index, uuid);
|
||||
const { time_offset } = item;
|
||||
const d = duration(time_offset);
|
||||
|
|
|
@ -10,7 +10,7 @@ describe("resource reducer", () => {
|
|||
const sequence = state.index.references[uuid] as TaggedSequence;
|
||||
expect(sequence).toBeTruthy();
|
||||
|
||||
expect(sequence.kind).toBe("sequences");
|
||||
expect(sequence.kind).toBe("Sequence");
|
||||
const next = resourceReducer(state, overwrite(sequence, {
|
||||
name: "wow",
|
||||
body: []
|
||||
|
@ -25,7 +25,7 @@ describe("resource reducer", () => {
|
|||
const device = state.index.references[uuid] as TaggedSequence;
|
||||
expect(device).toBeTruthy();
|
||||
|
||||
expect(device.kind).toBe("device");
|
||||
expect(device.kind).toBe("Device");
|
||||
const afterStart = resourceReducer(state, refreshStart(device.uuid));
|
||||
const dev2 = afterStart.index.references[uuid] as TaggedDevice;
|
||||
expect(dev2.specialStatus).toBe(SpecialStatus.SAVING);
|
||||
|
|
|
@ -10,18 +10,18 @@ import { Actions } from "../../constants";
|
|||
const TOOL_ID = 99;
|
||||
const SLOT_ID = 100;
|
||||
const fakeTool: TaggedTool = {
|
||||
kind: "tools",
|
||||
kind: "Tool",
|
||||
specialStatus: undefined,
|
||||
uuid: generateUuid(TOOL_ID, "tools"),
|
||||
uuid: generateUuid(TOOL_ID, "Tool"),
|
||||
body: {
|
||||
name: "yadda yadda",
|
||||
id: TOOL_ID
|
||||
}
|
||||
};
|
||||
const fakeSlot: TaggedToolSlotPointer = {
|
||||
kind: "points",
|
||||
kind: "Point",
|
||||
specialStatus: undefined,
|
||||
uuid: generateUuid(SLOT_ID, "points"),
|
||||
uuid: generateUuid(SLOT_ID, "Point"),
|
||||
body: {
|
||||
tool_id: TOOL_ID,
|
||||
pointer_type: "ToolSlot",
|
||||
|
@ -49,7 +49,7 @@ describe("findSlotByToolId", () => {
|
|||
.reduce(resourceReducer, initialState);
|
||||
const result = findSlotByToolId(state.index, TOOL_ID);
|
||||
expect(result).toBeTruthy();
|
||||
if (result) { expect(result.kind).toBe("points"); }
|
||||
if (result) { expect(result.kind).toBe("Point"); }
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -63,7 +63,7 @@ describe("getFeeds", () => {
|
|||
const state = [{
|
||||
type: Actions.RESOURCE_READY,
|
||||
payload: {
|
||||
name: "webcam_feed",
|
||||
name: "WebcamFeed",
|
||||
data: feed
|
||||
}
|
||||
}].reduce(resourceReducer, emptyState());
|
||||
|
|
|
@ -4,7 +4,7 @@ import { maybeTagSteps, getStepTag } from "../sequence_tagging";
|
|||
|
||||
describe("maybeTagSteps()", () => {
|
||||
const UNTAGGED_SEQUENCE: TaggedSequence = {
|
||||
"kind": "sequences",
|
||||
"kind": "Sequence",
|
||||
"uuid": "whatever",
|
||||
"specialStatus": undefined,
|
||||
"body": {
|
||||
|
|
|
@ -105,17 +105,17 @@ export let resourceReducer = generateReducer
|
|||
if (resource
|
||||
&& resource.body) {
|
||||
switch (resource.kind) {
|
||||
case "crops":
|
||||
case "device":
|
||||
case "farm_events":
|
||||
case "logs":
|
||||
case "peripherals":
|
||||
case "points":
|
||||
case "regimens":
|
||||
case "sequences":
|
||||
case "tools":
|
||||
case "users":
|
||||
case "webcam_feed":
|
||||
case "Crop":
|
||||
case "Device":
|
||||
case "FarmEvent":
|
||||
case "Log":
|
||||
case "Peripheral":
|
||||
case "Point":
|
||||
case "Regimen":
|
||||
case "Sequence":
|
||||
case "Tool":
|
||||
case "User":
|
||||
case "WebcamFeed":
|
||||
reindexResource(s.index, resource);
|
||||
dontTouchThis(resource);
|
||||
s.index.references[resource.uuid] = resource;
|
||||
|
@ -131,18 +131,18 @@ export let resourceReducer = generateReducer
|
|||
.add<TaggedResource>(Actions.DESTROY_RESOURCE_OK, (s, { payload }) => {
|
||||
const resource = payload;
|
||||
switch (resource.kind) {
|
||||
case "crops":
|
||||
case "device":
|
||||
case "farm_events":
|
||||
case "logs":
|
||||
case "peripherals":
|
||||
case "points":
|
||||
case "regimens":
|
||||
case "sequences":
|
||||
case "tools":
|
||||
case "users":
|
||||
case "webcam_feed":
|
||||
case "images":
|
||||
case "Crop":
|
||||
case "Device":
|
||||
case "FarmEvent":
|
||||
case "Log":
|
||||
case "Peripheral":
|
||||
case "Point":
|
||||
case "Regimen":
|
||||
case "Sequence":
|
||||
case "Tool":
|
||||
case "User":
|
||||
case "WebcamFeed":
|
||||
case "Image":
|
||||
removeFromIndex(s.index, resource);
|
||||
break;
|
||||
default:
|
||||
|
@ -196,7 +196,7 @@ export let resourceReducer = generateReducer
|
|||
const tr = payload;
|
||||
const uuid = tr.uuid;
|
||||
reindexResource(s.index, tr);
|
||||
if (tr.kind === "logs") {
|
||||
if (tr.kind === "Log") {
|
||||
// Since logs don't come from the API all the time, they are the only
|
||||
// resource (right now) that can have an id of `undefined` and not dirty.
|
||||
findByUuid(s.index, uuid).specialStatus = undefined;
|
||||
|
|
|
@ -60,11 +60,11 @@ function findAll(index: ResourceIndex, name: ResourceName) {
|
|||
}
|
||||
|
||||
export function selectAllFarmEvents(index: ResourceIndex) {
|
||||
return findAll(index, "farm_events") as TaggedFarmEvent[];
|
||||
return findAll(index, "FarmEvent") as TaggedFarmEvent[];
|
||||
}
|
||||
|
||||
export function selectAllPoints(index: ResourceIndex) {
|
||||
return findAll(index, "points") as
|
||||
return findAll(index, "Point") as
|
||||
(TaggedGenericPointer | TaggedPlantPointer | TaggedToolSlotPointer)[];
|
||||
}
|
||||
|
||||
|
@ -112,15 +112,15 @@ export function selectAllToolSlotPointers(index: ResourceIndex):
|
|||
}
|
||||
|
||||
export function selectAllTools(index: ResourceIndex) {
|
||||
return findAll(index, "tools") as TaggedTool[];
|
||||
return findAll(index, "Tool") as TaggedTool[];
|
||||
}
|
||||
|
||||
export function selectAllPeripherals(index: ResourceIndex) {
|
||||
return findAll(index, "peripherals") as TaggedPeripheral[];
|
||||
return findAll(index, "Peripheral") as TaggedPeripheral[];
|
||||
}
|
||||
|
||||
export function selectAllLogs(index: ResourceIndex) {
|
||||
return findAll(index, "logs") as TaggedLog[];
|
||||
return findAll(index, "Log") as TaggedLog[];
|
||||
}
|
||||
|
||||
interface Finder<T> {
|
||||
|
@ -151,11 +151,11 @@ export function findToolSlot(i: ResourceIndex, uuid: string): TaggedToolSlotPoin
|
|||
throw new Error("ToolSlotPointer not found: " + uuid);
|
||||
}
|
||||
}
|
||||
export let findTool = find("tools") as Finder<TaggedTool>;
|
||||
export let findSequence = find("sequences") as Finder<TaggedSequence>;
|
||||
export let findRegimen = find("regimens") as Finder<TaggedRegimen>;
|
||||
export let findFarmEvent = find("farm_events") as Finder<TaggedFarmEvent>;
|
||||
export let findPoints = find("points") as Finder<TaggedPlantPointer>;
|
||||
export let findTool = find("Tool") as Finder<TaggedTool>;
|
||||
export let findSequence = find("Sequence") as Finder<TaggedSequence>;
|
||||
export let findRegimen = find("Regimen") as Finder<TaggedRegimen>;
|
||||
export let findFarmEvent = find("FarmEvent") as Finder<TaggedFarmEvent>;
|
||||
export let findPoints = find("Point") as Finder<TaggedPlantPointer>;
|
||||
|
||||
export function findPlant(i: ResourceIndex, uuid: string):
|
||||
TaggedPlantPointer {
|
||||
|
@ -176,25 +176,25 @@ export function selectCurrentToolSlot(index: ResourceIndex, uuid: string) {
|
|||
}
|
||||
|
||||
export function selectAllImages(index: ResourceIndex) {
|
||||
return findAll(index, "images") as TaggedImage[];
|
||||
return findAll(index, "Image") as TaggedImage[];
|
||||
}
|
||||
|
||||
export function selectAllRegimens(index: ResourceIndex) {
|
||||
return findAll(index, "regimens") as TaggedRegimen[];
|
||||
return findAll(index, "Regimen") as TaggedRegimen[];
|
||||
}
|
||||
|
||||
export function selectAllCrops(index: ResourceIndex) {
|
||||
return findAll(index, "crops") as TaggedCrop[];
|
||||
return findAll(index, "Crop") as TaggedCrop[];
|
||||
}
|
||||
|
||||
export function getRegimenByUUID(index: ResourceIndex, uuid: string) {
|
||||
assertUuid("regimens", uuid);
|
||||
assertUuid("Regimen", uuid);
|
||||
return index.references[uuid];
|
||||
}
|
||||
|
||||
export function getSequenceByUUID(index: ResourceIndex,
|
||||
uuid: string): TaggedSequence {
|
||||
assertUuid("sequences", uuid);
|
||||
assertUuid("Sequence", uuid);
|
||||
const result = index.references[uuid];
|
||||
if (result && isTaggedSequence(result)) {
|
||||
return result;
|
||||
|
@ -204,14 +204,14 @@ export function getSequenceByUUID(index: ResourceIndex,
|
|||
}
|
||||
|
||||
export function selectAllSequences(index: ResourceIndex) {
|
||||
return findAll(index, "sequences") as TaggedSequence[];
|
||||
return findAll(index, "Sequence") as TaggedSequence[];
|
||||
}
|
||||
|
||||
export function indexSequenceById(index: ResourceIndex) {
|
||||
const output: CowardlyDictionary<TaggedSequence> = {};
|
||||
const uuids = index.byKind.sequences;
|
||||
uuids.map(uuid => {
|
||||
assertUuid("sequences", uuid);
|
||||
assertUuid("Sequence", uuid);
|
||||
const sequence = index.references[uuid];
|
||||
if (sequence && isTaggedSequence(sequence) && sequence.body.id) {
|
||||
output[sequence.body.id] = sequence;
|
||||
|
@ -225,7 +225,7 @@ export function indexRegimenById(index: ResourceIndex) {
|
|||
|
||||
const uuids = index.byKind.regimens;
|
||||
uuids.map(uuid => {
|
||||
assertUuid("regimens", uuid);
|
||||
assertUuid("Regimen", uuid);
|
||||
const regimen = index.references[uuid];
|
||||
if (regimen && isTaggedRegimen(regimen) && regimen.body.id) {
|
||||
output[regimen.body.id] = regimen;
|
||||
|
@ -239,7 +239,7 @@ export function indexFarmEventById(index: ResourceIndex) {
|
|||
|
||||
const uuids = index.byKind.farm_events;
|
||||
uuids.map(uuid => {
|
||||
assertUuid("farm_events", uuid);
|
||||
assertUuid("FarmEvent", uuid);
|
||||
const farmEvent = index.references[uuid];
|
||||
if (farmEvent && isTaggedFarmEvent(farmEvent) && farmEvent.body.id) {
|
||||
output[farmEvent.body.id] = farmEvent;
|
||||
|
@ -253,7 +253,7 @@ export function indexByToolId(index: ResourceIndex) {
|
|||
|
||||
const uuids = index.byKind.tools;
|
||||
uuids.map(uuid => {
|
||||
assertUuid("tools", uuid);
|
||||
assertUuid("Tool", uuid);
|
||||
const Tool = index.references[uuid];
|
||||
if (Tool && isTaggedTool(Tool) && Tool.body.id) {
|
||||
output[Tool.body.id] = Tool;
|
||||
|
@ -267,7 +267,7 @@ export function indexBySlotId(index: ResourceIndex) {
|
|||
|
||||
const uuids = index.byKind.points;
|
||||
uuids.map(uuid => {
|
||||
assertUuid("points", uuid);
|
||||
assertUuid("Point", uuid);
|
||||
const tool_slot = index.references[uuid];
|
||||
if (tool_slot && isTaggedToolSlotPointer(tool_slot) && tool_slot.body.id) {
|
||||
output[tool_slot.body.id] = tool_slot;
|
||||
|
@ -306,9 +306,9 @@ export let currentToolInSlot = (index: ResourceIndex) =>
|
|||
(toolSlotUUID: string): TaggedTool | undefined => {
|
||||
const currentSlot = selectCurrentToolSlot(index, toolSlotUUID);
|
||||
if (currentSlot
|
||||
&& currentSlot.kind === "points") {
|
||||
&& currentSlot.kind === "Point") {
|
||||
const toolUUID = index
|
||||
.byKindAndId[joinKindAndId("tools", currentSlot.body.tool_id)];
|
||||
.byKindAndId[joinKindAndId("Tool", currentSlot.body.tool_id)];
|
||||
const tool = index.references[toolUUID || "NOPE!"];
|
||||
if (tool && isTaggedTool(tool)) {
|
||||
return tool;
|
||||
|
@ -326,7 +326,7 @@ export function findAllById(i: ResourceIndex, ids: number[], k: ResourceName) {
|
|||
/** FINDS: All tools that are in use. */
|
||||
export function toolsInUse(index: ResourceIndex): TaggedTool[] {
|
||||
const ids = betterCompact(selectAllToolSlotPointers(index).map(ts => ts.body.tool_id));
|
||||
return findAllById(index, ids, "tools") as TaggedTool[];
|
||||
return findAllById(index, ids, "Tool") as TaggedTool[];
|
||||
}
|
||||
|
||||
export let byId = <T extends TaggedResource>(name: ResourceName) =>
|
||||
|
@ -342,7 +342,7 @@ export function hasId(ri: ResourceIndex, k: ResourceName, id: number): boolean {
|
|||
}
|
||||
|
||||
export let findFarmEventById = (ri: ResourceIndex, fe_id: number) => {
|
||||
const fe = byId("farm_events")(ri, fe_id);
|
||||
const fe = byId("FarmEvent")(ri, fe_id);
|
||||
if (fe && isTaggedFarmEvent(fe) && sanityCheck(fe)) {
|
||||
return fe;
|
||||
} else {
|
||||
|
@ -353,7 +353,7 @@ export let findFarmEventById = (ri: ResourceIndex, fe_id: number) => {
|
|||
|
||||
export let maybeFindToolById = (ri: ResourceIndex, tool_id?: number):
|
||||
TaggedTool | undefined => {
|
||||
const tool = tool_id && byId("tools")(ri, tool_id);
|
||||
const tool = tool_id && byId("Tool")(ri, tool_id);
|
||||
if (tool && isTaggedTool(tool) && sanityCheck(tool)) {
|
||||
return tool;
|
||||
} else {
|
||||
|
@ -371,7 +371,7 @@ export let findToolById = (ri: ResourceIndex, tool_id: number) => {
|
|||
};
|
||||
|
||||
export let findSequenceById = (ri: ResourceIndex, sequence_id: number) => {
|
||||
const sequence = byId("sequences")(ri, sequence_id);
|
||||
const sequence = byId("Sequence")(ri, sequence_id);
|
||||
if (sequence && isTaggedSequence(sequence) && sanityCheck(sequence)) {
|
||||
return sequence;
|
||||
} else {
|
||||
|
@ -380,7 +380,7 @@ export let findSequenceById = (ri: ResourceIndex, sequence_id: number) => {
|
|||
};
|
||||
|
||||
export let findRegimenById = (ri: ResourceIndex, regimen_id: number) => {
|
||||
const regimen = byId("regimens")(ri, regimen_id);
|
||||
const regimen = byId("Regimen")(ri, regimen_id);
|
||||
if (regimen && isTaggedRegimen(regimen) && sanityCheck(regimen)) {
|
||||
return regimen;
|
||||
} else {
|
||||
|
@ -388,7 +388,7 @@ export let findRegimenById = (ri: ResourceIndex, regimen_id: number) => {
|
|||
}
|
||||
};
|
||||
|
||||
export let findSlotById = byId<TaggedToolSlotPointer>("points");
|
||||
export let findSlotById = byId<TaggedToolSlotPointer>("Point");
|
||||
/** Find a Tool's corresponding Slot. */
|
||||
export let findSlotByToolId = (index: ResourceIndex, tool_id: number) => {
|
||||
const tool = findToolById(index, tool_id);
|
||||
|
@ -421,7 +421,7 @@ export function maybeGetRegimen(index: ResourceIndex,
|
|||
|
||||
/** Unlike other findById methods, this one allows undefined (missed) values */
|
||||
export function maybeFindPlantById(index: ResourceIndex, id: number) {
|
||||
const uuid = index.byKindAndId[joinKindAndId("points", id)];
|
||||
const uuid = index.byKindAndId[joinKindAndId("Point", id)];
|
||||
const resource = index.references[uuid || "nope"];
|
||||
if (resource && isTaggedPlantPointer(resource)) { return resource; }
|
||||
}
|
||||
|
@ -430,7 +430,7 @@ export function getDeviceAccountSettings(index: ResourceIndex) {
|
|||
const list = index.byKind.device;
|
||||
const uuid = list[0];
|
||||
const device = index.references[uuid || -1];
|
||||
if ((list.length === 1) && device && device.kind === "device") {
|
||||
if ((list.length === 1) && device && device.kind === "Device") {
|
||||
sanityCheck(device);
|
||||
return device;
|
||||
} else {
|
||||
|
@ -445,7 +445,7 @@ export function getFeeds(index: ResourceIndex): TaggedWebcamFeed[] {
|
|||
const output: TaggedWebcamFeed[] = [];
|
||||
list.forEach(y => {
|
||||
const x = index.references[y];
|
||||
if (x && x.kind === "webcam_feed") {
|
||||
if (x && x.kind === "WebcamFeed") {
|
||||
sanityCheck(x);
|
||||
output.push(x);
|
||||
}
|
||||
|
@ -462,7 +462,7 @@ export function maybeFetchUser(index: ResourceIndex):
|
|||
if (user && sanityCheck(user) && list.length > 1) {
|
||||
throw new Error("Index is broke. Expected exactly 1 user.");
|
||||
}
|
||||
if ((list.length === 1) && user && user.kind === "users") {
|
||||
if ((list.length === 1) && user && user.kind === "User") {
|
||||
return user;
|
||||
} else {
|
||||
return undefined;
|
||||
|
@ -508,7 +508,7 @@ export function findToolBySlotId(input: ResourceIndex, tool_slot_id: number):
|
|||
.map(x => input.references[x])
|
||||
.map((x) => {
|
||||
if (x
|
||||
&& (x.kind === "points")
|
||||
&& (x.kind === "Point")
|
||||
&& x.body.pointer_type === "ToolSlot"
|
||||
&& x.body.tool_id) {
|
||||
return maybeFindToolById(input, x.body.tool_id);
|
||||
|
@ -517,7 +517,7 @@ export function findToolBySlotId(input: ResourceIndex, tool_slot_id: number):
|
|||
}
|
||||
})
|
||||
.filter(x => x)[0];
|
||||
if (wow && wow.kind === "tools") {
|
||||
if (wow && wow.kind === "Tool") {
|
||||
return wow;
|
||||
} else {
|
||||
return undefined;
|
||||
|
|
|
@ -71,5 +71,5 @@ export let tagAllSteps = (i: SequenceBodyItem[]) => i.map(setStepTag);
|
|||
* Used by Redux within the `resource` reducer. Given a TaggedResource,
|
||||
* idempotently adds `UUID` property to all steps in all sequences. */
|
||||
export function maybeTagSteps(x: TaggedResource) {
|
||||
if (x && (x.kind === "sequences")) { tagAllSteps(x.body.body || []); }
|
||||
if (x && (x.kind === "Sequence")) { tagAllSteps(x.body.body || []); }
|
||||
}
|
||||
|
|
|
@ -18,20 +18,23 @@ import { betterCompact } from "../util";
|
|||
import * as _ from "lodash";
|
||||
import { WebcamFeed } from "../controls/interfaces";
|
||||
export type ResourceName =
|
||||
| "users"
|
||||
| "device"
|
||||
| "farm_events"
|
||||
| "images"
|
||||
| "logs"
|
||||
| "peripherals"
|
||||
| "crops"
|
||||
| "points"
|
||||
| "regimens"
|
||||
| "sequences"
|
||||
| "tools"
|
||||
| "users"
|
||||
| "webcam_feed";
|
||||
|
||||
| "User"
|
||||
| "Device"
|
||||
| "FarmEvent"
|
||||
| "Image"
|
||||
| "Log"
|
||||
| "Peripheral"
|
||||
| "Crop"
|
||||
| "Point"
|
||||
| "Regimen"
|
||||
| "Sequence"
|
||||
| "Tool"
|
||||
| "User"
|
||||
| "WebcamFeed"
|
||||
| "GenericPointer"
|
||||
| "PlantPointer"
|
||||
| "ToolSlotPointer";
|
||||
console.log("RICK REMOVE GenericPointer PlantPointer ToolSlotPointer before PR");
|
||||
export interface TaggedResourceBase {
|
||||
kind: ResourceName;
|
||||
/** Unique identifier and index key.
|
||||
|
@ -86,20 +89,20 @@ export type TaggedResource =
|
|||
| TaggedUser
|
||||
| TaggedWebcamFeed;
|
||||
|
||||
export type TaggedRegimen = Resource<"regimens", Regimen>;
|
||||
export type TaggedTool = Resource<"tools", Tool>;
|
||||
export type TaggedSequence = Resource<"sequences", Sequence>;
|
||||
export type TaggedCrop = Resource<"crops", Crop>;
|
||||
export type TaggedFarmEvent = Resource<"farm_events", FarmEvent>;
|
||||
export type TaggedImage = Resource<"images", Image>;
|
||||
export type TaggedLog = Resource<"logs", Log>;
|
||||
export type TaggedPeripheral = Resource<"peripherals", Peripheral>;
|
||||
export type TaggedGenericPointer = Resource<"points", GenericPointer>;
|
||||
export type TaggedPlantPointer = Resource<"points", PlantPointer>;
|
||||
export type TaggedToolSlotPointer = Resource<"points", ToolSlotPointer>;
|
||||
export type TaggedUser = Resource<"users", User>;
|
||||
export type TaggedDevice = Resource<"device", DeviceAccountSettings>;
|
||||
export type TaggedWebcamFeed = Resource<"webcam_feed", WebcamFeed>;
|
||||
export type TaggedRegimen = Resource<"Regimen", Regimen>;
|
||||
export type TaggedTool = Resource<"Tool", Tool>;
|
||||
export type TaggedSequence = Resource<"Sequence", Sequence>;
|
||||
export type TaggedCrop = Resource<"Crop", Crop>;
|
||||
export type TaggedFarmEvent = Resource<"FarmEvent", FarmEvent>;
|
||||
export type TaggedImage = Resource<"Image", Image>;
|
||||
export type TaggedLog = Resource<"Log", Log>;
|
||||
export type TaggedPeripheral = Resource<"Peripheral", Peripheral>;
|
||||
export type TaggedGenericPointer = Resource<"GenericPointer", GenericPointer>;
|
||||
export type TaggedPlantPointer = Resource<"PlantPointer", PlantPointer>;
|
||||
export type TaggedToolSlotPointer = Resource<"ToolSlotPointer", ToolSlotPointer>;
|
||||
export type TaggedUser = Resource<"User", User>;
|
||||
export type TaggedDevice = Resource<"Device", DeviceAccountSettings>;
|
||||
export type TaggedWebcamFeed = Resource<"WebcamFeed", WebcamFeed>;
|
||||
|
||||
/** Spot check to be certain a TaggedResource is what it says it is. */
|
||||
export function sanityCheck(x: object): x is TaggedResource {
|
||||
|
@ -134,21 +137,21 @@ export type PointerType =
|
|||
| TaggedPlantPointer;
|
||||
|
||||
function isTaggedPoint(x: {}): x is PointerType {
|
||||
return (is("points")(x)) && (x.kind === "points");
|
||||
return (is("Point")(x)) && (x.kind === "Point");
|
||||
}
|
||||
|
||||
export let isTaggedRegimen =
|
||||
(x: object): x is TaggedRegimen => is("regimens")(x);
|
||||
(x: object): x is TaggedRegimen => is("Regimen")(x);
|
||||
export let isTaggedSequence =
|
||||
(x: object): x is TaggedSequence => is("sequences")(x);
|
||||
(x: object): x is TaggedSequence => is("Sequence")(x);
|
||||
export let isTaggedTool =
|
||||
(x: object): x is TaggedTool => is("tools")(x);
|
||||
(x: object): x is TaggedTool => is("Tool")(x);
|
||||
export let isTaggedCrop =
|
||||
(x: object): x is TaggedCrop => is("crops")(x);
|
||||
(x: object): x is TaggedCrop => is("Crop")(x);
|
||||
export let isTaggedFarmEvent =
|
||||
(x: object): x is TaggedFarmEvent => is("farm_events")(x);
|
||||
(x: object): x is TaggedFarmEvent => is("FarmEvent")(x);
|
||||
export let isTaggedLog =
|
||||
(x: object): x is TaggedLog => is("logs")(x);
|
||||
(x: object): x is TaggedLog => is("Log")(x);
|
||||
export let isTaggedToolSlotPointer =
|
||||
(x: object): x is TaggedToolSlotPointer => {
|
||||
return isTaggedPoint(x) && (x.body.pointer_type === "ToolSlot");
|
||||
|
|
|
@ -204,7 +204,7 @@ export class RootComponent extends React.Component<RootComponentProps, {}> {
|
|||
},
|
||||
},
|
||||
{
|
||||
path: "farm_events",
|
||||
path: "FarmEvent",
|
||||
getComponent(_discard: void, cb: Function) {
|
||||
import("./farm_designer/farm_events/farm_events")
|
||||
.then(module => cb(undefined, module.FarmEvents))
|
||||
|
|
|
@ -7,7 +7,7 @@ import { maybeTagSteps } from "../../resources/sequence_tagging";
|
|||
|
||||
describe("<AllSteps/>", () => {
|
||||
const TEST_CASE = {
|
||||
"kind": "sequences",
|
||||
"kind": "Sequence",
|
||||
"specialStatus": undefined,
|
||||
"body": {
|
||||
"id": 8,
|
||||
|
|
|
@ -27,7 +27,7 @@ describe("<Sequences/>", () => {
|
|||
|
||||
it("renders", () => {
|
||||
const wrapper = shallow(<Sequences {...fakeProps() } />);
|
||||
expect(wrapper.html()).toContain("Sequences");
|
||||
expect(wrapper.html()).toContain("Sequence");
|
||||
expect(wrapper.html()).toContain("Sequence Editor");
|
||||
expect(wrapper.html()).toContain(ToolTips.SEQUENCE_EDITOR);
|
||||
expect(wrapper.html()).toContain("Commands");
|
||||
|
|
|
@ -6,7 +6,7 @@ import { mount } from "enzyme";
|
|||
describe("<TestButton/>", () => {
|
||||
function fakeSequence(): TaggedSequence {
|
||||
return {
|
||||
"kind": "sequences",
|
||||
"kind": "Sequence",
|
||||
"specialStatus": undefined,
|
||||
"body": {
|
||||
"name": "Goto 0, 0, 0",
|
||||
|
|
|
@ -34,7 +34,7 @@ describe("<InputDefault/>", () => {
|
|||
|
||||
const tr: TaggedSequence = {
|
||||
"specialStatus": undefined,
|
||||
"kind": "sequences",
|
||||
"kind": "Sequence",
|
||||
"body": {
|
||||
"id": 74,
|
||||
"name": "Goto 0, 0, 0",
|
||||
|
@ -62,7 +62,7 @@ describe("<InputDefault/>", () => {
|
|||
const action = dispatcher.mock.calls[0][0];
|
||||
const { payload } = action;
|
||||
expect(action.type).toEqual("OVERWRITE_RESOURCE");
|
||||
expect(payload.uuid).toContain("sequences");
|
||||
expect(payload.uuid).toContain("Sequence");
|
||||
expect(payload.update.name).toEqual(tr.body.name);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -17,7 +17,7 @@ export let sequenceReducer = generateReducer<SequenceReducerState>(initialState)
|
|||
return s;
|
||||
})
|
||||
.add<TaggedResource>(Actions.INIT_RESOURCE, (s, { payload }) => {
|
||||
if (payload.kind === "sequences") {
|
||||
if (payload.kind === "Sequence") {
|
||||
s.current = payload.uuid;
|
||||
}
|
||||
return s;
|
||||
|
|
|
@ -12,7 +12,7 @@ import { ToolTips } from "../constants";
|
|||
@connect(mapStateToProps)
|
||||
export class Sequences extends React.Component<Props, {}> {
|
||||
render() {
|
||||
return <Page className="sequences">
|
||||
return <Page className="Sequence">
|
||||
<Row>
|
||||
<Col sm={3}>
|
||||
<SequencesList
|
||||
|
|
|
@ -64,7 +64,7 @@ export class SequencesList extends
|
|||
|
||||
emptySequence = (): TaggedSequence => {
|
||||
return {
|
||||
kind: "sequences",
|
||||
kind: "Sequence",
|
||||
uuid: "REDUCER_MUST_CHANGE_THIS",
|
||||
specialStatus: undefined,
|
||||
body: {
|
||||
|
@ -84,7 +84,7 @@ export class SequencesList extends
|
|||
return (
|
||||
<div className="sequence-list-panel">
|
||||
<h3>
|
||||
<i>{t("Sequences")}</i>
|
||||
<i>{t("Sequence")}</i>
|
||||
</h3>
|
||||
<ToolTip helpText={ToolTips.SEQUENCE_LIST} />
|
||||
<button
|
||||
|
|
|
@ -6,7 +6,7 @@ export function fakeResourceIndex(): ResourceIndex {
|
|||
const fakeResources: TaggedResource[] = [
|
||||
{
|
||||
"specialStatus": undefined,
|
||||
"kind": "points",
|
||||
"kind": "Point",
|
||||
"body": {
|
||||
"id": 1,
|
||||
"meta": {},
|
||||
|
@ -22,7 +22,7 @@ export function fakeResourceIndex(): ResourceIndex {
|
|||
},
|
||||
{
|
||||
"specialStatus": undefined,
|
||||
"kind": "points",
|
||||
"kind": "Point",
|
||||
"body": {
|
||||
"id": 2,
|
||||
"meta": {},
|
||||
|
@ -37,7 +37,7 @@ export function fakeResourceIndex(): ResourceIndex {
|
|||
},
|
||||
{
|
||||
"specialStatus": undefined,
|
||||
"kind": "points",
|
||||
"kind": "Point",
|
||||
"body": {
|
||||
"id": 3,
|
||||
"meta": {},
|
||||
|
@ -53,7 +53,7 @@ export function fakeResourceIndex(): ResourceIndex {
|
|||
},
|
||||
{
|
||||
"specialStatus": undefined,
|
||||
"kind": "tools",
|
||||
"kind": "Tool",
|
||||
"body": {
|
||||
"id": 1,
|
||||
"name": "Generic Tool",
|
||||
|
|
|
@ -35,15 +35,15 @@ export function fetchSyncData(dispatch: Function) {
|
|||
const fail = () => warning("Please try refreshing the page or logging in again.",
|
||||
"Error downloading data");
|
||||
|
||||
fetch<User>("users", API.current.usersPath);
|
||||
fetch<DeviceAccountSettings>("device", API.current.devicePath);
|
||||
fetch<WebcamFeed>("webcam_feed", API.current.webcamFeedPath);
|
||||
fetch<FarmEvent[]>("farm_events", API.current.farmEventsPath);
|
||||
fetch<Image[]>("images", API.current.imagesPath);
|
||||
fetch<Log[]>("logs", API.current.logsPath);
|
||||
fetch<Peripheral[]>("peripherals", API.current.peripheralsPath);
|
||||
fetch<AnyPointer[]>("points", API.current.pointsPath);
|
||||
fetch<Regimen[]>("regimens", API.current.regimensPath);
|
||||
fetch<Sequence[]>("sequences", API.current.sequencesPath);
|
||||
fetch<Tool[]>("tools", API.current.toolsPath);
|
||||
fetch<User>("User", API.current.usersPath);
|
||||
fetch<DeviceAccountSettings>("Device", API.current.devicePath);
|
||||
fetch<WebcamFeed>("WebcamFeed", API.current.webcamFeedPath);
|
||||
fetch<FarmEvent[]>("FarmEvent", API.current.farmEventsPath);
|
||||
fetch<Image[]>("Image", API.current.imagesPath);
|
||||
fetch<Log[]>("Log", API.current.logsPath);
|
||||
fetch<Peripheral[]>("Peripheral", API.current.peripheralsPath);
|
||||
fetch<AnyPointer[]>("Point", API.current.pointsPath);
|
||||
fetch<Regimen[]>("Regimen", API.current.regimensPath);
|
||||
fetch<Sequence[]>("Sequence", API.current.sequencesPath);
|
||||
fetch<Tool[]>("Tool", API.current.toolsPath);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ describe("<Tools />", () => {
|
|||
"ToolBay 1",
|
||||
"SlotXYZ",
|
||||
"Tool1101010Foo",
|
||||
"Tools",
|
||||
"Tool",
|
||||
"Tool NameStatus",
|
||||
"Fooactive"];
|
||||
strings.map(string => expect(txt).toContain(string));
|
||||
|
|
|
@ -19,7 +19,7 @@ export class ToolForm extends React.Component<ToolFormProps, {}> {
|
|||
return {
|
||||
uuid: "ERROR: GENERATED BY REDUCER - UUID SHOULD BE UNSEEN",
|
||||
specialStatus: undefined,
|
||||
kind: "tools",
|
||||
kind: "Tool",
|
||||
body: { name: "Tool " + (this.props.tools.length + 1) }
|
||||
};
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ export class ToolForm extends React.Component<ToolFormProps, {}> {
|
|||
const { dispatch, tools } = this.props;
|
||||
const specialStatus = getArrayStatus(tools);
|
||||
return <Widget>
|
||||
<WidgetHeader helpText={ToolTips.TOOL_LIST} title="Tools">
|
||||
<WidgetHeader helpText={ToolTips.TOOL_LIST} title="Tool">
|
||||
<button
|
||||
className="fb-button gray"
|
||||
onClick={() => { toggle(); }}
|
||||
|
|
|
@ -11,7 +11,7 @@ export class ToolList extends React.Component<ToolListProps, {}> {
|
|||
const { tools } = this.props;
|
||||
|
||||
return <Widget>
|
||||
<WidgetHeader helpText={ToolTips.TOOL_LIST} title="Tools">
|
||||
<WidgetHeader helpText={ToolTips.TOOL_LIST} title="Tool">
|
||||
<button
|
||||
className="fb-button gray"
|
||||
onClick={toggle}>
|
||||
|
|
|
@ -23,7 +23,7 @@ export class ToolBayForm extends React.Component<ToolBayFormProps, {}> {
|
|||
emptyToolSlot = (): TaggedToolSlotPointer => {
|
||||
return {
|
||||
uuid: "ERROR: GENERATED BY REDUCER - SHOULD BE UNSEEN",
|
||||
kind: "points",
|
||||
kind: "Point",
|
||||
specialStatus: undefined,
|
||||
body: {
|
||||
x: 0,
|
||||
|
|
|
@ -16,7 +16,7 @@ export class Tools extends React.Component<Props, Partial<ToolsState>> {
|
|||
render() {
|
||||
const isEditingBays = this.state.editingBays;
|
||||
const isEditingTools = this.state.editingTools;
|
||||
return <Page className="tools">
|
||||
return <Page className="Tool">
|
||||
<Row>
|
||||
<Col sm={7}>
|
||||
{!isEditingBays &&
|
||||
|
|
|
@ -9,8 +9,8 @@ import { NULL_CHOICE } from "./new_fb_select";
|
|||
const SelectComponent = Select.ofType<DropDownItem | undefined>();
|
||||
|
||||
type PossibleReferences =
|
||||
| "Sequences"
|
||||
| "Regimens";
|
||||
| "Sequence"
|
||||
| "Regimen";
|
||||
|
||||
interface ParentMenu {
|
||||
title: string;
|
||||
|
|
Loading…
Reference in New Issue