diff --git a/src/components/FunctionalArea/Modal/ElementGlyphModal/ElementGlyphModal.component.tsx b/src/components/FunctionalArea/Modal/ElementGlyphModal/ElementGlyphModal.component.tsx index 017c1d5aee1abfbf6efd04e65b68f65cf58ad03d..dda13b3a0f2dbcc663c7ee2bc7b98a2de4528074 100644 --- a/src/components/FunctionalArea/Modal/ElementGlyphModal/ElementGlyphModal.component.tsx +++ b/src/components/FunctionalArea/Modal/ElementGlyphModal/ElementGlyphModal.component.tsx @@ -53,7 +53,7 @@ export const ElementGlyphModal: React.FC = () => { elementId: elementGlyphState.id, glyphId, }), - ); + ).unwrap(); showToast({ type: 'success', message: 'The element glyph has been successfully updated.', diff --git a/src/components/Map/Drawer/BioEntityDrawer/BioEntityDrawer.component.tsx b/src/components/Map/Drawer/BioEntityDrawer/BioEntityDrawer.component.tsx index 1a095ef891cb7868f1ac9c89b75321e2b2834b0a..a9ca4ffa077d0ade372c2b3131c9b0cd3a7c88f9 100644 --- a/src/components/Map/Drawer/BioEntityDrawer/BioEntityDrawer.component.tsx +++ b/src/components/Map/Drawer/BioEntityDrawer/BioEntityDrawer.component.tsx @@ -22,6 +22,7 @@ import { projectDataSelector } from '@/redux/project/project.selectors'; import { showToast } from '@/utils/showToast'; import { IconButton } from '@/shared/IconButton'; import { openElementGlyphModal } from '@/redux/modal/modal.slice'; +import { hasPrivilegeToWriteProjectSelector } from '@/redux/user/user.selectors'; import { CollapsibleSection } from '../ExportDrawer/CollapsibleSection'; import { AssociatedSubmap } from './AssociatedSubmap'; import { ChemicalsList } from './ChemicalsList'; @@ -35,6 +36,7 @@ export const BioEntityDrawer = (): React.ReactNode => { const modelElement = useAppSelector(currentDrawerModelElementSelector); const commentsData = useAppSelector(currentDrawerElementCommentsSelector); const relatedSubmap = useAppSelector(currentDrawerModelElementRelatedSubmapSelector); + const hasPrivilegeToWriteProject = useAppSelector(hasPrivilegeToWriteProjectSelector); const currentTargetId = modelElement?.id ? `${TARGET_PREFIX}:${modelElement.id}` : ''; const project = useAppSelector(projectDataSelector); @@ -85,12 +87,14 @@ export const BioEntityDrawer = (): React.ReactNode => { <div className="flex items-center"> <span className="font-normal">{type}:</span> {modelElement.name} - <IconButton - className="bg-white-pearl" - classNameIcon="fill-font-500" - icon="pencil" - onClick={editElementGlyph} - /> + {hasPrivilegeToWriteProject && ( + <IconButton + className="bg-white-pearl" + classNameIcon="fill-font-500" + icon="pencil" + onClick={editElementGlyph} + /> + )} </div> } />