mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-13 04:53:06 +00:00
#674 revert eror throw and ad set/get for grid communities and collections
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { Component, Inject, Input } from '@angular/core';
|
||||
|
||||
import { Collection } from '../../../core/shared/collection.model';
|
||||
import { AbstractListableElementComponent } from '../../object-collection/shared/object-collection-element/abstract-listable-element.component';
|
||||
import { ViewMode } from '../../../core/shared/view-mode.model';
|
||||
import { listableObjectComponent } from '../../object-collection/shared/listable-object/listable-object.decorator';
|
||||
import { hasNoValue, hasValue } from '../../empty.util';
|
||||
import { followLink } from '../../utils/follow-link-config.model';
|
||||
import { LinkService } from '../../../core/cache/builders/link.service';
|
||||
|
||||
/**
|
||||
* Component representing a grid element for collection
|
||||
@@ -15,4 +18,21 @@ import { listableObjectComponent } from '../../object-collection/shared/listable
|
||||
})
|
||||
|
||||
@listableObjectComponent(Collection, ViewMode.GridElement)
|
||||
export class CollectionGridElementComponent extends AbstractListableElementComponent<Collection> {}
|
||||
export class CollectionGridElementComponent extends AbstractListableElementComponent<Collection> {
|
||||
private _object: Collection;
|
||||
|
||||
constructor( private linkService: LinkService){
|
||||
super();
|
||||
}
|
||||
|
||||
@Input() set object(object: Collection) {
|
||||
this._object = object;
|
||||
if (hasValue(this._object) && hasNoValue(this._object.logo)) {
|
||||
this.linkService.resolveLink<Collection>(this._object, followLink('logo'))
|
||||
}
|
||||
}
|
||||
|
||||
get object(): Collection {
|
||||
return this._object;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user