Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add group by handlebar helper #3749

Merged
merged 6 commits into from
Jul 9, 2023
Merged

feat: add group by handlebar helper #3749

merged 6 commits into from
Jul 9, 2023

Conversation

jainpawan21
Copy link
Member

What change does this PR introduce?

Add new groupBy handlebar helper to group array values by property

Why was this change needed?

Other information (Screenshots)

Context:-

{{#each (groupBy names "name")}}
 <h1>{{key}}<h1>
 {{#each items}}
   {{age}}-
 {{/each}}
{{/each}}

Input

{
	"names": [{
		"name": "Name 1",
		"age": "30"
	}, {
		"name": "Name 2",
    "age": "31"
	}, {
		"name": "Name 1",
    "age": "32"
	}]
}

Output:-

<h1>Name 1<h1>
   30-
   32-
 <h1>Name 2<h1>
   31-

@github-actions
Copy link

github-actions bot commented Jul 9, 2023

Pull reviewers stats

Stats of the last 30 days for novu:

User Total reviews Time to review Total comments
p-fernandez 59 17h 32m 181
LetItRock 21 1d 5h 5m 76
djabarovgeorge 14 2d 9h 53m 53
ainouzgali 12 9h 25m 47
scopsy 12 59m 3
unicodeveloper 11 8d 1h 29m 115
jainpawan21 5 3h 16m 2
davidsoderberg 4 16h 18m 2
BiswaViraj 4 1d 22h 30m 2
Cliftonz 2 12h 3m 6
peoray 1 27m 1
michaldziuba03 1 10h 53m 1

@scopsy
Copy link
Contributor

scopsy commented Jul 9, 2023

Looking good! Could you please resolve the spellcheck error by adding groupby as a word? And also, maybe worth updating the docs for it?

deepsource-autofix bot and others added 2 commits July 9, 2023 09:26
…pile-template.spec.ts

Co-authored-by: ainouzgali <ainouzgali@gmail.com>
@jainpawan21
Copy link
Member Author

jainpawan21 commented Jul 9, 2023

Looking good! Could you please resolve the spellcheck error by adding groupby as a word? And also, maybe worth updating the docs for it?

Fixed SpellCheck Errors
The Devex team is working on separate documentation to list all helpers.
I will share this helper with them to add

@scopsy scopsy added this pull request to the merge queue Jul 9, 2023
Merged via the queue into next with commit 30dc93d Jul 9, 2023
34 checks passed
@scopsy scopsy deleted the feature/group-by-helper branch July 9, 2023 14:21
@jainpawan21 jainpawan21 restored the feature/group-by-helper branch July 9, 2023 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants