diff --git a/frontend/farm_designer/__tests__/index_test.tsx b/frontend/farm_designer/__tests__/index_test.tsx index 19e743bd6..26acd1746 100644 --- a/frontend/farm_designer/__tests__/index_test.tsx +++ b/frontend/farm_designer/__tests__/index_test.tsx @@ -126,7 +126,7 @@ describe("", () => { it("renders saved garden indicator", () => { const p = fakeProps(); - p.designer.openedSavedGarden = "SavedGardenUuid"; + p.designer.openedSavedGarden = 1; const wrapper = mount(); expect(wrapper.text().toLowerCase()).toContain("viewing saved garden"); }); diff --git a/frontend/farm_designer/__tests__/reducer_test.ts b/frontend/farm_designer/__tests__/reducer_test.ts index f95dbc4b8..71ac71edd 100644 --- a/frontend/farm_designer/__tests__/reducer_test.ts +++ b/frontend/farm_designer/__tests__/reducer_test.ts @@ -256,10 +256,10 @@ describe("designer reducer", () => { }); it("sets opened saved garden", () => { - const payload = "savedGardenUuid"; - const action: ReduxAction = { + const payload = 1; + const action: ReduxAction = { type: Actions.CHOOSE_SAVED_GARDEN, - payload + payload, }; const newState = designer(oldState(), action); expect(newState.openedSavedGarden).toEqual(payload); diff --git a/frontend/farm_designer/__tests__/state_to_props_test.ts b/frontend/farm_designer/__tests__/state_to_props_test.ts index 2be33fa70..ee1d4bf7d 100644 --- a/frontend/farm_designer/__tests__/state_to_props_test.ts +++ b/frontend/farm_designer/__tests__/state_to_props_test.ts @@ -167,8 +167,8 @@ describe("getPlants()", () => { it("returns plant templates", () => { const resources = fakeResources(); - const savedGardenUuid = Object.keys(resources.index.byKind["SavedGarden"])[0]; - resources.consumers.farm_designer.openedSavedGarden = savedGardenUuid; + const savedGardenId = 1; + resources.consumers.farm_designer.openedSavedGarden = savedGardenId; expect(getPlants(resources).length).toEqual(1); }); diff --git a/frontend/farm_designer/interfaces.ts b/frontend/farm_designer/interfaces.ts index 119de9742..bbf966016 100644 --- a/frontend/farm_designer/interfaces.ts +++ b/frontend/farm_designer/interfaces.ts @@ -165,7 +165,7 @@ export interface DesignerState { chosenLocation: BotPosition; drawnPoint: DrawnPointPayl | undefined; drawnWeed: DrawnWeedPayl | undefined; - openedSavedGarden: string | undefined; + openedSavedGarden: number | undefined; tryGroupSortType: ExtendedPointGroupSortType | undefined; editGroupAreaInMap: boolean; visualizedSequence: UUID | undefined; @@ -311,7 +311,7 @@ export type PlantOptions = Partial; export interface EditPlantInfoProps { dispatch: Function; findPlant(stringyID: string | undefined): TaggedPlant | undefined; - openedSavedGarden: string | undefined; + openedSavedGarden: number | undefined; timeSettings: TimeSettings; getConfigValue: GetWebAppConfigValue; soilHeightPoints: TaggedGenericPointer[]; diff --git a/frontend/farm_designer/map/layers/plants/__tests__/plant_actions_test.ts b/frontend/farm_designer/map/layers/plants/__tests__/plant_actions_test.ts index 1851ab2ad..ef84ef644 100644 --- a/frontend/farm_designer/map/layers/plants/__tests__/plant_actions_test.ts +++ b/frontend/farm_designer/map/layers/plants/__tests__/plant_actions_test.ts @@ -54,7 +54,7 @@ describe("newPlantKindAndBody()", () => { y: 0, slug: "mint", cropName: "Mint", - openedSavedGarden: "SavedGarden.1.1", + openedSavedGarden: 1, depth: 0, designer: fakeDesignerState(), }; diff --git a/frontend/farm_designer/map/layers/plants/plant_actions.ts b/frontend/farm_designer/map/layers/plants/plant_actions.ts index d3ff4979b..184616c6e 100644 --- a/frontend/farm_designer/map/layers/plants/plant_actions.ts +++ b/frontend/farm_designer/map/layers/plants/plant_actions.ts @@ -4,8 +4,7 @@ import { AxisNumberProperty, TaggedPlant, MapTransformProps, } from "../../interfaces"; import { Plant, DEFAULT_PLANT_RADIUS } from "../../../plant"; -import { unpackUUID } from "../../../../util"; -import { isNumber, isString } from "lodash"; +import { isNumber } from "lodash"; import { DesignerState, GardenMapState, MovePointsProps, } from "../../../interfaces"; @@ -25,7 +24,7 @@ export interface NewPlantKindAndBodyProps { y: number; slug: string; cropName: string; - openedSavedGarden: string | undefined; + openedSavedGarden: number | undefined; depth: number; designer: DesignerState; } @@ -35,9 +34,7 @@ export const newPlantKindAndBody = (props: NewPlantKindAndBodyProps): { kind: TaggedPlant["kind"], body: TaggedPlant["body"], } => { - const savedGardenId = isString(props.openedSavedGarden) - ? unpackUUID(props.openedSavedGarden).remoteId - : undefined; + const savedGardenId = props.openedSavedGarden || undefined; return isNumber(savedGardenId) ? { kind: "PlantTemplate", @@ -75,7 +72,7 @@ export interface CreatePlantProps { gardenCoords: AxisNumberProperty; gridSize: AxisNumberProperty | undefined; dispatch: Function; - openedSavedGarden: string | undefined; + openedSavedGarden: number | undefined; depth: number; designer: DesignerState; } diff --git a/frontend/farm_designer/reducer.ts b/frontend/farm_designer/reducer.ts index e4a1b088b..a71d8648d 100644 --- a/frontend/farm_designer/reducer.ts +++ b/frontend/farm_designer/reducer.ts @@ -188,7 +188,7 @@ export const designer = generateReducer(initialState) push(Path.location({ x: payload.x, y: payload.y })); return s; }) - .add(Actions.CHOOSE_SAVED_GARDEN, (s, { payload }) => { + .add(Actions.CHOOSE_SAVED_GARDEN, (s, { payload }) => { s.openedSavedGarden = payload; return s; }) diff --git a/frontend/farm_designer/state_to_props.ts b/frontend/farm_designer/state_to_props.ts index da327ae91..3c2b6cc8e 100644 --- a/frontend/farm_designer/state_to_props.ts +++ b/frontend/farm_designer/state_to_props.ts @@ -22,13 +22,13 @@ import { selectAllFarmwareEnvs, selectAllCurves, } from "../resources/selectors"; -import { validFwConfig, unpackUUID, validFbosConfig } from "../util"; +import { validFwConfig, validFbosConfig } from "../util"; import { validBotLocationData } from "../util/location"; import { getWebAppConfigValue } from "../config_storage/actions"; import { FarmDesignerProps, CameraCalibrationData } from "./interfaces"; import { TaggedPlant, BotSize } from "./map/interfaces"; import { RestResources } from "../resources/interfaces"; -import { isString, uniq, chain } from "lodash"; +import { isFinite, uniq, chain } from "lodash"; import { BooleanSetting } from "../session_keys"; import { getEnv } from "../farmware/state_to_props"; import { getFirmwareConfig, getFbosConfig } from "../resources/getters"; @@ -50,9 +50,9 @@ export const getPlants = (resources: RestResources) => { const onlyPlants = selectAllPlantPointers(resources.index); const plantTemplates = selectAllPlantTemplates(resources.index); const { openedSavedGarden } = resources.consumers.farm_designer; - return isString(openedSavedGarden) + return isFinite(openedSavedGarden) ? plantTemplates.filter(x => - x.body.saved_garden_id === unpackUUID(openedSavedGarden).remoteId) + x.body.saved_garden_id === openedSavedGarden) : onlyPlants; }; diff --git a/frontend/plants/__tests__/map_state_to_props_test.ts b/frontend/plants/__tests__/map_state_to_props_test.ts index 62ef2bd72..bef6a75df 100644 --- a/frontend/plants/__tests__/map_state_to_props_test.ts +++ b/frontend/plants/__tests__/map_state_to_props_test.ts @@ -29,7 +29,7 @@ describe("mapStateToProps()", () => { template.body.id = 10; state.resources = buildResourceIndex([template]); const uuid = Object.keys(state.resources.index.all)[0]; - state.resources.consumers.farm_designer.openedSavedGarden = "uuid"; + state.resources.consumers.farm_designer.openedSavedGarden = 1; const result = mapStateToProps(state); expect(result.findPlant("10")).toEqual( expect.objectContaining({ uuid })); diff --git a/frontend/plants/__tests__/plant_info_test.tsx b/frontend/plants/__tests__/plant_info_test.tsx index 5073da687..c0f1f760e 100644 --- a/frontend/plants/__tests__/plant_info_test.tsx +++ b/frontend/plants/__tests__/plant_info_test.tsx @@ -98,7 +98,7 @@ describe("", () => { it("gets template id", () => { mockPath = Path.mock(Path.plantTemplates(2)); const p = fakeProps(); - p.openedSavedGarden = "uuid"; + p.openedSavedGarden = 1; const wrapper = mount(); expect(wrapper.instance().stringyID).toEqual("2"); }); diff --git a/frontend/plants/__tests__/plant_inventory_test.tsx b/frontend/plants/__tests__/plant_inventory_test.tsx index aa8f072b6..0e19613ee 100644 --- a/frontend/plants/__tests__/plant_inventory_test.tsx +++ b/frontend/plants/__tests__/plant_inventory_test.tsx @@ -158,7 +158,7 @@ describe("", () => { window.confirm = () => true; const p = fakeProps(); p.plantsPanelState.plants = true; - p.openedSavedGarden = "fake"; + p.openedSavedGarden = 1; const wrapper = mount(); const plantsSection = wrapper.find(PanelSection).at(2); expect(plantsSection.text().toLowerCase()).not.toContain("delete all"); diff --git a/frontend/plants/__tests__/select_plants_test.tsx b/frontend/plants/__tests__/select_plants_test.tsx index 39bdf2b46..cf9c5ec95 100644 --- a/frontend/plants/__tests__/select_plants_test.tsx +++ b/frontend/plants/__tests__/select_plants_test.tsx @@ -63,7 +63,7 @@ describe("", () => { getConfigValue: () => true, plants: [plant1, plant2], dispatch: jest.fn(x => x), - gardenOpen: undefined, + gardenOpenId: undefined, allPoints: [], toolTransformProps: fakeToolTransformProps(), isActive: () => false, @@ -377,7 +377,7 @@ describe("", () => { it("doesn't create group", () => { const p = fakeProps(); - p.gardenOpen = "uuid"; + p.gardenOpenId = 1; const wrapper = mount(); wrapper.find(".dark-blue").simulate("click"); expect(createGroup).not.toHaveBeenCalled(); diff --git a/frontend/plants/crop_info.tsx b/frontend/plants/crop_info.tsx index 510dc3b3a..af975467f 100644 --- a/frontend/plants/crop_info.tsx +++ b/frontend/plants/crop_info.tsx @@ -204,7 +204,7 @@ const Companions = (props: CropInfoListProps) => { interface AddPlantHereButtonProps { botPosition: BotPosition; - openedSavedGarden: string | undefined; + openedSavedGarden: number | undefined; cropName: string; slug: string; dispatch: Function; diff --git a/frontend/plants/plant_info.tsx b/frontend/plants/plant_info.tsx index ee74842b4..2372f5670 100644 --- a/frontend/plants/plant_info.tsx +++ b/frontend/plants/plant_info.tsx @@ -9,7 +9,7 @@ import { } from "../farm_designer/designer_panel"; import { t } from "../i18next_wrapper"; import { EditPlantInfoProps, PlantOptions } from "../farm_designer/interfaces"; -import { isString } from "lodash"; +import { isFinite } from "lodash"; import { push } from "../history"; import { destroy, edit, save } from "../api/crud"; import { BooleanSetting } from "../session_keys"; @@ -20,7 +20,7 @@ import { validGoButtonAxes } from "../farm_designer/move_to"; export type UpdatePlant = (uuid: string, update: PlantOptions) => void; export class RawPlantInfo extends React.Component { - get templates() { return isString(this.props.openedSavedGarden); } + get templates() { return isFinite(this.props.openedSavedGarden); } get stringyID() { return Path.getSlug((this.templates ? Path.plantTemplates diff --git a/frontend/plants/plant_inventory.tsx b/frontend/plants/plant_inventory.tsx index 1058ddb37..7315fac02 100644 --- a/frontend/plants/plant_inventory.tsx +++ b/frontend/plants/plant_inventory.tsx @@ -48,7 +48,7 @@ export interface PlantInventoryProps { allPoints: TaggedPoint[]; plantTemplates: TaggedPlantTemplate[]; plantPointerCount: number; - openedSavedGarden: string | undefined; + openedSavedGarden: number | undefined; plantsPanelState: PlantsPanelState; getConfigValue: GetWebAppConfigValue; } diff --git a/frontend/plants/select_plants.tsx b/frontend/plants/select_plants.tsx index 8055cbd23..8553d6e98 100644 --- a/frontend/plants/select_plants.tsx +++ b/frontend/plants/select_plants.tsx @@ -116,7 +116,7 @@ export const mapStateToProps = (props: Everything): SelectPlantsProps => { plants: getPlants(props.resources), allPoints: selectAllActivePoints(props.resources.index), dispatch: props.dispatch, - gardenOpen: openedSavedGarden, + gardenOpenId: openedSavedGarden, tools: selectAllTools(props.resources.index), groups: selectAllPointGroups(props.resources.index), isActive: isActive(selectAllToolSlotPointers(props.resources.index)), @@ -135,7 +135,7 @@ export interface SelectPlantsProps { selected: UUID[] | undefined; selectionPointType: PointType[] | undefined; getConfigValue: GetWebAppConfigValue; - gardenOpen: string | undefined; + gardenOpenId: number | undefined; toolTransformProps: ToolTransformProps; isActive(id: number | undefined): boolean; tools: TaggedTool[]; @@ -288,7 +288,7 @@ export class RawSelectPlants !this.props.gardenOpen + onClick={() => !this.props.gardenOpenId ? this.props.dispatch(createGroup({ pointUuids: this.selected })) : error(t(Content.ERROR_PLANT_TEMPLATE_GROUP))}> {t("Create group")} diff --git a/frontend/saved_gardens/__tests__/actions_test.ts b/frontend/saved_gardens/__tests__/actions_test.ts index 8d233e6e4..a8b423d36 100644 --- a/frontend/saved_gardens/__tests__/actions_test.ts +++ b/frontend/saved_gardens/__tests__/actions_test.ts @@ -73,12 +73,12 @@ describe("closeSavedGarden", () => { describe("openSavedGarden", () => { it("opens garden", () => { const dispatch = jest.fn(); - const uuid = "SavedGardenUuid.1.0"; - openSavedGarden(uuid)(dispatch); + const id = 1; + openSavedGarden(id)(dispatch); expect(push).toHaveBeenCalledWith(Path.savedGardens(1)); expect(dispatch).toHaveBeenCalledWith({ type: Actions.CHOOSE_SAVED_GARDEN, - payload: uuid + payload: id, }); }); }); @@ -86,7 +86,7 @@ describe("openSavedGarden", () => { describe("openOrCloseGarden", () => { it("opens garden", () => { const props = { - savedGarden: "SavedGardenUuid.1.0", + savedGardenId: 1, dispatch: jest.fn(), gardenIsOpen: false, }; @@ -96,7 +96,7 @@ describe("openOrCloseGarden", () => { it("closes garden", () => { const props = { - savedGarden: "SavedGardenUuid.1.0", + savedGardenId: 1, dispatch: jest.fn(), gardenIsOpen: true, }; diff --git a/frontend/saved_gardens/__tests__/garden_add_test.tsx b/frontend/saved_gardens/__tests__/garden_add_test.tsx index 0f73aa66e..af95da17f 100644 --- a/frontend/saved_gardens/__tests__/garden_add_test.tsx +++ b/frontend/saved_gardens/__tests__/garden_add_test.tsx @@ -1,4 +1,4 @@ -import * as React from "react"; +import React from "react"; import { mount } from "enzyme"; import { RawAddGarden as AddGarden, mapStateToProps } from "../garden_add"; import { GardenSnapshotProps } from "../garden_snapshot"; @@ -31,7 +31,7 @@ describe("mapStateToProps()", () => { const state = fakeState(); const savedGarden = fakeSavedGarden(); state.resources = buildResourceIndex([savedGarden]); - state.resources.consumers.farm_designer.openedSavedGarden = savedGarden.uuid; + state.resources.consumers.farm_designer.openedSavedGarden = savedGarden.body.id; const props = mapStateToProps(state); expect(props.currentSavedGarden).toEqual(savedGarden); }); diff --git a/frontend/saved_gardens/__tests__/garden_edit_test.tsx b/frontend/saved_gardens/__tests__/garden_edit_test.tsx index cb80f2b52..4cb251e52 100644 --- a/frontend/saved_gardens/__tests__/garden_edit_test.tsx +++ b/frontend/saved_gardens/__tests__/garden_edit_test.tsx @@ -136,7 +136,7 @@ describe("mapStateToProps()", () => { mockPath = Path.mock(Path.savedGardens(1)); const state = fakeState(); state.resources = buildResourceIndex([sg, fakePlantTemplate()]); - state.resources.consumers.farm_designer.openedSavedGarden = sg.uuid; + state.resources.consumers.farm_designer.openedSavedGarden = sg.body.id; const props = mapStateToProps(state); expect(props.gardenIsOpen).toEqual(true); expect(props.savedGarden).toEqual(sg); @@ -148,7 +148,7 @@ describe("mapStateToProps()", () => { mockPath = Path.mock(Path.savedGardens()); const state = fakeState(); state.resources = buildResourceIndex([sg, fakePlantTemplate()]); - state.resources.consumers.farm_designer.openedSavedGarden = sg.uuid; + state.resources.consumers.farm_designer.openedSavedGarden = sg.body.id; const props = mapStateToProps(state); expect(props.gardenIsOpen).toEqual(false); expect(props.savedGarden).toEqual(undefined); diff --git a/frontend/saved_gardens/__tests__/garden_list_test.tsx b/frontend/saved_gardens/__tests__/garden_list_test.tsx index 80ac8040c..1159894f3 100644 --- a/frontend/saved_gardens/__tests__/garden_list_test.tsx +++ b/frontend/saved_gardens/__tests__/garden_list_test.tsx @@ -18,7 +18,7 @@ describe("", () => { const p = fakeProps(); const wrapper = shallow(); wrapper.simulate("click"); - expect(openSavedGarden).toHaveBeenCalledWith(p.savedGarden.uuid); + expect(openSavedGarden).toHaveBeenCalledWith(p.savedGarden.body.id); }); }); diff --git a/frontend/saved_gardens/__tests__/saved_gardens_test.tsx b/frontend/saved_gardens/__tests__/saved_gardens_test.tsx index 356349486..31a88db39 100644 --- a/frontend/saved_gardens/__tests__/saved_gardens_test.tsx +++ b/frontend/saved_gardens/__tests__/saved_gardens_test.tsx @@ -74,7 +74,7 @@ describe("", () => { it("shows when garden is open", () => { const p = fakeProps(); p.savedGardens = [fakeSavedGarden(), fakeSavedGarden()]; - p.openedSavedGarden = p.savedGardens[0].uuid; + p.openedSavedGarden = p.savedGardens[0].body.id; const wrapper = mount(); expect(wrapper.html()).toContain("selected"); }); diff --git a/frontend/saved_gardens/actions.ts b/frontend/saved_gardens/actions.ts index 81a361293..d23124ace 100644 --- a/frontend/saved_gardens/actions.ts +++ b/frontend/saved_gardens/actions.ts @@ -4,8 +4,6 @@ import { success, info } from "../toast/toast"; import { push } from "../history"; import { Actions } from "../constants"; import { destroy, initSave, initSaveGetId } from "../api/crud"; -import { unpackUUID } from "../util"; -import { isString } from "lodash"; import { TaggedSavedGarden, TaggedPlantTemplate } from "farmbot"; import { t } from "../i18next_wrapper"; import { stopTracking } from "../connectivity/data_consistency"; @@ -53,21 +51,21 @@ export const closeSavedGarden = () => { dispatch(unselectSavedGarden); }; -export const openSavedGarden = (savedGarden: string) => { - push(Path.savedGardens(unpackUUID(savedGarden).remoteId)); +export const openSavedGarden = (savedGardenId: number | undefined) => { + push(Path.savedGardens(savedGardenId)); return (dispatch: Function) => - dispatch({ type: Actions.CHOOSE_SAVED_GARDEN, payload: savedGarden }); + dispatch({ type: Actions.CHOOSE_SAVED_GARDEN, payload: savedGardenId }); }; /** Open a SavedGarden if it is closed, otherwise close it. */ export const openOrCloseGarden = (props: { - savedGarden: string | undefined, + savedGardenId: number | undefined, gardenIsOpen: boolean, dispatch: Function }) => () => - !props.gardenIsOpen && isString(props.savedGarden) - ? props.dispatch(openSavedGarden(props.savedGarden)) + !props.gardenIsOpen && props.savedGardenId + ? props.dispatch(openSavedGarden(props.savedGardenId)) : props.dispatch(closeSavedGarden()); /** Create a new SavedGarden with the chosen name. */ diff --git a/frontend/saved_gardens/garden_add.tsx b/frontend/saved_gardens/garden_add.tsx index 81d5a990e..da5da90a4 100644 --- a/frontend/saved_gardens/garden_add.tsx +++ b/frontend/saved_gardens/garden_add.tsx @@ -3,7 +3,7 @@ import { connect } from "react-redux"; import { Everything } from "../interfaces"; import { GardenSnapshotProps, GardenSnapshot } from "./garden_snapshot"; import { - selectAllPlantTemplates, findSavedGarden, + selectAllPlantTemplates, maybeFindSavedGardenById, } from "../resources/selectors"; import { DesignerPanel, DesignerPanelHeader, DesignerPanelContent, @@ -18,7 +18,7 @@ export const mapStateToProps = (props: Everything): GardenSnapshotProps => { const { openedSavedGarden } = props.resources.consumers.farm_designer; return { currentSavedGarden: openedSavedGarden - ? findSavedGarden(props.resources.index, openedSavedGarden) + ? maybeFindSavedGardenById(props.resources.index, openedSavedGarden) : undefined, dispatch: props.dispatch, plantTemplates: selectAllPlantTemplates(props.resources.index), diff --git a/frontend/saved_gardens/garden_edit.tsx b/frontend/saved_gardens/garden_edit.tsx index 9d3921101..6de86d1cb 100644 --- a/frontend/saved_gardens/garden_edit.tsx +++ b/frontend/saved_gardens/garden_edit.tsx @@ -26,8 +26,8 @@ import { /** Open or close a SavedGarden. */ const GardenViewButton = (props: GardenViewButtonProps) => { - const { dispatch, savedGarden, gardenIsOpen } = props; - const onClick = openOrCloseGarden({ savedGarden, gardenIsOpen, dispatch }); + const { dispatch, savedGardenId, gardenIsOpen } = props; + const onClick = openOrCloseGarden({ savedGardenId, gardenIsOpen, dispatch }); const btnText = gardenIsOpen ? t("exit") : t("view"); @@ -71,7 +71,7 @@ export const mapStateToProps = (props: Everything): EditGardenProps => { const savedGarden = findSavedGardenByUrl(props.resources.index); return { savedGarden, - gardenIsOpen: !!(savedGarden?.uuid === openedSavedGarden), + gardenIsOpen: !!(savedGarden?.body.id === openedSavedGarden), dispatch: props.dispatch, plantPointerCount: selectAllPlantPointers(props.resources.index).length, gardenPlants: selectAllPlantTemplates(props.resources.index) @@ -117,7 +117,7 @@ export class RawEditGarden gardenUuid={savedGarden.uuid} /> } diff --git a/frontend/saved_gardens/garden_list.tsx b/frontend/saved_gardens/garden_list.tsx index 6a5b11d98..1ae820717 100644 --- a/frontend/saved_gardens/garden_list.tsx +++ b/frontend/saved_gardens/garden_list.tsx @@ -11,7 +11,7 @@ import { t } from "../i18next_wrapper"; export const GardenInfo = (props: SavedGardenInfoProps) => { const { savedGarden, dispatch } = props; return dispatch(openSavedGarden(savedGarden.uuid))}> + onClick={() => dispatch(openSavedGarden(savedGarden.body.id))}> {savedGarden.body.name} @@ -43,7 +43,7 @@ export const SavedGardenList = (props: SavedGardenListProps) => return diff --git a/frontend/saved_gardens/interfaces.tsx b/frontend/saved_gardens/interfaces.tsx index 5515ca690..c205bfde2 100644 --- a/frontend/saved_gardens/interfaces.tsx +++ b/frontend/saved_gardens/interfaces.tsx @@ -5,7 +5,7 @@ export interface SavedGardensProps { plantTemplates: TaggedPlantTemplate[]; dispatch: Function; plantPointerCount: number; - openedSavedGarden: string | undefined; + openedSavedGarden: number | undefined; } export interface SavedGardenListProps extends SavedGardensProps { @@ -18,7 +18,7 @@ export interface SavedGardensState { export interface GardenViewButtonProps { dispatch: Function; - savedGarden: string | undefined; + savedGardenId: number | undefined; gardenIsOpen: boolean; }