Skip to content

Commit 8bcceff

Browse files
committed
Empty communities and collections items count are now shown. Show communities items count at the home page.
1 parent 8cc9606 commit 8bcceff

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/app/community-list-page/community-list/community-list.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ <h5 class="align-middle pt-2">
3737
<a [routerLink]="node.route" class="lead">
3838
{{node.name}}
3939
</a>
40-
<span *ngIf="node.payload.archivedItemsCount" class="archived-items-lead">[{{node.payload.archivedItemsCount}}]</span>
40+
<span *ngIf="node.payload.archivedItemsCount >= 0" class="archived-items-lead">[{{node.payload.archivedItemsCount}}]</span>
4141
</h5>
4242
</div>
4343
<ds-truncatable [id]="node.id">

src/app/shared/object-list/collection-list-element/collection-list-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<span *ngIf="linkType == linkTypes.None" class="lead">
55
{{object.name}}
66
</span>
7-
<span *ngIf="object.archivedItemsCount" class="archived-items-lead">[{{object.archivedItemsCount}}]<span>
7+
<span *ngIf="object.archivedItemsCount >= 0" class="lead archived-items-lead">[{{object.archivedItemsCount}}]</span>
88
<div *ngIf="object.shortDescription" class="text-muted abstract-text">
99
{{object.shortDescription}}
1010
</div>

src/app/shared/object-list/collection-list-element/collection-list-element.component.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ const mockCollectionWithArchivedItems: Collection = Object.assign(new Collection
1818
}, archivedItemsCount: 1
1919
});
2020

21-
const mockCollectionWithoutArchivedItems: Collection = Object.assign(new Collection(), {
21+
const mockCollectionWithArchivedItemsDisabledAtBackend: Collection = Object.assign(new Collection(), {
2222
metadata: {
2323
'dc.title': [
2424
{
2525
language: 'en_US',
2626
value: 'Test title'
2727
}
2828
]
29-
}, archivedItemsCount: 0
29+
}, archivedItemsCount: -1
3030
});
3131

3232

@@ -108,9 +108,9 @@ describe('CollectionListElementComponent', () => {
108108
});
109109
});
110110

111-
describe('When the collection has no archived items', () => {
111+
describe('When the collection archived items are disabled at backend', () => {
112112
beforeEach(() => {
113-
collectionListElementComponent.object = mockCollectionWithoutArchivedItems;
113+
collectionListElementComponent.object = mockCollectionWithArchivedItemsDisabledAtBackend;
114114
fixture.detectChanges();
115115
});
116116

src/app/shared/object-list/community-list-element/community-list-element.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<span *ngIf="linkType == linkTypes.None" class="lead">
55
{{object.name}}
66
</span>
7+
<span *ngIf="object.archivedItemsCount >= 0" class="lead archived-items-lead">[{{object.archivedItemsCount}}]</span>
78
<div *ngIf="object.shortDescription" class="text-muted abstract-text">
89
{{object.shortDescription}}
910
</div>

0 commit comments

Comments
 (0)