* Don't require TS extensions in imports
* Resolve all import extension errors
* Remove file extension from import paths used in mocks
* Remove .d of type definition file paths
* Remove .d of type definition file and import as type
---------
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
* Update package.json
* Update package-lock.json
* Enable plugin
* Update package.json
* Update package-lock.json
* Update .eslintrc.js
* Create a new object instead of mutating the existing one
* Update SoundRecorder.js
* Do not mutate prop directly
* Do not mutate store value directly
* Disable compiler for zoom hook
Because it uses reanimated logic, and previous work laid out we should specifically disregard a rule of react here, unsure what to do here for now.
* Move array for tracking results into component
* Disable compiler for StandardCamera
* Do not mutate store value directly
* Disable compiler for FullPageWebView
* Do not mutate route param
* Remove unnecessary check if state is true before setting it to false
* Fix: user might be undefined
* Update reanimated usage with new compiler compliant API
* Fix: taxon might be undefined
* Fix: taxon might be undefined
* Fix: common pitfall of trying to render text outside of Text component
* Update interface
* Add package override
* Update package-lock.json
* Refactor updating of user preferences into User model
* Remove no memo directive from zoom
* Update file imports
* Migrate safeRealmWrite to TS
* Update interface and import path
* Update interface
* Refactor useLocaalObservation hook to not mutate return value of a function that should not be mutated
* Update tests to new return structure
* Remove useSafeRoute hook
We get the same information from error contexts and surrounding documents, and this hook was violating the rules of react by conditionally calling another hook.
* Use optional chaining
* Update TaxonNamesSetting.test.js
* Fix: use optional chaining
* Extend on RNTLs renderHook instead of re-implementing
* Remove unnecessary mock
* Remove unnecessary mock
* Remove unecessary mock
* Remove trailing spaces
* Implement infinite scroll in Projects
* Styling fixes for empty state in projects; add infinite loading wheel
* Resolve require cycle from ObsFlashList and FlashList shared components
* Order by distance and remove radius for nearby projects fetch
* Code cleanup
* Fix test
* Code cleanup
* Minor tweaks to search API request and results
* Refactor to use watchPosition
* Update useWatchPosition with permissions/retry
* Replace useUserLocation with useWatchPosition and fix tests; return userLocation from watch position hook
* Only update observation keys when there's an observation
* Improve TypeScript definitions
* Revert TypeScript commit
* Revert "Only update observation keys when there's an observation"
This reverts commit a4cd17a513.
* Code cleanup: make useWatchPosition more modular
* Code cleanup; location permission in ObsEdit instead of subcomponent
* Use correct accuracy in Camera photos
* Camera fixes
* Fixes to watching position in ObsEdit
* Fix useWatchPosition tests
* Fix tests
* Make sure state updates when renavigating to OsEdit; test fixes
* Fetch location continuously in cameras until accuracy falls below threshold
* Unit test for useUserLocation
* Added untilAcc option to useUserLocation
* Bugfix: ObsEdit was not always fetching location for new camera photos
Closes#1340
* Bugfix: TaxonDetails was crashing if it received a null taxon
* Send lat and lng instead of latitude and longitude to the score_image
endpoint
* Show offline suggestions when you are offline
* Show notice when viewing offline suggestions
* Moved code unique to useOnlineSuggestions into that file
* Ensure we use a medium size image to get suggestions when dealing with
remote URLs
* More logging around React Query retries
* Use default retry logic for useAuthenticatedQuery
* Made a module-resolver shortcut for tests
* Move offline notice above top suggestion; hide when offlines exist but onlines do too
* Start on project / details UI overhaul
* UI tweak
* Show HTML in ProjDetails; close search bar
* Add OverviewStats and relevant fetches to ProjectDetail
* Allow user to leave/join traditional projects
* Fix tests with mock react-native-paper
* Make minimum viable RemoteComment
* Minimum vialbe RemoteIdentification
* Minimum viable remote project, place, and messages
* Create minimum viable records for all remote factories
* Remove factories for local device data
* Minimum viable local taxon, comment, id
* Minimum viable for local observation photo (photo has no primary key)
* Minimum viable LocalUser
* Minimum viable record for LocalObservation
* Add DateDisplay to ObsCard and make first pass at translation strings
* Add failing tests (due to lack of localization) for timeless dates
* WIP: trying to ensure i18next gets initialized before tests run
The remaining test failures might be legit. This probably breaks the actual
app, though.
* Got the rest of the tests working
* Updated tests to assume UTC
* Updated README to advise against using `npx jest` so test runs always have
the env vars we specify in our `npm test` script
* Moved i18next initialization to an explicitly-named file
* Use i18next init function in app
* Fixed up remaining tests
* Added test for non-English localization of date format
* Cleanup
* Made DateDisplay explicitly handle strings not Dates
* Restore skipped localization tests for MyObservations
* Remove duplicative tests from DateDisplay unit test
* Added note to the README about initializing i18next
* Updated change to DateDisplay in main
---------
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
* Incremental changes to navbar component
* Fix tests
* Fix ally tests
* Space parens
* Add box shadow for android
* Add accessibility role
* Add a11y
* lint
* Add basic tests
* Fix tests
* Fix tests
* Update colors
* Merge remote changes
* Lint
* Add more comprehensive test
* Incremental changes to navbar component
* Fix tests
* Fix ally tests
* Space parens
* Add box shadow for android
* Add accessibility role
* Add a11y
* lint
* Add basic tests
* Fix tests
* Fix tests
* Update colors
* Merge remote changes
* Lint
* Add more comprehensive test
* switch to react native paper
* Make explore button nav to explore
* Remove inline styles
* Fix border on android
* Use user icon component in nav bar
* Rename props
* Remove t from nav button
* Change accessibility props
* Use a11y role for tabs
* Update NavBar.js
* Mock route for messages
* Mock route in tests
* Remove not needed function
* Remove NavBar unit test
* Create integration test file
* Add container mock to user profile test
---------
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
* 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
The problem has something to do with the unicode capitalization code that got
ported from the web. It seems like the JS engine in Android has a problem
with calling toUpperCase() on some unicode characters, and this gets around
that particular bug, plus one problem with a null check on a Realm
collection.
* 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>
* 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/react library to 0.4.0; fixes initialization error on android due to importing realm
* Use authquery for explore provider
* Use mutations for blocking/muting users, invalidating queries, and refetching settings data
* Add react mutation to create/update/delete api calls
* Use mutation for creating identification on identity/obs detail screens
* Use mutations to update and delete relationships
* Use mutation to revoke authorized apps
* Use mutation for updating user settings
* Fix ids on activity tab; fix safe area view; fix mark viewed
* Limit fields for remote observation api call
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
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>
* 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>
* 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
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
* 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
* 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