Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added pinning functionality in the create post modal #1354

Merged
merged 7 commits into from
Jan 17, 2024

Conversation

pateldivyesh1323
Copy link
Contributor

What kind of change does this PR introduce?

Feature: Added pinning functionality to create post modal

Issue Number:

Fixes #1122

Did you add tests for your changes?

Yes

Snapshots/Videos:

Talawa.Posts.-.Google.Chrome.2024-01-02.14-21-43.mp4

If relevant, did you update the documentation?

No

Does this PR introduce a breaking change?

No

Have you read the contributing guide?

Yes

Copy link

github-actions bot commented Jan 2, 2024

Our Pull Request Approval Process

We have these basic policies to make the approval process smoother for our volunteer team.

Testing Your Code

Please make sure your code passes all tests. Our test code coverage system will fail if these conditions occur:

  1. The overall code coverage drops below the target threshold of the repository
  2. Any file in the pull request has code coverage levels below the repository threshold
  3. Merge conflicts

The process helps maintain the overall reliability of the code base and is a prerequisite for getting your PR approved. Assigned reviewers regularly review the PR queue and tend to focus on PRs that are passing.

Reviewers

When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

CONTRIBUTING.md

Read our CONTRIBUTING.md file. Most importantly:

  1. PRs with issues not assigned to you will be closed by the reviewer
  2. Fix the first comment in the PR so that each issue listed automatically closes

Other

  1. 🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
  2. Read the CONTRIBUTING.md file make

Copy link

codecov bot commented Jan 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (84c6697) 97.35% compared to head (e927adf) 97.35%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1354   +/-   ##
========================================
  Coverage    97.35%   97.35%           
========================================
  Files          143      143           
  Lines         3589     3590    +1     
  Branches      1047     1047           
========================================
+ Hits          3494     3495    +1     
  Misses          90       90           
  Partials         5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aashimawadhwa
Copy link
Member

can you please increase padding between the text "pin post" and chose file input field in the create post modal

@pateldivyesh1323
Copy link
Contributor Author

@aashimawadhwa Done👍

image

Copy link
Member

@aashimawadhwa aashimawadhwa left a comment

Choose a reason for hiding this comment

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

please make the requested changes

@@ -110,6 +113,7 @@ function orgPost(): JSX.Element {
text: postinfo,
organizationId: currentUrl,
file: postImage || postVideo,
pinned: pinPost,
},
});
/* istanbul ignore next */
Copy link
Member

Choose a reason for hiding this comment

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

remove this /* Istanbul ignore next */ comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aashimawadhwa I have removed the comment and the test coverage dropped. To increase the test coverage I was trying to update tests to bring them back to 100%. But every single tests in src/screens/OrgPost/OrgPost.test.tsx which calls CREATE_POST_MUTATION are throwing error after it is called. The test were written exactly before that point where it starts throwing error, that is why they are currently passing.

The error looks like this:
ApolloError: No more mocked responses for the query: mutation CreatePost($text: String!, $title: String!, $organizationId: ID!, $file: String, $pinned: Boolean) { createPost( data: {text: $text, title: $title, organizationId: $organizationId, pinned: $pinned} file: $file ) { _id } } , variables: {"title":"Dummy Post","text":"This is dummy text","file":"","pinned":false}

I have tried many solutions, but nothing is actually worked. Please help.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aashimawadhwa Should I comment it out again for now?

Copy link
Member

@beingnoble03 beingnoble03 Jan 17, 2024

Choose a reason for hiding this comment

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

@pateldivyesh1323 yes, please add the comment here.
@aashimawadhwa It just conveys Istanbul to not consider the if branch for code coverage. And, I guess it's not possible to test this branch. We have been using this comment in similar conditions in every other part of the codebase. For now, we can continue having this here.

Copy link
Member

@beingnoble03 beingnoble03 left a comment

Choose a reason for hiding this comment

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

Rest changes LGTM. Thanks @pateldivyesh1323!

@pateldivyesh1323
Copy link
Contributor Author

@beingnoble03 Thanks for the review, I have added the comment again.

Copy link
Member

@beingnoble03 beingnoble03 left a comment

Choose a reason for hiding this comment

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

LGTM.

@palisadoes palisadoes merged commit 5e4b1e1 into PalisadoesFoundation:develop Jan 17, 2024
8 of 9 checks passed
@pateldivyesh1323 pateldivyesh1323 deleted the 1122 branch January 23, 2024 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants