From 0b9e599d6e4cb60cf9d3ba6f39af8c84887b5e78 Mon Sep 17 00:00:00 2001 From: Ivan <8611739+IRBorisov@users.noreply.github.com> Date: Tue, 20 Aug 2024 14:35:46 +0300 Subject: [PATCH] M: Minor UI fixes --- .../src/pages/OssPage/EditorOssGraph/NodeCore.tsx | 11 +++-------- .../src/pages/OssPage/EditorOssGraph/OssFlow.tsx | 7 +++++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/rsconcept/frontend/src/pages/OssPage/EditorOssGraph/NodeCore.tsx b/rsconcept/frontend/src/pages/OssPage/EditorOssGraph/NodeCore.tsx index 158e8e88..cbf1747e 100644 --- a/rsconcept/frontend/src/pages/OssPage/EditorOssGraph/NodeCore.tsx +++ b/rsconcept/frontend/src/pages/OssPage/EditorOssGraph/NodeCore.tsx @@ -22,29 +22,24 @@ function NodeCore({ node }: NodeCoreProps) { const longLabel = node.data.label.length > PARAMETER.ossLongLabel; const labelText = truncateToLastWord(node.data.label, PARAMETER.ossTruncateLabel); - const handleOpenSchema = () => { - controller.openOperationSchema(Number(node.id)); - }; - return ( <> } + disabled noHover noPadding title={hasFile ? 'Связанная КС' : 'Нет связанной КС'} + icon={} hideTitle={!controller.showTooltip} - onClick={handleOpenSchema} - disabled={!hasFile} /> {node.data.operation.is_consolidation ? ( } disabled noPadding noHover titleHtml='Внимание!
Ромбовидный синтез
Возможны дубликаты конституент' + icon={} hideTitle={!controller.showTooltip} /> ) : null} diff --git a/rsconcept/frontend/src/pages/OssPage/EditorOssGraph/OssFlow.tsx b/rsconcept/frontend/src/pages/OssPage/EditorOssGraph/OssFlow.tsx index dc57ee11..204415d5 100644 --- a/rsconcept/frontend/src/pages/OssPage/EditorOssGraph/OssFlow.tsx +++ b/rsconcept/frontend/src/pages/OssPage/EditorOssGraph/OssFlow.tsx @@ -239,6 +239,9 @@ function OssFlow({ isModified, setIsModified }: OssFlowProps) { }, []); const handleSaveImage = useCallback(() => { + if (!model.schema) { + return; + } const canvas: HTMLElement | null = document.querySelector('.react-flow__viewport'); if (canvas === null) { toast.error(errors.imageFailed); @@ -261,7 +264,7 @@ function OssFlow({ isModified, setIsModified }: OssFlowProps) { }) .then(dataURL => { const a = document.createElement('a'); - a.setAttribute('download', 'reactflow.svg'); + a.setAttribute('download', `${model.schema?.alias ?? 'oss'}.svg`); a.setAttribute('href', dataURL); a.click(); }) @@ -269,7 +272,7 @@ function OssFlow({ isModified, setIsModified }: OssFlowProps) { console.error(error); toast.error(errors.imageFailed); }); - }, [colors, nodes]); + }, [colors, nodes, model.schema]); const handleContextMenu = useCallback( (event: CProps.EventMouse, node: OssNode) => {