Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

[Feature] Search users / show friends / add friend / delete friend #115

Merged
merged 23 commits into from Apr 14, 2020
Merged

[Feature] Search users / show friends / add friend / delete friend #115

merged 23 commits into from Apr 14, 2020

Conversation

geoseong
Copy link
Member

@geoseong geoseong commented Feb 27, 2020

Description

Features and Contributors

Related Issues

resolve #106
#98

Tests

  • Implemented with Apollo's MockedProvider
    • snapshot
    • renders loading, error view
    • [Help Wanted] can't figure out how to handle graphql's data state after loading and refetching
      • SearchUser.test.tsx
      • Friend.test.tsx

Checklist

Before you create this PR confirms that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the [CLA].
  • Run yarn lint && yarn tsc
  • Run yarn test or yarn test -u if you need to update snapshot.
  • I am willing to follow-up on review comments in a timely manner.

@geoseong geoseong marked this pull request as ready for review February 27, 2020 15:34
@geoseong geoseong changed the title [Feature] Search users / show friends / add friend / delete friend [Feature][WIP] Search users / show friends / add friend / delete friend Feb 27, 2020
@codecov
Copy link

codecov bot commented Feb 27, 2020

Codecov Report

Merging #115 into master will decrease coverage by 2.70%.
The diff coverage is 57.14%.

@@            Coverage Diff             @@
##           master     #115      +/-   ##
==========================================
- Coverage   86.22%   83.51%   -2.71%     
==========================================
  Files          37       37              
  Lines        1183     1189       +6     
  Branches      123      129       +6     
==========================================
- Hits         1020      993      -27     
- Misses        101      130      +29     
- Partials       62       66       +4     

@CLAassistant
Copy link

CLAassistant commented Mar 28, 2020

CLA assistant check
All committers have signed the CLA.

@geoseong geoseong changed the title [Feature][WIP] Search users / show friends / add friend / delete friend [Feature] Search users / show friends / add friend / delete friend Mar 29, 2020
@geoseong geoseong requested a review from hyochan March 29, 2020 07:51
Copy link
Member

@hyochan hyochan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you rebase this and see how you can improve some of test coverage?

