All files / app/shared/components/article-history-list article-history-list.component.html

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 523x                                                                                                      
@if (service.isLoading()) {
    <div class="history-loading">
        <ui-spinner />
    </div>
}
 
@if (!service.isLoading() && service.hasError()) {
    <p
        class="history-error"
        data-testid="history-error"
    >
        Не удалось загрузить данные
    </p>
}
 
@if (!service.isLoading() && !service.hasError() && service.hasItems()) {
    <ui-virtual-scroller
        [items]="service.displayItems()"
        [totalItems]="service.displayTotalItems()"
        [isLoading]="service.isLoadingMore()"
        [trackByFn]="trackByFn"
        (loadMore)="service.onLoadMore()"
    >
        <ng-template
            uiVirtualScrollerItem
            let-item
        >
            @if (item.type === 'header') {
                <div class="history-date-header">{{ item.date }}</div>
            } @else {
                <app-articles-history-item
                    [item]="item.data"
                    [selectable]="selectable()"
                    [selected]="selectedVersionIds().has(item.data.versionId)"
                    [canCompare]="canCompare()"
                    (selectItem)="selectItem.emit($event)"
                    (compare)="compareItems.emit()"
                />
            }
        </ng-template>
    </ui-virtual-scroller>
}
 
@if (!service.isLoading() && !service.hasError() && !service.hasItems()) {
    <p
        class="history-empty"
        data-testid="history-empty"
    >
        Нет записей
    </p>
}