Skip to content

Commit

Permalink
Re-enable Rapport de patrouille
Browse files Browse the repository at this point in the history
  • Loading branch information
lwih committed Mar 26, 2024
1 parent b8b0ffe commit 1798031
Showing 1 changed file with 68 additions and 67 deletions.
135 changes: 68 additions & 67 deletions frontend/src/pam/mission/page-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,81 +18,82 @@ const StyledHeader = styled.div`
`

interface MissionPageHeaderProps {
missionName: string
missionSource?: MissionSourceEnum
onClickClose: () => void
onClickExport: () => void
exportLoading?: boolean
missionName: string
missionSource?: MissionSourceEnum
onClickClose: () => void
onClickExport: () => void
exportLoading?: boolean
}

const MissionPageHeader: React.FC<MissionPageHeaderProps> = ({
missionName,
missionSource,
onClickClose,
onClickExport,
exportLoading
missionName,
missionSource,
onClickClose,
onClickExport,
exportLoading
}) => {

const exportRapportEnabled = useFlag('export_rapport');
const exportRapportEnabled = useFlag('export_rapport');

Check warning on line 36 in frontend/src/pam/mission/page-header.tsx

View workflow job for this annotation

GitHub Actions / build-and-test-frontend

'exportRapportEnabled' is assigned a value but never used

Check warning on line 36 in frontend/src/pam/mission/page-header.tsx

View workflow job for this annotation

GitHub Actions / build-and-test-frontend

'exportRapportEnabled' is assigned a value but never used

Check warning on line 36 in frontend/src/pam/mission/page-header.tsx

View workflow job for this annotation

GitHub Actions / build-and-test-frontend

'exportRapportEnabled' is assigned a value but never used

Check warning on line 36 in frontend/src/pam/mission/page-header.tsx

View workflow job for this annotation

GitHub Actions / build-and-test-frontend

'exportRapportEnabled' is assigned a value but never used

Check warning on line 36 in frontend/src/pam/mission/page-header.tsx

View workflow job for this annotation

GitHub Actions / build-and-test-frontend

'exportRapportEnabled' is assigned a value but never used

Check warning on line 36 in frontend/src/pam/mission/page-header.tsx

View workflow job for this annotation

GitHub Actions / build-and-test-frontend

'exportRapportEnabled' is assigned a value but never used

return (
<StyledHeader>
<FlexboxGrid justify="space-between" align="middle" style={{height: '100%'}}>
<FlexboxGrid.Item>
<Stack direction="row" spacing={'1rem'}>
<Stack.Item>
<Text as="h1" weight="bold" color={THEME.color.gainsboro}>
{missionName}
</Text>
</Stack.Item>
{
!!missionSource && (
<Stack.Item>
{/*<Text as="h1" weight="bold" color={THEME.color.gainsboro}>*/}
<MissionOpenByTag missionSource={missionSource}/>
{/*</Text>*/}
</Stack.Item>
)
}
</Stack>
</FlexboxGrid.Item>
<FlexboxGrid.Item colspan={6}>
<FlexboxGrid justify="end" align="middle" style={{height: '100%'}}>
<Stack direction={"row"} alignItems={"center"} spacing={"2rem"}>
<Stack.Item>
<Button
Icon={exportLoading ?
() => <GearIcon spin width={16} height={16} color={THEME.color.white}
style={{fontSize: '2em', marginRight: '0.5rem'}}/>
: Icon.Download
}
accent={Accent.PRIMARY}
size={Size.NORMAL}
onClick={onClickExport}
role={'dl-mission-export'}
style={{display: !!exportRapportEnabled ? "visible" : "none"}}
>
Exporter le rapport de la mission
</Button>
</Stack.Item>
return (
<StyledHeader>
<FlexboxGrid justify="space-between" align="middle" style={{height: '100%'}}>
<FlexboxGrid.Item>
<Stack direction="row" spacing={'1rem'}>
<Stack.Item>
<Text as="h1" weight="bold" color={THEME.color.gainsboro}>
{missionName}
</Text>
</Stack.Item>
{
!!missionSource && (
<Stack.Item>
{/*<Text as="h1" weight="bold" color={THEME.color.gainsboro}>*/}
<MissionOpenByTag missionSource={missionSource}/>
{/*</Text>*/}
</Stack.Item>
)
}
</Stack>
</FlexboxGrid.Item>
<FlexboxGrid.Item colspan={6}>
<FlexboxGrid justify="end" align="middle" style={{height: '100%'}}>
<Stack direction={"row"} alignItems={"center"} spacing={"2rem"}>
<Stack.Item>
<Button
Icon={exportLoading ?
() => <GearIcon spin width={16} height={16} color={THEME.color.white}
style={{fontSize: '2em', marginRight: '0.5rem'}}/>
: Icon.Download
}
accent={Accent.PRIMARY}
size={Size.NORMAL}
onClick={onClickExport}
role={'dl-mission-export'}
style={{display: "visible"}}
// style={{display: !!exportRapportEnabled ? "visible" : "none"}}
>
Exporter le rapport de la mission
</Button>
</Stack.Item>

<Stack.Item>
<IconButton
Icon={Icon.Close}
accent={Accent.TERTIARY}
size={Size.NORMAL}
color={THEME.color.gainsboro}
onClick={onClickClose}
role={'quit-mission-cross'}
/>
</Stack.Item>
</Stack>
<Stack.Item>
<IconButton
Icon={Icon.Close}
accent={Accent.TERTIARY}
size={Size.NORMAL}
color={THEME.color.gainsboro}
onClick={onClickClose}
role={'quit-mission-cross'}
/>
</Stack.Item>
</Stack>

</FlexboxGrid>
</FlexboxGrid.Item>
</FlexboxGrid>
</StyledHeader>
)
</FlexboxGrid>
</FlexboxGrid.Item>
</FlexboxGrid>
</StyledHeader>
)
}

export default MissionPageHeader

0 comments on commit 1798031

Please sign in to comment.