Skip to content

Commit 2038167

Browse files
[DURACOM-507] add autogenerated labels for layout possible customization, fix replace in string for html/longHtml rendering components
1 parent fc0ca88 commit 2038167

3 files changed

Lines changed: 162 additions & 11 deletions

File tree

src/app/dynamic-layout/dynamic-layout-matrix/dynamic-layout-box-container/boxes/metadata/rendering-types/html/html.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ export class HtmlComponent extends RenderingTypeValueModelComponent {
1919
*/
2020
processHtml(text: string): string {
2121
const htmlTagRegex = /<.*?>/;
22-
return htmlTagRegex.test(text) ? text.replace(/\n/, '<br>') : text;
22+
return htmlTagRegex.test(text)
23+
? text.replace(/\n/g, '<br>')
24+
: text;
2325
}
2426

2527
}

src/app/dynamic-layout/dynamic-layout-matrix/dynamic-layout-box-container/boxes/metadata/rendering-types/longhtml/longhtml.component.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55

66
import { TruncatableComponent } from '../../../../../../../shared/truncatable/truncatable.component';
77
import { TruncatablePartComponent } from '../../../../../../../shared/truncatable/truncatable-part/truncatable-part.component';
8-
import { RenderingTypeValueModelComponent } from '../rendering-type-value.model';
8+
import { HtmlComponent } from '../html/html.component';
99

1010
/**
1111
* This component renders the text metadata fields with a show more button
@@ -20,7 +20,7 @@ import { RenderingTypeValueModelComponent } from '../rendering-type-value.model'
2020
TruncatablePartComponent,
2121
],
2222
})
23-
export class LonghtmlComponent extends RenderingTypeValueModelComponent implements OnInit {
23+
export class LonghtmlComponent extends HtmlComponent implements OnInit {
2424

2525
/**
2626
* Id for truncatable component
@@ -31,13 +31,5 @@ export class LonghtmlComponent extends RenderingTypeValueModelComponent implemen
3131
this.truncatableId = `${this.item.id}_${this.field.metadata}_html`;
3232
}
3333

34-
/**
35-
* If the metadata value does not contain HTML tags then replace newline character with <br>
36-
* @param text
37-
*/
38-
processHtml(text: string): string {
39-
const htmlTagRegex = /<.*?>/;
40-
return htmlTagRegex.test(text) ? text.replace(/\n/, '<br>') : text;
41-
}
4234

4335
}

src/assets/i18n/en.json5

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7929,4 +7929,161 @@
79297929
"bitstream.related.isReplacedBy": "Is replaced by",
79307930

