FEATURE: add multiselect user custom field (#13560)

FEATURE: add multiselect user custom field (#13560)

New user custom field similar to dropdown but allowing users to select multiple options.

diff --git a/app/assets/javascripts/admin/addon/models/user-field.js b/app/assets/javascripts/admin/addon/models/user-field.js
index 495be7a..53b92a6 100644
--- a/app/assets/javascripts/admin/addon/models/user-field.js
+++ b/app/assets/javascripts/admin/addon/models/user-field.js
@@ -15,6 +15,7 @@ UserField.reopenClass({
         UserFieldType.create({ id: "text" }),
         UserFieldType.create({ id: "confirm" }),
         UserFieldType.create({ id: "dropdown", hasOptions: true }),
+        UserFieldType.create({ id: "multiselect", hasOptions: true }),
       ];
     }
 
diff --git a/app/assets/javascripts/discourse/app/templates/components/user-fields/multiselect.hbs b/app/assets/javascripts/discourse/app/templates/components/user-fields/multiselect.hbs
new file mode 100644
index 0000000..f81fa36
--- /dev/null
+++ b/app/assets/javascripts/discourse/app/templates/components/user-fields/multiselect.hbs
@@ -0,0 +1,19 @@
+<label class="control-label" for={{concat "user-" this.elementId}}>
+  {{html-safe this.field.name}}
+  {{#if this.field.required}}
+    <span class="required">*</span>
+  {{/if}}
+</label>
+
+<div class="controls">
+  {{multi-select
+    id=(concat "user-" this.elementId)
+    content=this.field.options
+    valueProperty=null
+    nameProperty=null
+    value=this.value
+    none=this.noneLabel
+    onChange=(action (mut this.value))
+  }}
+  <div class="instructions">{{html-safe this.field.description}}</div>
+</div>
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 7b2b269..6d3f72a 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -5095,6 +5095,7 @@ en:
           text: "Text Field"
           confirm: "Confirmation"
           dropdown: "Dropdown"
+          multiselect: "Multiselect"
 
       site_text:
         description: "You can customize any of the text on your forum. Please start by searching below:"

GitHub sha: a69839689da85f29ff697969e225f81f20b9eede

This commit appears in #13560 which was approved by martin and tgxworld. It was merged by lis2.