diff --git a/javascripts/discourse/components/top-contributors.js b/javascripts/discourse/components/top-contributors.js index 443927c..5c6f8b8 100644 --- a/javascripts/discourse/components/top-contributors.js +++ b/javascripts/discourse/components/top-contributors.js @@ -7,6 +7,7 @@ export default class TopContributors extends Component { order = this.args.params?.order || "likes_received"; period = this.args.params?.period || "yearly"; count = this.args.params?.count || 5; + excludedGroupNames = this.args.params?.excludedGroupNames || ""; constructor() { super(...arguments); @@ -17,12 +18,11 @@ export default class TopContributors extends Component { } get requestURL() { - const excludedGroupNames = this.args.params?.excludedGroupNames || ""; - return `/directory_items.json?period=${this.period}&order=${this.order}&exclude_groups=${excludedGroupNames}&limit=${this.count}`; + return `/directory_items.json?period=${this.period}&order=${this.order}&exclude_groups=${this.excludedGroupNames}&limit=${this.count}`; } get viewAllUrl() { - return `/u?order=${this.order}&period=${this.period}`; + return `/u?order=${this.order}&period=${this.period}&exclude_groups=${this.excludedGroupNames}`; } willDestroy() { diff --git a/test/acceptance/top-contributors-test.js b/test/acceptance/top-contributors-test.js index 6333796..f04c651 100644 --- a/test/acceptance/top-contributors-test.js +++ b/test/acceptance/top-contributors-test.js @@ -166,7 +166,10 @@ acceptance( assert .dom(".top-contributors--view-all") - .hasAttribute("href", "/u?order=likes_given&period=weekly"); + .hasAttribute( + "href", + "/u?order=likes_given&period=weekly&exclude_groups=Team|contributors" + ); }); } );