Skip to content

Commit

Permalink
Merge pull request #895 from betagouv/main
Browse files Browse the repository at this point in the history
FIX landing + baux precaire
  • Loading branch information
ssedoudbgouv authored Sep 9, 2024
2 parents 7ae79ff + eddafa8 commit 1159800
Show file tree
Hide file tree
Showing 15 changed files with 63 additions and 22 deletions.
7 changes: 7 additions & 0 deletions mobile-tools/feed.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
"link": "https://www.economie.gouv.fr/",
"description": "",
"items": [
{
"title": "La DGCCRF s'engage pour favoriser la consommation durable",
"link": "https://www.economie.gouv.fr/dgccrf/la-dgccrf-sengage-pour-favoriser-la-consommation-durable",
"description": "Faire évoluer nos modes de consommation est nécessaire pour réussir la transition écologique. La DGCCRF participe à l’élaboration de nouvelles réglementations, contrôle l’application des textes destinés à promouvoir une économie plus verte et accompagne les professionnels et les consommateurs vers une consommation plus durable. Le point sur le sujet à l’occasion de la semaine européenne du développement durable 2024.\n",
"guid": "3230353",
"date": "2024-09-06T09:11:16+02:00"
},
{
"title": "Le site vous informant sur le prix des contrôles techniques évolue !",
"link": "https://www.economie.gouv.fr/dgccrf/le-site-vous-informant-sur-le-prix-des-controles-techniques-evolue",
Expand Down
4 changes: 4 additions & 0 deletions shared/anomalies/Anomaly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ type SubcategoryBase = CategoryNodeBase & {
// A typical subcategory
export type StandardSubcategory = SubcategoryBase & {
fileLabel?: string
attachmentDesc?: string
//Customize consumer client reference input
customizedClientReferenceInput?: ClientReferenceInput
detailInputs?: DetailInput[]
Expand All @@ -82,6 +83,8 @@ export type SubcategoryWithInfoWall = SubcategoryBase & {

export type Subcategory = StandardSubcategory | SubcategoryWithInfoWall

export const reportTagsNotTransmittableToPro = ['BauxPrecaire']

export const reportTagsAllowedInYaml = [
'Hygiene',
'ProduitDangereux',
Expand All @@ -106,6 +109,7 @@ export const reportTagsAllowedInYaml = [
'AlimentationMaterielAnimaux',
'Telecom',
'Shrinkflation',
...reportTagsNotTransmittableToPro
] as const
export type ReportTagAllowedInYaml = (typeof reportTagsAllowedInYaml)[number]

Expand Down
1 change: 1 addition & 0 deletions shared/anomalies/checks/checkAnomaliesJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const subcategoryWithInfoWallSpec: ObjectSpec = {

const standardSubcategorySpec: ObjectSpec = {
fileLabel: _ => _.ifDefined()?.assertIsString(),
attachmentDesc: _ => _.ifDefined()?.assertIsString(),
customizedClientReferenceInput: _ =>
_.ifDefined()?.assertIsObjectWith({
label: _ => _.ifDefined()?.assertIsString(),
Expand Down
5 changes: 3 additions & 2 deletions website/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ const changedPaths = [
],
['/fr/app-mobile', '/fr/actualites/signalconso-desormais-disponible-en-application-mobile'],
['/en/app-mobile', '/en/actualites/signalconso-mobile-app-available'],
['/d%C3%A9marchage-t%C3%A9l%C3%A9phonique', '/demarchage-telephonique'],
['/d%C3%A9marchage-t%C3%A9l%C3%A9phonique', '/demarchage-abusif'],
['/pompe-%C3%A0-chaleur-pac', '/pompe-a-chaleur-pac'],
['/fr/bloctel', '/fr/demarchage-telephonique'],
['/fr/bloctel', '/fr/demarchage-abusif'],
['/fr/demarchage-telephonique', '/fr/demarchage-abusif'],
['/fr/bloctel/faire-un-signalement', '/fr/demarchage-abusif/faire-un-signalement'],
['/fr/duree-de-vie-produit-obsolescence-programmee-internet', '/fr/duree-de-vie-produit-obsolescence-programmee'],
['/fr/incidents-intoxication-alimentaire', '/fr/intoxication-alimentaire'],
Expand Down
6 changes: 6 additions & 0 deletions website/src/app/[lang]/demarchage-abusif/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {buildGenerateMetadata} from '@/core/metadatas'
import {DemarchageAbusifPage} from '@/reusablePages/manual_landings/demarchageAbusif'

export const generateMetadata = buildGenerateMetadata('demarchageAbusif')

export default DemarchageAbusifPage
6 changes: 0 additions & 6 deletions website/src/app/[lang]/demarchage-telephonique/page.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion website/src/app/[lang]/plan-du-site/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const PlanDuSite = (props: PageComponentProps) => {
<BasicPageLink page="obligationFibre" label={m.planDuSite.obligationFibre} {...{lang}} />
<BasicPageLink page="signalInfluenceur" label={m.planDuSite.signalInfluenceur} {...{lang}} />
<BasicPageLink page="obsolescencePage" label={m.planDuSite.obsolescencePage} {...{lang}} />
<BasicPageLink page="demarchageTelephonique" label={m.planDuSite.demarchageTelephonique} {...{lang}} />
<BasicPageLink page="demarchageAbusif" label={m.planDuSite.demarchageAbusif} {...{lang}} />
<BasicPageLink page="intoxAlimentaire" label={m.planDuSite.intoxAlimentaire} {...{lang}} />
<hr className="mt-4" />
</ul>
Expand Down
17 changes: 15 additions & 2 deletions website/src/components_feature/reportFlow/Details/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const Details = ({stepNavigation}: {stepNavigation: StepNavigation}) => {
transmissionStatus={getTransmissionStatus(report)}
inputs={inputs}
fileLabel={lastSubcategory.fileLabel}
attachmentDesc={lastSubcategory.attachmentDesc}
employeeConsumer={report.step1.employeeConsumer}
tags={getTags(report)}
onSubmit={(detailInputValues, uploadedFiles) => {
Expand All @@ -69,6 +70,7 @@ export const DetailsInner = ({
initialFiles,
inputs,
fileLabel,
attachmentDesc,
tags,
transmissionStatus,
employeeConsumer,
Expand All @@ -82,6 +84,7 @@ export const DetailsInner = ({
initialValues?: DetailInputValues2
initialFiles?: UploadedFile[]
fileLabel?: string
attachmentDesc?: string
employeeConsumer?: boolean
tags?: ReportTag[]
stepNavigation: StepNavigation
Expand Down Expand Up @@ -173,13 +176,23 @@ export const DetailsInner = ({
<Animate autoScrollTo={false}>
<div>
<h4 className="mt-4">{fileLabel ?? m.attachments}</h4>
{transmissionStatus !== 'NOT_TRANSMITTABLE' && (
{transmissionStatus !== 'NOT_TRANSMITTABLE' ? (
<>
<FriendlyHelpText>
<p className="mb-0" dangerouslySetInnerHTML={{__html: m.attachmentsDesc2}} />
<p className="mb-0" dangerouslySetInnerHTML={{__html: attachmentDesc ?? m.attachmentsDesc2}} />
</FriendlyHelpText>
{consumerWish !== 'fixContractualDispute' && <p dangerouslySetInnerHTML={{__html: m.attachmentsDescAnonymous}} />}
</>
) : (
<FriendlyHelpText>
{/*Do not display any custom attachmentDesc for employee consumer reports*/}
<p
className="mb-0"
dangerouslySetInnerHTML={{
__html: !employeeConsumer && attachmentDesc ? attachmentDesc : m.notTransmittableAttachmentsDesc2,
}}
/>
</FriendlyHelpText>
)}
<ReportFiles
files={uploadedFiles ?? []}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {ReactNode, useEffect} from 'react'
import {useReportFlowContext} from '../ReportFlowContext'
import {ProblemConsumerWishInformation} from './ProblemConsumerWishInformation'
import {ProblemSelect} from './ProblemSelect'
import {FriendlyHelpText} from '@/components_simple/FriendlyHelpText'

export function ProblemConsumerWish({children}: {children: ReactNode}) {
const {m} = useI18n()
Expand All @@ -30,6 +31,11 @@ export function ProblemConsumerWish({children}: {children: ReactNode}) {
const isDone = !!r.step1.consumerWish
return (
<>
{skipQuestion && !r.step1?.employeeConsumer && (
<FriendlyHelpText>
<p className="mb-0" dangerouslySetInnerHTML={{__html: m.notTransmittableToProConsumerInformation}} />
</FriendlyHelpText>
)}
{!skipQuestion && (
<>
<ProblemSelect
Expand Down
2 changes: 1 addition & 1 deletion website/src/components_simple/ScFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function buildLinksList(
link(pagesDefs.signalInfluenceur.url, 'Un influenceur'),
link(pagesDefs.obligationFibre.url, 'Un passage forcé à la fibre'),
link(pagesDefs.obsolescencePage.url, 'Une obsolescence programmée'),
link(pagesDefs.demarchageTelephonique.url, 'Un démarchage téléphonique'),
link(pagesDefs.demarchageAbusif.url, 'Un démarchage téléphonique abusif'),
link(pagesDefs.intoxAlimentaire.url, 'Une intoxication alimentaire'),
],
},
Expand Down
2 changes: 1 addition & 1 deletion website/src/core/pagesDefinitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const internalPageDefs = {
obligationFibre: page('/obligation-adsl-fibre', {hasEnglishVersion: false}),
signalInfluenceur: page('/signaler-un-influenceur', {hasEnglishVersion: false}),
obsolescencePage: page('/duree-de-vie-produit-obsolescence-programmee', {hasEnglishVersion: false}),
demarchageTelephonique: page('/demarchage-telephonique', {hasEnglishVersion: false}),
demarchageAbusif: page('/demarchage-abusif', {hasEnglishVersion: false}),
intoxAlimentaire: page('/intoxication-alimentaire', {hasEnglishVersion: false}),
}

Expand Down
13 changes: 9 additions & 4 deletions website/src/feature/reportUtils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {findAnomaly} from '@/anomalies/Anomalies'
import {CompanyKind, ReportTag, Subcategory} from 'shared/anomalies/Anomaly'
import {CompanyKind, ReportTag, Subcategory, reportTagsNotTransmittableToPro} from 'shared/anomalies/Anomaly'
import {PartialReport} from '@/components_feature/reportFlow/ReportFlowContext'
import {Report, ReportWithPickInStep1 as ReportPickInStep1, TransmissionStatus} from '@/model/Report'
import {lastFromArray, notUndefined} from '@/utils/utils'
Expand Down Expand Up @@ -91,11 +91,16 @@ export const getWipCompanyKindFromSelected = (r: ReportPickInStep1<'subcategorie
: [...getSubcategories(r)].reverse().find(_ => !!_.companyKind)?.companyKind
}

export const isTransmittableToPro = (r: ReportPickInStep1<'employeeConsumer' | 'consumerWish'>): boolean => {
export const isTransmittableToPro = (
r: ReportPickInStep1<'subcategoriesIndexes' | 'employeeConsumer' | 'consumerWish'>,
): boolean => {
return isTransmittableToProBeforePickingConsumerWish(r) && r.step1.consumerWish !== 'getAnswer'
}
export const isTransmittableToProBeforePickingConsumerWish = (r: ReportPickInStep1<'employeeConsumer'>): boolean => {
return !r.step1.employeeConsumer
export const isTransmittableToProBeforePickingConsumerWish = (
r: ReportPickInStep1<'subcategoriesIndexes' | 'employeeConsumer'>,
): boolean => {
const tags = getTags(r)
return !r.step1.employeeConsumer && !tags.some(tag => reportTagsNotTransmittableToPro.includes(tag))
}

export const getTransmissionStatus = (r: Pick<Report, 'step0' | 'step1' | 'step2'>): TransmissionStatus => {
Expand Down
6 changes: 4 additions & 2 deletions website/src/i18n/localization/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export const en = {
title: '',
description: '',
},
demarchageTelephonique: {
demarchageAbusif: {
title: '',
description: '',
},
Expand Down Expand Up @@ -567,7 +567,7 @@ export const en = {
telecomResolutionTips: 'Tips for resolving telecom individual issues (disputes)',
obligationFibre: 'Report a forced migration to fiber optic Internet',
obsolescencePage: 'Report a device with a lifespan that seems too short',
demarchageTelephonique: 'Report an abusive telemarketing call',
demarchageAbusif: 'Report an abusive telemarketing call',
intoxAlimentaire: 'Report food poisoning',
signalInfluenceur: '',
reportIncidentSection: 'Submitting a report',
Expand Down Expand Up @@ -1043,6 +1043,7 @@ export const en = {
consumerWishInvestigationIsPossible2:
'If a business receives an excessively high volume or frequent number of reports, Fraud Control will investigate the companies in question.',
employeeConsumerInformation: `To ensure your job security, your details will not be transmitted to the company. It will be read <b>only by Fraud Control</b>.`,
notTransmittableToProConsumerInformation: `Your reports will not be transmitted to the company. It will be read <b>only by Fraud Control</b>.`,
informationRatingSaved: `Your comments have been recorded, thank you.`,
informationTitle: `Unfortunately, we are unable to take your report any further.`,
informationReportOutOfScope: `Although we do believe the issue you experienced was genuine, it was not a case of fraud.`,
Expand Down Expand Up @@ -1073,6 +1074,7 @@ export const en = {
attachmentsDescAnonymous: `If you do not want the company to know your identity, <b style="color: black">remove your name</b> where it appears on your attachments.`,
attachmentsDescAllowedFormat: (formats: string[]) => `The following formats are accepted : ${formats.join(', ')}`,
attachmentsDesc2: `Including an attachment (for example: a contract, an invoice, exchanges with customer service...) <strong>GREATLY</strong> increases your chances that corrective action will be taken.<br/> You must not share private or sensitive information (e.g. bank account details or medical records).`,
notTransmittableAttachmentsDesc2: `Including an attachment (e.g., a contract, an invoice, correspondence with customer service…) greatly helps our administrative services. <br/> You must not share private or sensitive information (e.g. bank account details or medical records).`,
maxAttachmentsZero: (max: number) => `You can upload up to ${max} attachments`,
maxAttachmentsReached: (max: number) => `${max} attachments limit reached`,
maxAttachementExceeded: (max: number, toRemove: number) =>
Expand Down
6 changes: 4 additions & 2 deletions website/src/i18n/localization/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const fr = {
title: "Signaler un cas d'obsolescence programmée",
description: 'Votre appareil a une durée de vie qui vous semble trop courte, indice de réparabilité manquant, ...',
},
demarchageTelephonique: {
demarchageAbusif: {
title: 'Démarchage téléphonique abusif',
description: 'Signaler une entreprise qui vous appelle sans respecter Bloctel, ou hors des horaires autorisés',
},
Expand Down Expand Up @@ -577,7 +577,7 @@ export const fr = {
telecomResolutionTips: "Conseils pour résolution d'un problème individuel lié au télécom (litige)",
obligationFibre: 'Faire un signalement pour une migration forcée vers la fibre optique',
obsolescencePage: 'Faire un signalement pour un appareil dont la durée de vie vous semble trop courte',
demarchageTelephonique: 'Faire un signalement pour un démarchage téléphonique abusif (malgré Bloctel, trop fréquent, etc.)',
demarchageAbusif: 'Faire un signalement pour un démarchage téléphonique abusif (malgré Bloctel, trop fréquent, etc.)',
intoxAlimentaire: 'Faire un signalement pour une intoxication alimentaire',
signalInfluenceur: 'Faire un signalement sur un influenceur',
reportIncidentSection: "Dépôt d'un signalement",
Expand Down Expand Up @@ -1051,6 +1051,7 @@ export const fr = {
consumerWishInvestigationIsPossible2:
'Si les signalements sont trop nombreux ou fréquents pour un établissement, les enquêteurs de la répression des fraudes interviendront auprès des professionnels.',
employeeConsumerInformation: `Afin de garantir la sécurité de votre emploi, votre signalement ne sera pas transmis à l'entreprise. Il sera lu <b>uniquement par la répression des fraudes</b>.`,
notTransmittableToProConsumerInformation: `Votre signalement ne sera pas transmis à l'entreprise. Il sera lu <b>uniquement par la répression des fraudes</b>.`,
informationRatingSaved: `Votre avis a bien été enregistré, nous vous en remercions.`,
informationTitle: `Emmh, nous ne pouvons pas traiter votre signalement.`,
informationReportOutOfScope: `Nous ne doutons pas que vous ayez réellement rencontré un problème mais... il ne s’agit pas d’une fraude.`,
Expand Down Expand Up @@ -1081,6 +1082,7 @@ export const fr = {
attachmentsDescAnonymous: `Si vous ne souhaitez pas que l'entreprise connaisse votre identité, <b style="color: black">cachez votre nom</b> sur vos pièces jointes.`,
attachmentsDescAllowedFormat: (formats: string[]) => `Sont acceptés les formats suivants : ${formats.join(', ')}`,
attachmentsDesc2: `Ajouter une pièce jointe (par exemple : un contrat, une facture, des échanges avec le SAV…) augmente <strong>FORTEMENT</strong> vos chances d’entraîner une mesure corrective&nbsp;!<br/> Vous ne devez pas communiquer de données sensibles (données bancaires ou médicales).`,
notTransmittableAttachmentsDesc2: `Ajouter une pièce jointe (par exemple : un contrat, une facture, des échanges avec le SAV…) pour aider nos services administratifs&nbsp;!<br/> Vous ne devez pas communiquer de données sensibles (données bancaires ou médicales).`,
maxAttachmentsZero: (max: number) => `Vous pouvez téléverser jusqu'à ${max} pièces jointes`,
maxAttachmentsReached: (max: number) => `Limite de ${max} pièces jointes atteinte`,
maxAttachementExceeded: (max: number, toRemove: number) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {notFound} from 'next/navigation'

const bloctel = 'https://www.bloctel.gouv.fr/'

export function DemarchageTelephoniquePage(props: PageComponentProps) {
export function DemarchageAbusifPage(props: PageComponentProps) {
const lang = props.params.lang
if (lang !== 'fr') {
return notFound()
Expand Down

0 comments on commit 1159800

Please sign in to comment.