fix(xod-client): add missing labels for variadic pins in inspector

Fixes #1503
This commit is contained in:
Evgeny Kochetkov
2018-10-31 16:15:04 +03:00
parent 3ecfad9287
commit fa646d914d
8 changed files with 4 additions and 16 deletions

View File

@@ -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'),
@@ -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')
);

View File

@@ -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}
@@ -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,

View File

@@ -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}
@@ -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,

View File

@@ -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}
@@ -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,

View File

@@ -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}
@@ -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,

View File

@@ -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}
@@ -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,

View File

@@ -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}
@@ -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,

View File

@@ -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}
@@ -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,