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

IgniteUI / igniteui-angular / 13331632524

14 Feb 2025 02:51PM CUT coverage: 22.015% (-69.6%) from 91.622%
13331632524

Pull #15372

github

web-flow
Merge d52d57714 into bcb78ae0a
Pull Request #15372: chore(*): test ci passing

1990 of 15592 branches covered (12.76%)

431 of 964 new or added lines in 18 files covered. (44.71%)

19956 existing lines in 307 files now uncovered.

6452 of 29307 relevant lines covered (22.02%)

249.17 hits per line

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

21.15
/projects/igniteui-angular/src/lib/grids/grid.directives.ts
1
import { Directive, ElementRef, Renderer2, NgZone, HostBinding, TemplateRef } from '@angular/core';
2
import { IgxDropDirective } from '../directives/drag-drop/drag-drop.directive';
3
import { IgxColumnMovingDragDirective } from './moving/moving.drag.directive';
4
import { IgxGroupByAreaDirective } from './grouping/group-by-area.directive';
5
import {
6
    ColumnType,
7
    IgxGridMasterDetailContext,
8
    IgxGroupByRowTemplateContext,
9
    IgxGridHeaderTemplateContext,
10
    IgxGridRowTemplateContext,
11
    IgxGridTemplateContext
12
} from './common/grid.interface';
13

14
/**
15
 * @hidden
16
 */
17
@Directive({
18
    selector: '[igxGroupByRow]',
19
    standalone: true
20
})
21
export class IgxGroupByRowTemplateDirective {
2✔
22
    public static ngTemplateContextGuard(_dir: IgxGroupByRowTemplateDirective,
23
        ctx: unknown): ctx is IgxGroupByRowTemplateContext {
24
        return true
×
25
    }
26

UNCOV
27
    constructor(public template: TemplateRef<IgxGroupByRowTemplateContext>) { }
×
28

29
}
30

31
/**
32
 * @hidden
33
 */
34
@Directive({
35
    selector: '[igxGridDetail]',
36
    standalone: true
37
})
38
export class IgxGridDetailTemplateDirective {
2✔
39
    public static ngTemplateContextGuard(_dir: IgxGridDetailTemplateDirective,
40
        ctx: unknown): ctx is IgxGridMasterDetailContext {
41
        return true
×
42
    }
43
}
44

45
/**
46
 * @hidden
47
 */
48
@Directive({
49
    selector: '[igxRowExpandedIndicator]',
50
    standalone: true
51
})
52
export class IgxRowExpandedIndicatorDirective {
2✔
53
    public static ngTemplateContextGuard(_directive: IgxRowExpandedIndicatorDirective,
54
            context: unknown): context is IgxGridRowTemplateContext {
55
        return true
×
56
    }
57
}
58

59
/**
60
 * @hidden
61
 */
62
@Directive({
63
    selector: '[igxRowCollapsedIndicator]',
64
    standalone: true
65
})
66
export class IgxRowCollapsedIndicatorDirective {
2✔
67
    public static ngTemplateContextGuard(_directive: IgxRowCollapsedIndicatorDirective,
68
        context: unknown): context is IgxGridRowTemplateContext {
69
        return true
×
70
    }
71
}
72

73

74
/**
75
 * @hidden
76
 */
77
@Directive({
78
    selector: '[igxHeaderExpandedIndicator]',
79
    standalone: true
80
})
81
export class IgxHeaderExpandedIndicatorDirective {
2✔
82
    public static ngTemplateContextGuard(_directive: IgxHeaderExpandedIndicatorDirective,
83
        context: unknown): context is IgxGridTemplateContext {
84
        return true
×
85
    }
86
}
87

88
/**
89
 * @hidden
90
 */
91
@Directive({
92
    selector: '[igxHeaderCollapsedIndicator]',
93
    standalone: true
94
})
95
export class IgxHeaderCollapsedIndicatorDirective {
2✔
96
    public static ngTemplateContextGuard(_directive: IgxHeaderCollapsedIndicatorDirective,
97
        context: unknown): context is IgxGridTemplateContext {
98
        return true
×
99
    }
100
}
101

102
/**
103
 * @hidden
104
 */
105
@Directive({
106
    selector: '[igxExcelStyleHeaderIcon]',
107
    standalone: true
108
})
109
export class IgxExcelStyleHeaderIconDirective {
2✔
110
    public static ngTemplateContextGuard(_directive: IgxExcelStyleHeaderIconDirective,
111
        context: unknown): context is IgxGridHeaderTemplateContext {
112
        return true
×
113
    }
114
}
115

