mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
[CST-5253] Add view item button for workflow items
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
<button class="btn btn-primary workflow-view mt-1 mb-3" data-test="view-btn"
|
||||||
|
ngbTooltip="{{'submission.workspace.generic.view-help' | translate}}"
|
||||||
|
[routerLink]="[getWorkflowItemViewRoute(object)]">
|
||||||
|
<i class="fa fa-info-circle"></i> {{"submission.workspace.generic.view" | translate}}
|
||||||
|
</button>
|
||||||
|
@@ -18,6 +18,7 @@ import { getMockRequestService } from '../../mocks/request.service.mock';
|
|||||||
import { RequestService } from '../../../core/data/request.service';
|
import { RequestService } from '../../../core/data/request.service';
|
||||||
import { getMockSearchService } from '../../mocks/search-service.mock';
|
import { getMockSearchService } from '../../mocks/search-service.mock';
|
||||||
import { SearchService } from '../../../core/shared/search/search.service';
|
import { SearchService } from '../../../core/shared/search/search.service';
|
||||||
|
import { By } from '@angular/platform-browser';
|
||||||
|
|
||||||
let component: WorkflowitemActionsComponent;
|
let component: WorkflowitemActionsComponent;
|
||||||
let fixture: ComponentFixture<WorkflowitemActionsComponent>;
|
let fixture: ComponentFixture<WorkflowitemActionsComponent>;
|
||||||
@@ -105,4 +106,10 @@ describe('WorkflowitemActionsComponent', () => {
|
|||||||
expect(component.object).toEqual(mockObject);
|
expect(component.object).toEqual(mockObject);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should display view button', () => {
|
||||||
|
const btn = fixture.debugElement.query(By.css('button [data-test="view-btn"]'));
|
||||||
|
|
||||||
|
expect(btn).toBeDefined();
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@@ -9,6 +9,7 @@ import { WorkflowItemDataService } from '../../../core/submission/workflowitem-d
|
|||||||
import { NotificationsService } from '../../notifications/notifications.service';
|
import { NotificationsService } from '../../notifications/notifications.service';
|
||||||
import { RequestService } from '../../../core/data/request.service';
|
import { RequestService } from '../../../core/data/request.service';
|
||||||
import { SearchService } from '../../../core/shared/search/search.service';
|
import { SearchService } from '../../../core/shared/search/search.service';
|
||||||
|
import { getWorkflowItemViewRoute } from '../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component represents actions related to WorkflowItem object.
|
* This component represents actions related to WorkflowItem object.
|
||||||
@@ -44,6 +45,13 @@ export class WorkflowitemActionsComponent extends MyDSpaceActionsComponent<Workf
|
|||||||
super(WorkflowItem.type, injector, router, notificationsService, translate, searchService, requestService);
|
super(WorkflowItem.type, injector, router, notificationsService, translate, searchService, requestService);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the workflowitem view route.
|
||||||
|
*/
|
||||||
|
getWorkflowItemViewRoute(workflowitem: WorkflowItem): string {
|
||||||
|
return getWorkflowItemViewRoute(workflowitem?.id);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Init the target object
|
* Init the target object
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user