* Use updated version
Version 3.16.0 introduces support for RN 0.76. 3.16.7 introduces support vor RN 0.77 so I decided for 3.16.6 for now.
* Update package-lock.json
* Update Podfile.lock
* Update UploadStatus.test.js.snap
* Comment out snapshot tests
* Comment out snapshot tests
* 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>
* Revalidate jwt token before uploading observation and before attaching media
* Add logging to uploads and jwts
* Make logs more useful, add context and appstate
* Fix inat uploading mocks in tests
* Fix uploader test to reflect errors being thrown
* Update react-native-safe-area-context-to >4.10.1
Version 4.10.1 adds support for react native 0.74.
* Re-establish mock after it was reset
I think the better way forward would be to restructure these tests, so that we don't need to resetAllMocks in between the two describe blocks, but I don't want to increase the scope of this PR.
* Split apart observation & media uploaders & add unit tests
* Use typescript
* Return only media items needed
* Fix tests related to uploading vs. uploaded status
* Remove undefined from union for observationUUID
Above and below in the callstack of those functions the type is only string, so that change seems to be fine for me to make directly on your PR.
* Extract an Operation interface (#2904)
* Type updates
* Update mapped param types
---------
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
* Add Boolean to control button being shown
Same Button component, only with changed indentation
* Apply margin between buttons to hide button instead
* Move left margin to container
Because ID button is now optional but container is not.
* Increase margin between buttons
Not part of the ticket, but it was not according to designs.
* Use existing state for the button
* Update integration test
* Update duplicate testID
* Add unit test for showing button behaviour based on photos
* Rename file
* Migrate flow to TS
* Update type
* Update type
* Rename file
* Update useTranslation.ts
* Check if instanceof Error
* Update imports
* Update type
* Rename file
* Migrate translatedRank to TS
* Migrate DisplayTaxonName to TS
* Also accept number for taxonId
* Those types are currently not optional
* Revert "Migrate translatedRank to TS"
This reverts commit c69cc18061.
* Rename taxon.js
* Add interfaces and types
* Remove adding a key to the function param
* Move fetchTaxonAndSave back to original file
* Move interface
* Update import
* Update types
* Rename some variables for clarity
* This is how it currently props down from only HOC
* Update imports
* Rename file
* Add param interface
* Update imports
* Revert "Move fetchTaxonAndSave back to original file"
This reverts commit 981ce228e8.
* Move fetchTaxonAndSave to own file
* Type inference is easiest way for React components
* Rename file
* Remove unused props
* Add types
* Update type
* Infer return type
* Update import
* Add interface
* Rename const and interface
* Update import (Merge conflict)
* Create module for realm syncing and write unit tests before refactoring
* Refactor realmSync functions for readability & make sure realm errors aren't silently swallowed
* unit tests
* Update tests to use factory functions for media
* Update tests to use factory
* Remove sanitize function since it's redundant with mapping; move mapping & add unit tests
---------
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
* Create module for realm syncing and write unit tests before refactoring
* Refactor realmSync functions for readability & make sure realm errors aren't silently swallowed
* Move error handling to its own module and add unit tests
---------
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
* Create module for realm syncing and write unit tests before refactoring
* Refactor realmSync functions for readability & make sure realm errors aren't silently swallowed
* Break progress tracking out into module with unit tests
* Show upload status also if we have no status but an error
E.g. if all uploads fail.
* Change number of successful upploads
Now to use number of attempts made minus number of failed uploads.
* Add unit tests
* Refactor state of successful uploads into store
* Set default explore view to observations
* Rearrange ObservationsViewBar buttons to always show grid first and map first in Explore
* Set initialRegion of Explore map to same zoom level as location picker, using delta
* Consolidate map code into MapView with ref forwarding to allow animation & initialRegion set
* Stop controlling the map region from zustand, since we're using initialRegion
* Make sure we're not double animating when navigating to a new place
* Use ref to only get map boundaries exactly when they're needed, instead of tracking in state
* Make sure current location button does the same as NEARBY button
* Update Explore integration tests to reflect observations view as first view
* Fix navigation Explore tests to reflect landing on observations view
* Update MapView unit tests
* Check location permissions in MapView on current location button
* Code cleanup
* Fix tests and add test for location permissions
* To Mob 720: add some types and null guards (#2878)
* Update Map with Region type
* Type initialRegion
* Guard against null
* Guard against undefined coordinates
* Center loading indicator but not fill space (#2880)
Move the loading indicator to the center of the parent (and back left and top for half its size).
---------
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
* Add debounce to Button to make sure users can't double tap any buttons / navigate twice
* Fix tests by mocking the Button component with a quick debounce
* New Crowdin translations by GitHub Action
* test: handle multiple matches for localized text in Settings test
---------
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
* Open more options on long press
* Add tests for long press
* Rearranging Settings screen with new layout
* Add toggle for advanced settings in layout slice; fix default mode toggle
* Update settings with navigation flows
* Fix tests
* Change power mode switch for e2e test
* Fix settings test for green button toggle
* Fix advanced user toggle in e2e test (which hides pivot cards)
* Changes based on design convo; test fixes
* Fix e2e tests
* Follow user flow chart and update nav accordingly
* Rename function
* Fix test
* Can be null so check for false only
* Little less spacing between radio button rows
* Minor UI updates
* Remove check for previous setting in UI
* This is no longer used anywhere
* Update AICamera.test.js
* Update AICamera.test.js
* Update AICamera.test.js
* Update Suggestions.test.js
* Update Settings.test.js
* Update LanguageSettings.test.js
---------
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
* Text updates and AICamera icon update for onboarding carousel
* Update background image camera permission
* Update text for permission gates
* Update text match screen, login signup, and camera
* Fix AICamera test
* Update TypeScript
* Fix some tests with new default MyObservationsSimple
* Show upload toolbar on MyObs advanced
* Update tests for simple mode
* Fix deletions popping back up on MyObs
* Fix e2e test, which also means fixing our deletion process
* Fix useSyncObservations test
* Requested changes to better fit latest designs
* Add tests to check for hidden upload banner
* Use work queue to store local taxon name preferences & update when user goes online
* Do less updating on Settings screen
* Add logging to make sure taxon names are set correctly
* Test for TaxonNamesSettings
* Prop number in from direct and single HOC
* Prop num in from even higher
* Calculate number of unuploaded obs with missing basics
* Only show upload indicators when number of obs without missing basics is positive
* Send obs uuids with missing basics to button press handler
* Instead of reacting in useEffect call syncManually explicitly
* Accept array of uuids to skip and pass on to startUploadObservations
* If param given do not include some uuids when building upload queue
* Remove test
* Change param interface to options object
* Destructure only if param given
* Use fixed header on ObsDetails advanced mode
* Remove test for removed component - using react navigation header instead
* Remove tests related to ObsDetails header icon; using react navigation
* Add testID to react navigation level back button and fix e2e
* Terminate app after every e2e test and maybe help flakiness
* Rework termination of app
---------
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
* Only add zoom options if camera device has the actual physical devices
* Fix mock
* Add mocks to unit test
* Revert "Add mocks to unit test"
This reverts commit 0738d2b115.
* Optional chaining
* Alternative return for match screen in absence of suggestion
* Add lower part text elements
* Add margin at bottom
* Copy code to make a new suggestions scrll for iconic taxa
* Removing not needed properties of the copied code
* Remove log
* Remove width constraints
* Add a state to track selected iconic taxon
* Comment and code style
* Pass prop down to taxa scroll
* Use new props in iconic taxa scroll
* Color border according to selected state
* Use iconic taxon as top ID if none given
* Remove testing code
* Update Match.test.js
* Build UI for loading state between AI->Match
* Make designs for AI loading screen match Figma
* Selective changes from bf872e2d4f
* Selective changes from 9ed81f99c7
* Selective changes from 4bc7c3474f
* Selective changes from 4916cf70fb
* Replace loading state from store with props
* Add some types
* Make component agnostic of what skipping does
* Remove debug info
* Add more debug data
* Elongate loading state if online errors out and offline is still loading in sequence
* Remove underline
This classname had no effect as far as I can tell.
* Hide skip button when it has no function
* Remove a comment that slipped through partial cherry-picking
* Split apart online and offline fetch status
Weird but even though they start in sequence it happened to me that online error was received after offline was fetched successfully. So, Let's split apart online and offline loading state.
---------
Co-authored-by: Amanda Bullington <albullington@gmail.com>