Skip to content

Commit

Permalink
Merge branch 'master' into vslavov/expansion-panel-cancel-interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktorSlavov authored Oct 6, 2020
2 parents b6ba3ce + 1598e52 commit 5015ca0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4378,7 +4378,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
public refreshGridState(args?) {
this.endEdit(true);
this.selectionService.clearHeaderCBState();
this.summaryService.clearSummaryCache(args);
this.summaryService.clearSummaryCache();
}

// TODO: We have return values here. Move them to event args ??
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
import { Directive, ElementRef, HostListener } from '@angular/core';
import { GridBaseAPIService } from './api.service';
import { GridType } from './common/grid.interface';

/** @hidden */
/** @hidden @internal */
@Directive({
selector: '[igxRowEdit]'
})
export class IgxRowEditTemplateDirective { }

/** @hidden */
/** @hidden @internal */
@Directive({
selector: '[igxRowEditText]'
})
export class IgxRowEditTextDirective { }

/** @hidden */
/** @hidden @internal */
@Directive({
selector: '[igxRowEditActions]'
})
export class IgxRowEditActionsDirective { }


// TODO: Refactor circular ref, deps and logic
/** @hidden */
/** @hidden @internal */
@Directive({
selector: `[igxRowEditTabStop]`
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { async, TestBed, fakeAsync } from '@angular/core/testing';
import { configureTestSuite } from '../../test-utils/configure-suite';
import { DebugElement } from '@angular/core';
import { GridFunctions } from '../../test-utils/grid-functions.spec';
import { GridFunctions, GridSummaryFunctions } from '../../test-utils/grid-functions.spec';
import {
IgxAddRowComponent
} from '../../test-utils/grid-samples.spec';
Expand All @@ -14,6 +14,7 @@ import { IgxActionStripModule } from '../../action-strip/action-strip.module';
import { UIInteractions, wait } from '../../test-utils/ui-interactions.spec';

describe('IgxGrid - Row Adding #grid', () => {
const SUMMARY_ROW = 'igx-grid-summary-row';
let fixture;
let grid: IgxGridComponent;
let gridContent: DebugElement;
Expand Down Expand Up @@ -196,5 +197,21 @@ describe('IgxGrid - Row Adding #grid', () => {
expect(rowOffsets.top >= gridOffsets.top && rowOffsets.bottom <= gridOffsets.bottom).toBeTruthy();
});

it('should update summaries after row is added via the UI.', () => {
grid.getColumnByName('ID').hasSummary = true;
fixture.detectChanges();
let summaryRow = fixture.debugElement.query(By.css(SUMMARY_ROW));
GridSummaryFunctions.verifyColumnSummaries(summaryRow, 0, ['Count'], ['27']);

grid.rowList.first.beginAddRow();
fixture.detectChanges();

grid.endEdit(true);
fixture.detectChanges();

summaryRow = fixture.debugElement.query(By.css(SUMMARY_ROW));
GridSummaryFunctions.verifyColumnSummaries(summaryRow, 0, ['Count'], ['28']);
});

});
});
1 change: 1 addition & 0 deletions src/app/grid-add-row/grid-add-row.sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
[pinned]="c.pinned"
[hidden]="c.hidden"
[groupable]='true'
[hasSummary]="true"
>
</igx-column>

Expand Down

0 comments on commit 5015ca0

Please sign in to comment.