Commit Graph

18 Commits

Author SHA1 Message Date
Ryan Stelly
b78be9243d lint rule & autofix for "trailing comma" (#3299)
* (lint) MOB-1063 enforce trailing commas

* autofix trailing commas

* manually fix newly introduced maxlen violations

* add trailing comma convention to i18n build
2025-12-22 20:17:13 -06:00
Corey Farwell
a43446909c Remove the need to specify TypeScript file extensions in imports (#3094)
* 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>
2025-09-07 23:41:42 +02:00
Johannes Klein
f2145dc86d Update react-native-reanimated (#2987)
* Update package.json

* Update package-lock.json

* Update Podfile.lock

* Reactivate snapshot tests

* Update Podfile.lock
2025-06-27 15:29:21 -07:00
Johannes Klein
b9b58bdfc4 Update react-native-reanimated to version 3.16.6 (#2957)
* 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
2025-06-16 10:56:52 -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
Amanda Bullington
36240dafa2 Fix reposition evidence through drag and drop (#1632) 2024-06-03 14:10:47 -07:00
Amanda Bullington
e7c4fdbe5e Store original rotated photos temporarily during Camera -> ObsEdit flow (#1522)
* Check for CV directory

* Save original, rotated photos for processing; clear directory when user lands on MyObs

* Reset evidenceToAdd when user lands on StandardCamera

* Disable photo taking while loading so one photo doesn't overwrite another
2024-05-09 22:24:45 -07:00
Johannes Klein
d6afb4b386 Upgrade to RN 0.73 (#1339)
* Upgrade to RN 0.73 with upgrade helper

* Upgrade testing-library

* Comment announcements

* Comment out UserProfle test

* Mock function used to calculate masonry layout

* There should not be a modal here

* There is actually also no modal here

* Use View if SafeAreaView is undefined

* Replace fast image library that was failing tests because of not being maintained

* Clear mocks in useTaxon test

* Remove legacy deps from testing flow

* Snapshot update

* Revert "Snapshot update"

This reverts commit bca8b296df.

* Update package-lock.json

* Clean-start

* Update project.pbxproj

* Reenable test that failed before updating dependency

* Reenable test that failed because of dependencies

* Remove comment
2024-04-08 15:28:06 +02:00
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
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
4942664432 Replace IconButton with INatIconButton (#749)
* Replace IconButton with INatIconButton

* Fix tests
2023-08-28 13:01:48 -07:00
Amanda Bullington
333ae489cd AR Camera UI (#705)
* Refactor camera buttons into their own components

* Standardize camera buttons & make TaxonResult a reusable component

* Fix button styling in tablet landscape; create confidence interval

* Create camera container with shared functionality for both cameras; fix tests

* Connect results & loading status from native predictions; standardize results on iOS/Android

* Fix Camera test by mocking CameraView and FrameProcessor components
2023-07-19 10:14:30 -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
Ken-ichi
00ae38ddda Standard camera photo delete (#615)
* Ensure layout of the PhotoCarousel photos doesn't change in delete mode
* Stop conflating screen-size layout differences with tablet layout differences
* Bugfix: deleting one photo in the StandardCamera removed all photos
* Animated rotation of rotatable elements on StandardCamera
* Ensure loading status shows while first photo is being taken
* Tried to remove some open handles and shore up some unhappy tests
2023-05-19 13:16:32 -07:00
Amanda Bullington
81be995ad4 Media Viewer with landscape UI (#608)
* Make MediaViewer a navigation screen; support changing landscape/portrait orientations

* Move device orientation into hook

* Minor fixes to styling

* Styling updates based on breakpoints
2023-05-15 13:04:40 -07:00
Angie
343a3ded61 472 standardcamera large screen layout (#567)
* StandardCamera for large layouts

* StandardCamera and main  merge cleanup

* Refactoring flashButton render

* Adjust margins and button spacing for large layouts

* Change conditionals to include screen size breakpoints

* Remove redundant conditionals

* Added PhotoPreview large screens landscape, styling cleanup, ios portrait mode lock on phones

* Update unit test, update snapshots

* Rotate icons in landscape and fix photolist direction in phones

* Rotate icon function adjusted

* Several fixes for orientation chages; keep camera buttons in place

Orientation was not being set correctly, but given the different definitions
and different values for orientation used by differe libraries, that's pretty
understandable. Here's I've tried to standardize around some constants and
make sure it gets set correct and variables like `isLandscapeMode` actuall
have the value the claim to hold.

Also redid the "no photos" state for the camera to be closer to spec, though
the text rotation is quite a pain.

Camera buttons should now stay in place even when the flash button appears or
disappears depending on the camera in use.

* Use isLargeScreen consistently

* Don't track orientation change when it doesn't do anything

i.e. on a phone. This was causing a crash in Android when rotating into
portrait orientation.

* Orientation change updates for StandardCamera

* go back to supporting rotation on small devices for the icons
* fixed android crash when rotating from landscape to portrait on a small
  device
* handled FACE-UP and FACE-DOWN orientations by just not changing layout in
  those scenarios

* Fix discard changes sheet in camera

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
Co-authored-by: Amanda Bullington <albullington@gmail.com>
2023-04-21 14:03:39 -07:00
Angie
ae8e85098f 474 adjust photopreview sizes in standardcamera for different breakpoints (#559)
* Adjust PhotoPreview sizes for StandardCamera for different breakpoints

* PhotoCarousel tests

* Merge main into branch

* PhotoPreview styling after merge

* Update PhotoCarousel snapshots

* Moved getBreakpoint into Sharedhelper, changes requested.

* PhotoPreview for large layouts

* Remove testing color

* Update snapshots

---------

Co-authored-by: Amanda Bullington <albullington@gmail.com>
2023-04-06 13:09:17 -07:00