* Don't require TS extensions in imports
* Resolve all import extension errors
* Remove file extension from import paths used in mocks
* Remove .d of type definition file paths
* Remove .d of type definition file and import as type
---------
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
* Reorder conditions
* This does not really do anything because the option
keys have different names
* The Add Location CTA should always ask for permission
The only state we show the Add Location CTA is if the observation does not have a location when landing on ObsEdit.
* Use an initial state wether an observation should watch users location
In this case we can override the state to true whenever we want to force the app to watch the location.
For example when the user grants location permission on the screen we want to watch no matter where the user came from.
* Remove unused or nowhere imported functions
* Use same navigation on Match as ObsEdit does
* Always ask for permission when the MyLocation button
is pressed on the map
* Add a loading state to the "Add Location button"
* Update import
* Import realm models as types
* Remove unused import
* Add function param types
* Add function param types
* Rename param for consistency
* Remove unused function param
* Type param
* Update type
* Add TODO
* Import function param type
* File rename without change
* Update imports
* Add some fct types
* Add fct param types
* Add function param types
* Update ObservationPhoto.ts
* Remove unused param
* Type fct param
* Add type
* Remove unused param
* Update comment
* Add fct param type as accessed by local context
* Add types from what is accessed in function
* Add types
* Remove unused types
* Add basic type, as is used in local context
* Bring require statement back
* Import other function param types
* Add property types
* Fix wrong extends
* Assert inputs and outputs for mapping a local observation photo to server action
* Update unit tests for errors
* Rename file
* Update imports
* MOB-711 - add location for better IDs change
* Various fixes according to PR feedback
* Make button fill all available space
* Change padding to margin
---------
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
* 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>
* Rename file
* Use PressableProps interface for PressableWithTracking
* Remove TODO
* Update handleLayout types
* Update allowed prop type
If SuggestionsResult can have ApiTaxon | RealmTaxon, we have to enable it in DisplayTaxonName as well, and rank_level can be undefined according to this union.
* Allow null
accessibleTaxonName uses currentUser directly from useCurrentUser which can be null.
* Use as to declare which type is used
* Source might be null
* 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)
* Populate taxon in AICamera -> ObsEdit with AICamera suggestion
* Make sure we're only displaying predictions we already showed on AICamera
* Make suggested changes from PR review
* Add more types
This is necessary because the representative_photo returned by the image similarity search from API is fleeting only (e.g. from useOnlineSuggestions -> useSuggestions -> suggestions.topSuggestion).
The key is not saved to realm with the taxon because it only is relevant to the current photo scored on the API.
Therefore when overriding the taxon info with offline data we need to keep it.
* 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
* Code indentation
* Additional case of returning a UI. For when no top suggestion.
* Basic layout
* Refactor MatchHeaders fallback title to the higher components fallbacks
* Add string
* Add header for when no top suggestion (but others)
* Additional suggestions section
* Different header for additional suggestions section
* Update header padding according to designs for all match UIs
* Update padding between add suggestions header and scrollable list
* Correct margins for no suggestions UI
* Add location button also to no suggestions state
* Correct margin for location button on match with top suggestion
* Correct margins for location button in no top but other suggestions UI
* Use wrapper for additional suggestions scroll to set margin
* Correct margin left of additional suggestions scroll
* Hide button while loading
* Increase margins for text in no suggestions state
* Less margin left of scroll
So, in a case of having no top suggestion but low confidence additional suggestions we show all UI available for the match screen, so that a user can potentially also improve them by giving location permission.
* use useWatchPosition for location fetch
* Fix latitude check, add shouldFetchObservationLocation to check for evidence
* Update Podfile.lock
* Update MatchContainer.js
---------
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
* Undo a change I made in an earlier branch
* Add online skipped state
Integration test of UnsyncedObservations is checking the onlineSuggestions hook with setting NetInfo's isConnected to fasle. The assumption there is that the score_image API is not even hit in such an instance.
So, we also need a skip state for online suggestions.
* Define const in other component
* Separate out online and offline loading state
* Add type
* Add debug data
* Also call fetchError when netInfo says we are offline
* 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>
* Removes location picker from match screen, fetches user location and reloads suggestions instead
* fix variable name
* Remove unused prop
* changes requested, changes to fetching place guess, changes to refetch offline
* Close permission gate when permissions denied initially
* change toggle to set in reducer
* add optional chaining to location values
* Add optional chaining for place name
* Closing on initial block optional
The function of closing the permission gate on pressing the initial block button was as far as I can see only scoped to the Match container.
---------
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
* Show simple my obs header only for logged-in users
* ActivityCount TS
* CommentsCount TS
* IdentificationsCount TS
* ObsStatus TS initial pass not looking at errors
* QualityGradeStatus TS
* Update RealmObservation interface
* Update RealmObservation interface
* ObsUploadStatus TS, plain copy, no errors yet
* Update types
* Update type
* IconicTaxonIcon TS
* ObsImage TS
* PhotoCount TS
* ObsImagePreview TS
* Image is only opaque when logged in
* DateDisplay TS
* Remove debug flag from UploadObsStatus
* Update type
* Prop to hide ObsUploadStatus
* Test observations need those otherwise they appear as needing edit
* Update imports