Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release 23/12/2024 #614

Merged
merged 51 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
f05c388
style(control): update informations tab for control mobilic
sandrica89 Dec 2, 2024
0bdb4fc
feat(controls): display current mission business type in control
tristan-gueguen Dec 3, 2024
92561d5
feat(control): disable infraction edition for no lic controls
sandrica89 Dec 9, 2024
32be2c1
refactor(control): create components for control informations page
sandrica89 Dec 9, 2024
1033513
fix(controls): renamed businessTypeDuringControl field
tristan-gueguen Dec 10, 2024
12b9163
Merge pull request #602 from MTES-MCT/feat/business-types-in-controls
tristan-gueguen Dec 10, 2024
fb5b17c
refactor: use hook to get control type
sandrica89 Dec 10, 2024
0e9775a
Merge pull request #605 from MTES-MCT/feat/no-lic-no-infraction-edition
sandrica89 Dec 10, 2024
835e1ec
feat(controls-info): style block mission info, employee name
tristan-gueguen Dec 10, 2024
f7fbac9
fix(controls): no lic and regular lic tabs use same style
tristan-gueguen Dec 10, 2024
cccb1a2
fix(controls): fixed padding top info tab no lic
tristan-gueguen Dec 10, 2024
6b4e253
fix(controls): correct rowGap in informations tab
tristan-gueguen Dec 10, 2024
5e3316b
fix(controls): removed marginBottom warning several business types - …
tristan-gueguen Dec 10, 2024
9bfb445
fix(controls): control history rework
tristan-gueguen Dec 10, 2024
e39eab8
merged master
tristan-gueguen Dec 10, 2024
3dde19f
fix(controls): style employment block
tristan-gueguen Dec 10, 2024
8e8f9bb
fix(controls): notes button style
tristan-gueguen Dec 10, 2024
af7e229
fix(controls): information NbCard
tristan-gueguen Dec 11, 2024
96d7e04
fix(controls): no lic, link to alerts tab
tristan-gueguen Dec 11, 2024
c91e3d9
fix(controls): show employment status
tristan-gueguen Dec 11, 2024
9d18f13
fix(lic-papier): title when modifying lic papier infractions
tristan-gueguen Dec 13, 2024
d42ff07
fix(lic-papier): left align calendar and dates in InfractionDay
tristan-gueguen Dec 13, 2024
7dd796b
fix(lic-papier): page du jour remplie mandatory to create control
tristan-gueguen Dec 13, 2024
a769bfa
fix(informations): wording no employments warning + become admin button
tristan-gueguen Dec 13, 2024
d7f1484
fix(partners): fixed two buttons become partner
tristan-gueguen Dec 13, 2024
72fa61d
fix(infractions): spacing list infractions
tristan-gueguen Dec 13, 2024
2b6bcd8
fix(infractions): badge style
tristan-gueguen Dec 13, 2024
0f2e4fb
fix(infractions): typography
tristan-gueguen Dec 13, 2024
11cde85
fix(lic-papier): do not display Page du jour remplie in Info tab
tristan-gueguen Dec 14, 2024
ca1ead3
fix(controls): refacto Info NbCards + style
tristan-gueguen Dec 14, 2024
43f7e14
merged master
tristan-gueguen Dec 14, 2024
0dda097
feat(infrations): replace bottom menu edit infractions button
tristan-gueguen Dec 14, 2024
ae4c748
fix(typography): can have Description with no margin
tristan-gueguen Dec 16, 2024
f3596b5
fix(accessibility): replaced <br> by a span block
tristan-gueguen Dec 16, 2024
d197ca4
Merge pull request #607 from MTES-MCT/fix/no-employment-wording
tristan-gueguen Dec 16, 2024
f5ce814
Merge pull request #608 from MTES-MCT/fix/broken-buttons-in-partners-…
tristan-gueguen Dec 16, 2024
7698942
Merge pull request #606 from MTES-MCT/fix/lic-papier-feedbacks
tristan-gueguen Dec 16, 2024
8253fe1
fix(controls,accessibility): fixed heading hierarchy info page
tristan-gueguen Dec 17, 2024
8a22367
fix(controls,style): better NbCard flex behaviour
tristan-gueguen Dec 17, 2024
d6dd5b8
Merge pull request #609 from MTES-MCT/feat/style-control-page
tristan-gueguen Dec 17, 2024
fee320a
Merge branch 'master' into feat/lic-infractions-style
tristan-gueguen Dec 17, 2024
e2da9bf
Merge pull request #610 from MTES-MCT/feat/lic-infractions-style
tristan-gueguen Dec 17, 2024
f6c07b5
refacto(controllers): back button refacto
tristan-gueguen Dec 17, 2024
3cceb81
fix(informations): newline alert notice + notice isNoMarginRight
tristan-gueguen Dec 18, 2024
e7d5a80
fix(controls): scroll top when changing tabs
tristan-gueguen Dec 18, 2024
1e83a1a
fix(no-lic): text no history based on control, marginBottom no notes
tristan-gueguen Dec 18, 2024
94b018b
fix(infractions): bottom buttons zIndex
tristan-gueguen Dec 19, 2024
543b1a4
fix(infractions): update infractions mobile -> no weird horizontal sc…
tristan-gueguen Dec 19, 2024
6604fdc
fix(infractions): when closing control, setIsReportingInfractions to …
tristan-gueguen Dec 19, 2024
d2e5a3c
fix(infractions): do not center calendar in desktop in InfractionDay
tristan-gueguen Dec 19, 2024
1be3b29
fix(controls): on desktop, Modifier button on the left
tristan-gueguen Dec 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions common/utils/apiQueries.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,11 @@ export const CONTROLLER_READ_CONTROL_DATA = gql`
...ObservedInfractions
}
reportedInfractionsLastUpdateTime
businessTypeDuringControl {
id
transportType
businessType
}
}
}
`;
Expand Down
58 changes: 24 additions & 34 deletions web/common/EmploymentInfoCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ import Accordion from "@mui/material/Accordion";
import AccordionSummary from "@mui/material/AccordionSummary";
import AccordionDetails from "@mui/material/AccordionDetails";
import ThirdPartyEmploymentAccess from "./ThirdPartyEmploymentAccess";
import ContentCopyOutlined from "@mui/icons-material/ContentCopyOutlined";
import Box from "@mui/material/Box";
import { HideEmail } from "../home/HideEmail";
import { getNextHeadingComponent } from "common/utils/html";
import { formatActivity } from "common/utils/businessTypes";
import Notice from "./Notice";
import { Button } from "@codegouvfr/react-dsfr/Button";

const useStyles = makeStyles(theme => ({
companyName: {
Expand All @@ -48,18 +47,6 @@ const useStyles = makeStyles(theme => ({
},
employmentDetails: {
display: "block"
},
copyAdminEmails: {
display: "flex",
alignItems: "center",
flexWrap: "wrap",
color: theme.palette.primary.main,
fontSize: "0.85em",
cursor: "pointer",
marginTop: theme.spacing(1)
},
copyAdminEmailsIcon: {
marginRight: theme.spacing(1)
}
}));

Expand Down Expand Up @@ -93,7 +80,13 @@ export function EmploymentInfoCard({

const emailsCurrentAdminsDisplay = useMemo(
() => (
<ul style={{ listStyleType: "none", paddingInlineStart: "0px" }}>
<ul
style={{
listStyleType: "none",
paddingInlineStart: "0px",
margin: "0px"
}}
>
{employment?.company.currentAdmins?.map(admin => (
<li key={admin.email} style={{ overflowWrap: "anywhere" }}>
{admin.email}
Expand Down Expand Up @@ -234,6 +227,18 @@ export function EmploymentInfoCard({
uppercaseTitle={false}
/>
</Grid>
{!hideBusiness && !!employment.business && (
<Grid item xs={12}>
<InfoItem
name="Type d'activité"
value={formatActivity(employment.business)}
titleProps={{
component: getNextHeadingComponent(headingComponent)
}}
uppercaseTitle={false}
/>
</Grid>
)}
{!!emailsCurrentAdminsDisplay && (
<Grid item>
<InfoItem
Expand All @@ -242,8 +247,10 @@ export function EmploymentInfoCard({
titleProps={{
component: getNextHeadingComponent(headingComponent)
}}
uppercaseTitle={false}
/>
<Box
<Button
priority="tertiary"
onClick={() => {
navigator.clipboard
.writeText(emailsCurrentAdmins)
Expand All @@ -255,14 +262,9 @@ export function EmploymentInfoCard({
);
});
}}
className={classes.copyAdminEmails}
>
<ContentCopyOutlined
className={classes.copyAdminEmailsIcon}
fontSize="small"
/>
copier les emails
</Box>
</Button>
</Grid>
)}
{!hideRole && (
Expand All @@ -281,18 +283,6 @@ export function EmploymentInfoCard({
/>
</Grid>
)}
{!hideBusiness && !!employment.business && (
<Grid item xs={12}>
<InfoItem
name="Type d'activité"
value={formatActivity(employment.business)}
titleProps={{
component: getNextHeadingComponent(headingComponent)
}}
uppercaseTitle={false}
/>
</Grid>
)}
{!hideActions && (
<Grid item xs={12}>
<ThirdPartyEmploymentAccess
Expand Down
4 changes: 4 additions & 0 deletions web/common/Notice.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const Notice = ({
linkUrl,
linkText,
style,
isNoMarginRight = false,
isFullWidth = true,
classes = {},
sx = {},
Expand Down Expand Up @@ -40,6 +41,9 @@ const Notice = ({
fr.cx("fr-notice__title", { "fr-text--sm": size === "small" }),
classes.title
)}
style={{
...(isNoMarginRight && { marginRight: 0 })
}}
>
{title}{" "}
<span className={fr.cx("fr-text--regular")}>{description}</span>
Expand Down
26 changes: 19 additions & 7 deletions web/common/hooks/useScroll.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect } from "react";
import { useLocation } from "react-router-dom";

function useScroll() {
export const useScroll = () => {
const { hash, pathname, search } = useLocation();

useEffect(() => {
Expand All @@ -15,11 +15,23 @@ function useScroll() {
if (pathname === "/resources/regulations" && search !== "") {
return;
}
const mainElements = document.getElementsByTagName("main");
if (mainElements && mainElements[0]) {
mainElements[0].scrollIntoView({ behavior: "smooth", block: "start" });
}
scrollToMain();
}, [hash, pathname, search]);
}
};

export const scrollToMain = () => {
const mainElements = document.getElementsByTagName("main");
if (mainElements && mainElements[0]) {
_scrollTo(mainElements[0]);
}
};

export const scrollToId = id => {
const idElement = document.getElementById(id);
if (idElement) {
_scrollTo(idElement);
}
};

export default useScroll;
const _scrollTo = element =>
element.scrollIntoView({ behavior: "smooth", block: "start" });
11 changes: 9 additions & 2 deletions web/common/typography/Description.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@ import React from "react";
import { cx } from "@codegouvfr/react-dsfr/tools/cx";
import { fr } from "@codegouvfr/react-dsfr";

export const Description = ({ children, className, style, ...otherProps }) => {
export const Description = ({
children,
className,
style,
noMargin = false,
...otherProps
}) => {
return (
<Typography
className={cx(fr.cx("fr-text--sm"), className)}
style={{
...style,
color: fr.colors.decisions.text.mention.grey.default
color: fr.colors.decisions.text.mention.grey.default,
...(noMargin && { margin: 0 })
}}
{...otherProps}
>
Expand Down
20 changes: 13 additions & 7 deletions web/control/components/Alerts/AlertGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,16 @@ const useStyles = makeStyles(theme => {
alertNumber: {
display: "inline-flex",
whiteSpace: "pre",
borderRadius: theme.spacing(1.5),
borderRadius: "100px",
color: "white",
paddingLeft: theme.spacing(1),
paddingRight: theme.spacing(1),
height: theme.spacing(3),
minWidth: theme.spacing(3),
alignItems: "center",
justifyContent: "center",
fontWeight: "bold"
fontWeight: "bold",
fontSize: "0.75rem"
},
reportedAlert: {
borderColor: theme.palette.primary.main,
Expand Down Expand Up @@ -93,7 +94,7 @@ export function AlertGroup({
type,
sanction,
setPeriodOnFocus,
setTab,
onChangeTab,
readOnlyAlerts,
displayBusinessType = false,
titleProps = {}
Expand Down Expand Up @@ -148,10 +149,15 @@ export function AlertGroup({
wrap="nowrap"
>
<Grid item>
<Typography className="bold" color="primary" {...titleProps}>
<Typography
className="bold"
color="primary"
{...titleProps}
fontSize="0.875rem"
>
{sanction}
</Typography>
<Typography className="bold">{infringementLabel}</Typography>
<Typography fontWeight="500">{infringementLabel}</Typography>
</Grid>
{alertsNumber !== 0 && (
<Grid item>
Expand Down Expand Up @@ -185,7 +191,7 @@ export function AlertGroup({
{displayBusinessType && (
<BusinessTypeTitle business={alertBusiness} />
)}
<Description>{alertDescription}</Description>
<Description noMargin>{alertDescription}</Description>
<List>
{alertsByBusiness.map((alert, index) => (
<ListItem key={index} disableGutters>
Expand All @@ -195,7 +201,7 @@ export function AlertGroup({
sanction={sanction}
isReportable={isSanctionReportable}
setPeriodOnFocus={setPeriodOnFocus}
setTab={setTab}
onChangeTab={onChangeTab}
readOnlyAlerts={readOnlyAlerts}
/>
</ListItem>
Expand Down
3 changes: 1 addition & 2 deletions web/control/components/Alerts/InfractionDay.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ const gregorian_fr = {

const useStyles = makeStyles(theme => ({
calendar: {
margin: "auto",
border: "1px solid",
borderColor: fr.colors.decisions.background.disabled.grey.default,
borderRadius: "0px",
Expand Down Expand Up @@ -136,7 +135,7 @@ export const InfractionDay = ({ alerts, sanction }) => {
{initialTimestamps?.length > 0 && (
<ul
className="fr-tag-group"
style={{ listStyleType: "none", paddingInlineStart: "none" }}
style={{ listStyleType: "none", paddingInlineStart: "0" }}
>
{initialTimestamps
.map(ts => (ts / 1000) >> 0)
Expand Down
6 changes: 3 additions & 3 deletions web/control/components/RegulatoryAlert.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export function RegulatoryAlert({
sanction,
isReportable,
setPeriodOnFocus,
setTab,
onChangeTab,
readOnlyAlerts
}) {
const { isReportingInfractions, onUpdateInfraction } = useInfractions();
Expand All @@ -188,11 +188,11 @@ export function RegulatoryAlert({
/>
)}
<div>
{setTab ? (
{onChangeTab ? (
<Link
onClick={e => {
e.preventDefault();
setTab("history");
onChangeTab("history");
if (setPeriodOnFocus) {
setPeriodOnFocus(
alert.day || alert.week || alert.month
Expand Down
Loading
Loading