From 36f4ed5bc609d0264bbd23a73af08be2c643e8d2 Mon Sep 17 00:00:00 2001 From: Imen Chermiti <127976664+ImenOuidou@users.noreply.github.com> Date: Thu, 7 Nov 2024 17:46:14 +0100 Subject: [PATCH 1/3] fix: fix marche publiques sort (#356) --- .../NonBorderedTable/hooks.js | 32 ++++++++++++++----- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/client/src/components/DataSheets/Sections/SharedComponents/NonBorderedTable/hooks.js b/src/client/src/components/DataSheets/Sections/SharedComponents/NonBorderedTable/hooks.js index f02743ae..f5798f24 100644 --- a/src/client/src/components/DataSheets/Sections/SharedComponents/NonBorderedTable/hooks.js +++ b/src/client/src/components/DataSheets/Sections/SharedComponents/NonBorderedTable/hooks.js @@ -4,7 +4,6 @@ import { formatSiret } from "../../../../../helpers/utils"; import { formatUpperCase } from "../../../../../utils/entreprise/entreprise"; import { getCodePostal } from "../../../../../utils/establishment/establishment"; -// Suppose this function is imported or defined export const getCity = (marche) => marche?.etablissement?.libellecommuneetablissement || marche?.etablissement?.libellecommune2etablissement; @@ -25,22 +24,39 @@ export const useSortableData = (items, config = null) => { if (sortConfig.key === "city") { aValue = getCodePostal(a?.etablissement); // Retrieve city using getCity bValue = getCodePostal(b?.etablissement); - console.log(bValue); } else if (sortConfig.key === "acheteur") { aValue = getAcheteur(a); bValue = getAcheteur(b); + } else if ( + sortConfig.key === "montant" || + sortConfig.key === "dureeMois" + ) { + // Convertir 'montant' en nombre + aValue = parseFloat(a[sortConfig.key]); + bValue = parseFloat(b[sortConfig.key]); } else { aValue = a[sortConfig.key]; bValue = b[sortConfig.key]; } - if (aValue < bValue) { - return sortConfig.direction === "ascending" ? -1 : 1; - } - if (aValue > bValue) { - return sortConfig.direction === "ascending" ? 1 : -1; + // Gérer les valeurs nulles ou indéfinies + if (aValue == null) return 1; + if (bValue == null) return -1; + + // Comparaison appropriée en fonction du type + if (typeof aValue === "number" && typeof bValue === "number") { + return sortConfig.direction === "ascending" + ? aValue - bValue + : bValue - aValue; + } else { + if (aValue < bValue) { + return sortConfig.direction === "ascending" ? -1 : 1; + } + if (aValue > bValue) { + return sortConfig.direction === "ascending" ? 1 : -1; + } + return 0; } - return 0; }); } return sortableItems; From 8b704d6e8e561d5be420b226e051a66d412a4977 Mon Sep 17 00:00:00 2001 From: Social Groovy Bot <45039513+SocialGroovyBot@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:46:39 +0000 Subject: [PATCH 2/3] chore(release): version 27.106.2 ## [27.106.2](https://github.com/SocialGouv/fce/compare/v27.106.1...v27.106.2) (2024-11-07) ### Bug Fixes * fix marche publiques sort ([#356](https://github.com/SocialGouv/fce/issues/356)) ([36f4ed5](https://github.com/SocialGouv/fce/commit/36f4ed5bc609d0264bbd23a73af08be2c643e8d2)) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3dcbf52..acb20a5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [27.106.2](https://github.com/SocialGouv/fce/compare/v27.106.1...v27.106.2) (2024-11-07) + + +### Bug Fixes + +* fix marche publiques sort ([#356](https://github.com/SocialGouv/fce/issues/356)) ([36f4ed5](https://github.com/SocialGouv/fce/commit/36f4ed5bc609d0264bbd23a73af08be2c643e8d2)) + ## [27.106.1](https://github.com/SocialGouv/fce/compare/v27.106.0...v27.106.1) (2024-10-14) diff --git a/package.json b/package.json index 42e8989b..5449b949 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fce", - "version": "27.106.1", + "version": "27.106.2", "description": "", "author": "commit42", "private": true, From f1de22185fb00425e0c3be8fe127e90de29cf193 Mon Sep 17 00:00:00 2001 From: Imen Chermiti <127976664+ImenOuidou@users.noreply.github.com> Date: Mon, 25 Nov 2024 14:56:33 +0100 Subject: [PATCH 3/3] Cleaning azure files from strapi folder (#357) --- .../src/components/PublicPage/Help/Help.js | 7 +- .../RequestAccessForm/RequestAccessForm.js | 13 +- .../components/UsersFeedback/UsersFeedback.js | 2 +- src/server/src/models/FceUser.js | 52 ++-- src/server/src/utils/mail.js | 22 +- src/strapi/README.md | 7 - src/strapi/package.json | 2 - src/strapi/scripts/init-azurite.js | 23 -- src/strapi/yarn.lock | 231 +----------------- 9 files changed, 66 insertions(+), 293 deletions(-) delete mode 100644 src/strapi/scripts/init-azurite.js diff --git a/src/client/src/components/PublicPage/Help/Help.js b/src/client/src/components/PublicPage/Help/Help.js index 2c10e112..5816a2bd 100644 --- a/src/client/src/components/PublicPage/Help/Help.js +++ b/src/client/src/components/PublicPage/Help/Help.js @@ -5,9 +5,11 @@ import React from "react"; import { Link } from "react-router-dom"; import UsersFeedback from "../../../containers/UsersFeedback"; +import Config from "../../../services/Config"; import LoadSpinner from "../../shared/LoadSpinner"; const Help = ({ pageData = null, isLoading, hasError }) => { + const strapiPath = Config.get("strapi.domain"); if (hasError) { return (
@@ -41,7 +43,10 @@ const Help = ({ pageData = null, isLoading, hasError }) => {
{item.titre}
{/* eslint-disable-next-line jsx-a11y/media-has-caption */}