-
-
Notifications
You must be signed in to change notification settings - Fork 288
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
Dashboard : Device value on 2 lines #928
Dashboard : Device value on 2 lines #928
Conversation
def354e
to
2557d18
Compare
Codecov Report
@@ Coverage Diff @@
## master #928 +/- ##
=======================================
Coverage 94.22% 94.22%
=======================================
Files 462 462
Lines 6133 6133
=======================================
Hits 5779 5779
Misses 354 354 Continue to review full report at Codecov.
|
So how does it looks like when the text is long ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR !
Just a little feedback on type, nothing serious but this can lead to very weird bugs
@@ -23,7 +24,7 @@ const SensorDeviceType = ({ children, ...props }) => ( | |||
</td> | |||
<td>{props.deviceFeature.name}</td> | |||
{SPECIAL_SENSORS.indexOf(props.deviceFeature.category) === -1 && ( | |||
<td class="text-right"> | |||
<td class={cx('text-right', { 'text-nowrap': props.deviceFeature.last_value })}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you do a stricter type check on this ? If last_value = 0, (ex: temperature = 0°C) then it'll be "false" here, but we want true.
check only if null
@@ -51,7 +52,7 @@ const SensorDeviceType = ({ children, ...props }) => ( | |||
</td> | |||
)} | |||
{props.deviceFeature.category === DEVICE_FEATURE_CATEGORIES.MOTION_SENSOR && ( | |||
<td class="text-right"> | |||
<td class={cx('text-right', { 'text-nowrap': props.deviceFeature.last_value })}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it should be last_value_changed
not last_value
.
15dd08a
to
f21399c
Compare
Thanks for your changes! Good for me. |
Fixes GladysAssistant#925 Co-authored-by: Pierre-Gilles Leymarie <pierregilles.leymarie@gmail.com>
Fixes #925
Do not allow to display device value on multiple lines (except for "no value received").