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

86 title display #87

Merged
merged 17 commits into from
Aug 16, 2024
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
26 changes: 21 additions & 5 deletions src/app/core/breadcrumbs/dso-name.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export class DSONameService {
},
Default: (dso: DSpaceObject): string => {
// If object doesn't have dc.title metadata use name property
return dso.firstMetadataValue('dc.title') || dso.name || this.translateService.instant('dso.name.untitled');
// TAMU Customization - only added two or conditions up to dc.title.dataset after the || is core code.
return dso.firstMetadataValue('dc.title.project') || dso.firstMetadataValue('dc.title.dataset') || dso.firstMetadataValue('dc.title') || dso.name || this.translateService.instant('dso.name.untitled');
}
};

Expand Down Expand Up @@ -95,7 +96,7 @@ export class DSONameService {
const types = dso.getRenderTypes();
const entityType = types
.filter((type) => typeof type === 'string')
.find((type: string) => (['Person', 'OrgUnit']).includes(type)) as string;
.find((type: string) => (['Person', 'Dataset']).includes(type)) as string;
if (entityType === 'Person') {
const familyName = this.firstMetadataValue(object, dso, 'person.familyName');
const givenName = this.firstMetadataValue(object, dso, 'person.givenName');
Expand All @@ -105,10 +106,25 @@ export class DSONameService {
return familyName || givenName;
}
return `${familyName}, ${givenName}`;
} else if (entityType === 'OrgUnit') {
return this.firstMetadataValue(object, dso, 'organization.legalName') || this.translateService.instant('dso.name.untitled');
// TAMU Customization - swithched the entitiy to look for DATASET in stead of orgUnit
} else if (entityType === 'Dataset') {
// return this.firstMetadataValue(object, dso, 'organization.legalName') || this.translateService.instant('dso.name.untitled'); <- the core code
//Tamu Customization - Item list view to show Dimension tile and Project long Title. It will default to one or the other if only one exists.
const datasetTitle = dso.firstMetadataValue('dc.title.dataset');
const projectTitle = dso.firstMetadataValue('dc.title.project');

if (datasetTitle && projectTitle) {
return `${datasetTitle}: Supplement to ${projectTitle}`;
} else if (datasetTitle) {
return datasetTitle;
} else if (projectTitle) {
return projectTitle;
} else {
return this.translateService.instant('dso.name.untitled');
}
}
return this.firstMetadataValue(object, dso, 'dc.title') || dso.name || this.translateService.instant('dso.name.untitled');
// TAMU Customization - only added two || conditions up to dc.title.dataset after the || is core code.(dso.name and || this.translateService.instant('dso.name.untitled') )
return this.firstMetadataValue(object, dso, 'dc.title.project') || dso.firstMetadataValue('dc.title.dataset') || dso.firstMetadataValue('dc.title') || dso.name || this.translateService.instant('dso.name.untitled');
}

/**
Expand Down
qtamu marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
<h1 class="item-page-title-field">
<!-- // Core code block- Left intact on purpose -->
<!-- <h1 class="item-page-title-field">
<div *ngIf="item.firstMetadataValue('dspace.entity.type') as type" class="d-inline">
{{ type.toLowerCase() + '.page.titleprefix' | translate }}
</div>
<span class="dont-break-out">{{ dsoNameService.getName(item) }}</span>
</h1> -->
<!-- End of core code block -->

<!-- TAMU Customization -title display on Dataset entities for simple item view -->
<h1 class="item-page-title-field">
<div *ngIf="item.firstMetadataValue('dspace.entity.type') as type" class="d-inline">
{{ type.toLowerCase() + '.page.titleprefix' | translate }}
</div>
<span>
<ng-container *ngIf="item.firstMetadataValue('dc.title.dataset') as dataset">
{{ dataset }}
<ng-container *ngIf="item.firstMetadataValue('dc.title.project') as project">
: Supplement to {{ project }}
</ng-container>
</ng-container>
<ng-container *ngIf="!item.firstMetadataValue('dc.title.dataset') && item.firstMetadataValue('dc.title.project')">
{{ item.firstMetadataValue('dc.title.project') }}
</ng-container>
<ng-container *ngIf="!item.firstMetadataValue('dc.title.dataset') && !item.firstMetadataValue('dc.title.project')">
{{ item.firstMetadataValue('dspace.entity.type') }}
</ng-container>
</span>
</h1>
<!-- END TAMU Customization -title display on Dataset entities for simple item view -->
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
</ds-themed-item-page-title-field>
<ds-dso-edit-menu></ds-dso-edit-menu>
</div>

<div class="row">
<!-- TAMU Customization - icon thumbnail style `thumb-font-4` -->
<div class="col-xs-12 col-md-4 thumb-font-4">
Expand Down
Loading