Skip to content

Commit

Permalink
Merge pull request #88 from TAMULib/rdc-sprint3-staging
Browse files Browse the repository at this point in the history
RDC Sprint3 Staging
  • Loading branch information
qtamu authored Aug 22, 2024
2 parents de528d4 + c2589d9 commit fba418f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 6 deletions.
28 changes: 23 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,8 @@ export class DSONameService {
const types = dso.getRenderTypes();
const entityType = types
.filter((type) => typeof type === 'string')
.find((type: string) => (['Person', 'OrgUnit']).includes(type)) as string;
// TAMU Customization - added 'Dataset' after 'Person'
.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 +107,26 @@ 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 - switched the entity type to look for DATASET instead 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');
}
// END 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.
}
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
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 -->

0 comments on commit fba418f

Please sign in to comment.