Skip to content

Commit c47405c

Browse files
committed
[CST-6876] Fix issue for which submitter disappear when workflow state were changed
1 parent d8c8a43 commit c47405c

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.spec.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ import { EPersonMock } from '../../../testing/eperson.mock';
1111
import { TranslateLoaderMock } from '../../../mocks/translate-loader.mock';
1212
import { By } from '@angular/platform-browser';
1313
import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils';
14+
import { LinkService } from '../../../../core/cache/builders/link.service';
15+
import { getMockLinkService } from '../../../mocks/link-service.mock';
1416

1517
let component: ItemSubmitterComponent;
1618
let fixture: ComponentFixture<ItemSubmitterComponent>;
17-
18-
const compIndex = 1;
19-
2019
let mockResultObject: PoolTask;
2120

2221
const rdSumbitter = createSuccessfulRemoteDataObject(EPersonMock);
@@ -36,6 +35,9 @@ describe('ItemSubmitterComponent', () => {
3635
})
3736
],
3837
declarations: [ItemSubmitterComponent],
38+
providers: [
39+
{ provide: LinkService, useValue: getMockLinkService() },
40+
],
3941
schemas: [NO_ERRORS_SCHEMA]
4042
}).overrideComponent(ItemSubmitterComponent, {
4143
set: { changeDetection: ChangeDetectionStrategy.Default }

src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { RemoteData } from '../../../../core/data/remote-data';
88
import { isNotEmpty } from '../../../empty.util';
99
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
1010
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
11+
import { LinkService } from '../../../../core/cache/builders/link.service';
12+
import { followLink } from '../../../utils/follow-link-config.model';
1113

1214
/**
1315
* This component represents a badge with submitter information.
@@ -29,10 +31,17 @@ export class ItemSubmitterComponent implements OnInit {
2931
*/
3032
submitter$: Observable<EPerson>;
3133

34+
public constructor(protected linkService: LinkService) {
35+
36+
}
37+
3238
/**
3339
* Initialize submitter object
3440
*/
3541
ngOnInit() {
42+
this.linkService.resolveLinks(this.object, followLink('workflowitem', {},
43+
followLink('submitter',{})
44+
));
3645
this.submitter$ = (this.object.workflowitem as Observable<RemoteData<WorkflowItem>>).pipe(
3746
getFirstCompletedRemoteData(),
3847
mergeMap((rd: RemoteData<WorkflowItem>) => {

src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ export class PoolSearchResultListElementComponent extends SearchResultListElemen
111111

112112
ngOnDestroy() {
113113
// This ensures the object is removed from cache, when action is performed on task
114-
// this.wfiService.invalidateByHref(this.dso._links.workflowitem.href);
115114
this.objectCache.remove(this.dso._links.workflowitem.href);
116115
}
117116
}

0 commit comments

Comments
 (0)