Skip to content

Commit 90d331e

Browse files
scope usePortal false to 3D popups
1 parent eb73666 commit 90d331e

6 files changed

Lines changed: 12 additions & 5 deletions

File tree

frontend/farm_designer/move_to.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ export interface GoToThisLocationButtonProps {
167167
currentBotLocation: BotPosition;
168168
movementState: MovementState;
169169
noOptions?: boolean;
170+
usePortal?: boolean;
170171
}
171172

172173
interface GoToThisLocationButtonState {
@@ -222,7 +223,7 @@ export class GoToThisLocationButton
222223
</button>
223224
<Popover position={Position.BOTTOM_RIGHT}
224225
isOpen={this.state.open}
225-
usePortal={false}
226+
usePortal={this.props.usePortal}
226227
className={"go-button-axes"}
227228
popoverClassName={"go-button-axes-popover"}
228229
target={<button

frontend/plants/edit_plant_status.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export function EditPlantStatus(props: EditPlantStatusProps) {
9696
return <div className="grid half-gap">
9797
<label>{t("Status")}</label>
9898
<FBSelect
99-
usePortal={false}
99+
usePortal={props.usePortal}
100100
list={PLANT_STAGE_LIST()}
101101
selectedItem={PLANT_STAGE_DDI_LOOKUP()[plantStatus]}
102102
onChange={ddi =>
@@ -353,13 +353,14 @@ export const PlantSlugBulkUpdate = (props: PlantSlugBulkUpdateProps) => {
353353
export interface EditWeedStatusProps {
354354
weed: TaggedWeedPointer;
355355
updateWeed(update: Partial<TaggedWeedPointer["body"]>): void;
356+
usePortal?: boolean;
356357
}
357358

358359
/** Select a `plant_stage` for a weed. */
359360
export const EditWeedStatus = (props: EditWeedStatusProps) =>
360361
<FBSelect
361362
key={props.weed.uuid}
362-
usePortal={false}
363+
usePortal={props.usePortal}
363364
list={WEED_STAGE_LIST()}
364365
selectedItem={WEED_STAGE_DDI_LOOKUP()[props.weed.body.plant_stage]}
365366
onChange={ddi =>

frontend/plants/plant_panel.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ interface EditPlantProperty {
5454

5555
export interface EditPlantStatusProps extends EditPlantProperty {
5656
plantStatus: PlantStage;
57+
usePortal?: boolean;
5758
}
5859

5960
export interface EditDatePlantedProps extends EditPlantProperty {

frontend/three_d_garden/selection/popup_controls.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const isPlantPointer = (plant: TaggedPlant): plant is TaggedPlantPointer =>
7070
const GoButton = (props: GoButtonProps) =>
7171
props.dispatch &&
7272
<GoToThisLocationButton
73+
usePortal={false}
7374
dispatch={props.dispatch}
7475
locationCoordinate={props.locationCoordinate}
7576
botOnline={props.botOnline}
@@ -193,6 +194,7 @@ const PlantPopupControls = (props: PopupControlProps) => {
193194
</div>
194195
<EditPlantStatus
195196
{...commonProps}
197+
usePortal={false}
196198
plantStatus={plant.body.plant_stage} />
197199
</div>}
198200
<div className={"row grid-2-col"}>
@@ -231,7 +233,7 @@ const WeedPopupControls = (props: PopupControlProps) => {
231233
<div className={"row grid-2-col"}>
232234
<div className={"grid half-gap"}>
233235
<label>{t("Status")}</label>
234-
<EditWeedStatus weed={weed} updateWeed={update} />
236+
<EditWeedStatus weed={weed} updateWeed={update} usePortal={false} />
235237
</div>
236238
<EditPointRadius
237239
radius={weed.body.radius}
@@ -268,6 +270,7 @@ const UtmPopupControls = (props: PopupControlProps) => {
268270
<div className={"object-popup-mounted-tool-row row grid-2-col"}>
269271
<label>{t("Mounted Tool")}</label>
270272
<ToolSelection
273+
usePortal={false}
271274
tools={props.tools}
272275
selectedTool={mountedTool}
273276
onChange={({ tool_id }) => {

frontend/tools/interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ interface ToolInputPropsBase {
142142
export interface ToolSelectionProps extends ToolInputPropsBase {
143143
filterSelectedTool: boolean;
144144
filterActiveTools: boolean;
145+
usePortal?: boolean;
145146
}
146147

147148
export interface ToolInputRowProps extends ToolInputPropsBase {

frontend/tools/tool_slot_edit_components.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const SlotDirectionInputRow = (props: SlotDirectionInputRowProps) => {
7070

7171
export const ToolSelection = (props: ToolSelectionProps) =>
7272
<FBSelect
73-
usePortal={false}
73+
usePortal={props.usePortal}
7474
list={([NULL_CHOICE] as DropDownItem[]).concat(props.tools
7575
.filter(tool => !props.filterSelectedTool
7676
|| tool.body.id != props.selectedTool?.body.id)

0 commit comments

Comments
 (0)