Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: IgniteUI/igniteui-angular
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 14.2.11
Choose a base ref
...
head repository: IgniteUI/igniteui-angular
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 14.2.12
Choose a head ref
  • 1 commit
  • 3 files changed
  • 3 contributors

Commits on Jan 2, 2023

  1. Expose groupRecord property in grid summaries on 14.2.x (#12372)

    * chore(summary): expose groupRecord property
    
    * feat(grid): add groupRecord param when summaryPosition is top
    
    Co-authored-by: Stamen Stoychev <sstoychev@infragistics.com>
    Co-authored-by: Hristo <hanastasov@infragistics.com>
    3 people authored Jan 2, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5b4daa1 View commit details
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ export class IgxGridSummaryPipe implements PipeTransform {
for (const groupRecord of groupRecords) {
const groupRecordId = this.grid.gridAPI.get_groupBy_record_id(groupRecord);
const records = this.removeDeletedRecord(this.grid, groupRecord.records.slice());
const summaries = this.grid.summaryService.calculateSummaries(groupRecordId, records);
const summaries = this.grid.summaryService.calculateSummaries(groupRecordId, records, groupRecord);
const summaryRecord: ISummaryRecord = {
summaries,
max: maxSummaryHeight
@@ -91,7 +91,7 @@ export class IgxGridSummaryPipe implements PipeTransform {

if (summaryPosition === GridSummaryPosition.top) {
const records = this.removeDeletedRecord(this.grid, groupByRecord.records.slice());
const summaries = this.grid.summaryService.calculateSummaries(recordId, records);
const summaries = this.grid.summaryService.calculateSummaries(recordId, records, groupByRecord);
const summaryRecord: ISummaryRecord = {
summaries,
max: maxSummaryHeight
Original file line number Diff line number Diff line change
@@ -110,7 +110,7 @@ export class IgxGridSummaryService {
return this.summaryHeight;
}

public calculateSummaries(rowID, data) {
public calculateSummaries(rowID, data, groupRecord) {
let rowSummaries = this.summaryCacheMap.get(rowID);
if (!rowSummaries) {
rowSummaries = new Map<string, IgxSummaryResult[]>();
@@ -122,7 +122,7 @@ export class IgxGridSummaryService {
this.grid.columns.filter(col => col.hasSummary).forEach((column) => {
if (!rowSummaries.get(column.field)) {
const summaryResult = column.summaries.operate(data.map(r => resolveNestedPath(r, column.field)),
data, column.field, this.grid.locale, column.pipeArgs);
data, column.field, groupRecord, this.grid.locale, column.pipeArgs);
rowSummaries.set(column.field, summaryResult);
}
});
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { IGroupByRecord } from '../../data-operations/groupby-record.interface';

export interface ISummaryExpression {
fieldName: string;
customSummary?: any;
@@ -74,7 +76,7 @@ export class IgxSummaryOperand {
*
* @memberof IgxSummaryOperand
*/
public operate(data: any[] = [], allData: any[] = [], fieldName?: string): IgxSummaryResult[] {
public operate(data: any[] = [], allData: any[] = [], fieldName?: string, groupRecord?: IGroupByRecord): IgxSummaryResult[] {
return [{
key: 'count',
label: 'Count',
@@ -169,8 +171,8 @@ export class IgxNumberSummaryOperand extends IgxSummaryOperand {
*
* @memberof IgxNumberSummaryOperand
*/
public operate(data: any[] = [], allData: any[] = [], fieldName?: string): IgxSummaryResult[] {
const result = super.operate(data, allData, fieldName);
public operate(data: any[] = [], allData: any[] = [], fieldName?: string, groupRecord?: IGroupByRecord): IgxSummaryResult[] {
const result = super.operate(data, allData, fieldName, groupRecord);
result.push({
key: 'min',
label: 'Min',
@@ -257,8 +259,8 @@ export class IgxDateSummaryOperand extends IgxSummaryOperand {
*
* @memberof IgxDateSummaryOperand
*/
public operate(data: any[] = [], allData: any[] = [], fieldName?: string): IgxSummaryResult[] {
const result = super.operate(data, allData, fieldName);
public operate(data: any[] = [], allData: any[] = [], fieldName?: string, groupRecord?: IGroupByRecord): IgxSummaryResult[] {
const result = super.operate(data, allData, fieldName, groupRecord);
result.push({
key: 'earliest',
label: 'Earliest',
@@ -310,7 +312,7 @@ export class IgxTimeSummaryOperand extends IgxSummaryOperand {
/**
* @memberof IgxTimeSummaryOperand
*/
public operate(data: any[] = [], allData: any[] = [], fieldName?: string): IgxSummaryResult[] {
public operate(data: any[] = [], allData: any[] = [], fieldName?: string, groupRecord?: IGroupByRecord): IgxSummaryResult[] {
const result = super.operate(data, allData, fieldName);
result.push({
key: 'earliest',