* 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
* Add method to get innerPhotos array
* Rename component
* Get list pf photos in suggestions
* Add Media viewer modal
* Rename prop
* Update MediaViewer.test.js
* Update test IDs
* Show observations by defaulting to user location
* Remove log
* Create useHeaderCount hook to load user location count before global count
* Header count and location permission fixes
* Remove log
* Fix Explore tests
* Test fixes and add blocked/denied state
Additionally,
* Adds tests for ID withdraw and restore
* Renames withdrawOrRestoreIdentification function for clarity
* Adds some accessibility labels for testing and accessibility
Closes#1129
* Add a safeRealmWrite transaction for better logging around writes; code cleanup and realm update
* Add safeRealmWrite to tests and make sure action is called synchronously
* Fix final test
* Only write to realm when useObservationsUpdates data changes; code cleanup
* Code cleanup
* 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
* Extracted non-photo stuff from PhotoDisplay
* Separate component for FaveButton
* Prevent faves while signed out
* Separate component for nav header
* Stick nav header while scrolling until tabs
* Nav header has slight gradient for visibility over white content
* Renamed ObsDetails media components so they're not focused on photos
* Data and layout changes leading up to sound player on ObsDetail
* Add sound player to ObsDetails
* Swiping away while playing should pause playback
* Swiping back to sound and playing again should resume where you left off
* Allow viewing media while offline (images may be cached)
* Stop playback when navigating away from ObsDetails
* Fetch sounds in Explore so we can show sound icon
* Map all observation objects in explore with Realm-ish attributes
* 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
* use showSwitchMapTypeButton option in Location Picker and ObsDetails map
* title of comment bottom sheet to "Add Comment"
* fixed position of current location button on map
* text of geoprivacy on ObsDetails to "Geoprivacy: Open"
* don't load offline suggestions while loading online
* 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
Syncing was broken when an unsynced obs was deleted
The main problem here was that MyObs state has a list of observations that
need upload, but since it was a plain array of Realm objects it crashed when
one of those objects was invalid, which happened after deletion. This fix
isn't great: it just makes it so the thing in state is a Realm.Results
object, which will update dynamically when its underlying data changes. We
could also JSONify what we have in state, but then you get into problems of
nested objects and deep JSONification.
Also
* Delete local obs if remote doesn't exist
* Bugfix: ObsDetail tried to mark non-existent remote obs as viewed
* Tried to handle react query retries better
* 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.
* 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
* Show edit title; add tests; set current obs before nav to ObsEdit screen
* Use edit title when obs is not synced; rewrite ObsEdit tests to show nav works correctly with useStore
* Remove uuid in params to ObsEdit; no longer needed
* Fix e2e by ensuring ObsEdit doesn't rerender with deleted obs
* 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
* Add zustand to app
* Begin replacing ObsEditProvider with zustand for global state
* Use store and add tests
* Fix bugs
* Add test to check for deleted photos in StandardCamera
* Make sure evidence is only added to current observation; submit comment with ID on ObsDetail
* Fix ObsEditWithoutProvider tests
* Move store to where it's needed
* Fix tests
* Await evidence being added to obsPhotos from camera
* Add a note about slices to useStore
Fixes#907. Also adds an ObsEditOffline test for adding a new obs offline...
which doesn't actually catch this bug, but may catch others. This bug may
have been due to a race condition that doesn't happen in the test env for
some reason.
* 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
* Update to realm 12
* Remove unused mocks to fix some tests
* Fix test by unmocking ObsEditProvider
* Fix more tests by removing mocks/changing when tests write to realm
* Remove mocks on ObsEdit component test and fix accessibility labels
* Fix hooks tests with realm
* Set test path for realm; finish fixing tests
* Small tweak
* Upgrade realm/react library
* Migrate schema
* Simplify ObsEditProvider by moving functions into local state & calling reducer less frequently
* Fix delete all observations
* Fixes
* Move index selection to MediaViewer via params
* Access ObsEditContext on top level of ObsEdit and pass props
* Move context to top level screen components
* Fix tests
* Use waitFor to fix ObsDetails integration test
* Alphabetize props; remove realm check; refactor new Id method
---------
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
* Move upload functionality into MyObservations, out of ObsEditProvider
* Move upload into helper function
* Fixes for ObsEdit -> MyObs flow
* Progress on making uploads faster
* Update performance test
* Fix toolbar progress
* Fix tests for observation upload flow
* Fixes from code review; fix e2e test for signed in user by bypassing permission gate
* Hide sign up test when keyboard visible; fixes Android e2e test
* Comment out permissions code in e2e test to see if it's only needed locally
* Comment out permissions gate for signed out user iOS
* Use focused hook to stop ObsEdit from rerendering while user is on other screens
* Restore reassure in branch
* e2e code cleanup
* Remove console statements in production build
* Move uploadReducer into separate file
* Create reducer for creating obs; combine reducers
* Fixes with createObsReducer
* Move album, passes test states out of global context
* Bug fixes for ObsEdit flow
* Create photo gallery container
* Set accessibility test todo for PhotoGallery
* Improve FlashList performance MyObs
* Prevent flicker on modal close
* Create less rerenders in MyObservations
* Memoize drawer items for less rerendering
* Memoize custom tab bar
* Remove unused libraries and update snapshot
* Fix and prune dependencies
* Add AddObsModal tests
* Fix e2e test android by making comment confirm button visible
* Bugfix: navigation was broken when choosing a taxon on Suggestions
* Test for Suggestions navigation
The thorny part here was isolating the test Realm db. We should really have a
generalized strategy for this, but this works for this task.
* Add unit tests for Toolbar upload progress
* Tests and improvements to upload progress bars
* Fix tests
* Update type for showsExploreIcon
* Fix tests
* Clear realm before MyObs tests
Primarily adds designed layouts for permission gates (also referred to as permissions priming).
* moved permission gate business logic into a container
* use react-native-permissions exclusively
* Show PermissionGate as a modal
* Basic unit tests for PermissionGate
* Consistent content width on tablet, other minor style changes
* Allow PermissionGate to be used outside of nav hierarchy
* Use user location on Explore after getting permission
* Remove redundant 'always' location perm in ios
* Isolate current location button in the Map component, which uses location fetching functionality from react-native-maps instead of our own
* Updated cocoapods; matched INatIcon.ttf to sha1 hashes
* Use drag and drop to let a user change photo positions
* Fix tests
* Add test for EvidenceList
* Fix tests
* Fix state for no evidence / no observation photos
* Add unit tests for empty list and displaying obs photos
* 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