Empty communities and collections items count are now shown. Show communities items count at the home page.

This commit is contained in:
damian
2023-06-13 19:57:30 +02:00
parent 8cc96060ff
commit 8bcceff085
4 changed files with 7 additions and 6 deletions

View File

@@ -37,7 +37,7 @@
<a [routerLink]="node.route" class="lead"> <a [routerLink]="node.route" class="lead">
{{node.name}} {{node.name}}
</a> </a>
<span *ngIf="node.payload.archivedItemsCount" class="archived-items-lead">[{{node.payload.archivedItemsCount}}]</span> <span *ngIf="node.payload.archivedItemsCount >= 0" class="archived-items-lead">[{{node.payload.archivedItemsCount}}]</span>
</h5> </h5>
</div> </div>
<ds-truncatable [id]="node.id"> <ds-truncatable [id]="node.id">

View File

@@ -4,7 +4,7 @@
<span *ngIf="linkType == linkTypes.None" class="lead"> <span *ngIf="linkType == linkTypes.None" class="lead">
{{object.name}} {{object.name}}
</span> </span>
<span *ngIf="object.archivedItemsCount" class="archived-items-lead">[{{object.archivedItemsCount}}]<span> <span *ngIf="object.archivedItemsCount >= 0" class="lead archived-items-lead">[{{object.archivedItemsCount}}]</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>

View File

@@ -18,7 +18,7 @@ const mockCollectionWithArchivedItems: Collection = Object.assign(new Collection
}, archivedItemsCount: 1 }, archivedItemsCount: 1
}); });
const mockCollectionWithoutArchivedItems: Collection = Object.assign(new Collection(), { const mockCollectionWithArchivedItemsDisabledAtBackend: Collection = Object.assign(new Collection(), {
metadata: { metadata: {
'dc.title': [ 'dc.title': [
{ {
@@ -26,7 +26,7 @@ const mockCollectionWithoutArchivedItems: Collection = Object.assign(new Collect
value: 'Test title' value: 'Test title'
} }
] ]
}, archivedItemsCount: 0 }, archivedItemsCount: -1
}); });
@@ -108,9 +108,9 @@ describe('CollectionListElementComponent', () => {
}); });
}); });
describe('When the collection has no archived items', () => { describe('When the collection archived items are disabled at backend', () => {
beforeEach(() => { beforeEach(() => {
collectionListElementComponent.object = mockCollectionWithoutArchivedItems; collectionListElementComponent.object = mockCollectionWithArchivedItemsDisabledAtBackend;
fixture.detectChanges(); fixture.detectChanges();
}); });

View File

@@ -4,6 +4,7 @@
<span *ngIf="linkType == linkTypes.None" class="lead"> <span *ngIf="linkType == linkTypes.None" class="lead">
{{object.name}} {{object.name}}
</span> </span>
<span *ngIf="object.archivedItemsCount >= 0" class="lead archived-items-lead">[{{object.archivedItemsCount}}]</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>