Skip to content

Commit

Permalink
[Mission] add unit name in mission tile for new mission
Browse files Browse the repository at this point in the history
  • Loading branch information
claire2212 committed Aug 10, 2023
1 parent 01c4c17 commit 6f98ff0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/src/utils/getMissionTitle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { missionTypeEnum, type Mission } from '../domain/entities/missions'

export function getMissionTitle(isNewMission: boolean, values?: Partial<Mission>) {
return isNewMission
? 'Nouvelle mission'
? `Nouvelle mission ${
values?.controlUnits && values?.controlUnits.length > 0 && values?.controlUnits[0]?.name ? '-' : ''
} ${values?.controlUnits?.map(controlUnit => controlUnit.name).join(', ')}
`
: `Mission ${
values?.missionTypes &&
values?.missionTypes.map(missionType => missionTypeEnum[missionType].libelle).join(' / ')
Expand Down

0 comments on commit 6f98ff0

Please sign in to comment.