• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

atinc / ngx-tethys / d9ae709b-3c27-4b69-b125-b8b80b54f90b

pending completion
d9ae709b-3c27-4b69-b125-b8b80b54f90b

Pull #2757

circleci

mengshuicmq
fix: fix code review
Pull Request #2757: feat(color-picker): color-picker support disabled (#INFR-8645)

98 of 6315 branches covered (1.55%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

2392 of 13661 relevant lines covered (17.51%)

83.12 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

20.59
/src/message/abstract/abstract-message.component.ts
1
import { Directive, HostListener, Input, NgZone, OnDestroy, OnInit } from '@angular/core';
2
import { ThyMessageBaseConfig } from '../message.config';
3
import { ThyAbstractMessageQueue } from './abstract-message-queue.service';
4

1✔
5
export const ANIMATION_IN_DURATION = 100;
1✔
6
export const ANIMATION_OUT_DURATION = 150;
1✔
7
export const HIDE_STYLE = { transform: 'translateX(0)', opacity: 0, height: 0, paddingTop: 0, paddingBottom: 0, margin: 0 };
8

9
/**
10
 * @internal
1✔
11
 */
12
@Directive()
×
13
export class ThyAbstractMessageComponent<TConfig extends ThyMessageBaseConfig> implements OnInit, OnDestroy {
14
    animationState: string;
15

×
16
    config: TConfig;
×
17

×
18
    iconName = '';
19

20
    private closeTimer: any;
×
21

22
    private queue: ThyAbstractMessageQueue;
23

24
    @Input()
25
    set thyConfig(value: TConfig) {
26
        this.config = value;
×
27
    }
×
28

29
    constructor(private _ngZone: NgZone, queue: ThyAbstractMessageQueue) {
30
        this.queue = queue;
×
31
    }
×
32

33
    ngOnInit() {
34
        const iconName = {
35
            success: 'check-circle-fill',
×
36
            info: 'info-circle-fill',
×
37
            warning: 'waring-fill',
38
            error: 'close-circle-fill'
39
        };
40

×
41
        this.iconName = iconName[this.config.type];
×
42
        this.createCloseTimer();
×
43
    }
×
44

45
    @HostListener('mouseenter')
46
    mouseenter() {
47
        if (this.config.pauseOnHover) {
48
            this.clearCloseTimer();
×
49
        }
×
50
    }
×
51

×
52
    @HostListener('mouseleave')
53
    mouseleave() {
54
        if (this.config.pauseOnHover) {
55
            this.createCloseTimer();
56
        }
×
57
    }
58

59
    close() {
×
60
        this._ngZone.runOutsideAngular(() => {
61
            this.animationState = 'componentHide';
1✔
62
            setTimeout(() => {
63
                this.queue.remove(this.config.id);
64
            }, ANIMATION_OUT_DURATION);
65
        });
1✔
66
    }
67

68
    private createCloseTimer() {
69
        if (this.config.duration) {
70
            this.closeTimer = setInterval(() => {
71
                this.clearCloseTimer();
1✔
72
                this.close();
73
            }, this.config.duration);
74
        }
75
    }
76

77
    private clearCloseTimer() {
78
        clearInterval(this.closeTimer);
79
    }
80

81
    ngOnDestroy() {
82
        this.clearCloseTimer();
83
    }
84
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc