mirror of
https://github.com/discourse/discourse.git
synced 2025-06-17 11:52:31 +08:00
FIX: muted was not working in topic timeline (#9021)
This commit is contained in:
@ -382,21 +382,15 @@ createWidget("timeline-footer-controls", {
|
|||||||
controls.push(
|
controls.push(
|
||||||
new ComponentConnector(
|
new ComponentConnector(
|
||||||
this,
|
this,
|
||||||
"topic-notifications-options",
|
"topic-notifications-button",
|
||||||
{
|
{
|
||||||
value: notificationLevel,
|
notificationLevel,
|
||||||
topic,
|
topic,
|
||||||
options: {
|
showFullTitle: false,
|
||||||
showFullTitle: false,
|
appendReason: false,
|
||||||
placement: "bottom-end"
|
placement: "bottom-end"
|
||||||
},
|
|
||||||
onChange: newNotificationLevel => {
|
|
||||||
if (newNotificationLevel !== notificationLevel) {
|
|
||||||
topic.details.updateNotifications(newNotificationLevel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
["value"]
|
["notificationLevel"]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ export default Component.extend({
|
|||||||
classNames: ["topic-notifications-button"],
|
classNames: ["topic-notifications-button"],
|
||||||
appendReason: true,
|
appendReason: true,
|
||||||
showFullTitle: true,
|
showFullTitle: true,
|
||||||
|
placement: "bottom-start",
|
||||||
|
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
onChange=(action "changeTopicNotificationLevel")
|
onChange=(action "changeTopicNotificationLevel")
|
||||||
options=(hash
|
options=(hash
|
||||||
showFullTitle=showFullTitle
|
showFullTitle=showFullTitle
|
||||||
|
placement=placement
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
@ -30,4 +30,29 @@ QUnit.test("Updating topic notification level", async assert => {
|
|||||||
"Watching",
|
"Watching",
|
||||||
"it should display the right notification level"
|
"it should display the right notification level"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const timelineNotificationOptions = selectKit(
|
||||||
|
".topic-timeline .widget-component-connector .topic-notifications-options"
|
||||||
|
);
|
||||||
|
|
||||||
|
assert.equal(
|
||||||
|
timelineNotificationOptions.header().value(),
|
||||||
|
"3",
|
||||||
|
"it should display the right notification level"
|
||||||
|
);
|
||||||
|
|
||||||
|
await timelineNotificationOptions.expand();
|
||||||
|
await timelineNotificationOptions.selectRowByValue("0");
|
||||||
|
|
||||||
|
assert.equal(
|
||||||
|
timelineNotificationOptions.header().value(),
|
||||||
|
"0",
|
||||||
|
"it should display the right notification level"
|
||||||
|
);
|
||||||
|
|
||||||
|
assert.equal(
|
||||||
|
notificationOptions.header().label(),
|
||||||
|
"Muted",
|
||||||
|
"it should display the right notification level"
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user