mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
[CST-5253] Fix view item button for claim task in the mydspace results list
This commit is contained in:
@@ -4,15 +4,13 @@
|
||||
(processCompleted)="this.processCompleted.emit($event)">
|
||||
</ds-claimed-task-actions-loader>
|
||||
|
||||
<!-- <ng-container *ngIf="hasViewAction(workflowAction)"> -->
|
||||
<button class="btn btn-primary workflow-view" ngbTooltip="{{'submission.workflow.generic.view-help' | translate}}"
|
||||
[routerLink]="[getWorkflowItemViewRoute((workflowitem$ | async))]">
|
||||
<i class="fa fa-info-circle"></i> {{"submission.workflow.generic.view" | translate}}
|
||||
</button>
|
||||
<!-- </ng-container> -->
|
||||
|
||||
<ds-claimed-task-actions-loader [option]="returnToPoolOption" [object]="object"
|
||||
(processCompleted)="this.processCompleted.emit($event)">
|
||||
</ds-claimed-task-actions-loader>
|
||||
</div>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
|
@@ -161,25 +161,22 @@ describe('ClaimedTaskActionsComponent', () => {
|
||||
});
|
||||
}));
|
||||
|
||||
describe('when edit options is not available', () => {
|
||||
it('should display a view button', waitForAsync(() => {
|
||||
component.object = null;
|
||||
component.initObjects(mockObject);
|
||||
fixture.detectChanges();
|
||||
it('should display a view button', waitForAsync(() => {
|
||||
component.object = null;
|
||||
component.initObjects(mockObject);
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
const debugElement = fixture.debugElement.query(By.css('.workflow-view'));
|
||||
expect(debugElement).toBeTruthy();
|
||||
expect(debugElement.nativeElement.innerText.trim()).toBe('submission.workflow.generic.view');
|
||||
});
|
||||
fixture.whenStable().then(() => {
|
||||
const debugElement = fixture.debugElement.query(By.css('.workflow-view'));
|
||||
expect(debugElement).toBeTruthy();
|
||||
expect(debugElement.nativeElement.innerText.trim()).toBe('submission.workflow.generic.view');
|
||||
});
|
||||
|
||||
}));
|
||||
|
||||
it('getWorkflowItemViewRoute should return the combined uri to show a workspaceitem', waitForAsync(() => {
|
||||
const href = component.getWorkflowItemViewRoute(workflowitem);
|
||||
expect(href).toEqual('/workflowitems/333/view');
|
||||
}));
|
||||
});
|
||||
}));
|
||||
|
||||
it('getWorkflowItemViewRoute should return the combined uri to show a workspaceitem', waitForAsync(() => {
|
||||
const href = component.getWorkflowItemViewRoute(workflowitem);
|
||||
expect(href).toEqual('/workflowitems/333/view');
|
||||
}));
|
||||
|
||||
});
|
||||
|
@@ -102,14 +102,6 @@ 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.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user