Skip to content

Commit

Permalink
[IDC-1905] Hover tooltips for Segmentation + RTSTRUCT extension (#2044)
Browse files Browse the repository at this point in the history
* WIP debug dialog

* Rename the p10 downloader extension to debugger extension, add button to toolbar. Deactivate it by default.

* Fix unit tests

* WIP

* WIP

* Finish mailTo

* tooltop
  • Loading branch information
JamesAPetts authored Sep 17, 2020
1 parent fab122d commit bb1cdbd
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 8 deletions.
3 changes: 2 additions & 1 deletion extensions/dicom-rt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"dcmjs": "0.16.3",
"prop-types": "^15.6.2",
"react": "^16.8.6",
"react-dom": "^16.8.6"
"react-dom": "^16.8.6",
"react-tooltip": "4.2.10"
},
"dependencies": {
"@babel/runtime": "^7.5.5",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
import { TableListItem, Icon, Tooltip, OverlayTrigger } from '@ohif/ui';
import ReactTooltip from 'react-tooltip';

import './StructureSetItem.css';

Expand Down Expand Up @@ -68,7 +69,18 @@ const StructureSetItem = ({
>
<div>
<div className="item-label" style={{ marginBottom: 4 }}>
<span>{label}</span>
<a data-tip data-for={`StructureHover${index}`}>
<span>{label}</span>
</a>
<ReactTooltip
id={`StructureHover${index}`}
delayShow={250}
place="right"
border={true}
type="light"
>
<span>{label}</span>
</ReactTooltip>
{!isDisabled && (
<Icon
className={`eye-icon ${isVisible && '--visible'}`}
Expand Down
3 changes: 2 additions & 1 deletion extensions/dicom-segmentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"dependencies": {
"@babel/runtime": "^7.5.5",
"gl-matrix": "^3.3.0",
"react-select": "^3.0.8"
"react-select": "^3.0.8",
"react-tooltip": "4.2.10"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
import { TableListItem, Icon } from '@ohif/ui';
import ReactTooltip from 'react-tooltip';

import './SegmentItem.css';

Expand All @@ -17,7 +18,15 @@ ColoredCircle.propTypes = {
color: PropTypes.array.isRequired,
};

const SegmentItem = ({ index, label, onClick, itemClass, color, visible = true, onVisibilityChange }) => {
const SegmentItem = ({
index,
label,
onClick,
itemClass,
color,
visible = true,
onVisibilityChange,
}) => {
const [isVisible, setIsVisible] = useState(visible);

useEffect(() => {
Expand All @@ -37,7 +46,18 @@ const SegmentItem = ({ index, label, onClick, itemClass, color, visible = true,
>
<div>
<div className="segment-label" style={{ marginBottom: 4 }}>
<span>{label}</span>
<a data-tip data-for={`SegmentHover${index}`}>
<span>{label}</span>
</a>
<ReactTooltip
id={`SegmentHover${index}`}
delayShow={250}
place="right"
border={true}
type="light"
>
<span>{label}</span>
</ReactTooltip>
<Icon
className={`eye-icon ${isVisible && '--visible'}`}
name={isVisible ? 'eye' : 'eye-closed'}
Expand All @@ -61,7 +81,7 @@ const SegmentItem = ({ index, label, onClick, itemClass, color, visible = true,
<span style={{ marginRight: '4px' }}>
<Icon name="edit" width="14px" height="14px" />
</span>
Relabel
Relabel
</button>
<button
className="btnAction"
Expand All @@ -70,7 +90,7 @@ const SegmentItem = ({ index, label, onClick, itemClass, color, visible = true,
<span style={{ marginRight: '4px' }}>
<Icon name="edit" width="14px" height="14px" />
</span>
Description
Description
</button>
</div>
)}
Expand All @@ -90,7 +110,7 @@ SegmentItem.propTypes = {

SegmentItem.defaultProps = {
itemClass: '',
onClick: () => { }
onClick: () => {},
};

export default SegmentItem;
13 changes: 13 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16020,6 +16020,14 @@ react-simple-code-editor@^0.9.0:
resolved "https://registry.yarnpkg.com/react-simple-code-editor/-/react-simple-code-editor-0.9.15.tgz#59e3583832e9e98992d3674b2d7673b4cd1c5709"
integrity sha512-M8iKgjBTBZK92tZYgOEfMuR7c3zZ0q0v3QYllSxIPx3SU+w003VofH50txXQSBTu92pSOm2tidON1HbQ1l8BDA==

[email protected]:
version "4.2.10"
resolved "https://registry.yarnpkg.com/react-tooltip/-/react-tooltip-4.2.10.tgz#ed1a1acd388940c96f4b6309f4fd4dcce5e01bdc"
integrity sha512-D7ZLx6/QwpUl0SZRek3IZy/HWpsEEp0v3562tcT8IwZgu8IgV7hY5ZzniTkHyRcuL+IQnljpjj7A7zCgl2+T3w==
dependencies:
prop-types "^15.7.2"
uuid "^7.0.3"

[email protected]:
version "2.0.0"
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-2.0.0.tgz#e882e61fce8622ed981b6e31fc7ef52d43a1a06a"
Expand Down Expand Up @@ -19557,6 +19565,11 @@ uuid@^3.0.1, uuid@^3.1.0, uuid@^3.3.2:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866"
integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==

uuid@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-7.0.3.tgz#c5c9f2c8cf25dc0a372c4df1441c41f5bd0c680b"
integrity sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==

[email protected]:
version "2.0.3"
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.0.3.tgz#00f7494d2ae2b688cfe2899df6ed2c54bef91dbe"
Expand Down

0 comments on commit bb1cdbd

Please sign in to comment.