All files / app/codeCharta/ui/customConfigs/customConfigList/customConfigItemGroup customConfig2ApplicableColor.pipe.ts

100% Statements 8/8
100% Branches 4/4
100% Functions 2/2
100% Lines 7/7

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 197x 7x     7x           7x 38x     38x 38x      
import { Pipe, PipeTransform } from "@angular/core"
import { State } from "@ngrx/store"
import { CcState } from "../../../../codeCharta.model"
import { CustomConfigItem } from "../../customConfigs.component"
import { getMissingCustomConfigModeAndMaps } from "./getMissingCustomConfigModeAndMaps"
 
@Pipe({
    name: "customConfig2ApplicableColor",
    standalone: true
})
export class CustomConfig2ApplicableColor implements PipeTransform {
    constructor(private state: State<CcState>) {}
 
    transform(customConfig: CustomConfigItem): string {
        const { mapSelectionMode, mapNames } = getMissingCustomConfigModeAndMaps(customConfig, this.state.getValue())
        return mapNames.length > 0 || mapSelectionMode.length > 0 ? "rgb(204, 204, 204)" : "rgba(0, 0, 0, 0.87)"
    }
}