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

atinc / ngx-tethys / ba7e05e2-37c0-44c6-8725-6f617aa0d43e

pending completion
ba7e05e2-37c0-44c6-8725-6f617aa0d43e

Pull #2756

circleci

huanhuanwa
test(color-picker): add test #INFR-8673
Pull Request #2756: feat(color-picker): add popoverRef param when panel open and close #INFR-8673

187 of 6315 branches covered (2.96%)

Branch coverage included in aggregate %.

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

2645 of 13660 relevant lines covered (19.36%)

83.2 hits per line

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

10.71
/src/message/message.service.ts
1
import { Overlay } from '@angular/cdk/overlay';
2
import { Inject, Injectable, Injector, TemplateRef } from '@angular/core';
3
import { ThyMessageContainerComponent } from './message-container.component';
4
import { ThyMessageRef } from './message-ref';
5
import { ThyMessageQueue } from './message-queue.service';
6
import { ThyGlobalMessageConfig, ThyMessageConfig, THY_MESSAGE_DEFAULT_CONFIG, THY_MESSAGE_DEFAULT_CONFIG_VALUE } from './message.config';
7
import { ThyAbstractMessageService } from './abstract';
8

9
@Injectable({
1✔
10
    providedIn: 'root'
11
})
×
12
export class ThyMessageService extends ThyAbstractMessageService<ThyMessageContainerComponent> {
×
13
    private _lastMessageId = 0;
×
14

×
15
    private defaultConfig: ThyGlobalMessageConfig;
16

17
    constructor(
18
        overlay: Overlay,
19
        injector: Injector,
20
        private messageQueue: ThyMessageQueue,
21
        @Inject(THY_MESSAGE_DEFAULT_CONFIG) config: ThyGlobalMessageConfig
22
    ) {
23
        super(overlay, injector, messageQueue);
×
24
        this.defaultConfig = {
×
25
            ...THY_MESSAGE_DEFAULT_CONFIG_VALUE,
26
            ...config
27
        };
28
    }
29

30
    /**
31
     * 打开 success 类型的 Message
32
     */
33
    success(content: string | TemplateRef<any>, config?: ThyMessageConfig): ThyMessageRef {
×
34
        return this.show({
×
35
            ...(config || {}),
36
            type: 'success',
37
            content
38
        });
39
    }
40

41
    /**
42
     * 打开 error 类型的 Message
43
     */
×
44
    error(content: string | TemplateRef<any>, config?: ThyMessageConfig): ThyMessageRef {
×
45
        return this.show({
46
            ...(config || {}),
47
            type: 'error',
48
            content
49
        });
50
    }
51

52
    /**
53
     * 打开 info 类型的 Message
×
54
     */
×
55
    info(content: string | TemplateRef<any>, config?: ThyMessageConfig): ThyMessageRef {
56
        return this.show({
57
            ...(config || {}),
58
            type: 'info',
59
            content
60
        });
61
    }
62

63
    /**
×
64
     * 打开 warning 类型的 Message
×
65
     */
66
    warning(content: string | TemplateRef<any>, config?: ThyMessageConfig): ThyMessageRef {
67
        return this.show({
68
            ...(config || {}),
69
            type: 'warning',
70
            content
×
71
        });
×
72
    }
×
73

×
74
    /**
×
75
     * 打开 loading 类型的 Message
76
     */
77
    loading(content: string | TemplateRef<any>, config?: ThyMessageConfig): ThyMessageRef {
×
78
        return this.show({
79
            ...(config || {}),
1✔
80
            type: 'loading',
81
            content
82
        });
83
    }
84

85
    protected show(config: ThyMessageConfig): ThyMessageRef {
86
        this.container = this.createContainer(ThyMessageContainerComponent);
1✔
87

88
        const messageConfig = this.formatOptions(config);
89
        const messageRef = new ThyMessageRef(messageConfig, this.overlayRef, this.messageQueue);
90
        this.messageQueue.add(messageRef);
91
        return messageRef;
92
    }
93

94
    private formatOptions(config: ThyMessageConfig) {
95
        return Object.assign({ id: String(this._lastMessageId++) }, this.defaultConfig, config);
96
    }
97
}
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