• 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

27.78
/src/shared/directives/thy-drag-drop.directive.ts
1
import { Directive, AfterContentInit, ContentChildren, QueryList, OnDestroy } from '@angular/core';
2
import { CdkDrag } from '@angular/cdk/drag-drop';
3
import { merge, Subject } from 'rxjs';
4
import { Constructor, MixinBase, mixinUnsubscribe, ThyUnsubscribe } from 'ngx-tethys/core';
5
import { takeUntil, startWith } from 'rxjs/operators';
6

7
const _MixinBase: Constructor<ThyUnsubscribe> & typeof MixinBase = mixinUnsubscribe(MixinBase);
1✔
8

9
/**
10
 * @private
11
 */
1✔
12
@Directive({
13
    selector: '[thyDragDrop]',
×
14
    standalone: true
15
})
16
export class ThyDragDropDirective extends _MixinBase implements AfterContentInit, OnDestroy {
×
17
    @ContentChildren(CdkDrag, { descendants: true }) draggables: QueryList<CdkDrag>;
×
18

×
19
    constructor() {
×
20
        super();
×
21
    }
×
22

23
    ngAfterContentInit() {
24
        if (this.draggables) {
25
            this.draggables.changes.pipe(startWith(this.draggables)).subscribe(() => {
×
26
                super.ngOnDestroy();
27
                this.ngUnsubscribe$ = new Subject();
×
28
                merge(
29
                    ...this.draggables.toArray().map(dragRef => {
30
                        return dragRef.started;
×
31
                    })
32
                )
33
                    .pipe(takeUntil(this.ngUnsubscribe$))
34
                    .subscribe(() => {
35
                        document.body.classList.add('thy-dragging-body');
36
                    });
×
37

38
                merge(...this.draggables.toArray().map(dragRef => dragRef.released))
1✔
39
                    .pipe(takeUntil(this.ngUnsubscribe$))
1✔
40
                    .subscribe(() => {
41
                        document.body.classList.remove('thy-dragging-body');
42
                    });
43
            });
1✔
44
        }
45
    }
46

47
    ngOnDestroy() {
48
        super.ngOnDestroy();
49
    }
50
}
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