mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-13 13:03:04 +00:00
101577: Fixed some SearchResultListElementComponents not rendering because of potential undefined dso
This commit is contained in:
@@ -17,7 +17,7 @@ import { followLink } from '../../../utils/follow-link-config.model';
|
|||||||
import { LinkService } from '../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../core/cache/builders/link.service';
|
||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
||||||
import { isNotEmpty } from '../../../empty.util';
|
import { isNotEmpty, hasValue } from '../../../empty.util';
|
||||||
import { ObjectCacheService } from '../../../../core/cache/object-cache.service';
|
import { ObjectCacheService } from '../../../../core/cache/object-cache.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -88,7 +88,9 @@ export class ClaimedTaskSearchResultDetailElementComponent extends SearchResultD
|
|||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
// This ensures the object is removed from cache, when action is performed on task
|
// This ensures the object is removed from cache, when action is performed on task
|
||||||
|
if (hasValue(this.dso)) {
|
||||||
this.objectCache.remove(this.dso._links.workflowitem.href);
|
this.objectCache.remove(this.dso._links.workflowitem.href);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -17,7 +17,7 @@ import { followLink } from '../../../utils/follow-link-config.model';
|
|||||||
import { LinkService } from '../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../core/cache/builders/link.service';
|
||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
||||||
import { isNotEmpty } from '../../../empty.util';
|
import { isNotEmpty, hasValue } from '../../../empty.util';
|
||||||
import { ObjectCacheService } from '../../../../core/cache/object-cache.service';
|
import { ObjectCacheService } from '../../../../core/cache/object-cache.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -89,7 +89,9 @@ export class PoolSearchResultDetailElementComponent extends SearchResultDetailEl
|
|||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
// This ensures the object is removed from cache, when action is performed on task
|
// This ensures the object is removed from cache, when action is performed on task
|
||||||
|
if (hasValue(this.dso)) {
|
||||||
this.objectCache.remove(this.dso._links.workflowitem.href);
|
this.objectCache.remove(this.dso._links.workflowitem.href);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -22,7 +22,7 @@ import { ObjectCacheService } from '../../../../core/cache/object-cache.service'
|
|||||||
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { mergeMap, tap } from 'rxjs/operators';
|
import { mergeMap, tap } from 'rxjs/operators';
|
||||||
import { isNotEmpty } from '../../../empty.util';
|
import { isNotEmpty, hasValue } from '../../../empty.util';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-claimed-search-result-list-element',
|
selector: 'ds-claimed-search-result-list-element',
|
||||||
@@ -101,7 +101,9 @@ export class ClaimedSearchResultListElementComponent extends SearchResultListEle
|
|||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
// This ensures the object is removed from cache, when action is performed on task
|
// This ensures the object is removed from cache, when action is performed on task
|
||||||
|
if (hasValue(this.dso)) {
|
||||||
this.objectCache.remove(this.dso._links.workflowitem.href);
|
this.objectCache.remove(this.dso._links.workflowitem.href);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -23,7 +23,7 @@ import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interfac
|
|||||||
import { ObjectCacheService } from '../../../../core/cache/object-cache.service';
|
import { ObjectCacheService } from '../../../../core/cache/object-cache.service';
|
||||||
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { isNotEmpty } from '../../../empty.util';
|
import { isNotEmpty, hasValue } from '../../../empty.util';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders pool task object for the search result in the list view.
|
* This component renders pool task object for the search result in the list view.
|
||||||
@@ -111,6 +111,8 @@ export class PoolSearchResultListElementComponent extends SearchResultListElemen
|
|||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
// This ensures the object is removed from cache, when action is performed on task
|
// This ensures the object is removed from cache, when action is performed on task
|
||||||
|
if (hasValue(this.dso)) {
|
||||||
this.objectCache.remove(this.dso._links.workflowitem.href);
|
this.objectCache.remove(this.dso._links.workflowitem.href);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user