mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-09 19:13:08 +00:00
98211: Created advanced workflow task pages
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-advanced-workflow-action-abstract',
|
||||||
|
template: '',
|
||||||
|
})
|
||||||
|
export abstract class AdvancedWorkflowActionAbstractComponent {
|
||||||
|
}
|
@@ -1,4 +1,4 @@
|
|||||||
<button class="btn btn-primary" ngbTooltip="{{ 'submission.workflow.generic.' + option + '-help' | translate }}"
|
<button class="btn btn-primary" ngbTooltip="{{ 'submission.workflow.generic.' + option + '-help' | translate }}"
|
||||||
[routerLink]="workflowTaskPageRoute">
|
[routerLink]="workflowTaskPageRoute" [queryParams]="{ workflow: workflowType }">
|
||||||
<i class="fa fa-user"></i> {{ 'submission.workflow.generic.' + option | translate}}
|
<i class="fa fa-user"></i> {{ 'submission.workflow.generic.' + option | translate}}
|
||||||
</button>
|
</button>
|
||||||
|
@@ -4,12 +4,13 @@ import { NotificationsService } from '../../../notifications/notifications.servi
|
|||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { SearchService } from '../../../../core/shared/search/search.service';
|
import { SearchService } from '../../../../core/shared/search/search.service';
|
||||||
import { RequestService } from '../../../../core/data/request.service';
|
import { RequestService } from '../../../../core/data/request.service';
|
||||||
import {
|
import { getAdvancedWorkflowRoute } from '../../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths';
|
||||||
getWorkflowRatingReviewerRoute
|
|
||||||
} from '../../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths';
|
|
||||||
import {
|
import {
|
||||||
AdvancedClaimedTaskActionsAbstractComponent
|
AdvancedClaimedTaskActionsAbstractComponent
|
||||||
} from '../abstract/advanced-claimed-task-actions-abstract.component';
|
} from '../abstract/advanced-claimed-task-actions-abstract.component';
|
||||||
|
import {
|
||||||
|
ADVANCED_WORKFLOW_ACTION_RATING_REVIEWER
|
||||||
|
} from '../../../../workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating-reviewer/advanced-workflow-action-rating-reviewer.component';
|
||||||
|
|
||||||
export const WORKFLOW_ADVANCED_TASK_OPTION_RATING_REVIEWER = 'submit_rating_reviewer';
|
export const WORKFLOW_ADVANCED_TASK_OPTION_RATING_REVIEWER = 'submit_rating_reviewer';
|
||||||
|
|
||||||
@@ -25,6 +26,8 @@ export class AdvancedClaimedTaskActionRatingReviewerComponent extends AdvancedCl
|
|||||||
*/
|
*/
|
||||||
option = WORKFLOW_ADVANCED_TASK_OPTION_RATING_REVIEWER;
|
option = WORKFLOW_ADVANCED_TASK_OPTION_RATING_REVIEWER;
|
||||||
|
|
||||||
|
workflowType = ADVANCED_WORKFLOW_ACTION_RATING_REVIEWER;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Route to the workflow's task page
|
* Route to the workflow's task page
|
||||||
*/
|
*/
|
||||||
@@ -48,8 +51,8 @@ export class AdvancedClaimedTaskActionRatingReviewerComponent extends AdvancedCl
|
|||||||
/**
|
/**
|
||||||
* Initialise the route to the rating reviewer's page
|
* Initialise the route to the rating reviewer's page
|
||||||
*/
|
*/
|
||||||
initPageRoute() {
|
initPageRoute(): void {
|
||||||
this.workflowTaskPageRoute = getWorkflowRatingReviewerRoute(this.object.id);
|
this.workflowTaskPageRoute = getAdvancedWorkflowRoute(this.object.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
<button class="btn btn-primary" ngbTooltip="{{ 'submission.workflow.generic.' + option + '-help' | translate }}"
|
<button class="btn btn-primary" ngbTooltip="{{ 'submission.workflow.generic.' + option + '-help' | translate }}"
|
||||||
[routerLink]="workflowTaskPageRoute">
|
[routerLink]="workflowTaskPageRoute" [queryParams]="{ workflow: workflowType }">
|
||||||
<i class="fa fa-user"></i> {{ 'submission.workflow.generic.' + option | translate}}
|
<i class="fa fa-user"></i> {{ 'submission.workflow.generic.' + option | translate}}
|
||||||
</button>
|
</button>
|
||||||
|
@@ -8,9 +8,10 @@ import { NotificationsService } from '../../../notifications/notifications.servi
|
|||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { SearchService } from '../../../../core/shared/search/search.service';
|
import { SearchService } from '../../../../core/shared/search/search.service';
|
||||||
import { RequestService } from '../../../../core/data/request.service';
|
import { RequestService } from '../../../../core/data/request.service';
|
||||||
|
import { getAdvancedWorkflowRoute } from '../../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths';
|
||||||
import {
|
import {
|
||||||
getWorkflowSelectReviewerRoute
|
ADVANCED_WORKFLOW_ACTION_SELECT_REVIEWER
|
||||||
} from '../../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths';
|
} from '../../../../workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component';
|
||||||
|
|
||||||
export const WORKFLOW_ADVANCED_TASK_OPTION_SELECT_REVIEWER = 'submit_select_reviewer';
|
export const WORKFLOW_ADVANCED_TASK_OPTION_SELECT_REVIEWER = 'submit_select_reviewer';
|
||||||
|
|
||||||
@@ -27,6 +28,8 @@ export class AdvancedClaimedTaskActionSelectReviewerComponent extends AdvancedCl
|
|||||||
*/
|
*/
|
||||||
option = WORKFLOW_ADVANCED_TASK_OPTION_SELECT_REVIEWER;
|
option = WORKFLOW_ADVANCED_TASK_OPTION_SELECT_REVIEWER;
|
||||||
|
|
||||||
|
workflowType = ADVANCED_WORKFLOW_ACTION_SELECT_REVIEWER;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Route to the workflow's task page
|
* Route to the workflow's task page
|
||||||
*/
|
*/
|
||||||
@@ -51,7 +54,7 @@ export class AdvancedClaimedTaskActionSelectReviewerComponent extends AdvancedCl
|
|||||||
* Initialise the route to the select reviewer's page
|
* Initialise the route to the select reviewer's page
|
||||||
*/
|
*/
|
||||||
initPageRoute() {
|
initPageRoute() {
|
||||||
this.workflowTaskPageRoute = getWorkflowSelectReviewerRoute(this.object.id);
|
this.workflowTaskPageRoute = getAdvancedWorkflowRoute(this.object.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,23 +1,44 @@
|
|||||||
import { hasNoValue } from '../../../empty.util';
|
import { hasNoValue } from '../../../empty.util';
|
||||||
|
|
||||||
const map = new Map();
|
const workflowOptions = new Map();
|
||||||
|
const advancedWorkflowOptions = new Map();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decorator used for rendering ClaimedTaskActions pages by option type
|
* Decorator used for rendering ClaimedTaskActions pages by option type
|
||||||
*/
|
*/
|
||||||
export function rendersWorkflowTaskOption(option: string) {
|
export function rendersWorkflowTaskOption(option: string) {
|
||||||
return function decorator(component: any) {
|
return function decorator(component: any) {
|
||||||
if (hasNoValue(map.get(option))) {
|
if (hasNoValue(workflowOptions.get(option))) {
|
||||||
map.set(option, component);
|
workflowOptions.set(option, component);
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`There can't be more than one component to render ClaimedTaskActions for option "${option}"`);
|
throw new Error(`There can't be more than one component to render ClaimedTaskActions for option "${option}"`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decorator used for rendering AdvancedClaimedTaskActions pages by option type
|
||||||
|
*/
|
||||||
|
export function rendersAdvancedWorkflowTaskOption(option: string) {
|
||||||
|
return function decorator(component: any) {
|
||||||
|
if (hasNoValue(advancedWorkflowOptions.get(option))) {
|
||||||
|
advancedWorkflowOptions.set(option, component);
|
||||||
|
} else {
|
||||||
|
throw new Error(`There can't be more than one component to render AdvancedClaimedTaskActions for option "${option}"`);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the component used for rendering a ClaimedTaskActions page by option type
|
* Get the component used for rendering a ClaimedTaskActions page by option type
|
||||||
*/
|
*/
|
||||||
export function getComponentByWorkflowTaskOption(option: string) {
|
export function getComponentByWorkflowTaskOption(option: string) {
|
||||||
return map.get(option);
|
return workflowOptions.get(option);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the component used for rendering a AdvancedClaimedTaskActions page by option type
|
||||||
|
*/
|
||||||
|
export function getAdvancedComponentByWorkflowTaskOption(option: string) {
|
||||||
|
return advancedWorkflowOptions.get(option);
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,5 @@
|
|||||||
|
<div class="container">
|
||||||
|
<h2>{{'workflow-item.' + type + '.header' | translate}}</h2>
|
||||||
|
<ds-advanced-workflow-actions-loader [type]="type">
|
||||||
|
</ds-advanced-workflow-actions-loader>
|
||||||
|
</div>
|
@@ -0,0 +1,25 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
import { AdvancedWorkflowActionPageComponent } from './advanced-workflow-action-page.component';
|
||||||
|
|
||||||
|
describe('AdvancedWorkflowActionPageComponent', () => {
|
||||||
|
let component: AdvancedWorkflowActionPageComponent;
|
||||||
|
let fixture: ComponentFixture<AdvancedWorkflowActionPageComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [
|
||||||
|
AdvancedWorkflowActionPageComponent,
|
||||||
|
],
|
||||||
|
}).compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(AdvancedWorkflowActionPageComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
@@ -0,0 +1,22 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-advanced-workflow-action-page',
|
||||||
|
templateUrl: './advanced-workflow-action-page.component.html',
|
||||||
|
styleUrls: ['./advanced-workflow-action-page.component.scss']
|
||||||
|
})
|
||||||
|
export class AdvancedWorkflowActionPageComponent implements OnInit {
|
||||||
|
|
||||||
|
public type: string;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
protected route: ActivatedRoute,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.type = this.route.snapshot.queryParams.workflow;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1 @@
|
|||||||
|
<p>advanced-workflow-action-rating-reviewer works!</p>
|
@@ -0,0 +1,25 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { AdvancedWorkflowActionRatingReviewerComponent } from './advanced-workflow-action-rating-reviewer.component';
|
||||||
|
|
||||||
|
describe('AdvancedWorkflowActionRatingReviewerComponent', () => {
|
||||||
|
let component: AdvancedWorkflowActionRatingReviewerComponent;
|
||||||
|
let fixture: ComponentFixture<AdvancedWorkflowActionRatingReviewerComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [ AdvancedWorkflowActionRatingReviewerComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(AdvancedWorkflowActionRatingReviewerComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
@@ -0,0 +1,15 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import {
|
||||||
|
rendersAdvancedWorkflowTaskOption
|
||||||
|
} from '../../../shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-decorator';
|
||||||
|
|
||||||
|
export const ADVANCED_WORKFLOW_ACTION_RATING_REVIEWER = 'ratingrevieweraction';
|
||||||
|
|
||||||
|
@rendersAdvancedWorkflowTaskOption(ADVANCED_WORKFLOW_ACTION_RATING_REVIEWER)
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-advanced-workflow-action-rating-reviewer',
|
||||||
|
templateUrl: './advanced-workflow-action-rating-reviewer.component.html',
|
||||||
|
styleUrls: ['./advanced-workflow-action-rating-reviewer.component.scss']
|
||||||
|
})
|
||||||
|
export class AdvancedWorkflowActionRatingReviewerComponent {
|
||||||
|
}
|
@@ -0,0 +1 @@
|
|||||||
|
advancedInfo: {{ (workflowAction | async)?.advancedInfo | json }}
|
@@ -0,0 +1,25 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { AdvancedWorkflowActionSelectReviewerComponent } from './advanced-workflow-action-select-reviewer.component';
|
||||||
|
|
||||||
|
describe('AdvancedWorkflowActionSelectReviewerComponent', () => {
|
||||||
|
let component: AdvancedWorkflowActionSelectReviewerComponent;
|
||||||
|
let fixture: ComponentFixture<AdvancedWorkflowActionSelectReviewerComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [ AdvancedWorkflowActionSelectReviewerComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(AdvancedWorkflowActionSelectReviewerComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
@@ -0,0 +1,16 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import {
|
||||||
|
rendersAdvancedWorkflowTaskOption
|
||||||
|
} from '../../../shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-decorator';
|
||||||
|
import { AdvancedWorkflowActionComponent } from '../advanced-workflow-action/advanced-workflow-action.component';
|
||||||
|
|
||||||
|
export const ADVANCED_WORKFLOW_ACTION_SELECT_REVIEWER = 'selectrevieweraction';
|
||||||
|
|
||||||
|
@rendersAdvancedWorkflowTaskOption(ADVANCED_WORKFLOW_ACTION_SELECT_REVIEWER)
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-advanced-workflow-action-select-reviewer',
|
||||||
|
templateUrl: './advanced-workflow-action-select-reviewer.component.html',
|
||||||
|
styleUrls: ['./advanced-workflow-action-select-reviewer.component.scss'],
|
||||||
|
})
|
||||||
|
export class AdvancedWorkflowActionSelectReviewerComponent extends AdvancedWorkflowActionComponent {
|
||||||
|
}
|
@@ -0,0 +1 @@
|
|||||||
|
<p>advanced-workflow-action works!</p>
|
@@ -0,0 +1,25 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { AdvancedWorkflowActionComponent } from './advanced-workflow-action.component';
|
||||||
|
|
||||||
|
describe('AdvancedWorkflowActionComponent', () => {
|
||||||
|
let component: AdvancedWorkflowActionComponent;
|
||||||
|
let fixture: ComponentFixture<AdvancedWorkflowActionComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [ AdvancedWorkflowActionComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(AdvancedWorkflowActionComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
@@ -0,0 +1,29 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { WorkflowAction } from '../../../core/tasks/models/workflow-action-object.model';
|
||||||
|
import { WorkflowActionDataService } from '../../../core/data/workflow-action-data.service';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { getFirstSucceededRemoteDataPayload } from '../../../core/shared/operators';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-advanced-workflow-action',
|
||||||
|
templateUrl: './advanced-workflow-action.component.html',
|
||||||
|
styleUrls: ['./advanced-workflow-action.component.scss']
|
||||||
|
})
|
||||||
|
export class AdvancedWorkflowActionComponent implements OnInit {
|
||||||
|
|
||||||
|
workflowAction: Observable<WorkflowAction>;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
protected route: ActivatedRoute,
|
||||||
|
protected workflowActionService: WorkflowActionDataService,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.workflowAction = this.workflowActionService.findById(this.route.snapshot.queryParams.workflow).pipe(
|
||||||
|
getFirstSucceededRemoteDataPayload(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,16 @@
|
|||||||
|
import { Directive, ViewContainerRef } from '@angular/core';
|
||||||
|
|
||||||
|
@Directive({
|
||||||
|
selector: '[dsAdvancedClaimedTaskActions]',
|
||||||
|
})
|
||||||
|
/**
|
||||||
|
* Directive used as a hook to know where to inject the dynamic Advanced Claimed Task Actions component
|
||||||
|
*/
|
||||||
|
export class AdvancedClaimedTaskActionsDirective {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
public viewContainerRef: ViewContainerRef,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1 @@
|
|||||||
|
<ng-template dsAdvancedClaimedTaskActions></ng-template>
|
@@ -0,0 +1,25 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
import { AdvancedWorkflowActionsLoaderComponent } from './advanced-workflow-actions-loader.component';
|
||||||
|
|
||||||
|
describe('AdvancedWorkflowActionsLoaderComponent', () => {
|
||||||
|
let component: AdvancedWorkflowActionsLoaderComponent;
|
||||||
|
let fixture: ComponentFixture<AdvancedWorkflowActionsLoaderComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [
|
||||||
|
AdvancedWorkflowActionsLoaderComponent,
|
||||||
|
],
|
||||||
|
}).compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(AdvancedWorkflowActionsLoaderComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
@@ -0,0 +1,54 @@
|
|||||||
|
import { Component, Input, ViewChild, ComponentFactoryResolver, OnInit } from '@angular/core';
|
||||||
|
import { hasValue } from '../../../shared/empty.util';
|
||||||
|
import {
|
||||||
|
getAdvancedComponentByWorkflowTaskOption
|
||||||
|
} from '../../../shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-decorator';
|
||||||
|
import { AdvancedClaimedTaskActionsDirective } from './advanced-claimed-task-actions.directive';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { PAGE_NOT_FOUND_PATH } from '../../../app-routing-paths';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-advanced-workflow-actions-loader',
|
||||||
|
templateUrl: './advanced-workflow-actions-loader.component.html',
|
||||||
|
styleUrls: ['./advanced-workflow-actions-loader.component.scss'],
|
||||||
|
})
|
||||||
|
export class AdvancedWorkflowActionsLoaderComponent implements OnInit {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name of the type to render
|
||||||
|
* Passed on to the decorator to fetch the relevant component for this option
|
||||||
|
*/
|
||||||
|
@Input() type: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Directive to determine where the dynamic child component is located
|
||||||
|
*/
|
||||||
|
@ViewChild(AdvancedClaimedTaskActionsDirective, { static: true }) claimedTaskActionsDirective: AdvancedClaimedTaskActionsDirective;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private componentFactoryResolver: ComponentFactoryResolver,
|
||||||
|
private router: Router,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch, create and initialize the relevant component
|
||||||
|
*/
|
||||||
|
ngOnInit(): void {
|
||||||
|
const comp = this.getComponentByWorkflowTaskOption(this.type);
|
||||||
|
if (hasValue(comp)) {
|
||||||
|
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(comp);
|
||||||
|
|
||||||
|
const viewContainerRef = this.claimedTaskActionsDirective.viewContainerRef;
|
||||||
|
viewContainerRef.clear();
|
||||||
|
viewContainerRef.createComponent(componentFactory);
|
||||||
|
} else {
|
||||||
|
void this.router.navigate([PAGE_NOT_FOUND_PATH]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getComponentByWorkflowTaskOption(option: string) {
|
||||||
|
return getAdvancedComponentByWorkflowTaskOption(option);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -1,6 +1,5 @@
|
|||||||
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();
|
||||||
@@ -21,16 +20,12 @@ 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) {
|
export function getAdvancedWorkflowRoute(wfiId: string) {
|
||||||
return new URLCombiner(getWorkflowItemModuleRoute(), wfiId, WORKFLOW_SELECT_REVIEWER_PATH).toString();
|
return new URLCombiner(getWorkflowItemModuleRoute(), wfiId, ADVANCED_WORKFLOW_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 ADVANCED_WORKFLOW_PATH = 'advanced';
|
||||||
export const WORKFLOW_RATING_REVIEWER_PATH = 'ratingreviewer';
|
|
||||||
|
@@ -8,8 +8,7 @@ import {
|
|||||||
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,
|
ADVANCED_WORKFLOW_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';
|
||||||
@@ -17,6 +16,9 @@ import { ThemedWorkflowItemSendBackComponent } from './workflow-item-send-back/t
|
|||||||
import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
|
import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||||
import { ItemFromWorkflowResolver } from './item-from-workflow.resolver';
|
import { ItemFromWorkflowResolver } from './item-from-workflow.resolver';
|
||||||
import { ThemedFullItemPageComponent } from '../item-page/full/themed-full-item-page.component';
|
import { ThemedFullItemPageComponent } from '../item-page/full/themed-full-item-page.component';
|
||||||
|
import {
|
||||||
|
AdvancedWorkflowActionPageComponent
|
||||||
|
} from './advanced-workflow-action/advanced-workflow-action-page/advanced-workflow-action-page.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -64,21 +66,12 @@ import { ThemedFullItemPageComponent } from '../item-page/full/themed-full-item-
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
canActivate: [AuthenticatedGuard],
|
canActivate: [AuthenticatedGuard],
|
||||||
path: WORKFLOW_SELECT_REVIEWER_PATH,
|
path: ADVANCED_WORKFLOW_PATH,
|
||||||
component: ThemedWorkflowItemSendBackComponent,
|
component: AdvancedWorkflowActionPageComponent,
|
||||||
resolve: {
|
resolve: {
|
||||||
breadcrumb: I18nBreadcrumbResolver
|
breadcrumb: I18nBreadcrumbResolver
|
||||||
},
|
},
|
||||||
data: { title: 'workflow-item.select-reviewer.title', breadcrumbKey: 'workflow-item.edit' }
|
data: { title: 'workflow-item.advanced.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' }
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}]
|
}]
|
||||||
|
@@ -9,6 +9,16 @@ import { ThemedWorkflowItemDeleteComponent } from './workflow-item-delete/themed
|
|||||||
import { ThemedWorkflowItemSendBackComponent } from './workflow-item-send-back/themed-workflow-item-send-back.component';
|
import { ThemedWorkflowItemSendBackComponent } from './workflow-item-send-back/themed-workflow-item-send-back.component';
|
||||||
import { StatisticsModule } from '../statistics/statistics.module';
|
import { StatisticsModule } from '../statistics/statistics.module';
|
||||||
import { ItemPageModule } from '../item-page/item-page.module';
|
import { ItemPageModule } from '../item-page/item-page.module';
|
||||||
|
import {
|
||||||
|
AdvancedWorkflowActionsLoaderComponent
|
||||||
|
} from './advanced-workflow-action/advanced-workflow-actions-loader/advanced-workflow-actions-loader.component';
|
||||||
|
import { AdvancedWorkflowActionRatingReviewerComponent } from './advanced-workflow-action/advanced-workflow-action-rating-reviewer/advanced-workflow-action-rating-reviewer.component';
|
||||||
|
import { AdvancedWorkflowActionSelectReviewerComponent } from './advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component';
|
||||||
|
import { AdvancedWorkflowActionPageComponent } from './advanced-workflow-action/advanced-workflow-action-page/advanced-workflow-action-page.component';
|
||||||
|
import {
|
||||||
|
AdvancedClaimedTaskActionsDirective
|
||||||
|
} from './advanced-workflow-action/advanced-workflow-actions-loader/advanced-claimed-task-actions.directive';
|
||||||
|
import { AdvancedWorkflowActionComponent } from './advanced-workflow-action/advanced-workflow-action/advanced-workflow-action.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -23,7 +33,13 @@ import { ItemPageModule } from '../item-page/item-page.module';
|
|||||||
WorkflowItemDeleteComponent,
|
WorkflowItemDeleteComponent,
|
||||||
ThemedWorkflowItemDeleteComponent,
|
ThemedWorkflowItemDeleteComponent,
|
||||||
WorkflowItemSendBackComponent,
|
WorkflowItemSendBackComponent,
|
||||||
ThemedWorkflowItemSendBackComponent
|
ThemedWorkflowItemSendBackComponent,
|
||||||
|
AdvancedWorkflowActionsLoaderComponent,
|
||||||
|
AdvancedWorkflowActionRatingReviewerComponent,
|
||||||
|
AdvancedWorkflowActionSelectReviewerComponent,
|
||||||
|
AdvancedWorkflowActionPageComponent,
|
||||||
|
AdvancedClaimedTaskActionsDirective,
|
||||||
|
AdvancedWorkflowActionComponent,
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
|
@@ -4164,11 +4164,11 @@
|
|||||||
|
|
||||||
"workflow-item.view.breadcrumbs": "Workflow View",
|
"workflow-item.view.breadcrumbs": "Workflow View",
|
||||||
|
|
||||||
|
"workflow-item.advanced.title": "Advanced workflow",
|
||||||
|
|
||||||
"workflow-item.select-reviewer.title": "Select Reviewer",
|
"workflow-item.selectrevieweraction.header": "Select Reviewer",
|
||||||
|
|
||||||
|
"workflow-item.ratingrevieweraction.header": "Rating Reviewer",
|
||||||
"workflow-item.rating-reviewer.title": "Rating Reviewer",
|
|
||||||
|
|
||||||
|
|
||||||
"idle-modal.header": "Session will expire soon",
|
"idle-modal.header": "Session will expire soon",
|
||||||
|
@@ -178,6 +178,9 @@ const DECLARATIONS = [
|
|||||||
ResourcePoliciesModule,
|
ResourcePoliciesModule,
|
||||||
ComcolModule
|
ComcolModule
|
||||||
],
|
],
|
||||||
|
exports: [
|
||||||
|
FullItemPageComponent
|
||||||
|
],
|
||||||
declarations: DECLARATIONS
|
declarations: DECLARATIONS
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user