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

100% Statements 15/15
100% Branches 0/0
100% Functions 2/2
100% Lines 14/14

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 363x 3x 3x 3x   3x                             3x 27x 27x 27x   27x 27x   27x 27x     1x      
import { ArticleHistoryService, trackByFn } from '../../../services/articles/article-history/article-history.service';
import { ArticlesHistoryItemComponent } from '../articles-history-item/articles-history-item.component';
import { InworkItemComponent } from '../inwork-item/inwork-item.component';
import { ChangeDetectionStrategy, Component, inject, input, output } from '@angular/core';
import { ArticleHistoryItem } from '@drevo-web/shared';
import { SpinnerComponent, VirtualScrollerComponent, VirtualScrollerItemDirective } from '@drevo-web/ui';
 
@Component({
    selector: 'app-article-history-list',
    imports: [
        ArticlesHistoryItemComponent,
        InworkItemComponent,
        SpinnerComponent,
        VirtualScrollerComponent,
        VirtualScrollerItemDirective,
    ],
    templateUrl: './article-history-list.component.html',
    styleUrl: './article-history-list.component.scss',
    changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ArticleHistoryListComponent {
    readonly selectedVersionIds = input<ReadonlySet<number>>(new Set());
    readonly selectable = input(false);
    readonly canCompare = input(false);
 
    readonly selectItem = output<ArticleHistoryItem>();
    readonly compareItems = output<void>();
 
    protected readonly service = inject(ArticleHistoryService);
    protected readonly trackByFn = trackByFn;
 
    onCancelInwork(title: string): void {
        this.service.onCancelInwork(title);
    }
}