#39-SMHI_view Data Connection: SMHI #151
No reviewers
Labels
No labels
_CRITICAL_
API
app
backEnd
Blocked-waiting-for-further-changes
bug
bug-only-on-server-for-mobile-not-webpage
Bug-Report-After-Merge
cleanup
close
design
duplicate
enhancement
feature request
frontEnd
further-changes-needed
future-problem-not-fixint-this-period
help wanted
invalid
last-week-issue-to-fix
library
low-priority
needs input
needs review
not-implemented.
project documentation
question
research
reviewed
Script
security
SQL
style
Team 1
Team 2
team leaders
test-creation
testing
topLevel
unassigned
Under-review
wontfix
No milestone
No project
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Andras/BoundlessFlowCampus2K!151
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "#39-SMHI_view"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implemented the SMHI observations (metobs) and SMHI forecast (snow1gv1) API:s. This is related to issue #39. The code also contains two files to demo the hooks.
changes made:
added useSMHIObservations.js (metobs API)
added useSMHIForecast.js (snow1gv1 API)
added SMHITemperatureView.js (metobs demo)
added SMHIForecastCard.js (snow1gv1 demo)
testing:
checked that the demo views/cards showed the correct data fetched from SMHI
note:
The react hooks are fairly simple, and discard some choices the API:s give us. The issue might need to be revisited in the future.
All data is shown on the app and tested everything locally which works, nice!
Regarding the names of the files, I have some questions.
Comments:
Other questions:
Everything seems fine and working.
It's just unclear what each file does, and there is a lack of comments.
ae94aaed9atoc618a0edb2@a24noabe ,
The naming and commeting looks good,
But the files "useSMHIForecast" and "useSMHIObservations" should use the function useApi that is found in "src/features/utility/sharedFeatures.js".
All you have to do is construct the URL outside of the fetch and then do the fetch using useAPi.
Example of what I mean in the useSMHIObservations-script:
I have committed and updated the pr, it's now better commented and documented and uses the proper 'useApi' function. Please note that the views included are for demo purposes on how the data can be parsed and presented
Checked that the view code compiles, gets the correct data, and that the naming is compliant with our coding standard.
It seems to pass all these, and comments are now present.
Merging