diff --git a/src/resources/studyareas/StudyAreasEdit.tsx b/src/resources/studyareas/StudyAreasEdit.tsx index ac114499..bc9f16e5 100644 --- a/src/resources/studyareas/StudyAreasEdit.tsx +++ b/src/resources/studyareas/StudyAreasEdit.tsx @@ -11,8 +11,7 @@ import { Toolbar, SaveButton, useEditController, - SelectInput, - useRefresh + SelectInput } from "react-admin"; import { addGeoStoresConfig, @@ -26,6 +25,7 @@ import { GeoStorePickerComponent } from "./components/GeoStorePicker.component"; import { OpportunityCreatorComponent } from "./components/OpportunityCreator.component"; import { OpportunityViewerComponent } from "./components/OpportunityViewer.component"; import { Opportunity } from "@types"; +import { getLayerGroups } from "@context/layers"; const displayStyle = { xs: "block", sm: "flex", width: "100%" }; @@ -41,7 +41,6 @@ const CustomToolbar = (props: any) => { }; export default function StudyAreasEdit() { - const refresh = useRefresh(); const dispatch = useAppDispatch(); const { save } = useEditController(); const redirect = useRedirect(); @@ -64,6 +63,7 @@ export default function StudyAreasEdit() { return batch(() => { dispatch(getStudyAreasOpportunities(parseFloat(id as string))); dispatch(getGeoStoresConfig(parseFloat(id as string))); + dispatch(getLayerGroups()); }); }, []); @@ -255,6 +255,7 @@ export default function StudyAreasEdit() { label="View" color="secondary" onClick={() => setOpportunityData(i)} + sx={{ backgroundColor: "#2bb381" }} /> ))} diff --git a/src/resources/studyareas/components/GeoStorePicker.component.tsx b/src/resources/studyareas/components/GeoStorePicker.component.tsx index b1651964..c8646522 100644 --- a/src/resources/studyareas/components/GeoStorePicker.component.tsx +++ b/src/resources/studyareas/components/GeoStorePicker.component.tsx @@ -29,7 +29,7 @@ export function GeoStorePickerComponent(props: { setDialogOpen(true)} /> diff --git a/src/resources/studyareas/components/LayerPicker.components.tsx b/src/resources/studyareas/components/LayerPicker.components.tsx index ac6fa6b9..7eeabd13 100644 --- a/src/resources/studyareas/components/LayerPicker.components.tsx +++ b/src/resources/studyareas/components/LayerPicker.components.tsx @@ -29,7 +29,7 @@ export function LayerPickerComponent(props: { setDialogOpen(true)} /> diff --git a/src/resources/studyareas/components/OpportunityCreator.component.tsx b/src/resources/studyareas/components/OpportunityCreator.component.tsx index 06e08aaf..6b0f0ae6 100644 --- a/src/resources/studyareas/components/OpportunityCreator.component.tsx +++ b/src/resources/studyareas/components/OpportunityCreator.component.tsx @@ -87,7 +87,7 @@ export function OpportunityCreatorComponent(props: { studyAreaId: number }) { setDialogOpen(true)} />