Allow admins to see the group reports nav item (#101)

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.

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();
     }
 

GitHub sha: 82cb3ac2

This commit appears in #101 which was approved by davidtaylorhq. It was merged by davidtaylorhq.