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

Handle the case where no trips have been labeled for two weeks #806

Merged
merged 1 commit into from
Jan 15, 2022

Conversation

shankari
Copy link
Contributor

This is likely fairly common for those people who have given up on labeling, so
it is worth addressing. The problem is that in that case,

lastWeek.footprint.low = 0
thisWeek.footprint.low = 0

thisWeek.footprint.low/lastWeek.footprint.low = NaN

So we end up with a blank "low" on the diff display, which looks weird.

To fix, we add a pre-processing step to the directive, which converts NaN -> 0
and display the % if it is >= 0

This then leads to the marginally less weird case in which we don't show the
arrow and we don't show the OR

To fix that as well, we remove the ng-if for the OR (not sure why it was ever added)
and add an = for the case in which the metric is 0

This is likely fairly common for those people who have given up on labeling, so
it is worth addressing. The problem is that in that case,

```
lastWeek.footprint.low = 0
thisWeek.footprint.low = 0

thisWeek.footprint.low/lastWeek.footprint.low = NaN
```

So we end up with a blank "low" on the diff display, which looks weird.

To fix, we add a pre-processing step to the directive, which converts NaN -> 0
and display the % if it is >= 0

This then leads to the marginally less weird case in which we don't show the
arrow and we don't show the OR

To fix that as well, we remove the `ng-if` for the OR (not sure why it was ever added)
and add an = for the case in which the metric is 0
@shankari shankari merged commit e4a74dc into e-mission:master Jan 15, 2022
@shankari
Copy link
Contributor Author

Before changes zero replace and >= 0 fix Final version
Screenshot_1642250891 Screenshot_1642251584 Screenshot_1642254790

shankari added a commit to shankari/e-mission-phone that referenced this pull request Jan 15, 2022
This is a merge of
e-mission#806
and
e-mission#806
into the currently deployed branch

This primarily involved copying files over since the merge history has diverged
significantly. Should really prioritize pushing out the status screen changes
so that we don't have to do that in the future.
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.

1 participant