diff --git a/src/app/+admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.ts b/src/app/+admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.ts index 2109357b81..d44f870b14 100644 --- a/src/app/+admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.ts +++ b/src/app/+admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.ts @@ -11,6 +11,7 @@ import { getWorkflowItemDeletePath, getWorkflowItemSendBackPath } from '../../.. * The component for displaying the actions for a list element for an item on the admin workflow search page */ export class WorkflowItemAdminWorkflowActionsComponent { + /** * The workflow item to perform the actions on */ @@ -25,6 +26,7 @@ export class WorkflowItemAdminWorkflowActionsComponent { * Returns the path to the delete page of this workflow item */ getDeletePath(): string { + return getWorkflowItemDeletePath(this.wfi.id) } diff --git a/src/app/+workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.spec.ts b/src/app/+workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.spec.ts index d2c093ff4b..c11cdc1d15 100644 --- a/src/app/+workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.spec.ts +++ b/src/app/+workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.spec.ts @@ -15,6 +15,8 @@ import { WorkflowItem } from '../../core/submission/models/workflowitem.model'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { VarDirective } from '../../shared/utils/var.directive'; import { of as observableOf } from 'rxjs'; +import { RequestService } from '../../core/data/request.service'; +import { getMockRequestService } from '../../shared/mocks/mock-request.service'; describe('WorkflowItemDeleteComponent', () => { let component: WorkflowItemDeleteComponent; @@ -50,6 +52,7 @@ describe('WorkflowItemDeleteComponent', () => { { provide: RouteService, useValue: {} }, { provide: NotificationsService, useClass: NotificationsServiceStub }, { provide: WorkflowItemDataService, useValue: wfiService }, + { provide: RequestService, useValue: getMockRequestService() }, ], schemas: [NO_ERRORS_SCHEMA] }) diff --git a/src/app/+workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts b/src/app/+workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts index 73111bdf2b..43c3e90152 100644 --- a/src/app/+workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts +++ b/src/app/+workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts @@ -6,6 +6,7 @@ import { WorkflowItemDataService } from '../../core/submission/workflowitem-data import { RouteService } from '../../core/services/route.service'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { TranslateService } from '@ngx-translate/core'; +import { RequestService } from '../../core/data/request.service'; @Component({ selector: 'ds-workflow-item-delete', @@ -20,7 +21,8 @@ export class WorkflowItemDeleteComponent extends WorkflowItemActionPageComponent protected router: Router, protected routeService: RouteService, protected notificationsService: NotificationsService, - protected translationService: TranslateService) { + protected translationService: TranslateService, + protected requestService: RequestService) { super(route, workflowItemService, router, routeService, notificationsService, translationService); } @@ -36,6 +38,7 @@ export class WorkflowItemDeleteComponent extends WorkflowItemActionPageComponent * @param id The id of the WorkflowItem */ sendRequest(id: string): Observable { + this.requestService.removeByHrefSubstring('/discover'); return this.workflowItemService.delete(id); } } diff --git a/src/app/+workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.spec.ts b/src/app/+workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.spec.ts index daf58450e4..0332a6b9ee 100644 --- a/src/app/+workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.spec.ts +++ b/src/app/+workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.spec.ts @@ -15,6 +15,8 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { VarDirective } from '../../shared/utils/var.directive'; import { of as observableOf } from 'rxjs'; import { WorkflowItemSendBackComponent } from './workflow-item-send-back.component'; +import { RequestService } from '../../core/data/request.service'; +import { getMockRequestService } from '../../shared/mocks/mock-request.service'; describe('WorkflowItemSendBackComponent', () => { let component: WorkflowItemSendBackComponent; @@ -50,6 +52,7 @@ describe('WorkflowItemSendBackComponent', () => { { provide: RouteService, useValue: {} }, { provide: NotificationsService, useClass: NotificationsServiceStub }, { provide: WorkflowItemDataService, useValue: wfiService }, + { provide: RequestService, useValue: getMockRequestService() }, ], schemas: [NO_ERRORS_SCHEMA] }) diff --git a/src/app/+workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts b/src/app/+workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts index 6e9a2e841e..002e5dcc9a 100644 --- a/src/app/+workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts +++ b/src/app/+workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts @@ -6,6 +6,7 @@ import { WorkflowItemDataService } from '../../core/submission/workflowitem-data import { RouteService } from '../../core/services/route.service'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { TranslateService } from '@ngx-translate/core'; +import { RequestService } from '../../core/data/request.service'; @Component({ selector: 'ds-workflow-item-send-back', @@ -20,7 +21,8 @@ export class WorkflowItemSendBackComponent extends WorkflowItemActionPageCompone protected router: Router, protected routeService: RouteService, protected notificationsService: NotificationsService, - protected translationService: TranslateService) { + protected translationService: TranslateService, + protected requestService: RequestService) { super(route, workflowItemService, router, routeService, notificationsService, translationService); } @@ -36,6 +38,7 @@ export class WorkflowItemSendBackComponent extends WorkflowItemActionPageCompone * @param id The id of the WorkflowItem */ sendRequest(id: string): Observable { + this.requestService.removeByHrefSubstring('/discover'); return this.workflowItemService.sendBack(id); } }