mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 14:03:06 +00:00
[CST-4320] No way to view an Item when in simple "Approve/Reject" workflow stage
This commit is contained in:
@@ -17,6 +17,7 @@ import { SearchService } from '../../../core/shared/search/search.service';
|
||||
import { WorkflowAction } from '../../../core/tasks/models/workflow-action-object.model';
|
||||
import { WorkflowActionDataService } from '../../../core/data/workflow-action-data.service';
|
||||
import { WORKFLOW_TASK_OPTION_RETURN_TO_POOL } from './return-to-pool/claimed-task-actions-return-to-pool.component';
|
||||
import { getWorkflowItemViewRoute } from '../../../+workflowitems-edit-page/workflowitems-edit-page-routing-paths';
|
||||
|
||||
/**
|
||||
* This component represents actions related to ClaimedTask object.
|
||||
@@ -85,6 +86,7 @@ export class ClaimedTaskActionsComponent extends MyDSpaceActionsComponent<Claime
|
||||
*/
|
||||
initObjects(object: ClaimedTask) {
|
||||
this.object = object;
|
||||
|
||||
this.workflowitem$ = (this.object.workflowitem as Observable<RemoteData<WorkflowItem>>).pipe(
|
||||
filter((rd: RemoteData<WorkflowItem>) => ((!rd.isRequestPending) && isNotUndefined(rd.payload))),
|
||||
map((rd: RemoteData<WorkflowItem>) => rd.payload),
|
||||
@@ -100,4 +102,19 @@ export class ClaimedTaskActionsComponent extends MyDSpaceActionsComponent<Claime
|
||||
this.actionRD$ = object.action;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if claimed task actions should display a view item button.
|
||||
* @param workflowAction
|
||||
*/
|
||||
hasViewAction(workflowAction: WorkflowAction) {
|
||||
return !workflowAction?.options.includes('submit_edit_metadata');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the workflowitem view route.
|
||||
*/
|
||||
getWorkflowItemViewRoute(workflowitem: WorkflowItem): string {
|
||||
return getWorkflowItemViewRoute(workflowitem?.id);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user