Commit Graph

4199 Commits

Author SHA1 Message Date
Ken-ichi Ueda
911a71d294 Updated fastlane 2022-10-21 12:30:41 -07:00
Ken-ichi Ueda
15837cc0f6 Added .xcode.env to gitignore 2022-10-21 12:29:31 -07:00
Amanda Bullington
5456758f27 Move hooks into sharedHooks folder; reorganize Observations and models/ (#194)
* Rearrange hooks and observation component code
* Rename models/ to realmModels/ and use babel aliases

Closes #155

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2022-10-20 16:59:19 -07:00
Amanda Bullington
1d00edcb3c Add back button to camera; hide next button when no photos (#193)
Add a back button to the camera; hide next when no photos taken; styling fixes

Closes #143

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2022-10-20 16:15:15 -07:00
Amanda Bullington
a07ee979e6 Custom fonts (#192)
* Add Whitney fonts to project
* Use styled components to pass whitney as default font for all app text
* Add header component using Papyrus as default font
* Update realm and add custom font examples for Android

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2022-10-20 15:23:10 -07:00
Amanda Bullington
f9392452f3 Add navigation buttons to media viewer (#187)
Add nav buttons with scroll to index to media viewer

Closes #164

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2022-10-20 12:05:57 -07:00
Amanda Bullington
c740a06224 Start using Tailwind CSS (#185)
Starts changing styles over to tailwind via nativewind.

* Update node to 16.17.0
* Use styled() to ignore flow errors about className or tw props when styling components with nativewind
* Upgrade realm to make test suite run; set failing test in Explore as todo
* Add workaround for getting pods to run with XCode 14
* Fix for loading remote obs with infinite scroll
* Add styling section to README
* Use IconButton from rn-paper to make buttons more responsive to press
* Add caret next to camera roll album picker
* Fixed broken addition of gallery photos to existing observation
* Removed flatlist from scrollview on ProjectDetails (apparently not allowed?)
* Moved border style from Image to container in PhotoCarousel (border color
  not allowed for images?)

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2022-10-19 17:15:55 -07:00
Amanda Bullington
e81894d406 Use authenticated queries for fetch/search requests (#195)
* Use authenticated query for search results
* Use search API for fetching places from Settings
* Use authenticated query for authorized applications
* Use authenticated query to fetch user.me
* Move fetch/search api calls into react query format, out of hooks
* Update with react query instead of hooks
* Fetch list of blocked and muted users with authenticated query
* Added Podfile postinstall block to get app running in a Simulator
* Use auth query in identify
* Upgrade Realm to 11.0.0-rc.0, most recent version that will work with RN 0.68.2
* Upgrade @realm/react library to 0.4.0; fixes initialization error on android due to importing realm
* Use authquery for explore provider
* ObsDetail wasn't showing the edit button for obs created while signed out
* simplified ObsEditHeader so it takes a full observation instead of relying
  on the ObsEditContext
* ObsEdit now accepts an obs UUID as a param and loads that if the context
  doesn't have a current obs
* null checks for API methods, mostly to prevent requests that won't work b/c
  of missing params

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2022-10-19 13:01:04 -07:00
Amanda Bullington
c4d9cd4dc6 Use babel-plugin-module-resolver (#188)
* Add alias and update eslint/flow to resolve modules

* Update aliases for components and api

* Add other src directories to module resolver aliases
2022-10-07 10:20:55 -07:00
Ken-ichi
dc124d4c72 Skip group photos (#191)
Skips group photo when importing a single photo.

Closes #174, co-authored with @albullington
2022-10-06 16:24:03 -07:00
Ken-ichi
c22d0fe79a Use RealmProvider (#183)
This attempts to remove the necessity of opening and closing Realm
connections, which can lead to stale connections and invalidated objects. I
did not try to remove direct access to realm from AuthenticatedService,
which exists outside of the component hierarchy and can't really access
context, but I think eventually we may want to bring all that functionality
within the component hierarchy so there really is only one Realm connection
in the app.

Probably still some bugs here. One major problem is that deleting the Realm
file does not seem to trigger a re-render of the RealmProvider. My workaround
was to delete all the data in RealmProvider connection to Realm before
deleting the file, but it seems kind of redundant.

Some other changes

* Updated react-native-image-resizer and worked around some regressions
* Needed to use Array.from on Realm collections in many places;
  map( o => o ) doesn't seem to work for creating POJOs from realm objects any more
* React Native Paper provider needs to be inside the Realm provider for any
  realm stuff to happen with rn paper modals
* Several workarounds for the fact that Realm objects don't behave like POJOs
* Added useApiToken hook (#158)
* Renamed the useUser hook to useRemoteUser, since that's what it was doing
2022-10-06 16:15:22 -07:00
Ken-ichi Ueda
38d7716ccb Bugfix: uploading an obs without evidence was broken 2022-10-04 16:04:46 -07:00
Merhawit Gubsa
f4f1e367e7 Make sync icon active for unuploaded obs (#190)
Closes #176

Co-authored-by: Merhawit Gubsa <merhawitgubsa@Merhawits-MacBook-Pro.local>
2022-10-04 13:32:19 -07:00
Merhawit Gubsa
d3eeed7b05 123 permission fetch location (#184)
* add location permission access to android manifest
* request permission to access location for android
* removes location fetching from the observation model and adds it to ObsEdit
* do not fetch location if it is existing observation

Co-authored-by: Merhawit Gubsa <merhawitgubsa@Merhawits-MacBook-Pro.local>
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2022-10-04 13:26:07 -07:00
Merhawit Gubsa
76a103ded4 use only material icon set (#189)
Co-authored-by: Merhawit Gubsa <merhawitgubsa@Merhawits-MacBook-Pro.local>
2022-09-29 14:27:07 -07:00
Amanda Bullington
af8f17190d Keep toolbar sticky & collapse header on ObsList scroll (#182)
* Change bottom sheet modal to bottom sheet
* Give flatlist container a minHeight to make bottom sheet snap correctly when flatlist has few items
* Make entire header sticky above FlatList
* Hide header on scroll while keeping toolbar sticky on scroll
* Allow flatlist to scroll while bottom sheet modal up
* Use animated event on scroll with interpolation and stickyheaderindices to keep toolbar sticky while animating header
* Add accessibility label to logged out card

Closes #175
2022-09-27 16:20:13 -07:00
Amanda Bullington
337d812ab9 UI updates to bottom sheet (#181)
* Changes My Observations upload bottom sheet from modal to non-modal
* Give flatlist container a minHeight to make bottom sheet snap correctly when flatlist has few items
* Mock useLoggedIn hook in tests
* Move useCurrentUser to sharedHooks/ and mock in ObsList test
* Mock useUser hook
* Use useCurrentUser hook on user profile
* Downgrade gesture handler
2022-09-19 14:40:26 -07:00
Ken-ichi Ueda
88fa8a4516 Minor readability change 2022-09-07 17:45:50 -07:00
Ken-ichi Ueda
6f6631a5d1 Updated fastlane 2022-09-06 17:46:19 -07:00
Ken-ichi Ueda
964924c6b7 v0.1.1+26 v0.1.1+26 2022-09-06 17:05:55 -07:00
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