From 82cb3ac2fe475ea367bef25287d4ab0555a240ad Mon Sep 17 00:00:00 2001 From: Grayden <38144548+graydenshand@users.noreply.github.com> Date: Thu, 8 Apr 2021 10:50:49 -0400 Subject: [PATCH] Allow admins to see the group reports nav item (#101) Previously, the report tab would appear only if the user was a member of the group. With this change, admins can see the reports in any group. --- .../discourse/components/group-reports-nav-item.js.es6 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/discourse/components/group-reports-nav-item.js.es6 b/assets/javascripts/discourse/components/group-reports-nav-item.js.es6 index 136d7ad..8164c9e 100644 --- a/assets/javascripts/discourse/components/group-reports-nav-item.js.es6 +++ b/assets/javascripts/discourse/components/group-reports-nav-item.js.es6 @@ -13,9 +13,12 @@ export default Ember.Component.extend({ init(args) { this.set("group", args.group); if ( - (this.get("currentUser.groups") || []).some((g) => g.id === this.group.id) + (this.get("currentUser.groups") || []).some( + (g) => g.id === this.group.id + ) || + this.get("currentUser.admin") ) { - // User is a part of the group. Now check if the group has reports + // User is a part of the group (or an admin). Now check if the group has reports this.checkForReports(); }