mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 04:31:56 +08:00
FIX: missing default notification level on group creation (#11512)
This commit is contained in:
parent
e7b837e7e1
commit
9870a0b6a1
|
@ -1,5 +1,6 @@
|
|||
import Component from "@ember/component";
|
||||
import I18n from "I18n";
|
||||
import { NotificationLevels } from "discourse/lib/notification-levels";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
import { or } from "@ember/object/computed";
|
||||
|
||||
|
@ -46,6 +47,8 @@ export default Component.extend({
|
|||
{ name: I18n.t("groups.alias_levels.owners_mods_and_admins"), value: 4 },
|
||||
{ name: I18n.t("groups.alias_levels.everyone"), value: 99 },
|
||||
];
|
||||
|
||||
this.watchingNotificationLevel = NotificationLevels.WATCHING;
|
||||
},
|
||||
|
||||
membersVisibilityLevel: or(
|
||||
|
@ -63,6 +66,11 @@ export default Component.extend({
|
|||
"aliasLevelOptions.firstObject.value"
|
||||
),
|
||||
|
||||
defaultNotificationLevel: or(
|
||||
"model.default_notification_level",
|
||||
"watchingNotificationLevel"
|
||||
),
|
||||
|
||||
@discourseComputed(
|
||||
"siteSettings.email_in",
|
||||
"model.automatic",
|
||||
|
|
|
@ -94,10 +94,11 @@
|
|||
<label>{{i18n "groups.notification_level"}}</label>
|
||||
|
||||
{{notifications-button
|
||||
value=model.default_notification_level
|
||||
value=defaultNotificationLevel
|
||||
class="groups-form-default-notification-level"
|
||||
options=(hash
|
||||
i18nPrefix="groups.notifications"
|
||||
)
|
||||
onChange=(action (mut model.default_notification_level))
|
||||
}}
|
||||
</div>
|
||||
|
|
|
@ -74,5 +74,12 @@ acceptance("New Group - Authenticated", function (needs) {
|
|||
0,
|
||||
"it should disable the membership requests checkbox"
|
||||
);
|
||||
|
||||
assert.ok(
|
||||
queryAll(".groups-form-default-notification-level .selected-name .name")
|
||||
.text()
|
||||
.trim() === I18n.t("groups.notifications.watching.title"),
|
||||
"it has a default selection for notification level"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user