Skip to content

Commit

Permalink
Fix some errors
Browse files Browse the repository at this point in the history
  • Loading branch information
beque committed Jan 10, 2025
1 parent 2597b03 commit 7e9d3eb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
/>
</Form.Group>
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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);
}
Expand All @@ -34,7 +23,7 @@ const OntologySegmentsList = ({ store, element, handleSegmentsChange, handleRetr
return (
<GenToolbar
generic={segment}
genericType="Segment"
genericType={Constants.GENERIC_TYPES.SEGMENT}
klass={segmentKlass}
fnReload={handleSegmentsChange}
fnRetrieve={handleRetrieveRevision}
Expand Down Expand Up @@ -72,7 +61,7 @@ const OntologySegmentsList = ({ store, element, handleSegmentsChange, handleRetr
isPreview={false}
isSearch={false}
isActiveWF={false}
fnNavi={onNaviClick}
fnNavi={() => {}}
key={`ontology-${index}-${j}`}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ const AnalysesContainer = ({ readonly }) => {

containers.forEach((container, index) => {
items.push(
<Card key={`container_${container.id}`} className={`border-0${index === 0 ? '' : 'border-top'}`}>
<Card.Header className={`rounded-0 p-0 border-bottom-0`}>
<Card key={`container_${container.id}`} className={`rounded-0 border-0${index === 0 ? '' : ' border-top'}`}>
<Card.Header className="rounded-0 p-0 border-bottom-0">
<AccordionHeaderWithButtons eventKey={container.id}>
<AnalysisHeader container={container} readonly={readonly} />
</AccordionHeaderWithButtons>
Expand Down

0 comments on commit 7e9d3eb

Please sign in to comment.