glific / mobile

8 stars 17 forks source link

Add Collection to Contact and Contacts to Collection #169

Closed VishalZ123 closed 1 year ago

VishalZ123 commented 1 year ago

Collection to Contact and Contact to Collection addition feature

Description

The PR implements the Add collection to contact feature on the contact chat screen and Add contacts to collection feature on the collection chat screen. Depending on the chat screen type (contact or collection) we fetch all options for contacts or collections respectively via GET_CONTACTS & GET_COLLECTIONS_LIST queries. We also fetch the collections in which the current contact is added or contacts added in the current collection respectively via GET_CONTACT_COLLECTIONS & GET_COLLECTION_CONTACTS queries. We use MultiSelect for selecting the options and selected and deleted options are used to make a mutation ADD_COLLECTIONS_TO_CONTACT or ADD_CONTACTS_TO_COLLECTION to add/delete options. The MultiSelect component was changed to remove the close button.

Changes Made

https://github.com/glific/mobile/assets/76409986/72de9ece-bd1f-4172-b43d-3907af4fbbdd

Related Issues

Closes: #156 & #157

Reviewer

@mdshamoon & @ajaman190 Please Review


ajaman190 commented 1 year ago

@VishalZ123 Please fix all possible deep scan problems first.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 32.91% and project coverage change: -2.10% :warning:

Comparison is base (2c9e8c8) 72.37% compared to head (9778709) 70.27%. Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #169 +/- ## ========================================== - Coverage 72.37% 70.27% -2.10% ========================================== Files 91 93 +2 Lines 1448 1514 +66 Branches 128 139 +11 ========================================== + Hits 1048 1064 +16 - Misses 356 405 +49 - Partials 44 45 +1 ``` | [Files Changed](https://app.codecov.io/gh/glific/mobile/pull/169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=glific) | Coverage Δ | | |---|---|---| | [components/messages/ChatPopup.tsx](https://app.codecov.io/gh/glific/mobile/pull/169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=glific#diff-Y29tcG9uZW50cy9tZXNzYWdlcy9DaGF0UG9wdXAudHN4) | `69.23% <ø> (ø)` | | | [components/messages/CollectionPopup.tsx](https://app.codecov.io/gh/glific/mobile/pull/169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=glific#diff-Y29tcG9uZW50cy9tZXNzYWdlcy9Db2xsZWN0aW9uUG9wdXAudHN4) | `6.12% <6.12%> (ø)` | | | [components/ui/MultiSelect.tsx](https://app.codecov.io/gh/glific/mobile/pull/169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=glific#diff-Y29tcG9uZW50cy91aS9NdWx0aVNlbGVjdC50c3g=) | `92.85% <50.00%> (-7.15%)` | :arrow_down: | | [components/headers/ChatHeader.tsx](https://app.codecov.io/gh/glific/mobile/pull/169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=glific#diff-Y29tcG9uZW50cy9oZWFkZXJzL0NoYXRIZWFkZXIudHN4) | `82.25% <63.63%> (-1.38%)` | :arrow_down: | | [screens/Chat.tsx](https://app.codecov.io/gh/glific/mobile/pull/169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=glific#diff-c2NyZWVucy9DaGF0LnRzeA==) | `80.00% <75.00%> (-0.89%)` | :arrow_down: | | [constants/popupsData.ts](https://app.codecov.io/gh/glific/mobile/pull/169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=glific#diff-Y29uc3RhbnRzL3BvcHVwc0RhdGEudHM=) | `100.00% <100.00%> (ø)` | | | [graphql/mutations/Contacts.ts](https://app.codecov.io/gh/glific/mobile/pull/169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=glific#diff-Z3JhcGhxbC9tdXRhdGlvbnMvQ29udGFjdHMudHM=) | `100.00% <100.00%> (ø)` | | | [graphql/queries/Collection.ts](https://app.codecov.io/gh/glific/mobile/pull/169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=glific#diff-Z3JhcGhxbC9xdWVyaWVzL0NvbGxlY3Rpb24udHM=) | `100.00% <100.00%> (ø)` | | | [graphql/queries/Contact.ts](https://app.codecov.io/gh/glific/mobile/pull/169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=glific#diff-Z3JhcGhxbC9xdWVyaWVzL0NvbnRhY3QudHM=) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.