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 }))}
|
onChange={(code) => setForm((prev) => ({ ...prev, countryCode: code }))}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
{/* The free-text "Country (full name)" override (migration 107) was
|
||||||
{/* Free-text country name override (migration 107). When
|
removed as redundant — the country picker stores the ISO code and
|
||||||
left empty the PDF renderer falls back to the locale-
|
the PDF renderer derives the localized full name from it
|
||||||
aware lookup on the ISO code. Kept for the rare case
|
(pdfService.countryName). The DB column + the `country_name ||`
|
||||||
where an operator wants a custom display name that
|
fallback stay, so any legacy override still renders. */}
|
||||||
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>
|
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
|
|||||||
@@ -88,13 +88,11 @@ export const SettingsBusinessProfilePage: React.FC = () => {
|
|||||||
<CountrySelect label={t('businessProfile.field.countryCode', 'Country') as string}
|
<CountrySelect label={t('businessProfile.field.countryCode', 'Country') as string}
|
||||||
value={profile.countryCode || ''}
|
value={profile.countryCode || ''}
|
||||||
onChange={(code) => setProfile({ ...profile, countryCode: code })} />
|
onChange={(code) => setProfile({ ...profile, countryCode: code })} />
|
||||||
{/* Free-text country name override (migration 107). When
|
{/* The free-text "Country (full name)" override (migration 107) was
|
||||||
left empty the renderer falls back to the COUNTRY_NAMES
|
removed as redundant — the picker stores the ISO code and the PDF
|
||||||
lookup on the abbreviation. */}
|
renderer derives the localized full name from it
|
||||||
<Input label={t('businessProfile.field.countryName', 'Country (full name)') as string}
|
(pdfService.countryName). The DB column + `country_name ||`
|
||||||
value={profile.countryName || ''}
|
fallback remain, so any legacy override still renders. */}
|
||||||
placeholder="Liechtenstein"
|
|
||||||
onChange={(e) => setProfile({ ...profile, countryName: e.target.value })} />
|
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user