Skip to content
Snippets Groups Projects
Commit 4da66b5f authored by Kristof De Langhe's avatar Kristof De Langhe
Browse files

61133: Post-merge refactoring + order renamed to place

parent e6d401d1
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,7 @@ export class CollectionPageComponent implements OnInit, OnDestroy {
this.paginationConfig.id = 'collection-page-pagination';
this.paginationConfig.pageSize = 5;
this.paginationConfig.currentPage = 1;
this.sortConfig = new SortOptions('dc.date.accessioned', SortDirection.DESC);
this.sortConfig = new SortOptions('dc.date.issued', SortDirection.DESC);
}
ngOnInit(): void {
......@@ -76,7 +76,7 @@ export class CollectionPageComponent implements OnInit, OnDestroy {
);
const sort = Object.assign({},
this.sortConfig,
{ direction: sortDirection, field: params.sortField }
{ direction: sortDirection, field: this.sortConfig.field }
);
this.collectionRD$.subscribe((rd: RemoteData<Collection>) => {
this.collectionId = rd.payload.id;
......
......@@ -119,21 +119,21 @@ export class DSpaceObject implements CacheableObject, ListableObject {
}
/**
* Find metadata on a specific field and order all of them using their "order" property.
* Find metadata on a specific field and order all of them using their "place" property.
* @param key
*/
findMetadataSortedByPlace(key: string): MetadataValue[] {
return this.allMetadata([key]).sort((a: MetadataValue, b: MetadataValue) => {
if (hasNoValue(a.order) && hasNoValue(b.order)) {
if (hasNoValue(a.place) && hasNoValue(b.place)) {
return 0;
}
if (hasNoValue(a.order)) {
if (hasNoValue(a.place)) {
return -1;
}
if (hasNoValue(b.order)) {
if (hasNoValue(b.place)) {
return 1;
}
return a.order - b.order;
return a.place - b.place;
});
}
......
......@@ -29,7 +29,7 @@ export class MetadataValue {
* This is used to render metadata in a specific custom order
*/
@autoserialize
order: number;
place: number;
/** The authority key used for authority-controlled metadata */
@autoserialize
......@@ -91,7 +91,7 @@ export class MetadatumViewModel {
* The place of this MetadataValue within his list of metadata
* This is used to render metadata in a specific custom order
*/
order: number;
place: number;
/** The authority key used for authority-controlled metadata */
authority: string;
......
......@@ -4,9 +4,9 @@
[innerHTML]="firstMetadataValue('dc.title')"></a>
<span class="text-muted">
<ds-truncatable-part [id]="item.id" [minLines]="1">
<span *ngIf="item.filterMetadata(['journal.identifier.issn']).length > 0"
<span *ngIf="item.allMetadata(['journal.identifier.issn']).length > 0"
class="item-list-journals">
<span *ngFor="let value of getValues(['journal.identifier.issn']); let last=last;">
<span *ngFor="let value of allMetadataValues(['journal.identifier.issn']); let last=last;">
<span [innerHTML]="value"><span [innerHTML]="value"></span></span>
</span>
</span>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment