diff --git a/apps/datahub/src/app/record/record-metadata/record-metadata.component.html b/apps/datahub/src/app/record/record-metadata/record-metadata.component.html index b190bba305..c07d56fccc 100644 --- a/apps/datahub/src/app/record/record-metadata/record-metadata.component.html +++ b/apps/datahub/src/app/record/record-metadata/record-metadata.component.html @@ -23,9 +23,9 @@ > -
+
-

+

record.metadata.quality

-
+
+

record.metadata.contact

@@ -20,7 +20,7 @@ {{ shownOrganization.name }}
- -
+
-
+
-
+

- {{ contacts[0].firstName }} {{ contacts[0].lastName }} + {{ contacts[0]?.firstName || '' }} {{ contacts[0]?.lastName || '' }}

-
+
-

- {{ address[0] }} -

-

+

{{ addressPart }}

diff --git a/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.ts b/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.ts index 6970eca336..38ace97c9a 100644 --- a/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.ts +++ b/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.ts @@ -34,35 +34,11 @@ export class MetadataContactComponent { ) } - parseAddress(inputAddress) { - const addressParts = inputAddress.split(',').map((part) => part.trim()) - - const addressArray = [] - - for (let i = 0; i < addressParts.length; i++) { - const part = addressParts[i] - if (part.toLowerCase().includes('cs')) { - // Handle "CS Number" in a single line - addressArray.push(part) - } else if (part.match(/^\d{5}$/)) { - // Combine postcode and city in a single line - const postcodeCity = `${part} ${addressParts[i - 1]}` - // delete duplicate city - if (postcodeCity.includes(addressParts[i - 1])) { - addressArray.pop() - } - addressArray.push(postcodeCity) - } else { - // Treat as a separate line - addressArray.push(part) - } - } - - return addressArray - } - get address() { - return this.parseAddress(this.contacts[0].address) + const addressParts = this.contacts[0].address + .split(',') + .map((part) => part.trim()) + return addressParts } onOrganizationClick() {