* Restored Suggestions navigation tests
* Restored SuggestionsWithSyncedObs.test.js tests
* Mocked vision-camera-plugin-inatvision instead of useOfflineSuggestions
* Removed unnecessarily complex object from navigation params
There were a lot of issues here, but the main ones (I think) were related to
rendering all the navigators and waiting for asynchronous stuff to happen
before proceeding with the test.
* Style taxonomy ancestors and current taxon
* Link to TaxonDetails pages
* Add children to TaxonDetails taxonomy
* Add children taxa toggle
* Display children after button tap
* Wrap text'
* Fix italic font size in DisplayTaxonName
* Add tests to Taxonomy component
* Change Taxonomy test
* Bugfix: TaxonDetails was crashing if it received a null taxon
* Send lat and lng instead of latitude and longitude to the score_image
endpoint
* Show offline suggestions when you are offline
* Show notice when viewing offline suggestions
* Moved code unique to useOnlineSuggestions into that file
* Ensure we use a medium size image to get suggestions when dealing with
remote URLs
* More logging around React Query retries
* Use default retry logic for useAuthenticatedQuery
* Made a module-resolver shortcut for tests
* Move offline notice above top suggestion; hide when offlines exist but onlines do too
* Access MediaViewer from TaxonDetails
* Added our own presets for ActivityIndicator
* TaxonDetail should show a local taxon if one is available
* Made it a little easier to import the custom logger
* Refactored MediaViewer to accept photo-like objects instead of URIs
* Added license / attribution button to MediaViewer
* Moved delete button into MainPhotoDisplay so each photo has its own button
and it can be laid out relative to its photo
* Add custom header to MediaViewer when accessed from TaxonDetial
* Allow DisplayTaxonName to accept custom text components as props
* Added darker bg to photo on TaxonDetail to make title more legible
* Use offline model for displaying sugggestions
* Simplify Suggestions/TaxonSearch screens using hooks
* Use updateObsKeys function from useStore
* Simplify code and fix unit tests
* Fix tests for offline predictions
* Fix faker urls
* Fetch remote taxa to display taxon photos in Suggestions
* Fix useTaxon code and test
* Use online vision results as backup for offline results
* Fix tests and add test for online predictions
* Use Flatlist for Suggestions and fix tests
* Move API call out of Attribution and fix test
* Fix tests
* Fix test warnings
* Add vision param to identification create; test vision false on TaxonSearch and true elsewhere
* Test that vision attribute is only used from Suggestions screen
* Add owners_identification_from_vision attribute to observations
* Fixes for vision attribute
* Make sure taxon is applied from Suggestions/TaxonSearch via ObsEdit
* Fix for ids vision
* Fix Suggestions tests
This changes the default behavior for API errors such that they get thrown by
default, forcing code closer to the user to handle them. While we were set up
to catch errors in the upload process, we were supressing them so they
weren't bubbling up to that level. No more!
This also adds some additional handling for the occasionally zany shape of our
API error responses.
* Realm updates for cascading deletions
* Delete local observations from remote list
* Add tests for deleting local obs which were deelted on server
* Fix: don't create embedded objects explicitly
* Start on project / details UI overhaul
* UI tweak
* Show HTML in ProjDetails; close search bar
* Add OverviewStats and relevant fetches to ProjectDetail
* Allow user to leave/join traditional projects
* Fix tests with mock react-native-paper
* Show icon in DisplayTaxon if no photo; closes#769
* Update icons with correct mollusca name
* Fix tests
* Fix tests and add test for iconic taxon icon; fix API call for default photo
* Start building explore screen
* Header for Explore screen
* Fix button build
* Move ObsFlashList to shared components for use in Explore
* Fix background transparency on SegmentedButtons
* Use reusable components for map and ObservationLocation
* Use search observations API to show results in explore views
* Add infinite scroll hook to species, observers, and identifiers views
* Update snapshots and create ExploreFlashList for consistent header animation
* Float segmented buttons above observation lists in explore
* Use queryparams for API calls; add loading state to each view
* Make minimum viable RemoteComment
* Minimum vialbe RemoteIdentification
* Minimum viable remote project, place, and messages
* Create minimum viable records for all remote factories
* Remove factories for local device data
* Minimum viable local taxon, comment, id
* Minimum viable for local observation photo (photo has no primary key)
* Minimum viable LocalUser
* Minimum viable record for LocalObservation
* Flag Id Modal created.
* Flag item modal radio buttons, styling, cancel button
* Flag Item Modal, Api Flags file created
* Added id field in Identifications realm schema, Flag Item Modal API call
* Clear form, toggle function, click title not just checkbox to toggle
* Fixed android checkbox toggle.
* Clean up. Flag ID ObsDetail. Closes#301.
* Flag realm model, flagged status shown on initial load
* Refresh observation after item flagged. In Progress.
* Remove console logs, add onError
* save button loading spinner
* Realm 31 migration for obsservation updated_at
* Flags test file
* FlagItemModal tests
* FlagItemModal tests
---------
Co-authored-by: Amanda Bullington <albullington@gmail.com>
* Rename some functions and variables
* Rename function
* Revert to original timeout for tokens
* Get JWT for a 401 or 403 http errors in the react-query QueryClient retry handler
* Log API error to new logger
* Fetch token on every render in useApiToken hook
* Remove commented code
* Add comment
* Remove useEffect from useApiToken
* Revert "Remove useEffect from useApiToken"
This reverts commit 9cf1e0c0bc.
Primary bug was that requests to POST /v2/observation_photos were using the
obs serial ID instead of the obs UUID.
Another major problem was that uploads always quit before the last observation
when there were multiple observations to upload, which I address by changing
the way we set `allObsToUpload` in `useLocalObservations`.
Also added a signOut test helper... and maybe have introduced some problems
with parallel test execution as a result, as parallel jest runs don't seem to
totally separate with regards to the in-memory realm db. Something to think
about.
* Remove delete option for observations not in realm
* Add mutation for delete observation
* Hide delete option for observations not persisted to realm
* Close kebab menu when item pressed; this allows dialog to respond to first user
press
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
* Rewrite remote observation & update fetching using useQuery in ObsList
* Fix ObsList test by adding query provider
* Add padding to infinite scroll view indicator
* Only set next uuid for obslist if not still loading results from last api call
* Improve how ObsList works when observations don't fill screen
* Remove explore, explore provider, dropdown menu, and related screens; fix tests
* Move setIdBelow function into onEndReached
* Allow editing of existing id; remove unused id buttons; closes#230 and closes#231
* Remove unused text component & update IdentificationSection to tailwind css
* Remove unused obsEdit styles; convert styles to tailwind
* Remove unused bottom modal component and obsedit stylesheet
* Add comments to useEffect for opening local observation; convert realm object to JSON
* ObsEdit loads obs from db only when required
* Use observation update API call for observations already on the server
* Change wasSynced to instance method; only upload unsynced evidence
* Move keyboard aware scroll mock to jest.setup
* Await uploading evidence instead of returning a different response
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
* Show skeleton UI for comment and update with real comment from server
* Update styling in ActivityItem to use tailwind; fix code combining id and comment arrays
* Use tailwind styling in ObsDetails
* Styling updates; remove unneeded code from ObsDetails test
* Show loading wheel when comment submitted; clear comment box when backdrop tapped
* Remove console log
* Fix infinite loop when setting ids; return error from api so useQuery doesn't produce an undefined error
* Add throw option to fetchRemoteObservation so error is thrown when uuid doesn't exist
* Use authenticated query for search results
* Use search API for fetching places from Settings
* Use authenticated query for authorized applications
* Use authenticated query to fetch user.me
* Move fetch/search api calls into react query format, out of hooks
* Update with react query instead of hooks
* Fetch list of blocked and muted users with authenticated query
* Added Podfile postinstall block to get app running in a Simulator
* Use auth query in identify
* Upgrade @realm/react library to 0.4.0; fixes initialization error on android due to importing realm
* Use authquery for explore provider
* Use mutations for blocking/muting users, invalidating queries, and refetching settings data
* Add react mutation to create/update/delete api calls
* Use mutation for creating identification on identity/obs detail screens
* Use mutations to update and delete relationships
* Use mutation to revoke authorized apps
* Use mutation for updating user settings
* Fix ids on activity tab; fix safe area view; fix mark viewed
* Limit fields for remote observation api call
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
* Use authenticated query for search results
* Use search API for fetching places from Settings
* Use authenticated query for authorized applications
* Use authenticated query to fetch user.me
* Move fetch/search api calls into react query format, out of hooks
* Update with react query instead of hooks
* Fetch list of blocked and muted users with authenticated query
* Added Podfile postinstall block to get app running in a Simulator
* Use auth query in identify
* Upgrade Realm to 11.0.0-rc.0, most recent version that will work with RN 0.68.2
* Upgrade @realm/react library to 0.4.0; fixes initialization error on android due to importing realm
* Use authquery for explore provider
* ObsDetail wasn't showing the edit button for obs created while signed out
* simplified ObsEditHeader so it takes a full observation instead of relying
on the ObsEditContext
* ObsEdit now accepts an obs UUID as a param and loads that if the context
doesn't have a current obs
* null checks for API methods, mostly to prevent requests that won't work b/c
of missing params
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
* Start using React Query to make remote data requests
* Renaming, standardized error handling from API calls, moving code
* Fixed messages test; changed useQuery mocking approach
* React Query should only retry for network issues
* Tried using useAuthenticatedRequest on TaxonDetail
* Clear the React Query cache on sign out
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>