diff --git a/src/app/core/tasks/claimed-task-data.service.ts b/src/app/core/tasks/claimed-task-data.service.ts index b9c7e9ee54..c8ab170bfe 100644 --- a/src/app/core/tasks/claimed-task-data.service.ts +++ b/src/app/core/tasks/claimed-task-data.service.ts @@ -119,7 +119,11 @@ export class ClaimedTaskDataService extends TasksService { options.searchParams = [ new RequestParam('uuid', uuid) ]; - return this.searchTask('findByItem', options, followLink('workflowitem')) + return this.searchTask('findByItem', options, followLink('workflowitem', + null, + true, + false, + true)) .pipe(getFirstSucceededRemoteData()); } diff --git a/src/app/core/tasks/pool-task-data.service.ts b/src/app/core/tasks/pool-task-data.service.ts index 26eb3e6dad..83aad10fe5 100644 --- a/src/app/core/tasks/pool-task-data.service.ts +++ b/src/app/core/tasks/pool-task-data.service.ts @@ -71,7 +71,11 @@ export class PoolTaskDataService extends TasksService { options.searchParams = [ new RequestParam('uuid', uuid) ]; - return this.searchTask('findByItem', options, followLink('workflowitem')) + return this.searchTask('findByItem', options, followLink('workflowitem', + null, + true, + false, + true)) .pipe(getFirstSucceededRemoteData()); } diff --git a/src/app/core/tasks/tasks.service.ts b/src/app/core/tasks/tasks.service.ts index ddc262d9b2..851112aa42 100644 --- a/src/app/core/tasks/tasks.service.ts +++ b/src/app/core/tasks/tasks.service.ts @@ -131,14 +131,19 @@ export abstract class TasksService extends DataServic * links to follow */ public searchTask(searchMethod: string, options: FindListOptions = {}, ...linksToFollow: FollowLinkConfig[]): Observable> { + const correlationId = Math.floor(Math.random() * 1000); const hrefObs = this.getSearchByHref(searchMethod, options, ...linksToFollow); return hrefObs.pipe( + tap(href => console.log('CorrelationId: ' + correlationId, 'SearchTaskHref', href)), find((href: string) => hasValue(href)), - switchMap((href) => this.findByHref(href).pipe( + switchMap((href) => this.findByHref(href, false, true).pipe( getFirstSucceededRemoteData(), tap(() => { this.requestService.setStaleByHrefSubstring(searchMethod); }))), + tap((response) => { + console.log('CorrelationId: ' + correlationId, 'SearchTaskResponse', response.payload); + }) ); } } 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 afb50c8351..b610232279 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 @@ -1,4 +1,4 @@ -import {Component, Injector, Input, OnDestroy, OnInit} from '@angular/core'; +import { Component, Injector, Input, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { Observable } from 'rxjs'; @@ -26,7 +26,7 @@ import { WORKFLOW_TASK_OPTION_RETURN_TO_POOL } from './return-to-pool/claimed-ta styleUrls: ['./claimed-task-actions.component.scss'], templateUrl: './claimed-task-actions.component.html', }) -export class ClaimedTaskActionsComponent extends MyDSpaceActionsComponent implements OnInit, OnDestroy { +export class ClaimedTaskActionsComponent extends MyDSpaceActionsComponent implements OnInit { /** * The ClaimedTask object @@ -100,8 +100,4 @@ export class ClaimedTaskActionsComponent extends MyDSpaceActionsComponent | DSpaceObject> { - return this.poolTaskService.findByItem(this.itemUuid).pipe(take(1), tap((value) => { - console.log('The new PoolTask (found by item) is:', value); - })); + return this.poolTaskService.findByItem(this.itemUuid).pipe(take(1)); } actionExecution(): Observable { diff --git a/src/app/shared/mydspace-actions/mydspace-reloadable-actions.ts b/src/app/shared/mydspace-actions/mydspace-reloadable-actions.ts index 2a9a14a341..c24d493d6b 100644 --- a/src/app/shared/mydspace-actions/mydspace-reloadable-actions.ts +++ b/src/app/shared/mydspace-actions/mydspace-reloadable-actions.ts @@ -53,7 +53,6 @@ export abstract class MyDSpaceReloadableActionsComponent { this.processing$.next(false); this.handleReloadableActionResponse(res.hasSucceeded, reloadedObject); - return reloadedObject; }) ); } else { diff --git a/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts b/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts index 19f257f512..92086ac817 100644 --- a/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts +++ b/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts @@ -19,7 +19,6 @@ import { Item } from '../../../core/shared/item.model'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { MyDSpaceReloadableActionsComponent } from '../mydspace-reloadable-actions'; import { ProcessTaskResponse } from '../../../core/tasks/models/process-task-response'; -import { tap } from 'rxjs/internal/operators/tap'; /** * This component represents mydspace actions related to PoolTask object. @@ -96,9 +95,7 @@ export class PoolTaskActionsComponent extends MyDSpaceReloadableActionsComponent } reloadObjectExecution(): Observable | DSpaceObject> { - return this.claimedTaskService.findByItem(this.itemUuid).pipe(take(1), tap((value) => { - console.log('The new ClaimTask (found by item) is:', value); - })); + return this.claimedTaskService.findByItem(this.itemUuid).pipe(take(1)); } /** @@ -116,7 +113,6 @@ export class PoolTaskActionsComponent extends MyDSpaceReloadableActionsComponent ngOnDestroy() { this.subs.forEach((sub) => sub.unsubscribe()); - console.log('Destroy of PoolTaskActionsComponent', this.object); } } 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.ts 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.ts index 9eb538ab6a..5423722160 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.ts +++ 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.ts @@ -51,9 +51,17 @@ export class ClaimedApprovedSearchResultListElementComponent extends SearchResul */ ngOnInit() { super.ngOnInit(); - this.linkService.resolveLinks(this.dso, followLink('workflowitem', null, true, - followLink('item'), followLink('submitter') - ), followLink('action')); + this.linkService.resolveLinks(this.dso, + followLink('workflowitem', + null, + true, + false, + true, + followLink('item'), + followLink('submitter') + ), + followLink('action') + ); this.workflowitemRD$ = this.dso.workflowitem as Observable>; } diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.ts index ee90953c8c..7db12c1725 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.ts @@ -52,9 +52,16 @@ export class ClaimedDeclinedSearchResultListElementComponent extends SearchResul */ ngOnInit() { super.ngOnInit(); - this.linkService.resolveLinks(this.dso, followLink('workflowitem', null, true, - followLink('item'), followLink('submitter') - ), followLink('action')); + this.linkService.resolveLinks(this.dso, + followLink('workflowitem', + null, + true, + false, + true, + followLink('item'), + followLink('submitter') + ), + followLink('action')); this.workflowitemRD$ = this.dso.workflowitem as Observable>; }