Appearance
Manage Teams
Team management interface for creating teams, assigning workers, and configuring team administrators. Displayed as a tab within Company Settings.
Route
/organisations/:organisationId/company-settings/manage-teams
Roles
CompanyAdmin, CompanyOwner, TeamAdmin, TenantAdmin
Version Router
The page entry point (OrganisationStructure/VersionRouter.svelte) renders either V1 or V2 based on the useNewTeamsPage feature flag.
useNewTeamsPage = false-- RendersOrganisationStructure/Index.svelte(V1, default)useNewTeamsPage = true-- RendersOrganisationStructure/V2/Index.svelte(V2)
Both versions receive the params object containing organisationId.
V1 Layout
Rendered inside the Company Settings tab container (tab index 3, "Manage Teams"). Contains:
- Title and description header -- i18n keys
organisation.structure.titleandorganisation.structure.desc - Unassigned Users section (hidden for TeamAdmin)
- Create Team section (hidden for TeamAdmin)
- Teams list
Unassigned Users (V1)
Rendered by the UnassignedUsers component.
- Lists workers (EOR instances) that are not assigned to any team and whose contracts have not ended (
isContractEndedis false). - Workers can be assigned to existing teams via the
UnassignedUsersDropdown. - Reassigning triggers a refresh event that updates the teams list.
Create Team (V1)
Rendered by the CreateTeam component.
- Available to CompanyAdmin, CompanyOwner, and TenantAdmin only (hidden for TeamAdmin via
lineManagerView). - Inputs: team name and colour picker (via
TeamNameAndColourField). - Team admins and pending team admins can be assigned at creation time.
Teams List (V1)
Rendered by the Teams component.
- Displays all teams from the
teamsStore. - The
readonlyprop is set totruefor TeamAdmin users, preventing edits. - Each team card (
TeamCard) shows team name, colour, assigned members, and admins. - CompanyAdmin and above can edit team membership, assign/remove admins, and rename teams.
V2 Layout
Rendered inside the Company Settings tab container (tab index 3, "Manage Teams"). Contains:
- Title and description header -- Same i18n keys as V1
- Unassigned Users section (hidden for TeamAdmin)
- Create Team section (hidden for TeamAdmin)
- Teams list with
TeamCardcomponents rendered in a flex-wrap container
Unassigned Users (V2)
Rendered by OrganisationStructure/V2/UnassignedUsers.svelte.
- Lists workers from
teamsPage.unassignedWorkers. - Workers can be added to teams, dispatching
add-members-to-teamoradd-members-to-pending-teamevents. - Adding to a pending team triggers a confirmation modal.
Create Team (V2)
Rendered by OrganisationStructure/V2/CreateTeam.svelte.
- Available when
lineManagerViewis false. - Binds to the
teamsPageobject to update the teams list reactively.
Teams List (V2)
Iterates over Object.values(teamsPage.teams), rendering a V2/TeamCard for each.
Each TeamCard receives:
team-- The team objectlineManagerView-- Read-only flag for TeamAdmin userscompanyAdmins-- Available company admins fromteamsPage.companyAdminslineManagers-- Available line managers fromteamsPage.lineManagersworkersNotInTeam-- A collated map of all workers not in the current team (including workers from other teams, annotated with their team name)otherTeams-- A map of other team IDs to names for move-to-team functionality
Team card actions dispatch events handled via a ConfirmationModal:
delete-team-- Deletes the team viadeleteTeamhelper, updatesteamsPageremove-members-- Removes members from the team viaremoveMembersFromTeamhelperadd-members-to-team-- Adds members viaaddMembersToTeamhelpermove-members-to-team-- Moves members from one team to another (add withpreviousTeamId)
The confirmation modal shows localised content from organisation.structure.confirmation-modals.* including member names and team name.
Data Loading
V1
On initialisation, a single getTeamsPage API call returns:
- Teams (converted from internalised format via
convertTeamsInternalisedToTeam) - Organisation details (with
managersconverted to aSet) - Users categorised as
seniors,teamAdmins, andpendingTeamAdmins - All members (EOR instances), partitioned into assigned (in a team) and unassigned (not in any team, contract not ended)
Users are sorted with CompanyOwner appearing first. All data is loaded into stores (teamsStore, organisation, seniors, teamAdmins, pendingTeamAdmins, usersStore, unassigned, assigned, invitationsStore).
V2
On initialisation, a single getTeamsPageV2 API call returns a TeamsPageV2 object containing:
teams-- Record of team ID to team objects, each withworkers,name,idunassignedWorkers-- Record of EOR ID toMinimalUserDetailscompanyAdmins-- Available company adminslineManagers-- Available line managers
The teamsPage object is bound reactively, so all mutations (add, remove, delete, move) update the UI automatically.
Behavior notes
- On initialisation failure: V1 redirects to
/pages-404; V2 displays an inline error message. - Team membership changes trigger a refresh of the teams list.
- Pending team admins (invited but not yet accepted) are tracked separately from active admins.
- The
lineManagerViewflag is determined bypickPrincipalRole($user.remundoIdentity!) == Role.TeamAdmin. - V2 uses a
ConfirmationModalcomponent with apollingstate to prevent double-actions while an operation is in progress.