Skip to content

Commit

Permalink
Make onHelp optional
Browse files Browse the repository at this point in the history
  • Loading branch information
WardBrian committed Jul 26, 2024
1 parent 805ca1b commit 2bf3729
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
1 change: 0 additions & 1 deletion gui/src/app/Scripting/Analysis/AnalysisPyWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ const AnalysisPyWindow: FunctionComponent<AnalysisWindowProps> = ({
onRun={handleRun}
runnable={runnable}
notRunnableReason={notRunnableReason}
onHelp={() => {}}
imagesRef={imagesRef}
consoleRef={consoleRef}
contentOnEmpty={contentOnEmpty}
Expand Down
1 change: 0 additions & 1 deletion gui/src/app/Scripting/Analysis/AnalysisRWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ const AnalysisRWindow: FunctionComponent<AnalysisWindowProps> = ({
onRun={handleRun}
runnable={runnable}
notRunnableReason={notRunnableReason}
onHelp={() => {}}
imagesRef={imagesRef}
consoleRef={consoleRef}
contentOnEmpty={contentOnEmpty}
Expand Down
18 changes: 10 additions & 8 deletions gui/src/app/Scripting/ScriptEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type ScriptEditorProps = {
onRun: (code: string) => void;
runnable: boolean;
notRunnableReason?: string;
onHelp: () => void;
onHelp?: () => void;
contentOnEmpty?: string | HTMLSpanElement;
consoleRef: RefObject<HTMLDivElement>;
};
Expand Down Expand Up @@ -113,16 +113,18 @@ const makeToolbar = (o: {
runnable: boolean;
notRunnableReason?: string;
onRun: () => void;
onHelp: () => void;
onHelp?: () => void;
}): ToolbarItem[] => {
const { status, onRun, runnable, onHelp, name } = o;
const ret: ToolbarItem[] = [];
ret.push({
type: "button",
tooltip: "Help",
icon: <Help />,
onClick: onHelp,
});
if (onHelp !== undefined) {
ret.push({
type: "button",
tooltip: "Help",
icon: <Help />,
onClick: onHelp,
});
}
if (runnable) {
ret.push({
type: "button",
Expand Down

0 comments on commit 2bf3729

Please sign in to comment.