Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made the labels in edit relationships tab unique #3307

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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 @@ -34,13 +34,13 @@
<ds-related-items
[parentItem]="object"
[relationType]="'isJournalVolumeOfIssue'"
[label]="'relationships.isSingleVolumeOf' | translate">
[label]="'item.page.journal-volume' | translate">
</ds-related-items>
<ds-related-items
class="mb-1 mt-1"
[parentItem]="object"
[relationType]="'isPublicationOfJournalIssue'"
[label]="'relationships.isPublicationOfJournalIssue' | translate">
[label]="'item.page.articles' | translate">
</ds-related-items>
<ds-generic-item-page-field [item]="object"
[fields]="['dc.description']"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
<ds-related-items
[parentItem]="object"
[relationType]="'isJournalOfVolume'"
[label]="'relationships.isSingleJournalOf' | translate">
[label]="'item.page.journal' | translate">
</ds-related-items>
<ds-related-items
[parentItem]="object"
[relationType]="'isIssueOfJournalVolume'"
[label]="'relationships.isIssueOf' | translate">
[label]="'item.page.journal-issues' | translate">
</ds-related-items>
<ds-generic-item-page-field [item]="object"
[fields]="['dc.description']"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<ds-related-items
[parentItem]="object"
[relationType]="'isVolumeOfJournal'"
[label]="'relationships.isVolumeOf' | translate">
[label]="'item.page.journal-volumes' | translate">
</ds-related-items>
<ds-generic-item-page-field class="item-page-fields" [item]="object"
[fields]="['dc.description']"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<ds-related-items
[parentItem]="object"
[relationType]="'isPublicationOfOrgUnit'"
[label]="'relationships.isPublicationOf' | translate">
[label]="'item.page.publications' | translate">
</ds-related-items>
<ds-generic-item-page-field [item]="object"
[fields]="['dc.description']"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
<ds-related-items
[parentItem]="object"
[relationType]="'isProjectOfPerson'"
[label]="'relationships.isProjectOf' | translate">
[label]="'item.page.projects' | translate">
</ds-related-items>
<ds-related-items
[parentItem]="object"
[relationType]="'isOrgUnitOfPerson'"
[label]="'relationships.isOrgUnitOf' | translate">
[label]="'item.page.org-units' | translate">
</ds-related-items>
<ds-generic-item-page-field [item]="object"
[fields]="['person.jobTitle']"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@
<ds-related-items
[parentItem]="object"
[relationType]="'isPersonOfProject'"
[label]="'relationships.isPersonOf' | translate">
[label]="'item.page.authors' | translate">
</ds-related-items>
<ds-related-items
[parentItem]="object"
[relationType]="'isPublicationOfProject'"
[label]="'relationships.isPublicationOf' | translate">
[label]="'item.page.publications' | translate">
</ds-related-items>
<ds-related-items
[parentItem]="object"
[relationType]="'isOrgUnitOfProject'"
[label]="'relationships.isOrgUnitOf' | translate">
[label]="'item.page.org-units' | translate">
</ds-related-items>
<ds-generic-item-page-field [item]="object"
[fields]="['dc.description']"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy {
*/
relationshipMessageKey$: Observable<string>;

currentEntityType$: Observable<ItemType>;

/**
* The list ID to save selected entities under
*/
Expand Down Expand Up @@ -224,20 +226,12 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy {
*/
public getRelationshipMessageKey(): Observable<string> {
return observableCombineLatest([
this.currentEntityType$,
this.getLabel(),
this.relatedEntityType$,
]).pipe(
map(([label, relatedEntityType]) => {
if (hasValue(label) && label.indexOf('is') > -1 && label.indexOf('Of') > -1) {
const relationshipLabel = `${label.substring(2, label.indexOf('Of'))}`;
if (relationshipLabel !== relatedEntityType.label) {
return `relationships.is${relationshipLabel}Of.${relatedEntityType.label}`;
} else {
return `relationships.is${relationshipLabel}Of`;
}
} else {
return label;
}
map(([currentEntityType, label, relatedEntityType]: [ItemType, string, ItemType]) => {
return `relationships.${currentEntityType.label}.${label}.${relatedEntityType.label}`;
}),
);
}
Expand Down Expand Up @@ -454,6 +448,17 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy {
hasValueOperator(),
);

this.currentEntityType$ = this.relationshipLeftAndRightType$.pipe(
map(([leftType, rightType]: [ItemType, ItemType]) => {
if (leftType.uuid === this.itemType.uuid) {
return leftType;
} else {
return rightType;
}
}),
hasValueOperator(),
);

this.relatedEntityType$.pipe(
take(1),
).subscribe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ export class ItemPageAuthorFieldComponent extends ItemPageFieldComponent {
/**
* Label i18n key for the rendered metadata
*/
label = 'item.page.author';
label = 'item.page.authors';

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
[parentItem]="object"
[itemType]="'Person'"
[metadataFields]="['dc.contributor.author', 'dc.creator']"
[label]="'relationships.isAuthorOf' | translate">
[label]="'item.page.authors' | translate">
</ds-metadata-representation-list>
<ds-generic-item-page-field [item]="object"
[fields]="['journal.title']"
Expand All @@ -52,17 +52,17 @@
<ds-related-items
[parentItem]="object"
[relationType]="'isProjectOfPublication'"
[label]="'relationships.isProjectOf' | translate">
[label]="'item.page.projects' | translate">
</ds-related-items>
<ds-related-items
[parentItem]="object"
[relationType]="'isOrgUnitOfPublication'"
[label]="'relationships.isOrgUnitOf' | translate">
[label]="'item.page.org-units' | translate">
</ds-related-items>
<ds-related-items
[parentItem]="object"
[relationType]="'isJournalIssueOfPublication'"
[label]="'relationships.isJournalIssueOf' | translate">
[label]="'item.page.journal-issue' | translate">
</ds-related-items>
<ds-item-page-abstract-field [item]="object"></ds-item-page-abstract-field>
<ds-generic-item-page-field [item]="object"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
[parentItem]="object"
[itemType]="'Person'"
[metadataFields]="['dc.contributor.author', 'dc.creator']"
[label]="'relationships.isAuthorOf' | translate">
[label]="'item.page.authors' | translate">
</ds-metadata-representation-list>
<ds-generic-item-page-field [item]="object"
[fields]="['journal.title']"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
[placeholder]="('mydspace.results.no-date' | translate)"></ds-item-detail-preview-field>
<ds-item-detail-preview-field [item]="item"
[object]="object"
[label]="('item.page.author' | translate)"
[label]="('item.page.authors' | translate)"
[metadata]="['dc.contributor', 'dc.creator', 'dc.contributor.*']"
[separator]="separator"
[placeholder]="('mydspace.results.no-authors' | translate)"></ds-item-detail-preview-field>
Expand Down
114 changes: 92 additions & 22 deletions src/assets/i18n/ar.json5
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,34 @@
"item.orcid.return": "رجوع",
"item.listelement.badge": "المادة",
"item.page.description": "الوصف",

// "item.page.org-units": "Organizational Units",
"item.page.org-units": "وحدات مؤسسية",

// "item.page.projects": "Research Projects",
"item.page.projects": "مشاريع البحث",

// "item.page.publications": "Publications",
"item.page.publications": "منشورات",

// "item.page.articles": "Articles",
"item.page.articles": "مقالات",

// "item.page.journal": "Journal",
"item.page.journal": "الدوري",

// "item.page.journal-issue": "Journal Issue",
"item.page.journal-issue": "عدد الدوري",

// "item.page.journal-issues": "Journal Issues",
"item.page.journal-issues": "سجل الدوري",

// "item.page.journal-volume": "Journal Volume",
"item.page.journal-volume": "سلسلة الدورية",

// "item.page.journal-volumes": "Journal Volumes",
"item.page.journal-volumes": "سلسلة الدوريات",

"item.page.journal-issn": "ردمد الدورية",
"item.page.journal-title": "عنوان الدوري",
"item.page.publisher": "الناشر",
Expand Down Expand Up @@ -1341,7 +1369,7 @@
"confidence.indicator.help-text.unset": "لم يتم تسجيل الثقة بهذه القيمة أبدًا",
"confidence.indicator.help-text.unknown": "قيمة ثقة غير معروفة",
"item.page.abstract": "أ",
"item.page.author": "المؤلفين",
"item.page.authors": "المؤلفين",
"item.page.citation": "المرسل",
"item.page.collections": "مقبول",
"item.page.collections.loading": "جاري التحميل...",
Expand Down Expand Up @@ -2050,27 +2078,69 @@
"relationships.add.error.relationship-type.content": "لا يمكن العثور على تطابق مناسب لنوع التوافق {{ type }} بين المادتين",
"relationships.add.error.server.content": "لقد ساعدت في خطأ",
"relationships.add.error.title": "غير قادر على الانضمام إلى إيران",
"relationships.isAuthorOf": "المؤلفين",
"relationships.isAuthorOf.Person": "المؤلفين (الأشخاص)",
"relationships.isAuthorOf.OrgUnit": "المؤلفين (وحدات مؤسسية)",
"relationships.isIssueOf": "سجل الدوري",
"relationships.isIssueOf.JournalIssue": "عدد الدوري",
"relationships.isJournalIssueOf": "عدد الدوري",
"relationships.isJournalOf": "الدوريات",
"relationships.isJournalVolumeOf": "سلسلة الدورية",
"relationships.isOrgUnitOf": "وحدات مؤسسية",
"relationships.isPersonOf": "المؤلفين",
"relationships.isProjectOf": "مشاريع البحث",
"relationships.isPublicationOf": "منشورات",
"relationships.isPublicationOfJournalIssue": "مقالات",
"relationships.isSingleJournalOf": "الدوري",
"relationships.isSingleVolumeOf": "سلسلة الدورية",
"relationships.isVolumeOf": "سلسلة الدوريات",
"relationships.isVolumeOf.JournalVolume": "سلسلة الدورية",
"relationships.isContributorOf": "خذ",
"relationships.isContributorOf.OrgUnit": "المساهم (وحدة مؤسسية)",
"relationships.isContributorOf.Person": "المساهم",
"relationships.isFundingAgencyOf.OrgUnit": "الممول",

// "relationships.Publication.isAuthorOfPublication.Person": "Authors (persons)",
"relationships.Publication.isAuthorOfPublication.Person": "المؤلفين (الأشخاص)",

// "relationships.Publication.isProjectOfPublication.Project": "Research Projects",
"relationships.Publication.isProjectOfPublication.Project": "مشاريع البحث",

// "relationships.Publication.isOrgUnitOfPublication.OrgUnit": "Organizational Units",
"relationships.Publication.isOrgUnitOfPublication.OrgUnit": "وحدات مؤسسية",

// "relationships.Publication.isAuthorOfPublication.OrgUnit": "Authors (organizational units)",
"relationships.Publication.isAuthorOfPublication.OrgUnit": "المؤلفين (وحدات مؤسسية)",

// "relationships.Publication.isJournalIssueOfPublication.JournalIssue": "Journal Issue",
"relationships.Publication.isJournalIssueOfPublication.JournalIssue": "عدد الدوري",

// "relationships.Person.isPublicationOfAuthor.Publication": "Publications",
"relationships.Person.isPublicationOfAuthor.Publication": "منشورات",

// "relationships.Person.isProjectOfPerson.Project": "Research Projects",
"relationships.Person.isProjectOfPerson.Project": "مشاريع البحث",

// "relationships.Person.isOrgUnitOfPerson.OrgUnit": "Organizational Units",
"relationships.Person.isOrgUnitOfPerson.OrgUnit": "وحدات مؤسسية",

// "relationships.Project.isPublicationOfProject.Publication": "Publications",
"relationships.Project.isPublicationOfProject.Publication": "منشورات",

// "relationships.Project.isPersonOfProject.Person": "Authors",
"relationships.Project.isPersonOfProject.Person": "المؤلفين",

// "relationships.Project.isOrgUnitOfProject.OrgUnit": "Organizational Units",
"relationships.Project.isOrgUnitOfProject.OrgUnit": "وحدات مؤسسية",

// "relationships.OrgUnit.isPublicationOfOrgUnit.Publication": "Organisation Publications",
// TODO New key - Add a translation
"relationships.OrgUnit.isPublicationOfOrgUnit.Publication": "Organisation Publications",

// "relationships.OrgUnit.isPersonOfOrgUnit.Person": "Authors",
"relationships.OrgUnit.isPersonOfOrgUnit.Person": "المؤلفين",

// "relationships.OrgUnit.isProjectOfOrgUnit.Project": "Research Projects",
"relationships.OrgUnit.isProjectOfOrgUnit.Project": "مشاريع البحث",

// "relationships.OrgUnit.isPublicationOfAuthor.Publication": "Authored Publications",
// TODO New key - Add a translation
"relationships.OrgUnit.isPublicationOfAuthor.Publication": "Authored Publications",

// "relationships.JournalIssue.isJournalVolumeOfIssue.JournalVolume": "Journal Volume",
"relationships.JournalIssue.isJournalVolumeOfIssue.JournalVolume": "سلسلة الدورية",

// "relationships.JournalIssue.isPublicationOfJournalIssue.Publication": "Publications",
"relationships.JournalIssue.isPublicationOfJournalIssue.Publication": "منشورات",

// "relationships.JournalVolume.isJournalOfVolume.Journal": "Journals",
"relationships.JournalVolume.isJournalOfVolume.Journal": "الدوريات",

// "relationships.JournalVolume.isIssueOfJournalVolume.JournalIssue": "Journal Issue",
"relationships.JournalVolume.isIssueOfJournalVolume.JournalIssue": "عدد الدوري",

// "relationships.Journal.isVolumeOfJournal.JournalVolume": "Journal Volume",
"relationships.Journal.isVolumeOfJournal.JournalVolume": "سلسلة الدورية",

"repository.image.logo": "مستودع الشعار",
"repository.title": "مستودع دي سبيس",
"repository.title.prefix": "مستودع دي سبيس :: ",
Expand Down
Loading
Loading