@@ -39,9 +39,11 @@ import { RemoteData } from '../../core/data/remote-data';
3939import { PaginationService } from '../../core/pagination/pagination.service' ;
4040import { Collection } from '../../core/shared/collection.model' ;
4141import { Item } from '../../core/shared/item.model' ;
42- import { getFirstCompletedRemoteData } from '../../core/shared/operators' ;
42+ import { getFirstCompletedRemoteData , getFirstSucceededRemoteDataPayload } from '../../core/shared/operators' ;
4343import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model' ;
4444import { AuditTableComponent } from '../audit-table/audit-table.component' ;
45+ import { DSONameService } from '../../core/breadcrumbs/dso-name.service' ;
46+ import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service' ;
4547/**
4648 * Component displaying a list of all audit about a object in a paginated table
4749 */
@@ -94,6 +96,8 @@ export class ObjectAuditOverviewComponent implements OnInit, OnDestroy {
9496
9597 objectId : string ;
9698
99+ objectName : string ;
100+
97101 dataNotAvailable = AUDIT_PERSON_NOT_AVAILABLE ;
98102
99103 sub : Subscription ;
@@ -104,13 +108,18 @@ export class ObjectAuditOverviewComponent implements OnInit, OnDestroy {
104108 protected itemService : ItemDataService ,
105109 protected paginationService : PaginationService ,
106110 protected collectionDataService : CollectionDataService ,
111+ protected dsoNameService : DSONameService ,
112+ protected dSpaceObjectDataService : DSpaceObjectDataService ,
107113 ) { }
108114
109115 ngOnInit ( ) : void {
110116 this . sub = this . route . paramMap . pipe (
111117 map ( ( paramMap : ParamMap ) => paramMap . get ( 'objectId' ) ) ,
112- ) . subscribe ( ( id ) => {
113- this . objectId = id ;
118+ switchMap ( ( id : string ) => this . dSpaceObjectDataService . findById ( id , true , true ) ) ,
119+ getFirstSucceededRemoteDataPayload ( ) ,
120+ ) . subscribe ( ( dso ) => {
121+ this . objectId = dso . id ;
122+ this . objectName = this . dsoNameService . getName ( dso ) ;
114123 this . setAudits ( ) ;
115124 } ) ;
116125 }
@@ -128,7 +137,6 @@ export class ObjectAuditOverviewComponent implements OnInit, OnDestroy {
128137 const config$ = this . paginationService . getFindListOptions ( this . pageConfig . id , this . config ) ;
129138
130139 this . auditsRD$ = config$ . pipe (
131- tap ( console . log ) ,
132140 switchMap ( ( config ) =>
133141 this . auditService . findByObject ( this . objectId , config ) . pipe (
134142 getFirstCompletedRemoteData ( ) ,
0 commit comments