* Update tooltip trigger logic in AddObsButton for logged in
Refines the tooltip display conditions for AddObsButton. Now shows the tooltip for logged-out users after their second observation, and for logged-in users with 50 or fewer observations upon landing on the My Observations screen. Adds comments for future handling of users with more than 50 observations.
* Refactor the state justFinishedSignup into the layout store slice
* Refactor trigger logic and add conditions for when the tooltip would overlap with pivot cards
* Move files
* Basic AddObsButton unit test
* Add mock for addListener
* Basic test for tooltip
* Add tests for two conditions that require a card dismissal
* Wrap setState in act in helper function
* Update navigators and create util for tabstack navigation
* Changes for react navigation 7
* Refactor to use navigateToTabStack throughout app
* Add comment about unmountOnBlur
* Get all unit tests passing; remove navutils & mock HeaderBackButton
* Fix animation issues in tests
* Temporarily remove parts of tests with back functionality
* Fix tests
* Delete ios/iNaturalistReactNative.xcodeproj/project.pbxproj
* Fix pbxproj
* Code cleanup; minimize unnecessary changes
* Fix tests
* Downgrade react-native-screens to v4.4.0 (#2918)
react-native-screens version 4.5.0 increases the react native version that it supports to 0.74.0+ (https://github.com/software-mansion/react-native-screens/pull/2613/files). So, by using 4.4.0 we are still able to build the app on Android as we are still on 0.73 for now (have tested and it works).
Have not seen any effect on the changes related to the latest react-navigation versions.
* Make requested changes
* Speed up Explore nearby tile loading (#2912)
* Create a performance tracker to show urltile load time in debug mode
* Set default radius to 1km, not 50km
* Code cleanup & TypeScript definitions
* Fix TypeError
* Address eslint error
* Make github actions happy
---------
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
* New Crowdin translations by GitHub Action (#2920)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
* MOB-690 - Add error context to 401 errors (#2921)
* MOB-690 - Add error context to 401 errors
* Add Object.defineProperty like in the other error classes
* Add logger line
* Also throw 401 error if the error object has no response property
---------
Co-authored-by: Yaron Budowski <budowski@gmail.com>
* v1.0.4+164
* Rebase with latest version of RN screens. Remove unused code and packages, add eslint package for TS, suppress TS errors (#2924)
* New Crowdin translations by GitHub Action (#2926)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
* New Crowdin translations by GitHub Action (#2929)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
* Use 3 separate initial routes for tabs; hide animations on drawer screens
* Fix test
---------
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
Co-authored-by: Ken-ichi <kenichi.ueda@gmail.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: Yaron Budowski <budowski@gmail.com>
* Change default MyObs layout to grid
* Rename testID
* Update tests expecting to start with list view
* Reverse order of buttons in layout selector
* Fix layout bug of having empty boxes on explore
* Use system locale on install
* Check for system locale when app comes to foreground (required in Android
b/c app doesn't get restarted when system locale changes)
* Create a constant of SUPPORTED_LOCALES in loadTranslations.js
* Restart app on sign out
* Use existing transaction when writing to Realm if available (might also
consider an approach that waits for the existing transaction to complete)
* Make value returned by useCurrentUser actually reactive
Closes#2243
* Write some failing navigation tests for MyObs navigation
* Add one more failing test to check for empty screen after all obs are deleted
* Update what happens on blur
* Changes to focus effect
* Revert "Changes to focus effect"
This reverts commit c779504cdf.
* Test: toolbar status reset when user leaves screen
* Unmock useFocusEffect in Jest; fix tests
* Minor nav mocking updates
* Fix import
* 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
* 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
* 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
* 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
* 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
* 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
* Mock INatPaperProvider to remove warnings about wrong icon names in jest; closes#421
* Remove unnecessary paper provider mock
* Add mocked views back to tests
* 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.
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>
* Fetch user from server, set locale in realm and change language with i18next
* Added some Spanish translations so I can see localization working
* config QueryClient with `cacheTime: Infinity` to deal with "Jest did not
exit" errors
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>