groups-registry.component.ts (dspace-angular-dspace-7.0) | : | groups-registry.component.ts (dspace-angular-dspace-7.1) | ||
---|---|---|---|---|
skipping to change at line 38 | skipping to change at line 38 | |||
getFirstCompletedRemoteData, | getFirstCompletedRemoteData, | |||
getFirstSucceededRemoteData, | getFirstSucceededRemoteData, | |||
getRemoteDataPayload | getRemoteDataPayload | |||
} from '../../core/shared/operators'; | } from '../../core/shared/operators'; | |||
import { PageInfo } from '../../core/shared/page-info.model'; | import { PageInfo } from '../../core/shared/page-info.model'; | |||
import { hasValue } from '../../shared/empty.util'; | import { hasValue } from '../../shared/empty.util'; | |||
import { NotificationsService } from '../../shared/notifications/notifications.s ervice'; | import { NotificationsService } from '../../shared/notifications/notifications.s ervice'; | |||
import { PaginationComponentOptions } from '../../shared/pagination/pagination-c omponent-options.model'; | import { PaginationComponentOptions } from '../../shared/pagination/pagination-c omponent-options.model'; | |||
import { NoContent } from '../../core/shared/NoContent.model'; | import { NoContent } from '../../core/shared/NoContent.model'; | |||
import { PaginationService } from '../../core/pagination/pagination.service'; | import { PaginationService } from '../../core/pagination/pagination.service'; | |||
import { followLink } from '../../shared/utils/follow-link-config.model'; | ||||
@Component({ | @Component({ | |||
selector: 'ds-groups-registry', | selector: 'ds-groups-registry', | |||
templateUrl: './groups-registry.component.html', | templateUrl: './groups-registry.component.html', | |||
}) | }) | |||
/** | /** | |||
* A component used for managing all existing groups within the repository. | * A component used for managing all existing groups within the repository. | |||
* The admin can create, edit or delete groups here. | * The admin can create, edit or delete groups here. | |||
*/ | */ | |||
export class GroupsRegistryComponent implements OnInit, OnDestroy { | export class GroupsRegistryComponent implements OnInit, OnDestroy { | |||
skipping to change at line 135 | skipping to change at line 136 | |||
this.searchSub = this.paginationService.getCurrentPagination(this.config.id, this.config).pipe( | this.searchSub = this.paginationService.getCurrentPagination(this.config.id, this.config).pipe( | |||
tap(() => this.loading$.next(true)), | tap(() => this.loading$.next(true)), | |||
switchMap((paginationOptions) => { | switchMap((paginationOptions) => { | |||
const query: string = data.query; | const query: string = data.query; | |||
if (query != null && this.currentSearchQuery !== query) { | if (query != null && this.currentSearchQuery !== query) { | |||
this.currentSearchQuery = query; | this.currentSearchQuery = query; | |||
this.paginationService.updateRouteWithUrl(this.config.id, [], {page: 1 }); | this.paginationService.updateRouteWithUrl(this.config.id, [], {page: 1 }); | |||
} | } | |||
return this.groupService.searchGroups(this.currentSearchQuery.trim(), { | return this.groupService.searchGroups(this.currentSearchQuery.trim(), { | |||
currentPage: paginationOptions.currentPage, | currentPage: paginationOptions.currentPage, | |||
elementsPerPage: paginationOptions.pageSize | elementsPerPage: paginationOptions.pageSize, | |||
}); | }, true, true, followLink('object')); | |||
}), | }), | |||
getAllSucceededRemoteData(), | getAllSucceededRemoteData(), | |||
getRemoteDataPayload(), | getRemoteDataPayload(), | |||
switchMap((groups: PaginatedList<Group>) => { | switchMap((groups: PaginatedList<Group>) => { | |||
if (groups.page.length === 0) { | if (groups.page.length === 0) { | |||
return observableOf(buildPaginatedList(groups.pageInfo, [])); | return observableOf(buildPaginatedList(groups.pageInfo, [])); | |||
} | } | |||
return this.authorizationService.isAuthorized(FeatureID.AdministratorOf) .pipe( | return this.authorizationService.isAuthorized(FeatureID.AdministratorOf) .pipe( | |||
switchMap((isSiteAdmin: boolean) => { | switchMap((isSiteAdmin: boolean) => { | |||
return observableCombineLatest(groups.page.map((group: Group) => { | return observableCombineLatest(groups.page.map((group: Group) => { | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 3 lines changed or added |