Commit Graph

299 Commits

Author SHA1 Message Date
Amanda Bullington
5ee4a433df Add location picker to ObsEdit (#593)
* Crosshairs, location accuracy warnings, text input for location picker

* Add LocationPicker tests

* UI improvements and code refactor into smaller components; get GMaps working

* Add shadows to icons/text boxes

* Use debouncing to avoid map jitter when typing in location

* Show place results & let user pick new location from web api

* Add tests for location picker with remote results

* Add gmaps api key to github actions

* Try adding manifest placeholders for env variable to work in github actions

* Add key to printf in github actions

* Try accessing GMAPS_API_KEY a different way

* Update android e2e env file step

This updates the "Create .env file" step to use printf to print the Google Maps key into a newly created .env file in the GitHub Action runner. Using the same key as in env.example.

* Fix newline

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2023-04-26 10:51:05 -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
Johannes Klein
bb67a8d859 Remove direct dependence on react-spring 2023-04-24 14:50:34 +02: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
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
Ken-ichi
5747d4d1d9 Several minor UI fixes (#572)
* use `shrink` tailwind class instead of hard-coded max widths to control
  overflow in a few situations
* fixed some spacing issues with the Toolbar during upload
* center text in buttons by default
* export KebabMenu from SharedComponents (how was it working without this?)
* added some extra colors for debugging purposes
2023-04-17 15:50:39 -07:00
Angie
8ef2fbb89c 440 activityitem component (#564)
* ActivityItem component main styling, ActivityHeader added Body4

* ActivityItem component, onAgree icon

* Remove console logs

* onAgree prop

* Changes requested, text wrap, styling to match figma

* Add ActivityItem to UILibrary

* onAgree button shows conditionally

* onAgree button shows conditionally

---------

Co-authored-by: Amanda Bullington <albullington@gmail.com>
2023-04-06 13:09:32 -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
Amanda Bullington
7c234221cf Fix add evidence modal duplicate row 2023-04-04 12:31:02 -07:00
Chris
98a6663fe1 561 fix hidden bottom sheet (#563)
* Show bottom sheet over tab bar

* use present method

* Ensure bottom sheet works elsewhere

* Ensure bottom sheet works elsewhere

* Add provider to test

* lint

* Fix tests

* Merge fixes

---------

Co-authored-by: Amanda Bullington <35536439+albullington@users.noreply.github.com>
Co-authored-by: Amanda Bullington <albullington@gmail.com>
2023-04-04 12:30:07 -07:00
Amanda Bullington
bf2aa516c3 UI updates for Obs Edit (#565)
* Styling updates to ObsEdit screen

* Fix padding/margins and font style in TextInput

* Styling updates for identification section

* UI changes; add checkmarks for evidence

* Only show arrows for multiple observations
2023-04-04 11:37:05 -07:00
Ken-ichi Ueda
04d5b83444 Minor fixes to Header and Tab Bar spacing 2023-03-31 18:38:21 -07:00
Ken-ichi Ueda
4a621c2fb5 Wrap useTranslation to catch java.lang.NoClassDefFoundError in Android
This error seems to happen on the first few attempts to use i18next.translate
on Android when there are numerical interpolations, e.g. plurals. This
extends a bandaid fix by @Chrischuck in
https://github.com/inaturalist/iNaturalistReactNative/pull/515 to handle all
uses of translation.
2023-03-31 18:38:21 -07:00
Amanda Bullington
c623c02272 Refactor DiscardChangesSheet and show only when leaving screen (#562)
* Only render bottom sheet when needed; refactor; fixes #556

* Fix test: add useFocusEffect to mocked nav
2023-03-31 10:26:23 -07:00
Amanda Bullington
20bd896d20 Fix orientation of thumbnails and checkmark; closes #475 (#557) 2023-03-30 13:52:34 -07:00
Chris
978bf26f81 Remove conditional around setAllObsToUpload (#558)
* Remove conditional around setAllObsToUpload

* Add spread

* Fix duplicate key bug
2023-03-30 13:48:14 -07:00
Angie
18dcccc705 Snapshot and unit tests, and default color for QualityGradeStatus (#512) 2023-03-30 11:18:53 -07:00
Ken-ichi Ueda
38311ea3c7 Consistent grid item spacing on MyObservations 2023-03-29 16:20:44 -07:00
Amanda Bullington
295eaee88a Navigation fixes / remove stack navigator (#554)
Remove stack navigator; move everything into tab nav and hide footer when needed
2023-03-29 16:19:31 -07:00
Chris
b6453c57b5 Fix observation deletion crash (#551)
Ensure requests to fetch observations that are in flight at the time an
observation is deleted to not re-create or overwrite the deleted observation.

Closes #545
2023-03-29 15:21:23 -07:00
Chris
6e133acbeb Use flash list obs page (#553)
* Convert to flash list on my obs page
* Use infinite scroll query

Closes #535
2023-03-29 14:56:17 -07: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
Ken-ichi Ueda
4ada127064 Fixed some style changes to ObsStatus 2023-03-28 17:05:30 -07:00
Ken-ichi Ueda
b5c340cf28 Bugfix: signing in w/o an Internet connection was raising an exception 2023-03-28 16:54:45 -07:00
Chris
5385c5404b Implement forced state update to rerender svg content (#550)
* Implement forced state update to rerender svg content

* Fix tests
2023-03-20 15:26:56 -07:00
Amanda Bullington
16e7fa21bd Improve toolbar styling (#547) 2023-03-17 13:54:02 -07:00
Johannes Klein
868c95ee13 494 activity count (#495)
* Refactor to boolean prop for white or gray

* Rename prop

* Add component for comments count

* Reorder strings

* Use CommentsCount

* Add identifications count component

* Add snapshot test for ActivityCount

* Add tests TODO for component

* Updated with new icons

* Add snapshot tests

* Update ActivityCount.test.js.snap

* Unit test for count text

* Remove testing comments count in ObsList test

* Update with changes from main

* Update IdentificationsCount.test.js.snap

* Remove components from ObsStatus
2023-03-17 11:55:29 -07:00
Johannes Klein
e1e968116c Do not use camera focus if device does not support it 2023-03-17 17:11:17 +01:00
Chris
94ec2de209 530 fix freezing loading spinner (#531)
* Fix freezing loading spinner

* Rebase

* Rebase

* Change from continuous spin to delay

* Change from continuous spin to delay

* Fix rotation
2023-03-17 10:50:03 +01:00
Amanda Bullington
32245cb526 Fix camera button alignment & add eslint indent rule 2023-03-15 17:26:44 -07:00
Amanda Bullington
1a2b042aa1 Fix nav to Explore screen 2023-03-15 15:58:34 -07:00
Amanda Bullington
cf2309b936 Rotate camera checkmark in landscape (#536)
* Rotate camera checkmark 90 degrees when device is in landscape; closes #470

* Add rotation to view around IconButton; fix android crash
2023-03-15 13:50:24 -07:00
Chris
c89fc837da add safe area to headers (#537)
* Adjust header margins and safe areas

* Lint
2023-03-15 11:09:44 -07:00
Chris
5b35e83b5c Utilize floating action bar and sticky toolbar in group photos ui (#527)
* lint

* Fix shadow on fab android

* lint
2023-03-14 12:42:53 -07:00
Amanda Bullington
bbc5b9d67d MyObservations refactor (#510)
* WIP: very rough start at pulling state up into a container for MyObservations

I made a parallel MyObservations component and container so ObservationViews
can still be used as a working reference, but the ultimate goal here is to
focus MyObservations on presentation, and pull state and other business logic
up into a container component. This should make MyObservations a bit more
testable and clean up a very large and confusing file.

I'm also trying to move away from a generalized representation of observations
on all screens, which is why I want to name it MyObservations and not
ObservationViews. MyObservations has a lot of unique functionality that we
won't need elsewhere, and we can modularize stuff when we need to use it in
multiple places.

* UI updates for header, toolbar, empty component

* Add pressable component and login sheet

* UI improvements; get infinite scroll working

* UI improvements & additions for empty screen & bottom sheet

* Show login sheet when a user presses sync but is not logged in

* Fix backdrop close for AddObsModal

* Move UI elements to MyObservations

* Fix unit tests for MyObservations

* Fix for login sheet

* Set header height to a different height on Android to account for safe area

* Fix failing tests & rerender of user icon in navbar

* Remove scientific name from DisplayTaxonName to match Figma UI

* Set height above toolbar dynamically for sticky toolbar

* Add prop to display or hide second name in DisplayTaxonName

* Use RN styling to style grid view for MyObs flatlist

* Fix failing project obs test

* Create separate ToolbarContainer to separate presentation from logic; fix upload count

* Merge main and show onboarding based on user's total obs count

* Fix display taxon name styling and remove header fade on iOS

* Add header text for 0 observations, logged out state

* Update infinite scroll to 50 obs at a time; make loading wheel show faster

* Add uploaded status to toolbar

* Apply bandaid fix to stop Android from crashing on start

* Start adding new icons to MyObs

* Add circular progress; show upload icons at correct times during upload

* Add disabled props for accessibility state

* Fix tests; update snapshots

* Code cleanup

* Code cleanup & add inaturalist icon

* Fix merge conflict and add icon

* Add inaturalist icon

* Fix navigation to obs list and toolbar status when upload completes

* Move showLoginSheet code to MyObsContainer

* Fix toolbar status text

* Sync toolbar with upload status progress

* Clear toolbar after nav

* Tests passing

* Update e2e test

* Target login button in e2e tests

* Fix failing e2e tests with new testID for login button

* Update button snapshot to include new testID

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2023-03-14 10:54:33 -07:00
Chris
6408890566 Use ObsPreviewImage for photo gallery and use PhotoCount component (#525)
* Use ObsPreviewImage for photo gallery and use PhotoCount component

* Lint

* Disable gradient

* Fix android border gap

* Lint

* Fix gap bug

* Lint
2023-03-14 13:38:08 +01:00
Chris
da743537bc 501 502 date dispaly location styling (#524)
* Use new icons for date + location display

* lint

* Update new icon in obsdetails
2023-03-12 13:18:45 +01:00
Chris
54479f22b3 Use trash-outline icon (#526) 2023-03-12 12:53:05 +01:00
Ken-ichi
3320aec7f6 Add icons to repo & use script to generate font (#518)
This uses an npm package to convert SVGs into an icon font, allowing us to
not step on each others' toes when adding new icons in branches and
simplifying the icon addition process. It also allows us to track changes to
the icons, and embed them directly as SVGs if we need to.

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2023-03-10 12:21:09 -08:00
Chris
01099be1ce Create tab navigator (#507)
* Create tab navigator

* Add add obs button

* lint

* Wire up routes

* Fix login

* Add keys

* Fix delayed state bug

* Lint

* space parens

* Add details to tab nav

* Lint

* re-add back btn

* Rebase off main

* Fix format

* Fix back button

* Remove unused change

* Replace lowercase folder

* I don't know why that is needed

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2023-03-10 14:57:32 +01:00
Chris
6763e161f3 Create custom header (#508)
* Create custom header

* Add right button back

* lint

* Rebase main

* Make required changes

* Add header to ui library

* Remove abs positioning
2023-03-09 11:07:38 -08:00
Angie
fb23d925c4 400 uploadstatus component (#488)
* UploadStatus component

* Added UploadStatus to SharedComponents/index.js

* Change upload complete icon and color

* QualityGradeStatus accessibility labels

* Saved Observation Animation for UploadStatus

* Changed widths of component

* Unit test for UploadStatus

* Unit test and snapshot for UploadStatus

* Update snapshot tests

* Changes requested, accessibility labels for UploadStatus progress, accessibility tests

* Update snapshot tests

* Testing updated snapshot test

* Fix style

* And again

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2023-03-09 17:49:32 +01:00
Johannes Klein
a771a309ef Change PhotoCount in UiLib 2023-03-09 16:48:42 +01:00
Yahia Jabeur
3342dfa9e2 483 create PhotoCount component (#497)
* 483 create PhotoCount component

* 483 PhotoCount refinement

* 483 add PhotoCount component unit test

* 483 add shadow to PhotoCount component

* Use Body3 component instead of SVG text

* 483 fix unit tests

* Find component by text rather than by ID

* Remove unused test id

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2023-03-09 16:44:45 +01:00
Ken-ichi
6047a44241 Reverted icon names in Fontastic to match main (mostly) (#511)
Somehow many of the icon names in Fontastic were changed. This changes them
back to match what we use on the web and what we use in the main branch of
this repo, with a few exceptions to attempt to make names more consistent.

Also updated the README in the hopes of avoiding situations like this in the
future.

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2023-03-07 15:01:29 -08:00
Amanda Bullington
7d63206862 Move sticky toolbar above footer in UI library 2023-03-07 14:48:22 -08:00
Chris
3565bcfe9d 484 - Create sticky toolbar (#506)
* Create sticky toolbar

* Clean up code

* Rebase off main

* Fix shadows
2023-03-07 14:42:44 -08:00
Chris
206934f7ad 471 create camera cancel bottom sheet (#516)
* Add confirmation modal for discard photos in standard camera

* Add confirmation modal for discard photos in standard camera

* Fix tests

* Make requested changes

* Add close via overlay
2023-03-07 11:06:57 -08:00
Chris
66607b0bc8 391 & 466 - Fix shutter effect & remove hidden camera areas (#513)
* Fix shutter effect & remove hidden camera areas

* lint

* Remove uneeded classes
2023-03-06 12:36:53 -08:00
Angie
c3ad393a0d 455 update colors and unify usage in the app (#505)
* Update tailwind colors to match current designs, update PaperProviderColors, unify usage

* Change snapshot test colors to match current design colors

* Added accessibility labels

* Edited accessibility labels

* Remove surface color, unify usage

* Update colors
2023-03-06 11:43:42 -08:00