Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Ignore deleted team members on project's page#320

Merged
shalapatil merged 4 commits intodevelopfrom
ignore-deleted-team-members-on-project
Apr 25, 2022
Merged

Ignore deleted team members on project's page#320
shalapatil merged 4 commits intodevelopfrom
ignore-deleted-team-members-on-project

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 🎉

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
Collaborator

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
vipulnsward pushed a commit that referenced this pull request Feb 15, 2026
* Ignore deleted team members on project's page

* Ignore deleted team members on project's page

* Use pluck instead of map
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