Commit Graph

17 Commits

Author SHA1 Message Date
Amanda Bullington
045ce6f789 Improve Jest performance (#1160)
* Use faker import with specific locale

* Add global beforeAll to initiate i18next
2024-02-16 16:17:00 -08:00
Ken-ichi
f7dc08a704 Suggestions fixes (#972)
* 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
2023-12-15 19:58:12 -08:00
Amanda Bullington
808cbee452 Replace ObsEditProvider with zustand for global state management (#948)
* 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
2023-12-05 14:10:00 -08:00
Ken-ichi
0c7c807b56 Realm & other bugfixes (#950)
* Updated faker; fixed bug w/ DisplayTaxonName trying to modify a Realm object
* Fixed crash going from ObsDetail to ObsEdit
* Fixed bug fetching observation dates (not clear how this didn't instantly crash_
* Bugfix: MyObs observation fetch was failing on taxa w/ float rank_level
2023-12-04 13:47:00 -08:00
Amanda Bullington
1a27ef68cb Upgrade to Realm 12 (#925)
* 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
2023-11-22 13:01:59 -08:00
Ken-ichi Ueda
38e75d3cdf Remove some unecessary react-navigation mocks 2023-11-20 11:09:36 -08:00
Ken-ichi
dacd8788ec Permission gate layouts (#743)
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
2023-10-18 16:47:12 -07:00
Amanda Bullington
7d20f6aa81 Suggestions (using server data) (#821)
* UI overhaul for Suggestions

* Updates to suggestions

* Update permissions library and Podfile

* Get tests passing

* Add tests for suggestions

* Update snapshot

* Add comment prompt & box to TaxonSearch

* Add empty state

* Nav and loading fixes

* Add more tests to Suggestions flow

* Fix tests

* Fix tests
2023-10-13 14:46:05 -07:00
Amanda Bullington
47c5d8e2fd Drag and drop photos (#813)
* 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
2023-10-11 13:55:27 -07:00
Amanda Bullington
9c6106f5d0 Refactor tests to use minimum viable test factories (#681)
* 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
2023-06-27 17:06:01 -07:00
budowski
ef9a06f5eb #392 - Write photos taken via the app into the camera roll and update their location metadata (#496)
Writes photos out to external storage at capture time, and updates GPS EXIF fields when observation is saved. Closes #392. There is a known bug in Android causing landscape photos to be inverted.

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2023-06-09 18:04:17 -07:00
Amanda Bullington
1849e59aa3 Only use date/location from exif when importing photo (#637)
* Only use exif date/location from imported photos; don't display date/location if no exif data

* Fetch location for new ObsEdit screen
2023-05-23 14:40:34 -07:00
Johannes Klein
1439c40c6a Upgrading the app to react-native 0.71.7 (#592)
* Changes in the unproblematic files

* Remove manually linked react-native-config

* Updates to files because of upgrade

* RN 71 and dependencies packages

* Update snapshot tests

* RN 71.1

* Fix missing jest mock

* RN 71.7

* Missing mock

* Fix errors with apisauce and axios

* Remove react-native-codegen direct dependency

* Code style
2023-04-25 17:18:24 +02:00
Amanda Bullington
fa94ab5b42 ObsEdit - bottom sheets (#570)
* Add KebabMenu to shared components index

* Separate EvidenceList from PhotoCarousel component

* Remove unneeded props from PhotoCarousel

* Create notes bottom sheet

* Fix tests for delete obs sheet

* Add wild status sheet

* Show date from observations uploaded via website

* Move media viewer modal into evidence section

* Fix mock

* Move location fetching into its own hook

* Refactor ObsEdit header; move code into Header component

* Add discard changes sheet

* Styling updates and save changes button

* Add classes to buttons based on evidence/id missing

* Add imprecise location sheet

* Add jest.fn from provider to ObsEdit tests

* Remove fakeTimers from ObsEditWithoutProvider.test.js; minor cleanup

* Show discard obs sheet anytime a user tries to navigate back

* Fixes to bottom sheet backdrop, evidence, add discard changes sheet

* Switch to paper radio buttons instead of checkmarks

* Fix bottom sheet backdrop in android by wrapping with GestureHandlerRootView

* Update bottom sheet for add comment & notes

* Fix test

* Remove fake timer from ObsEdit test to get tests passing

* Force update github actions cache

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2023-04-20 17:02:19 -07:00
Johannes Klein
4f9144077d Upgrade factoria/faker, breaking changes 2023-04-20 12:07:33 +02:00
Amanda Bullington
0db7558abb Reverse geocode only when internet is connected (#552)
* Only reverse geocode from fetchPlaceName function; skip geocoding when no internet
* Reverse geocode when internet is reachable; closes #390
2023-03-29 11:47:02 -07:00
Johannes Klein
2324182999 Rename test 2023-02-16 15:51:04 +01:00