Skip to content

Conversation

@MadChadJack
Copy link

I believe this is a bug. The public API has a parameter that can be passed called 'aggregationLabel', but in the public API call, it is not used.

This pull request adds a check to the service to see if that aggregation label is a string and uses that as a label instead, as I believe it was intended.

Public API:
image

@commit-lint
Copy link

commit-lint bot commented Oct 23, 2019

Bug Fixes

  • grouping: adds aggregationLabel to aggregateColumn call to match (3fdf3ba)

Contributors

@

@MadChadJack MadChadJack changed the title fix(grouping): Adds aggregationLabel to aggregateColumn call to match public API fix(grouping): adds aggregationLabel to aggregateColumn call to match public API Oct 24, 2019
@mportuga
Copy link
Member

@MadChadJack would it be possible for you to add some unit tests for this?

* @param {Grid} grid grid object
* @param {GridColumn} column the column we want to aggregate
* @param {string} aggregationType of the recognised types from uiGridGroupingConstants or one of the custom aggregations from gridOptions
* @param {string} aggregationLabel to be used instead of the default label. If empty string is passed, label is omitted
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't help but notice that you said that "[i]f empty string is passed, label is omitted", Is the point of this to add a way for users to be able to hide the label on the aggregate column by passing an empty string?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intention is to be able to pass any label and have each row show that label. For our purposes, we just so happen to want to hide the aggregation labels but for other users this would hopefully allow them to use count and have the label say "Sum" instead.

@mportuga mportuga merged commit 60fcedc into angular-ui:master Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants