Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Auxtel Mount SummaryPanel #420

Merged
merged 2 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export default class SummaryTable extends Component {
</Value>

<Label>Cell load</Label>
<Value>{this.props.loadCell === "Unknown" ? (this.props.loadCell) : (this.props.loadCell).toFixed(2) + ' kg' }</Value>
<Value>{this.props.loadCell}</Value>
<Row>
<Limits
lowerLimit={ATPneumaticsLimits.cellLoad.min}
Expand All @@ -221,7 +221,7 @@ export default class SummaryTable extends Component {
</Row>

<Label>M1 Air pressure</Label>
<Value>{this.props.m1AirPressure === "Unknown" ? (this.props.m1AirPressure) : (this.props.m1AirPressure).toFixed(2) + ' Pa' }</Value>
<Value>{this.props.m1AirPressure}</Value>
<Row>
<Limits
lowerLimit={ATPneumaticsLimits.pressure.min}
Expand Down
3 changes: 2 additions & 1 deletion love/src/components/GeneralPurpose/SummaryPanel/Value.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const Value = ({
otherwise use the stringified version */
if (typeof children === 'object' && !React.isValidElement(children)) {
if (children.value !== undefined) parsedChild = children.value;
if (children.units !== undefined) parsedChild = `${parsedChild.toFixed(2)} ${children.units}`;
else parsedChild = JSON.stringify(children);
}
/** Display array of values when children is an array */
Expand All @@ -51,7 +52,7 @@ const Value = ({
);
}
/** Display strings and numbers. Truncate to 4 decimal places in the case of numbers */
return <span className={styles.value}>{parsedChild.toFixed ? parsedChild.toFixed(3) : parsedChild}</span>;
return <span className={styles.value}>{parsedChild}</span>;
};

export default Value;