"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.ts" between
dspace-angular-dspace-7.0.tar.gz and dspace-angular-dspace-7.1.tar.gz

About: dspace-angular is the Angular-based frontend of DSpace, a digital repository system to capture, store, index, preserve and redistribute an organization’s research material in digital formats.

authorized-collection-selector.component.ts  (dspace-angular-dspace-7.0):authorized-collection-selector.component.ts  (dspace-angular-dspace-7.1)
import { Component } from '@angular/core'; import { Component, Input } from '@angular/core';
import { DSOSelectorComponent } from '../dso-selector.component'; import { DSOSelectorComponent } from '../dso-selector.component';
import { SearchService } from '../../../../core/shared/search/search.service'; import { SearchService } from '../../../../core/shared/search/search.service';
import { CollectionDataService } from '../../../../core/data/collection-data.ser vice'; import { CollectionDataService } from '../../../../core/data/collection-data.ser vice';
import { Observable } from 'rxjs/internal/Observable'; import { Observable } from 'rxjs';
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
import { CollectionSearchResult } from '../../../object-collection/shared/collec tion-search-result.model'; import { CollectionSearchResult } from '../../../object-collection/shared/collec tion-search-result.model';
import { SearchResult } from '../../../search/search-result.model'; import { SearchResult } from '../../../search/search-result.model';
import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model';
import { buildPaginatedList, PaginatedList } from '../../../../core/data/paginat ed-list.model'; import { buildPaginatedList, PaginatedList } from '../../../../core/data/paginat ed-list.model';
import { followLink } from '../../../utils/follow-link-config.model'; import { followLink } from '../../../utils/follow-link-config.model';
import { RemoteData } from '../../../../core/data/remote-data'; import { RemoteData } from '../../../../core/data/remote-data';
import { hasValue } from '../../../empty.util'; import { hasValue } from '../../../empty.util';
import { NotificationsService } from '../../../notifications/notifications.servi ce'; import { NotificationsService } from '../../../notifications/notifications.servi ce';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { Collection } from '../../../../core/shared/collection.model';
import { FindListOptions } from '../../../../core/data/request.models';
@Component({ @Component({
selector: 'ds-authorized-collection-selector', selector: 'ds-authorized-collection-selector',
styleUrls: ['../dso-selector.component.scss'], styleUrls: ['../dso-selector.component.scss'],
templateUrl: '../dso-selector.component.html' templateUrl: '../dso-selector.component.html'
}) })
/** /**
* Component rendering a list of collections to select from * Component rendering a list of collections to select from
*/ */
export class AuthorizedCollectionSelectorComponent extends DSOSelectorComponent { export class AuthorizedCollectionSelectorComponent extends DSOSelectorComponent {
/**
* If present this value is used to filter collection list by entity type
*/
@Input() entityType: string;
constructor(protected searchService: SearchService, constructor(protected searchService: SearchService,
protected collectionDataService: CollectionDataService, protected collectionDataService: CollectionDataService,
protected notifcationsService: NotificationsService, protected notifcationsService: NotificationsService,
protected translate: TranslateService) { protected translate: TranslateService) {
super(searchService, notifcationsService, translate); super(searchService, notifcationsService, translate);
} }
/** /**
* Get a query to send for retrieving the current DSO * Get a query to send for retrieving the current DSO
*/ */
getCurrentDSOQuery(): string { getCurrentDSOQuery(): string {
return this.currentDSOId; return this.currentDSOId;
} }
/** /**
* Perform a search for authorized collections with the current query and page * Perform a search for authorized collections with the current query and page
* @param query Query to search objects for * @param query Query to search objects for
* @param page Page to retrieve * @param page Page to retrieve
*/ */
search(query: string, page: number): Observable<RemoteData<PaginatedList<Searc hResult<DSpaceObject>>>> { search(query: string, page: number): Observable<RemoteData<PaginatedList<Searc hResult<DSpaceObject>>>> {
return this.collectionDataService.getAuthorizedCollection(query, Object.assi let searchListService$: Observable<RemoteData<PaginatedList<Collection>>> =
gn({ null;
const findOptions: FindListOptions = {
currentPage: page, currentPage: page,
elementsPerPage: this.defaultPagination.pageSize elementsPerPage: this.defaultPagination.pageSize
}),true, false, followLink('parentCommunity')).pipe( };
if (this.entityType) {
searchListService$ = this.collectionDataService
.getAuthorizedCollectionByEntityType(
query,
this.entityType,
findOptions);
} else {
searchListService$ = this.collectionDataService
.getAuthorizedCollection(query, findOptions, true, false, followLink('pa
rentCommunity'));
}
return searchListService$.pipe(
getFirstCompletedRemoteData(), getFirstCompletedRemoteData(),
map((rd) => Object.assign(new RemoteData(null, null, null, null), rd, { map((rd) => Object.assign(new RemoteData(null, null, null, null), rd, {
payload: hasValue(rd.payload) ? buildPaginatedList(rd.payload.pageInfo, rd.payload.page.map((col) => Object.assign(new CollectionSearchResult(), { index ableObject: col }))) : null, payload: hasValue(rd.payload) ? buildPaginatedList(rd.payload.pageInfo, rd.payload.page.map((col) => Object.assign(new CollectionSearchResult(), { index ableObject: col }))) : null,
})) }))
); );
} }
} }
 End of changes. 6 change blocks. 
5 lines changed or deleted 26 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)