Displaying item counts at Communities and Collections list view.

This commit is contained in:
damian
2023-05-15 16:09:17 +02:00
parent 5e27741483
commit 536cb62cc0
4 changed files with 15 additions and 2 deletions

View File

@@ -37,6 +37,7 @@
<a [routerLink]="node.route" class="lead"> <a [routerLink]="node.route" class="lead">
{{node.name}} {{node.name}}
</a> </a>
<span>[{{node.payload.archivedItems}}]</span>
</h5> </h5>
</div> </div>
<ds-truncatable [id]="node.id"> <ds-truncatable [id]="node.id">

View File

@@ -1,4 +1,4 @@
import { deserialize, inheritSerialization } from 'cerialize'; import {autoserialize, deserialize, inheritSerialization} from 'cerialize';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { link, typedObject } from '../cache/builders/build-decorators'; import { link, typedObject } from '../cache/builders/build-decorators';
import { PaginatedList } from '../data/paginated-list.model'; import { PaginatedList } from '../data/paginated-list.model';
@@ -16,12 +16,17 @@ import { COMMUNITY } from './community.resource-type';
import { Community } from './community.model'; import { Community } from './community.model';
import { ChildHALResource } from './child-hal-resource.model'; import { ChildHALResource } from './child-hal-resource.model';
import { HandleObject } from './handle-object.model'; import { HandleObject } from './handle-object.model';
import {excludeFromEquals} from '../utilities/equals.decorators';
@typedObject @typedObject
@inheritSerialization(DSpaceObject) @inheritSerialization(DSpaceObject)
export class Collection extends DSpaceObject implements ChildHALResource, HandleObject { export class Collection extends DSpaceObject implements ChildHALResource, HandleObject {
static type = COLLECTION; static type = COLLECTION;
@excludeFromEquals
@autoserialize
archivedItems: number;
/** /**
* The {@link HALLink}s for this Collection * The {@link HALLink}s for this Collection
*/ */

View File

@@ -1,4 +1,4 @@
import { deserialize, inheritSerialization } from 'cerialize'; import {autoserialize, deserialize, inheritSerialization} from 'cerialize';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { link, typedObject } from '../cache/builders/build-decorators'; import { link, typedObject } from '../cache/builders/build-decorators';
import { PaginatedList } from '../data/paginated-list.model'; import { PaginatedList } from '../data/paginated-list.model';
@@ -12,12 +12,17 @@ import { DSpaceObject } from './dspace-object.model';
import { HALLink } from './hal-link.model'; import { HALLink } from './hal-link.model';
import { ChildHALResource } from './child-hal-resource.model'; import { ChildHALResource } from './child-hal-resource.model';
import { HandleObject } from './handle-object.model'; import { HandleObject } from './handle-object.model';
import {excludeFromEquals} from '../utilities/equals.decorators';
@typedObject @typedObject
@inheritSerialization(DSpaceObject) @inheritSerialization(DSpaceObject)
export class Community extends DSpaceObject implements ChildHALResource, HandleObject { export class Community extends DSpaceObject implements ChildHALResource, HandleObject {
static type = COMMUNITY; static type = COMMUNITY;
@excludeFromEquals
@autoserialize
archivedItems: number;
/** /**
* The {@link HALLink}s for this Community * The {@link HALLink}s for this Community
*/ */

View File

@@ -3,7 +3,9 @@
</a> </a>
<span *ngIf="linkType == linkTypes.None" class="lead"> <span *ngIf="linkType == linkTypes.None" class="lead">
{{object.name}} {{object.name}}
<span>[{{object.archivedItems}}]<span>
</span> </span>
<div *ngIf="object.shortDescription" class="text-muted abstract-text"> <div *ngIf="object.shortDescription" class="text-muted abstract-text">
{{object.shortDescription}} {{object.shortDescription}}
</div> </div>