mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 18:44:14 +00:00
Initial work on browse with thumbs.
This commit is contained in:
@@ -28,6 +28,7 @@ import { AuthorizationDataService } from '../core/data/feature-authorization/aut
|
||||
import { FeatureID } from '../core/data/feature-authorization/feature-id';
|
||||
import { getCollectionPageRoute } from './collection-page-routing-paths';
|
||||
import { redirectOn4xx } from '../core/shared/authorized.operators';
|
||||
import { BROWSE_ITEM_LINKS_TO_FOLLOW } from '../core/browse/browse.service';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-collection-page',
|
||||
@@ -74,6 +75,7 @@ export class CollectionPageComponent implements OnInit {
|
||||
this.paginationConfig.pageSize = 5;
|
||||
this.paginationConfig.currentPage = 1;
|
||||
this.sortConfig = new SortOptions('dc.date.accessioned', SortDirection.DESC);
|
||||
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
@@ -108,7 +110,8 @@ export class CollectionPageComponent implements OnInit {
|
||||
pagination: currentPagination,
|
||||
sort: currentSort,
|
||||
dsoTypes: [DSpaceObjectType.ITEM]
|
||||
})).pipe(toDSpaceObjectListRD()) as Observable<RemoteData<PaginatedList<Item>>>;
|
||||
}), null, true, true, ...BROWSE_ITEM_LINKS_TO_FOLLOW)
|
||||
.pipe(toDSpaceObjectListRD()) as Observable<RemoteData<PaginatedList<Item>>>;
|
||||
}),
|
||||
startWith(undefined) // Make sure switching pages shows loading component
|
||||
)
|
||||
|
@@ -17,7 +17,7 @@ export const COLLECTION_PAGE_LINKS_TO_FOLLOW: FollowLinkConfig<Collection>[] = [
|
||||
followLink('parentCommunity', {},
|
||||
followLink('parentCommunity')
|
||||
),
|
||||
followLink('logo')
|
||||
followLink('logo'),
|
||||
];
|
||||
|
||||
/**
|
||||
|
BIN
src/app/community-page.tar.gz
Normal file
BIN
src/app/community-page.tar.gz
Normal file
Binary file not shown.
@@ -21,6 +21,15 @@ import { URLCombiner } from '../url-combiner/url-combiner';
|
||||
import { BrowseEntrySearchOptions } from './browse-entry-search-options.model';
|
||||
import { BrowseDefinitionDataService } from './browse-definition-data.service';
|
||||
import { HrefOnlyDataService } from '../data/href-only-data.service';
|
||||
import { followLink, FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
||||
|
||||
const BROWSE_ENTRY_LINKS_TO_FOLLOW: FollowLinkConfig<BrowseEntry>[] = [
|
||||
followLink('thumbnail')
|
||||
];
|
||||
|
||||
export const BROWSE_ITEM_LINKS_TO_FOLLOW: FollowLinkConfig<Item>[] = [
|
||||
followLink('thumbnail')
|
||||
];
|
||||
|
||||
/**
|
||||
* The service handling all browse requests
|
||||
@@ -96,6 +105,11 @@ export class BrowseService {
|
||||
return href;
|
||||
})
|
||||
);
|
||||
|
||||
if (options.metadataDefinition == 'title' || options.metadataDefinition == 'dateissued' ) {
|
||||
return this.hrefOnlyDataService.findAllByHref<BrowseEntry>(href$, {}, null, null, ...BROWSE_ENTRY_LINKS_TO_FOLLOW);
|
||||
|
||||
}
|
||||
return this.hrefOnlyDataService.findAllByHref<BrowseEntry>(href$);
|
||||
}
|
||||
|
||||
@@ -141,6 +155,9 @@ export class BrowseService {
|
||||
return href;
|
||||
}),
|
||||
);
|
||||
if (options.metadataDefinition == 'title' || options.metadataDefinition == 'dateissued' || hasValue(filterValue)) {
|
||||
return this.hrefOnlyDataService.findAllByHref<Item>(href$, {}, null, null, ...BROWSE_ITEM_LINKS_TO_FOLLOW);
|
||||
}
|
||||
return this.hrefOnlyDataService.findAllByHref<Item>(href$);
|
||||
}
|
||||
|
||||
|
@@ -51,6 +51,7 @@ export class BrowseEntry extends ListableObject implements TypedObject {
|
||||
_links: {
|
||||
self: HALLink;
|
||||
entries: HALLink;
|
||||
thumbnail: HALLink;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -1,9 +1,18 @@
|
||||
<div class="d-flex">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer"
|
||||
[routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out">
|
||||
<ds-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="true">
|
||||
</ds-thumbnail>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<div class="d-flex">
|
||||
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
|
||||
<ds-access-status-badge [item]="dso" class="pl-1"></ds-access-status-badge>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ds-truncatable [id]="dso.id" *ngIf="object !== undefined && object !== null">
|
||||
<ds-truncatable [id]="dso.id" *ngIf="object !== undefined && object !== null">
|
||||
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer"
|
||||
[routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out"
|
||||
[innerHTML]="dsoTitle"></a>
|
||||
@@ -28,4 +37,6 @@
|
||||
[innerHTML]="firstMetadataValue('dc.description.abstract')"></span>
|
||||
</ds-truncatable-part>
|
||||
</div>
|
||||
</ds-truncatable>
|
||||
</ds-truncatable>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user