From 7e9d3eb78b754822ce5416f90985132eb6e6afbe Mon Sep 17 00:00:00 2001 From: Beate Quednau Date: Tue, 7 Jan 2025 19:25:16 +0100 Subject: [PATCH] Fix some errors --- .../details/deviceDescriptions/FormFields.js | 2 +- .../deviceDescriptions/OntologySegmentsList.js | 17 +++-------------- .../deviceDescriptions/OntologySortableList.js | 6 +++--- .../analysesTab/AnalysesContainer.js | 4 ++-- 4 files changed, 9 insertions(+), 20 deletions(-) diff --git a/app/javascript/src/apps/mydb/elements/details/deviceDescriptions/FormFields.js b/app/javascript/src/apps/mydb/elements/details/deviceDescriptions/FormFields.js index abec467b34..efb3aca982 100644 --- a/app/javascript/src/apps/mydb/elements/details/deviceDescriptions/FormFields.js +++ b/app/javascript/src/apps/mydb/elements/details/deviceDescriptions/FormFields.js @@ -654,7 +654,7 @@ const numericInput = (element, store, field, label, type, info) => { name={field} type="number" key={`${store.key_prefix}-${field}`} - value={parseFloat(value)} + value={value !== '' ? parseFloat(value) : ''} onChange={handleFieldChanged(store, field, type, element.type)} /> diff --git a/app/javascript/src/apps/mydb/elements/details/deviceDescriptions/OntologySegmentsList.js b/app/javascript/src/apps/mydb/elements/details/deviceDescriptions/OntologySegmentsList.js index 921d3cd9d6..cd37aef185 100644 --- a/app/javascript/src/apps/mydb/elements/details/deviceDescriptions/OntologySegmentsList.js +++ b/app/javascript/src/apps/mydb/elements/details/deviceDescriptions/OntologySegmentsList.js @@ -1,7 +1,7 @@ import React from 'react'; import { Accordion } from 'react-bootstrap'; import { cloneDeep } from 'lodash'; -import { GenInterface, GenToolbar } from 'chem-generic-ui'; +import { Constants, GenInterface, GenToolbar } from 'chem-generic-ui'; import UserStore from 'src/stores/alt/stores/UserStore'; import Segment from 'src/models/Segment'; @@ -15,17 +15,6 @@ const OntologySegmentsList = ({ store, element, handleSegmentsChange, handleRetr const segmentKlasses = (UserStore.getState() && UserStore.getState().segmentKlasses) || []; let existingSegment = {} - const onNaviClick = (type, id) => { - console.log('navi', type, id); - //const { currentCollection, isSync } = UIStore.getState(); - //const collectionUrl = !isNaN(id) - // ? `${currentCollection.id}/${type}/${id}` - // : `${currentCollection.id}/${type}`; - //Aviator.navigate( - // isSync ? `/scollection/${collectionUrl}` : `/collection/${collectionUrl}` - //); - }; - const toggleSegment = (segment) => { store.toggleSegment(segment); } @@ -34,7 +23,7 @@ const OntologySegmentsList = ({ store, element, handleSegmentsChange, handleRetr return ( {}} key={`ontology-${index}-${j}`} /> ); diff --git a/app/javascript/src/apps/mydb/elements/details/deviceDescriptions/OntologySortableList.js b/app/javascript/src/apps/mydb/elements/details/deviceDescriptions/OntologySortableList.js index 5aadce9b0d..98c7007ca5 100644 --- a/app/javascript/src/apps/mydb/elements/details/deviceDescriptions/OntologySortableList.js +++ b/app/javascript/src/apps/mydb/elements/details/deviceDescriptions/OntologySortableList.js @@ -52,13 +52,13 @@ const OntologySortableList = ({ store, element, ontology, index }) => { const orderClass = ' d-flex align-items-center gap-3'; let dndClass = ''; - if (orderClass && canDrop) { + if (canDrop) { dndClass = ' dnd-zone-list-item mb-1'; } - if (orderClass && isOver) { + if (isOver) { dndClass += ' dnd-zone-over'; } - if (orderClass && isDragging) { + if (isDragging) { dndClass += ' dnd-dragging'; } diff --git a/app/javascript/src/apps/mydb/elements/details/deviceDescriptions/analysesTab/AnalysesContainer.js b/app/javascript/src/apps/mydb/elements/details/deviceDescriptions/analysesTab/AnalysesContainer.js index 0a77ac1f55..6d4e7c1db0 100644 --- a/app/javascript/src/apps/mydb/elements/details/deviceDescriptions/analysesTab/AnalysesContainer.js +++ b/app/javascript/src/apps/mydb/elements/details/deviceDescriptions/analysesTab/AnalysesContainer.js @@ -147,8 +147,8 @@ const AnalysesContainer = ({ readonly }) => { containers.forEach((container, index) => { items.push( - - + +