From 1f204e788a8c165c1dc7ebdd7112bb0f035a8d59 Mon Sep 17 00:00:00 2001 From: Charles Dufour Date: Tue, 4 Mar 2025 11:19:53 +0100 Subject: [PATCH] [TRELLO-2781] Change 'reassign' to 'reattribute' --- .../[reportId]/page.tsx | 6 ++-- .../webview/reassigner/[reportId]/page.tsx | 4 +-- website/src/clients/AdresseApiClient.ts | 2 +- website/src/clients/SignalConsoApiClient.ts | 10 +++--- ...signCompany.tsx => ReattributeCompany.tsx} | 31 +++++++++---------- website/src/i18n/localization/en.ts | 4 +-- website/src/i18n/localization/fr.ts | 4 +-- 7 files changed, 30 insertions(+), 31 deletions(-) rename website/src/app/[lang]/{reassigner => reattribuer}/[reportId]/page.tsx (70%) rename website/src/components_feature/reportFlow/Company/{ReassignCompany.tsx => ReattributeCompany.tsx} (83%) diff --git a/website/src/app/[lang]/reassigner/[reportId]/page.tsx b/website/src/app/[lang]/reattribuer/[reportId]/page.tsx similarity index 70% rename from website/src/app/[lang]/reassigner/[reportId]/page.tsx rename to website/src/app/[lang]/reattribuer/[reportId]/page.tsx index 5bde271cc..de6503f88 100644 --- a/website/src/app/[lang]/reassigner/[reportId]/page.tsx +++ b/website/src/app/[lang]/reattribuer/[reportId]/page.tsx @@ -1,17 +1,17 @@ import {buildGenerateMetadataForNoIndexPage, PageComponentProps, PathParams} from '@/core/metadatas' -import {ReassignCompany} from '@/components_feature/reportFlow/Company/ReassignCompany' +import {ReattributeCompany} from '@/components_feature/reportFlow/Company/ReattributeCompany' import {LimitedWidthPageContainer} from '@/components_simple/PageContainers' type LocalPathParams = PathParams<{ reportId: string }> -export const generateMetadata = buildGenerateMetadataForNoIndexPage('reassigner') +export const generateMetadata = buildGenerateMetadataForNoIndexPage('reattribuer') export default function Page(props: PageComponentProps) { return ( - + ) } diff --git a/website/src/app/[lang]/webview/reassigner/[reportId]/page.tsx b/website/src/app/[lang]/webview/reassigner/[reportId]/page.tsx index 4133289e5..ba6bb99c9 100644 --- a/website/src/app/[lang]/webview/reassigner/[reportId]/page.tsx +++ b/website/src/app/[lang]/webview/reassigner/[reportId]/page.tsx @@ -1,5 +1,5 @@ import {buildGenerateMetadataForWebviews, PageComponentProps, PathParams} from '@/core/metadatas' -import {ReassignCompany} from '@/components_feature/reportFlow/Company/ReassignCompany' +import {ReattributeCompany} from '@/components_feature/reportFlow/Company/ReattributeCompany' import {WebviewEnvMarker} from '@/utils/WebviewEnvMarker' type LocalPathParams = PathParams<{ @@ -12,7 +12,7 @@ export default function Page(props: PageComponentProps) { return (
- +
) } diff --git a/website/src/clients/AdresseApiClient.ts b/website/src/clients/AdresseApiClient.ts index 5de987c3e..4e4d5fe52 100644 --- a/website/src/clients/AdresseApiClient.ts +++ b/website/src/clients/AdresseApiClient.ts @@ -63,7 +63,7 @@ export class AdresseApiClient { type, //Some PostalCode does not appear when we have more than one city linkend to same postal code - limit: 100, + limit: 20, // autocomplete: 1 }, }) diff --git a/website/src/clients/SignalConsoApiClient.ts b/website/src/clients/SignalConsoApiClient.ts index fcca0772a..0ba7ce30a 100644 --- a/website/src/clients/SignalConsoApiClient.ts +++ b/website/src/clients/SignalConsoApiClient.ts @@ -145,16 +145,16 @@ export class SignalConsoApiClient { return this.client.get(`/reports/${reportId}/engagement/review/exists`) } - isReportReassignable = (reportId: string) => { - return this.client.get(`/reports/${reportId}/reassign`) + isReportReattributable = (reportId: string) => { + return this.client.get(`/reports/${reportId}/reattribute`) } - reassignReport = (reportId: string, company: CompanySearchResult, metadata: ApiReport['metadata']) => { - return this.client.post(`/reports/${reportId}/reassign`, {body: {company, metadata}}) + reattributeReport = (reportId: string, company: CompanySearchResult, metadata: ApiReport['metadata']) => { + return this.client.post(`/reports/${reportId}/reattribute`, {body: {company, metadata}}) } } -export interface ReassignableReport { +export interface ReattributableReport { tags: ReportTag[] creationDate: string companyName?: string diff --git a/website/src/components_feature/reportFlow/Company/ReassignCompany.tsx b/website/src/components_feature/reportFlow/Company/ReattributeCompany.tsx similarity index 83% rename from website/src/components_feature/reportFlow/Company/ReassignCompany.tsx rename to website/src/components_feature/reportFlow/Company/ReattributeCompany.tsx index cdb10b7b6..9ac5abd60 100644 --- a/website/src/components_feature/reportFlow/Company/ReassignCompany.tsx +++ b/website/src/components_feature/reportFlow/Company/ReattributeCompany.tsx @@ -17,31 +17,31 @@ import {CreatedReport} from '@/model/CreatedReport' import {AcknowledgementInner} from '@/components_feature/reportFlow/Acknowledgement/Acknowledgement' import {useToastError} from '@/hooks/useToastError' -interface ReassignCompanyProps { +interface ReattributeCompanyProps { reportId: string isWebView: boolean } -export const ReassignCompany = ({reportId, isWebView}: ReassignCompanyProps) => { +export const ReattributeCompany = ({reportId, isWebView}: ReattributeCompanyProps) => { const {m, currentLang} = useI18n() const [method, setMethod] = useState<'byNameAndGeoArea' | 'byIdentifier' | undefined>() const {signalConsoApiClient} = useApiClients() const toastError = useToastError() - const _isReportReassignable = useQuery({ - queryKey: ['isReportReassignable', reportId], - queryFn: () => signalConsoApiClient.isReportReassignable(reportId), + const _isReportReattributable = useQuery({ + queryKey: ['isReportReattributable', reportId], + queryFn: () => signalConsoApiClient.isReportReattributable(reportId), retry: false, }) const [isDone, setDone] = useState() - const _reassignReport = useMutation({ + const _reattributeReport = useMutation({ mutationFn: (company: CompanySearchResult) => - signalConsoApiClient.reassignReport(reportId, company, buildReportMetadata({isWebView})), + signalConsoApiClient.reattributeReport(reportId, company, buildReportMetadata({isWebView})), onSuccess: report => setDone(report), onError: error => { - toastError(`---- ${error}`) + toastError(error.message) }, }) @@ -57,23 +57,23 @@ export const ReassignCompany = ({reportId, isWebView}: ReassignCompanyProps) => const options = [optionByNameAndGeoArea, optionByIdentifier] - if (_isReportReassignable.isLoading) { + if (_isReportReattributable.isLoading) { return - } else if (_isReportReassignable.data) { - const {companyName, daysToAnswer, tags, creationDate} = _isReportReassignable.data + } else if (_isReportReattributable.data) { + const {companyName, daysToAnswer, tags, creationDate} = _isReportReattributable.data return isDone ? ( ) : ( <>
-

Ré-assigner votre signalement

+

Réattribuer votre signalement

L'entreprise {companyName} a indiqué que votre signalement du{' '} {isoToHumanReadableText(creationDate, currentLang)} était mal attribué.

- Vous avez {daysToAnswer} jours pour réassigner votre signalement. + Vous avez {daysToAnswer} jours pour réattribuer votre signalement.

@@ -84,18 +84,17 @@ export const ReassignCompany = ({reportId, isWebView}: ReassignCompanyProps) => onChange={setMethod} options={options} title="Identifier la nouvelle entreprise" - titleNoAutoAsterisk description={} /> - {method && dispatch(method, tags, _reassignReport.mutate)} + {method && dispatch(method, tags, _reattributeReport.mutate)} ) } else { return ( <> -

Ce signalement n'existe pas ou n'est pas ré-assignable

+

Ce signalement n'existe pas ou n'est pas réattribuable

diff --git a/website/src/i18n/localization/en.ts b/website/src/i18n/localization/en.ts index 5e93e1de5..67c169cc1 100644 --- a/website/src/i18n/localization/en.ts +++ b/website/src/i18n/localization/en.ts @@ -127,8 +127,8 @@ export const en = { title: 'Share your review - SignalConso', description: '', }, - reassigner: { - title: 'Reassign your report - SignalConso', + reattribuer: { + title: 'Reattribute your report - SignalConso', description: '', }, avisEngagement: { diff --git a/website/src/i18n/localization/fr.ts b/website/src/i18n/localization/fr.ts index 72a12cad3..c2101c181 100644 --- a/website/src/i18n/localization/fr.ts +++ b/website/src/i18n/localization/fr.ts @@ -127,8 +127,8 @@ export const fr = { title: 'Donnez votre avis - SignalConso', description: '', }, - reassigner: { - title: 'Ré-assigner votre signalement - SignalConso', + reattribuer: { + title: 'Réattribuer votre signalement - SignalConso', description: '', }, avisEngagement: {