Skip to content

Commit ba44214

Browse files
authored
Merge branch 'master' into puppeteer
2 parents 0425a58 + a70a8c3 commit ba44214

File tree

7 files changed

+81
-3
lines changed

7 files changed

+81
-3
lines changed

.github/workflows/nodejs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ jobs:
5454
npm run test:i18n:dist
5555
- name: Publish to coveralls.io
5656
if: github.repository == 'IgniteUI/igniteui-angular' && matrix.node-version == '16.x'
57-
uses: coverallsapp/github-action@v1.1.2
57+
uses: coverallsapp/github-action@v1.2.1
5858
with:
5959
github-token: ${{ github.token }}

projects/igniteui-angular/src/lib/badge/badge.component.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,24 @@ export class IgxBadgeComponent {
133133
@HostBinding('class.igx-badge')
134134
public cssClass = 'igx-badge';
135135

136+
/**
137+
* Sets a square shape to the badge, if `shape` is set to `square`.
138+
* By default the shape of the badge is rounded.
139+
*
140+
* @example
141+
* ```html
142+
* <igx-badge shape="square"></igx-badge>
143+
* ```
144+
*/
145+
@Input()
146+
public shape: 'rounded' | 'square' = 'rounded';
147+
148+
/** @hidden @internal */
149+
@HostBinding('class.igx-badge--square')
150+
public get _squareShape(): boolean {
151+
return this.shape === 'square';
152+
}
153+
136154
/**
137155
* Sets/gets the aria-label attribute value.
138156
*

projects/igniteui-angular/src/lib/core/styles/components/badge/_badge-component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
@extend %igx-badge--error !optional;
4040
}
4141

42+
@include m(square) {
43+
@extend %igx-badge--square !optional;
44+
}
45+
4246
@include m(hidden) {
4347
@extend %igx-badge--hidden !optional;
4448
}

projects/igniteui-angular/src/lib/core/styles/components/badge/_badge-theme.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@
127127
}
128128
}
129129

130+
%igx-badge--square {
131+
border-radius: 0;
132+
}
133+
130134
%igx-badge-value {
131135
white-space: nowrap;
132136
padding: $badge-value-padding;

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4758,8 +4758,8 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
47584758
this.crudService.endEdit(true);
47594759
this.gridAPI.addRowToData(data);
47604760

4761-
this.rowAddedNotifier.next({ data: data, owner: this });
47624761
this.pipeTrigger++;
4762+
this.rowAddedNotifier.next({ data: data, owner: this });
47634763
this.notifyChanges();
47644764
}
47654765

@@ -5065,6 +5065,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
50655065
this.crudService.endEdit(true);
50665066
this.selectionService.clearHeaderCBState();
50675067
this.summaryService.clearSummaryCache();
5068+
this.summaryPipeTrigger++;
50685069
this.cdr.detectChanges();
50695070
}
50705071

projects/igniteui-angular/src/lib/grids/grid/grid-summary.spec.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,6 +2284,57 @@ describe('IgxGrid - Summaries #grid', () => {
22842284
GridSummaryFunctions.verifyColumnSummaries(summaryRow, 5, ['Count'], ['3']);
22852285
});
22862286

2287+
it('CRUD: Adding grouped item via UI should update group summary accordingly', () => {
2288+
grid.rowEditable = true;
2289+
fix.detectChanges();
2290+
const newRow = {
2291+
ID: 777,
2292+
ParentID: 17,
2293+
Name: 'New Employee',
2294+
HireDate: new Date(2019, 3, 3),
2295+
Age: 19,
2296+
OnPTO: true
2297+
};
2298+
const rows = grid.rowList.toArray();
2299+
rows[1].beginAddRow();
2300+
2301+
const animationElem = fix.nativeElement.querySelector('.igx-grid__tr--inner');
2302+
const endEvent = new AnimationEvent('animationend');
2303+
animationElem.dispatchEvent(endEvent);
2304+
2305+
fix.detectChanges();
2306+
2307+
let addRow = grid.gridAPI.get_row_by_index(2);
2308+
expect(addRow.addRowUI).toBeTrue();
2309+
2310+
let cell = grid.getCellByColumn(2, 'ParentID');
2311+
cell.update(newRow.ParentID);
2312+
cell = grid.getCellByColumn(2, 'Name');
2313+
cell.update(newRow.Name);
2314+
cell = grid.getCellByColumn(2, 'HireDate');
2315+
cell.update(newRow.HireDate);
2316+
cell = grid.getCellByColumn(2, 'Age');
2317+
cell.update(newRow.Age);
2318+
cell = grid.getCellByColumn(2, 'OnPTO');
2319+
cell.update(newRow.OnPTO);
2320+
2321+
fix.detectChanges();
2322+
grid.endEdit(true);
2323+
2324+
fix.detectChanges();
2325+
2326+
addRow = grid.gridAPI.get_row_by_index(2);
2327+
expect(addRow.addRowUI).toBeFalse();
2328+
2329+
let summaryRow = GridSummaryFunctions.getSummaryRowByDataRowIndex(fix, 4);
2330+
GridSummaryFunctions.verifyColumnSummaries(summaryRow, 0, [], []);
2331+
GridSummaryFunctions.verifyColumnSummaries(summaryRow, 1, ['Count', 'Min', 'Max', 'Sum', 'Avg'], ['3', '17', '17', '51', '17']);
2332+
GridSummaryFunctions.verifyColumnSummaries(summaryRow, 2, ['Count'], ['3']);
2333+
GridSummaryFunctions.verifyColumnSummaries(summaryRow, 3,
2334+
['Count', 'Earliest', 'Latest'], ['3', 'Dec 18, 2007', 'Apr 3, 2019']);
2335+
GridSummaryFunctions.verifyColumnSummaries(summaryRow, 5, ['Count'], ['3']);
2336+
});
2337+
22872338
it('CRUD: Add not grouped item', () => {
22882339
const newRow = {
22892340
ID: 777,

src/app/badge/badge.sample.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ <h4 class="sample-title">In conjunction with the
99

1010
<div class="avatar-sample">
1111
<igx-avatar icon="face" size="medium"></igx-avatar>
12-
<igx-badge value="8"></igx-badge>
12+
<igx-badge value="8" shape="square"></igx-badge>
1313
</div>
1414

1515
<div class="avatar-sample">

0 commit comments

Comments
 (0)