fix(crm): drop redundant 'Country (full name)' field
The customer detail + business profile forms showed both a Country picker (stores the ISO code) and a free-text 'Country (full name)' override (migration 107). Now that the picker offers the full ISO list and the PDF renderer derives the localized full name from the code (pdfService.countryName, used as 'country_name || derive' for both issuer and recipient), the free-text field is redundant. Remove the input from both forms. The DB column + the fallback stay, so any legacy override still renders.
This commit is contained in:
@@ -545,19 +545,11 @@ export const CustomerDetailPage: React.FC = () => {
|
||||
onChange={(code) => setForm((prev) => ({ ...prev, countryCode: code }))}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
{/* Free-text country name override (migration 107). When
|
||||
left empty the PDF renderer falls back to the locale-
|
||||
aware lookup on the ISO code. Kept for the rare case
|
||||
where an operator wants a custom display name that
|
||||
differs from the standard localized label. */}
|
||||
<label className="block text-sm font-medium text-theme mb-1">{t('customers.detail.countryName', 'Country (full name)')}</label>
|
||||
<Input
|
||||
value={form.countryName || ''}
|
||||
onChange={setField('countryName')}
|
||||
placeholder="Liechtenstein"
|
||||
/>
|
||||
</div>
|
||||
{/* The free-text "Country (full name)" override (migration 107) was
|
||||
removed as redundant — the country picker stores the ISO code and
|
||||
the PDF renderer derives the localized full name from it
|
||||
(pdfService.countryName). The DB column + the `country_name ||`
|
||||
fallback stay, so any legacy override still renders. */}
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
|
||||
@@ -88,13 +88,11 @@ export const SettingsBusinessProfilePage: React.FC = () => {
|
||||
<CountrySelect label={t('businessProfile.field.countryCode', 'Country') as string}
|
||||
value={profile.countryCode || ''}
|
||||
onChange={(code) => setProfile({ ...profile, countryCode: code })} />
|
||||
{/* Free-text country name override (migration 107). When
|
||||
left empty the renderer falls back to the COUNTRY_NAMES
|
||||
lookup on the abbreviation. */}
|
||||
<Input label={t('businessProfile.field.countryName', 'Country (full name)') as string}
|
||||
value={profile.countryName || ''}
|
||||
placeholder="Liechtenstein"
|
||||
onChange={(e) => setProfile({ ...profile, countryName: e.target.value })} />
|
||||
{/* The free-text "Country (full name)" override (migration 107) was
|
||||
removed as redundant — the picker stores the ISO code and the PDF
|
||||
renderer derives the localized full name from it
|
||||
(pdfService.countryName). The DB column + `country_name ||`
|
||||
fallback remain, so any legacy override still renders. */}
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user