Skip to content

Commit

Permalink
fix(xod-client): add missing labels for variadic pins in inspector
Browse files Browse the repository at this point in the history
Fixes #1503
  • Loading branch information
evgenykochetkov authored and brusherru committed Nov 6, 2018
1 parent aeaeadd commit d5f5163
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const getPinWidgetProps = R.applySpec({
keyName: XP.getPinKey,
type: XP.getPinType,
label: XP.getPinLabel,
normalizedLabel: R.prop('normalizedLabel'),
value: R.prop('value'),
direction: XP.getPinDirection,
isConnected: R.prop('isConnected'),
Expand Down Expand Up @@ -59,6 +58,7 @@ const createPinWidgetsConfig = R.compose(
R.apply(R.concat),
R.map(R.sort(R.ascend(XP.getPinOrder))),
R.juxt([R.filter(XP.isInputPin), R.filter(XP.isOutputPin)]),
XP.normalizeEmptyPinLabels,
R.values,
R.prop('pins')
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ function BoolWidget(props) {
<PinWidget
elementId={props.elementId}
label={props.label}
normalizedLabel={props.normalizedLabel}
dataType={props.dataType}
isConnected={props.isConnected}
isInvalid={props.isInvalid}
Expand All @@ -37,7 +36,6 @@ function BoolWidget(props) {
BoolWidget.propTypes = {
elementId: PropTypes.string.isRequired,
label: PropTypes.string,
normalizedLabel: PropTypes.string.isRequired,
dataType: PropTypes.string,
isConnected: PropTypes.bool,
isInvalid: PropTypes.bool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const DisabledInputWidget = props => (
<PinWidget
elementId={props.elementId}
label={props.label}
normalizedLabel={props.normalizedLabel}
dataType={props.dataType}
isConnected={props.isConnected}
isLastVariadicGroup={props.isLastVariadicGroup}
Expand All @@ -18,7 +17,6 @@ const DisabledInputWidget = props => (

DisabledInputWidget.propTypes = {
elementId: PropTypes.string.isRequired,
normalizedLabel: PropTypes.string.isRequired,
label: PropTypes.string,
dataType: PropTypes.string,
isConnected: PropTypes.bool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const GenericPinWidget = props => (
<PinWidget
elementId={props.elementId}
label={props.label}
normalizedLabel={props.normalizedLabel}
dataType={props.dataType}
isConnected={props.isConnected}
isInvalid={props.isInvalid}
Expand All @@ -31,7 +30,6 @@ const GenericPinWidget = props => (

GenericPinWidget.propTypes = {
elementId: PropTypes.string.isRequired,
normalizedLabel: PropTypes.string.isRequired,
label: PropTypes.string,
dataType: PropTypes.string,
isConnected: PropTypes.bool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const NumberWidget = props => {
<PinWidget
elementId={props.elementId}
label={props.label}
normalizedLabel={props.normalizedLabel}
dataType={props.dataType}
isConnected={props.isConnected}
isInvalid={props.isInvalid}
Expand All @@ -35,7 +34,6 @@ const NumberWidget = props => {

NumberWidget.propTypes = {
elementId: PropTypes.string.isRequired,
normalizedLabel: PropTypes.string.isRequired,
label: PropTypes.string,
dataType: PropTypes.string,
isConnected: PropTypes.bool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function PinWidget(props) {
props.children
);
return (
<div className="Widget PinWidget" data-pinlabel={props.normalizedLabel}>
<div className="Widget PinWidget" data-pinlabel={props.label}>
{input}
<PinIcon
id={props.elementId}
Expand All @@ -60,14 +60,14 @@ function PinWidget(props) {
deducedType={props.deducedType}
isLastVariadicGroup={props.isLastVariadicGroup}
/>
<label htmlFor={props.elementId}>{props.normalizedLabel}</label>
<label htmlFor={props.elementId}>{props.label}</label>
</div>
);
}

PinWidget.propTypes = {
elementId: PropTypes.string.isRequired,
normalizedLabel: PropTypes.string.isRequired,
label: PropTypes.string.isRequired,
dataType: PropTypes.string,
isConnected: PropTypes.bool,
isInvalid: PropTypes.bool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const PulseWidget = props => {
<PinWidget
elementId={props.elementId}
label={props.label}
normalizedLabel={props.normalizedLabel}
dataType={props.dataType}
isConnected={props.isConnected}
isInvalid={props.isInvalid}
Expand Down Expand Up @@ -43,7 +42,6 @@ const PulseWidget = props => {

PulseWidget.propTypes = {
elementId: PropTypes.string.isRequired,
normalizedLabel: PropTypes.string.isRequired,
label: PropTypes.string,
dataType: PropTypes.string,
isConnected: PropTypes.bool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const StringWidget = withState('focused', 'setFocus', false)(props => {
<PinWidget
elementId={props.elementId}
label={props.label}
normalizedLabel={props.normalizedLabel}
dataType={props.dataType}
isConnected={props.isConnected}
isInvalid={props.isInvalid}
Expand Down Expand Up @@ -51,7 +50,6 @@ const StringWidget = withState('focused', 'setFocus', false)(props => {

StringWidget.propTypes = {
elementId: PropTypes.string.isRequired,
normalizedLabel: PropTypes.string.isRequired,
label: PropTypes.string,
dataType: PropTypes.string,
isConnected: PropTypes.bool,
Expand Down

0 comments on commit d5f5163

Please sign in to comment.