115215: Removed hardcoded options in favor of the ones from ClaimedTaskActionsLoaderComponent & AdvancedWorkflowActionsLoaderComponent

This commit is contained in:
Alexandre Vryghem
2024-05-20 21:03:10 +02:00
parent 2d957bfa37
commit d7be627c89
9 changed files with 7 additions and 38 deletions

View File

@@ -38,7 +38,7 @@ export abstract class ClaimedTaskActionsAbstractComponent extends MyDSpaceReload
/**
* The workflow task option the child component represents
*/
abstract option: string;
@Input() option: string;
object: ClaimedTask;

View File

@@ -38,10 +38,6 @@ export const WORKFLOW_TASK_OPTION_APPROVE = 'submit_approve';
* Component for displaying and processing the approve action on a workflow task item
*/
export class ClaimedTaskActionsApproveComponent extends ClaimedTaskActionsAbstractComponent {
/**
* This component represents the approve option
*/
option = WORKFLOW_TASK_OPTION_APPROVE;
constructor(protected injector: Injector,
protected router: Router,

View File

@@ -39,8 +39,6 @@ export const WORKFLOW_TASK_OPTION_DECLINE_TASK = 'submit_decline_task';
*/
export class ClaimedTaskActionsDeclineTaskComponent extends ClaimedTaskActionsAbstractComponent {
option = WORKFLOW_TASK_OPTION_DECLINE_TASK;
constructor(protected injector: Injector,
protected router: Router,
protected notificationsService: NotificationsService,

View File

@@ -34,10 +34,6 @@ export const WORKFLOW_TASK_OPTION_EDIT_METADATA = 'submit_edit_metadata';
* Component for displaying the edit metadata action on a workflow task item
*/
export class ClaimedTaskActionsEditMetadataComponent extends ClaimedTaskActionsAbstractComponent {
/**
* This component represents the edit metadata option
*/
option = WORKFLOW_TASK_OPTION_EDIT_METADATA;
constructor(protected injector: Injector,
protected router: Router,

View File

@@ -14,10 +14,7 @@ import {
import { RequestService } from '../../../../core/data/request.service';
import { SearchService } from '../../../../core/shared/search/search.service';
import {
ADVANCED_WORKFLOW_ACTION_RATING,
ADVANCED_WORKFLOW_TASK_OPTION_RATING,
} from '../../../../workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component';
import { ADVANCED_WORKFLOW_ACTION_RATING } from '../../../../workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component';
import { NotificationsService } from '../../../notifications/notifications.service';
import { AdvancedClaimedTaskActionsAbstractComponent } from '../abstract/advanced-claimed-task-actions-abstract.component';
@@ -33,11 +30,6 @@ import { AdvancedClaimedTaskActionsAbstractComponent } from '../abstract/advance
})
export class AdvancedClaimedTaskActionRatingComponent extends AdvancedClaimedTaskActionsAbstractComponent {
/**
* This component represents the advanced select option
*/
option = ADVANCED_WORKFLOW_TASK_OPTION_RATING;
workflowType = ADVANCED_WORKFLOW_ACTION_RATING;
constructor(

View File

@@ -50,10 +50,6 @@ export const WORKFLOW_TASK_OPTION_REJECT = 'submit_reject';
* Component for displaying and processing the reject action on a workflow task item
*/
export class ClaimedTaskActionsRejectComponent extends ClaimedTaskActionsAbstractComponent implements OnInit {
/**
* This component represents the reject option
*/
option = WORKFLOW_TASK_OPTION_REJECT;
/**
* The reject form group

View File

@@ -36,10 +36,6 @@ export const WORKFLOW_TASK_OPTION_RETURN_TO_POOL = 'return_to_pool';
* Component for displaying and processing the return to pool action on a workflow task item
*/
export class ClaimedTaskActionsReturnToPoolComponent extends ClaimedTaskActionsAbstractComponent {
/**
* This component represents the return to pool option
*/
option = WORKFLOW_TASK_OPTION_RETURN_TO_POOL;
constructor(protected injector: Injector,
protected router: Router,

View File

@@ -14,10 +14,7 @@ import {
import { RequestService } from '../../../../core/data/request.service';
import { SearchService } from '../../../../core/shared/search/search.service';
import {
ADVANCED_WORKFLOW_ACTION_SELECT_REVIEWER,
ADVANCED_WORKFLOW_TASK_OPTION_SELECT_REVIEWER,
} from '../../../../workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component';
import { ADVANCED_WORKFLOW_ACTION_SELECT_REVIEWER } from '../../../../workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component';
import { NotificationsService } from '../../../notifications/notifications.service';
import { AdvancedClaimedTaskActionsAbstractComponent } from '../abstract/advanced-claimed-task-actions-abstract.component';
@@ -33,11 +30,6 @@ import { AdvancedClaimedTaskActionsAbstractComponent } from '../abstract/advance
})
export class AdvancedClaimedTaskActionSelectReviewerComponent extends AdvancedClaimedTaskActionsAbstractComponent {
/**
* This component represents the advanced select option
*/
option = ADVANCED_WORKFLOW_TASK_OPTION_SELECT_REVIEWER;
workflowType = ADVANCED_WORKFLOW_ACTION_SELECT_REVIEWER;
constructor(

View File

@@ -1,6 +1,7 @@
import { Location } from '@angular/common';
import {
Directive,
Input,
OnInit,
} from '@angular/core';
import {
@@ -42,7 +43,9 @@ import { NotificationsService } from '../shared/notifications/notifications.serv
standalone: true,
})
export abstract class WorkflowItemActionPageDirective implements OnInit {
public type;
@Input() type: string;
public wfi$: Observable<WorkflowItem>;
public item$: Observable<Item>;
protected previousQueryParameters?: Params;