Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
@for (mdEntry of (metadata$ | async) | keyvalue; track mdEntry) {
@for (mdValue of mdEntry.value; track mdValue) {
<tr>
<td [title]="mdEntry.key">{{ mdEntry.key | translate }}</td>
<td class="metadata-label">{{ mdEntry.key }}</td>
<td class="metadata-label">{{ mdEntry.key | dsMetadataLabel | async }}</td>
<td>{{ mdValue.value }}</td>
<td>{{ mdValue.language }}</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:host {
// The full-item-page table has two label columns (raw metadata key + its
// translation). A long value cell (e.g. dc.description) would otherwise
// squeeze these, wrapping two-word labels like "Megjelenés dátuma". Keep the
// label columns on a single line; only the value column wraps. (QREPO-413)
td.metadata-label {
white-space: nowrap;
}
}
19 changes: 11 additions & 8 deletions src/themes/qulto/app/item-page/full/full-item-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,22 @@ import { DsoEditMenuComponent } from '../../../../../app/shared/dso-page/dso-edi
import { ErrorComponent } from '../../../../../app/shared/error/error.component';
import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component';
import { VarDirective } from '../../../../../app/shared/utils/var.directive';
import { MetadataLabelPipe } from '../../shared/utils/metadata-label.pipe';

/**
* Qulto full item page — renders the metadata as a translated table:
* the metadata field keys (e.g. `dc.title`) are passed through the translate
* pipe so the table headers show localised labels from the qulto/szerep i18n.
* The base template shows raw metadata keys instead.
* Qulto full item page — renders the metadata table with an extra column.
* Each row shows the raw metadata key (e.g. `dc.title`) AND, in a separate
* column, its localised label resolved via the `dsMetadataLabel` pipe (empty
* when no translation exists). The base template shows only the raw key.
* (QREPO-413)
*/

@Component({
selector: 'ds-themed-full-item-page',
// styleUrls: ['./full-item-page.component.scss'],
styleUrls: ['../../../../../app/item-page/full/full-item-page.component.scss'],
styleUrls: [
'../../../../../app/item-page/full/full-item-page.component.scss',
'./full-item-page.component.scss',
],
templateUrl: './full-item-page.component.html',
// templateUrl: '../../../../../app/item-page/full/full-item-page.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [fadeInOut],
imports: [
Expand All @@ -45,6 +47,7 @@ import { VarDirective } from '../../../../../app/shared/utils/var.directive';
ItemVersionsComponent,
ItemVersionsNoticeComponent,
KeyValuePipe,
MetadataLabelPipe,
RouterLink,
ThemedFullFileSectionComponent,
ThemedItemAlertsComponent,
Expand Down
33 changes: 33 additions & 0 deletions src/themes/qulto/app/shared/utils/metadata-label.pipe.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {
inject,
Pipe,
PipeTransform,
} from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';

/**
* Resolves a metadata field key (e.g. `dc.title`) to its localised label.
*
* Returns an empty string when no translation exists, so the full-item-page
* label column stays blank instead of echoing the raw key. Uses
* `translate.stream()` (combined with the async pipe in the template) so the
* label updates reactively on language change; the pipe itself is pure, so the
* stream is created once per key and cached — no per-change-detection work. This
* replaces the previous `getTranslation()` component method. (QREPO-413)
*/
@Pipe({
name: 'dsMetadataLabel',
})
export class MetadataLabelPipe implements PipeTransform {

private translate = inject(TranslateService);

transform(key: string): Observable<string> {
return this.translate.stream(key).pipe(
map((translation: string) => (translation === key ? '' : translation)),
);
}

}
31 changes: 31 additions & 0 deletions src/themes/qulto/assets/i18n/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,35 @@
// Label for the Publication page author field (mixed-author-field). The qulto
// publication override uses this key instead of base "item.page.authors".
"relationships.isAuthorOf": "Authors",

// The full-item-page table's translation column resolves the metadata key
// (mdEntry.key) via getTranslation(). The keys below are the basic fields of the
// traditional submission form (traditionalpageone + traditionalpagetwo). (QREPO-413)
"dc.contributor.author": "Author",

"dc.title": "Title",

"dc.title.alternative": "Other Titles",

"dc.date.issued": "Date of Issue",

"dc.publisher": "Publisher",

"dc.identifier.citation": "Citation",

"dc.relation.ispartofseries": "Series/Report No.",

"dc.identifier": "Identifiers",

"dc.type": "Type",

"dc.language.iso": "Language",

"dc.subject": "Subject Keywords",

"dc.description.abstract": "Abstract",

"dc.description.sponsorship": "Sponsors",

"dc.description": "Description",
}
31 changes: 31 additions & 0 deletions src/themes/qulto/assets/i18n/hu.json5
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,35 @@
"relationships.isAuthorOf": "Szerzők",

"access-status.open.access.listelement.badge": "Szabadon hozzáférhető",

// A full-item-page (teljes nézet) táblázat fordítás-oszlopa a metaadat-kulcsra
// (mdEntry.key) keres rá a getTranslation()-nel. Az alábbi kulcsok a traditional
// beküldő űrlap (traditionalpageone + traditionalpagetwo) alapmezői. (QREPO-413)
"dc.contributor.author": "Szerző",

"dc.title": "Cím",

"dc.title.alternative": "További címek",

"dc.date.issued": "Megjelenés dátuma",

"dc.publisher": "Kiadó",

"dc.identifier.citation": "Bibliográfiai hivatkozás",

"dc.relation.ispartofseries": "Sorozat / jelentésszám",

"dc.identifier": "Azonosítók",

"dc.type": "Típus",

"dc.language.iso": "Nyelv",

"dc.subject": "Tárgyszavak",

"dc.description.abstract": "Absztrakt",

"dc.description.sponsorship": "Támogatók",

"dc.description": "Leírás",
}
60 changes: 0 additions & 60 deletions src/themes/szerep/app/item-page/full/full-item-page.component.html

This file was deleted.

54 changes: 0 additions & 54 deletions src/themes/szerep/app/item-page/full/full-item-page.component.ts

This file was deleted.

9 changes: 3 additions & 6 deletions src/themes/szerep/assets/i18n/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@

"browse.search-form.placeholder": "Enter the first few characters",

// SZEREP-specific metadata labels that DIFFER from the qulto base or exist only
// here. Keys identical to qulto (dc.title, dc.contributor.author, dc.language.iso)
// were removed — they are inherited from the qulto theme i18n. (QREPO-413)
"dc.title.subtitle": "Subtitle",

"dc.title.other": "Other title",

"dc.title": "Title",

"dc.contributor.author": "Author",

"dc.contributor.advisor": "Advisor",

"dc.contributor.description": "Description",
Expand Down Expand Up @@ -61,8 +60,6 @@

"dc.identifier.uri": "URI",

"dc.language.iso": "Language",

"dc.rights.access": "Access",

"dc.subject": "Subject",
Expand Down
13 changes: 3 additions & 10 deletions src/themes/szerep/assets/i18n/hu.json5
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,13 @@

"browse.search-form.placeholder": "Adja meg az első pár karaktert",

// SZEREP-specifikus metaadat-címkék, amelyek ELTÉRNEK a qulto alapfordításától
// vagy csak itt léteznek. A qulto-val azonos kulcsok (dc.title, dc.contributor.author,
// dc.language.iso) ki lettek véve — azok a qulto téma i18n-jéből öröklődnek. (QREPO-413)
"dc.title.subtitle": "Alcím",

"dc.title.other": "Egyéb cím",

"dc.title": "Cím",

"dc.contributor.author": "Szerző",

"dc.contributor.advisor": "Konzulens/Témavezető",

"dc.contributor.description": "Leírás",
Expand Down Expand Up @@ -75,18 +74,12 @@

"dc.identifier.uri": "URI",

"dc.language.iso": "Nyelv",

"dc.rights.access": "Hozzáférés",

"dc.subject": "Tárgyszó",

"dc.type": "Dokumentumtípus",

"dc.title": "Cím",

"dc.title.other": "Egyéb cím",

"dc.format.extent": "Terjedelem",

"dc.identifier.doi": "DOI",
Expand Down
Loading