3279 Commits

Author SHA1 Message Date
Amanda Bullington
d892d755a7 Use React Query to simplify API requests (#166)
* Start using React Query to make remote data requests
* Renaming, standardized error handling from API calls, moving code
* Fixed messages test; changed useQuery mocking approach
* React Query should only retry for network issues
* Tried using useAuthenticatedRequest on TaxonDetail
* Clear the React Query cache on sign out

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2022-09-01 18:43:52 -07:00
Merhawit Gubsa
6919fac650 Create Custom button (#165)
* Replaced several separate button components with a single, configurable Button component
* Removed RoundGreenButton and SecondaryButton

Closes #121

Co-authored-by: Merhawit Gubsa <merhawitgubsa@Merhawits-MacBook-Pro.local>
2022-09-01 18:40:56 -07:00
Corey Farwell
e928f27887 Add flow types for react-native-safe-area-context; upgrade file to @flow strict-local. (#169) 2022-09-01 12:22:39 -07:00
Corey Farwell
4e054cf134 Fix NPM package version conflicts. (#172)
Prior to this commit, if I were to run `npm install` twice, I would get
this error:

```
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: inaturalistreactnative@0.1.1
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"17.0.2" from the root project
npm ERR!   peer react@">= 16.8.0" from react-spring@8.0.27
npm ERR!   node_modules/react-spring
npm ERR!     react-spring@"^8.0.27" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^18.2.0" from react-dom@18.2.0
npm ERR! node_modules/react-dom
npm ERR!   peer react-dom@">= 16.8.0" from react-spring@8.0.27
npm ERR!   node_modules/react-spring
npm ERR!     react-spring@"^8.0.27" from the root project
```

Because `react-dom` was eagerly trying to upgrade `react-dom` to version
18, but we want to lock it to 17 to match our React version.
2022-08-30 17:58:55 -07:00
Amanda Bullington
89edd38d6f Variable name change in photo gallery 2022-08-24 12:08:40 -07:00
Amanda Bullington
39111a9ab3 Replace PhotoGalleryProvider with useBetween hook (#162)
* Remove photo gallery provider

* Get tests passing

* Remove use-between & ability to remove photos from GroupPhotos and reflect that in PhotoGallery selection

* Use goBack method since not passing params back to PhotoGallery

* Remove params when navigating to photo gallery
2022-08-24 12:05:14 -07:00
Ken-ichi Ueda
d82c339eac v0.1.1+25 v0.1.1+25 2022-08-22 17:16:21 -07:00
Ken-ichi Ueda
e0e5064147 Close button should be visible on Login regardless of login state 2022-08-19 16:53:38 -07:00
Amanda Bullington
9a74595a65 Consolidate stack navigators (#163)
* Remove stack nav for explore & notifications; rename main stack nav
* Hide animation for ObsList
2022-08-19 11:28:45 -07:00
Amanda Bullington
a03bb2b34f Show photo upload failures; upload unsynced photos without overwriting from remote data (#161)
* Lint fix

* Simplify uploadObservation code by moving some logic into Obs model

* Eslint fix: remove unused import

* Use realm to filter by observationPhotos which haven't been synced

* Tests passing

* Eslint fixes

* Create helper functions to check for unsynced obs including photos; show in ObsList

* Show photo failure error if upload fails on obs_photo API call

* Fix test

* Guard against 500 errors
2022-08-18 11:29:12 -07:00
Amanda Bullington
c8f23fcb5f Add swipe to media viewer (#136)
* Add swiping in media viewer for photos which are zoomed out; closes #43

* Make media viewer full screen by overriding safe areas

* Improve custom swiper component (aka flatlist)

* Fix eslint errors

* Use onScrollEndDrag to handle left/right scrolling and update selected photo index

* Switch event handler to onMomentumScrollEnd

* Fixes for getting photo index while swiping only halfway

* Use IconButton for standardized back button in media viewer

* Update translations
2022-08-18 11:12:55 -07:00
budowski
6e65faab64 Obs Detail comment input in bottom sheet modal
Closes #105

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2022-08-16 18:50:20 -07:00
Ken-ichi Ueda
40585a4b01 v0.1.1+24 v0.1.1+24 2022-08-16 11:28:08 -07:00
budowski
9318f82cf9 Add photos to an existing observation
Also implements limits on number of media items one can import.

Closes #102
2022-08-15 15:22:36 -07:00
Merhawit Gubsa
5d4e58f60a Show title on Obs Edit (#148)
Closes #134

Co-authored-by: Merhawit Gubsa <merhawitgubsa@Merhawits-MacBook-Pro.local>
2022-08-11 18:19:01 -07:00
Merhawit Gubsa
29403df5ae Updated windowSoftInputMode for android (#147)
Changed the android:windowSoftInputMode to adjustPan. Closes #109

Co-authored-by: Merhawit Gubsa <merhawitgubsa@Merhawits-MacBook-Pro.local>
2022-08-09 17:16:56 -07:00
budowski
4d89160d07 Obs Detail closer to wireframe (#129)
Closes #106
2022-08-09 14:23:40 -07:00
Ken-ichi Ueda
2e9d414e75 Updated fastlane; truncated size of last changelog 2022-08-08 22:31:56 -07:00
Ken-ichi Ueda
c537167b6c v0.1.1+23 v0.1.1+23 2022-08-08 21:38:34 -07:00
Amanda Bullington
da4c30364d Unviewed comments/ids in ObsList (#141)
* Update text color to match icon color for unviewed comments and ids

* Eslint fix

* Add cleanup effect for useRemoteObs hook
2022-08-08 11:23:49 -07:00
Amanda Bullington
f9c566a77f Camera shutter effect and thumbnails (#133)
* Add a skeleton instantly when user taps shutter

* Update styling for photo preview to make flatlist of images scrollable within container

* Fix styling for media viewer modal

* Create animated view overlaying camera; closes #108

* Make fade duration shorter

* Fix animation for fade out/in when tapping shutter

* Fix hardcoded styles; move to stylesheets; remove extra comments
2022-08-05 09:53:06 -07:00
Amanda Bullington
2e2f4cb302 Combine camera and observations nav into one stack navigator (#139)
* Simplify stack navigation for observations flow
* Navigation code cleanup
* Fix upload bugs from new API v2 verification
* Restore useObservations to previous version
2022-08-04 18:59:14 -07:00
Merhawit Gubsa
ad263f0b67 Add close button to the login screen (#140)
* added close button to login screen
* added style for the close button

Closes #122 

Co-authored-by: Merhawit Gubsa <merhawitgubsa@Merhawits-MacBook-Pro.local>
2022-08-04 17:48:09 -07:00
Ken-ichi Ueda
e3a74cc47a Remove all null values from obs before upload 2022-08-01 17:29:05 -07:00
Ken-ichi Ueda
a1735f070d Restrict try/catch to network call while uploading; show error body 2022-08-01 16:56:26 -07:00
Ken-ichi Ueda
c453e1a52c Added some setup requirements to the README 2022-08-01 16:53:56 -07:00
Amanda Bullington
65d67c2a64 Mark comments unviewed on MyObs & viewed on ObsDetail (#132)
* Add icons to obs card comments/ids

* Show red icons when user has unviewed comments/ids

* Mark obs viewed locally and with server via obs detail

* Mock i18next; get tests passing
2022-07-27 13:08:01 -07:00
Amanda Bullington
281a43440c Add position to tap to focus square; keep photo preview flush with top; closes #96 (#131) 2022-07-25 18:18:31 -07:00
Amanda Bullington
42e0e73c4b Upload progress bar (#130)
* More progress on progress bar; make sure for loop uses all observations

* Remove attributes for API v2 obs create, cancel upload if user taps x

* Fetch current user id from auth service, not API call

* Add error message to uploader progress bar
2022-07-25 18:18:20 -07:00
Amanda Bullington
3d65b1e294 UI updates to bulk uploader (#128)
* UI updates to photo gallery

* Add filter icons to group photos

* Styling for carets, multiple ObsEdit

* Standardize kebab menu in shared component

* Fix bug in removePhotos; change selection to kebab menu

* Create delete obs dialog which deletes obs from bulk uploader obs edit

* UI tweaks; closes #100

* Add precommit hook to translate strings

* Fix styling for obs edit header; add fonts to xcode

* Fix lint errors

* Add safe area provider to test & app

* Fix tests
2022-07-18 14:44:20 -07:00
Ken-ichi
e929764c25 Adopted and enforced code style from other iNat Javascript projects
These rules are largely based on the AirBnB ones, which are not quite standard
for the React Native world, where Prettier seems to be more common, but I
think they add a lot of useful checks, and unlike Prettier we can customize
them. This also just makes it easier for people on the iNat team to work on
the mobile app.

Some specific changes:

* Added eslint-plugin-react-hooks to eslint rules
* Added eslint-plugin-simple-import-sort to eslint rules
* Bugfix: could not import photo from gallery
* Added support for react-native/no-inline-styles eslint rule
* useUser should not bother fetching a user for a blank userId
2022-07-13 13:55:59 -07:00
Ken-ichi Ueda
dbd39ff605 v0.1.1+22 v0.1.1+22 2022-07-11 15:39:54 -07:00
Ken-ichi Ueda
3df6e6f250 Mocked @gorhom/bottom-sheet with mock provided by same 2022-07-09 16:35:55 -07:00
Amanda Bullington
3c7ac52eec Logged out state for MyObservations (#119)
* Show logged out green card at top of my obs screen when user logged out
* Allow user to save obs locally without being signed in; show number of unuploaded obs in top banner:
* Show login prompt in bottom sheet; hide sync button when logged out
* Upload prompt uses same styling as login prompt
* Delete realm file if user is installing app after deletion
* Code cleanup; add comment to checkForSignedInUser; closes #98
* Update eslint-config package
* Update RN maps
* Update styling for empty list
* Use third-party bottom sheet modal for login prompt & upload prompt
* Get tests passing via transformIgnorePatterns
2022-07-09 15:21:10 -07:00
Ken-ichi Ueda
86c30727aa Disabled LocationPicker for now; typo fix 2022-07-06 17:12:03 -07:00
Ken-ichi Ueda
96d0800a91 Sanity changes for the Log In form
* Extended RoundGreenButton to accpept `style` and `loading` props
* Removed Tab Bar
* Make the form react to the presence of the keyboard
* Stop form loading on failure or success, not immediately
* Use RoundGreenButton instead of one-off styles
2022-07-06 15:59:19 -07:00
Ken-ichi
90ff7a59c0 Fastlane setup for tagging, releasing, and internal testing (#118)
Configures fastlane to automate our current release process of making a git tag, making a git release, building, and pushing to the Play Store internal track and Testflight. See README.md for details on setup and usage.

Co-authored-by: Amanda Bullington <albullington@gmail.com>
2022-07-05 18:19:41 -07:00
budowski
4b4b0f9244 Add ID - initial commit (#103) (#113)
* Adds a component for adding identifications, both from Obs Detail and Obs Edit
* Minor style and eslint change to disallow all-caps string literals

Closes #103 

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2022-07-02 16:01:48 -07:00
Amanda Bullington
2e184b97f4 Enforce globalized text with eslint plugin (#120)
Add plugin to enforce globalized text with warnings; globalize some strings; closes #93
2022-07-01 12:42:24 -07:00
Ken-ichi Ueda
1b5599f95c Skip legacy peer deps when running CI tests 2022-06-28 12:27:27 -07:00
Amanda Bullington
9b85991b83 Show comments on ObsDetail (#111)
* Save uuid to Comment realm; rerender ObsDetail when comment deleted; delete comment locally first

* Fix styling for kebab menu; closes #104

* Update package lock

* Get tests passing

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2022-06-27 11:13:31 -07:00
Amanda Bullington
5f320c0301 Fix search results for Explore Dropdowns, Projects, Search (#117)
* Display records from remote search results; only show one dropdown at a time; closes #114
* Remove LogBox used for testing
2022-06-25 11:32:24 -07:00
budowski
071b038c20 Login screen UI (#116)
Closes #6
2022-06-21 17:27:59 -07:00
Amanda Bullington
17122fc46e Delete user JWT on 401 error (#112)
* Sign out user when encountering a 401 error while fetching JWT
* Save currently signed in user in Realm
* Check for logged in user on app start, add loading wheel to obs list, sign user out when no user ID

Closes #99 

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2022-06-15 10:26:46 -07:00
Ken-ichi
93788014f7 Try to run eslint and flow as a part of CI (#115) 2022-06-14 14:45:00 -07:00
Ken-ichi Ueda
085eda25bf Clean up eslint and flow errors
Added some types, but most of this is a bit of a cop-out. Flow with hooks and
dynamically keyed objects doesn't work all that well.
2022-06-14 14:29:40 -07:00
budowski
0144200e9c Settings Screen (#77)
Gets most of the way toward #27. Blocks, mutes, and some other functionality require API v2 updates. UI needs refinement.
2022-06-09 15:49:22 -07:00
Amanda Bullington
1f2becdef6 Media Viewer (#107)
* Create basic media viewer with full sized image, selection, carousel, and header

* Create photo delete dialog component

* Wrap camera stack in Mortal component instead of resetting state on camera blur

* Use photo carousel in PhotoPreview for standardized photo sizes

* Make media viewer accessible from ObsEdit

* Remove evidencelist component and use photo carousel instead in ObsEdit/suggestions

* code tweaks

* Create realm ObsPhotos in standard camera for passing to media viewer, ObsEdit

* Move resize image function into Photo model

* Update photo preview to use delete photo functions from photo and obsphoto model

* Allow photo deletion in media viewer from ObsEdit, StandardCamera; switch to Modal view

* Swap in zoom functionality instead of carousel, media viewer

* Remove media viewer from nav, now that it's a modal

* Remove comment

* Update babel config with react-native-paper plugin for production

* Mock RN paper Portal component

* Media viewer takes photo uris; handles obsPhoto updates in ObsEdit and photo uri updates in StandardCamera

* Make sure tests pass with optional chaining for obsPhotos

* Update styling for StandardCamera

* Create obsPhotos attached to photos from camera

* Pass photos to StandardCamera from ObsEdit to reflect any changes made in MediaViewer

* Get tests passing

* Fix flow issues

* Change flow type for photoUris

* Add pre-commit hook for flow

* Fix flow erros
2022-06-01 11:10:03 -07:00
Ken-ichi Ueda
31da0fe957 Added NVM version file 2022-05-31 13:05:17 -07:00
Ken-ichi
109f91908e Consolidate API URL config into .env (#101) 2022-05-23 15:39:38 -07:00