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

Dashboard : Device value on 2 lines #928

Merged
merged 2 commits into from
Nov 11, 2020

Conversation

atrovato
Copy link
Contributor

@atrovato atrovato commented Nov 8, 2020

Fixes #925

Do not allow to display device value on multiple lines (except for "no value received").

@codecov
Copy link

codecov bot commented Nov 8, 2020

Codecov Report

Merging #928 (c5430ce) into master (e837997) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e837997...c5430ce. Read the comment docs.

@Pierre-Gilles
Copy link
Contributor

So how does it looks like when the text is long ?

Copy link
Contributor

@Pierre-Gilles Pierre-Gilles left a 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 })}>
Copy link
Contributor

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 })}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Contributor Author

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.

@atrovato
Copy link
Contributor Author

atrovato commented Nov 9, 2020

Before:

After:

@Pierre-Gilles
Copy link
Contributor

Thanks for your changes! Good for me.

@Pierre-Gilles Pierre-Gilles merged commit 765461e into GladysAssistant:master Nov 11, 2020
R6n0 pushed a commit to R6n0/Gladys that referenced this pull request Dec 2, 2020
Fixes GladysAssistant#925

Co-authored-by: Pierre-Gilles Leymarie <pierregilles.leymarie@gmail.com>
@atrovato atrovato deleted the atrovato/issue925 branch November 28, 2021 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dashboard : Device value on 2 lines
2 participants