mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 15:03:07 +00:00
Merge remote-tracking branch 'remotes/origin/main' into upgrade_angular10
# Conflicts: # package.json # server.ts # src/app/+admin/admin-access-control/epeople-registry/epeople-registry.component.ts # src/app/+admin/admin-access-control/group-registry/group-form/group-form.component.ts # src/app/+admin/admin-access-control/group-registry/groups-registry.component.spec.ts # src/app/+admin/admin-access-control/group-registry/groups-registry.component.ts # src/app/+collection-page/collection-page.component.ts # src/app/+item-page/edit-item-page/item-page-reinstate.guard.ts # src/app/+item-page/edit-item-page/item-page-withdraw.guard.ts # src/app/+item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts # src/app/+item-page/edit-item-page/item-relationships/item-relationships.component.ts # src/app/+item-page/item-page-administrator.guard.ts # src/app/app-routing.module.ts # src/app/community-list-page/community-list-service.ts # src/app/core/data/entity-type.service.ts # src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-feature.guard.spec.ts # src/app/core/data/feature-authorization/feature-authorization-guard/feature-authorization.guard.spec.ts # src/app/core/data/feature-authorization/feature-authorization-guard/feature-authorization.guard.ts # src/app/core/data/feature-authorization/feature-authorization-guard/site-administrator.guard.ts # src/app/core/data/feature-authorization/feature-authorization-guard/site-register.guard.ts # src/app/core/data/object-updates/object-updates.reducer.ts # src/app/core/shared/operators.ts # src/app/process-page/detail/process-detail.component.ts # src/app/shared/comcol-forms/delete-comcol-page/delete-comcol-page.component.ts # src/app/shared/dso-selector/dso-selector/dso-selector.component.ts # src/app/shared/input-suggestions/filter-suggestions/filter-input-suggestions.component.ts # src/app/shared/object-grid/grid-thumbnail/grid-thumbnail.component.ts # src/app/shared/shared.module.ts # yarn.lock
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { createSelector, Store } from '@ngrx/store';
|
||||
import { combineLatest as observableCombineLatest, Observable, of as observableOf } from 'rxjs';
|
||||
import { combineLatest as observableCombineLatest } from 'rxjs/internal/observable/combineLatest';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import { map, switchMap } from 'rxjs/operators';
|
||||
import { AppState } from '../app.reducer';
|
||||
import { CommunityDataService } from '../core/data/community-data.service';
|
||||
import { FindListOptions } from '../core/data/request.models';
|
||||
import { map, mergeMap } from 'rxjs/operators';
|
||||
import { Community } from '../core/shared/community.model';
|
||||
import { Collection } from '../core/shared/collection.model';
|
||||
import { getSucceededRemoteData } from '../core/shared/operators';
|
||||
import { PageInfo } from '../core/shared/page-info.model';
|
||||
import { hasValue, isNotEmpty } from '../shared/empty.util';
|
||||
import { RemoteData } from '../core/data/remote-data';
|
||||
@@ -148,8 +148,8 @@ export class CommunityListService {
|
||||
return new PaginatedList(newPageInfo, newPage);
|
||||
})
|
||||
);
|
||||
return topComs$.pipe(mergeMap((topComs: PaginatedList<Community>) => this.transformListOfCommunities(topComs, 0, null, expandedNodes)));
|
||||
}
|
||||
return topComs$.pipe(switchMap((topComs: PaginatedList<Community>) => this.transformListOfCommunities(topComs, 0, null, expandedNodes)));
|
||||
};
|
||||
|
||||
/**
|
||||
* Puts the initial top level communities in a list to be called upon
|
||||
@@ -228,9 +228,13 @@ export class CommunityListService {
|
||||
currentPage: i
|
||||
})
|
||||
.pipe(
|
||||
getSucceededRemoteData(),
|
||||
mergeMap((rd: RemoteData<PaginatedList<Community>>) =>
|
||||
this.transformListOfCommunities(rd.payload, level + 1, communityFlatNode, expandedNodes))
|
||||
switchMap((rd: RemoteData<PaginatedList<Community>>) => {
|
||||
if (hasValue(rd) && hasValue(rd.payload)) {
|
||||
return this.transformListOfCommunities(rd.payload, level + 1, communityFlatNode, expandedNodes);
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
subcoms = [...subcoms, nextSetOfSubcommunitiesPage];
|
||||
@@ -246,14 +250,17 @@ export class CommunityListService {
|
||||
currentPage: i
|
||||
})
|
||||
.pipe(
|
||||
getSucceededRemoteData(),
|
||||
map((rd: RemoteData<PaginatedList<Collection>>) => {
|
||||
let nodes = rd.payload.page
|
||||
.map((collection: Collection) => toFlatNode(collection, observableOf(false), level + 1, false, communityFlatNode));
|
||||
if (currentCollectionPage < rd.payload.totalPages && currentCollectionPage === rd.payload.currentPage) {
|
||||
nodes = [...nodes, showMoreFlatNode('collection', level + 1, communityFlatNode)];
|
||||
if (hasValue(rd) && hasValue(rd.payload)) {
|
||||
let nodes = rd.payload.page
|
||||
.map((collection: Collection) => toFlatNode(collection, observableOf(false), level + 1, false, communityFlatNode));
|
||||
if (currentCollectionPage < rd.payload.totalPages && currentCollectionPage === rd.payload.currentPage) {
|
||||
nodes = [...nodes, showMoreFlatNode('collection', level + 1, communityFlatNode)];
|
||||
}
|
||||
return nodes;
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
return nodes;
|
||||
}),
|
||||
);
|
||||
collections = [...collections, nextSetOfCollectionsPage];
|
||||
@@ -275,14 +282,24 @@ export class CommunityListService {
|
||||
let hasColls$: Observable<boolean>;
|
||||
hasSubcoms$ = this.communityDataService.findByParent(community.uuid, { elementsPerPage: 1 })
|
||||
.pipe(
|
||||
getSucceededRemoteData(),
|
||||
map((results) => results.payload.totalElements > 0),
|
||||
map((rd: RemoteData<PaginatedList<Community>>) => {
|
||||
if (hasValue(rd) && hasValue(rd.payload)) {
|
||||
return rd.payload.totalElements > 0;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
hasColls$ = this.collectionDataService.findByParent(community.uuid, { elementsPerPage: 1 })
|
||||
.pipe(
|
||||
getSucceededRemoteData(),
|
||||
map((results) => results.payload.totalElements > 0),
|
||||
map((rd: RemoteData<PaginatedList<Collection>>) => {
|
||||
if (hasValue(rd) && hasValue(rd.payload)) {
|
||||
return rd.payload.totalElements > 0;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
let hasChildren$: Observable<boolean>;
|
||||
|
Reference in New Issue
Block a user