FIX: Get all groups for user directory dropdown (#13566)

FIX: Get all groups for user directory dropdown (#13566)

diff --git a/app/assets/javascripts/discourse/app/controllers/users.js b/app/assets/javascripts/discourse/app/controllers/users.js
index 1846b4e..ebdca0a 100644
--- a/app/assets/javascripts/discourse/app/controllers/users.js
+++ b/app/assets/javascripts/discourse/app/controllers/users.js
@@ -1,4 +1,5 @@
 import Controller, { inject as controller } from "@ember/controller";
+import Group from "discourse/models/group";
 import { action } from "@ember/object";
 import discourseDebounce from "discourse-common/lib/debounce";
 import showModal from "discourse/lib/show-modal";
@@ -58,11 +59,11 @@ export default Controller.extend({
   },
 
   loadGroups() {
-    return this.store.findAll("group").then((groups) => {
+    return Group.findAll({ ignore_automatic: true }).then((groups) => {
       const groupOptions = groups.map((group) => {
         return {
-          name: group.name,
-          id: group.id,
+          name: group.full_name || group.name,
+          id: group.name,
         };
       });
       this.set("groupOptions", groupOptions);
@@ -72,7 +73,7 @@ export default Controller.extend({
   @action
   groupChanged(_, groupAttrs) {
     // First param is the group name, which include none or 'all groups'. Ignore this and look at second param.
-    this.set("group", groupAttrs.id ? groupAttrs.name : null);
+    this.set("group", groupAttrs.id);
   },
 
   @action

GitHub sha: 717908f42631493c891d5bd471bb86fb82c6b9c1

This commit appears in #13566 which was approved by eviltrout. It was merged by markvanlan.