* UI changes to suggestions screen
* Update offline suggestions UI and allow refetch
* Allow user to search online suggestions with and without evidence location
* Add improve location button and refactor header
* Use loading screen correctly between location/ignore location
* Hide location permission button and code cleanup
* Fix test for suggestions changes
* Log the actual message we intended for JSON parsing errors
* Always use the configured tile URL instead of hard-coding it
* Use tiles.inaturalist.org whenever possible
When an Error object is passed to logger.error() as the last arg, this change
* extracts error_type and backtrace
* reports a shorter message that should be searchable
Also:
* Avoid double logging errors; ErrorBoundary should log errors in a way we can parse
* Added restart button to default ErrorBoundary; globalized text
* Add typescript parser and fix Flow errors in JS files
* Uninstall packages from react-native/eslint-config
* Fix all flow errors (or ignore them for unknowns
* Navigate user to Suggestions after Camera; add location check to usePrepareStateForObsEdit function
* Test that Camera advances to Suggestions when checkmark tapped
* Use vision result as top suggestion on Suggestions screen
* Write AR nav test; filter vision result from all suggestions list
* Show LocationPermission on camera screen; navigate back from ObsEdit
* Updates to flow so user can back out of ObsEdit to cameras
* Fixes
* Add evidence to existing observation when backing out of ObsEdit flow
* Fix tests
* Add mocks for worklet functions
---------
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
* Made react-native-logs post to API log endpoint
* Try to build a slightly more informative user agent
* Made react-native-logs post to API log endpoint
* Try to build a slightly more informative user agent
* Remove unused const
* Replace other usages of exported user agent
* Revert "Remove unused const"
This reverts commit 02389c8390.
* Revert removal of axios instance
* Strange order
* Remove device name from user agent
* Copy logstash transporter to new file and change to post
* Update import
* Remove comma
* Get the user jwt token as authorization for the log request
* Use anonymous token as app token
* Mock away logs config file because it now has a dependency on authentication
* Code style
* Typo
* Add timestamp field to form data, to show client_timestamp on the logs
* Add TODO
* Add a developer button to force a js-side error
* Add comments
---------
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
* Only requests remote taxon if local is missing or hasn't been synced in a
week
* Returns a localized version of the remote taxon immediately without waiting
to get a newly-created record from realm
* Expands tests to use a unique realm, integrate more of our code, and check
to ensure the API gets called
* Show indicator while loading taxon on ARCamera
* Show iconic taxon found in model results if we can't load a remote taxon
* Show iconic taxon as backdrop for ObsImage whenever possible
Replaces account settings with a small set of settings and a web view to show settings on the website.
Also
* Minor taxon detail fixes
* Display taxon name on observations according to the current user's
preferences, not the observers
Closes#927
---------
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
* Add string
* Add a state that signifies syncing in progress
* Rename state as it no longer only pertains to uploading
* Set flag on button press
* Fix bug with wrong number of obs to upload shown
* Update MyObservations.test.js
* Add 1 to param for human readability
* Update MyObservations.perf-test.js
* Update ToolbarContainer.test.js
* Reintroduce number of finished uploads
* Update comment
* Use animation for gallery loading screen
* Added basic navigation test for StandardCamera & SoundRecorder
* Abstracted camera nav buttons and used in SoundRecorder
* Show sounds in the MediaViewer
* Added sounds to ObsEdit, w/ MediaViewer support
* Ensure sounds get both uploaded and added to observations
* Local sound deletion
* Remote sound deletion
* Rudimentary and deeply unperformative sound visualization
Closes#869
* Shows indicator in tab bar when you have new updates
* Should update every minute
* Make unread updates indicator go away when you view the updates
Closes#900
---------
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
* Delete local & remote observations on MyObs; show progress
* Update tests & add test for delete hook
* Fix test failures
* Add tests for deletion strings in Toolbar; add test for multiple deletion
* Clear deletion text on toolbar when user navigates away from MyObs
* Add a check in e2e test to make sure observation was deleted
* Update iNatjs
* Add webshell dependency
* Basic announcement fetching component
* Styling
* Dismiss function
* Error handling TODO
* Add param
* React to link presses
* Missing code
* Add unit test
* Add string
* Refactor search query and dismiss to use react-query
* Activity indicator when refetching
* Add query provider to test
* Mock component in other integration tests
* Move user agent to api
* Throw error instead of logging
* Shows notice when user or obs is opted out of Community Taxon on ObsDetails
(closes#882)
* Unifies mapApiToRealm methods around a single interface
* Ensure that the remote obs used on ObsDetail is normalized to look like a
local obs
* Ensure some tests that use signIn() have isolated Realm instances
* Update current user's obs from ObsDetails (closes#1045)
* Fixed CC0 license display on ObsDetails (was not actually related to
updating the local copy of the obs
* Changed the default React Query retry handler to be synchronous; being async
meant it returned a promise, which React Query interpreted as true-ish,
which meant it retried forever
* React Query retry handler should log info about its query key, which should
make those problems a bit easier to debug given a log
* Prevent useObservationUpdates from throwing errors when network requests
fail, which they always do while offline
* Added our own ErrorBoundary that shows a component trace
* Prevent several uses of useAuthenticatedRequest when not online
* Work around bug in vision-camera-plugin-inatvision where it can't get
dimensions of photos in Android
* Actually throw errors when vision-camera-plugin-inatvision's predictImage
throws unexpected errors
* Allow online suggestions while signed out using anonymous JWT
* Only show agree button on first taxon displayed; show on all ranks
* Show agree button only on first taxon displayed; show agree for ranks above species; closes#566
* Fix test
* 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.