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:
Yana De Pauw
2018-12-18 16:52:11 +01:00
parent a3b4883e2d
commit d9a393c8e6
38 changed files with 1984 additions and 76 deletions

View File

@@ -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-private',
templateUrl: '../simple-item-action/abstract-simple-item-action.component.html'
})
/**
* Component responsible for rendering the make item private page
*/
export class ItemPrivateComponent extends AbstractSimpleItemActionComponent {
protected messageKey = 'private';
protected predicate = (rd: RemoteData<Item>) => !rd.payload.isDiscoverable;
/**
* Perform the make private action to the item
*/
performAction() {
this.itemDataService.setDiscoverable(this.item.id, false).pipe(first()).subscribe(
(response: RestResponse) => {
this.processRestResponse(response);
}
);
}
}