mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
fixed caching issue
This commit is contained in:
@@ -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
|
* The component for displaying the actions for a list element for an item on the admin workflow search page
|
||||||
*/
|
*/
|
||||||
export class WorkflowItemAdminWorkflowActionsComponent {
|
export class WorkflowItemAdminWorkflowActionsComponent {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The workflow item to perform the actions on
|
* 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
|
* Returns the path to the delete page of this workflow item
|
||||||
*/
|
*/
|
||||||
getDeletePath(): string {
|
getDeletePath(): string {
|
||||||
|
|
||||||
return getWorkflowItemDeletePath(this.wfi.id)
|
return getWorkflowItemDeletePath(this.wfi.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,6 +15,8 @@ import { WorkflowItem } from '../../core/submission/models/workflowitem.model';
|
|||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { VarDirective } from '../../shared/utils/var.directive';
|
import { VarDirective } from '../../shared/utils/var.directive';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
|
import { RequestService } from '../../core/data/request.service';
|
||||||
|
import { getMockRequestService } from '../../shared/mocks/mock-request.service';
|
||||||
|
|
||||||
describe('WorkflowItemDeleteComponent', () => {
|
describe('WorkflowItemDeleteComponent', () => {
|
||||||
let component: WorkflowItemDeleteComponent;
|
let component: WorkflowItemDeleteComponent;
|
||||||
@@ -50,6 +52,7 @@ describe('WorkflowItemDeleteComponent', () => {
|
|||||||
{ provide: RouteService, useValue: {} },
|
{ provide: RouteService, useValue: {} },
|
||||||
{ provide: NotificationsService, useClass: NotificationsServiceStub },
|
{ provide: NotificationsService, useClass: NotificationsServiceStub },
|
||||||
{ provide: WorkflowItemDataService, useValue: wfiService },
|
{ provide: WorkflowItemDataService, useValue: wfiService },
|
||||||
|
{ provide: RequestService, useValue: getMockRequestService() },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
})
|
})
|
||||||
|
@@ -6,6 +6,7 @@ import { WorkflowItemDataService } from '../../core/submission/workflowitem-data
|
|||||||
import { RouteService } from '../../core/services/route.service';
|
import { RouteService } from '../../core/services/route.service';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
import { RequestService } from '../../core/data/request.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-workflow-item-delete',
|
selector: 'ds-workflow-item-delete',
|
||||||
@@ -20,7 +21,8 @@ export class WorkflowItemDeleteComponent extends WorkflowItemActionPageComponent
|
|||||||
protected router: Router,
|
protected router: Router,
|
||||||
protected routeService: RouteService,
|
protected routeService: RouteService,
|
||||||
protected notificationsService: NotificationsService,
|
protected notificationsService: NotificationsService,
|
||||||
protected translationService: TranslateService) {
|
protected translationService: TranslateService,
|
||||||
|
protected requestService: RequestService) {
|
||||||
super(route, workflowItemService, router, routeService, notificationsService, translationService);
|
super(route, workflowItemService, router, routeService, notificationsService, translationService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,6 +38,7 @@ export class WorkflowItemDeleteComponent extends WorkflowItemActionPageComponent
|
|||||||
* @param id The id of the WorkflowItem
|
* @param id The id of the WorkflowItem
|
||||||
*/
|
*/
|
||||||
sendRequest(id: string): Observable<boolean> {
|
sendRequest(id: string): Observable<boolean> {
|
||||||
|
this.requestService.removeByHrefSubstring('/discover');
|
||||||
return this.workflowItemService.delete(id);
|
return this.workflowItemService.delete(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,6 +15,8 @@ import { NO_ERRORS_SCHEMA } from '@angular/core';
|
|||||||
import { VarDirective } from '../../shared/utils/var.directive';
|
import { VarDirective } from '../../shared/utils/var.directive';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import { WorkflowItemSendBackComponent } from './workflow-item-send-back.component';
|
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', () => {
|
describe('WorkflowItemSendBackComponent', () => {
|
||||||
let component: WorkflowItemSendBackComponent;
|
let component: WorkflowItemSendBackComponent;
|
||||||
@@ -50,6 +52,7 @@ describe('WorkflowItemSendBackComponent', () => {
|
|||||||
{ provide: RouteService, useValue: {} },
|
{ provide: RouteService, useValue: {} },
|
||||||
{ provide: NotificationsService, useClass: NotificationsServiceStub },
|
{ provide: NotificationsService, useClass: NotificationsServiceStub },
|
||||||
{ provide: WorkflowItemDataService, useValue: wfiService },
|
{ provide: WorkflowItemDataService, useValue: wfiService },
|
||||||
|
{ provide: RequestService, useValue: getMockRequestService() },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
})
|
})
|
||||||
|
@@ -6,6 +6,7 @@ import { WorkflowItemDataService } from '../../core/submission/workflowitem-data
|
|||||||
import { RouteService } from '../../core/services/route.service';
|
import { RouteService } from '../../core/services/route.service';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
import { RequestService } from '../../core/data/request.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-workflow-item-send-back',
|
selector: 'ds-workflow-item-send-back',
|
||||||
@@ -20,7 +21,8 @@ export class WorkflowItemSendBackComponent extends WorkflowItemActionPageCompone
|
|||||||
protected router: Router,
|
protected router: Router,
|
||||||
protected routeService: RouteService,
|
protected routeService: RouteService,
|
||||||
protected notificationsService: NotificationsService,
|
protected notificationsService: NotificationsService,
|
||||||
protected translationService: TranslateService) {
|
protected translationService: TranslateService,
|
||||||
|
protected requestService: RequestService) {
|
||||||
super(route, workflowItemService, router, routeService, notificationsService, translationService);
|
super(route, workflowItemService, router, routeService, notificationsService, translationService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,6 +38,7 @@ export class WorkflowItemSendBackComponent extends WorkflowItemActionPageCompone
|
|||||||
* @param id The id of the WorkflowItem
|
* @param id The id of the WorkflowItem
|
||||||
*/
|
*/
|
||||||
sendRequest(id: string): Observable<boolean> {
|
sendRequest(id: string): Observable<boolean> {
|
||||||
|
this.requestService.removeByHrefSubstring('/discover');
|
||||||
return this.workflowItemService.sendBack(id);
|
return this.workflowItemService.sendBack(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user