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">
{{node.name}}
</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>
</div>
<ds-truncatable [id]="node.id">

View File

@@ -4,7 +4,7 @@
<span *ngIf="linkType == linkTypes.None" class="lead">
{{object.name}}
</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">
{{object.shortDescription}}
</div>

View File

@@ -18,7 +18,7 @@ const mockCollectionWithArchivedItems: Collection = Object.assign(new Collection
}, archivedItemsCount: 1
});
const mockCollectionWithoutArchivedItems: Collection = Object.assign(new Collection(), {
const mockCollectionWithArchivedItemsDisabledAtBackend: Collection = Object.assign(new Collection(), {
metadata: {
'dc.title': [
{
@@ -26,7 +26,7 @@ const mockCollectionWithoutArchivedItems: Collection = Object.assign(new Collect
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(() => {
collectionListElementComponent.object = mockCollectionWithoutArchivedItems;
collectionListElementComponent.object = mockCollectionWithArchivedItemsDisabledAtBackend;
fixture.detectChanges();
});

View File

@@ -4,6 +4,7 @@
<span *ngIf="linkType == linkTypes.None" class="lead">
{{object.name}}
</span>
<span *ngIf="object.archivedItemsCount >= 0" class="lead archived-items-lead">[{{object.archivedItemsCount}}]</span>
<div *ngIf="object.shortDescription" class="text-muted abstract-text">
{{object.shortDescription}}
</div>