src/graphql/mutations.ts Outdated Show resolved Hide resolved
geoseong and others added 13 commits April 7, 2020 11:56
* Add sample error container to handle graphql error (#112)
* Add sample error container for graphql error
* Add error asset
* Implement [ErrorView] shared component
* Set timer before judging the navigation on startup
* Implement [ChannelCreate] screen to start chatting with multiple users (#113)
* Enhance [SearchTextInput] for [SearchUser]
* Add [ChannelCreate] screen and fab in [Channel] screen
* Enhance [ErrorView] and use it in EmptyListComponent
  - Add ability to set custom title, body, buttonText and hide button.
* Implement [ChannelCreate] screen wich [CheckBox]
* CheckBox toggle on press
* Fix [UserListItem] child width
* Add ability render tablet with testUtils
* Improve test coverage
* Add query to collect users
* Attach apollo to collect actual data from server('hackatalk-server')
* Fix tsc errors
* Rebase upstream master branch
* Add "MockedProvider" and clear console.error's Warning message
 - Add "MockedProvider" in test code
 - make following warning message disappear
   "Warning: An update to Screen inside a test was not wrapped in act"
* Apollo Error Handling and add refetch typing
* Add useQuery's error handling test case

Co-authored-by: Hyo Chan Jang <dooboolab@gmail.com>
* Add friends
* Show user name
  run effect if data changes
* Show loading and error
* Modify test code
* lint
* SearchUser: update test code to resolve snapshot test failure
* Add friends
* Show user name
  run effect if data changes
* Show loading and error
* Modify test code
* lint
* Fix refetch generic type
* Add friends
* Show user name
  run effect if data changes
* Show loading and error
* Modify test code
* lint
* Add friends
* Fix refetch generic type
* Delete comments

Co-authored-by: TaeSeong Park <imf4@naver.com>
* squash commits
* Revert test file back,

Co-authored-by: Gordon <godon019@gmail.com>
Co-authored-by: Ted Kim <dev.ted.kim@gmail.com>

* remove incompatible codes

Co-authored-by: Ted Kim <dev.ted.kim@gmail.com>
* Implement remove friend mutation
* Implement remove friend
* Refactor ProfileModal.deleteFriend, delete mutation
* Refactor ProfileModal
* Implement <ProfileModal/> test code
* Refactor naming remove to delete
* Refactor remove to delete
* Fix mutation wrong argument error
* Implement delete the friend in list when the friend is deleted
* Fix lint
* Update <ProfileModal/> test case
* Update snapshots
* Update readme
* Delete comments
* Implement to use QUERY_FRIENDS of useQuery than useFriendContext when delete a user and update friend list
* Update <ProfileModal/> test code
* implement updated "users" graphql query
* update "users" graphql's query variables
* Update snapshot of 'ProfileModal'
* Some version of PODS updated via 'pod install'
* Update 'users' query and type
* Implement "Relay-style cursor pagination"
* Implement basic test code
* Filled in Missing fields of result of 'QUERY_FRIENDS'
* Add test case: "change text in SearchTextInput"
… files

```
ReferenceError: You are trying to `import` a file after the Jest environment has been torn down.
...
TypeError: stacktraceParser.parse is not a function
```
geoseong and others added 5 commits April 7, 2020 12:08
* Update props of ProfileModal
* Update testcases of ProfileModal
* Refactor ProfileModal.test
* Use ternary operators in rendering & add retrieved variable "isFriendAlreadyAdded"
* Remove legacy codes
* Figuring out what is the reason of problem when testing:
" Network error: No more mocked responses for the query: query users($filter: Boolean, $user: UserQueryInput, $first: Int, $last: Int, $before: String, $after: String) "

* Friend: Remove legacy code
* Add "ios/assets/" to gitgnore list
* Refactor funciton name & Add attribute in Props to inject from caller
@geoseong
Copy link
Member Author

@hyochan I think I ready to merge it. but ci/circleci: android returns error

#!/bin/bash -eo pipefail
yarn build:android
yarn run v1.12.3
$ ENVFILE=.env.prod react-native bundle --entry-file index.js --platform android --dev false --bundle-output android/main.jsbundle --assets-dest ./android
Loading dependency graph, done.
error node_modules/@react-native-community/viewpager/js/index.js: ENOMEM: not enough memory, read. Run CLI with --verbose flag for more details.
Error: ENOMEM: not enough memory, read
    at Object.readSync (fs.js:494:3)
    at tryReadSync (fs.js:333:20)
    at Object.readFileSync (fs.js:362:19)
    at Object.sync (/home/circleci/dooboo/node_modules/gensync/index.js:177:19)
    at Object.readFile (/home/circleci/dooboo/node_modules/gensync/index.js:204:19)
    at Generator.next (<anonymous>)
    at /home/circleci/dooboo/node_modules/@babel/core/lib/config/files/utils.js:37:36
    at Generator.next (<anonymous>)
    at Function.<anonymous> (/home/circleci/dooboo/node_modules/@babel/core/lib/gensync-utils/async.js:26:3)
error Command failed with exit code 1.

maybe it's circieci's configuration problem?

@geoseong
Copy link
Member Author

@hyochan and also I modified content of Tests section in main description. please check

@hyochan
Copy link
Member

hyochan commented Apr 14, 2020

Thanks for the great work everyone! I'll handle the rest.

Copy link
Member

@hyochan hyochan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done all you wonderful people!

There are few things I want to mention here.

  1. Try to add logics such as useMutation in ProfileModalProvider instead in ProfileModal itself. It is more general way as in redux container pattern.
  2. Try to add input types for graphql along with the queries and not in which you'd like to use query.
  3. Add enter after the paragraph. Single lines of code can stay together without enter but it looks much better with next line if the codes are in paragraph.

For number 1, it should be enhanced in the near future.

Thank you again for all your hard work and bring things in the community.

@hyochan hyochan merged commit ca9f94d into dooboolab-community:master Apr 14, 2020
@hyochan
Copy link
Member

hyochan commented Apr 15, 2020

@all-contributors please add @00aney for code, test.

@allcontributors
Copy link
Contributor

@hyochan

I've put up a pull request to add @00aney! 🎉

@hyochan
Copy link
Member

hyochan commented Apr 15, 2020

@all-contributors please add @qkreltms for code, test.

@allcontributors
Copy link
Contributor

@hyochan

I've put up a pull request to add @qkreltms! 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Search users / show friends / add friend / delete friend
4 participants