fixed caching issue

This commit is contained in:
lotte
2020-04-09 10:20:42 +02:00
parent e43f04e564
commit 9cfed06784
5 changed files with 16 additions and 2 deletions

View File

@@ -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)
}

View File

@@ -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]
})

View File

@@ -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<boolean> {
this.requestService.removeByHrefSubstring('/discover');
return this.workflowItemService.delete(id);
}
}

View File

@@ -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]
})

View File

@@ -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<boolean> {
this.requestService.removeByHrefSubstring('/discover');
return this.workflowItemService.sendBack(id);
}
}