From e43baafa02496be95dddd1baee36e46b3bc722c8 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 13 Apr 2018 10:41:29 +0800 Subject: [PATCH] UX: Link to automatic group page on user admin page. --- .../admin/controllers/admin-user-index.js.es6 | 10 +++++++--- app/assets/javascripts/admin/templates/user-index.hbs | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/admin/controllers/admin-user-index.js.es6 b/app/assets/javascripts/admin/controllers/admin-user-index.js.es6 index b80dd29cec2..ee49a1c119e 100644 --- a/app/assets/javascripts/admin/controllers/admin-user-index.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-user-index.js.es6 @@ -24,9 +24,13 @@ export default Ember.Controller.extend(CanCheckEmails, { 'model.can_disable_second_factor' ), - automaticGroups: function() { - return this.get("model.automaticGroups").map((g) => g.name).join(", "); - }.property("model.automaticGroups"), + @computed("model.automaticGroups") + automaticGroups(automaticGroups) { + return automaticGroups.map(group => { + const name = Ember.String.htmlSafe(group.name); + return `${name}`; + }).join(", "); + }, userFields: function() { const siteUserFields = this.site.get('user_fields'), diff --git a/app/assets/javascripts/admin/templates/user-index.hbs b/app/assets/javascripts/admin/templates/user-index.hbs index 464402a8225..b1e164a01b5 100644 --- a/app/assets/javascripts/admin/templates/user-index.hbs +++ b/app/assets/javascripts/admin/templates/user-index.hbs @@ -415,7 +415,7 @@

{{i18n 'admin.groups.title'}}

{{i18n 'admin.groups.automatic'}}
-
{{automaticGroups}}
+
{{{automaticGroups}}}
{{i18n 'admin.groups.custom'}}