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 * The workflow task option the child component represents
*/ */
abstract option: string; @Input() option: string;
object: ClaimedTask; 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 * Component for displaying and processing the approve action on a workflow task item
*/ */
export class ClaimedTaskActionsApproveComponent extends ClaimedTaskActionsAbstractComponent { export class ClaimedTaskActionsApproveComponent extends ClaimedTaskActionsAbstractComponent {
/**
* This component represents the approve option
*/
option = WORKFLOW_TASK_OPTION_APPROVE;
constructor(protected injector: Injector, constructor(protected injector: Injector,
protected router: Router, protected router: Router,

View File

@@ -39,8 +39,6 @@ export const WORKFLOW_TASK_OPTION_DECLINE_TASK = 'submit_decline_task';
*/ */
export class ClaimedTaskActionsDeclineTaskComponent extends ClaimedTaskActionsAbstractComponent { export class ClaimedTaskActionsDeclineTaskComponent extends ClaimedTaskActionsAbstractComponent {
option = WORKFLOW_TASK_OPTION_DECLINE_TASK;
constructor(protected injector: Injector, constructor(protected injector: Injector,
protected router: Router, protected router: Router,
protected notificationsService: NotificationsService, 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 * Component for displaying the edit metadata action on a workflow task item
*/ */
export class ClaimedTaskActionsEditMetadataComponent extends ClaimedTaskActionsAbstractComponent { export class ClaimedTaskActionsEditMetadataComponent extends ClaimedTaskActionsAbstractComponent {
/**
* This component represents the edit metadata option
*/
option = WORKFLOW_TASK_OPTION_EDIT_METADATA;
constructor(protected injector: Injector, constructor(protected injector: Injector,
protected router: Router, protected router: Router,

View File

@@ -14,10 +14,7 @@ import {
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 { import { ADVANCED_WORKFLOW_ACTION_RATING } from '../../../../workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component';
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 { NotificationsService } from '../../../notifications/notifications.service'; import { NotificationsService } from '../../../notifications/notifications.service';
import { AdvancedClaimedTaskActionsAbstractComponent } from '../abstract/advanced-claimed-task-actions-abstract.component'; import { AdvancedClaimedTaskActionsAbstractComponent } from '../abstract/advanced-claimed-task-actions-abstract.component';
@@ -33,11 +30,6 @@ import { AdvancedClaimedTaskActionsAbstractComponent } from '../abstract/advance
}) })
export class AdvancedClaimedTaskActionRatingComponent extends AdvancedClaimedTaskActionsAbstractComponent { export class AdvancedClaimedTaskActionRatingComponent extends AdvancedClaimedTaskActionsAbstractComponent {
/**
* This component represents the advanced select option
*/
option = ADVANCED_WORKFLOW_TASK_OPTION_RATING;
workflowType = ADVANCED_WORKFLOW_ACTION_RATING; workflowType = ADVANCED_WORKFLOW_ACTION_RATING;
constructor( 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 * Component for displaying and processing the reject action on a workflow task item
*/ */
export class ClaimedTaskActionsRejectComponent extends ClaimedTaskActionsAbstractComponent implements OnInit { export class ClaimedTaskActionsRejectComponent extends ClaimedTaskActionsAbstractComponent implements OnInit {
/**
* This component represents the reject option
*/
option = WORKFLOW_TASK_OPTION_REJECT;
/** /**
* The reject form group * 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 * Component for displaying and processing the return to pool action on a workflow task item
*/ */
export class ClaimedTaskActionsReturnToPoolComponent extends ClaimedTaskActionsAbstractComponent { export class ClaimedTaskActionsReturnToPoolComponent extends ClaimedTaskActionsAbstractComponent {
/**
* This component represents the return to pool option
*/
option = WORKFLOW_TASK_OPTION_RETURN_TO_POOL;
constructor(protected injector: Injector, constructor(protected injector: Injector,
protected router: Router, protected router: Router,

View File

@@ -14,10 +14,7 @@ import {
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 { import { ADVANCED_WORKFLOW_ACTION_SELECT_REVIEWER } from '../../../../workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component';
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 { NotificationsService } from '../../../notifications/notifications.service'; import { NotificationsService } from '../../../notifications/notifications.service';
import { AdvancedClaimedTaskActionsAbstractComponent } from '../abstract/advanced-claimed-task-actions-abstract.component'; import { AdvancedClaimedTaskActionsAbstractComponent } from '../abstract/advanced-claimed-task-actions-abstract.component';
@@ -33,11 +30,6 @@ import { AdvancedClaimedTaskActionsAbstractComponent } from '../abstract/advance
}) })
export class AdvancedClaimedTaskActionSelectReviewerComponent extends AdvancedClaimedTaskActionsAbstractComponent { 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; workflowType = ADVANCED_WORKFLOW_ACTION_SELECT_REVIEWER;
constructor( constructor(

View File

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