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

Hel 657/fix retours #605

Merged
merged 11 commits into from
Dec 5, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,15 @@ export class TypeOrmRechercheLoader implements RechercheLoader {

if (zoneParam) {
if (typeZone === "C") {
conditions.push("recherche.commune = :commune");
parameters = { ...parameters, commune: zoneParam };
// Afficher toute la ville pour les villes avec arrondissements: Paris, Marseille et Lyon
if (zoneParam === "LYON" || zoneParam === "MARSEILLE" || zoneParam === "PARIS") {
conditions.push("recherche.commune like :commune");
parameters = { ...parameters, commune: `%${zoneParam}%` };
}
else {
conditions.push("recherche.commune = :commune");
parameters = { ...parameters, commune: zoneParam };
}
}
if (typeZone === "D") {
conditions.push("recherche.departement = :departement");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export const FiltreZoneGeographique = () => {
setZoneGeoType("");
rechercheAvanceeContext?.setZoneGeoType("");
setSuggestions([]);
rechercheAvanceeContext?.setZoneGeoLabel;
rechercheAvanceeContext?.setZoneGeoLabel("");
};

const applyZoneGeoValue = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ import styles from "./RechercheAvanceeFormulaire.module.css";
type RechercheAvanceeFormulaireProps = Readonly<{
lancerLaRecherche: (event: MouseEvent<HTMLButtonElement>) => void;
rechercheOnChange: (event: ChangeEvent<HTMLInputElement>) => void;
terme: string | undefined;
}>;

export const RechercheAvanceeFormulaire = ({ terme, lancerLaRecherche, rechercheOnChange }: RechercheAvanceeFormulaireProps) => {
export const RechercheAvanceeFormulaire = ({ lancerLaRecherche, rechercheOnChange }: RechercheAvanceeFormulaireProps) => {
const { wording } = useDependencies();
const rechercheAvanceeContext = useContext(RechercheAvanceeContext);
const [disableCapaciter, setDisableCapaciter] = useState<boolean>(false);
Expand Down Expand Up @@ -87,7 +86,6 @@ export const RechercheAvanceeFormulaire = ({ terme, lancerLaRecherche, recherche
onChange={rechercheOnChange}
placeholder="Rechercher un numéro FINESS ou le nom d'un établissement"
type="search"
value={terme}
/>
<button className="fr-btn" onClick={lancerLaRecherche} title="Rechercher" type="button">
{wording.RECHERCHE_LABEL}
Expand Down
5 changes: 2 additions & 3 deletions src/pages/recherche-avancee.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export default function RechercheAvancee(props: ExtendedRésultatDeRecherche) {
estCeQueLaRechercheEstLancee,
lancerLaRecherche,
rechercheOnChange,
terme,
resultats,
nombreRésultats,
page,
Expand All @@ -48,7 +47,7 @@ export default function RechercheAvancee(props: ExtendedRésultatDeRecherche) {

return (
<main className="fr-container">
<RechercheAvanceeFormulaire lancerLaRecherche={lancerLaRecherche} rechercheOnChange={rechercheOnChange} terme={terme} />
<RechercheAvanceeFormulaire lancerLaRecherche={lancerLaRecherche} rechercheOnChange={rechercheOnChange} />
{estCeQueLesRésultatsSontReçus && Number(nombreRésultats) === 0 && !estCeEnAttente && <PasResultatRechercheAvancee />}
{nombreRésultats > 0 && !estCeEnAttente && (
<ResultatRechercheAvancee data={resultats} lastPage={lastPage} nombreRésultats={nombreRésultats} page={page || 1} setPage={setPage} />
Expand All @@ -72,7 +71,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext): Pr
capacite_medico_sociaux: capaciteMedicoSociaux = [],
capacite_handicap: capaciteHandicap = [],
capacite_agees: capaciteAgees = [],
order = "",
order = "ASC",
order_by: orderBy = "",
},
} = context;
Expand Down
Loading