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

atinc / ngx-tethys / 3b40a702-4b4d-4ddb-81a7-a96baae6d682

08 Nov 2024 05:40AM UTC coverage: 90.395% (-0.04%) from 90.431%
3b40a702-4b4d-4ddb-81a7-a96baae6d682

push

circleci

why520crazy
Merge branch 'master' into feat-theme

5503 of 6730 branches covered (81.77%)

Branch coverage included in aggregate %.

424 of 431 new or added lines in 171 files covered. (98.38%)

344 existing lines in 81 files now uncovered.

13150 of 13905 relevant lines covered (94.57%)

999.86 hits per line

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

85.29
/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);
15

43✔
16
    animationState: string;
43✔
17

43✔
18
    config: TConfig;
19

20
    iconName = '';
43✔
21

22
    private closeTimer: any;
23

24
    private queue: ThyAbstractMessageQueue;
25

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

3✔
31
    constructor(queue: ThyAbstractMessageQueue) {
2✔
32
        this.queue = queue;
33
    }
34

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

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

47
    @HostListener('mouseenter')
48
    mouseenter() {
43✔
49
        if (this.config.pauseOnHover) {
41✔
50
            this.clearCloseTimer();
34✔
51
        }
34✔
52
    }
53

54
    @HostListener('mouseleave')
55
    mouseleave() {
56
        if (this.config.pauseOnHover) {
79✔
57
            this.createCloseTimer();
58
        }
59
    }
43✔
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

© 2026 Coveralls, Inc