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

Crystal fix tasks of members are hidden when teams toggle is off #1127

Conversation

crystallow1168
Copy link

@crystallow1168 crystallow1168 commented Oct 8, 2024

Description

image

Bug priority high

Related PRS (if any):

To test this backend PR you need to checkout the development frontend PR.

Main changes explained:

  • Implement condition so that users (besides Owner/Admin/Core Team) cannot view team's tasks when their team toggle visibility is off

How to test:

  1. Check into current branch: git checkout crystal-followup-fix-so-tasks-of-members-are-hidden-with-the-teams-toggle
  2. Do npm install, npm run build and npm run start to run this PR locally
  3. Clear site data/cache
  4. Log as Admin user
  5. Go to Dashboard → Other Links→ Teams →…
  6. Add members to the team to test. Verify that user with team visibility toggle off:
  • Owner role -> Can view other members tasks
    User with Owner role visibility toggle off still can view other member’s task

  • Admin role -> Can view other members tasks
    User with Admin role visibility toggle off can still view other member’s task

  • Core Team role -> Can view other members tasks
    User with Core Team role visibility toggle off still can view other member’s task

  • Manager role -> CANNOT view other members tasks
    User with Manager role visibility toggle off cannot view other member’s task

  • Volunteer role -> CANNOT view other members tasks
    User with Volunteer role visibility toggle off cannot view other member’s task

  • Volunteer role (user has 2 teams)-> CANNOT view other members tasks
    User with Volunteer role visibility toggle off cannot view other member’s task, testing with 2 teams

Screenshots or videos of changes:

How to set team member visibility's toggle. (refer to video below)

How.to.set.team.member.visibility.s.toggle.mp4

Example of changes when testing user: Crystal Volunteer with Volunteer role. (refer to video below)

PR.1127.-.User.with.team.visibility.toggle.off.cannot.view.other.member.s.task.mp4

Copy link

@Ankuriboh Ankuriboh left a comment

Choose a reason for hiding this comment

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

The code doesn't work on my end. It will always show other members' task whenever I've set to disable my own visibility.

_myTeam.members.forEach((teamMember) => {
if (!teamMember.userId.equals(userid)) teamMemberIds.push(teamMember.userId);
if (teamMember.userId.equals(userid) && teamMember.visible) hasTeamVisibility = true;

Choose a reason for hiding this comment

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

As long as the user that is requesting is the last user and was set as visible in settings, they could see all other users as well as their tasks. You didn't check if the user has necessary permission (i.e. if they're an Owner/Administrator/Manager).

_myTeam.members.forEach((teamMember) => {
if (!teamMember.userId.equals(userid)) teamMemberIds.push(teamMember.userId);
});
}
Copy link

@Ankuriboh Ankuriboh Oct 8, 2024

Choose a reason for hiding this comment

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

You can use teamMembersIds.push(_myTeam.members.filter(m => !m.userId.equals(userid)).map(m => m.userId)); for shorthand.

@one-community one-community added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Oct 8, 2024
@lucy-xfl lucy-xfl removed their request for review October 8, 2024 22:20
@crystallow1168
Copy link
Author

The code doesn't work on my end. It will always show other members' task whenever I've set to disable my own visibility.

Hello, @Ankuriboh did you set the visibility specifically from the Team page?
Dashboard → Other Links→ Teams → Select the team which has the user you are testing -> turn off the toggle for the user that you are testing. I added a video to show how to set team member's visibility toggle.

How.to.set.team.member.visibility.s.toggle.mp4

@one-community one-community merged commit 97a2e55 into development Oct 14, 2024
3 checks passed
@Ankuriboh
Copy link

The code doesn't work on my end. It will always show other members' task whenever I've set to disable my own visibility.

Hello, @Ankuriboh did you set the visibility specifically from the Team page? Dashboard → Other Links→ Teams → Select the team which has the user you are testing -> turn off the toggle for the user that you are testing. I added a video to show how to set team member's visibility toggle.

How.to.set.team.member.visibility.s.toggle.mp4

Hi, thanks for the kindly reply. It could probably be some problems on my end. But I tried on frontend PR #2766 development preview, toggling off the "see all" option as an administrator wouldn't allow me others on the tasks page. Is this working as intended? Because the "see all" tips says that it does "NOT reduce visibility for Owner, Admin or Core Team roles".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants