Skip to content

Commit

Permalink
Merge pull request #385 from MTES-MCT/master
Browse files Browse the repository at this point in the history
Release 31/07/2023
  • Loading branch information
sandrica89 authored Jul 31, 2023
2 parents eba2e27 + 5f576ce commit 076ac2f
Show file tree
Hide file tree
Showing 7 changed files with 1,391 additions and 989 deletions.
Binary file added common/assets/images/partner-logos/sofrilog.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"babel-jest": "^27.0.0",
"babel-loader": "^8.0.6",
"babel-plugin-named-asset-import": "^0.3.5",
"babel-plugin-recharts": "^2.0.0",
Expand All @@ -41,13 +41,13 @@
"common": "0.1.0",
"core-js": "^3.8.1",
"crisp-sdk-web": "^1.0.18",
"css-loader": "^3.2.0",
"css-loader": "^3.6.0",
"csv-stringify": "^5.3.6",
"date-fns": "^2.29.3",
"dotenv": "^8.2.0",
"dotenv-expand": "^5.1.0",
"enzyme": "^3.11.0",
"eslint": "^6.6.0",
"eslint": "^7.0.0",
"eslint-loader": "^3.0.2",
"eslint-plugin-flowtype": "^3.13.0",
"eslint-plugin-import": "^2.18.2",
Expand All @@ -63,9 +63,9 @@
"http-proxy-middleware": "^1.0.5",
"husky": "^4.2.5",
"identity-obj-proxy": "^3.0.0",
"jest": "^25.0.0",
"jest": "^27.0.0",
"jest-environment-jsdom-fourteen": "^0.1.0",
"jest-resolve": "^25.0.0",
"jest-resolve": "^26.5.0",
"jest-watch-typeahead": "^0.4.2",
"lodash": "^4.17.19",
"mini-css-extract-plugin": "^0.8.0",
Expand Down Expand Up @@ -94,8 +94,8 @@
"reselect": "^4.0.0",
"resolve": "^1.12.2",
"resolve-url-loader": "^3.1.1",
"sass-loader": "^8.0.0",
"semver": "^6.3.0",
"sass-loader": "^9.0.0",
"semver": "^7.5.4",
"source-map-explorer": "^2.5.2",
"style-loader": "1.0.0",
"terser-webpack-plugin": "^2.3.6",
Expand Down Expand Up @@ -195,7 +195,7 @@
"<rootDir>/common/**/__tests__/**/*.{js,jsx,ts,tsx}",
"<rootDir>/common/**/*.{spec,test}.{js,jsx,ts,tsx}"
],
"testEnvironment": "jest-environment-jsdom-fourteen",
"testEnvironment": "jest-environment-jsdom",
"transform": {
"^.+\\.(js|jsx|ts|tsx)$": "<rootDir>/node_modules/babel-jest",
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
Expand Down
38 changes: 21 additions & 17 deletions web/controller/components/details/ControllerControlHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,30 @@ const useStyles = makeStyles(theme => ({
}
}));

const ExportButton = (classes, modals, controlId) => (
<Button
color="primary"
variant="outlined"
size="small"
className={classes.batchInviteButton}
onClick={() => {
modals.open("controllerExportExcelOne", { controlId });
}}
>
Exporter le contrôle
</Button>
);
export function ExportButton({ controlId }) {
const modals = useModals();
const classes = useStyles();
return (
<Button
color="primary"
variant="outlined"
size="small"
className={classes.batchInviteButton}
onClick={() => {
modals.open("controllerExportExcelOne", { controlId });
}}
>
Exporter le contrôle
</Button>
);
}

export function ControllerControlHeader({
controlId,
controlDate,
onCloseDrawer
onCloseDrawer,
enableExport = true
}) {
const modals = useModals();
const classes = useStyles();
const isOnDesktop = useIsWidthUp("md");
return isOnDesktop ? (
Expand All @@ -82,7 +86,7 @@ export function ControllerControlHeader({
<Typography>
Date et heure du contrôle : <b>{prettyFormatDayHour(controlDate)}</b>
</Typography>
{ExportButton(classes, modals, controlId)}
{enableExport && <ExportButton controlId={controlId} />}
</Box>
</Container>
) : (
Expand All @@ -100,7 +104,7 @@ export function ControllerControlHeader({
>
Fermer
</Link>
{ExportButton(classes, modals, controlId)}
{enableExport && <ExportButton controlId={controlId} />}
</Box>
</Container>
);
Expand Down
16 changes: 2 additions & 14 deletions web/controller/components/modals/ControllerExportExcelOne.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import React from "react";
import {
Button,
Modal,
ModalTitle,
ModalContent,
ModalFooter,
Button
ModalTitle
} from "@dataesr/react-dsfr";
import { makeStyles } from "@mui/styles";
import Typography from "@mui/material/Typography";
import { useApi } from "common/utils/api";
import { useSnackbarAlerts } from "../../../common/Snackbar";
import { HTTP_QUERIES } from "common/utils/apiQueries";
Expand All @@ -30,17 +29,6 @@ export default function ExportExcelOne({ open, handleClose, controlId }) {
Mobilic permet d'exporter les données des salariés contrôlés au format
Excel (.xlsx).
</p>
<Typography variant="h4">Conditions d’export</Typography>
<br></br>
<p>
Le téléchargement produit un fichier Excel qui contient les données
d’activité du contrôle Mobilic sélectionné.{" "}
<b>
Les données du salarié sont limitées à une période qui ne peut pas
dépasser les 28 jours précédant le contrôle (ainsi que la journée
“en cours” lors du contrôle).
</b>
</p>
</ModalContent>
<ModalFooter>
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export function ControllerControlNoLicDrawer({
controlId={controlData.id}
controlDate={controlData.creationTime}
onCloseDrawer={() => closeControl()}
enableExport={false}
/>
<ControllerControlNoLic controlData={controlData} editBDC={editBDC} />
</ControlDrawer>
Expand Down
3 changes: 1 addition & 2 deletions web/landing/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ export default function Stats() {
<Container key={2} className={classes.container} maxWidth={false}>
<iframe
title="Métriques publiques"
src="https://metabase.mobilic.beta.gouv.fr/public/dashboard/14cc44a1-eec6-4d8d-9269-b67b10ca77bc#bordered=false"
frameBorder="0"
src="https://metabase.mobilic.beta.gouv.fr/public/dashboard/1d41b5c1-8eed-4688-a605-306614511814#bordered=false"
width="100%"
height="100%"
style={{ backgroundColor: "transparent" }}
Expand Down
Loading

0 comments on commit 076ac2f

Please sign in to comment.