mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 02:24:11 +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 { FeatureID } from '../core/data/feature-authorization/feature-id';
|
||||||
import { getCollectionPageRoute } from './collection-page-routing-paths';
|
import { getCollectionPageRoute } from './collection-page-routing-paths';
|
||||||
import { redirectOn4xx } from '../core/shared/authorized.operators';
|
import { redirectOn4xx } from '../core/shared/authorized.operators';
|
||||||
|
import { BROWSE_ITEM_LINKS_TO_FOLLOW } from '../core/browse/browse.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-collection-page',
|
selector: 'ds-collection-page',
|
||||||
@@ -74,6 +75,7 @@ export class CollectionPageComponent implements OnInit {
|
|||||||
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.accessioned', SortDirection.DESC);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
@@ -108,7 +110,8 @@ export class CollectionPageComponent implements OnInit {
|
|||||||
pagination: currentPagination,
|
pagination: currentPagination,
|
||||||
sort: currentSort,
|
sort: currentSort,
|
||||||
dsoTypes: [DSpaceObjectType.ITEM]
|
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
|
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('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 { BrowseEntrySearchOptions } from './browse-entry-search-options.model';
|
||||||
import { BrowseDefinitionDataService } from './browse-definition-data.service';
|
import { BrowseDefinitionDataService } from './browse-definition-data.service';
|
||||||
import { HrefOnlyDataService } from '../data/href-only-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
|
* The service handling all browse requests
|
||||||
@@ -96,6 +105,11 @@ export class BrowseService {
|
|||||||
return href;
|
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$);
|
return this.hrefOnlyDataService.findAllByHref<BrowseEntry>(href$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,6 +155,9 @@ export class BrowseService {
|
|||||||
return href;
|
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$);
|
return this.hrefOnlyDataService.findAllByHref<Item>(href$);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -51,6 +51,7 @@ export class BrowseEntry extends ListableObject implements TypedObject {
|
|||||||
_links: {
|
_links: {
|
||||||
self: HALLink;
|
self: HALLink;
|
||||||
entries: HALLink;
|
entries: HALLink;
|
||||||
|
thumbnail: HALLink;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,15 +1,24 @@
|
|||||||
<div class="d-flex">
|
<div class="row">
|
||||||
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
|
<div class="col-md-2">
|
||||||
<ds-access-status-badge [item]="dso" class="pl-1"></ds-access-status-badge>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ds-truncatable [id]="dso.id" *ngIf="object !== undefined && object !== null">
|
|
||||||
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer"
|
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer"
|
||||||
[routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out"
|
[routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out">
|
||||||
[innerHTML]="dsoTitle"></a>
|
<ds-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="true">
|
||||||
<span *ngIf="linkType == linkTypes.None" class="lead item-list-title dont-break-out"
|
</ds-thumbnail>
|
||||||
[innerHTML]="dsoTitle"></span>
|
</a>
|
||||||
<span class="text-muted">
|
</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>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
<span *ngIf="linkType == linkTypes.None" class="lead item-list-title dont-break-out"
|
||||||
|
[innerHTML]="dsoTitle"></span>
|
||||||
|
<span class="text-muted">
|
||||||
<ds-truncatable-part [id]="dso.id" [minLines]="1">
|
<ds-truncatable-part [id]="dso.id" [minLines]="1">
|
||||||
<ng-container *ngIf="dso.firstMetadataValue('dc.publisher') || dso.firstMetadataValue('dc.date.issued')">
|
<ng-container *ngIf="dso.firstMetadataValue('dc.publisher') || dso.firstMetadataValue('dc.date.issued')">
|
||||||
(<span *ngIf="dso.firstMetadataValue('dc.publisher')" class="item-list-publisher" [innerHTML]="firstMetadataValue('dc.publisher') + ', '"></span>
|
(<span *ngIf="dso.firstMetadataValue('dc.publisher')" class="item-list-publisher" [innerHTML]="firstMetadataValue('dc.publisher') + ', '"></span>
|
||||||
@@ -23,9 +32,11 @@
|
|||||||
</span>
|
</span>
|
||||||
</ds-truncatable-part>
|
</ds-truncatable-part>
|
||||||
</span>
|
</span>
|
||||||
<div *ngIf="dso.firstMetadataValue('dc.description.abstract')" class="item-list-abstract">
|
<div *ngIf="dso.firstMetadataValue('dc.description.abstract')" class="item-list-abstract">
|
||||||
<ds-truncatable-part [id]="dso.id" [minLines]="3"><span
|
<ds-truncatable-part [id]="dso.id" [minLines]="3"><span
|
||||||
[innerHTML]="firstMetadataValue('dc.description.abstract')"></span>
|
[innerHTML]="firstMetadataValue('dc.description.abstract')"></span>
|
||||||
</ds-truncatable-part>
|
</ds-truncatable-part>
|
||||||
</div>
|
</div>
|
||||||
</ds-truncatable>
|
</ds-truncatable>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
Reference in New Issue
Block a user