116
/**
117
 * @hidden
118
 */
119
@Directive({
120
    selector: '[igxSortHeaderIcon]',
121
    standalone: true
122
})
123
export class IgxSortHeaderIconDirective {
2✔
124
    public static ngTemplateContextGuard(_directive: IgxSortHeaderIconDirective,
125
        context: unknown): context is IgxGridHeaderTemplateContext {
126
        return true
×
127
    }
128
}
129

130
/**
131
 * @hidden
132
 */
133
@Directive({
134
    selector: '[igxSortAscendingHeaderIcon]',
135
    standalone: true
136
})
137
export class IgxSortAscendingHeaderIconDirective {
2✔
138
    public static ngTemplateContextGuard(_directive: IgxSortAscendingHeaderIconDirective,
139
        context: unknown): context is IgxGridHeaderTemplateContext {
140
        return true
×
141
    }
142
}
143

144
/**
145
 * @hidden
146
 */
147
@Directive({
148
    selector: '[igxSortDescendingHeaderIcon]',
149
    standalone: true
150
})
151
export class IgxSortDescendingHeaderIconDirective {
2✔
152
    public static ngTemplateContextGuard(_directive: IgxSortDescendingHeaderIconDirective,
153
        context: unknown): context is IgxGridHeaderTemplateContext {
154
        return true
×
155
    }
156
}
157

158
/**
159
 * @hidden
160
 */
161
@Directive({
162
    selector: '[igxGroupAreaDrop]',
163
    standalone: true
164
})
165
export class IgxGroupAreaDropDirective extends IgxDropDirective {
2✔
166

167
    @HostBinding('class.igx-drop-area--hover')
UNCOV
168
    public hovered = false;
×
169

170
    constructor(
UNCOV
171
        private groupArea: IgxGroupByAreaDirective,
×
UNCOV
172
        private elementRef: ElementRef<HTMLElement>,
×
173
        renderer: Renderer2,
174
        zone: NgZone) {
UNCOV
175
        super(elementRef, renderer, zone);
×
176
    }
177

178
    public override onDragEnter(event) {
UNCOV
179
        const drag: IgxColumnMovingDragDirective = event.detail.owner;
×
UNCOV
180
        const column: ColumnType = drag.column;
×
UNCOV
181
        if (!this.columnBelongsToGrid(column)) {
×
182
            return;
×
183
        }
184

UNCOV
185
        const isGrouped = this.groupArea.expressions
×
186
            ? this.groupArea.expressions.findIndex((item) => item.fieldName === column.field) !== -1
×
187
            : false;
UNCOV
188
        if (column.groupable && !isGrouped && !column.columnGroup && !!column.field) {
×
UNCOV
189
            drag.icon.innerText = 'group_work';
×
UNCOV
190
            this.hovered = true;
×
191
        } else {
UNCOV
192
            drag.icon.innerText = 'block';
×
UNCOV
193
            this.hovered = false;
×
194
        }
195
    }
196

197
    public override onDragLeave(event) {
UNCOV
198
        const drag: IgxColumnMovingDragDirective = event.detail.owner;
×
UNCOV
199
        const column: ColumnType = drag.column;
×
UNCOV
200
        if (!this.columnBelongsToGrid(column)) {
×
201
            return;
×
202
        }
UNCOV
203
        event.detail.owner.icon.innerText = 'block';
×
UNCOV
204
        this.hovered = false;
×
205
    }
206

207
    private closestParentByAttr(elem, attr) {
UNCOV
208
        return elem.hasAttribute(attr) ?
×
209
            elem :
210
            this.closestParentByAttr(elem.parentElement, attr);
211
    }
212

213
    private columnBelongsToGrid(column: ColumnType) {
UNCOV
214
        const elem = this.elementRef.nativeElement;
×
UNCOV
215
        const closestGridID = this.closestParentByAttr(elem, 'igxGroupAreaDrop').getAttribute('gridId');
×
UNCOV
216
        if (!column) {
×
217
            return false;
×
218
        } else {
UNCOV
219
            const grid = column.grid;
×
UNCOV
220
            if (!grid || grid.id !== closestGridID) {
×
221
                return false;
×
222
            }
UNCOV
223
            return true;
×
224
        }
225
    }
226
}
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