Skip to content

fix(project-dashboard): Show projects without teams #90355

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

Conversation

priscilawebdev
Copy link
Member

@priscilawebdev priscilawebdev commented Apr 25, 2025

Problem
I encountered an issue while transferring projects between organizations. The scenario is as follows:

  1. I had projects in orgA.
  2. I transferred the projects from orgA to orgB.
  3. When I navigated to the projects dashboard with "All Teams" selected, I couldn’t see the newly transferred projects because they hadn’t been assigned to a team in orgB yet.

As a result, the projects were not displayed on the dashboard, even though they existed in the system, simply because they weren't associated with a team at the time - this was confusing as the projects became invisible.

Screen.Recording.2025-04-25.at.08.59.04.mov

Solution
Now, when "All Teams" is selected, all projects will be displayed, even those without a team assigned. While we may want to add a separate label (e.g., "Unassigned Teams") in the future, for now, we are displaying these unassigned projects under the "All Teams" filter, giving them visibility and preventing confusion.

Screen.Recording.2025-04-25.at.08.57.51.mov

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 25, 2025
@@ -81,6 +82,64 @@ function addProjectsToTeams(teams: Team[], projects: Project[]): TeamWithProject
}));
}

function getFilteredProjectsBasedOnTeams({
Copy link
Member Author

Choose a reason for hiding this comment

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

Since there's a significant amount of code dedicated to filtering the projects, I extracted it into a new function to make it clearer and more manageable

Copy link

codecov bot commented Apr 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #90355      +/-   ##
==========================================
- Coverage   87.78%   79.35%   -8.44%     
==========================================
  Files       10263    10278      +15     
  Lines      580480   578856    -1624     
  Branches    22646    22661      +15     
==========================================
- Hits       509595   459325   -50270     
- Misses      70450   119093   +48643     
- Partials      435      438       +3     

? otherTeamsInAll
: [...otherTeamsInAll].filter(team => selectedOtherTeamIds.has(String(team.id)));

const visibleTeams = [...myTeams, ...otherTeams].filter(team => {
Copy link
Member Author

Choose a reason for hiding this comment

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

this contained duplicated entries too

Copy link
Member Author

Choose a reason for hiding this comment

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

ok this actually have to contain duplicates, otherwise the test "renders correct project with selected team" breaks.

@priscilawebdev priscilawebdev requested review from scttcper and a team April 25, 2025 07:39
@priscilawebdev priscilawebdev marked this pull request as ready for review April 25, 2025 07:39
);
const currentProjectIds = new Set(currentProjects.map(p => p.id));
const unassignedProjects = isAllTeams
? projects.filter(project => !currentProjectIds.has(project.id))
Copy link
Member

Choose a reason for hiding this comment

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

does this need to check showNonMemberProjects? Orgs that have open team membership disabled may not want to show them

Copy link
Member Author

@priscilawebdev priscilawebdev Apr 28, 2025

Choose a reason for hiding this comment

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

But in this case, shouldn't other members be aware of these projects, so they can decide whether or not to request to join a team? or how they would ever know about these projects/teams?

Copy link
Member Author

@priscilawebdev priscilawebdev Apr 28, 2025

Choose a reason for hiding this comment

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

in the settings, they can see all projects and request to join them:

Screen.Recording.2025-04-28.at.08.14.23.mov

Copy link
Member

@scttcper scttcper Apr 28, 2025

Choose a reason for hiding this comment

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

i think settings is the only place they should see them with open membership disabled. we don't want them to see stats etc

Copy link
Member

@scttcper scttcper left a comment

Choose a reason for hiding this comment

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

other than the check for open membership

@priscilawebdev priscilawebdev force-pushed the priscila/fix/projects-dashboard/show-projects-without-teams branch from aa90927 to a07d25e Compare April 29, 2025 07:55
@priscilawebdev priscilawebdev merged commit eaa2e13 into master Apr 29, 2025
45 checks passed
@priscilawebdev priscilawebdev deleted the priscila/fix/projects-dashboard/show-projects-without-teams branch April 29, 2025 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants