* 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>
* Rename file
* Migrate flow to TS
* Update type
* Update type
* Rename file
* Update useTranslation.ts
* Check if instanceof Error
* Update imports
* Update type
* Rename file
* Migrate translatedRank to TS
* Migrate DisplayTaxonName to TS
* Also accept number for taxonId
* Those types are currently not optional
* Revert "Migrate translatedRank to TS"
This reverts commit c69cc18061.
* Rename taxon.js
* Add interfaces and types
* Remove adding a key to the function param
* Move fetchTaxonAndSave back to original file
* Move interface
* Update import
* Update types
* Rename some variables for clarity
* This is how it currently props down from only HOC
* Update imports
* Rename file
* Add param interface
* Update imports
* Revert "Move fetchTaxonAndSave back to original file"
This reverts commit 981ce228e8.
* Move fetchTaxonAndSave to own file
* Type inference is easiest way for React components
* Rename file
* Remove unused props
* Add types
* Update type
* Infer return type
* Update import
* Add interface
* Rename const and interface
* Update import (Merge conflict)
* Change text to size 2
* Change text size for date to Body2
* Change text size for other data to Body2
* Adjust tappable height for other data
* Adjust tappable height for date picker
* DatePicker TS
* Change padding of location section
* Push pixels to center icons with first line of text
* Fix a UI issue with evidence list not scrolling to the sides of the screen
* Align all icons at same vertical axis
* Apply margin to evidence list and iconic taxon list
* Add specific keys for determiners as pronouns
* Adjust permission gate text
* Remove a duplicative key
* Remove jargon like 'modal' from accessibility hints
* Make x-of-y style phrases easier to pluralize
* Update staff list
* Dehyphenate (de-hyphenate?) real time, break up long sentence
* Change black text to dark gray text
* Start simplifying to a single color scheme
* Remove custom paper theme colors
* More theme cleanup
* Styling specifically for RNPaper components
* Update snapshots to use hex colors, not rbga
* Customize back button; move icon assets into our image dir
* Fix ContextHeader with updated back button
* Fix styling around back buttons
* Fix taxon details header
* Test fix
* Fix signed in e2e test
* 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
* Replace name in permission requests
* TakePhoto TS
* PermissionGate TS
* Type
* PermissionGateContainer TS
* Interface
* Types
* LocationGate TS
* Remove LocationPermissionGate from Camera
* Remove write only permission
* Type
* ObsPhotoSelectionList TS
* Code style
* Show the improve with location button
* Create useLocationPermission.tsx
* Use new hook on suggestions
* Doc comment
* Use new hook in camera view
* Add strings
* Refactor Explore main content
* Use permission hook on RootExplore
* Add no location permission component
* Rename function
* Prop request permissions and use with button
* Default to Nearby label
* Remove Node type
* Projects TS
* Use useLocationPermission hook in projects screen
* Add string
* Prop permission down
* Refactor list render
* Refactor tab id into enum
* Tab type
* On nearby tab if without permission show button to prompt
* Leftovers
* Remove location permission gate from ObsEdit
* Use location permission hook on evidence section
* SearchBar TS
* Do not autoFocus on search bar in location picker.
Closes#1743
* Update type
* LocationSearch TS
* Show location permission gate on location picker's mount
* Add location permission to CurrentLocationButton
* Remove unused props of Map
* Remove unused exports from useMapLocation
* Migration
* Revert "Show location permission gate on location picker's mount"
This reverts commit 30ff75698c53d54d0b14cd2bd629f7155b743bf8.
* Add callbacks to useLocationPermission hook
* Show location permission ask on Obs Edit
* Remove unused string
* Reset explore filters should set location always to worldwide
* Add helper function to show place text in Explore
* Remove unused state of filter modal
* Show place text in filters modal with helper
* Show location permission button only for Nearby explore state
* Add a placeMode state
* Do not send placeMode to API
* Also treat limited permission as yes
* useLocationPermission in ExploreLocationSearch
* Refactor to setting place mode
Instead of logic based on the translated text of the place_guess string that is stored in ExploreContext, we are switching to an enum state that signifies which mode to show on explore:
1.) Nearby: Filters explore results based on the user's location. This also has a state without location permission that does not query the API.
2.) Place: Filtering by a specific place (as retrieved by /places API).
3.) Worldwide: Retrieve worldwide results, i.e. not having a place filter set.
4.) Map area: Filtering explore results precisely to the map rectangle shown on the explore map.
* Remove import from test
* Remove export
* Use blocked title only for blocked permission asks
* Move gallery permission container to Tab navigator as are the others
* Add gallery save title
* Split location permission explanation into two
* Update strings.ftl
* Only nav to location picker if permission was not granted
* Check permission on app being foregrounded
* The location permission part is handled by useLocationPermission
* Do not store permission result in hook
* Use hasPermission from permissions hook
* Update fetchUserLocation.e2e-mock
* Move hook one higher
* Show user location if permission is given
* PermissionGate callbacks should use useCallback
* Add permission hook to map usage
* Fix test
* Update layout to be asserted
* Add location permission hook to Explore
* Remove console.log
* Few TS fixes
* Indentation
* Remove superficial check
* Update Podfile.lock
* Add typescript parser and fix Flow errors in JS files
* Uninstall packages from react-native/eslint-config
* Fix all flow errors (or ignore them for unknowns
FYI, this also essentially outlaws variables in translation keys because a key
that is only used with interpolated strings will never appear as "used".
Also starts using a convention of adding info to i18n keys that do not relate
to the text after double dashes, e.g. `Unknown--taxon = Unknown` for a string
that is specifically meant to describe a missing taxon but only needs to have
the word "Unknown".
* Changed several accessibilityHints to 3rd person
* Made several accessibilityLabels shorter and more verb-oriented
* Removed many unused i18n keys
* Refactored variables in i18n keys
* Removed some unused code from the old Settings
* Added basic navigation test for StandardCamera & SoundRecorder
* Abstracted camera nav buttons and used in SoundRecorder
* Show sounds in the MediaViewer
* Added sounds to ObsEdit, w/ MediaViewer support
* Ensure sounds get both uploaded and added to observations
* Local sound deletion
* Remote sound deletion
* Rudimentary and deeply unperformative sound visualization
Closes#869
* Show person icon as fallback when user is offline; closes#946
* Prevent thumbnails in EvidenceList from being clipped; closes#847
* Forgot to switch back to main before new code. Revert "Show person icon as fallback when user is offline; closes#946"
This reverts commit 13b0a1a1aa.
* #856 - support for modifying and updating observation photos locally/remotely; reordering of photos fix
* ESLint fix
* Fixed tests
* Fixed tests
* Fixes related to tests
* Access MediaViewer from TaxonDetails
* Added our own presets for ActivityIndicator
* TaxonDetail should show a local taxon if one is available
* Made it a little easier to import the custom logger
* Refactored MediaViewer to accept photo-like objects instead of URIs
* Added license / attribution button to MediaViewer
* Moved delete button into MainPhotoDisplay so each photo has its own button
and it can be laid out relative to its photo
* Add custom header to MediaViewer when accessed from TaxonDetial
* Allow DisplayTaxonName to accept custom text components as props
* Added darker bg to photo on TaxonDetail to make title more legible
* Add zustand to app
* Begin replacing ObsEditProvider with zustand for global state
* Use store and add tests
* Fix bugs
* Add test to check for deleted photos in StandardCamera
* Make sure evidence is only added to current observation; submit comment with ID on ObsDetail
* Fix ObsEditWithoutProvider tests
* Move store to where it's needed
* Fix tests
* Await evidence being added to obsPhotos from camera
* Add a note about slices to useStore
Fixes#907. Also adds an ObsEditOffline test for adding a new obs offline...
which doesn't actually catch this bug, but may catch others. This bug may
have been due to a race condition that doesn't happen in the test env for
some reason.
* Update to realm 12
* Remove unused mocks to fix some tests
* Fix test by unmocking ObsEditProvider
* Fix more tests by removing mocks/changing when tests write to realm
* Remove mocks on ObsEdit component test and fix accessibility labels
* Fix hooks tests with realm
* Set test path for realm; finish fixing tests
* Small tweak
* Upgrade realm/react library
* Migrate schema
* Simplify ObsEditProvider by moving functions into local state & calling reducer less frequently
* Fix delete all observations
* Fixes
* Move index selection to MediaViewer via params
* Access ObsEditContext on top level of ObsEdit and pass props
* Move context to top level screen components
* Fix tests
* Use waitFor to fix ObsDetails integration test
* Alphabetize props; remove realm check; refactor new Id method
---------
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
Primarily adds designed layouts for permission gates (also referred to as permissions priming).
* moved permission gate business logic into a container
* use react-native-permissions exclusively
* Show PermissionGate as a modal
* Basic unit tests for PermissionGate
* Consistent content width on tablet, other minor style changes
* Allow PermissionGate to be used outside of nav hierarchy
* Use user location on Explore after getting permission
* Remove redundant 'always' location perm in ios
* Isolate current location button in the Map component, which uses location fetching functionality from react-native-maps instead of our own
* Updated cocoapods; matched INatIcon.ttf to sha1 hashes
* Use drag and drop to let a user change photo positions
* Fix tests
* Add test for EvidenceList
* Fix tests
* Fix state for no evidence / no observation photos
* Add unit tests for empty list and displaying obs photos
* Move login and camera screens into stack navigators
* Navigation fixes
* Create ObservationsStackNavigator
* Move drawer items into drawer nav
* Navigator fixes and improvements
* Nav improvements
* Fix navigation from ObsEdit
* Fix test
* Fix test
* Redo bottom tab nav with Explore as part of ObservationsStack
* Use ObsEdit and AddID in two stacks
* Move identify into ObservationsStack and fix headers
* Fix ObsEdit bottom button issue by using fixed positioning for tab bar
That required a few other changes to places where we were explicitly
compensating for the height of the tab bar. Also fixed some other minor
layout issues.
* Typo
* Add LocationPicker to ObservationsStackNavigator
---------
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
* Refactor camera buttons into their own components
* Standardize camera buttons & make TaxonResult a reusable component
* Fix button styling in tablet landscape; create confidence interval
* Create camera container with shared functionality for both cameras; fix tests
* Connect results & loading status from native predictions; standardize results on iOS/Android
* Fix Camera test by mocking CameraView and FrameProcessor components
* #629 - wait for bottom sheet to dismiss before navigating away to next screen
* Fix accessibility test failure
---------
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
Writes photos out to external storage at capture time, and updates GPS EXIF fields when observation is saved. Closes#392. There is a known bug in Android causing landscape photos to be inverted.
---------
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
* Add activity indicator to fetch location
* Add e2e location mock (#643)
Adds a mock for fetchUserLocation intended to be used with e2e tests. `MOCK_MODE=e2e` must be in the ENV for this to work.
---------
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
---------
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
* Make MediaViewer a navigation screen; support changing landscape/portrait orientations
* Move device orientation into hook
* Minor fixes to styling
* Styling updates based on breakpoints
* PhotoScroll styling and header styling
* Data Tab renamed to Details Tab, styling to match designs, changed text strings,
* Fixed failing tests for ObservationLocation, dividers added for activity item
* Moved geoprivacy to ObservationLocation, removed console logs
* Moved suggest id and add comment buttons out of activity tab, added stickybar, PhotoScroll buttons, back button
* Show headerbackbutton when no image
* Bugfix: coordinates didn't have enough fractional digits
---------
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
* Crosshairs, location accuracy warnings, text input for location picker
* Add LocationPicker tests
* UI improvements and code refactor into smaller components; get GMaps working
* Add shadows to icons/text boxes
* Use debouncing to avoid map jitter when typing in location
* Show place results & let user pick new location from web api
* Add tests for location picker with remote results
* Add gmaps api key to github actions
* Try adding manifest placeholders for env variable to work in github actions
* Add key to printf in github actions
* Try accessing GMAPS_API_KEY a different way
* Update android e2e env file step
This updates the "Create .env file" step to use printf to print the Google Maps key into a newly created .env file in the GitHub Action runner. Using the same key as in env.example.
* Fix newline
---------
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
* Add KebabMenu to shared components index
* Separate EvidenceList from PhotoCarousel component
* Remove unneeded props from PhotoCarousel
* Create notes bottom sheet
* Fix tests for delete obs sheet
* Add wild status sheet
* Show date from observations uploaded via website
* Move media viewer modal into evidence section
* Fix mock
* Move location fetching into its own hook
* Refactor ObsEdit header; move code into Header component
* Add discard changes sheet
* Styling updates and save changes button
* Add classes to buttons based on evidence/id missing
* Add imprecise location sheet
* Add jest.fn from provider to ObsEdit tests
* Remove fakeTimers from ObsEditWithoutProvider.test.js; minor cleanup
* Show discard obs sheet anytime a user tries to navigate back
* Fixes to bottom sheet backdrop, evidence, add discard changes sheet
* Switch to paper radio buttons instead of checkmarks
* Fix bottom sheet backdrop in android by wrapping with GestureHandlerRootView
* Update bottom sheet for add comment & notes
* Fix test
* Remove fake timer from ObsEdit test to get tests passing
* Force update github actions cache
---------
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
* Styling updates to ObsEdit screen
* Fix padding/margins and font style in TextInput
* Styling updates for identification section
* UI changes; add checkmarks for evidence
* Only show arrows for multiple observations
This uses an npm package to convert SVGs into an icon font, allowing us to
not step on each others' toes when adding new icons in branches and
simplifying the icon addition process. It also allows us to track changes to
the icons, and embed them directly as SVGs if we need to.
---------
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
* Add custom iNat icon font to iOS and Android
* Add custom icon to iNat UI library
* Create custom iNat icons using IconButton for add obs modal & footer
* Add icon placeholders to observation edit screen
* Test fixes for accessibility
* Move paper provider into new component; fix names in UI library
* Update README with clarified directions about changing the name of the .ttf file