reordering authors

This commit is contained in:
lotte
2019-12-02 15:37:59 +01:00
parent 0048a97181
commit bc8e7d8fe6
16 changed files with 291 additions and 126 deletions

View File

@@ -197,21 +197,23 @@ export class SubmissionFormCollectionComponent implements OnChanges, OnInit {
find((communities: RemoteData<PaginatedList<Community>>) => isNotEmpty(communities.payload)),
mergeMap((communities: RemoteData<PaginatedList<Community>>) => communities.payload.page));
const listCollection$ = communities$.pipe(
flatMap((communityData: Community) => {
return this.collectionDataService.getAuthorizedCollectionByCommunity(communityData.uuid, findOptions).pipe(
find((collections: RemoteData<PaginatedList<Collection>>) => !collections.isResponsePending && collections.hasSucceeded),
mergeMap((collections: RemoteData<PaginatedList<Collection>>) => collections.payload.page),
filter((collectionData: Collection) => isNotEmpty(collectionData)),
map((collectionData: Collection) => ({
communities: [{ id: communityData.id, name: communityData.name }],
collection: { id: collectionData.id, name: collectionData.name }
}))
);
}),
reduce((acc: any, value: any) => [...acc, ...value], []),
startWith([])
);
const listCollection$ = observableOf([]);
// const listCollection$ = communities$.pipe(
// flatMap((communityData: Community) => {
// return this.collectionDataService.getAuthorizedCollectionByCommunity(communityData.uuid, findOptions).pipe(
// find((collections: RemoteData<PaginatedList<Collection>>) => !collections.isResponsePending && collections.hasSucceeded),
// mergeMap((collections: RemoteData<PaginatedList<Collection>>) => collections.payload.page),
// filter((collectionData: Collection) => isNotEmpty(collectionData)),
// map((collectionData: Collection) => ({
// communities: [{ id: communityData.id, name: communityData.name }],
// collection: { id: collectionData.id, name: collectionData.name }
// }))
// );
// }),
// reduce((acc: any, value: any) => [...acc, ...value], []),
// startWith([])
// );
const searchTerm$ = this.searchField.valueChanges.pipe(
debounceTime(200),
@@ -227,8 +229,8 @@ export class SubmissionFormCollectionComponent implements OnChanges, OnInit {
} else {
return listCollection.filter((v) => v.collection.name.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1).slice(0, 5);
}
})
);
})
);
}
}
}