refactor: update terminology from 'preferenze' to 'parametri' for consistency across components and forms
This commit is contained in:
parent
bc9689cb4d
commit
4899c66822
15 changed files with 106 additions and 109 deletions
|
|
@ -11,9 +11,9 @@
|
|||
1. **Introduzione al Servizio**: L'interessato ci contratta tramite Idealista, Casa.it etc per richiedere informazioni su un annuncio. Viene guidato alla visita del sito InfoAlloggi.it e informato del servizio di ricerca.
|
||||
2. **Profilazione utente**: Tramite i messaggi, email, chiamate o WhatsApp, si raccolgono informazioni sulle esigenze abitative dell'interessato (budget, zona, tipologia di alloggio, tempistiche).
|
||||
3. **Proposta del Servizio**: Si spiega il funzionamento del servizio di ricerca, le possibili opzioni in quanto ad immobili e i costi associati.
|
||||
Si precompila il profilo, documenti utente, preferenze ri ricerca e si invia il link per la registrazione.
|
||||
Si precompila il profilo, documenti utente, parametri ri ricerca e si invia il link per la registrazione.
|
||||
4. **Registrazione e Pagamento**: L'interessato completa la registrazione sul sito e procede con il pagamento del servizio.
|
||||
5. **Fruizione del servizio**: L'utente contatta i proprietari degli immobili proposti, organizza visite e/o richiede l'accesso ad altri immobili tra quelli disponibili nel sito.
|
||||
6. **Conferma**: Una volta trovato l'alloggio, l'utente notifica il suo interesse a confermare la locazione. Allegando il doc di motivazione nel caso di locazione transitoria. Il consulente recepisce la conferma e convalida la compatibilità dell'immobile con le esigenze dell'utente e accetta la conferma.
|
||||
7. **Saldo e Contratto**: L'utente procede con il saldo del servizio, basato sul tipo di servizio scelto (stabile o transitorio) e alle preferenze di ricerca indicate e basate sull'effettivo immobile confermato. Viene predisposto il contratto di locazione e viene inviato all'utente.
|
||||
7. **Saldo e Contratto**: L'utente procede con il saldo del servizio, basato sul tipo di servizio scelto (stabile o transitorio) e alle parametri di ricerca indicate e basate sull'effettivo immobile confermato. Viene predisposto il contratto di locazione e viene inviato all'utente.
|
||||
8. **Post Contratto**: Nel caso di locazione stabile l'utente salda il costo del contratto redatto. La ricevuta di registrazione viene caricata una volta ottenuta.
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ const SelectedComp = memo(
|
|||
aggiornamento: t.card.in_aggiornamento,
|
||||
consegna: selected.consegna,
|
||||
consegna_da: t.card.consegna_da,
|
||||
mesi: t.preferenze.mesi,
|
||||
mesi: t.parametri.mesi,
|
||||
subito: t.card.consegna_subito,
|
||||
})}
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -401,7 +401,7 @@ export const CardAnnuncio = ({
|
|||
aggiornamento: t.card.in_aggiornamento,
|
||||
consegna: consegna,
|
||||
consegna_da: t.card.consegna_da,
|
||||
mesi: t.preferenze.mesi,
|
||||
mesi: t.parametri.mesi,
|
||||
subito: t.card.consegna_subito,
|
||||
})}
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ function SchedaAnnuncio({ data }: { data: Annunci }) {
|
|||
aggiornamento: it.card.in_aggiornamento,
|
||||
consegna: data.consegna,
|
||||
consegna_da: it.card.consegna_da,
|
||||
mesi: it.preferenze.mesi,
|
||||
mesi: it.parametri.mesi,
|
||||
subito: it.card.consegna_subito,
|
||||
})}
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -470,7 +470,7 @@ const MotivazioneSection = () => {
|
|||
{servizio.motivazione_transitorio ? (
|
||||
<span>
|
||||
{
|
||||
t.preferenze.motivazioni_mappings.find(
|
||||
t.parametri.motivazioni_mappings.find(
|
||||
(m) => m.id === servizio.motivazione_transitorio,
|
||||
)?.title
|
||||
}
|
||||
|
|
@ -561,14 +561,14 @@ const TransitorioSection = () => {
|
|||
<div className="flex flex-col gap-2">
|
||||
<div className="max-w-sm">
|
||||
<Label className="text-base" htmlFor="permanenza">
|
||||
Permanenza (da preferenze servizio):
|
||||
Permanenza (da parametri servizio):
|
||||
</Label>
|
||||
|
||||
<MultiSelect
|
||||
defaultValue={
|
||||
servizio.permanenza
|
||||
? {
|
||||
label: t.preferenze.permanenza[servizio.permanenza] || "",
|
||||
label: t.parametri.permanenza[servizio.permanenza] || "",
|
||||
value: servizio.permanenza.toString(),
|
||||
}
|
||||
: undefined
|
||||
|
|
@ -578,7 +578,7 @@ const TransitorioSection = () => {
|
|||
isMulti={false}
|
||||
onValueChange={handlePermanenzaChange}
|
||||
options={UnpackOptions({
|
||||
options: t.preferenze.permanenza,
|
||||
options: t.parametri.permanenza,
|
||||
})}
|
||||
placeholder="Seleziona..."
|
||||
/>
|
||||
|
|
@ -703,7 +703,7 @@ const GeneralSection = () => {
|
|||
aggiornamento: it.card.in_aggiornamento,
|
||||
|
||||
consegna_da: it.card.consegna_da,
|
||||
mesi: it.preferenze.mesi,
|
||||
mesi: it.parametri.mesi,
|
||||
subito: it.card.consegna_subito,
|
||||
});
|
||||
|
||||
|
|
@ -713,7 +713,7 @@ const GeneralSection = () => {
|
|||
<span className="font-semibold">Persone:</span>
|
||||
<div className="flex w-full gap-4">
|
||||
<div className="flex w-1/2 flex-col gap-2">
|
||||
<Label htmlFor="n_adulti">{t.preferenze.nadulti_label}</Label>
|
||||
<Label htmlFor="n_adulti">{t.parametri.nadulti_label}</Label>
|
||||
<Counter
|
||||
name="n_adulti"
|
||||
onlyPositive
|
||||
|
|
@ -723,7 +723,7 @@ const GeneralSection = () => {
|
|||
</div>
|
||||
|
||||
<div className="flex w-1/2 flex-col gap-2">
|
||||
<Label htmlFor="n_minori">{t.preferenze.nminori_label}</Label>
|
||||
<Label htmlFor="n_minori">{t.parametri.nminori_label}</Label>
|
||||
<Counter
|
||||
name="n_minori"
|
||||
onlyPositive
|
||||
|
|
@ -740,13 +740,13 @@ const GeneralSection = () => {
|
|||
<div className="flex flex-col gap-2">
|
||||
<span className="font-semibold">Entro mese:</span>
|
||||
<div className="max-w-sm">
|
||||
<Label htmlFor="select-mesi">{t.preferenze.dalmese_label}</Label>
|
||||
<Label htmlFor="select-mesi">{t.parametri.dalmese_label}</Label>
|
||||
<MultiSelect
|
||||
defaultValue={
|
||||
servizio.entromese !== null
|
||||
? {
|
||||
// biome-ignore lint/style/noNonNullAssertion: <known size>
|
||||
label: t.preferenze.mesi[servizio.entromese]!,
|
||||
label: t.parametri.mesi[servizio.entromese]!,
|
||||
value: String(servizio.entromese),
|
||||
}
|
||||
: undefined
|
||||
|
|
@ -756,7 +756,7 @@ const GeneralSection = () => {
|
|||
isMulti={false}
|
||||
onValueChange={handleDisponibilitàChange}
|
||||
options={UnpackOptions({
|
||||
options: t.preferenze.mesi,
|
||||
options: t.parametri.mesi,
|
||||
})}
|
||||
placeholder="Seleziona..."
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ export const BasicAnnuncioCard = ({
|
|||
aggiornamento: t.card.in_aggiornamento,
|
||||
consegna: data.consegna,
|
||||
consegna_da: t.card.consegna_da,
|
||||
mesi: t.preferenze.mesi,
|
||||
mesi: t.parametri.mesi,
|
||||
subito: t.card.consegna_subito,
|
||||
})}
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -38,12 +38,12 @@ export const AnnunciCompatibili = () => {
|
|||
<DialogContent className="max-w-xl p-2 sm:max-w-5xl sm:p-6 md:max-w-7xl 2xl:max-w-[100rem]">
|
||||
<DialogHeader className="flex-row flex-wrap items-center gap-5 pt-6">
|
||||
<DialogTitle>
|
||||
Annunci compatibili con le preferenze del servizio
|
||||
Annunci compatibili con i parametri del servizio
|
||||
</DialogTitle>
|
||||
{isAdmin && (
|
||||
<div className="flex flex-wrap items-center gap-x-2">
|
||||
<Label htmlFor="adminOverride">
|
||||
Ignora limitazioni preferenze
|
||||
Ignora limitazioni parametri
|
||||
</Label>
|
||||
|
||||
<Switch
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ const ServizioBasicActions = ({ className }: { className?: string }) => {
|
|||
if (isAdmin || canUserEdit) {
|
||||
return (
|
||||
<div className={cn("flex flex-wrap items-center gap-3", className)}>
|
||||
<EditPreferenze />
|
||||
<EditParametri />
|
||||
<InterruzioneServizio />
|
||||
</div>
|
||||
);
|
||||
|
|
@ -399,9 +399,9 @@ const InterruzioneServizio = () => {
|
|||
);
|
||||
};
|
||||
|
||||
const EditPreferenze = () => {
|
||||
const EditParametri = () => {
|
||||
const { servizioId, userId, isAdmin, servizio } = useServizio();
|
||||
const [openEditPreferenze, setOpenEditPreferenze] = useState(false);
|
||||
const [openEditParametri, setOpenEditParametri] = useState(false);
|
||||
const { data, isLoading } = api.servizio.getServizio.useQuery({ servizioId });
|
||||
const utils = api.useUtils();
|
||||
|
||||
|
|
@ -416,7 +416,7 @@ const EditPreferenze = () => {
|
|||
await utils.servizio.getCompatibileAnnunci.invalidate({
|
||||
servizioId,
|
||||
});
|
||||
setOpenEditPreferenze(false);
|
||||
setOpenEditParametri(false);
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -430,10 +430,10 @@ const EditPreferenze = () => {
|
|||
}
|
||||
|
||||
return (
|
||||
<Credenza onOpenChange={setOpenEditPreferenze} open={openEditPreferenze}>
|
||||
<Credenza onOpenChange={setOpenEditParametri} open={openEditParametri}>
|
||||
<CredenzaTrigger asChild>
|
||||
<Button
|
||||
aria-label="Preferenze di ricerca"
|
||||
aria-label="Parametri di ricerca"
|
||||
className=""
|
||||
disabled={
|
||||
!isAdmin &&
|
||||
|
|
@ -443,14 +443,14 @@ const EditPreferenze = () => {
|
|||
variant="secondary"
|
||||
>
|
||||
<Calculator />
|
||||
Preferenze
|
||||
Parametri
|
||||
</Button>
|
||||
</CredenzaTrigger>
|
||||
<CredenzaContent className="max-h-[90vh] w-full sm:max-w-5xl">
|
||||
<CredenzaHeader>
|
||||
<CredenzaTitle>Preferenze di ricerca</CredenzaTitle>
|
||||
<CredenzaTitle>Parametri di ricerca</CredenzaTitle>
|
||||
<CredenzaDescription className="sr-only">
|
||||
Preferenze
|
||||
Parametri
|
||||
</CredenzaDescription>
|
||||
</CredenzaHeader>
|
||||
<CredenzaBody className="max-h-[80vh] w-full max-w-3xl overflow-y-auto pb-5 sm:max-w-5xl">
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ export const FormNewServizio = ({
|
|||
["ascensore", string],
|
||||
["pianoterra", string],
|
||||
];
|
||||
const altrePrefMapping = t.altrePrefMapping as altrePrefMappingType;
|
||||
const altrePrefMapping = t.altriParamsMapping as altrePrefMappingType;
|
||||
const tipologia = form.watch("tipologia");
|
||||
return (
|
||||
<Form {...form}>
|
||||
|
|
@ -192,8 +192,8 @@ export const FormNewServizio = ({
|
|||
<FormItem>
|
||||
<div className="flex flex-wrap items-center gap-x-2 pb-1">
|
||||
<FormLabel htmlFor="budgetslider">
|
||||
{`${t.preferenze.budget_label1} - ${field.value.toLocaleString("it")},00 ${
|
||||
t.preferenze.budget_label2
|
||||
{`${t.parametri.budget_label1} - ${field.value.toLocaleString("it")},00 ${
|
||||
t.parametri.budget_label2
|
||||
}`}
|
||||
</FormLabel>
|
||||
<FormMessage />
|
||||
|
|
@ -213,7 +213,7 @@ export const FormNewServizio = ({
|
|||
value={[form.getValues("budget")]}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormDescription>{t.preferenze.budget_desc}</FormDescription>
|
||||
<FormDescription>{t.parametri.budget_desc}</FormDescription>
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
|
@ -225,7 +225,7 @@ export const FormNewServizio = ({
|
|||
<FormItem className="w-full">
|
||||
<div className="flex flex-wrap items-center gap-x-2">
|
||||
<FormLabel htmlFor="select-mesi">
|
||||
{t.preferenze.dalmese_label}...
|
||||
{t.parametri.dalmese_label}...
|
||||
</FormLabel>
|
||||
{field.value !== null && !initialData && (
|
||||
<button
|
||||
|
|
@ -245,7 +245,7 @@ export const FormNewServizio = ({
|
|||
field.value !== null
|
||||
? {
|
||||
// biome-ignore lint/style/noNonNullAssertion: <known size>
|
||||
label: t.preferenze.mesi[field.value]!,
|
||||
label: t.parametri.mesi[field.value]!,
|
||||
value: String(field.value),
|
||||
}
|
||||
: undefined
|
||||
|
|
@ -259,7 +259,7 @@ export const FormNewServizio = ({
|
|||
);
|
||||
}}
|
||||
options={UnpackOptions({
|
||||
options: t.preferenze.mesi,
|
||||
options: t.parametri.mesi,
|
||||
})}
|
||||
placeholder="Seleziona..."
|
||||
/>
|
||||
|
|
@ -275,7 +275,7 @@ export const FormNewServizio = ({
|
|||
<FormItem className="w-full">
|
||||
<div className="flex flex-wrap items-center gap-x-2">
|
||||
<FormLabel htmlFor="permanenza">
|
||||
{t.preferenze.permanenza_label}
|
||||
{t.parametri.permanenza_label}
|
||||
</FormLabel>
|
||||
{field.value !== null && !initialData && (
|
||||
<button
|
||||
|
|
@ -294,7 +294,7 @@ export const FormNewServizio = ({
|
|||
defaultValue={
|
||||
field.value
|
||||
? {
|
||||
label: t.preferenze.permanenza[field.value] || "",
|
||||
label: t.parametri.permanenza[field.value] || "",
|
||||
value: field.value.toString(),
|
||||
}
|
||||
: undefined
|
||||
|
|
@ -309,14 +309,12 @@ export const FormNewServizio = ({
|
|||
);
|
||||
}}
|
||||
options={UnpackOptions({
|
||||
options: t.preferenze.permanenza,
|
||||
options: t.parametri.permanenza,
|
||||
})}
|
||||
placeholder="Seleziona..."
|
||||
/>
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
{t.preferenze.permanenza_desc}
|
||||
</FormDescription>
|
||||
<FormDescription>{t.parametri.permanenza_desc}</FormDescription>
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
|
@ -332,7 +330,7 @@ export const FormNewServizio = ({
|
|||
className={cn("font-semibold text-base")}
|
||||
htmlFor="n_adulti"
|
||||
>
|
||||
{t.preferenze.nadulti_label}
|
||||
{t.parametri.nadulti_label}
|
||||
</FormLabel>
|
||||
<FormMessage />
|
||||
</div>
|
||||
|
|
@ -357,7 +355,7 @@ export const FormNewServizio = ({
|
|||
className={cn("font-semibold text-base")}
|
||||
htmlFor="n_minori"
|
||||
>
|
||||
{t.preferenze.nminori_label}
|
||||
{t.parametri.nminori_label}
|
||||
</FormLabel>
|
||||
<FormMessage />
|
||||
</div>
|
||||
|
|
@ -380,7 +378,7 @@ export const FormNewServizio = ({
|
|||
<FormItem className="w-full">
|
||||
<div className="flex flex-wrap items-center gap-x-2">
|
||||
<FormLabel htmlFor="arredato">
|
||||
{t.preferenze.arredato_label}
|
||||
{t.parametri.arredato_label}
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Switch
|
||||
|
|
@ -393,7 +391,7 @@ export const FormNewServizio = ({
|
|||
<FormMessage />
|
||||
</div>
|
||||
|
||||
<FormDescription>{t.preferenze.arredato_desc}</FormDescription>
|
||||
<FormDescription>{t.parametri.arredato_desc}</FormDescription>
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
|
@ -405,14 +403,14 @@ export const FormNewServizio = ({
|
|||
key={tipologia}
|
||||
name="motivazione_transitorio"
|
||||
render={({ field }) => {
|
||||
const existingValue = t.preferenze.motivazioni_mappings.find(
|
||||
const existingValue = t.parametri.motivazioni_mappings.find(
|
||||
(m) => m.id === field.value,
|
||||
);
|
||||
return (
|
||||
<FormItem className="w-full">
|
||||
<div className="flex w-full flex-wrap items-center gap-x-2">
|
||||
<FormLabel htmlFor="motivazione_transitorio">
|
||||
{t.preferenze.motivazione_label}
|
||||
{t.parametri.motivazione_label}
|
||||
</FormLabel>
|
||||
<FormMessage />
|
||||
</div>
|
||||
|
|
@ -443,7 +441,7 @@ export const FormNewServizio = ({
|
|||
onValueChange={(value) => {
|
||||
field.onChange(value.value);
|
||||
}}
|
||||
options={t.preferenze.motivazioni_mappings.map(
|
||||
options={t.parametri.motivazioni_mappings.map(
|
||||
(option) => ({
|
||||
label: option.title,
|
||||
value: option.id,
|
||||
|
|
@ -452,7 +450,7 @@ export const FormNewServizio = ({
|
|||
placeholder={t.seleziona_placeholder}
|
||||
/>
|
||||
<FormDescription>
|
||||
{t.preferenze.motivazione_desc}
|
||||
{t.parametri.motivazione_desc}
|
||||
</FormDescription>
|
||||
</>
|
||||
)}
|
||||
|
|
@ -538,7 +536,7 @@ export const FormNewServizio = ({
|
|||
<FormItem>
|
||||
<div className="flex flex-wrap items-center gap-x-2">
|
||||
<FormLabel htmlFor="select-reddito">
|
||||
{t.preferenze.reddito_label}
|
||||
{t.parametri.reddito_label}
|
||||
</FormLabel>
|
||||
<FormMessage />
|
||||
</div>
|
||||
|
|
@ -552,7 +550,7 @@ export const FormNewServizio = ({
|
|||
field.onChange(value.value);
|
||||
}}
|
||||
options={UnpackOptions({
|
||||
options: t.preferenze.reddito_options,
|
||||
options: t.parametri.reddito_options,
|
||||
})}
|
||||
placeholder={t.seleziona_placeholder}
|
||||
/>
|
||||
|
|
@ -563,9 +561,9 @@ export const FormNewServizio = ({
|
|||
|
||||
<div className="flex flex-col space-y-2">
|
||||
<Label htmlFor="altrePrefDialogButton">
|
||||
{t.preferenze.altrepref_label}
|
||||
{t.parametri.altriparams_label}
|
||||
</Label>
|
||||
<FormDescription>{t.preferenze.altrepref_desc}</FormDescription>
|
||||
<FormDescription>{t.parametri.altriparams_desc}</FormDescription>
|
||||
<div className="mt-2 flex flex-wrap gap-2">
|
||||
{altrePrefMapping.map((pair) => {
|
||||
if (pair) {
|
||||
|
|
|
|||
|
|
@ -462,7 +462,7 @@ export const FormNewServizioAcquisto = ({
|
|||
["ascensore", string],
|
||||
["pianoterra", string],
|
||||
];
|
||||
const altrePrefMapping = t.altrePrefMapping as altrePrefMappingType;
|
||||
const altrePrefMapping = t.altriParamsMapping as altrePrefMappingType;
|
||||
const [tipologia, nazione_nascita, budget] = form.watch([
|
||||
"tipologia",
|
||||
"nazione_nascita",
|
||||
|
|
@ -509,7 +509,7 @@ export const FormNewServizioAcquisto = ({
|
|||
<FormItem>
|
||||
<div className="flex flex-wrap items-center gap-x-2">
|
||||
<FormLabel htmlFor="select-tipologia">
|
||||
{t.preferenze.tipologia}
|
||||
{t.parametri.tipologia}
|
||||
</FormLabel>
|
||||
<FormMessage />
|
||||
</div>
|
||||
|
|
@ -557,8 +557,8 @@ export const FormNewServizioAcquisto = ({
|
|||
<FormItem>
|
||||
<div className="flex flex-wrap items-center gap-x-2 pb-1">
|
||||
<FormLabel htmlFor="budgetslider">
|
||||
{`${t.preferenze.budget_label1} - ${field.value},00 ${
|
||||
t.preferenze.budget_label2
|
||||
{`${t.parametri.budget_label1} - ${field.value},00 ${
|
||||
t.parametri.budget_label2
|
||||
}`}
|
||||
</FormLabel>
|
||||
<FormMessage />
|
||||
|
|
@ -578,7 +578,7 @@ export const FormNewServizioAcquisto = ({
|
|||
value={[budget]}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormDescription>{t.preferenze.budget_desc}</FormDescription>
|
||||
<FormDescription>{t.parametri.budget_desc}</FormDescription>
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
|
@ -590,7 +590,7 @@ export const FormNewServizioAcquisto = ({
|
|||
<FormItem className="w-full">
|
||||
<div className="flex flex-wrap items-center gap-x-2">
|
||||
<FormLabel htmlFor="select-mesi">
|
||||
{t.preferenze.dalmese_label}...
|
||||
{t.parametri.dalmese_label}...
|
||||
</FormLabel>
|
||||
<FormMessage />
|
||||
</div>
|
||||
|
|
@ -600,7 +600,7 @@ export const FormNewServizioAcquisto = ({
|
|||
field.value !== null
|
||||
? {
|
||||
// biome-ignore lint/style/noNonNullAssertion: <known size>
|
||||
label: t.preferenze.mesi[field.value]!,
|
||||
label: t.parametri.mesi[field.value]!,
|
||||
value: String(field.value),
|
||||
}
|
||||
: undefined
|
||||
|
|
@ -614,7 +614,7 @@ export const FormNewServizioAcquisto = ({
|
|||
);
|
||||
}}
|
||||
options={UnpackOptions({
|
||||
options: t.preferenze.mesi,
|
||||
options: t.parametri.mesi,
|
||||
})}
|
||||
placeholder="Seleziona..."
|
||||
/>
|
||||
|
|
@ -630,7 +630,7 @@ export const FormNewServizioAcquisto = ({
|
|||
<FormItem className="w-full">
|
||||
<div className="flex flex-wrap items-center gap-x-2">
|
||||
<FormLabel htmlFor="permanenza">
|
||||
{t.preferenze.permanenza_label}
|
||||
{t.parametri.permanenza_label}
|
||||
</FormLabel>
|
||||
<FormMessage />
|
||||
</div>
|
||||
|
|
@ -641,7 +641,7 @@ export const FormNewServizioAcquisto = ({
|
|||
field.value
|
||||
? {
|
||||
label:
|
||||
t.preferenze.permanenza[field.value] || "",
|
||||
t.parametri.permanenza[field.value] || "",
|
||||
value: field.value.toString(),
|
||||
}
|
||||
: undefined
|
||||
|
|
@ -658,13 +658,13 @@ export const FormNewServizioAcquisto = ({
|
|||
);
|
||||
}}
|
||||
options={UnpackOptions({
|
||||
options: t.preferenze.permanenza,
|
||||
options: t.parametri.permanenza,
|
||||
})}
|
||||
placeholder="Seleziona..."
|
||||
/>
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
{t.preferenze.permanenza_desc}
|
||||
{t.parametri.permanenza_desc}
|
||||
</FormDescription>
|
||||
</FormItem>
|
||||
)}
|
||||
|
|
@ -679,7 +679,7 @@ export const FormNewServizioAcquisto = ({
|
|||
<FormItem className={cn("w-full")}>
|
||||
<div className="flex flex-wrap items-center gap-x-2">
|
||||
<FormLabel className={cn("")} htmlFor="n_adulti">
|
||||
{t.preferenze.nadulti_label}
|
||||
{t.parametri.nadulti_label}
|
||||
</FormLabel>
|
||||
<FormMessage />
|
||||
</div>
|
||||
|
|
@ -701,7 +701,7 @@ export const FormNewServizioAcquisto = ({
|
|||
<FormItem className={cn("w-full")}>
|
||||
<div className="flex flex-wrap items-center gap-x-2">
|
||||
<FormLabel className={cn("")} htmlFor="n_minori">
|
||||
{t.preferenze.nminori_label}
|
||||
{t.parametri.nminori_label}
|
||||
</FormLabel>
|
||||
<FormMessage />
|
||||
</div>
|
||||
|
|
@ -725,7 +725,7 @@ export const FormNewServizioAcquisto = ({
|
|||
<FormItem className="w-full">
|
||||
<div className="flex flex-wrap items-center gap-x-2">
|
||||
<FormLabel htmlFor="arredato">
|
||||
{t.preferenze.arredato_label}
|
||||
{t.parametri.arredato_label}
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Switch
|
||||
|
|
@ -739,7 +739,7 @@ export const FormNewServizioAcquisto = ({
|
|||
</div>
|
||||
|
||||
<FormDescription>
|
||||
{t.preferenze.arredato_desc}
|
||||
{t.parametri.arredato_desc}
|
||||
</FormDescription>
|
||||
</FormItem>
|
||||
)}
|
||||
|
|
@ -753,15 +753,14 @@ export const FormNewServizioAcquisto = ({
|
|||
key={tipologia}
|
||||
name="motivazione_transitorio"
|
||||
render={({ field }) => {
|
||||
const existingValue =
|
||||
t.preferenze.motivazioni_mappings.find(
|
||||
(m) => m.id === field.value,
|
||||
);
|
||||
const existingValue = t.parametri.motivazioni_mappings.find(
|
||||
(m) => m.id === field.value,
|
||||
);
|
||||
return (
|
||||
<FormItem className="w-full">
|
||||
<div className="flex w-full flex-wrap items-center gap-x-2">
|
||||
<FormLabel htmlFor="motivazione_transitorio">
|
||||
{t.preferenze.motivazione_label}
|
||||
{t.parametri.motivazione_label}
|
||||
</FormLabel>
|
||||
<FormMessage />
|
||||
</div>
|
||||
|
|
@ -780,7 +779,7 @@ export const FormNewServizioAcquisto = ({
|
|||
onValueChange={(value) => {
|
||||
field.onChange(value.value);
|
||||
}}
|
||||
options={t.preferenze.motivazioni_mappings.map(
|
||||
options={t.parametri.motivazioni_mappings.map(
|
||||
(option) => ({
|
||||
label: option.title,
|
||||
value: option.id,
|
||||
|
|
@ -789,7 +788,7 @@ export const FormNewServizioAcquisto = ({
|
|||
placeholder={t.seleziona_placeholder}
|
||||
/>
|
||||
<FormDescription>
|
||||
{t.preferenze.motivazione_desc}
|
||||
{t.parametri.motivazione_desc}
|
||||
</FormDescription>
|
||||
</FormItem>
|
||||
);
|
||||
|
|
@ -855,7 +854,7 @@ export const FormNewServizioAcquisto = ({
|
|||
<FormItem>
|
||||
<div className="flex flex-wrap items-center gap-x-2">
|
||||
<FormLabel htmlFor="select-reddito">
|
||||
{t.preferenze.reddito_label}
|
||||
{t.parametri.reddito_label}
|
||||
</FormLabel>
|
||||
<FormMessage />
|
||||
</div>
|
||||
|
|
@ -869,7 +868,7 @@ export const FormNewServizioAcquisto = ({
|
|||
field.onChange(value.value);
|
||||
}}
|
||||
options={UnpackOptions({
|
||||
options: t.preferenze.reddito_options,
|
||||
options: t.parametri.reddito_options,
|
||||
})}
|
||||
placeholder={t.seleziona_placeholder}
|
||||
/>
|
||||
|
|
@ -880,9 +879,9 @@ export const FormNewServizioAcquisto = ({
|
|||
|
||||
<div className="flex flex-col space-y-2">
|
||||
<Label htmlFor="altrePrefDialogButton">
|
||||
{t.preferenze.altrepref_label}
|
||||
{t.parametri.altriparams_label}
|
||||
</Label>
|
||||
<FormDescription>{t.preferenze.altrepref_desc}</FormDescription>
|
||||
<FormDescription>{t.parametri.altriparams_desc}</FormDescription>
|
||||
<div className="mt-2 flex flex-wrap gap-2">
|
||||
{altrePrefMapping.map((pair) => {
|
||||
if (pair) {
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ export const en: LangDict = {
|
|||
success_caricamento: "Files uploaded successfully",
|
||||
title: "Attachments",
|
||||
},
|
||||
altrePrefMapping: [
|
||||
altriParamsMapping: [
|
||||
["animali", "I have pets"],
|
||||
["giardino", "Garden or outdoor space"],
|
||||
["terrazzo", "Terrace"],
|
||||
|
|
@ -808,9 +808,9 @@ export const en: LangDict = {
|
|||
newPw: "New password",
|
||||
pwAggiornata: "Password updated",
|
||||
},
|
||||
preferenze: {
|
||||
altrepref_desc: "Select any additional preferences",
|
||||
altrepref_label: "Other preferences",
|
||||
parametri: {
|
||||
altriparams_desc: "Select any additional preferences",
|
||||
altriparams_label: "Other preferences",
|
||||
arredato_desc: "Select if you want a furnished property",
|
||||
arredato_label: "Furnished",
|
||||
budget_acquisto: " €",
|
||||
|
|
@ -967,7 +967,7 @@ export const en: LangDict = {
|
|||
titolo2: "Working information",
|
||||
titolo3: "Other preferences",
|
||||
},
|
||||
preferenze_mancanti: {
|
||||
parametri_mancanti: {
|
||||
description: "You have not yet entered your search preferences",
|
||||
inserisci: "Enter your preferences now",
|
||||
text: `Search preferences are essential to use the service.
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ export const it: LangDict = {
|
|||
success_caricamento: "File caricati con successo",
|
||||
title: "Allegati",
|
||||
},
|
||||
altrePrefMapping: [
|
||||
altriParamsMapping: [
|
||||
["animali", "Ho animali"],
|
||||
["giardino", "Giardino o spazio esterno"],
|
||||
["terrazzo", "Terrazzo"],
|
||||
|
|
@ -670,7 +670,7 @@ export const it: LangDict = {
|
|||
title: "Profilo",
|
||||
},
|
||||
],
|
||||
impostazioni: "Preferenze",
|
||||
impostazioni: "Parametri",
|
||||
impostazioni_chiudi: "Chiudi",
|
||||
loginMenuAdmin: [
|
||||
{
|
||||
|
|
@ -804,9 +804,9 @@ export const it: LangDict = {
|
|||
newPw: "Nuova password",
|
||||
pwAggiornata: "Password aggiornata",
|
||||
},
|
||||
preferenze: {
|
||||
altrepref_desc: "Seleziona le preferenze aggiuntive",
|
||||
altrepref_label: "Altre preferenze",
|
||||
parametri: {
|
||||
altriparams_desc: "Seleziona gli altri parametri",
|
||||
altriparams_label: "Altri parametri",
|
||||
arredato_desc: "Se stai cercando un immobile arredato",
|
||||
arredato_label: "Arredato",
|
||||
budget_acquisto: " €",
|
||||
|
|
@ -959,17 +959,17 @@ export const it: LangDict = {
|
|||
"Villetta schiera",
|
||||
],
|
||||
tipologie_label: "Tipologie di immobile",
|
||||
titolo: "Preferenze di Ricerca",
|
||||
titolo: "Parametri di Ricerca",
|
||||
titolo2: "Informazioni Lavorative",
|
||||
titolo3: "Altre Preferenze",
|
||||
titolo3: "Altri Parametri",
|
||||
},
|
||||
preferenze_mancanti: {
|
||||
description: "Non hai ancora inserito le tue preferenze di ricerca",
|
||||
inserisci: "Inserisci ora le tue preferenze",
|
||||
text: `Le preferenze di ricerca sono fondamentali per usufruire del servizio,
|
||||
inserisci ora le tue preferenze per poter inviare una richiesta al
|
||||
parametri_mancanti: {
|
||||
description: "Non hai ancora inserito i tuoi parametri di ricerca",
|
||||
inserisci: "Inserisci ora i tuoi parametri",
|
||||
text: `I parametri di ricerca sono fondamentali per usufruire del servizio,
|
||||
inserisci ora i tuoi parametri per poter inviare una richiesta al
|
||||
proprietario.`,
|
||||
title: "Preferenze Mancanti",
|
||||
title: "Parametri Mancanti",
|
||||
},
|
||||
prezzi: {
|
||||
acconto: "Acconto",
|
||||
|
|
|
|||
|
|
@ -426,7 +426,7 @@ export type LangDict = {
|
|||
alert_inserito: string;
|
||||
alert_inserito_corretto: string;
|
||||
};
|
||||
preferenze: {
|
||||
parametri: {
|
||||
titolo: string;
|
||||
titolo2: string;
|
||||
titolo3: string;
|
||||
|
|
@ -445,8 +445,8 @@ export type LangDict = {
|
|||
npersone_label: string;
|
||||
nadulti_label: string;
|
||||
nminori_label: string;
|
||||
altrepref_label: string;
|
||||
altrepref_desc: string;
|
||||
altriparams_label: string;
|
||||
altriparams_desc: string;
|
||||
comuni: string[];
|
||||
tipologie: string[];
|
||||
mesi: string[];
|
||||
|
|
@ -463,7 +463,7 @@ export type LangDict = {
|
|||
cta_label: string;
|
||||
}[];
|
||||
};
|
||||
altrePrefMapping: string[][];
|
||||
altriParamsMapping: string[][];
|
||||
pwReset: {
|
||||
titolo: string;
|
||||
oldPw: string;
|
||||
|
|
@ -665,7 +665,7 @@ export type LangDict = {
|
|||
title: string;
|
||||
rating_text: string;
|
||||
};
|
||||
preferenze_mancanti: {
|
||||
parametri_mancanti: {
|
||||
title: string;
|
||||
description: string;
|
||||
text: string;
|
||||
|
|
|
|||
|
|
@ -135,8 +135,8 @@ const Filters = () => {
|
|||
} = useRicerca();
|
||||
const mappedConsegnaOptions = useMemo(
|
||||
// biome-ignore lint/style/noNonNullAssertion: <known lenght>
|
||||
() => consegnaOptions.map((m) => t.preferenze.mesi[m]!).filter(Boolean),
|
||||
[consegnaOptions, t.preferenze.mesi],
|
||||
() => consegnaOptions.map((m) => t.parametri.mesi[m]!).filter(Boolean),
|
||||
[consegnaOptions, t.parametri.mesi],
|
||||
);
|
||||
return (
|
||||
<>
|
||||
|
|
@ -177,16 +177,16 @@ const Filters = () => {
|
|||
await setConsegna(null);
|
||||
return;
|
||||
}
|
||||
if (t.preferenze.mesi.includes(value)) {
|
||||
await setConsegna(t.preferenze.mesi.indexOf(value));
|
||||
if (t.parametri.mesi.includes(value)) {
|
||||
await setConsegna(t.parametri.mesi.indexOf(value));
|
||||
return;
|
||||
}
|
||||
console.warn("Value not found in preferenze.mesi");
|
||||
console.warn("Value not found in parametri.mesi");
|
||||
await setConsegna(null);
|
||||
}}
|
||||
options={mappedConsegnaOptions}
|
||||
placeholder={t.seleziona_placeholder}
|
||||
value={consegna ? t.preferenze.mesi[consegna] || "" : ""}
|
||||
value={consegna ? t.parametri.mesi[consegna] || "" : ""}
|
||||
/>
|
||||
<SelectFilter
|
||||
defaultValue={sort}
|
||||
|
|
|
|||
|
|
@ -528,7 +528,7 @@ const CardInfos = ({ data }: { data: Annunci }) => {
|
|||
aggiornamento: t.card.in_aggiornamento,
|
||||
consegna: data.consegna,
|
||||
consegna_da: t.card.consegna_da,
|
||||
mesi: t.preferenze.mesi,
|
||||
mesi: t.parametri.mesi,
|
||||
subito: t.card.consegna_subito,
|
||||
})}
|
||||
</span>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue