From 3583202404665639e335fff6cc4bcf9746c6a9bb Mon Sep 17 00:00:00 2001 From: Ritchie Martori Date: Tue, 7 Jan 2025 10:18:06 -0700 Subject: [PATCH] fix issue with delegated only execution options --- .../SchemaIO/components/TooltipProvider.tsx | 2 +- .../OperatorExecutionButton/index.tsx | 35 +++++++++++++------ app/packages/operators/src/state.ts | 8 +++++ 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/app/packages/core/src/plugins/SchemaIO/components/TooltipProvider.tsx b/app/packages/core/src/plugins/SchemaIO/components/TooltipProvider.tsx index cd70bb5e0e..e97b1a0f58 100644 --- a/app/packages/core/src/plugins/SchemaIO/components/TooltipProvider.tsx +++ b/app/packages/core/src/plugins/SchemaIO/components/TooltipProvider.tsx @@ -6,7 +6,7 @@ export default function TooltipProvider(props: TooltipProps) { if (!title) return children; return ( - {children} + {children} ); } diff --git a/app/packages/operators/src/components/OperatorExecutionButton/index.tsx b/app/packages/operators/src/components/OperatorExecutionButton/index.tsx index 4a3cd443e5..0123b551c6 100644 --- a/app/packages/operators/src/components/OperatorExecutionButton/index.tsx +++ b/app/packages/operators/src/components/OperatorExecutionButton/index.tsx @@ -1,17 +1,18 @@ +import TooltipProvider from "@fiftyone/core/src/plugins/SchemaIO/components/TooltipProvider"; import { Button } from "@mui/material"; -import { OperatorExecutionTrigger } from "../OperatorExecutionTrigger"; import React, { useCallback, useMemo } from "react"; -import { - ExecutionCallback, - ExecutionErrorCallback, - OperatorExecutorOptions, -} from "../../types-internal"; import { OperatorExecutionOption, useOperatorExecutionOptions, useOperatorExecutor, usePromptOperatorInput, } from "../../state"; +import { + ExecutionCallback, + ExecutionErrorCallback, + OperatorExecutorOptions, +} from "../../types-internal"; +import { OperatorExecutionTrigger } from "../OperatorExecutionTrigger"; /** * Button which acts as a trigger for opening an `OperatorExecutionMenu`. @@ -84,10 +85,23 @@ export const OperatorExecutionButton = ({ [executorOptions, operator, executionParams] ); - const { executionOptions } = useOperatorExecutionOptions({ - operatorUri, - onExecute, - }); + const { executionOptions, warningMessage, showWarning, isLoading } = + useOperatorExecutionOptions({ + operatorUri, + onExecute, + }); + + if (isLoading) return null; + + if (showWarning) { + return ( + + + + ); + } if (prompt) { return ( @@ -107,6 +121,7 @@ export const OperatorExecutionButton = ({ prompt={prompt} executionParams={executionParams} onOptionSelected={onOptionSelected} + executionOptions={executionOptions} disabled={disabled} >