DEV: allows groups-selector to have an onChangeCallback (#9399)

DEV: allows groups-selector to have an onChangeCallback (#9399)

diff --git a/app/assets/javascripts/discourse/components/group-selector.js b/app/assets/javascripts/discourse/components/group-selector.js
index 74c1c4b..3fe2e50 100644
--- a/app/assets/javascripts/discourse/components/group-selector.js
+++ b/app/assets/javascripts/discourse/components/group-selector.js
@@ -35,7 +35,12 @@ export default Component.extend({
       updateData: opts && opts.updateData ? opts.updateData : false,
       onChangeItems: items => {
         selectedGroups = items;
-        this.set("groupNames", items.join(","));
+
+        if (this.onChangeCallback) {
+          this.onChangeCallback(this.groupNames, selectedGroups);
+        } else {
+          this.set("groupNames", items.join(","));
+        }
       },
       transformComplete: g => {
         return g.name;

GitHub sha: d891665a

This commit appears in #9399 which was merged by jjaffeux.