feat: Snapshot Download Tool (#840)

* feat(Download ScreenShot Dialog)

- UI part of it

* feat(Download ScreenShot Dialog)

- UI part of it

* feat(Download ScreenShot Dialog)

- Missing Annotations showing controls

* feat(Download ScreenShot Dialog)

- Missing Annotations showing controls

* feat(Download ScreenShot Dialog)

- Partial Pull Request - Not ready to Prod yet.

* feat(Download ScreenShot Dialog)

  - UI - v2

* feat(Download ScreenShot Dialog)

  - UI - v3

* feat(Download ScreenShot Dialog)

  - Resizing tool

* feat(Download ScreenShot Dialog)

  - Resizing tool

* feat(Download ScreenShot Dialog)

  - Removing hardcoded CSS left

* feat(Download ScreenShot Dialog)

  - Bugfixes

* feat(Download ScreenShot Dialog)

  - Bugfixes - Escape closes the modal

* feat(Download ScreenShot Dialog)

  - Bugfixes - Responsive issues

* WIP: Refactoring DownloadDialog

* WIP: Refactoring DownloadDialog

* Align label and hide background canvas

* Add constantes and remove code not used

* Reset state on close modal

* Extract cornerstone to connect

* Fix modal zindex and add custom canvas classname

* CR Update: Add proptypes and fix useeffect warning

* CR Update: Refactor hooks, styles and imports

* CR Update: Remove important from css

* CR Update: Update core utils test of index
This commit is contained in:
Romulo Bordezani authored and Danny Brown committed 2019-10-25 22:46:32 -04:00
1 parent 8cf1e54490
commit 450e0981a5
19 files changed
+824 -96

No files matched your search

+20 -28
View File
@@ -1,42 +1,34 @@
.select-ohif {
display: block;
font-family: Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue',
sans-serif;
font-size: 0.8em;
font-weight: 600;
color: #444;
line-height: 1.3;
padding: 0.6em 1.4em 0.5em 0.8em;
width: 100%;
max-width: 100%;
.select-ohif-container .select-ohif {
display: inline-block;
font-size: 10pt;
box-sizing: border-box;
margin: 0;
border: 1px solid #aaa;
box-shadow: 0 1px 0 1px rgba(0, 0, 0, 0.04);
border-radius: 0.5em;
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
background-color: #fff;
background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E'),
linear-gradient(to bottom, #ffffff 0%, #e5e5e5 100%);
background-repeat: no-repeat, repeat;
background-position: right 0.7em top 50%, 0 0;
background-size: 0.65em auto, 100%;
width: auto;
transition: all 0.15s ease;
background-color: var(--input-background-color);
line-height: 16px;
color: var(--input-placeholder-color);
height: 40px;
margin: 0 5px 20px 5px;
padding: 0 20px;
placeholder-color: var(--input-placeholder-color);
cursor: pointer;
border: none;
font-weight: normal;
border-radius: 4px;
}
.select-ohif::-ms-expand {
.select-ohif-container .select-ohif::-ms-expand {
display: none;
}
.select-ohif:hover {
border-color: #888;
.select-ohif-container .select-ohif-label {
padding: 5px;
}
.select-ohif:focus {
outline: none;
}
.select-ohif option {
.select-ohif-container .select-ohif option {
font-weight: normal;
}
+30 -25
View File
@@ -7,9 +7,19 @@ import PropTypes from 'prop-types';
class Select extends Component {
constructor(props) {
super(props);
this.state = { value: this.props.value };
}
static propTypes = {
options: PropTypes.arrayOf(
PropTypes.shape({
key: PropTypes.string.isRequired,
value: PropTypes.string.isRequired,
})
),
value: PropTypes.string,
onChange: PropTypes.func,
};
handleChange = event => {
const value = event.target.value;
this.setState({ value });
@@ -18,32 +28,27 @@ class Select extends Component {
render() {
return (
<select
className="select-ohif"
value={this.state.selected}
onChange={this.handleChange}
>
{this.props.options.map(({ key, value }) => {
return (
<option key={key} value={value}>
{key}
</option>
);
})}
</select>
<div className="select-ohif-container">
<label className="select-ohif-label" htmlFor={this.id}>
{this.props.label}
<select
className="form-control select-ohif"
{...this.props}
>
{this.props.options.map(({ key, value }) => {
return (
<option key={key} value={value}>
{key}
</option>
);
})}
</select>
</label>
</div>
);
}
}
Select.propTypes = {
options: PropTypes.arrayOf(
PropTypes.shape({
key: PropTypes.string.isRequired,
value: PropTypes.string.isRequired,
})
),
value: PropTypes.string,
onChange: PropTypes.func,
};
export { Select };
+32 -5
View File
@@ -1,7 +1,34 @@
.input-ohif {
background-color: #b6b6b6;
border-color: #b6b6b6;
font-family: Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue',
sans-serif;
.input-ohif-container {
font-size: 1em;
color: var(--text-primary-color);
font-weight: 400;
}
.input-ohif-container .input-ohif {
display: inline-block;
height: 40px;
margin: 0 10px 20px;
padding: 0 20px;
cursor: pointer;
border: none;
background-color: var(--input-background-color);
color: var(--input-placeholder-color);
font-size: 10pt;
font-weight: normal;
width: auto;
border-radius: 4px;
transition: all 0.15s ease;
}
.input-ohif-container .input-ohif-label {
padding: 5px;
}
.input-ohif-container .input-ohif:active,
.input-ohif-container .input-ohif:focus {
background-color: var(--input-background-color);
}
.input-ohif-container .input-ohif.invisible {
visibility: hidden;
}
+28 -19
View File
@@ -1,36 +1,45 @@
import './TextInput.css';
import React from 'react';
import PropTypes from 'prop-types';
import './TextInput.css';
class TextInput extends React.Component {
constructor(props) {
super(props);
this.state = { value: props.value };
}
handleChange = event => {
this.setState({ value: event.target.value });
if (this.props.onChange) this.props.onChange();
static propTypes = {
value: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
]),
id: PropTypes.string,
label:PropTypes.string,
type: PropTypes.string,
};
static defaultProps = {
value: '',
id: `TextInput-${new Date().toTimeString()}`,
label: undefined,
type: 'text',
};
render() {
return (
<input
className="input-ohif"
type="text"
value={this.state.value}
onChange={this.handleChange}
id={this.props.id}
/>
<div className="input-ohif-container">
<label className="input-ohif-label" htmlFor={this.props.id}>
{this.props.label}
<input
type={this.props.type}
id={this.props.id}
className="form-control input-ohif"
{...this.props}
/>
</label>
</div>
);
}
}
TextInput.propTypes = {
value: PropTypes.string,
id: PropTypes.string,
onChange: PropTypes.func,
};
export { TextInput };
+2 -3
View File
@@ -1,3 +1,2 @@
import { ICONS, Icon } from './Icon';
export { Icon, ICONS };
export * from './Icon';
export * from './form';