Commit Graph

4199 Commits

Author SHA1 Message Date
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
Amanda Bullington
83648c7157 Delete realm record on signout (#97)
* Show confirmation popup on signout & delete realm file; closes #87

* Add Mortal component around Obs stack; closes #87
2022-05-18 07:38:30 -07:00
Amanda Bullington
f4e9fdc724 Delete photos from standard camera preview; closes #89 (#94)
* Delete photos from state and tmp directory; closes #89

* Increase padding around delete buttons in camera preview

* Add confirm modal before deleting photos in photo preview
2022-05-16 20:30:19 -07:00
Amanda Bullington
c5528c67a9 Edit existing observations (#86)
* Convert Realm objects into plain objects for ObsEdit; check for recently edited obs in ObsList

* Code cleanup; closes #85

* Extend classes with Realm.Object; use .toJSON( ) to edit plain objects with less code

* Check for local updates before syncing from server

* Code cleanup; rename existingObs and remove projects in OtherDataSection
2022-05-12 18:38:26 -07:00
Amanda Bullington
d2fda78a6c Rename normal camera to standard camera; closes #88 (#91) 2022-05-12 13:25:11 -07:00
Ken-ichi Ueda
25fe935de0 WRITE permissions for camera / gallery so they can write resized images 2022-05-10 16:32:00 -07:00
Ken-ichi
baab03e0e0 More permissions (#81)
* Components should decide when photos are requested
* Use PermissionGate for SoundRecorder
2022-05-10 16:08:24 -07:00
Ken-ichi
e5a48d41cb Force Login component to unmount when it loses focus, resetting state (#82)
Adds a <Mortal> component that only renders its children when it has focus in
React Navigation, causing its children to unmount when that focus is lost,
thereby resetting their state and cause all there effects to clean up after
themselves.
2022-05-10 15:57:41 -07:00
Amanda Bullington
f46d4086ad Save observations, photos, sounds in Realm for upload (#78)
* Break uploader into helper function; add bottom model for uploading from obs list

* Create mapping function for uploading observations to iNat

* Mark observations as uploaded when id is returned from server

* Format dates on obs list

* Save all obs locally before trying to upload

* Resize grouped photo gallery photos for upload

* Resize photos btw group photos screen and obs edit

* Get sound, photo, obs uploads saving to realm and uploading later

* ObsEdit progresses to next or prev screen after one obs is saved locally

* Format date in camera; use time observed to show new local obs in ObsList

* Remove time zone attribute, since this is handled by server

* Submit sound and photo uuids as the file name for sound/photo uploads

* Make obsSounds an array in case there are multiple sounds for upload

* Removing time synced from Photo model bc not sure it's necessary

* Save _synced_at and _created_at time for all remote obs

* Fix back button, obs edit

* Don't show obs edit for unuploaded obs

* Get rid of ObservationProvider, move useObservations hook

* Fix place name; add date/time and location to no evidence uploads

* Add species_guess to observation when taxon_id changes

* Format date from picker; use string for sending to server

* Styling cleanup with react-native-paper; make ObsEdit into section components

* Add vector icons to ios (for searchbar)

* Add empty text to CV suggestions

* Cleanup code for marking records synced & uploading to server

* Use placeholder icons on bottom tab bar

* Add icons to ObsList; fix grid view when photo === null

* Fix jest tests

* Simplify setting an identification in ObsEdit

* Move inline styles to separate files

* Display all relevant saved obs data on ObsDetails; function to check for camel or snake case attributes

* Move logic for creating new sound observation to model, not sound recorder

* Add android vector icons

* Move create obs and create with no evidence into Observation model

* Add mock for react-native-fs

* Show option to edit user obs in ObsDetail; fix captive/geoprivacy/date fields for uploaded obs

* Move obsPhoto creation and obs with obsPhoto creation into models

* Create obs with sound from Obs model

* Create multiple obs from gallery photos; move logic into model

* Pass observation to ObsDetails via navigation to avoid opening and closing realm twice

* Lint error fixes

* Fix jest tests

* Use icons on normal camera

* Use timestamps from gallery and camera for new observations

* Keep simplifying code

* Update version/build number; add key to info.plist for faster ios build

* Remove TranslatedHeadline component

* Move saveLocalObservation logic to model

* Move all FIELDS for api calls into models (except messages, which doesn't have a model yet)

* Only show upload UI if user is logged in

* Fix obs edit link so it works for both logged in and logged out users

* Bug fixes: get fields from models; addListener function in test

* Model code cleanup

* More code cleanup

* Remove unused imports
2022-05-10 14:41:31 -07:00
Ken-ichi
09ed361d02 Camera and gallery now display after granting permission (#79)
* Camera and gallery now display after granting permission

Previously these were not quite working because the usePhotos hook was asking
for a permission, so if that was used anywhere in conjunction with another
permission request, one or both success promises never got executed. This
commit tries to solve that with a PermissionGate component that takes a
permission as a prop, asks for it if not granted, then renders its children
when granted. If not granted, it renders a message saying that the permission
is required to use the feature.

Other stuff

* Added `env.example` so people know how to populate `.env`
* Added the `intl-pluralrules` polyfill to support pluralization with i18next
* Skip some token granting logic if the user is not logged in
* Trim whitespace from username/email before auth
* Some minor UI changes to auth form so I know where to tap
* Test fixes

* Use a full screen view for children of PermissionGate

* Globalized text on PermissionGate
2022-04-27 12:36:03 -07:00
Ken-ichi
0c8c9020ec Test fixes (#80)
* Comment model needs a UUID attribute
* mocked useLoggedIn in ObsEdit test
* updated caniuse
* Close Realm when hooks are done
2022-04-26 17:07:55 -07:00
Amanda Bullington
5b47975443 Update version number 2022-04-11 11:10:43 -07:00
Amanda Bullington
d51760dca5 Bump version number and tweak fastlane setup 2022-04-05 15:51:30 -07:00
Amanda Bullington
b690139fd1 Add fastlane init files in android/ios subdirectories; set up internal and beta testing (#76) 2022-04-05 15:32:16 -07:00
Amanda Bullington
1ebf4b951d Bug fixes from beta 0.0.1 (#75)
* Add exception handler library; fix computer vision results

* Create loggedIn hook to check whether user is logged in before cv suggestions or upload

* Create user profile card on MyObs

* Update packages

* Add text for camera permissions denied

* Remove log

* Upgrade react native on iOS

* Add vendor file for ruby gems to gitignore

* Remove vendor file from github

* Update react native for android

* Add plural example to fluent; create TranslatedText component to render translations

* Add translations and update camera roll screens

* Small changes to uploader flow; add date/time picker

* Separate explore into landing screen and view screen

* Show total number of observations, explore

* Clean up styling and add details for grid view; banner for total observations in explore

* Add checkboxes for status, quality grade, media filters

* Add a lot of explore filters

* Show months in Explore filters

* Create About screen; sync package.json version using react native version

* Get explore filters in mostly working condition

* Observations download after login; clear login screen after nav; closes #62 and #60

* Allow separating photos if at least 1 combined photo obs is selected; closes #68

* Fix auth tests; add user id

* Pop text input above keyboard to address #66

* Lint cleanup

* Create bottom modal for user tapping back button on ObsEdit

* Check permissions on android only, camera

* Keep trying to get android camera working

* Change version number to 0.1.0
2022-04-01 15:46:51 -07:00
Ken-ichi
5a9aeb95ec Forgot a colon 2022-03-29 16:00:21 -07:00
Ken-ichi
e1872cba2c Added bug report issue template 2022-03-29 14:49:34 -07:00
Amanda Bullington
78cca57b0d Android permissions (#58)
* Get camera and sound recording working in Android

* Use obs uuid for create observation

* Fix no evidence upload screen; create new obs to upload

* Fix tests and flow errors

* Get photo gallery working on android; fetch more photos on user scroll

* Add alert for upload in progress

* Update build number

* Set up upload key for release build

* Make test todo
2022-03-22 13:07:16 -07:00
Nick McConnell
e20ca7110d #34 Show Messages - first attempt (#46)
* first pass

* some clean-up

* linting clean-up

* added a Q

* more cleanup

* Merge branch main of https://github.com/inaturalist/iNaturalistReactNative into 34-messages-0

# Conflicts:
#src/providers/hooks/useObservations.js

* simplify away from context and providers

* remove unused model

* remove model ref

* other clean-up

* add basic unit test for messages

* add activity indicator

* add test for activity indicator

* remove false positive tests

* fix navigation

* remove api params

* clean up

* move navigation and update test

* improve testing
2022-03-22 10:59:23 -07:00
Nick McConnell
d97310dfd5 Fixes Projects.test.js false positive problem (#54) 2022-03-17 14:04:29 -07:00
Amanda Bullington
e4b768f955 Add app icon, remove Flipper for production build on iOS 2022-03-16 15:20:28 -07:00
Amanda Bullington
4a4bccd28a Make app run on Android (#57)
* Fixes to make the app run on Android

* Update to android gradle.properties

Co-authored-by: Yaron Budowski <budowski@gmail.com>
2022-03-15 18:24:11 -07:00
Amanda Bullington
59508b6840 Merge user profile, obs detail updates (#56)
* Add to user profile

* Create a hook to fetch member projects

* Create custom header for user profile

* Updates to user profile; resize image for CV suggestions; build config for Android

* Bug fixes with obs list & CV suggestion fields

* Add functions for creating id, faving obs and adding comment in obsdetail

* Show comments as activity items; create comments and refetch obs data

* Fix activity item keys

* Add data to data tab, obs detail

* Let user unfave observation

* Fix camera modal

* Get tests passing
2022-03-15 18:00:54 -07:00
Amanda Bullington
94bd3dd270 Merge identify into main (#55)
* Create identify screen with gridview, grid items, agree button, agree API call

* Add dropdown to allow sorting by taxon and location

* Add activity indicator to grid items while waiting for agree

* Tweaks

* Create card swipe view for identify

* Add mark as reviewed; swipe right to agree on identifications for species rank
2022-03-10 10:27:35 -08:00
Amanda Bullington
759d8f15cd CV suggestions (#53)
* Create CV suggestions screen with taxa id search

* Show suggestions by observation lat/lng

* Switch to computervision score_image endpoint for suggestions

* Show identification on ObsEdit screen; select from CV suggestions screen

* User can select different observation photos to get diff CV suggestions

* Allow user to search for taxa to add identification to obs edit

* Add buttons for nav to taxon details and confirm id to CV suggestions

* Create custom side menu component

* Fix lint warnings

* Lint warnings
2022-03-07 14:41:07 -08:00
Amanda Bullington
6e228dd2b2 Observation uploader (photos, sound, no evidence) (#52)
* Get observation upload and obs_photo upload working with staging v1

* Add location with accuracy to normal camera uploads

* Add location and date to sound recordings

* Add camera options button to end of evidence list

* Add photos to obsEditProvider from camera, sound, and photo library

* Code cleanup

* Use ObsEditProvider as global state for uploader; support multi photo/sound; get test passing

* Set config to API v2
2022-03-01 16:56:25 -08:00
Amanda Bullington
b6b15dc8bc Merge location picker into main (#50)
* Start on location picker for obs edit

* Location picker updates

* Get basic location picker functionality working (search or pan map)

* Update current obs location from location picker

* Fix test failing on Map with no region props
2022-02-15 14:47:46 -08:00
Amanda Bullington
5caaf58c0b Merge login changes for staging server (#49)
* Override base URL for AuthenticationService + some integration fixes for Android

* Update lock file

* Trying to get staging JWT working; allow navigation from Login screen

* Code cleanup

* More code cleanup

* Fix tests; set username

Co-authored-by: Yaron Budowski <budowski@gmail.com>
2022-02-15 12:51:13 -08:00
Amanda Bullington
6f4e830026 Merge sound recorder, regular camera, nav without evidence, realm updates (#48)
* Build basic sound recorder; flow fixes

* More progress on sound recorder; add metering for visualization

* Flow fixes

* Use logged in user to fetch observations; use modified param to clean up realm code

* Hide tests that aren't passing; add mock for rn-localize

* Code cleanup - remove autolink

* Add member id lookup for projects screen

* Navigate to obs detail with sound recording; don't display photos

* Add basic camera with take photo functionality

* Toggle flash

* Add front camera; camera toggle

* Add pinch to zoom functionality

* Add tap to focus functionality; create focus square component for animation

* Add thumbnails to top of regular camera

* Parse photos from regular camera for ObsEdit

* Nav to obs edit with no photos/sounds

* Revert auth service

* Flow fixes AuthService
2022-02-12 10:40:29 -08:00
Amanda Bullington
03392f7da3 Merge login into main 2022-02-07 11:43:51 -08:00
Amanda Bullington
f1f7fcc382 Update lock files 2022-02-07 11:36:02 -08:00