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

atinc / ngx-tethys / 82f575a8-2f12-4689-80e6-398f6f1685a3

15 Aug 2024 08:19AM UTC coverage: 90.473%. Remained the same
82f575a8-2f12-4689-80e6-398f6f1685a3

push

circleci

web-flow
build: bump prettier to 3.3.3 and other deps, refactor notify use @if (#3152)

5502 of 6726 branches covered (81.8%)

Branch coverage included in aggregate %.

112 of 116 new or added lines in 57 files covered. (96.55%)

59 existing lines in 15 files now uncovered.

13254 of 14005 relevant lines covered (94.64%)

997.41 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 } 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

45✔
16
    config: TConfig;
45✔
17

45✔
18
    iconName = '';
19

20
    private closeTimer: any;
45✔
21

22
    private queue: ThyAbstractMessageQueue;
23

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

29
    constructor(
30
        private _ngZone: NgZone,
3✔
31
        queue: ThyAbstractMessageQueue
2✔
32
    ) {
33
        this.queue = queue;
34
    }
UNCOV
35

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

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

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

55
    @HostListener('mouseleave')
56
    mouseleave() {
81✔
57
        if (this.config.pauseOnHover) {
58
            this.createCloseTimer();
59
        }
45✔
60
    }
61

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

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

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

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