79317931
"bitstream.related.deleted": "deleted",
7932+
7933+
// Layout - Autogenerated i18n keys: Tab headers
7934+
7935+
"layout.tab.header.Person.details": "Profile",
7936+
7937+
"layout.tab.header.Person.bitstreams": "Personal File(s)",
7938+
7939+
"layout.tab.header.Person.secure": "Secured Tab",
7940+
7941+
"layout.tab.header.OrgUnit.details": "Details",
7942+
7943+
"layout.tab.header.OrgUnit.bitstreams": "Files",
7944+
7945+
"layout.tab.header.Project.heading": "Heading",
7946+
7947+
"layout.tab.header.Project.details": "Details",
7948+
7949+
"layout.tab.header.Project.bitstreams": "Files",
7950+
7951+
"layout.tab.header.Journal.details": "Details",
7952+
7953+
"layout.tab.header.Publication.details": "Details",
7954+
7955+
// Layout - Autogenerated i18n keys: box headers
7956+
7957+
"layout.box.header.Journal.details": "Journal description",
7958+
7959+
"layout.box.header.OrgUnit.details": "Details",
7960+
7961+
"layout.box.header.OrgUnit.bitstreams": "Files",
7962+
7963+
"layout.box.header.Person.secure": "Secured box",
7964+
7965+
"layout.box.header.Person.bitstreams": "Personal File(s)",
7966+
7967+
"layout.box.header.Project.primarydata": "Primary Data",
7968+
7969+
"layout.box.header.Project.bitstreams": "Files",
7970+
7971+
// Layout - Autogenerated i18n keys: metadata labels
7972+
7973+
"layout.field.label.Journal.creativework.editor": "Editor(s)",
7974+
7975+
"layout.field.label.Journal.creativeworkseries.issn": "ISSN",
7976+
7977+
"layout.field.label.Journal.dc.description": "Description",
7978+
7979+
"layout.field.label.Journal.creativework.publisher": "Publisher",
7980+
7981+
"layout.field.label.Journal.BITSTREAM": "File(s)",
7982+
7983+
"layout.field.label.OrgUnit.dc.identifier": "ID",
7984+
7985+
"layout.field.label.OrgUnit.organization.foundingDate": "Date established",
7986+
7987+
"layout.field.label.OrgUnit.organization.address.addressLocality": "City",
7988+
7989+
"layout.field.label.OrgUnit.organization.address.addressCountry": "Country",
7990+
7991+
"layout.field.label.OrgUnit.dc.description": "Description",
7992+
7993+
"layout.field.label.OrgUnit.BITSTREAM": "File(s)",
7994+
7995+
"layout.field.label.Person.person.familyName": "Last name",
7996+
7997+
"layout.field.label.Person.person.givenName": "First name",
7998+
7999+
"layout.field.label.Person.person.email": "Email",
8000+
8001+
"layout.field.label.Person.person.birthDate": "Birth Date",
8002+
8003+
"layout.field.label.Project.dc.identifier": "ID",
8004+
8005+
"layout.field.label.Project.project.investigator": "Investigator",
8006+
8007+
"layout.field.label.Project.dc.subject": "Keywords",
8008+
8009+
"layout.field.label.Project.project.startDate": "Start date",
8010+
8011+
"layout.field.label.Project.project.endDate": "End Date",
8012+
8013+
"layout.field.label.Project.project.amount": "Amount",
8014+
8015+
"layout.field.label.Project.project.amount.currency": "Currency",
8016+
8017+
"layout.field.label.Project.dc.description": "Description",
8018+
8019+
"layout.field.label.Project.BITSTREAM": "File(s)",
8020+
8021+
"layout.field.label.Publication.dc.title.alternative": "Other Titles",
8022+
8023+
"layout.field.label.Publication.dc.contributor.author": "Author(s)",
8024+
8025+
"layout.field.label.Publication.dc.contributor.editor": "Editor(s)",
8026+
8027+
"layout.field.label.Publication.dc.date.issued": "Date Issued",
8028+
8029+
"layout.field.label.Publication.dc.type": "Type",
8030+
8031+
"layout.field.label.Publication.dc.publisher": "Publisher",
8032+
8033+
"layout.field.label.Publication.dc.relation.journal": "Journal",
8034+
8035+
"layout.field.label.Publication.dc.relation.ispartofseries ": "Series/Report No.",
8036+
8037+
"layout.field.label.Publication.dc.relation.publication": "Contained in",
8038+
8039+
"layout.field.label.Publication.dc.identifier.doi": "DOI",
8040+
8041+
"layout.field.label.Publication.dc.relation.issn": "ISSN",
8042+
8043+
"layout.field.label.Publication.dc.relation.isbn": "ISBN",
8044+
8045+
"layout.field.label.Publication.dc.description.abstract": "Abstract",
8046+
8047+
"layout.field.label.Publication.dc.description": "Additional information",
8048+
8049+
"layout.field.label.Publication.dc.identifier.citation": "Citation",
8050+
8051+
"layout.field.label.Publication.dc.subject": "Keywords",
8052+
8053+
"layout.field.label.Publication.dc.description.sponsorship": "Sponsor(s)",
8054+
8055+
"layout.field.label.Publication.BITSTREAM": "File(s)",
8056+
8057+
// Layout - Autogenerated i18n keys: metadata groups labels
8058+
8059+
"layout.field.label.Person.oairecerif.affiliation.role": "Role",
8060+
8061+
"layout.field.label.Person.oairecerif.person.affiliation": "Organisation",
8062+
8063+
"layout.field.label.Person.oairecerif.affiliation.startDate": "Start",
8064+
8065+
"layout.field.label.Person.oairecerif.affiliation.endDate": "End",
8066+
8067+
"layout.field.label.Person.crisrp.education.role": "Role",
8068+
8069+
"layout.field.label.Person.crisrp.education": "Organisation",
8070+
8071+
"layout.field.label.Person.crisrp.education.start": "Start",
8072+
8073+
"layout.field.label.Person.crisrp.education.end": "End",
8074+
8075+
"layout.field.label.Person.crisrp.qualification": "Title",
8076+
8077+
"layout.field.label.Person.crisrp.qualification.start": "Start",
8078+
8079+
"layout.field.label.Person.crisrp.qualification.end": "End",
8080+
8081+
"layout.field.label.Publication.dc.contributor.author": "Author",
8082+
8083+
"layout.field.label.Publication.oairecerif.author.affiliation": "Affiliation",
8084+
8085+
"layout.field.label.Publication.dc.contributor.editor": "Editor",
8086+
8087+
"layout.field.label.Publication.oairecerif.editor.affiliation": "Affiliation",
8088+
79328089
}

0 commit comments

Comments
 (0)