>(new Set());
-
- const shouldWrap =
- overflowBehavior === "wrap" ||
- (overflowBehavior === "wrap-when-open" && open);
-
- useEffect(() => {
- if (!shouldWrap) return;
- itemsRef.current.forEach((child) => child.style.removeProperty("display"));
- }, [shouldWrap]);
-
- const checkOverflow = useCallback(() => {
- if (valueRef.current == null) return;
-
- const containerElement = valueRef.current;
- const overflowElement = overflowRef.current;
-
- if (overflowElement != null) overflowElement.style.display = "none";
- itemsRef.current.forEach((child) => child.style.removeProperty("display"));
- let amount = 0;
- for (let i = itemsRef.current.size - 1; i >= 0; i--) {
- const child = [...itemsRef.current][i];
- if (
- containerElement.scrollWidth <= containerElement.clientWidth ||
- !child
- ) {
- break;
- }
- amount = itemsRef.current.size - i;
- child.style.display = "none";
- overflowElement?.style.removeProperty("display");
- }
- setOverflowAmount(amount);
- }, []);
-
- useEffect(() => {
- if (valueRef.current == null) return;
-
- const observer = new ResizeObserver(checkOverflow);
- observer.observe(valueRef.current);
-
- return () => observer.disconnect();
- }, [checkOverflow]);
-
- useLayoutEffect(() => {
- checkOverflow();
- }, [selectedValues, checkOverflow]);
-
- if (selectedValues.size === 0 && placeholder) {
- return (
- {placeholder}
- );
- }
-
- return (
-
- {[...selectedValues]
- .filter((value) => items.has(value))
- .map((value) => (
- {
- e.stopPropagation();
- toggleValue(value);
- }
- : undefined
- }
- ref={(el) => {
- if (el == null) return;
-
- itemsRef.current.add(el);
- return () => {
- itemsRef.current.delete(el);
- };
- }}
- variant="outline"
- >
- {items.get(value)}
- {clickToRemove && (
-
- )}
-
- ))}
- 0 && !shouldWrap ? "block" : "none",
- }}
- variant="outline"
- >
- +{overflowAmount}
-
-
- );
-}
-
-export function MultiSelectContent({
- search = true,
- children,
- ...props
-}: {
- search?: boolean | { placeholder?: string; emptyMessage?: string };
- children: ReactNode;
-} & Omit, "children">) {
- const canSearch = typeof search === "object" ? true : search;
-
- return (
- <>
-
-
- {children}
-
-
-
-
- {canSearch ? (
-
- ) : (
- // biome-ignore lint/a11y/noAriaHiddenOnFocusable:
-
- )}
-
- {canSearch && (
-
- {typeof search === "object" ? search.emptyMessage : undefined}
-
- )}
- {children}
-
-
-
- >
- );
-}
-
-export function MultiSelectItem({
- value,
- children,
- badgeLabel,
- onSelect,
- ...props
-}: {
- badgeLabel?: ReactNode;
- value: string;
-} & Omit, "value">) {
- const { toggleValue, selectedValues, onItemAdded } = useMultiSelectContext();
- const isSelected = selectedValues.has(value);
-
- useEffect(() => {
- onItemAdded(value, badgeLabel ?? children);
- }, [value, children, onItemAdded, badgeLabel]);
-
- return (
- {
- toggleValue(v);
- onSelect?.(v);
- }}
- value={value}
- >
-
- {children}
-
- );
-}
-
-export function MultiSelectGroup(
- props: ComponentPropsWithoutRef,
-) {
- return ;
-}
-
-export function MultiSelectSeparator(
- props: ComponentPropsWithoutRef,
-) {
- return ;
-}
-
-function useMultiSelectContext() {
- const context = useContext(MultiSelectContext);
- if (context == null) {
- throw new Error(
- "useMultiSelectContext must be used within a MultiSelectContext",
- );
- }
- return context;
-}
diff --git a/apps/infoalloggi/src/hooks/storageClienSideHooks.ts b/apps/infoalloggi/src/hooks/storageClienSideHooks.ts
index a814b82..236beae 100644
--- a/apps/infoalloggi/src/hooks/storageClienSideHooks.ts
+++ b/apps/infoalloggi/src/hooks/storageClienSideHooks.ts
@@ -11,7 +11,7 @@ type UploadResponse =
error: string;
};
// Helper to handle file uploads
-export async function uploadFile(
+async function uploadFile(
file: File,
expiresAt: string | undefined,
): Promise {
diff --git a/apps/infoalloggi/src/i18n/FormErrorsTranslation.ts b/apps/infoalloggi/src/i18n/FormErrorsTranslation.ts
deleted file mode 100644
index 25eb91c..0000000
--- a/apps/infoalloggi/src/i18n/FormErrorsTranslation.ts
+++ /dev/null
@@ -1,296 +0,0 @@
-export const ita = {
- customErrors: {
- azienda_o_pf: "Seleziona un'opzione",
- codice_fiscale: "Codice fiscale non valido",
- data_nascita: "Data di nascita non valida",
- nazione: "Seleziona una nazione",
- provincia: "Seleziona una provincia",
- tipologia: "Seleziona una tipologia",
- },
- errors: {
- custom: "Input non valido",
- invalid_arguments: "Argomenti della funzione non validi",
- invalid_date: "Data non valida",
- invalid_enum_value:
- "Valore dell'enum non valido. Atteso {{- options}}, ricevuto '{{received}}'",
- invalid_intersection_types:
- "Il risultato dell'intersezione non può essere unito",
- invalid_literal: "Valore literal non valido, atteso {{expected}}",
- invalid_return_type: "Tipo di ritorno della funzione non valido",
- invalid_string: {
- cuid: "{{validation}} non valido",
- datetime: "{{validation}} non valido",
- email: "{{validation}} non valida",
- endsWith: 'Input non valido: deve finire con "{{endsWith}}"',
- regex: "Non valida",
- startsWith: 'Input non valido: deve iniziare con "{{startsWith}}"',
- url: "{{validation}} non valido",
- uuid: "{{validation}} non valido",
- },
- invalid_type: "Atteso {{expected}}, ricevuto {{received}}",
- invalid_type_received_undefined: "Obbligatorio",
- invalid_union: "Input non valido",
- invalid_union_discriminator:
- "Valore discriminante non valido. Atteso {{- options}}",
- not_finite: "Il numero deve essere finito",
- not_multiple_of: "Il numero deve essere un multiplo di {{multipleOf}}",
- too_big: {
- array: {
- exact: "L'array deve contenere esattamente {{maximum}} elementi",
- inclusive: "L'array deve contenere al massimo {{maximum}} elementi",
- not_inclusive: "L'array deve contenere meno di {{maximum}} elementi",
- },
- date: {
- exact: "La data deve essere esattamente {{- maximum, datetime}}",
- inclusive:
- "La data deve essere minore di o uguale a {{- maximum, datetime}}",
- not_inclusive: "La data deve essere minore di {{- maximum, datetime}}",
- },
- number: {
- exact: "Il numero deve essere esattamente {{maximum}}",
- inclusive: "Il numero deve essere minore di o uguale a {{maximum}}",
- not_inclusive: "Il numero deve essere minore di {{maximum}}",
- },
- set: {
- exact: "Input non valido",
- inclusive: "Input non valido",
- not_inclusive: "Input non valido",
- },
- string: {
- exact: "La stringa deve contenere esattamente {{maximum}} caratteri",
- inclusive: "La stringa deve contenere al massimo {{maximum}} caratteri",
- not_inclusive:
- "La stringa deve contenere meno di {{maximum}} caratteri",
- },
- },
- too_small: {
- array: {
- exact: "L'array deve contenere esattamente {{minimum}} elementi",
- inclusive: "L'array deve contenere almeno {{minimum}} elementi",
- not_inclusive: "L'array deve contenere più di {{minimum}} elementi",
- },
- date: {
- exact: "La data deve essere esattamente {{- minimum, datetime}}",
- inclusive:
- "La data deve essere maggiore di o uguale a {{- minimum, datetime}}",
- not_inclusive: "La data deve essere maggiore {{- minimum, datetime}}",
- },
- number: {
- exact: "Il numero deve essere esattamente {{minimum}}",
- inclusive: "Il numero deve essere maggiore o uguale a {{minimum}}",
- not_inclusive: "Il numero deve essere maggiore di {{minimum}}",
- },
- set: {
- exact: "Input non valido",
- inclusive: "Input non valido",
- not_inclusive: "Input non valido",
- },
- string: {
- exact: "La stringa deve contenere esattamente {{minimum}} caratteri",
- //inclusive: "La stringa deve contenere almeno {{minimum}} caratteri",
- inclusive: "Il campo non può essere vuoto",
- not_inclusive: "La stringa deve contenere più di {{minimum}} caratteri",
- },
- },
- unrecognized_keys: "Campo/i non riconosciuto nell'oggetto: {{- keys}}",
- },
- local_types: {
- array: "lista",
- bigint: "numero",
- boolean: "si/no",
- date: "data",
- float: "numero",
- function: "funzione",
- integer: "numero",
- map: "mappa",
- nan: "vuoto",
- never: "mai",
- null: "vuoto",
- number: "numero",
- object: "oggetto",
- promise: "promessa",
- set: "lista",
- string: "testo",
- symbol: "simbolo",
- undefined: "indefinito",
- unknown: "sconosciuto",
- void: "vuoto",
- },
- types: {
- array: "array",
- bigint: "bigint",
- boolean: "boolean",
- date: "date",
- float: "float",
- function: "function",
- integer: "integer",
- map: "map",
- nan: "nan",
- never: "never",
- null: "null",
- number: "number",
- object: "object",
- promise: "promise",
- set: "set",
- string: "string",
- symbol: "symbol",
- undefined: "undefined",
- unknown: "unknown",
- void: "void",
- },
- validations: {
- cuid: "cuid",
- datetime: "datetime",
- email: "email",
- regex: "regex",
- url: "url",
- uuid: "uuid",
- },
-};
-
-export const eng = {
- customErrors: {
- azienda_o_pf: "Select an option",
- codice_fiscale: "Tax code not valid",
- data_nascita: "Select a date",
- nazione: "Select a nation",
- provincia: "Select a province",
- tipologia: "Select a type",
- },
- errors: {
- custom: "Invalid input",
- invalid_arguments: "Invalid function arguments",
- invalid_date: "Invalid date",
- invalid_enum_value:
- "Invalid enum value. Expected {{- options}}, received '{{received}}'",
- invalid_intersection_types: "Intersection results could not be merged",
- invalid_literal: "Invalid literal value, expected {{expected}}",
- invalid_return_type: "Invalid function return type",
- invalid_string: {
- cuid: "Invalid {{validation}}",
- datetime: "Invalid {{validation}}",
- email: "Invalid {{validation}}",
- endsWith: 'Invalid input: must end with "{{endsWith}}"',
- regex: "Invalid",
- startsWith: 'Invalid input: must start with "{{startsWith}}"',
- url: "Invalid {{validation}}",
- uuid: "Invalid {{validation}}",
- },
- invalid_type: "Expected {{expected}}, received {{received}}",
- invalid_type_received_undefined: "Required",
- invalid_union: "Invalid input",
- invalid_union_discriminator:
- "Invalid discriminator value. Expected {{- options}}",
- not_finite: "Number must be finite",
- not_multiple_of: "Number must be a multiple of {{multipleOf}}",
- too_big: {
- array: {
- exact: "Array must contain exactly {{maximum}} element(s)",
- inclusive: "Array must contain at most {{maximum}} element(s)",
- not_inclusive: "Array must contain less than {{maximum}} element(s)",
- },
- date: {
- exact: "Date must be exactly {{- maximum, datetime}}",
- inclusive:
- "Date must be smaller than or equal to {{- maximum, datetime}}",
- not_inclusive: "Date must be smaller than {{- maximum, datetime}}",
- },
- number: {
- exact: "Number must be exactly {{maximum}}",
- inclusive: "Number must be less than or equal to {{maximum}}",
- not_inclusive: "Number must be less than {{maximum}}",
- },
- set: {
- exact: "Invalid input",
- inclusive: "Invalid input",
- not_inclusive: "Invalid input",
- },
- string: {
- exact: "String must contain exactly {{maximum}} character(s)",
- inclusive: "String must contain at most {{maximum}} character(s)",
- not_inclusive: "String must contain under {{maximum}} character(s)",
- },
- },
- too_small: {
- array: {
- exact: "Array must contain exactly {{minimum}} element(s)",
- inclusive: "Array must contain at least {{minimum}} element(s)",
- not_inclusive: "Array must contain more than {{minimum}} element(s)",
- },
- date: {
- exact: "Date must be exactly {{- minimum, datetime}}",
- inclusive:
- "Date must be greater than or equal to {{- minimum, datetime}}",
- not_inclusive: "Date must be greater than {{- minimum, datetime}}",
- },
- number: {
- exact: "Number must be exactly {{minimum}}",
- inclusive: "Number must be greater than or equal to {{minimum}}",
- not_inclusive: "Number must be greater than {{minimum}}",
- },
- set: {
- exact: "Invalid input",
- inclusive: "Invalid input",
- not_inclusive: "Invalid input",
- },
- string: {
- exact: "String must contain exactly {{minimum}} character(s)",
- inclusive: "String must contain at least {{minimum}} character(s)",
- not_inclusive: "String must contain over {{minimum}} character(s)",
- },
- },
- unrecognized_keys: "Unrecognized key(s) in object: {{- keys}}",
- },
- local_types: {
- array: "array",
- bigint: "bigint",
- boolean: "boolean",
- date: "date",
- float: "float",
- function: "function",
- integer: "integer",
- map: "map",
- nan: "nan",
- never: "never",
- null: "null",
- number: "number",
- object: "object",
- promise: "promise",
- set: "set",
- string: "string",
- symbol: "symbol",
- undefined: "undefined",
- unknown: "unknown",
- void: "void",
- },
- types: {
- array: "array",
- bigint: "bigint",
- boolean: "boolean",
- date: "date",
- float: "float",
- function: "function",
- integer: "integer",
- map: "map",
- nan: "nan",
- never: "never",
- null: "null",
- number: "number",
- object: "object",
- promise: "promise",
- set: "set",
- string: "string",
- symbol: "symbol",
- undefined: "undefined",
- unknown: "unknown",
- void: "void",
- },
- validations: {
- cuid: "cuid",
- datetime: "datetime",
- email: "email",
- regex: "regex",
- url: "url",
- uuid: "uuid",
- },
-};
diff --git a/apps/infoalloggi/src/schemas/public/PublicSchema.ts b/apps/infoalloggi/src/schemas/public/PublicSchema.ts
index 339371e..0cf0003 100644
--- a/apps/infoalloggi/src/schemas/public/PublicSchema.ts
+++ b/apps/infoalloggi/src/schemas/public/PublicSchema.ts
@@ -11,7 +11,6 @@ import type { default as UsersStorageTable } from './UsersStorage';
import type { default as ServizioAnnunciTable } from './ServizioAnnunci';
import type { default as EmailsTable } from './Emails';
import type { default as PaymentsTable } from './Payments';
-import type { default as TempTokensTable } from './TempTokens';
import type { default as EventQueueTable } from './EventQueue';
import type { default as OrdiniTable } from './Ordini';
import type { default as PrezziarioTable } from './Prezziario';
@@ -46,8 +45,6 @@ export default interface PublicSchema {
payments: PaymentsTable;
- temp_tokens: TempTokensTable;
-
event_queue: EventQueueTable;
ordini: OrdiniTable;
diff --git a/apps/infoalloggi/src/schemas/public/TempTokens.ts b/apps/infoalloggi/src/schemas/public/TempTokens.ts
deleted file mode 100644
index 60ff6f2..0000000
--- a/apps/infoalloggi/src/schemas/public/TempTokens.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-// @generated
-// This file is automatically generated by Kanel. Do not modify manually.
-
-import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
-
-/** Identifier type for public.temp_tokens */
-export type TempTokensToken = string & { __brand: 'public.temp_tokens' };
-
-/** Represents the table public.temp_tokens */
-export default interface TempTokensTable {
- token: ColumnType;
-
- elapse: ColumnType;
-}
-
-export type TempTokens = Selectable;
-
-export type NewTempTokens = Insertable;
-
-export type TempTokensUpdate = Updateable;
diff --git a/apps/infoalloggi/src/server/controllers/storage.controller.ts b/apps/infoalloggi/src/server/controllers/storage.controller.ts
index d2eb386..e4ac238 100644
--- a/apps/infoalloggi/src/server/controllers/storage.controller.ts
+++ b/apps/infoalloggi/src/server/controllers/storage.controller.ts
@@ -124,21 +124,6 @@ export const addUserStorage = async (data: NewUsersStorage) => {
}
};
-export const getUserStorage = async ({ userId }: { userId: UsersId }) => {
- try {
- return await db
- .selectFrom("users_storage")
- .where("userId", "=", userId)
- .selectAll()
- .execute();
- } catch (e) {
- throw new TRPCError({
- code: "INTERNAL_SERVER_ERROR",
- message: `Error while getting user storage: ${(e as Error).message}`,
- });
- }
-};
-
export const deleteUserStorageEntry = async ({
userId,
storageId,