diff --git a/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts b/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts index 0a0dbb3f5d..58d252f0b4 100644 --- a/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts +++ b/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts @@ -37,12 +37,30 @@ enum SubKey { SearchResultsDTO, } +/** + * The layout config of the buttons in the last column + */ export interface EPersonActionConfig { + /** + * The css classes that should be added to the button + */ css?: string; + /** + * Whether the button should be disabled + */ disabled: boolean; + /** + * The Font Awesome icon that should be used + */ icon: string; } +/** + * The {@link EPersonActionConfig} that should be used to display the button. The remove config will be used when the + * {@link EPerson} is already a member of the {@link Group} and the remove config will be used otherwise. + * + * *See {@link actionConfig} for an example* + */ export interface EPersonListActionConfig { add: EPersonActionConfig; remove: EPersonActionConfig; diff --git a/src/app/my-dspace-page/my-dspace-search.module.ts b/src/app/my-dspace-page/my-dspace-search.module.ts index 1ce39991b3..8b03bffea7 100644 --- a/src/app/my-dspace-page/my-dspace-search.module.ts +++ b/src/app/my-dspace-page/my-dspace-search.module.ts @@ -25,6 +25,7 @@ import { ThemedItemListPreviewComponent } from '../shared/object-list/my-dspace- import { MyDSpaceItemStatusComponent } from '../shared/object-collection/shared/mydspace-item-status/my-dspace-item-status.component'; import { JournalEntitiesModule } from '../entity-groups/journal-entities/journal-entities.module'; import { MyDSpaceActionsModule } from '../shared/mydspace-actions/mydspace-actions.module'; +import { ClaimedDeclinedTaskSearchResultListElementComponent } from '../shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component'; const ENTRY_COMPONENTS = [ WorkspaceItemSearchResultListElementComponent, @@ -32,6 +33,7 @@ const ENTRY_COMPONENTS = [ ClaimedSearchResultListElementComponent, ClaimedApprovedSearchResultListElementComponent, ClaimedDeclinedSearchResultListElementComponent, + ClaimedDeclinedTaskSearchResultListElementComponent, PoolSearchResultListElementComponent, ItemSearchResultDetailElementComponent, WorkspaceItemSearchResultDetailElementComponent, diff --git a/src/app/shared/mydspace-actions/claimed-task/abstract/advanced-claimed-task-actions-abstract.component.ts b/src/app/shared/mydspace-actions/claimed-task/abstract/advanced-claimed-task-actions-abstract.component.ts index d3f2ce4b6e..06d51d67a3 100644 --- a/src/app/shared/mydspace-actions/claimed-task/abstract/advanced-claimed-task-actions-abstract.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/abstract/advanced-claimed-task-actions-abstract.component.ts @@ -7,8 +7,8 @@ import { getAdvancedWorkflowRoute } from '../../../../workflowitems-edit-page/wo /** * Abstract component for rendering an advanced claimed task's action * To create a child-component for a new option: - * - Set the "option" and "workflowType" of the component - * - Add a @rendersWorkflowTaskOption annotation to your component providing the same enum value + * - Set the "{@link option}" and "{@link workflowType}" of the component + * - Add a @{@link rendersWorkflowTaskOption} annotation to your component providing the same enum value */ @Component({ selector: 'ds-advanced-claimed-task-action-abstract', diff --git a/src/app/shared/mydspace-actions/claimed-task/abstract/advanced-workflow-action-abstract.component.ts b/src/app/shared/mydspace-actions/claimed-task/abstract/advanced-workflow-action-abstract.component.ts deleted file mode 100644 index be6935d900..0000000000 --- a/src/app/shared/mydspace-actions/claimed-task/abstract/advanced-workflow-action-abstract.component.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'ds-advanced-workflow-action-abstract', - template: '', -}) -export abstract class AdvancedWorkflowActionAbstractComponent { -} diff --git a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.html b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.html index 34932f47bf..50e3b46dfe 100644 --- a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.html +++ b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.html @@ -12,12 +12,5 @@ [routerLink]="[getWorkflowItemViewRoute(workflowitem)]"> {{"submission.workflow.generic.view" | translate}} - - - diff --git a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts index dc57105a4e..195a2193e5 100644 --- a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts @@ -14,7 +14,6 @@ import { RequestService } from '../../../core/data/request.service'; import { SearchService } from '../../../core/shared/search/search.service'; import { WorkflowAction } from '../../../core/tasks/models/workflow-action-object.model'; import { WorkflowActionDataService } from '../../../core/data/workflow-action-data.service'; -import { WORKFLOW_TASK_OPTION_RETURN_TO_POOL } from './return-to-pool/claimed-task-actions-return-to-pool.component'; import { getWorkflowItemViewRoute } from '../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths'; import { Item } from '../../../core/shared/item.model'; @@ -48,12 +47,6 @@ export class ClaimedTaskActionsComponent extends MyDSpaceActionsComponent>; - /** - * The option used to render the "return to pool" component - * Every claimed task contains this option - */ - public returnToPoolOption = WORKFLOW_TASK_OPTION_RETURN_TO_POOL; - /** * Initialize instance variables * diff --git a/src/app/shared/mydspace-actions/claimed-task/decline-task/claimed-task-actions-decline-task.component.ts b/src/app/shared/mydspace-actions/claimed-task/decline-task/claimed-task-actions-decline-task.component.ts index ab867d62d6..5afbde7d7d 100644 --- a/src/app/shared/mydspace-actions/claimed-task/decline-task/claimed-task-actions-decline-task.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/decline-task/claimed-task-actions-decline-task.component.ts @@ -6,6 +6,12 @@ import { NotificationsService } from '../../../notifications/notifications.servi import { TranslateService } from '@ngx-translate/core'; import { SearchService } from '../../../../core/shared/search/search.service'; import { RequestService } from '../../../../core/data/request.service'; +import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; +import { + ClaimedDeclinedTaskTaskSearchResult +} from '../../../object-collection/shared/claimed-declined-task-task-search-result.model'; +import { Observable, of as observableOf } from 'rxjs'; +import { RemoteData } from 'src/app/core/data/remote-data'; export const WORKFLOW_TASK_OPTION_DECLINE_TASK = 'submit_decline_task'; @@ -31,4 +37,14 @@ export class ClaimedTaskActionsDeclineTaskComponent extends ClaimedTaskActionsAb super(injector, router, notificationsService, translate, searchService, requestService); } + reloadObjectExecution(): Observable | DSpaceObject> { + return observableOf(this.object); + } + + convertReloadedObject(dso: DSpaceObject): DSpaceObject { + return Object.assign(new ClaimedDeclinedTaskTaskSearchResult(), dso, { + indexableObject: dso + }); + } + } diff --git a/src/app/shared/object-collection/shared/claimed-declined-task-search-result.model.ts b/src/app/shared/object-collection/shared/claimed-declined-task-search-result.model.ts index eaf63bf6dd..0afb79a274 100644 --- a/src/app/shared/object-collection/shared/claimed-declined-task-search-result.model.ts +++ b/src/app/shared/object-collection/shared/claimed-declined-task-search-result.model.ts @@ -2,7 +2,7 @@ import { ClaimedTask } from '../../../core/tasks/models/claimed-task-object.mode import { SearchResult } from '../../search/models/search-result.model'; /** - * Represents a search result object of a Declined ClaimedTask object + * Represents a search result object of a Declined/Rejected ClaimedTask object (sent back to the submitter) */ export class ClaimedDeclinedTaskSearchResult extends SearchResult { } diff --git a/src/app/shared/object-collection/shared/claimed-declined-task-task-search-result.model.ts b/src/app/shared/object-collection/shared/claimed-declined-task-task-search-result.model.ts new file mode 100644 index 0000000000..dffb3c1313 --- /dev/null +++ b/src/app/shared/object-collection/shared/claimed-declined-task-task-search-result.model.ts @@ -0,0 +1,8 @@ +import { ClaimedTask } from '../../../core/tasks/models/claimed-task-object.model'; +import { SearchResult } from '../../search/models/search-result.model'; + +/** + * Represents a search result object of a Declined ClaimedTask object (sent back to the Review Managers) + */ +export class ClaimedDeclinedTaskTaskSearchResult extends SearchResult { +} diff --git a/src/app/shared/object-collection/shared/mydspace-item-status/my-dspace-item-status-type.ts b/src/app/shared/object-collection/shared/mydspace-item-status/my-dspace-item-status-type.ts index 5cf4d91b20..ec101f1ee7 100644 --- a/src/app/shared/object-collection/shared/mydspace-item-status/my-dspace-item-status-type.ts +++ b/src/app/shared/object-collection/shared/mydspace-item-status/my-dspace-item-status-type.ts @@ -6,4 +6,5 @@ export enum MyDspaceItemStatusType { ARCHIVED = 'mydspace.status.archived', DECLINED = 'mydspace.status.declined', APPROVED = 'mydspace.status.approved', + DECLINED_TASk = 'mydspace.status.declined-task', } diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.html b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.html index 544c1ebea8..79e870e130 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.html +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.html @@ -1,6 +1,6 @@