Skip to content

Commit

Permalink
Merge pull request #891 from MTES-MCT/main
Browse files Browse the repository at this point in the history
Mise en production 19/09/2024
  • Loading branch information
loicguillois authored Sep 24, 2024
2 parents 3b764ea + b9e829a commit 4547eb9
Show file tree
Hide file tree
Showing 30 changed files with 129 additions and 97 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Ministères de la Transition écologique & de la Cohésion des territoires
Copyright (c) 2024 Ministère du Logement et de la Rénovation urbaine

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion e2e/cypress/e2e/campaign.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('Campaign', () => {
cy.get('div[aria-labelledby="draft-body-label"]')
.type('Madame, Monsieur,{enter}')
.type(
'Marseille BB fait partie des lauréats du plan national de lutte contre les logements vacants du Ministère de la Transition écologique et de la Cohésion des Territoires. Ce plan a pour objectif d’accélérer, dans les territoires pilotes, la remise sur le marché immobilier (rénovation, location, vente, restructuration) du plus grand nombre possible de logements vacants. Dans ce cadre, l’ADIL 13 a été missionnée par Marseille BB pour assurer une mission d’information, de sensibilisation et d’accompagnement des propriétaires de logements vacants qui le souhaitent.{enter}'
'Marseille BB fait partie des lauréats du plan national de lutte contre les logements vacants du Ministère du Logement et de la Rénovation urbaine. Ce plan a pour objectif d’accélérer, dans les territoires pilotes, la remise sur le marché immobilier (rénovation, location, vente, restructuration) du plus grand nombre possible de logements vacants. Dans ce cadre, l’ADIL 13 a été missionnée par Marseille BB pour assurer une mission d’information, de sensibilisation et d’accompagnement des propriétaires de logements vacants qui le souhaitent.{enter}'
)
.type(
'Un formulaire vous est proposé dans le cadre d’une enquête destinée à mieux comprendre les raisons de la vacance et s’inscrit dans une politique plus globale afin de construire l’aide qui vous sera la plus adaptée, et permettrait la remise des biens sur un marché en forte demande.{enter}'
Expand Down
2 changes: 1 addition & 1 deletion frontend/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Ministères de la Transition écologique & de la Cohésion des territoires
Copyright (c) 2024 Ministère du Logement et de la Rénovation urbaine

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
25 changes: 11 additions & 14 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
Redirect,
Route,
RouteProps,
Switch,
Switch
} from 'react-router-dom';

import './App.scss';
Expand Down Expand Up @@ -37,19 +37,16 @@ import UsersView from './views/Users/UsersView';
import TerritoryEstablishmentsView from './views/TerritoryEstablishments/TerritoryEstablishmentsView';
import SmallHeader from './components/Header/SmallHeader';
import Header from './components/Header/Header';
import posthog from 'posthog-js';

posthog.init('phc_Thondx9VvGONN5SZK0OuDttJDIorIANsudwCL2gU3O7', { api_host: 'https://eu.i.posthog.com', person_profiles: 'identified_only' });

const publicRoutes: RouteProps[] = [
{ path: '/stats', component: StatsView },
{ path: '/accessibilite', component: AccessibilityView },
{ path: '/mentions-legales', component: LegalNoticesView },
{ path: '/mentions-legales', component: LegalNoticesView }
];
const authenticatedRoutes: RouteProps[] = [
{
path: '/parc-de-logements',
component: HousingListView,
component: HousingListView
},
// TODO: remove this
{ path: '/parc-de-logements/campagnes/:id', component: CampaignView },
Expand All @@ -58,12 +55,12 @@ const authenticatedRoutes: RouteProps[] = [
{ path: '/campagnes/:id', component: CampaignView },
{
path: '/proprietaires/:ownerId/logements/:housingId',
component: HousingView,
component: HousingView
},
{ path: '/proprietaires/:ownerId', component: OwnerView },
{
path: '/logements/:housingId/proprietaires/:ownerId',
component: OwnerView,
component: OwnerView
},
{ path: '/logements/:housingId', component: HousingView },
{ path: '/ressources/statuts', component: StatusView },
Expand All @@ -72,21 +69,21 @@ const authenticatedRoutes: RouteProps[] = [
{ path: '/compte', component: AccountView },
{ path: '/compte/mot-de-passe', component: AccountPasswordView },
{ path: '/utilisateurs', component: UsersView },
{ path: '/autres-etablissements', component: TerritoryEstablishmentsView },
{ path: '/autres-etablissements', component: TerritoryEstablishmentsView }
];
const guestRoutes: RouteProps[] = [
{ path: '/inscription*', component: AccountCreationView },
{ path: '/connexion', component: LoginView },
{
path: '/mot-de-passe/oublie',
component: ForgottenPasswordView,
component: ForgottenPasswordView
},
{
path: '/mot-de-passe/nouveau',
component: ResetPasswordView,
component: ResetPasswordView
},
{ path: '/admin', component: LoginView },
{ path: '/', component: EstablishmentHomeView },
{ path: '/', component: EstablishmentHomeView }
];

function App() {
Expand All @@ -96,8 +93,8 @@ function App() {
const dispatch = useAppDispatch();
const isSomeQueryPending = useAppSelector((state) =>
Object.values(state.api.queries).some(
(query) => query?.status === 'pending',
),
(query) => query?.status === 'pending'
)
);

FetchInterceptor();
Expand Down
9 changes: 4 additions & 5 deletions frontend/src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ function Footer() {
}}
brandTop={
<>
Ministère de <br />
la transition <br />
écologique <br />
et de la cohésion <br />
des territoires
Ministère
du Logement <br />
et de la Rénovation <br />
urbaine
</>
}
classes={{
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Group/Group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function Group(props: GroupProps) {
<Container as="main" fluid>
<Row>
<Col n="12">
<Typography component="h6" mb={1}>
<Typography component="h3" variant="body1" mb={1}>
Description
</Typography>
</Col>
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/components/GroupCard/GroupCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ function GroupCard(props: GroupCardProps) {
<Container
as="article"
className={classNames(styles.container, {
[styles.active]: props.isActive,
[styles.active]: props.isActive
})}
fluid
role="group-card"
>
<Typography className={styles.title} mr={1} variant="body2">
<Typography
className={styles.title}
component="h3"
mr={1}
variant="body2"
>
{props.group.title}
</Typography>
<HousingCount
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/GroupHeader/GroupHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ function GroupHeader(props: Props) {
return (
<Grid className={props.className} component="article" container>
<Grid component="header" mb={2}>
<Typography variant="h6">Vos groupes de logements</Typography>
<Typography component="h2" variant="h6">
Vos groupes de logements
</Typography>
</Grid>

{isLoadingGroups && <Loading />}
Expand Down
9 changes: 4 additions & 5 deletions frontend/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@ function Header() {
<DSFRHeader
brandTop={
<>
Ministère de <br />
la transition <br />
écologique <br />
et de la cohésion <br />
des territoires
Ministère <br />
du Logement <br />
et de la Rénovation <br />
urbaine
</>
}
homeLinkProps={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,14 @@ function HousingListFiltersSidemenu(props: Props) {
xs
>
<Grid
alignItems="center"
alignItems="flex-start"
component="header"
container
mb={1}
justifyContent="space-between"
>
<Grid component="section" xs="auto">
<Typography variant="h6" mb={3}>
<Typography component="h2" variant="h6" mb={3}>
Filtres
</Typography>
</Grid>
Expand Down Expand Up @@ -516,7 +516,7 @@ function HousingListFiltersSidemenu(props: Props) {
</Accordion>
<Accordion
label={
<TitleWithIcon icon="fr-icon-calendar-line" title="Millésime" />
<TitleWithIcon icon="fr-database-2-line" title="Données" />
}
>
<Grid component="article" mb={2} xs={12}>
Expand Down
8 changes: 2 additions & 6 deletions frontend/src/hooks/useDocumentTitle.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { useEffect } from 'react';
import { useTitle } from 'react-use';

export function useDocumentTitle(title?: string) {
useEffect(() => {
document.title = title
? `Zéro Logement Vacant - ${title}`
: 'Zéro Logement Vacant';
});
useTitle(title ? `Zéro Logement Vacant - ${title}` : 'Zéro Logement Vacant');
}
2 changes: 1 addition & 1 deletion frontend/src/services/dashboard.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface FindOneOptions {
id: Resource;
}

type Resource = 'utilisateurs' | 'etablissements';
type Resource = '6-utilisateurs-de-zlv-sur-votre-structure' | '7-autres-structures-de-votre-territoires-inscrites-sur-zlv';

interface Dashboard {
url: string;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/Accessibility/AccessibilityView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const AccessibilityView = () => {
Établie le <span>27 juin 2022</span>.
</p>
<p>
Le <span>Ministère de la Transition Ecologique</span> s’engage à rendre
Le <span>Ministère du Logement et de la Rénovation urbaine</span> s’engage à rendre
son service accessible, conformément à l’article 47 de la loi n°
2005-102 du 11 février 2005.
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useActivationEmail } from '../../../hooks/useActivationEmail';
import styles from './account-email-creation-view.module.scss';
import AppTextInput from '../../../components/_app/AppTextInput/AppTextInput';
import Button from '@codegouvfr/react-dsfr/Button';
import Alert from '@codegouvfr/react-dsfr/Alert';
import { useMatomo } from '@jonkoops/matomo-tracker-react';
import {
TrackEventActions,
Expand Down Expand Up @@ -53,6 +54,11 @@ function AccountEmailCreationView() {
impérativement avoir déjà signé l’acte d’engagement permettant d’accéder
aux données LOVAC via la procédure indiquée sur le site du Cerema.
</Text>
<Alert
severity="warning"
title="Les demandes d&apos;accès à ZLV et LOVAC évoluent !"
description={<>Les procédures via Démarches Simpifiées évoluent. Toute demande de données devra désormais être effectuée sur le nouveau Portail des Données Foncières qui sera déployé à compter du 01/10/2024. <a href='https://datafoncier.cerema.fr/actualites/interruption-des-demandes-dacces-aux-donnees-du-15-septembre-au-1er-octobre-2024'>En savoir plus</a></>}
/>
<Container as="section" fluid>
<Row justifyContent="right">
<AppLink
Expand Down
15 changes: 3 additions & 12 deletions frontend/src/views/Campaign/CampaignDraft.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import Grid from '@mui/material/Unstable_Grid2';
import fp from 'lodash/fp';
import { useEffect, useState } from 'react';
import * as yup from 'yup';

import { useDocumentTitle } from '../../hooks/useDocumentTitle';
import { useCampaign } from '../../hooks/useCampaign';
import { useForm } from '../../hooks/useForm';
import DraftBody, { Body } from '../../components/Draft/DraftBody';
Expand Down Expand Up @@ -38,10 +36,8 @@ import Alert from '@codegouvfr/react-dsfr/Alert';

const schema = yup
.object({
subject: yup
.string(),
body: yup
.string(),
subject: yup.string(),
body: yup.string(),
sender: senderSchema
})
// Must do like that because the useForm hook has a validation bug
Expand All @@ -55,8 +51,6 @@ interface Props {
function CampaignDraft(props: Readonly<Props>) {
const { count, draft, isLoadingDraft } = useCampaign();

useDocumentTitle(props.campaign.title);

const [values, setValues] = useState<DraftCreationPayload>({
subject: '',
body: '',
Expand Down Expand Up @@ -225,10 +219,7 @@ function CampaignDraft(props: Readonly<Props>) {
}}
onSave={save}
/>
<PreviewButton
disabled={!exists}
draft={draft}
/>
<PreviewButton disabled={!exists} draft={draft} />
</Row>
<Row gutters spacing="mb-2w">
<Col n="5">
Expand Down
15 changes: 6 additions & 9 deletions frontend/src/views/Campaign/CampaignInProgress.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { useMatomo } from '@jonkoops/matomo-tracker-react';
import Grid from '@mui/material/Unstable_Grid2';
import { useDocumentTitle } from '../../hooks/useDocumentTitle';
import { useFilters } from '../../hooks/useFilters';
import HousingListFiltersSidemenu from '../../components/HousingListFilters/HousingListFiltersSidemenu';
import {
TrackEventActions,
TrackEventCategories,
TrackEventCategories
} from '../../models/TrackEvent';
import HousingFiltersBadges from '../../components/HousingFiltersBadges/HousingFiltersBadges';
import HousingListMap from '../HousingList/HousingListMap';
Expand All @@ -20,8 +19,6 @@ interface Props {
}

function CampaignInProgress(props: Readonly<Props>) {
useDocumentTitle(props.campaign.title);

const { trackEvent } = useMatomo();
const {
filters,
Expand All @@ -30,12 +27,12 @@ function CampaignInProgress(props: Readonly<Props>) {
removeFilter,
setExpand,
onChangeFilters,
onResetFilters,
onResetFilters
} = useFilters({
storage: 'state',
initialState: {
campaignIds: [props.campaign.id],
},
campaignIds: [props.campaign.id]
}
});

const { view } = useAppSelector((state) => state.housing);
Expand All @@ -44,11 +41,11 @@ function CampaignInProgress(props: Readonly<Props>) {
trackEvent({
category: TrackEventCategories.Campaigns,
action: TrackEventActions.HousingList.Search,
name: query,
name: query
});
setFilters({
...filters,
query,
query
});
}

Expand Down
6 changes: 5 additions & 1 deletion frontend/src/views/Campaign/CampaignView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ import CampaignDraft from './CampaignDraft';
import CampaignSending from './CampaignSending';
import { CampaignStatus } from '../../../../shared';
import NotFoundView from '../NotFoundView';
import { useDocumentTitle } from '../../hooks/useDocumentTitle';

function CampaignView() {
const { campaign, isLoadingCampaign } = useCampaign();
useDocumentTitle(
campaign ? `Campagne - ${campaign.title}` : 'Page non trouvée'
);

if (isLoadingCampaign) {
return <Loading />;
Expand All @@ -22,7 +26,7 @@ function CampaignView() {
draft: <CampaignDraft campaign={campaign} />,
sending: <CampaignSending campaign={campaign} />,
'in-progress': <CampaignInProgress campaign={campaign} />,
archived: <CampaignInProgress campaign={campaign} />,
archived: <CampaignInProgress campaign={campaign} />
};
const CampaignComponent = steps[campaign.status] || <NotFoundView />;

Expand Down
Loading

0 comments on commit 4547eb9

Please sign in to comment.