Commit Graph

4199 Commits

Author SHA1 Message Date
Yaron Budowski
4aee237978 Fixes according to PR notes 2022-02-05 18:18:37 +01:00
Amanda Bullington
37743f0652 Merge photo gallery and obs edit into main (#45)
* Add gallery library; hide camera stack in drawer navigation since we can't use a tab navigator

* Add gallery permissions ios and android

* Move to obs edit screen when a photo is selected from gallery

* Make sure camera options modal closes on navigate

* Create shared hook for reverse geocoded locations

* Obs edit; dismiss keyboard; uuid generator

* Use popup modal to search for projects / taxa from obs edit & add to obs

* Obs edit updates

* Add i18next mock for global testing

* Add tests for photo gallery

* Add test for obs edit

* Get album picker working and store albums + photos in ObsEditProvider

* Maintain photo selection across multiple photo albums

* Create GroupPhotos screen with photos sorted by timestamp across all albums

* Add styling for group photos

* Pseudocode for grouping photos

* Combine photos into observations in photo gallery

* Remove photos from camera roll selection on group photos screen

* Fix remove photos function

* Finish combine, separate, remove photo functionality

* Display multiple obs and multiple photos on obs edit screen

* Code cleanup

* Code cleanup again

* Show number observation at top of obs edit screen

* Update navigation

* Get one photo gallery test passing

* Fix obs edit test

* Fix warning eslint

* Make tests happy

* Remove unused variable
2022-02-04 09:59:49 -08:00
Yaron Budowski
a9bb14c34e ESLint fixes 2022-01-30 23:51:45 +01:00
Yaron Budowski
491de2f7e1 ESLint fixes 2022-01-30 23:51:01 +01:00
Yaron Budowski
2947bb6514 Merged; fixed issue with installCoreFunctions; tests to AuthenticationService 2022-01-30 23:47:42 +01:00
Amanda Bullington
5d543d617a Add /projects/search endpoint (#42)
* Create projects screen which searches projects and changes API params on button press

* Create project details screen which makes an API call by project id

* Clean up project code; get one project test passing

* Basic styling for project details; add project observations grid

* Add testing for project details

* Add loading wheel to project obs
2022-01-24 12:03:50 -08:00
Ken-ichi
9ea8bf7070 i18n with Fluent and i18next (#40)
* Support localization with i18next and Fluent

* src/i18n/strings.ftl holds all application strings. If you're going to add a
  string, add it there
* src/i18n/l10n/ has all the translations (or localizations), both .ftl files
  in Fluent format and .ftl.json files in which the file structure is JSON
  but the values are Fluent strings
* src/i18n/i18ncli.js is a CLI tool to generate files and code given
  localizations in .ftl files

So the process for adding strings looks like

1. Update src/i18n/strings.ftl
2. Add strings to code using the useTranslation hook
3. Run `node src/i18n/i18ncli.js ftl2json`
4. Build

* Set up for use with Crowdin CLI or github integration

* Added some example strings that might not change

* Expanded README to explain how to add new text
2022-01-24 12:02:44 -08:00
Yaron Budowski
7cc7ece8df Implementation of getAPIToken / getAnonymousJWTToken / getJWTToken 2022-01-17 16:35:03 +01:00
Ken-ichi
d773b2120f Restore skip-duplicate-actions (#39) 2022-01-12 17:19:12 -08:00
Amanda Bullington
c5c50b3c24 Merge projects / project details into main (#38)
* Create projects screen which searches projects and changes API params on button press

* Create project details screen which makes an API call by project id

* Clean up project code; get one project test passing

* Basic styling for project details; add project observations grid

* Add testing for project details
2022-01-12 14:27:51 -08:00
Amanda Bullington
e2216cb8be Rename copyRealmSchema method 2022-01-07 14:21:32 -08:00
Amanda Bullington
7883120abb Pull and merge latest from main 2022-01-07 12:29:49 -08:00
Amanda Bullington
c400e20b7f Add yaml file for gitguardian 2022-01-07 12:28:56 -08:00
Amanda Bullington
846b73a861 Search screen + test coverage (#26)
* Create Explore screen

* Add input field component

* Add input fields

* UI for list view in Explore; dropdown taxa picker

* UI for list view in Explore; dropdown taxa picker

* ObservationViews component is shared between Explore and My Observations

* Get tests passing with Explore + ObservationViews

* Add map view, iOS location permission whenInUse, and geolocation fetch

* Add RN permissions and geolocation to jest mocks

* Explore filters, testing, explore provider/navigation stack

* Crash fix for grid items with no observation photos

* Code cleanup; move fetch search results to shared folder

* Code cleanup; remove duplicate files

* Use shared hooks for search

* Remove more duplication

* Display search results, similar to on web

* Show a list of search results for users/taxa and allow toggling

* Consolidate pickers into a single component

* Move copyRealmSchema into Observation model

* Move copyRealmSchema into Observation model

* Move observation photo logic to Obs model

* Obs details fetches an observation from API instead of from realm/exploreList

* Rename hooks files with 'use' instead of 'fetch'

* Add user to observation schema

* Change realm keys from camelcase to snakecase with mapping

* Simplify model code

* Fix tests for ObsDetails

* Attempt to clean up ObsList code; move useObservations hook into provider

* Simplify copyRealmSchema code

* Code cleanup

* Add test coverage for Search

* Add testing for users search

* Add gitguardian pre-commit hook

* Update ggshield

* Testing ggshield

* Add .env back to gitignore
2022-01-07 12:25:27 -08:00
Amanda Bullington
9ef85a6818 Explore and explore filters (#24)
* Create Explore screen

* Add input field component

* Add input fields

* UI for list view in Explore; dropdown taxa picker

* UI for list view in Explore; dropdown taxa picker

* ObservationViews component is shared between Explore and My Observations

* Get tests passing with Explore + ObservationViews

* Add map view, iOS location permission whenInUse, and geolocation fetch

* Add RN permissions and geolocation to jest mocks

* Explore filters, testing, explore provider/navigation stack

* Crash fix for grid items with no observation photos

* Code cleanup; remove duplicate files

* Remove more duplication

* Consolidate pickers into a single component

* Move copyRealmSchema into Observation model

* Move copyRealmSchema into Observation model

* Move observation photo logic to Obs model

* Obs details fetches an observation from API instead of from realm/exploreList

* Rename hooks files with 'use' instead of 'fetch'

* Add user to observation schema

* Change realm keys from camelcase to snakecase with mapping

* Simplify model code

* Fix tests for ObsDetails

* Attempt to clean up ObsList code; move useObservations hook into provider

* Several minor changes to get tests passing

* Stopped mocking useObservation hook in MyObservations integration test; this
  should not be mocked in an integration test since the point is to test the
  integration of all the different moving pieces within the app, and it was
  causing a failure because it was mocked but none of the methods were
  actually provided with mock responses, so it wasn't doing anything
* Used the LocalObservation factory for ObsDetails.test.js, where the
  useObservation hook should return an observation in the Realm schema
  (or something like it), not in the remote schema
* Updated the LocalObservation factory to meet expectations

* Attempting to work around weird problem with fkirc/skip-duplicate-actions

* Removed fkirc/skip-duplicate-actions from CI for now

* CI fix

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2022-01-07 11:38:50 -08:00
Amanda Bullington
72f136f4b9 Add .env back to gitignore 2022-01-06 13:44:24 -08:00
Amanda Bullington
c5cc5de9b5 Testing ggshield 2022-01-06 13:30:43 -08:00
Amanda Bullington
21704d89cd Update ggshield 2022-01-06 13:27:41 -08:00
Amanda Bullington
bbb313f386 Add gitguardian pre-commit hook 2022-01-06 13:26:35 -08:00
Amanda Bullington
95f4d1740f Add .env to gitignore 2021-12-21 11:35:54 -08:00
Yaron Budowski
4f855834cd Sign up / login flow - initial implementation 2021-12-13 15:34:13 +01:00
Amanda Bullington
e8da272dbd Taxon detail; testing coverage (#21)
* Fetch taxon details from API v2

* Add basic styling, html renderer, Wikipedia link

* Add testing for TaxonDetails API results

* Code cleanup

* Upgrade accessibility engine

* Add testing for ObsDetails

* Check that data tab renders when user taps it

* Make user profiles dynamic and tappable from ObsDetail

* Add test coverage for user profile

* Test navigation and linking to wikipedia

* Add accessibility roles and test todos

* Add grid view to observation list

* Add accessibility roles to pressables in obslist
2021-12-02 14:49:07 -08:00
Amanda Bullington
e206970c8c Pre-commit hooks; Realm updates
* Move realm object creation functions into realm classes

* Make all fields except for uuids optional in realm & update schemaVersion

* Add pre-commit hooks for linting

* Add eslint automatic fix line

* Testing pre-commit hook

* Still testing

* Tweak husky settings and remove lint-staged

* Add a Taxon realm shared by Observation and Identification; add listener for obs list changes

* Create new User realm model for Comments/Identifications

* Remove code comments from models

* Add loading wheel while ObsList is fetching initial data

* Move observations into stack within drawer navigator

* Remove unneeded code

* Look up existing obs using .objectForPrimaryKey method

* More code cleanup (naming, adding primary keys, etc.)

* Merge testing code from main; remove unused imports

* Add more factories and fix ObsCard tests

* Update tests to match updated realm models

* Move ObservationProvider to wrap MyObservationsStackNavigator instead of all navigation

* Remove code comments

* Add primary keys to User and Taxon schemas

* Update realm models to include ObservationPhotos

* Get integration test to pass with new realm schemas
2021-11-24 15:48:14 -08:00
Ken-ichi
523da746f2 Several updates to testing (#17)
* Several updates to testing

* Restructured tests so they are in their own dir at the root
* Added an integration test that mocks the response from inaturalistjs
* Instead of mocking Realm, I mocked the Realm config so it writes to an
  in-memory database for tests
* Added test data factories with factoria and faker

TODO
* Try mocking hooks to make a unit tests for the ObsList component; it should
  be possible to write unit tests for components with hooks
* Data in the in-memory Realm db is probably sticking around between tests; we
  need a way to trash the db after each test

* Tried to address logbox failure in Github Actions test run

* Tried bumping the timeout for tests for github actions

* Added skip duplicates and Slack notification to test action

* Added unit test for ObsList

* Seriously, how much time do you need to run a test...

* Added missing factory import

* Test fixes for context & providers

* DRY out ObsList.test.js a bit

* Made ObsList.test.js synchronous

In theory I suspect all component tests should be synchronous because if
you've mocked out all the hooks, there should be no reason to wait for
effects to complete.

Also removed subscriptionRef which didn't seem to be doing anything.
2021-11-19 13:53:44 -08:00
Amanda Bullington
375b5fe1a8 Set up context/providers for managing global state (#18)
* Move obs hooks into context/providers

* Refetch observations from realm any time user lands on obs detail

* Code cleanup: observation provider for accessing local realm observations throughout app

* Remove unused code
2021-11-17 11:36:30 -08:00
Amanda Bullington
075073b78b Add react native modal for camera navigation; add messages nav to obs list header 2021-11-16 15:35:48 -08:00
Amanda Bullington
3365f835a6 Fill in side menu with placeholder screens (#16)
* Fill in placeholders for side menu

* Tweak text
2021-11-15 16:59:53 -08:00
Amanda Bullington
355ea3a533 Remove kotlin version (used for watermelondb testing) 2021-11-13 07:49:49 -08:00
Amanda Bullington
543b52ef8d Merge latest from main. Merge branch 'main' of https://github.com/inaturalist/iNaturalistReactNative 2021-11-12 17:11:09 -08:00
Amanda Bullington
3536fa15ae Move all RN/JS code under src folder to (hopefully) make things easier to find & edit 2021-11-12 17:10:54 -08:00
Amanda Bullington
493ff99b30 Add install details to README 2021-11-11 17:22:19 -08:00
Amanda Bullington
6953408ee5 Use staging api for inatjs 2021-11-05 12:41:45 -07:00
Amanda Bullington
d6d4b5aa01 Test and github actions fixes 2021-11-04 17:16:05 -07:00
Amanda Bullington
a113ba97a4 Switch to npm install 2021-11-04 17:09:50 -07:00
Amanda Bullington
e0f40926bb Add Github Actions config file for unit tests 2021-11-04 17:00:16 -07:00
Amanda Bullington
67f130fe59 Code cleanup; add accessibility engine to test suite 2021-11-04 16:36:52 -07:00
Amanda Bullington
ff6789c32c Merge obs list, obs card, and user profile into main (#4)
* Obs detail screen skeleton; move safe area view to wrapper component

* Progress on obs detail

* Get ids and photos from api v2

* Fetch data needed for data tab in obs detail

* Create basic map for data tab, centered on lat/long

* Create linked realms for photos and identifications; access these on obs detail screen

* User Profile and more setup for test suite

* Delete coverage directory

* Add Jest coverage folder to gitignore

* Keep trying to mock out fetch for inatjs in ObsList.test.js

* Rename ObsList.test to match component name
2021-11-04 15:44:57 -07:00
Amanda Bullington
845004b0df Update README.md 2021-11-04 11:35:21 -07:00
Amanda Bullington
750f7d729a Merge realm + jest implementation into main (#3)
* Struggles with git

* Continued struggles with git stash

* Database experiments

* Get API v2 implementation working with fetch

* WatermelonDB fetch; API v2; RN testing library set up; pods installed

* Enable hermes

* WatermelonDB working with Jest; code cleanup; install latest inatjs

* Experiment with migrations in WatermelonDB

* Remove WatermelonDB from project

* Continue removing watermelonDB

* Add observation schema; remember to remove hermes

* Create local realm observations from observations/search fetch

* Wrap ObsList test in navigation container; add realm files to gitignore
2021-10-15 18:03:49 -07:00
Amanda Bullington
ec922e7c4f Merge incoming changes from main 2021-10-12 17:15:21 -07:00
Amanda Bullington
fe6d44085d Drawer + stack navigation (#2)
* Create a hook to fetch a particular user's observations; add basic styling to obs cards

* Delete prettier config file

* Create stack navigator, footer with shadow

* Create stack, drawer nav and footer component

* Remove default hamburger icon in header
2021-10-12 17:11:30 -07:00
Amanda Bullington
f856fd7b92 Lastest XCode config. Merge branch 'main' of https://github.com/inaturalist/iNaturalistReactNative 2021-10-08 15:56:03 -07:00
Ken-ichi Ueda
71e707f725 Renamed xcode scheme to match repo 2021-10-06 14:59:09 -07:00
Amanda Bullington
180da57723 Create a hook to fetch a particular user's observations; add basic styling to obs cards 2021-09-30 15:14:03 -07:00
Amanda Bullington
a839f7867c Add eslint rules & make lint fixes 2021-09-15 11:16:47 -07:00
Amanda Bullington
bc71c97055 Update repo name to iNaturalistReactNative 2021-09-13 16:41:59 -07:00
Amanda Bullington
de47bb5596 Update README.md 2021-09-13 15:49:03 -07:00
Amanda Bullington
d4adde847d Create RN repo with npx react-native init 2021-09-13 14:38:14 -07:00
Amanda Bullington
118bf72804 first commit 2021-09-13 14:36:51 -07:00