[CST-5253] Fix view item button for claim task in the mydspace results list

This commit is contained in:
Giuseppe Digilio
2022-04-29 09:19:56 +02:00
parent 55e77d1edb
commit bfb84c86df
3 changed files with 15 additions and 28 deletions

View File

@@ -4,12 +4,10 @@
(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)">

View File

@@ -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');
}));
});

View File

@@ -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.
*/