Rename 'iban' to 'ownerIBAN' in UserSettings
Changes: - Updated UserSettings interface: iban -> ownerIBAN - Updated userSettingsActions.ts: - Changed State type to use ownerIBAN - Updated FormSchema validation to reference ownerIBAN - Updated validation refinements to check ownerIBAN - Updated form data parsing to read ownerIBAN - Renamed normalizedIban to normalizedOwnerIBAN - Updated database write operations to use ownerIBAN - Updated UserSettingsForm.tsx: - Changed state tracking to use ownerIBAN - Updated validation check to reference ownerIBAN (cleanedOwnerIBAN) - Updated input field: id, name, and event handlers - Updated ViewLocationCard.tsx to use ownerIBAN instead of iban - Updated English translations: - iban-label -> owner-iban-label - iban-placeholder -> owner-iban-placeholder - iban-required -> owner-iban-required - iban-invalid -> owner-iban-invalid - Updated Croatian translations with corresponding ownerIBAN keys 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -30,7 +30,7 @@ const FormFields: FC<FormFieldsProps> = ({ userSettings, errors, message }) => {
|
||||
ownerName: userSettings?.ownerName ?? "",
|
||||
ownerStreet: userSettings?.ownerStreet ?? "",
|
||||
ownerTown: userSettings?.ownerTown ?? "",
|
||||
iban: formatIban(userSettings?.iban) ?? "",
|
||||
ownerIBAN: formatIban(userSettings?.ownerIBAN) ?? "",
|
||||
currency: userSettings?.currency ?? "EUR",
|
||||
});
|
||||
|
||||
@@ -39,8 +39,8 @@ const FormFields: FC<FormFieldsProps> = ({ userSettings, errors, message }) => {
|
||||
};
|
||||
|
||||
// Check if any required field is missing (clean IBAN of spaces for validation)
|
||||
const cleanedIban = formValues.iban.replace(/\s/g, '');
|
||||
const hasMissingData = !formValues.ownerName || !formValues.ownerStreet || !formValues.ownerTown || !cleanedIban || !formValues.currency;
|
||||
const cleanedOwnerIBAN = formValues.ownerIBAN.replace(/\s/g, '');
|
||||
const hasMissingData = !formValues.ownerName || !formValues.ownerStreet || !formValues.ownerTown || !cleanedOwnerIBAN || !formValues.currency;
|
||||
|
||||
// Track whether to generate 2D code for tenant (use persisted value from database)
|
||||
const [show2dCodeInMonthlyStatement, setShow2dCodeInMonthlyStatement] = useState(
|
||||
@@ -146,21 +146,21 @@ const FormFields: FC<FormFieldsProps> = ({ userSettings, errors, message }) => {
|
||||
|
||||
<div className="form-control w-full">
|
||||
<label className="label">
|
||||
<span className="label-text">{t("iban-label")}</span>
|
||||
<span className="label-text">{t("owner-iban-label")}</span>
|
||||
</label>
|
||||
<input
|
||||
id="iban"
|
||||
name="iban"
|
||||
id="ownerIBAN"
|
||||
name="ownerIBAN"
|
||||
type="text"
|
||||
placeholder={t("iban-placeholder")}
|
||||
placeholder={t("owner-iban-placeholder")}
|
||||
className="input input-bordered w-full placeholder:text-gray-600"
|
||||
defaultValue={formatIban(userSettings?.iban)}
|
||||
onChange={(e) => handleInputChange("iban", e.target.value)}
|
||||
defaultValue={formatIban(userSettings?.ownerIBAN)}
|
||||
onChange={(e) => handleInputChange("ownerIBAN", e.target.value)}
|
||||
disabled={pending}
|
||||
/>
|
||||
<div id="iban-error" aria-live="polite" aria-atomic="true">
|
||||
{errors?.iban &&
|
||||
errors.iban.map((error: string) => (
|
||||
<div id="ownerIBAN-error" aria-live="polite" aria-atomic="true">
|
||||
{errors?.ownerIBAN &&
|
||||
errors.ownerIBAN.map((error: string) => (
|
||||
<p className="mt-2 text-sm text-red-500" key={error}>
|
||||
{error}
|
||||
</p>
|
||||
|
||||
@@ -31,7 +31,7 @@ export const ViewLocationCard:FC<ViewLocationCardProps> = ({location, userSettin
|
||||
Primatelj: userSettings?.ownerName ?? "",
|
||||
AdresaPrimatelja: userSettings?.ownerStreet ?? "",
|
||||
SjedistePrimatelja: userSettings?.ownerTown ?? "",
|
||||
IBAN: userSettings?.iban ?? "",
|
||||
IBAN: userSettings?.ownerIBAN ?? "",
|
||||
ModelPlacanja: "HR00",
|
||||
PozivNaBroj: `${yearMonth.year}-${yearMonth.month.toString().padStart(2,"0")}`,
|
||||
SifraNamjene: "",
|
||||
|
||||
Reference in New Issue
Block a user