mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-11 20:13:07 +00:00
108555: Refactored ItemSelectComponent to not call canSelect every time changes are detected
This commit is contained in:
29
src/app/shared/object-select/object-select.model.ts
Normal file
29
src/app/shared/object-select/object-select.model.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { Observable } from 'rxjs';
|
||||
import { DSpaceObject } from '../../core/shared/dspace-object.model';
|
||||
|
||||
/**
|
||||
* Class used to collect all the data that that is used by the {@link ObjectSelectComponent} in the HTML.
|
||||
*/
|
||||
export class DSpaceObjectSelect<T extends DSpaceObject> {
|
||||
|
||||
/**
|
||||
* The {@link DSpaceObject} to display
|
||||
*/
|
||||
dso: T;
|
||||
|
||||
/**
|
||||
* Whether the {@link DSpaceObject} can be selected
|
||||
*/
|
||||
canSelect$: Observable<boolean>;
|
||||
|
||||
/**
|
||||
* Whether the {@link DSpaceObject} is selected
|
||||
*/
|
||||
selected$: Observable<boolean>;
|
||||
|
||||
/**
|
||||
* The {@link DSpaceObject}'s route
|
||||
*/
|
||||
route: string;
|
||||
|
||||
}
|
Reference in New Issue
Block a user