-
Notifications
You must be signed in to change notification settings - Fork 2
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
OKRS-24-55 #1243
OKRS-24-55 #1243
Conversation
✅ Preview link ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…oved annotation for Hosptal Admissions sensor when we don't have recent data for choosen date
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.
This looks great! I especially appreciate how you got rid of the asterisks and added tooltip hovers for the latest dates of each of the 3 highlighted indicators.
There is one behavior that we might want to change though (and we can merge this PR and fix it later, if necessary) -- when you go to the dashboard without any url parameters (like https://deploy-preview-1243--cmu-delphi-covidcast.netlify.app/ ), it shows the warning message as appropriate. However, when you go to the dashboard with a date specified that matches minMaxDate
, it still shows the warning message (for instance, as of today 20240416
, the most recent date with all 3 indicators available is 20240329
, so today this happens when you visit https://deploy-preview-1243--cmu-delphi-covidcast.netlify.app/?date=20240329 ). This doesn't give incorrect information, but it could be fairly confusing for users.
<a href="?date={formatAPITime(sensor.timeFrame.max)}" on:click={switchDate} | ||
>{formatDateYearDayOfWeekAbbr(sensor.timeFrame.max)}</a | ||
<a | ||
href="?date={formatAPITime(sensor.timeFrame.max)}&{window.location.search.split('&').slice(1).join('&')}" |
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.
Is this file still used anywhere? It looks like it has been replaced by your new NoRecentDataWarning.svelte
...
If we are keeping the file, we should include a comment describing what this split/slice/join operation is doing.
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.
I didn't mean to replace "IndicatorWarning.svelte" by "NoRecentDataWarning.svelte", but I didn't want to change existing "Indicator.svelte" either.
I would prefer to add comment and leave both of them (at least for now).
Co-authored-by: george <[email protected]>
Co-authored-by: george <[email protected]>
Yeah, I agree that it is uncorrect behaviour and I wanted to fix that, but I have not found how to do that yet. |
…comment to explain some split/slice logic in IndicatorWarning
…warning message handling.
…explanation on split/slice/join operations in NoRecentDataWarning.svelte
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.
This is great! Just two little things for punctuation, and then one comment/question about code location.
// warningType is indicator of which exact warning message should be shown. | ||
// By default, when user opens page with no specified date, the date will be set to the latest date we have data for all 3 indicators. | ||
// In this case, warningType should be set to 1. | ||
// In case selected date is set to future date (date > minMaxDate, where we don't have recent data for all 3 indicators), the warningType will be set to 2 | ||
// which has different warning message. | ||
// In case selected date is set to some date which is < minMaxDate, the warningType will be set to 0 which means that we will not show | ||
// any warning message. | ||
|
||
// warningType should be set in beforeUpdate() method, to guess correct warningType. | ||
|
||
let warningType = 1; | ||
beforeUpdate(() => { | ||
if (date.value > minMaxDate) { | ||
warningType = 2; | ||
} else if (date.value < minMaxDate) { | ||
warningType = 0; | ||
} else { | ||
warningType = 1; | ||
} | ||
}); |
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 we do the date.value != minMaxDate
comparisons inside NoRecentDataWarning.svelte
? That way we wouldn't have to pass warningType
... Or do we need to do the comparisons inside of the beforeUpdate()
event 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.
i talked to Dmytro on slack, he is going to look at this but we will release the current state in the meantime as the functionality is doing what its supposed to.
Co-authored-by: george <[email protected]>
Co-authored-by: george <[email protected]>
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.
awesome!
ah crap, build is now failing because |
thanks Dmytro, youre the best! |
Prerequisites:
dev
Summary
"latest known data" link now preserves context.
Set default date to the date when we have data for all 3 sensors in 'Overview'. When date is present in URL, the date doesn't change to "default date". Added "NoRecentDataWarning" in order to nofity user about "old" data