forked from hazza/dspace-angular
98211: Added button to my workflow task page
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { ClaimedTaskActionsAbstractComponent } from './claimed-task-actions-abstract.component';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Abstract component for rendering an advanced claimed task's action
|
||||||
|
* To create a child-component for a new option:
|
||||||
|
* - Set the "option" of the component
|
||||||
|
* - Add a @rendersWorkflowTaskOption annotation to your component providing the same enum value
|
||||||
|
* - Optionally overwrite createBody if the request body requires more than just the option
|
||||||
|
*/
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-advanced-claimed-task-action-abstract',
|
||||||
|
template: ''
|
||||||
|
})
|
||||||
|
export abstract class AdvancedClaimedTaskActionsAbstractComponent extends ClaimedTaskActionsAbstractComponent {
|
||||||
|
}
|
@@ -0,0 +1,4 @@
|
|||||||
|
<button class="btn btn-primary" ngbTooltip="{{ 'submission.workflow.generic.' + option + '-help' | translate }}"
|
||||||
|
[routerLink]="workflowTaskPageRoute">
|
||||||
|
<i class="fa fa-user"></i> {{ 'submission.workflow.generic.' + option | translate}}
|
||||||
|
</button>
|
@@ -0,0 +1,27 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
import {
|
||||||
|
AdvancedClaimedTaskActionRatingReviewerComponent
|
||||||
|
} from './advanced-claimed-task-action-rating-reviewer.component';
|
||||||
|
|
||||||
|
describe('AdvancedClaimedTaskActionsRatingReviewerComponent', () => {
|
||||||
|
let component: AdvancedClaimedTaskActionRatingReviewerComponent;
|
||||||
|
let fixture: ComponentFixture<AdvancedClaimedTaskActionRatingReviewerComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [
|
||||||
|
AdvancedClaimedTaskActionRatingReviewerComponent,
|
||||||
|
],
|
||||||
|
}).compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(AdvancedClaimedTaskActionRatingReviewerComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
@@ -0,0 +1,55 @@
|
|||||||
|
import { Component, Injector } from '@angular/core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { NotificationsService } from '../../../notifications/notifications.service';
|
||||||
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
import { SearchService } from '../../../../core/shared/search/search.service';
|
||||||
|
import { RequestService } from '../../../../core/data/request.service';
|
||||||
|
import {
|
||||||
|
getWorkflowRatingReviewerRoute
|
||||||
|
} from '../../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths';
|
||||||
|
import {
|
||||||
|
AdvancedClaimedTaskActionsAbstractComponent
|
||||||
|
} from '../abstract/advanced-claimed-task-actions-abstract.component';
|
||||||
|
|
||||||
|
export const WORKFLOW_ADVANCED_TASK_OPTION_RATING_REVIEWER = 'submit_rating_reviewer';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-advanced-claimed-task-action-rating-reviewer',
|
||||||
|
templateUrl: './advanced-claimed-task-action-rating-reviewer.component.html',
|
||||||
|
styleUrls: ['./advanced-claimed-task-action-rating-reviewer.component.scss']
|
||||||
|
})
|
||||||
|
export class AdvancedClaimedTaskActionRatingReviewerComponent extends AdvancedClaimedTaskActionsAbstractComponent {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This component represents the advanced select option
|
||||||
|
*/
|
||||||
|
option = WORKFLOW_ADVANCED_TASK_OPTION_RATING_REVIEWER;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Route to the workflow's task page
|
||||||
|
*/
|
||||||
|
workflowTaskPageRoute: string;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
protected injector: Injector,
|
||||||
|
protected router: Router,
|
||||||
|
protected notificationsService: NotificationsService,
|
||||||
|
protected translate: TranslateService,
|
||||||
|
protected searchService: SearchService,
|
||||||
|
protected requestService: RequestService,
|
||||||
|
) {
|
||||||
|
super(injector, router, notificationsService, translate, searchService, requestService);
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.initPageRoute();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialise the route to the rating reviewer's page
|
||||||
|
*/
|
||||||
|
initPageRoute() {
|
||||||
|
this.workflowTaskPageRoute = getWorkflowRatingReviewerRoute(this.object.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,4 @@
|
|||||||
|
<button class="btn btn-primary" ngbTooltip="{{ 'submission.workflow.generic.' + option + '-help' | translate }}"
|
||||||
|
[routerLink]="workflowTaskPageRoute">
|
||||||
|
<i class="fa fa-user"></i> {{ 'submission.workflow.generic.' + option | translate}}
|
||||||
|
</button>
|
@@ -0,0 +1,27 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
import {
|
||||||
|
AdvancedClaimedTaskActionSelectReviewerComponent
|
||||||
|
} from './advanced-claimed-task-action-select-reviewer.component';
|
||||||
|
|
||||||
|
describe('AdvancedClaimedTaskActionsSelectReviewerComponent', () => {
|
||||||
|
let component: AdvancedClaimedTaskActionSelectReviewerComponent;
|
||||||
|
let fixture: ComponentFixture<AdvancedClaimedTaskActionSelectReviewerComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [
|
||||||
|
AdvancedClaimedTaskActionSelectReviewerComponent,
|
||||||
|
],
|
||||||
|
}).compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(AdvancedClaimedTaskActionSelectReviewerComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
@@ -0,0 +1,57 @@
|
|||||||
|
import { Component, Injector } from '@angular/core';
|
||||||
|
import { rendersWorkflowTaskOption } from '../switcher/claimed-task-actions-decorator';
|
||||||
|
import {
|
||||||
|
AdvancedClaimedTaskActionsAbstractComponent
|
||||||
|
} from '../abstract/advanced-claimed-task-actions-abstract.component';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { NotificationsService } from '../../../notifications/notifications.service';
|
||||||
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
import { SearchService } from '../../../../core/shared/search/search.service';
|
||||||
|
import { RequestService } from '../../../../core/data/request.service';
|
||||||
|
import {
|
||||||
|
getWorkflowSelectReviewerRoute
|
||||||
|
} from '../../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths';
|
||||||
|
|
||||||
|
export const WORKFLOW_ADVANCED_TASK_OPTION_SELECT_REVIEWER = 'submit_select_reviewer';
|
||||||
|
|
||||||
|
@rendersWorkflowTaskOption(WORKFLOW_ADVANCED_TASK_OPTION_SELECT_REVIEWER)
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-advanced-claimed-task-action-select-reviewer',
|
||||||
|
templateUrl: './advanced-claimed-task-action-select-reviewer.component.html',
|
||||||
|
styleUrls: ['./advanced-claimed-task-action-select-reviewer.component.scss']
|
||||||
|
})
|
||||||
|
export class AdvancedClaimedTaskActionSelectReviewerComponent extends AdvancedClaimedTaskActionsAbstractComponent {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This component represents the advanced select option
|
||||||
|
*/
|
||||||
|
option = WORKFLOW_ADVANCED_TASK_OPTION_SELECT_REVIEWER;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Route to the workflow's task page
|
||||||
|
*/
|
||||||
|
workflowTaskPageRoute: string;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
protected injector: Injector,
|
||||||
|
protected router: Router,
|
||||||
|
protected notificationsService: NotificationsService,
|
||||||
|
protected translate: TranslateService,
|
||||||
|
protected searchService: SearchService,
|
||||||
|
protected requestService: RequestService,
|
||||||
|
) {
|
||||||
|
super(injector, router, notificationsService, translate, searchService, requestService);
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.initPageRoute();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialise the route to the select reviewer's page
|
||||||
|
*/
|
||||||
|
initPageRoute() {
|
||||||
|
this.workflowTaskPageRoute = getWorkflowSelectReviewerRoute(this.object.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -177,6 +177,10 @@ import { ScopeSelectorModalComponent } from './search-form/scope-selector-modal/
|
|||||||
import { BitstreamRequestACopyPageComponent } from './bitstream-request-a-copy-page/bitstream-request-a-copy-page.component';
|
import { BitstreamRequestACopyPageComponent } from './bitstream-request-a-copy-page/bitstream-request-a-copy-page.component';
|
||||||
import { DsSelectComponent } from './ds-select/ds-select.component';
|
import { DsSelectComponent } from './ds-select/ds-select.component';
|
||||||
import { LogInOidcComponent } from './log-in/methods/oidc/log-in-oidc.component';
|
import { LogInOidcComponent } from './log-in/methods/oidc/log-in-oidc.component';
|
||||||
|
import { AdvancedClaimedTaskActionSelectReviewerComponent } from './mydspace-actions/claimed-task/select-reviewer/advanced-claimed-task-action-select-reviewer.component';
|
||||||
|
import {
|
||||||
|
AdvancedClaimedTaskActionRatingReviewerComponent
|
||||||
|
} from './mydspace-actions/claimed-task/rating-reviewer/advanced-claimed-task-action-rating-reviewer.component';
|
||||||
|
|
||||||
const MODULES = [
|
const MODULES = [
|
||||||
// Do NOT include UniversalModule, HttpModule, or JsonpModule here
|
// Do NOT include UniversalModule, HttpModule, or JsonpModule here
|
||||||
@@ -346,6 +350,8 @@ const COMPONENTS = [
|
|||||||
CommunitySidebarSearchListElementComponent,
|
CommunitySidebarSearchListElementComponent,
|
||||||
SearchNavbarComponent,
|
SearchNavbarComponent,
|
||||||
ScopeSelectorModalComponent,
|
ScopeSelectorModalComponent,
|
||||||
|
AdvancedClaimedTaskActionSelectReviewerComponent,
|
||||||
|
AdvancedClaimedTaskActionRatingReviewerComponent,
|
||||||
];
|
];
|
||||||
|
|
||||||
const ENTRY_COMPONENTS = [
|
const ENTRY_COMPONENTS = [
|
||||||
@@ -402,6 +408,8 @@ const ENTRY_COMPONENTS = [
|
|||||||
OnClickMenuItemComponent,
|
OnClickMenuItemComponent,
|
||||||
TextMenuItemComponent,
|
TextMenuItemComponent,
|
||||||
ScopeSelectorModalComponent,
|
ScopeSelectorModalComponent,
|
||||||
|
AdvancedClaimedTaskActionSelectReviewerComponent,
|
||||||
|
AdvancedClaimedTaskActionRatingReviewerComponent,
|
||||||
];
|
];
|
||||||
|
|
||||||
const SHARED_ITEM_PAGE_COMPONENTS = [
|
const SHARED_ITEM_PAGE_COMPONENTS = [
|
||||||
@@ -436,7 +444,6 @@ const DIRECTIVES = [
|
|||||||
ClaimedTaskActionsDirective,
|
ClaimedTaskActionsDirective,
|
||||||
FileValueAccessorDirective,
|
FileValueAccessorDirective,
|
||||||
FileValidator,
|
FileValidator,
|
||||||
ClaimedTaskActionsDirective,
|
|
||||||
NgForTrackByIdDirective,
|
NgForTrackByIdDirective,
|
||||||
MetadataFieldValidator,
|
MetadataFieldValidator,
|
||||||
HoverClassDirective
|
HoverClassDirective
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
import { URLCombiner } from '../core/url-combiner/url-combiner';
|
import { URLCombiner } from '../core/url-combiner/url-combiner';
|
||||||
import { getWorkflowItemModuleRoute } from '../app-routing-paths';
|
import { getWorkflowItemModuleRoute } from '../app-routing-paths';
|
||||||
|
import { RATING_REVIEWER_ACTION_ADVANCED_INFO } from '../core/tasks/models/reviewer-action-advanced-info.resource-type';
|
||||||
|
|
||||||
export function getWorkflowItemPageRoute(wfiId: string) {
|
export function getWorkflowItemPageRoute(wfiId: string) {
|
||||||
return new URLCombiner(getWorkflowItemModuleRoute(), wfiId).toString();
|
return new URLCombiner(getWorkflowItemModuleRoute(), wfiId).toString();
|
||||||
@@ -20,7 +21,16 @@ export function getWorkflowItemSendBackRoute(wfiId: string) {
|
|||||||
return new URLCombiner(getWorkflowItemModuleRoute(), wfiId, WORKFLOW_ITEM_SEND_BACK_PATH).toString();
|
return new URLCombiner(getWorkflowItemModuleRoute(), wfiId, WORKFLOW_ITEM_SEND_BACK_PATH).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getWorkflowSelectReviewerRoute(wfiId: string) {
|
||||||
|
return new URLCombiner(getWorkflowItemModuleRoute(), wfiId, WORKFLOW_SELECT_REVIEWER_PATH).toString();
|
||||||
|
}
|
||||||
|
export function getWorkflowRatingReviewerRoute(wfiId: string) {
|
||||||
|
return new URLCombiner(getWorkflowItemModuleRoute(), wfiId, WORKFLOW_RATING_REVIEWER_PATH).toString();
|
||||||
|
}
|
||||||
|
|
||||||
export const WORKFLOW_ITEM_EDIT_PATH = 'edit';
|
export const WORKFLOW_ITEM_EDIT_PATH = 'edit';
|
||||||
export const WORKFLOW_ITEM_DELETE_PATH = 'delete';
|
export const WORKFLOW_ITEM_DELETE_PATH = 'delete';
|
||||||
export const WORKFLOW_ITEM_VIEW_PATH = 'view';
|
export const WORKFLOW_ITEM_VIEW_PATH = 'view';
|
||||||
export const WORKFLOW_ITEM_SEND_BACK_PATH = 'sendback';
|
export const WORKFLOW_ITEM_SEND_BACK_PATH = 'sendback';
|
||||||
|
export const WORKFLOW_SELECT_REVIEWER_PATH = 'selectreviewer';
|
||||||
|
export const WORKFLOW_RATING_REVIEWER_PATH = 'ratingreviewer';
|
||||||
|
@@ -7,7 +7,9 @@ import {
|
|||||||
WORKFLOW_ITEM_DELETE_PATH,
|
WORKFLOW_ITEM_DELETE_PATH,
|
||||||
WORKFLOW_ITEM_EDIT_PATH,
|
WORKFLOW_ITEM_EDIT_PATH,
|
||||||
WORKFLOW_ITEM_SEND_BACK_PATH,
|
WORKFLOW_ITEM_SEND_BACK_PATH,
|
||||||
WORKFLOW_ITEM_VIEW_PATH
|
WORKFLOW_ITEM_VIEW_PATH,
|
||||||
|
WORKFLOW_SELECT_REVIEWER_PATH,
|
||||||
|
WORKFLOW_RATING_REVIEWER_PATH,
|
||||||
} from './workflowitems-edit-page-routing-paths';
|
} from './workflowitems-edit-page-routing-paths';
|
||||||
import { ThemedSubmissionEditComponent } from '../submission/edit/themed-submission-edit.component';
|
import { ThemedSubmissionEditComponent } from '../submission/edit/themed-submission-edit.component';
|
||||||
import { ThemedWorkflowItemDeleteComponent } from './workflow-item-delete/themed-workflow-item-delete.component';
|
import { ThemedWorkflowItemDeleteComponent } from './workflow-item-delete/themed-workflow-item-delete.component';
|
||||||
@@ -59,7 +61,25 @@ import { ThemedFullItemPageComponent } from '../item-page/full/themed-full-item-
|
|||||||
breadcrumb: I18nBreadcrumbResolver
|
breadcrumb: I18nBreadcrumbResolver
|
||||||
},
|
},
|
||||||
data: { title: 'workflow-item.send-back.title', breadcrumbKey: 'workflow-item.edit' }
|
data: { title: 'workflow-item.send-back.title', breadcrumbKey: 'workflow-item.edit' }
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
canActivate: [AuthenticatedGuard],
|
||||||
|
path: WORKFLOW_SELECT_REVIEWER_PATH,
|
||||||
|
component: ThemedWorkflowItemSendBackComponent,
|
||||||
|
resolve: {
|
||||||
|
breadcrumb: I18nBreadcrumbResolver
|
||||||
|
},
|
||||||
|
data: { title: 'workflow-item.select-reviewer.title', breadcrumbKey: 'workflow-item.edit' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
canActivate: [AuthenticatedGuard],
|
||||||
|
path: WORKFLOW_RATING_REVIEWER_PATH,
|
||||||
|
component: ThemedWorkflowItemSendBackComponent,
|
||||||
|
resolve: {
|
||||||
|
breadcrumb: I18nBreadcrumbResolver
|
||||||
|
},
|
||||||
|
data: { title: 'workflow-item.rating-reviewer.title', breadcrumbKey: 'workflow-item.edit' }
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}]
|
}]
|
||||||
)
|
)
|
||||||
|
@@ -4003,6 +4003,15 @@
|
|||||||
"submission.workflow.generic.view-help": "Select this option to view the item's metadata.",
|
"submission.workflow.generic.view-help": "Select this option to view the item's metadata.",
|
||||||
|
|
||||||
|
|
||||||
|
"submission.workflow.generic.submit_select_reviewer": "Select Reviewer",
|
||||||
|
|
||||||
|
"submission.workflow.generic.submit_select_reviewer-help": "",
|
||||||
|
|
||||||
|
|
||||||
|
"submission.workflow.generic.submit_rating_reviewer": "Rating Reviewer",
|
||||||
|
|
||||||
|
"submission.workflow.generic.submit_rating_reviewer-help": "",
|
||||||
|
|
||||||
|
|
||||||
"submission.workflow.tasks.claimed.approve": "Approve",
|
"submission.workflow.tasks.claimed.approve": "Approve",
|
||||||
|
|
||||||
@@ -4156,6 +4165,12 @@
|
|||||||
"workflow-item.view.breadcrumbs": "Workflow View",
|
"workflow-item.view.breadcrumbs": "Workflow View",
|
||||||
|
|
||||||
|
|
||||||
|
"workflow-item.select-reviewer.title": "Select Reviewer",
|
||||||
|
|
||||||
|
|
||||||
|
"workflow-item.rating-reviewer.title": "Rating Reviewer",
|
||||||
|
|
||||||
|
|
||||||
"idle-modal.header": "Session will expire soon",
|
"idle-modal.header": "Session will expire soon",
|
||||||
|
|
||||||
"idle-modal.info": "For security reasons, user sessions expire after {{ timeToExpire }} minutes of inactivity. Your session will expire soon. Would you like to extend it or log out?",
|
"idle-modal.info": "For security reasons, user sessions expire after {{ timeToExpire }} minutes of inactivity. Your session will expire soon. Would you like to extend it or log out?",
|
||||||
|
Reference in New Issue
Block a user