Commit Graph

11 Commits

Author SHA1 Message Date
Johannes Klein
1b4039eb36 417 eslint testing (#419)
* Add eslint-plugin-testing-library dependency

* Enable plugin inside tests folder

* Fix errors given by eslint-plugin
2023-02-01 12:50:59 +01:00
Johannes Klein
14d0239468 308 accessibility tests (#393)
* Regroup accessibility label strings at end of strings file
* Add accessibility test to AddID
* Add a11y labels to AddID
* Add a11y test to StandardCamera
* Add a11y props to StandardCamera
* Remove unit test with only todos
* Add a11y test to Messages
* Refactor PhotoScroll test into own file
* Add a11y test to ObsDetails
* Add a11y test to ObsList
* Add a11y matcher to PhotoGallery test
* Add a11y matcher to ProjectDetails test
* Add a11y matcher to ProjectObservations test
* Add a11y matcher to Projects test
* Add a11y props to ProjectList
* Add a11y props to ProjectTabs
* Add a11y matcher to Search
* Add a11y matcher to UserProfile test
* Add a11y test matcher to UserText test
* Update react-native-accessibility-engine
* Add a11y matcher to Tabs test
* Add a11y label to a selectable photo
* Refactor DataTab tests into separate file
* Refactor ActivityTab test out into own file
* Added a test how to check if a component uses a mocked container
* Add wrong a11y props to TextInput left icon
* Enable a11y test with actual BottomSheet because mock does not pass a11y props down
* Add a11y default props to Button
2023-01-27 12:30:57 -08:00
Amanda Bullington
0c4b9a5158 Fixes for API calls, useCurrentUser hook, api token not being fetched (#309)
* Random code cleanup

* Simplify useCurrentUser hook; only fetch messages if current user; closes #272

* Fix padding around login prompt button

* Code cleanup

* Fix projects; display search and tabs separately

* Remove log
2022-12-21 13:35:41 -08:00
Amanda Bullington
0d69fe1568 Fetch user locale from server and change language (#255)
* Fetch user from server, set locale in realm and change language with i18next
* Added some Spanish translations so I can see localization working
* config QueryClient with `cacheTime: Infinity` to deal with "Jest did not
  exit" errors

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2022-12-09 15:51:17 -08: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
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
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
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
Nick McConnell
d97310dfd5 Fixes Projects.test.js false positive problem (#54) 2022-03-17 14:04:29 -07: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