mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 22:13:02 +00:00
[CST-3090] fix services name and dropdown
This commit is contained in:
@@ -78,7 +78,7 @@ export class CollectionDataService extends ComColDataService<Collection> {
|
||||
* collection list
|
||||
*/
|
||||
getAuthorizedCollection(query: string, options: FindListOptions = {}, ...linksToFollow: Array<FollowLinkConfig<Collection>>): Observable<RemoteData<PaginatedList<Collection>>> {
|
||||
const searchHref = 'findAuthorized';
|
||||
const searchHref = 'findSubmitAuthorized';
|
||||
options = Object.assign({}, options, {
|
||||
searchParams: [new RequestParam('query', query)]
|
||||
});
|
||||
@@ -97,7 +97,7 @@ export class CollectionDataService extends ComColDataService<Collection> {
|
||||
* collection list
|
||||
*/
|
||||
getAuthorizedCollectionByCommunity(communityId: string, query: string, options: FindListOptions = {}): Observable<RemoteData<PaginatedList<Collection>>> {
|
||||
const searchHref = 'findAuthorizedByCommunity';
|
||||
const searchHref = 'findSubmitAuthorizedByCommunity';
|
||||
options = Object.assign({}, options, {
|
||||
searchParams: [
|
||||
new RequestParam('uuid', communityId),
|
||||
@@ -116,7 +116,7 @@ export class CollectionDataService extends ComColDataService<Collection> {
|
||||
* true if the user has at least one collection to submit to
|
||||
*/
|
||||
hasAuthorizedCollection(): Observable<boolean> {
|
||||
const searchHref = 'findAuthorized';
|
||||
const searchHref = 'findSubmitAuthorized';
|
||||
const options = new FindListOptions();
|
||||
options.elementsPerPage = 1;
|
||||
|
||||
|
@@ -123,7 +123,7 @@ export class CollectionDropdownComponent implements OnInit, OnDestroy {
|
||||
startWith('')
|
||||
).subscribe(
|
||||
(next) => {
|
||||
if (hasValue(next)) {
|
||||
if (hasValue(next) && next !== this.currentQuery) {
|
||||
this.resetPagination();
|
||||
this.currentQuery = next;
|
||||
this.populateCollectionList(this.currentQuery, this.currentPage);
|
||||
|
@@ -87,18 +87,6 @@ export class SubmissionFormCollectionComponent implements OnChanges, OnInit {
|
||||
*/
|
||||
protected pathCombiner: JsonPatchOperationPathCombiner;
|
||||
|
||||
/**
|
||||
* A boolean representing if dropdown list is scrollable to the bottom
|
||||
* @type {boolean}
|
||||
*/
|
||||
private scrollableBottom = false;
|
||||
|
||||
/**
|
||||
* A boolean representing if dropdown list is scrollable to the top
|
||||
* @type {boolean}
|
||||
*/
|
||||
private scrollableTop = false;
|
||||
|
||||
/**
|
||||
* Array to track all subscriptions and unsubscribe them onDestroy
|
||||
* @type {Array}
|
||||
@@ -121,39 +109,12 @@ export class SubmissionFormCollectionComponent implements OnChanges, OnInit {
|
||||
* @param {SubmissionService} submissionService
|
||||
*/
|
||||
constructor(protected cdr: ChangeDetectorRef,
|
||||
private communityDataService: CommunityDataService,
|
||||
private collectionDataService: CollectionDataService,
|
||||
private operationsBuilder: JsonPatchOperationsBuilder,
|
||||
private operationsService: SubmissionJsonPatchOperationsService,
|
||||
private submissionService: SubmissionService) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called on mousewheel event, it prevent the page scroll
|
||||
* when arriving at the top/bottom of dropdown menu
|
||||
*
|
||||
* @param event
|
||||
* mousewheel event
|
||||
*/
|
||||
@HostListener('mousewheel', ['$event']) onMousewheel(event) {
|
||||
if (event.wheelDelta > 0 && this.scrollableTop) {
|
||||
event.preventDefault();
|
||||
}
|
||||
if (event.wheelDelta < 0 && this.scrollableBottom) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if dropdown scrollbar is at the top or bottom of the dropdown list
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
onScroll(event) {
|
||||
this.scrollableBottom = (event.target.scrollTop + event.target.clientHeight === event.target.scrollHeight);
|
||||
this.scrollableTop = (event.target.scrollTop === 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize collection list
|
||||
*/
|
||||
|
Reference in New Issue
Block a user