Skip to content

Commit

Permalink
Merge pull request #461 from Kitware/widget-update
Browse files Browse the repository at this point in the history
Widget update
  • Loading branch information
jourdain authored May 24, 2018
2 parents 56a32e3 + ecbb37e commit 41247d9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Common/Misc/ConvertProxyProperty/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export function proxyPropToProp(property, ui) {
domain: ui.domain || extractDomain(ui),
componentLabels: [],
size: extractSize(ui),
sort: ui.sort,
},
data: {
id: [property.id, property.name].join(':'),
Expand Down
7 changes: 6 additions & 1 deletion src/React/Properties/EnumProperty/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ export default class EnumProperty extends React.Component {
ret.push(<option key="empty-value" value={null} />);
}

Object.keys(this.props.ui.domain).forEach((key) => {
const keys = Object.keys(this.props.ui.domain);
if (this.props.ui.sort) {
keys.sort();
}

keys.forEach((key) => {
ret.push(
<option
value={valueToString(this.props.ui.domain[key])}
Expand Down
11 changes: 10 additions & 1 deletion src/React/Properties/PropertyPanel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import PropTypes from 'prop-types';
import style from 'PVWStyle/ReactProperties/PropertyPanel.mcss';
import factory from '../PropertyFactory';

function alwaysShow() {
return true;
}

export default class PropertyPanel extends React.Component {
constructor(props) {
super(props);
Expand All @@ -27,7 +31,12 @@ export default class PropertyPanel extends React.Component {
this.props.onChange ? this.valueChange : undefined
);
const uiContainer = (property) => (
<div key={property.title}>
<div
key={property.title}
style={{
display: (property.show || alwaysShow)(viewData) ? 'block' : 'none',
}}
>
<div className={style.propertyHeader}>
<strong>{property.title}</strong>
</div>
Expand Down

0 comments on commit 41247d9

Please sign in to comment.