* 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>
* Set default explore view to observations
* Rearrange ObservationsViewBar buttons to always show grid first and map first in Explore
* Set initialRegion of Explore map to same zoom level as location picker, using delta
* Consolidate map code into MapView with ref forwarding to allow animation & initialRegion set
* Stop controlling the map region from zustand, since we're using initialRegion
* Make sure we're not double animating when navigating to a new place
* Use ref to only get map boundaries exactly when they're needed, instead of tracking in state
* Make sure current location button does the same as NEARBY button
* Update Explore integration tests to reflect observations view as first view
* Fix navigation Explore tests to reflect landing on observations view
* Update MapView unit tests
* Check location permissions in MapView on current location button
* Code cleanup
* Fix tests and add test for location permissions
* To Mob 720: add some types and null guards (#2878)
* Update Map with Region type
* Type initialRegion
* Guard against null
* Guard against undefined coordinates
* Center loading indicator but not fill space (#2880)
Move the loading indicator to the center of the parent (and back left and top for half its size).
---------
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
* remove assumed and undocumented meaning of page being zero from our use of
useInfiniteScroll in Explore; uses explicit type checks instead
* document byzantine pagination logic in useInfiniteExploreScroll
* fix broken infinite scroll when sorting by faves (was only showing first
page)
The underlying problem from 96c316a was setting initialPageParam to 1 in
useAuthenticatedInfiniteQuery, which seems rational, except
useInfiniteExploreScroll was using a false-ish value of page to detect when
it was requesting its first page. This does the same by being more explicit
about page's type without injecting undocumented meaning into the params we
hand to useInfiniteScroll.
* refactor: move Explore page param munging into unit tested helper
Closes MOB-400
Simplified version of MyObs for signed out users with more than 1 obs. Currently only in debug mode.
Also:
* refactor: extract TaxonGridItem into a reusable component
* chore: TypeScript cleanup
Closes MOB-317
* reduce prop surface area for map-related components
* map just receives an observation, not a bunch of its properties
* adjust a lot of logic based on observation.obscured to more specific logic
based on whether the current user can view the coordinates
* hide the map on ObsDetails if there are no coordinates
* show the spec'd explanation for why coordinates are obscured
* remove a prop that just hides a component if true; that should really be up
to the outer context
* fixed a bug on ObsDetail where the remote obs wasn't getting mapped to
Realm-ish attributes
* prevent button mashing from opening multiple TaxonDetails
* clean out the state related obs create / edit after exiting that flow so
that TaxonDetails (or anyone else trying to detect an obs being edited)
doesn't end up finding it when the user has finished creating / editing.
Closes#2271
* 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
Solves the problem of Explore changing the region when applying a taxon filter
on top of an existing map area or nearby filter, but also adds similar
functionality whenever the observation bounds change, e.g. for a user
filter.
* Change connectivity url to ping inat; remove unnecessary useIsConnected hook; closes#1770
* Ensure inaturalist.org/ping is being pinged
* Fix e2e tests by using isConnected, not isInternetReachable
* Show observations by defaulting to user location
* Remove log
* Create useHeaderCount hook to load user location count before global count
* Header count and location permission fixes
* Remove log
* Fix Explore tests
* Test fixes and add blocked/denied state
* Remove Explore Filters screen
* State for Explore filters modal
* Accept modal state in Header to open modal
* Basic explore filters modal
* Save taxon object to explore state on update
* Update types expected
* Pass state and update function into filters modal
* Receive new props
* Destructure taxon from props
* Restyle header View
* Add main Heading
* Add taxon section
* Restyle modal header
* Add numbers badge component
* TaxonResult add prop for general on press
* Make TaxonResult checkmark optional
* DisplayTaxon can receive children as right-side component
* Refactor ExploreFilters component tree
* Move header out of scroll view
* Update ExploreFilters.js
* Update ExploreFilters.js
* Add icon to display taxon
* Update ExploreFilters.js
* Add basic taxon search screen
* Use taxon result without checkmark, send taxon to Explore screen
* Add string
* Accept taxon on explore screen
* Add a dummy screen for explore location search
* Add type
* Store place in state when received as route param
* Basic explore filters location section
* Add strings
* Move filter modal to separate component, add sort by props
* Add screen for testing purposes
Because atm we can not have two modals open at the same time, I move filters to a separate screen for testing the other modals.
* Add initial filter params and do not pass down undefined ones
* Pass function to update sort by down
* Create SortBySheet.js
* Navigate to test screen instead
* Sort by button text
* Add default filters definition
* Call reset function if filters are not default
* Add prop and function to reset
* Add user search screen
* Move search screens
* Move references
* Replace list with flash list
* Add item separator
* Remove footer
* Return user to Explore
* On press handle for user list item
* Fix wrong imports
* If a user is in prop show user icon and edit button instead
* Refactor display taxon to be inside a Pressable
* Missing import
* Receive user in explore rout params
* Quality grade section header
* Placeholder
* Add TODO
* Calculate number of filters set
* Only send user id to explore screen
* Do send back user object, filter out user_id
* Add project section
* Refactor project list item into standalone component
* Change initial value to undefined
* Add project search screen
* Remove loading state
* Show project in filter modal
* If project is in param set it to state
* Add Checkboxes to filter modal
* Remove comment
* Taxonomic Ranks section UI
* Use props for checkboxes
* Update ExploreContainer.js
* Calculate actual query param
* Is Most Faved possible?
* Actually set sort by query params
* Save hrank and lrank to explore state, prop down
* Update ExploreContainer.js
* Show ranks in button text
* Radio modal to test taxonomic ranks
* Add sticky toolbar
* Update strings.ftl
* Date observed section bottom sheet
* Date observed prop
* Change padding
* Date observed all UI
* Taxonomic ranks section
* Add todo
* Refactor open sheets state
* Update button
* Add exact date picker sections
* Store dates in state
* Update strings.ftl
* Refactor function name
* Refactor constants
* Reset date states on mode change
* Set new months to state on change
* Configuration for showing months checkboxes
* Receive and update months with checkboxes
* Refactor RadioButton sheet to export radio button row
* Add Media section UI
* Add media state to Explore
* Start with Establishment Means section
* Add checkbox texts
* Add states
* Functions to update state
* Add sort by param for most faved
* Spacing for checkboxes
* Wild Status section UI
* Wild status state
* Reviewed UI section
* Reviewed state
* Set current user id as viewer_id for review true to work
* Remove testing code
* Photo licensing UI section
* Photo license state
* Prop down photo license update, use param in search
Forgotten in previous commit
* Unused prop
* Add noStatus state
* Change Establishment Means status to TODO
* Add TODO text
* Console log for testing params
* After rebase from main this was necessary
* Simple switch between two UIs
* Simple explore context
* Lift Provider one up
* Copy over photo license to new provider
* Copy over review filter
* Refactor to use enum
* Copy over wild status, and enum refactors
* Refactor some more state
* Remove unused navigation
* Refactor one state
* Refactor some more state
* Refactor some more state
* Remove testing screen
* Refactor some more state and derived state
* Do send over project as param from Project Details
* Update FilterModal.js
* Rename components
* Remove unused param handling
* Add keys
* Remove substring for key
* lrank and hrank combined counts as one only
* Use the correct constants
* Add key
* Fix issue with button text
* Add View Wrapper for filters section
* UI cosmetics
* Compare current filters state to a snapshot
* Change button level to focus
* Add context action to revert to snapshot
* Confirmation dialog strings
* Add confirmation sheet
* Send current user along to Explore from Home Header
Closes#887
* Date bottom sheets texts
* Show texts in modal
* Set search to worldwide on param received
* Send taxon as param to Explore from Taxon details screen
Closes#889
* Show all observations worldwide of project
* On species view pressed should navigate to explore species view
Closes#893
* Go to explore from users profile
* Navigate to species view from user profile
Closes#894
* Enable unclear filters
* Add taxon to context
* Use context for explore params further down the tree
* Refactor one state
* Remove unused action
* Remove unused state
* Refactor function
* Refactor state
* Refactor place_id, which concludes reducer refactor
* Refactor names
* Do not use key inside context's state
* Add a11y label
* Remove duplicate test ID
* Remove superfluous component
* Create ProjectListItem.test.js
* Add failing filter modal test
* Remove log
* Rename function
* Months strings
* Remove todo
* A11y labels
* Remove TODOs
* A11y label
* A11y label
* Refactor taxon search hook
* Update FilterModal.js
* A11y labels
* A11y not possible in react-native-paper lead to test fails
* Update TaxonSearch.test.js
* Add dropshadow
* Another dropshadow
* Add TODO text to UI elements that are not finished
* Reverse order
* Refactor constants
* Revert "Refactor constants"
This reverts commit 2f52e936d6.
* Refactor to use constants
* Refactor constants use
* Refactor constant use
* Refactor constants use
* Refactor constants use
* Refactor constants use
* Refactor code
* Add validation of date format
* Correct type for snapshot action
* Add taxonomic rank enum
* Taxon can be undefined
* More precise type
* Fix wrong string usage
* Refactor radio button row component
* Refactor ProjectListItem import
* Example usage of new ui elements
* Pull sort by sheet back inside filter modal
* Rename params
* Add useEffect dependency
* Rename param
* Fix broken function
* 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
* Rewrite remote observation & update fetching using useQuery in ObsList
* Fix ObsList test by adding query provider
* Add padding to infinite scroll view indicator
* Only set next uuid for obslist if not still loading results from last api call
* Improve how ObsList works when observations don't fill screen
* Remove explore, explore provider, dropdown menu, and related screens; fix tests
* Move setIdBelow function into onEndReached
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>
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
* 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
* 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
* 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>