Commit Graph

480 Commits

Author SHA1 Message Date
Ken-ichi
899076e67a Only ask for permission to add photos from cameras (#1869)
* Patch camera roll to not ask for readwrite after addonly granted
* Only request add permission from cameras
2024-07-29 11:51:14 -07:00
Amanda Bullington
182196a205 Change url for connectivity check (#1868)
* Change connectivity url to ping inat; remove unnecessary useIsConnected hook; closes #1770

* Ensure inaturalist.org/ping is being pinged

* Fix e2e tests by using isConnected, not isInternetReachable
2024-07-26 20:16:32 -07:00
Amanda Bullington
4beda5691c Use DisplayTaxonName component for disagreements (#1865)
* Use DisplayTaxonName as component in Trans to show DisagreementText

* Use DisplayTaxonName for top of disagree sheet

* Use DisplayTaxonName styling in radio button labels

* Remove italic from disagree text

* Add testing for DisplayTaxonName with plain text and scientific name only
2024-07-26 16:39:06 -07:00
Amanda Bullington
b61ff38f7c Reset stack when user navigates from AddObsModal (#1858)
* Reset navigation stack when user navigates from AddObsModal; closes #1857

* Fix AddObs nav test
2024-07-25 09:58:54 -07:00
Johannes Klein
b6ea37e7e2 Add reset button to Explore searches for taxon, user, and project (#1836)
* Add reset button to set user to null

* Update type

* Update project to be null with reset button

* Reset button to set taxon to null

* Fix test for null now

* Project can also be null now
2024-07-25 15:06:22 +02:00
Amanda Bullington
5c1a5142a4 Load suggestions with location after permission granted (#1846)
* Refactor into useReducer

* Use reducer for Suggestions

* Offline working

* Progress on getting location permissions button to work as expected

* Code improvements

* Fix photo deletion test

* Fix AICamera nav test

* Ensure suggestions location permission uses location immediately

* Loading wheel fixes

* Fix photo deletion test

* Use online result to advance to obsedit in PhotoDeletion

* Fix test by using online mock
2024-07-24 22:19:05 -07:00
Angie
27912676dc Loading wheel to explore filters searches (#1840) 2024-07-23 20:04:13 -07:00
Amanda Bullington
fbd22f9e9d Fix location toggle on Suggestions (#1833)
* Fix Suggestions test & create test for online suggestions with location

* Fetch location according to toggle

* Update tests

* Show loading & remove prev queries when toggling location

* Fix loading test
2024-07-22 06:44:35 -07:00
Johannes Klein
b655c896cc Increase width of upload circle to 2.5 (#1835)
* Increase width of upload circle to 2.5

* Update UploadStatus.test.js.snap
2024-07-22 15:38:56 +02:00
Amanda Bullington
c3c98deeda Create new obs when backing out to AICamera (#1832)
* Write test to confirm only one obs photo added when backing out of AICamera

* Create new obs when backing out to AICamera; closes #1822
2024-07-19 09:57:16 -07:00
Amanda Bullington
59959317d7 Fix photo deletion test (#1830) 2024-07-19 07:47:59 -07:00
Amanda Bullington
90a803d55b Only show select button when coming from Suggestions/Search; closes #1813 (#1829) 2024-07-18 13:55:33 -07:00
Angie
6cd952d733 1747 taxon detail spacing UI fix (#1823)
* taxondetails title ui adjustments

* update snapshot
2024-07-18 10:07:58 -07:00
Amanda Bullington
92cafdde83 Land user on Suggestions when one photo imported (#1824)
* Create navigation test for PhotoGallery

* Code and test land user on Suggestions when one photo imported
2024-07-16 14:47:02 -07:00
Amanda Bullington
abd4bcee23 Refactored location fetching for accurate locations (#1788)
* Refactor to use watchPosition

* Update useWatchPosition with permissions/retry

* Replace useUserLocation with useWatchPosition and fix tests; return userLocation from watch position hook

* Only update observation keys when there's an observation

* Improve TypeScript definitions

* Revert TypeScript commit

* Revert "Only update observation keys when there's an observation"

This reverts commit a4cd17a513.

* Code cleanup: make useWatchPosition more modular

* Code cleanup; location permission in ObsEdit instead of subcomponent

* Use correct accuracy in Camera photos

* Camera fixes

* Fixes to watching position in ObsEdit

* Fix useWatchPosition tests

* Fix tests

* Make sure state updates when renavigating to OsEdit; test fixes
2024-07-16 09:23:09 -07:00
budowski
656a1c6bf3 #1104 - when searching for taxon, use the general /search endpoint (#1717)
* #1104 - Taxon search - use general search endpoint (not taxa/search endpoint)

* Linter fixes

* Updated inaturalistjs library to v2.12.0

* Test fix

* Further test fixes

* Linter fixes
2024-07-15 17:34:00 -07:00
Ken-ichi
934e486402 Hide skip ID button on Suggestions sometimes (#1791)
* Hide skip ID button on Suggestions sometimes

We only want to show the text "Add an ID later" when one needs to move forward
without adding an ID, so this hides it

* When reached from ObsDetails (you can go back)
* When reaced from ObsEdit and there is an existing identification
  (you've already added an ID so if you're editing it you need to choose a
  taxon or back out)

* Update test

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2024-07-12 13:34:27 +02:00
Johannes Klein
a52996f535 Changes to the way permissions are asked for (#1793)
* Replace name in permission requests

* TakePhoto TS

* PermissionGate TS

* Type

* PermissionGateContainer TS

* Interface

* Types

* LocationGate TS

* Remove LocationPermissionGate from Camera

* Remove write only permission

* Type

* ObsPhotoSelectionList TS

* Code style

* Show the improve with location button

* Create useLocationPermission.tsx

* Use new hook on suggestions

* Doc comment

* Use new hook in camera view

* Add strings

* Refactor Explore main content

* Use permission hook on RootExplore

* Add no location permission component

* Rename function

* Prop request permissions and use with button

* Default to Nearby label

* Remove Node type

* Projects TS

* Use useLocationPermission hook in projects screen

* Add string

* Prop permission down

* Refactor list render

* Refactor tab id into enum

* Tab type

* On nearby tab if without permission show button to prompt

* Leftovers

* Remove location permission gate from ObsEdit

* Use location permission hook on evidence section

* SearchBar TS

* Do not autoFocus on search bar in location picker.

Closes #1743

* Update type

* LocationSearch TS

* Show location permission gate on location picker's mount

* Add location permission to CurrentLocationButton

* Remove unused props of Map

* Remove unused exports from useMapLocation

* Migration

* Revert "Show location permission gate on location picker's mount"

This reverts commit 30ff75698c53d54d0b14cd2bd629f7155b743bf8.

* Add callbacks to useLocationPermission hook

* Show location permission ask on Obs Edit

* Remove unused string

* Reset explore filters should set location always to worldwide

* Add helper function to show place text in Explore

* Remove unused state of filter modal

* Show place text in filters modal with helper

* Show location permission button only for Nearby explore state

* Add a placeMode state

* Do not send placeMode to API

* Also treat limited permission as yes

* useLocationPermission in ExploreLocationSearch

* Refactor to setting place mode

Instead of logic based on the translated text of the place_guess string that is stored in ExploreContext, we are switching to an enum state that signifies which mode to show on explore:
1.) Nearby: Filters explore results based on the user's location. This also has a state without location permission that does not query the API.
2.) Place: Filtering by a specific place (as retrieved by /places API).
3.) Worldwide: Retrieve worldwide results, i.e. not having a place filter set.
4.) Map area: Filtering explore results precisely to the map rectangle shown on the explore map.

* Remove import from test

* Remove export

* Use blocked title only for blocked permission asks

* Move gallery permission container to Tab navigator as are the others

* Add gallery save title

* Split location permission explanation into two

* Update strings.ftl

* Only nav to location picker if permission was not  granted

* Check permission on app being foregrounded

* The location permission part is handled by useLocationPermission

* Do not store permission result in hook

* Use hasPermission from permissions hook

* Update fetchUserLocation.e2e-mock

* Move hook one higher

* Show user location if permission is given

* PermissionGate callbacks should use useCallback

* Add permission hook to map usage

* Fix test

* Update layout to be asserted

* Add location permission hook to Explore

* Remove console.log

* Few TS fixes

* Indentation

* Remove superficial check

* Update Podfile.lock
2024-07-12 11:00:24 +02:00
Angie
b55db96db8 1723 agree button should not appear while signed out (#1792)
* Agree with id button does not show when logged out, test added

* updated pod

* Fix failing test
2024-07-11 12:38:10 -07:00
Ken-ichi
fe0229291e Restore photo deletion (#1789)
* Restore photo deletion
* Rename methods for accessing media files
* Added integration test for photo deletion
* Cleaned up some accessibility labels

Closes #1429
2024-07-10 15:23:53 -07:00
Amanda Bullington
ce39b03495 Changes to showing select taxon button & vision attribute; closes #1773 (#1790) 2024-07-10 13:18:27 -07:00
Ken-ichi
50d9d1e60c Media clearing (#1771)
* (Re-)Fix bug where shared photo got deleted before it could be used
* Only run cleanup when MyObs has focus
* Only run cleanup once a minute
* Only delete files that are a day old or more
2024-07-05 21:33:52 -07:00
Ken-ichi Ueda
5ffe9e487d Bugfix: adding an ID from ObsDetails was landing on ObsEdit 2024-07-05 16:19:00 -07:00
Ken-ichi
e747b37a8f Push TaxonDetails onto nav stack in Taxonomy section (#1767)
* Refactor useCallacks into components
* Push TaxonDetails onto the nav stack in Taxonomy section

Closes #1735
2024-07-03 17:25:58 -07:00
Ken-ichi
61cbbc9ac1 Show all obs photos in StandardCamera preview (#1765)
* Show all obs photos in StandardCamera preview
* Clear camera Zustand state after saving photos as ObservationPhotos
* Load Photo URIs into Zustand state when entering the camera
* Rename rotatedOriginalCameraPhotos to cameraUris to match galleryUri and to
  save us all a few keystrokes
2024-07-03 17:25:24 -07:00
Amanda Bullington
452ebcbdf4 Navigate user correctly with selected ID when coming from TaxonDetails (#1766) 2024-07-03 16:29:46 -07:00
Ken-ichi
591d6dc0e5 DQA voting status (#1757)
* Readability / cleanup updates for DQA
* Moved from unnecessary use of useMutation to useQuery for fetching metrics
* Log API errors
* Avoid warnings in tests about updates outside of act
* Update header in DQA after vote changes quality grade

Closes #1504
2024-07-03 10:08:47 -07:00
Johannes Klein
230646e2ae 1684 explore map null (#1760) 2024-07-03 16:33:08 +02:00
Amanda Bullington
f95e73c27f Default to iconic taxon image in TaxonResult (#1759)
* Show iconic taxon instead of loading wheel in TaxonResult

* Fix tests; closes #1739
2024-07-03 06:54:05 -07:00
Amanda Bullington
fca249c655 Show bottom sheet before confirming suggested ID in ObsDetails -> Suggestions flow (#1728)
* Allow user to open add comment sheet from another modal

* Code cleanup

* Add suggest ID bottom sheet to test

* Change names of test IDs in signed in e2e test for TextInputSheet
2024-07-01 16:05:56 -07:00
Ken-ichi
ae2f9eeddc Fix missing map tiles when taxon chosen on Explore (#1722)
* IconicTaxonChooser no longer takes a taxon or manages its own state
* Setting iconic taxon filter to Unknown is now its own action
* Unsetting a taxon can be done with the CHOOSE_TAXON action by setting taxon
  to null or undefined
* Omitted some extraneous params from tile requests
2024-06-28 10:13:51 -07:00
Amanda Bullington
cc8b610f2f Web parity for displaying top suggestion (#1721)
* Fix suggestions tests; use SectionList for suggestions

* Comment out offline test, Suggestions
2024-06-27 17:29:33 -07:00
Amanda Bullington
7e6323831d Separate store for RootExplore (#1710)
* Create root explore slice; preserves root explore state when user backs out of nav

* Fix tests
2024-06-25 13:22:18 -07:00
Amanda Bullington
545a068ab9 Use loading wheel when switching selected photo; closes #1668 (#1709) 2024-06-25 10:01:44 -07:00
Amanda Bullington
d9d7a6ff06 Suggestions screen UI fixes, location toggle, and offline reloading state (#1708)
* 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
2024-06-24 16:26:40 -07:00
Johannes Klein
081cc6e3f8 1689 signout designs (#1698)
* Add and remove strings

* Drawer TS

* INatIcon TS

* Fix import

* INatIcon TS

* ActivityIndicator TS

* Button TS

* Optional param

* Add ViewStyle prop back in

* WarningSheet TS

* Add string

* Update Logout.js

* Add types

* Change log out label to not navigate but set state

* Imports

* Show warning sheet on log out press

* Actually sign out user from warning sheet

* Remove sign out fct from Logout screen

* Change logger context

* Remove Logout

* Use Heading4 instead of local style

* Use Icon instead of Button

* Pixel pushing

* Prop testID down

* Remove unused login state

* Login TS

* Update type
2024-06-21 09:12:25 +02:00
Johannes Klein
4793b716ff 1520 explore offline notice (#1697)
* OfflineNotice TS

* Show OfflineNotice on Explore
2024-06-20 16:06:48 +02:00
Johannes Klein
68f026d76c Changes to email confirmation screen. (#1695)
* Add bottom padding to Login text

* Body2 TS

* Checkbox TS

* Add bottom padding

* Add transparent mode to Checkbox

* Use transparent Checkbox in License form

* Update string

* Bit more padding

* Update SignUpConfirmation.js

* Navigate to home screen for text

* Error TS

* Authenticate user immediately after registration

* Update List2.tsx

* Update Checkbox.test.js.snap

* If authentication fails after reigstration only log an error but proceed

* Add loading state to register button
2024-06-20 12:15:05 +02:00
Amanda Bullington
771e5c810b Changes to syncing process (#1670)
* Refactor syncing code and add preUploadProgress checks

* Progress on sync button functionality

* Fix deletions progress and toolbar test

* Time out deletion complete if no uploads

* Delete and then upload from sync button

* Test cleanup

* try to fix tests

* Improvements to automatic and button sync logging

* Code cleanup

* Renaming and rewriting sync functionality

* Restore MyObs test

* Add tests for useSyncObservations

* Code cleanup

* Use unique realm instance in useSyncObservations test

* Fixes for e2e crash

* Fix deletions, tests, and deletion errors

* Show and clear deletions on toolbar

* Sleep longer before resetting toolbar

* Remove sleep to pass e2e test
2024-06-18 19:04:28 -07:00
Amanda Bullington
76824636ef Human treatment in suggestions (#1693)
* Fix human suggestions

* Fix human test

* Fix tests
2024-06-18 12:39:59 -07:00
Ken-ichi Ueda
6788601751 Bugfix: first photo was not getting saved to gallery from StandardCamera 2024-06-14 10:44:15 -07:00
Johannes Klein
7c91bdf950 Obsedit add photo with StandardCamera, two fixes (#1677)
* Reorder hooks dependencies

* Return uri from take photo hook

* Keep state of photos added in this instance of the camera

* List2 TS

* INatIconButton TS

* Refactor useBackPress to show discard modal only if photos taken during this instance of the camera

* Remove newPhotoCount var

* TS refactors

* fetchUserLocation TS

* Increase timeout

* Fix error

* Hoist deletePhotoByUri

* Delete photos on discard

* Reorder code

* Set saving photo on checkmark press

Closes #1556

* Update snapshots

* Remove delete test

* Create StandardCamera.test.js

* Check if image is there before deletion

* Update react-native-share-menu+6.0.0.patch

* Update e2e_ios.yml

* Update some types
2024-06-14 14:04:24 +02:00
Ken-ichi
6d553daa0b Made status text in Toolbar clickable to start upload (#1678)
Also refactored layout code to be a bit more rational and added Toolbar to the
UI library to help visualize its many states.

Closes #1453
2024-06-13 18:36:24 -07:00
Ken-ichi Ueda
15029631f3 Removed redundant cleanup, hopefully deflakeing tests a bit 2024-06-13 10:43:46 -07:00
Ken-ichi
f3bcec2d2e Continuous location fetch in the cameras (#1673)
* Fetch location continuously in cameras until accuracy falls below threshold
* Unit test for useUserLocation
* Added untilAcc option to useUserLocation
* Bugfix: ObsEdit was not always fetching location for new camera photos

Closes #1340
2024-06-12 11:18:12 -07:00
Ken-ichi Ueda
4f01c08ca8 Upload fixes
* Rename numObservationsInQueue to initialNumObservationsInQueue for clarity
* Change upload timeout to 5 minutes (from 15 seconds)
* Mint a new abortController at the beginning of an upload queue, not for each
  observation
2024-06-07 12:57:18 -07:00
Ken-ichi
4f46cf5dfd Explore nearby and map area (#1655)
* Bugfix: map area search was broken after Nearby filter set
* Made EXPLORE_ACTION.SET_MAP_BOUNDARIES remove lat, lng, and radius
  attributes so we don't end up applying both kinds of geographic filters at
  the same time
* Renamed setExploreLocation to defaultExploreLocation because it doesn't set
  anything
* Added a unit test fot the Explore reducer
* Bugfix: zoom Explore to nearby after granting permission
2024-06-05 17:10:49 -07:00
Ken-ichi
5c6e88cbc1 Typescrpt path aliases (#1648)
* Typescrpt path aliases;
* Tried to resolve all ts errors in one file
2024-06-05 14:35:49 -07:00
Amanda Bullington
3b35e072b1 Default to first photo in Suggestions (#1649)
* Default to first photo in Suggestions; closes

* Fix tests for default selection on Suggestions
2024-06-05 12:12:14 -07:00
Ken-ichi
8dbbca04d9 Fail upload when network request failed (#1651)
* Fixed cancel upload button
* Uploads will timeout after 15s
* Moved MyObs tests unrelated to unsynced into the synced block
2024-06-04 18:23:59 -07:00