diff --git a/app/assets/javascripts/admin/addon/components/admin-user-field-item.hbs b/app/assets/javascripts/admin/addon/components/admin-user-field-item.hbs
index 6d2b2093565..c87eb5e1eec 100644
--- a/app/assets/javascripts/admin/addon/components/admin-user-field-item.hbs
+++ b/app/assets/javascripts/admin/addon/components/admin-user-field-item.hbs
@@ -109,6 +109,6 @@
/>
-
{{this.flags}}
+ {{this.flags}}
{{/if}}
\ No newline at end of file
diff --git a/app/assets/javascripts/admin/addon/components/admin-user-field-item.js b/app/assets/javascripts/admin/addon/components/admin-user-field-item.js
index 73ad07612ca..faf374788c5 100644
--- a/app/assets/javascripts/admin/addon/components/admin-user-field-item.js
+++ b/app/assets/javascripts/admin/addon/components/admin-user-field-item.js
@@ -51,10 +51,10 @@ export default Component.extend(bufferedProperty("userField"), {
if (userField.required) {
ret.push(I18n.t("admin.user_fields.required.enabled"));
}
- if (userField.showOnProfile) {
+ if (userField.show_on_profile) {
ret.push(I18n.t("admin.user_fields.show_on_profile.enabled"));
}
- if (userField.showOnUserCard) {
+ if (userField.show_on_user_card) {
ret.push(I18n.t("admin.user_fields.show_on_user_card.enabled"));
}
if (userField.searchable) {
diff --git a/app/assets/javascripts/discourse/tests/integration/components/admin-user-field-item-test.js b/app/assets/javascripts/discourse/tests/integration/components/admin-user-field-item-test.js
index 49e8e927f1a..c146d22f3b9 100644
--- a/app/assets/javascripts/discourse/tests/integration/components/admin-user-field-item-test.js
+++ b/app/assets/javascripts/discourse/tests/integration/components/admin-user-field-item-test.js
@@ -37,12 +37,15 @@ module("Integration | Component | admin-user-field-item", function (hooks) {
assert.ok(exists(".save"));
});
- test("user field with an id", async function (assert) {
+ test("field attributes are rendered correctly", async function (assert) {
this.set("userField", {
id: 1,
field_type: "text",
name: "foo",
description: "what is foo",
+ show_on_profile: true,
+ show_on_user_card: true,
+ searchable: true,
});
await render(hbs``);
@@ -56,5 +59,13 @@ module("Integration | Component | admin-user-field-item", function (hooks) {
query(".field-type").innerText,
I18n.t("admin.user_fields.field_types.text")
);
+
+ assert
+ .dom(".user-field-flags")
+ .hasText(
+ `${I18n.t("admin.user_fields.show_on_profile.enabled")}, ${I18n.t(
+ "admin.user_fields.show_on_user_card.enabled"
+ )}, ${I18n.t("admin.user_fields.searchable.enabled")}`
+ );
});
});