Comments (7)
Final note: Merging #40 will not (yet) auto deploy the refactored webhook to Nightly.
It does now :)
To deploy, cd into ./gluco-check-webhooks
and run yarn deploy
from gluco-check.
Awesome, thanks Niels! My winter break just started so I will have a look at this over the next couple of days.
from gluco-check.
Okay @nielsmaerten just about done working through this but want to confirm, ah, nevermind any of this, can see for myself now that it's been deployed to nightly.url
is always present in the response, but token
nightscout
and discoveredMetrics
would be optional, am I reading validate
correctly? Or would they be present but empty?
from gluco-check.
Hi @ddamico
I turned this card into an issue, because I think it may require some additional discussion before it's actually useful.
I currently see 2 issues:
-
if a metric is missing from
readableMetrics
it does not necessarily mean that metric is completely unavailable. Nightscout's API is tricky here: When you have no more Carbs On Board... it does not set COB to 0. Instead, the COB is omitted entirely.
A metric being unreadable now, does not mean will won't be there at some point in the future. -
canReadStatus
doesn't seem very useful from the point of the frontend? Basically, it means the /api/v1/status endpoint is returning data. That should indicate there's a working nightscout site behind the url entered BUT... if the user has set API_DEFAULT_ROLES todenied
, there's a working Nightscout site... butcanReadStatus
will still be false.
from gluco-check.
I have some ideas about how to solve these, but I'm curious what you think.
- readableMetrics: I would not block a metric from being selected just because the API can't find it.
- canReadStatus: Maybe I should change this to
isNightscoutUrl
? I'd run some different logic to detect there's actually a nightscout site there. Then if it's false, it's clear that the user must be instructed to update their url
from gluco-check.
Ah these are great points Niels! I see what you mean with readableMetrics
, I will not block anything on this. And on canReadStatus
, your alternate proposal sounds like a great alternative if the current logic has that level of uncertainty!
Also was thinking earlier today that rather than changing user input based on this response, it makes more sense to provide clear messaging with adjacent helper text. Apart from the "these characteristics of the response could mean a few different things" concerns, it seems to me like a confusing user experience to present the form with "corrections" that wouldn't actually be persisted anywhere unless the user clicks save.
from gluco-check.
Hey @ddamico
First off: happy holidays! :)
I found some time to take another look at the validation endpoint, and I've created a PR with a refactored version.
NightscoutValidationResult.ts is the file you'll probably want to take a look at, because that's what the API will be responding with.
If this looks good to you, go ahead and merge PR #40.
Also was thinking earlier today that rather than changing user input based on this response, it makes more sense to provide clear messaging with adjacent helper text
Agreed. Something like: when a Metric is missing, we only show some helper text/info bubble to indicate the Metric could not be found? This might nudge the user to not select it after all (eg if they realize they don't enter this info into Nightscout anyways).
it seems to me like a confusing user experience to present the form with "corrections" that wouldn't actually be persisted anywhere unless the user clicks save.
Sounds good! The only real correction here is that the token and url saved to the userDocument should be the 'parsed' versions from the api response.
And on canReadStatus, your alternate proposal sounds like a great alternative if the current logic has that level of uncertainty!
canReadStatus
is gone, and replaced with pointsToNightscout
. If that property is false, the user will have to correct their URL
from gluco-check.
Related Issues (20)
- Update documentation
- Settings page has very low contrast in dark mode
- Request: Remove urls from translation.json
- Remove unused React imports.
- Point Nightscout Status users to Gluco Check HOT 1
- Feature: Add a language selector to frontend
- Update frontend to better integrate secret-to-token behaviour HOT 4
- Insulin Input
- GlucoseUnit is not detected properly HOT 3
- Account deletion (GDPR, ...)
- New translation: Spanish
- New translation: Swedish
- New translation: German HOT 3
- Voice not recognized HOT 3
- Prevent multiple inits of singletons
- Invocations HOT 1
- CAGE and SAGE are NaN in Nightscout 14.2.x HOT 1
- Add bèta link to Nightscout Status homepage
- Auto-generate Nightscout tokens HOT 1
- Merge gluco-check-frontend HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gluco-check.