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

Ignore deleted team members on project's page #320

Merged
merged 4 commits into from
Apr 25, 2022

Conversation

shalapatil
Copy link
Contributor

@shalapatil shalapatil commented Apr 25, 2022

Notion card

https://www.notion.so/saeloun/Able-to-add-a-deleted-team-member-to-project-team-5fc1026dbe544a2c9a45067be9a0f6fd

Summary

Deleted team members were available in project team members add dropdown. Fixed it to not show deleted team members.

Preview

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Checklist:

  • I have manually tested all workflows
  • I have performed a self-review of my own code
  • I have added automated tests for my code

@github-actions
Copy link

Current Code Coverage Percent of this PR:

99.52 %

Files having coverage below 100%

Impacted Files Coverage
/app/controllers/invoices_controller.rb 63.64 %

Copy link
Contributor

@rohitjoshixyz rohitjoshixyz left a comment

Choose a reason for hiding this comment

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

Try to split the spec into more scenarios.
In this case,
For company_users#index they could be
it "lists company 1 company_users"
"does not list company 2 company_users"
"does not list discarded company users"

Copy link
Contributor

@rohitjoshixyz rohitjoshixyz left a comment

Choose a reason for hiding this comment

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

1 suggestion, rest LGTM 🎉

result = [ { id: user1.id, name: user1.full_name }, { id: user2.id, name: user2.full_name }]
expect(json_response["users"]).to match_array(JSON.parse(result.to_json))
end

it "does not return the discarded users of company1" do
expect(json_response["users"].map { |user| user["id"] }).not_to include user4.id
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
expect(json_response["users"].map { |user| user["id"] }).not_to include user4.id
expect(json_response["users"].pluck("id").not_to include user4.id

end

it "does not return the users of company2" do
expect(json_response["users"].map { |user| user["id"] }).not_to include user3.id
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
expect(json_response["users"].map { |user| user["id"] }).not_to include user3.id
expect(json_response["users"].pluck("id")).not_to include user3.id

@supriya3105
Copy link
Contributor

@apoorv1316 Please test this is working as expected. If yes, please merge

@apoorv1316
Copy link
Contributor

It's working fine. We can merge this once Rohit's suggestions are implemented. @supriya3105 @shalapatil

@shalapatil shalapatil merged commit 52ee20b into develop Apr 25, 2022
@shalapatil shalapatil deleted the ignore-deleted-team-members-on-project branch April 25, 2022 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants