mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
55990: Item move component
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {Collection} from '../../../core/shared/collection.model';
|
||||
import {RemoteData} from '../../../core/data/remote-data';
|
||||
import {Item} from '../../../core/shared/item.model';
|
||||
import {getSucceededRemoteData} from '../../../core/shared/operators';
|
||||
import {Observable} from 'rxjs';
|
||||
import {PaginatedList} from '../../../core/data/paginated-list';
|
||||
import {TranslateService} from '@ngx-translate/core';
|
||||
import {NotificationsService} from '../../../shared/notifications/notifications.service';
|
||||
import {SearchService} from '../../../+search-page/search-service/search.service';
|
||||
import {SearchConfigurationService} from '../../../+search-page/search-service/search-configuration.service';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {CollectionDataService} from '../../../core/data/collection-data.service';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-item-move',
|
||||
templateUrl: './item-move.component.html'
|
||||
})
|
||||
export class ItemMoveComponent implements OnInit {
|
||||
inheritPolicies: boolean;
|
||||
|
||||
itemRD$: Observable<RemoteData<Item>>;
|
||||
|
||||
/**
|
||||
* List of collections to show under the "Browse" tab
|
||||
* Collections that are mapped to the item
|
||||
*/
|
||||
itemCollectionsRD$: Observable<RemoteData<PaginatedList<Collection>>>;
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private searchConfigService: SearchConfigurationService,
|
||||
private searchService: SearchService,
|
||||
private notificationsService: NotificationsService,
|
||||
private collectionDataService: CollectionDataService,
|
||||
private translateService: TranslateService) {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.itemRD$ = this.route.data.map((data) => data.item).pipe(getSucceededRemoteData()) as Observable<RemoteData<Item>>;
|
||||
this.loadCollectionLists();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load all available collections to move the item to.
|
||||
* TODO: When the API support it, only fetch collections where user has ADD rights to.
|
||||
*/
|
||||
loadCollectionLists() {
|
||||
this.itemCollectionsRD$ = this.collectionDataService.findAll();
|
||||
}
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
import {Component} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-item-operation',
|
||||
templateUrl: './ds-item-operation.html'
|
||||
})
|
||||
|
||||
export class ItemOperationComponent {
|
||||
|
||||
}
|
Reference in New Issue
Block a user