Skip to content

refactor(teams_selection): centralize team selection in TeamSelectionService - #592

Open
sawankshrma wants to merge 6 commits into
devsecopsmaturitymodel:mainfrom
sawankshrma:global_team_selection
Open

sawankshrma wants to merge 6 commits into
devsecopsmaturitymodel:mainfrom
sawankshrma:global_team_selection

Conversation

@sawankshrma

@sawankshrma sawankshrma commented Sep 7, 2026 •

Copy link
Copy Markdown
Collaborator

Adds a TeamSelectionService as the single source of truth for the active team filter, used by the heatmap, report page/modal, and evidence components. Removes selectedTeams from ReportConfig (previously stored inside localStorage, now only persists per-session)

Changes:

  • TeamSelectionService has selectedTeams, effectiveTeams, selectedGroupName, and isAllSelected as computed signals.
  • CircularHeatmapComponent: derives fiiltersTeams/filtersTeamGroups from the service; syncs SectorService via effect()
  • ReportComponent/ReportConfigModalComponent: selectedTeams is pulled out of ReportConfig entirely. Team selection now flows through the service instead of being persisted config. The modal's result type changed from ReportConfig to { config, selectedTeams } since they're no longer the same object.
  • AddEvidenceModalComponent/EvidencePanelComponent: injects service directly instead of passing allTeams/teamGroups through dialog data
  • TeamSelectorComponent: makes selectedTeams a plain input, selectAllTeams()/deselectAllTeams()/selectGroup() just emit rather than mutate local state.

Follow-up changes: (Addersing Issue: #588)

  • Teams & Groups can now be reordered with up/down controls in edit mode. Team order is stored in the existing teams array; group order is preserved by rebuilding the group mapping in the selected order.

  • Team rename handling now tracks explicit rename actions instead of inferring renames from list positions. This prevents a reorder from being treated as a rename and incorrectly moving progress or evidence data.

  • Deleting a team continues to remove it only from the active team/group configuration; its stored progress and evidence is preserved by re-creating the same team name.

@sawankshrma
sawankshrma requested a review from vbakke September 7, 2026 21:55
@github-actions

Copy link
Copy Markdown

This PR has been automatically marked as stale because it has not had recent activity. 📆 It will be closed automatically in two weeks if no further activity occurs.

@github-actions github-actions Bot added the Stale label Oct 13, 2026
@wurstbrot

Copy link
Copy Markdown
Collaborator

Hi, what is the status?

@github-actions github-actions Bot removed the Stale label Oct 25, 2026
@sawankshrma
sawankshrma force-pushed the global_team_selection branch from 51bc7ca to 0ae4a2e Compare October 26, 2026 09:52
@sawankshrma

Copy link
Copy Markdown
Collaborator Author

Hi, what is the status?

Hi @wurstbrot, @vbakke, This PR is now ready to review :)

@vbakke

vbakke commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Thank you @sawankshrma! This is so much better! Finally we can re-order the Teams and Groups 😃 🙏

Sorry for the late review. I mistook the email from GitLab as an issue that had gone stale.

I did find some minor bugs, and some bugs in the original specification.

I'll split them up in separate posts, to easy the discussion

@vbakke

vbakke commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Missing from specification

Looks like I missed a couple of places where the Global Team Selection Object (GTSO? : ) should take effect:

  • Activity Description Component
    • Implemented by and Team Evidence
      • I think these should only show the teams selected in the GTSO
  • Download Teams' Progress and Evidence
    • If some (but not all) teams have been selected, I think we should filter away the rest
    • However, if none/all teams are selected, I don't think we should do any filtering at all.
      • The reason for this is that it is possible to delete a team that has Progress or Evidence. Downloading this file is a way to export info even if you deleted the team by mistake.
  • Download Mappings
    • It is a bit strange that we include Team progress in the Excel sheet under Activity Mapping. But we do, so I think this download should also adhere to the GTSO

@vbakke

vbakke commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Report page

  • Clicking 'Deselect all' adds a check-mark for all teams.
  • Under Configure Report, 'Deselect all' does work. However, I wonder if it is better to remove Team Selection from 'Configure Report' and only keep the one one the Report page. They now serve the same functionality, right? Or am I missing something?

@vbakke

vbakke commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Close the menu

It took me a while to figure out what the Please close the menu-warning meant. I thought maybe it was a menu in Chrome itself, but could not find one. 😄
image

I agree that having the menu in the print out is undesirable.

I suggest that we just automatically close the Menu for the user if it is open. I don't see that as too obtrusive. The user can just hit the burger menu again if they want the menu back.

Any other views, @sawankshrma, @wurstbrot ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants