-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
fix(project-dashboard): Show projects without teams #90355
Conversation
@@ -81,6 +82,64 @@ function addProjectsToTeams(teams: Team[], projects: Project[]): TeamWithProject | |||
})); | |||
} | |||
|
|||
function getFilteredProjectsBasedOnTeams({ |
There was a problem hiding this comment.
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
Codecov ReportAll 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 => { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
…cts-without-teams
); | ||
const currentProjectIds = new Set(currentProjects.map(p => p.id)); | ||
const unassignedProjects = isAllTeams | ||
? projects.filter(project => !currentProjectIds.has(project.id)) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this 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
Co-authored-by: Scott Cooper <[email protected]>
aa90927
to
a07d25e
Compare
…cts-without-teams
Problem
I encountered an issue while transferring projects between organizations. The scenario is as follows:
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