From c7da60325cf47d254d054979b188e3642e5c28de Mon Sep 17 00:00:00 2001 From: Ivan <8611739+IRBorisov@users.noreply.github.com> Date: Sun, 28 Jul 2024 01:30:00 +0300 Subject: [PATCH] Improve icons --- rsconcept/frontend/src/components/Icons.tsx | 2 ++ .../EditorOssGraph/NodeContextMenu.tsx | 24 +++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/rsconcept/frontend/src/components/Icons.tsx b/rsconcept/frontend/src/components/Icons.tsx index 049e971d..4ae18681 100644 --- a/rsconcept/frontend/src/components/Icons.tsx +++ b/rsconcept/frontend/src/components/Icons.tsx @@ -105,6 +105,8 @@ export { FaSortAmountDownAlt as IconSortList } from 'react-icons/fa'; export { LuNetwork as IconGenerateStructure } from 'react-icons/lu'; export { LuBookCopy as IconInlineSynthesis } from 'react-icons/lu'; export { LuWand2 as IconGenerateNames } from 'react-icons/lu'; +export { GrConnect as IconConnect } from 'react-icons/gr'; +export { BsPlay as IconExecute } from 'react-icons/bs'; // ======== Graph UI ======= export { BiCollapse as IconGraphCollapse } from 'react-icons/bi'; diff --git a/rsconcept/frontend/src/pages/OssPage/EditorOssGraph/NodeContextMenu.tsx b/rsconcept/frontend/src/pages/OssPage/EditorOssGraph/NodeContextMenu.tsx index 91c93f92..348e3813 100644 --- a/rsconcept/frontend/src/pages/OssPage/EditorOssGraph/NodeContextMenu.tsx +++ b/rsconcept/frontend/src/pages/OssPage/EditorOssGraph/NodeContextMenu.tsx @@ -3,7 +3,7 @@ import { useCallback, useEffect, useRef, useState } from 'react'; import { toast } from 'react-toastify'; -import { IconDestroy, IconEdit2, IconNewItem, IconRSForm } from '@/components/Icons'; +import { IconConnect, IconDestroy, IconEdit2, IconExecute, IconNewItem, IconRSForm } from '@/components/Icons'; import Dropdown from '@/components/ui/Dropdown'; import DropdownButton from '@/components/ui/DropdownButton'; import useClickedOutside from '@/hooks/useClickedOutside'; @@ -63,11 +63,16 @@ function NodeContextMenu({ operation, cursorX, cursorY, onHide, onDelete, onCrea onCreateInput(operation.id); }; + const handleRunSynthesis = () => { + toast.error('Not implemented'); + handleHide(); + }; + return (
= window.innerWidth - PARAMETER.ossContextMenuWidth}> } disabled={controller.isProcessing} @@ -92,15 +97,24 @@ function NodeContextMenu({ operation, cursorX, cursorY, onHide, onDelete, onCrea onClick={handleCreateSchema} /> ) : null} - {controller.isMutable && operation.operation_type === OperationType.INPUT ? ( + {controller.isMutable && !operation.result && operation.operation_type === OperationType.INPUT ? ( } + icon={} disabled={controller.isProcessing} onClick={handleEditSchema} /> ) : null} + {controller.isMutable && !operation.result && operation.operation_type === OperationType.SYNTHESIS ? ( + } + disabled={controller.isProcessing} + onClick={handleRunSynthesis} + /> + ) : null}