FIX: correctly set values and defaults for group-form-interaction-fields (#9891)
This commit is contained in:
parent
1d685c22af
commit
f51093dde7
|
@ -1,5 +1,6 @@
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
|
import { or } from "@ember/object/computed";
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
|
@ -47,6 +48,21 @@ export default Component.extend({
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
membersVisibilityLevel: or(
|
||||||
|
"model.members_visibility_level",
|
||||||
|
"visibilityLevelOptions.firstObject.value"
|
||||||
|
),
|
||||||
|
|
||||||
|
messageableLevel: or(
|
||||||
|
"model.messageable_level",
|
||||||
|
"aliasLevelOptions.firstObject.value"
|
||||||
|
),
|
||||||
|
|
||||||
|
mentionableLevel: or(
|
||||||
|
"model.mentionable_level",
|
||||||
|
"aliasLevelOptions.firstObject.value"
|
||||||
|
),
|
||||||
|
|
||||||
@discourseComputed(
|
@discourseComputed(
|
||||||
"siteSettings.email_in",
|
"siteSettings.email_in",
|
||||||
"model.automatic",
|
"model.automatic",
|
||||||
|
|
|
@ -22,11 +22,12 @@
|
||||||
<label for="visiblity">{{i18n "admin.groups.manage.interaction.members_visibility_levels.title"}}</label>
|
<label for="visiblity">{{i18n "admin.groups.manage.interaction.members_visibility_levels.title"}}</label>
|
||||||
|
|
||||||
{{combo-box name="alias"
|
{{combo-box name="alias"
|
||||||
valueProperty="value"
|
valueProperty="value"
|
||||||
value=model.members_visibility_level
|
value=membersVisibilityLevel
|
||||||
content=visibilityLevelOptions
|
content=visibilityLevelOptions
|
||||||
castInteger=true
|
class="groups-form-members-visibility-level"
|
||||||
class="groups-form-members-visibility-level"}}
|
onChange=(action (mut model.members_visibility_level))
|
||||||
|
}}
|
||||||
|
|
||||||
<div class="control-instructions">
|
<div class="control-instructions">
|
||||||
{{i18n "admin.groups.manage.interaction.members_visibility_levels.description"}}
|
{{i18n "admin.groups.manage.interaction.members_visibility_levels.description"}}
|
||||||
|
@ -41,7 +42,7 @@
|
||||||
{{combo-box
|
{{combo-box
|
||||||
name="alias"
|
name="alias"
|
||||||
valueProperty="value"
|
valueProperty="value"
|
||||||
value=model.mentionable_level
|
value=mentionableLevel
|
||||||
content=aliasLevelOptions
|
content=aliasLevelOptions
|
||||||
class="groups-form-mentionable-level"
|
class="groups-form-mentionable-level"
|
||||||
onChange=(action (mut model.mentionable_level))
|
onChange=(action (mut model.mentionable_level))
|
||||||
|
@ -54,7 +55,7 @@
|
||||||
{{combo-box
|
{{combo-box
|
||||||
name="alias"
|
name="alias"
|
||||||
valueProperty="value"
|
valueProperty="value"
|
||||||
value=model.messageable_level
|
value=messageableLevel
|
||||||
content=aliasLevelOptions
|
content=aliasLevelOptions
|
||||||
class="groups-form-messageable-level"
|
class="groups-form-messageable-level"
|
||||||
onChange=(action (mut model.messageable_level))
|
onChange=(action (mut model.messageable_level))
|
||||||
|
|
Loading…
Reference in New Issue