Commit Graph

239 Commits

Author SHA1 Message Date
Ken-ichi Ueda
3bc52a3e7f Minor touch-ups for unique keys and tests not wrapped in act 2023-02-07 23:41:56 -05:00
Chris
885f2e72d8 Location display component (#446)
Closes #438
2023-02-07 23:19:50 -05:00
Chris
4f732bace9 Create taxon name component (#444)
* Create taxon name component
* Switch to classnames

Closes #435
2023-02-07 23:13:27 -05:00
Chris
41e7fb3ff7 Obs status component (#443)
Closes #443
2023-02-07 22:52:58 -05:00
Ken-ichi Ueda
44f6410097 Use gradle to integrate custom icon font
Per
https://github.com/oblador/react-native-vector-icons#option-with-gradle-recommended.
This should theoretically keep the font up to date in Android when we update
the font file.
2023-02-07 21:12:41 -05:00
Chris
dc53c47a2a Date display component (#445)
Closes #437
2023-02-07 20:54:59 -05:00
Ken-ichi
09ab2de8d6 Remove eslint rule requiring acc. hint with label and other minor changes (#447)
* Added identification-solid icon
* Used ActivityCount on obs detail to test out label without hint
* Minor fixes to the README
2023-02-07 18:58:28 -05:00
Johannes Klein
e57aac93f6 418 create an index.js file for importing shared components (#427)
* Update .eslintrc.js

* Create index.js

* Change Button usage in GridItem

* Replace imports

* Add strings

* Add hint prop to button

* Add a11y hint prop to EvidenceButton

* Add EvidenceButton to index

* Add a11y props to EvidenceButton

* Update UiLibrary.js

* Add a11y props to CloseButton

* Add CloseButton to index and UiLib

* Rename function

* Update string

* Add a11y props to AddObsButton

* Add Tabs to index

* Linebreak

* Add Typography to index

* Remove unused text

* Refactor UserIcon test coverage in it's own test

* Add UserIcon to index

* Add UserIcon to UiLib

* Add InlineUser to index

* Add Quality badge to index

* Update UiLibrary.js

* Remove unused component

* Change AddObsButton a11y label

* Change hint

* Use consistent uri in snapshots

* Add snapshot to InlineUser

* Fix wrong user key

* Update Tabs.test.js

* Snapshot TODO

* Update NavButton.js

* Update snapshot

* Add snapshot for active user icon

* Remove snapshot result

* Add ActivityCount to index

* Update UiLibrary.js
2023-02-04 15:18:42 +01:00
Chris
70129f8d48 Update copy for observation uploads (#430)
* Update copy for observation uploads

* lint

* Use compass rose icon

* lint

* Fix tests

* Change accessibility label and hint

* Fix translation comment

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2023-02-04 15:18:08 +01:00
Angie
e14d620992 301 flag id functionality obsdetail (#333)
* Flag Id Modal created.

* Flag item modal radio buttons, styling, cancel button

* Flag Item Modal, Api Flags file created

* Added id field in Identifications realm schema, Flag Item Modal API call

* Clear form, toggle function, click title not just checkbox to toggle

* Fixed android checkbox toggle.

* Clean up. Flag ID ObsDetail. Closes #301.

* Flag realm model, flagged status shown on initial load

* Refresh observation after item flagged. In Progress.

* Remove console logs, add onError

* save button loading spinner

* Realm 31 migration for obsservation updated_at

* Flags test file

* FlagItemModal tests

* FlagItemModal tests

---------

Co-authored-by: Amanda Bullington <albullington@gmail.com>
2023-02-03 13:09:56 -08:00
Amanda Bullington
ba181e75fd Remove warnings about custom icons / Material icons in jest (#429)
* Mock INatPaperProvider to remove warnings about wrong icon names in jest; closes #421

* Remove unnecessary paper provider mock

* Add mocked views back to tests
2023-02-03 08:38:51 -08:00
Amanda Bullington
5bd4fc7ea9 Activity Count component (#426)
* Create ActivityCount component and add to UI Library

* Add accessibility label

* Make ActivityCount component compatible with identifications

* Localize numbers; add large number to UI library

* Fix ObsCard tests with waitFor ActivityCount

* Make testID dynamic and optional in ActivityCount
2023-02-03 08:30:40 -08:00
Chris
985defb28a Change progress bar color to inat green (#425) 2023-02-03 12:41:02 +01:00
Chris
158966b74e Fix nearby projects query for android (#406)
* Fix nearby projects query for android

* clean up code

* remove logs

* Fix delay and add loading return data

* Simplify hook

* Make minimal required changes

* Flatten if/elif

* Lint
2023-02-03 12:40:14 +01:00
Chris
44b28ff54e Incremental changes to navbar component (#407)
* 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>
2023-02-03 11:42:55 +01:00
Angie Ta
d2f992924d Fix svg fill color 2023-02-02 15:56:14 -08:00
Angie
d76446bbc6 Merge pull request #424 from inaturalist/397-qualitygradestatus-component
397 qualitygradestatus component
2023-02-01 16:58:17 -08:00
Angie Ta
4d606fbcd2 import cleanup 2023-02-01 15:44:36 -08:00
Chris
4e99ee3526 create view hider component (#412)
* Create view hider component

* Fix logic to be easier to use on consumer side

* Add tests

* Fix errors and tests

---------

Co-authored-by: Amanda Bullington <35536439+albullington@users.noreply.github.com>
Co-authored-by: Amanda Bullington <albullington@gmail.com>
2023-02-01 15:23:16 -08:00
Angie Ta
b71bc274e0 Merge branch 'main' into 397-qualitygradestatus-component 2023-02-01 15:15:45 -08:00
Angie Ta
65331ccf68 Accessibility labels to QualityGradeStatus component 2023-02-01 14:32:13 -08:00
Chris
11d05b5b01 Intro work to obs list toolbar redesign (#411)
* Intro work to obs list toolbar redesign

* Replace current upload prompt w/ toolbar

* Fix and skip locale tests

* Add resetting error to cleanup func

* Update icon size

* Make loading bar more accurate

* lint

* Fix file name

* Make requested changes

* Space parens

* Update UserCard.js

* Fix UserCard background color

* Fix navigation to Explore screen

* Small changes, mostly to get LoggedOutCard visible and tests passing

---------

Co-authored-by: Amanda Bullington <35536439+albullington@users.noreply.github.com>
Co-authored-by: Amanda Bullington <albullington@gmail.com>
2023-02-01 13:00:04 -08:00
Amanda Bullington
7d39c0f919 UI redesign: Typography components (#402)
* Add heading typography components

* Add typography components for body, list, and subheading

* Add font sizes/line heights to tailwind css

* Replace Text components in UI library with new typography; closes #383

* Update pixel size of fonts and use Heading2 throughout UI library

* Remove repeated logic from code

* Fix sizes for typography components
2023-02-01 12:40:25 -08:00
Ken-ichi Ueda
bd0d0953f7 Adjust test IDs to fix e2e tests 2023-02-01 11:16:22 -08:00
Johannes Klein
7bceb1214b 416 eslint a11y (#420)
* Add eslint-plugin-react-native-a11y dependency

* Do not fix warnings on eslint run

* Change all a11y error rules to warnings for now

* Add a11y hint to Tabs

* Add a11y prop to UserIcon

* Update strings.ftl

* Update strings

* Update README.md

* Update a11y props for InlineUser

* Update a11y label

* Add explanation for strings
2023-02-01 14:12:15 +01:00
Angie Ta
9d18e7a6b2 Merge branch 'main' into 397-qualitygradestatus-component 2023-01-31 20:27:13 -08:00
Angie Ta
4b26a44260 QualityGradeStatus component, replaced QualityBadge, import svg 2023-01-31 19:54:36 -08:00
Amanda Bullington
3f125beab6 Framework for adding custom icons to iNatRN (#414)
* 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
2023-01-31 16:45:11 -08:00
budowski
cca053ff39 110 upload sounds and obs separately (#395)
Closes #110

* #110 - upload photos/sounds separately from obs_photos/obs_sounds, using new API v2
* Updated package-lock.json with new version of inaturalistjs

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2023-01-31 16:35:08 -08:00
Chris
959a61316e Create base inline user component (#410)
* Create base inline user component

* make icon closer to spec

* use premade func

* Add unit tests

* Add unsaved changes

* Add unsaved changes

* Change a11y role to get branch to run without errors

* Fix comments

* Lint

* Add nav to user profile

* Move InlineUser in UiLib and use currentUser if true

* Add a11y label and testID

* Add currentUser to UiLib

* Reorder tests

* Rename mock

* Await photos in tests

* Fix order

* Refactor Inline to use UserIcon and add no internet icon

* Update UiLibrary.js

* Test also that unwanted images are not present

* Use InlineUser component in ObsDetail and ActivityItem

* Update UserIcon.js

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2023-01-31 21:41:26 +01:00
Chris
769fb124d8 Fix flatlist height in observations view (#409)
* Fix flatlist height in observations view

* Remove uneeded var

* Lint

* Readd parens
2023-01-30 16:36:23 -08:00
Johannes Klein
f8c403b9b1 353 retry with jwt (#382)
* Rename some functions and variables

* Rename function

* Revert to original timeout for tokens

* Get JWT for a 401 or 403 http errors in the react-query QueryClient retry handler

* Log API error to new logger

* Fetch token on every render in useApiToken hook

* Remove commented code

* Add comment

* Remove useEffect from useApiToken

* Revert "Remove useEffect from useApiToken"

This reverts commit 9cf1e0c0bc.
2023-01-29 10:09:50 +01:00
Angie
1299aeb014 350 cant tap next from standard camera on ipad in portrait orientation (#386)
* Standard Camera adjust for width when screen orientation changes. Closes #350.
* Remove SafeAreaView from StandardCamera
* Reduced pressable area for camera button
* Lock StandardCamera orientation to portrait mode on smaller devices, detect device rotation
* PhotoCarousel responsive to device rotation, mocks added to StandardCamera tests
* Image rotation when rotation to and from landscape mode
2023-01-27 16:31:28 -08: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
Johannes Klein
e947b21785 Correct DataTab title testID 2023-01-27 16:40:33 +01:00
Chris
bb4ccb36db 379 Make projects page use tab component (#389)
* 379 Make projects page use tab component

* Fix requested changes

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2023-01-27 11:05:53 +01:00
Chris
af7d47acf4 380 Make obs detail page use reusable tabs component (#385)
* Make obs detail page use reusable tabs component

* Fix requested changes

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2023-01-27 10:44:20 +01:00
Amanda Bullington
4597245b38 Update Button component with new styling (#388)
* Update Button component with new styling; closes #384
* Change button to Pressable instead of RNPaper to get border to show on Android
* Add disabled buttons to UI library
* Add multiple buttons in row
* Add multiple button examples
2023-01-26 16:05:14 -08:00
Ken-ichi Ueda
b5ceba376a Added UI Library component 2023-01-24 14:06:49 -08:00
Chris
a6762fd863 Create reusable tab components (#345)
* Create reusable tab components

* Add tests, accessibility, and nit changes

* Update a11y state to use expanded instead of selected add a11y role to parent

* Update Tabs.test.js

* Use screen, rearrange test, added expanded state

* Define default prop outside of component

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2023-01-24 15:04:54 +01:00
Ken-ichi Ueda
0f19faa0cc Test cleanup 2023-01-23 19:05:24 -08:00
Ken-ichi
7a7e6619e7 Fix sign out after force quit in Android (#375)
Removes intentional Realm file deletion to avoid unintentional Realm file deletion, though the latter remains something of a mystery.

* Configure Realm with the full path to the file
* Remove all Realm.open calls in AuthenticationService in favor of passing the
  context/provider copy of realm (only one realm instance)
* Only delete the realm file on sign out if deleting realm contents fails for
  some reason
* Replaced deleteRealm with semantically more accurate clearRealm

Closes #373
2023-01-23 18:34:58 -08:00
Amanda Bullington
08bcdfd589 Catch Android camera tap to focus error (#374)
* Wrap focus errors in try/catch; show focus box immediately with correct coords; closes #355
* Throw errors which are not startFocusAndMetering error

Closes #363

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2023-01-23 18:32:39 -08:00
Amanda Bullington
0e82f83c50 Bug fix for importing photos to obs without evidence; closes #365 (#381) 2023-01-23 18:30:41 -08:00
Amanda Bullington
6349fb8831 Add double tap to zoom in Camera; update Gesture API (#372)
* Update to newer Gesture.Tap and GestureDetector API; add double tap to zoom
* Update pinch to zoom to use newer Gesture.Pinch API
* Improve zoom by comparing saved value instead of checking velocity to determine zoom in/out
* Wrap focus errors in try/catch; show focus box immediately with correct coords
* Added withTiming to animate tap-to-zoom without animating pinch-to-zoom

Closes #355

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2023-01-23 18:20:17 -08:00
Ken-ichi
fa46546b44 Use different library for location fetching (#377)
* #369 - use different library for location fetching
* Use @react-native-community/geolocation everywhere, including tests

Co-authored-by: Yaron Budowski <budowski@gmail.com>
2023-01-23 16:50:30 -08:00
Amanda Bullington
5ced128ee9 Trigger system back button from Modal in Android (#378) 2023-01-23 16:09:44 -08:00
Ken-ichi
d8ff78b076 Only mark obs as viewed when an existing mutation is not in flight (#376)
Also changed useAuthenticatedMutation to be more in line with the docs (it was
working, though).
2023-01-23 16:34:49 +01:00
Amanda Bullington
9544eab730 Email debug logs from About screen; log sign in and sign out (#370)
* Set up logging for user signing in and out
* Set up button to email debug logs in About; closes #357
* Fix bug where signOut called too many times in App; code cleanup
* Add mocks to RNFS to get Auth tests passing
* Add simple test to make sure mailer is called on button press
* Added a file sharing fallback when Mail is not available in iOS
* Rename log extension

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2023-01-18 10:59:54 -08:00
Ken-ichi Ueda
e993f10a7a Added missing migration for optional Taxon.rank_level 2023-01-17 16:47:36 -08:00