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

atinc / ngx-tethys / 68ef226c-f83e-44c1-b8ed-e420a83c5d84

28 May 2025 10:31AM UTC coverage: 10.352% (-80.0%) from 90.316%
68ef226c-f83e-44c1-b8ed-e420a83c5d84

Pull #3460

circleci

pubuzhixing8
chore: xxx
Pull Request #3460: refactor(icon): migrate signal input #TINFR-1476

132 of 6823 branches covered (1.93%)

Branch coverage included in aggregate %.

10 of 14 new or added lines in 1 file covered. (71.43%)

11648 existing lines in 344 files now uncovered.

2078 of 14525 relevant lines covered (14.31%)

6.69 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, inject } 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
    private _ngZone = inject(NgZone);
UNCOV
15

×
UNCOV
16
    animationState: string;
×
UNCOV
17

×
18
    config: TConfig;
19

UNCOV
20
    iconName = '';
×
21

22
    private closeTimer: any;
23

24
    private queue: ThyAbstractMessageQueue;
25

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

×
UNCOV
31
    constructor(queue: ThyAbstractMessageQueue) {
×
32
        this.queue = queue;
33
    }
34

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

×
UNCOV
43
        this.iconName = iconName[this.config.type];
×
44
        this.createCloseTimer();
45
    }
46

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

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

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

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

79
    private clearCloseTimer() {
80
        clearInterval(this.closeTimer);
81
    }
82

83
    ngOnDestroy() {
84
        this.clearCloseTimer();
85
    }
86
}
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