All files / app/codeCharta/ui/customConfigs customConfigHelper.service.ts

64.28% Statements 9/14
100% Branches 0/0
0% Functions 0/3
61.53% Lines 8/13

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 247x 7x 7x 7x 7x 7x 7x       7x                          
import { combineLatest, map } from "rxjs"
import { CustomConfigHelper } from "../../util/customConfigHelper"
import { getDownloadableCustomConfigs } from "./downloadCustomConfigsButton/getDownloadableCustomConfigs"
import { Injectable } from "@angular/core"
import { getCustomConfigItemGroups } from "./customConfigList/getCustomConfigItemGroups"
import { visibleFilesBySelectionModeSelector } from "./visibleFilesBySelectionMode.selector"
import { Store } from "@ngrx/store"
import { CcState } from "../../codeCharta.model"
 
@Injectable({ providedIn: "root" })
export class CustomConfigHelperService {
    readonly downloadableCustomConfigs$ = combineLatest([
        this.store.select(visibleFilesBySelectionModeSelector),
        CustomConfigHelper.customConfigChange$
    ]).pipe(map(([visibleFilesBySelectionMode]) => getDownloadableCustomConfigs(visibleFilesBySelectionMode)))
 
    readonly customConfigItemGroups$ = combineLatest([
        this.store.select(visibleFilesBySelectionModeSelector),
        CustomConfigHelper.customConfigChange$
    ]).pipe(map(([visibleFilesBySelectionMode]) => getCustomConfigItemGroups(visibleFilesBySelectionMode)))
 
    constructor(private store: Store<CcState>) {}
}