-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(rapportage): save & display geoms of Controls
- Loading branch information
1 parent
63c8f75
commit 473bb4a
Showing
13 changed files
with
180 additions
and
37 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
...c/main/kotlin/fr/gouv/cacem/monitorenv/domain/entities/missions/EnvActionControlEntity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
frontend/src/features/commonComponents/CustomFormikFields/FormikInputNumber.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react' | ||
import { useField } from 'formik'; | ||
import { InputNumber } from 'rsuite' | ||
|
||
|
||
export const FormikInputNumber = ({ name, ...props }) => { | ||
const [field, , helpers] = useField(name); | ||
const { value } = field; | ||
const { setValue } = helpers; | ||
|
||
|
||
return ( | ||
<InputNumber value={value || ''} onChange={setValue} {...props} /> | ||
); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
import { format, isValid } from 'date-fns' | ||
import { fr } from 'date-fns/locale' | ||
|
||
import { actionTargetTypeEnum } from '../../../../domain/entities/missions' | ||
|
||
import { COLORS } from '../../../../constants/constants' | ||
|
||
export const ActionCard = ({feature, }) => { | ||
const { | ||
// actionType, | ||
actionNumberOfControls, | ||
actionTargetType, | ||
// actionTheme, | ||
actionStartDatetimeUtc, | ||
infractions | ||
} = feature.getProperties() | ||
const parsedactionStartDatetimeUtc = new Date(actionStartDatetimeUtc) | ||
|
||
|
||
|
||
return ( | ||
<ActionCardHeader> | ||
<Col1> | ||
<ActionDate> | ||
{isValid(parsedactionStartDatetimeUtc) && format(parsedactionStartDatetimeUtc, "dd MMM yyyy", {locale: fr})} | ||
</ActionDate> | ||
</Col1> | ||
<Col2> | ||
<ControlSummary> | ||
<Accented>{actionNumberOfControls || 0}</Accented> | ||
{` contrôles réalisés sur des cibles de type ` } | ||
<Accented>{actionTargetTypeEnum[actionTargetType]?.libelle || 'non spécifié'}</Accented> | ||
</ControlSummary> | ||
<Tags> | ||
<Tag>RAS</Tag> | ||
<Tag>INFRA</Tag> | ||
<Tag>INFRA SANS PV</Tag> | ||
<Tag>MED</Tag> | ||
</Tags> | ||
<Accented>{infractions || 0}</Accented>infraction(s) | ||
</Col2> | ||
</ActionCardHeader> | ||
) | ||
} | ||
|
||
const ActionCardHeader = styled.div` | ||
background: ${COLORS.white}; | ||
border-top-left-radius: 2px; | ||
border-top-right-radius: 2px; | ||
display: flex; | ||
width: 265px; | ||
z-index: ${props=> props.selected ? 4900 : 5000} | ||
` | ||
|
||
const ActionDate = styled.div` | ||
width: 75px; | ||
font-size: 12px; | ||
margin-right: 16px; | ||
` | ||
|
||
const Accented = styled.span` | ||
font-weight: bold; | ||
` | ||
|
||
const ControlSummary = styled.div` | ||
font: normal normal normal 13px/18px Marianne; | ||
color: ${COLORS.slateGray}; | ||
` | ||
|
||
const Col1 = styled.div` | ||
padding: 8px 0px 5px 10px; | ||
` | ||
const Col2 = styled.div` | ||
padding: 8px 8px 4px 8px; | ||
` | ||
|
||
const Tags = styled.div` | ||
display: flex; | ||
margin-top: 16px; | ||
margin-bottom: 16px; | ||
` | ||
|
||
const Tag = styled.div` | ||
background: ${COLORS.missingGrey}; | ||
border-radius: 11px; | ||
font-weight: 500; | ||
font-size: 13px; | ||
line-height: 18px; | ||
padding: 2px 8px 2px 8px; | ||
:not(:first-child) { | ||
margin-left: 8px; | ||
} | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.