mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
[CST-6876] Refactoring workflow actions components in order to pass item and workflowitem objects down from paren search element component to children
This commit is contained in:
@@ -15,6 +15,8 @@ import { ClaimedTaskActionsAbstractComponent } from '../abstract/claimed-task-ac
|
||||
import { hasValue } from '../../../empty.util';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { MyDSpaceActionsResult } from '../../mydspace-actions';
|
||||
import { Item } from '../../../../core/shared/item.model';
|
||||
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-claimed-task-actions-loader',
|
||||
@@ -25,6 +27,11 @@ import { MyDSpaceActionsResult } from '../../mydspace-actions';
|
||||
* Passes on the ClaimedTask to the component and subscribes to the processCompleted output
|
||||
*/
|
||||
export class ClaimedTaskActionsLoaderComponent implements OnInit, OnDestroy {
|
||||
/**
|
||||
* The item object that belonging to the ClaimedTask object
|
||||
*/
|
||||
@Input() item: Item;
|
||||
|
||||
/**
|
||||
* The ClaimedTask object
|
||||
*/
|
||||
@@ -36,6 +43,11 @@ export class ClaimedTaskActionsLoaderComponent implements OnInit, OnDestroy {
|
||||
*/
|
||||
@Input() option: string;
|
||||
|
||||
/**
|
||||
* The workflowitem object that belonging to the ClaimedTask object
|
||||
*/
|
||||
@Input() workflowitem: WorkflowItem;
|
||||
|
||||
/**
|
||||
* Emits the success or failure of a processed action
|
||||
*/
|
||||
@@ -69,7 +81,9 @@ export class ClaimedTaskActionsLoaderComponent implements OnInit, OnDestroy {
|
||||
|
||||
const componentRef = viewContainerRef.createComponent(componentFactory);
|
||||
const componentInstance = (componentRef.instance as ClaimedTaskActionsAbstractComponent);
|
||||
componentInstance.item = this.item;
|
||||
componentInstance.object = this.object;
|
||||
componentInstance.workflowitem = this.workflowitem;
|
||||
if (hasValue(componentInstance.processCompleted)) {
|
||||
this.subs.push(componentInstance.processCompleted.subscribe((result) => this.processCompleted.emit(result)));
|
||||
}
|
||||
|
Reference in New Issue
Block a user