mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 15:03:07 +00:00
Add Item Status Edit Actions
Add the Item Withdraw and Reistate action Add the make Item Private and Public action Add the Permanently Delete action
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import {Component} from '@angular/core';
|
||||
import {first} from 'rxjs/operators';
|
||||
import {RestResponse} from '../../../core/cache/response-cache.models';
|
||||
import {AbstractSimpleItemActionComponent} from '../simple-item-action/abstract-simple-item-action.component';
|
||||
import {RemoteData} from '../../../core/data/remote-data';
|
||||
import {Item} from '../../../core/shared/item.model';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-item-public',
|
||||
templateUrl: '../simple-item-action/abstract-simple-item-action.component.html'
|
||||
})
|
||||
/**
|
||||
* Component responsible for rendering the make item public page
|
||||
*/
|
||||
export class ItemPublicComponent extends AbstractSimpleItemActionComponent {
|
||||
|
||||
protected messageKey = 'public';
|
||||
protected predicate = (rd: RemoteData<Item>) => rd.payload.isDiscoverable;
|
||||
|
||||
/**
|
||||
* Perform the make public action to the item
|
||||
*/
|
||||
performAction() {
|
||||
this.itemDataService.setDiscoverable(this.item.id, true).pipe(first()).subscribe(
|
||||
(response: RestResponse) => {
|
||||
this.processRestResponse(response);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user