98211: Added advanced workflow models

This commit is contained in:
Alexandre Vryghem
2023-01-03 16:15:59 +01:00
parent e4f483c308
commit 1cf0f97121
6 changed files with 112 additions and 0 deletions

View File

@@ -162,6 +162,9 @@ import { SearchConfig } from './shared/search/search-filters/search-config.model
import { SequenceService } from './shared/sequence.service';
import { GroupDataService } from './eperson/group-data.service';
import { SubmissionAccessesModel } from './config/models/config-submission-accesses.model';
import { RatingReviewerActionAdvancedInfo } from './tasks/models/rating-reviewer-action-advanced-info.model';
import { ReviewerActionAdvancedInfo } from './tasks/models/reviewer-action-advanced-info.model';
import { SelectReviewerActionAdvancedInfo } from './tasks/models/select-reviewer-action-advanced-info.model';
/**
* When not in production, endpoint responses can be mocked for testing purposes
@@ -332,6 +335,9 @@ export const models =
Version,
VersionHistory,
WorkflowAction,
ReviewerActionAdvancedInfo,
RatingReviewerActionAdvancedInfo,
SelectReviewerActionAdvancedInfo,
TemplateItem,
Feature,
Authorization,

View File

@@ -0,0 +1,27 @@
import { typedObject } from '../../cache/builders/build-decorators';
import { inheritSerialization, autoserialize } from 'cerialize';
import { RATING_REVIEWER_ACTION_ADVANCED_INFO } from './reviewer-action-advanced-info.resource-type';
import { ReviewerActionAdvancedInfo } from './reviewer-action-advanced-info.model';
/**
* A model class for a {@link RatingReviewerActionAdvancedInfo}
*/
@typedObject
@inheritSerialization(ReviewerActionAdvancedInfo)
export class RatingReviewerActionAdvancedInfo extends ReviewerActionAdvancedInfo {
static type = RATING_REVIEWER_ACTION_ADVANCED_INFO;
/**
* Whether the description is required.
*/
@autoserialize
descriptionRequired: boolean;
/**
* The maximum value.
*/
@autoserialize
maxValue: number;
}

View File

@@ -0,0 +1,16 @@
import { typedObject } from '../../cache/builders/build-decorators';
import { autoserialize } from 'cerialize';
import { REVIEWER_ACTION_ADVANCED_INFO } from './reviewer-action-advanced-info.resource-type';
/**
* A model class for a {@link ReviewerActionAdvancedInfo}
*/
@typedObject
export class ReviewerActionAdvancedInfo {
static type = REVIEWER_ACTION_ADVANCED_INFO;
@autoserialize
id: string;
}

View File

@@ -0,0 +1,25 @@
import { ResourceType } from '../../shared/resource-type';
/**
* The resource type for {@link ReviewerActionAdvancedInfo}
*
* Needs to be in a separate file to prevent circular
* dependencies in webpack.
*/
export const REVIEWER_ACTION_ADVANCED_INFO = new ResourceType('revieweraction');
/**
* The resource type for {@link RatingReviewerActionAdvancedInfo}
*
* Needs to be in a separate file to prevent circular
* dependencies in webpack.
*/
export const RATING_REVIEWER_ACTION_ADVANCED_INFO = new ResourceType('ratingrevieweraction');
/**
* The resource type for {@link SelectReviewerActionAdvancedInfo}
*
* Needs to be in a separate file to prevent circular
* dependencies in webpack.
*/
export const SELECT_REVIEWER_ACTION_ADVANCED_INFO = new ResourceType('selectrevieweraction');

View File

@@ -0,0 +1,18 @@
import { typedObject } from '../../cache/builders/build-decorators';
import { inheritSerialization, autoserialize } from 'cerialize';
import { SELECT_REVIEWER_ACTION_ADVANCED_INFO } from './reviewer-action-advanced-info.resource-type';
import { ReviewerActionAdvancedInfo } from './reviewer-action-advanced-info.model';
/**
* A model class for a {@link SelectReviewerActionAdvancedInfo}
*/
@typedObject
@inheritSerialization(ReviewerActionAdvancedInfo)
export class SelectReviewerActionAdvancedInfo extends ReviewerActionAdvancedInfo {
static type = SELECT_REVIEWER_ACTION_ADVANCED_INFO;
@autoserialize
group: string;
}

View File

@@ -2,6 +2,7 @@ import { inheritSerialization, autoserialize } from 'cerialize';
import { typedObject } from '../../cache/builders/build-decorators';
import { DSpaceObject } from '../../shared/dspace-object.model';
import { WORKFLOW_ACTION } from './workflow-action-object.resource-type';
import { ReviewerActionAdvancedInfo } from './reviewer-action-advanced-info.model';
/**
* A model class for a WorkflowAction
@@ -22,4 +23,23 @@ export class WorkflowAction extends DSpaceObject {
*/
@autoserialize
options: string[];
/**
* Whether this action has advanced options
*/
@autoserialize
advanced: boolean;
/**
* The advanced options that the user can select at this action
*/
@autoserialize
advancedOptions: string[];
/**
* The advanced info required by the advanced options
*/
@autoserialize
advancedInfo: ReviewerActionAdvancedInfo[];
}