mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 18:44:14 +00:00
61133: Post-merge refactoring + order renamed to place
This commit is contained in:
@@ -51,7 +51,7 @@ export class CollectionPageComponent implements OnInit, OnDestroy {
|
|||||||
this.paginationConfig.id = 'collection-page-pagination';
|
this.paginationConfig.id = 'collection-page-pagination';
|
||||||
this.paginationConfig.pageSize = 5;
|
this.paginationConfig.pageSize = 5;
|
||||||
this.paginationConfig.currentPage = 1;
|
this.paginationConfig.currentPage = 1;
|
||||||
this.sortConfig = new SortOptions('dc.date.accessioned', SortDirection.DESC);
|
this.sortConfig = new SortOptions('dc.date.issued', SortDirection.DESC);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
@@ -76,7 +76,7 @@ export class CollectionPageComponent implements OnInit, OnDestroy {
|
|||||||
);
|
);
|
||||||
const sort = Object.assign({},
|
const sort = Object.assign({},
|
||||||
this.sortConfig,
|
this.sortConfig,
|
||||||
{ direction: sortDirection, field: params.sortField }
|
{ direction: sortDirection, field: this.sortConfig.field }
|
||||||
);
|
);
|
||||||
this.collectionRD$.subscribe((rd: RemoteData<Collection>) => {
|
this.collectionRD$.subscribe((rd: RemoteData<Collection>) => {
|
||||||
this.collectionId = rd.payload.id;
|
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
|
* @param key
|
||||||
*/
|
*/
|
||||||
findMetadataSortedByPlace(key: string): MetadataValue[] {
|
findMetadataSortedByPlace(key: string): MetadataValue[] {
|
||||||
return this.allMetadata([key]).sort((a: MetadataValue, b: 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;
|
return 0;
|
||||||
}
|
}
|
||||||
if (hasNoValue(a.order)) {
|
if (hasNoValue(a.place)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (hasNoValue(b.order)) {
|
if (hasNoValue(b.place)) {
|
||||||
return 1;
|
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
|
* This is used to render metadata in a specific custom order
|
||||||
*/
|
*/
|
||||||
@autoserialize
|
@autoserialize
|
||||||
order: number;
|
place: number;
|
||||||
|
|
||||||
/** The authority key used for authority-controlled metadata */
|
/** The authority key used for authority-controlled metadata */
|
||||||
@autoserialize
|
@autoserialize
|
||||||
@@ -91,7 +91,7 @@ export class MetadatumViewModel {
|
|||||||
* The place of this MetadataValue within his list of metadata
|
* The place of this MetadataValue within his list of metadata
|
||||||
* This is used to render metadata in a specific custom order
|
* This is used to render metadata in a specific custom order
|
||||||
*/
|
*/
|
||||||
order: number;
|
place: number;
|
||||||
|
|
||||||
/** The authority key used for authority-controlled metadata */
|
/** The authority key used for authority-controlled metadata */
|
||||||
authority: string;
|
authority: string;
|
||||||
|
@@ -4,9 +4,9 @@
|
|||||||
[innerHTML]="firstMetadataValue('dc.title')"></a>
|
[innerHTML]="firstMetadataValue('dc.title')"></a>
|
||||||
<span class="text-muted">
|
<span class="text-muted">
|
||||||
<ds-truncatable-part [id]="item.id" [minLines]="1">
|
<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">
|
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 [innerHTML]="value"><span [innerHTML]="value"></span></span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
Reference in New Issue
Block a user