mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 14:38:17 +08:00
FEATURE: In the slow mode dialog make "Enabled Until" mandatory (#12701)
This commit is contained in:
parent
c54609bfcd
commit
eb99ecf1d2
|
@ -5,7 +5,7 @@ import ModalFunctionality from "discourse/mixins/modal-functionality";
|
|||
import Topic from "discourse/models/topic";
|
||||
import { action } from "@ember/object";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
import { equal } from "@ember/object/computed";
|
||||
import { equal, or } from "@ember/object/computed";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
|
||||
export default Controller.extend(ModalFunctionality, {
|
||||
|
@ -16,6 +16,7 @@ export default Controller.extend(ModalFunctionality, {
|
|||
saveDisabled: false,
|
||||
enabledUntil: null,
|
||||
showCustomSelect: equal("selectedSlowMode", "custom"),
|
||||
durationIsSet: or("hours", "minutes", "seconds"),
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
|
@ -86,9 +87,9 @@ export default Controller.extend(ModalFunctionality, {
|
|||
}
|
||||
},
|
||||
|
||||
@discourseComputed("hours", "minutes", "seconds")
|
||||
submitDisabled(hours, minutes, seconds) {
|
||||
return this.saveDisabled || !(hours || minutes || seconds);
|
||||
@discourseComputed("saveDisabled", "durationIsSet", "enabledUntil")
|
||||
submitDisabled(saveDisabled, durationIsSet, enabledUntil) {
|
||||
return saveDisabled || !durationIsSet || !enabledUntil;
|
||||
},
|
||||
|
||||
_setFromSeconds(seconds) {
|
||||
|
|
|
@ -2480,7 +2480,7 @@ en:
|
|||
select: "Users may only post in this topic once every:"
|
||||
description: "To promote thoughtful discussion in fast moving or contentious discussions, users must wait before posting again in this topic."
|
||||
save: "Enable"
|
||||
enabled_until: "(Optional) Enabled until:"
|
||||
enabled_until: "Enabled until:"
|
||||
remove: "Disable"
|
||||
hours: "Hours:"
|
||||
minutes: "Minutes:"
|
||||
|
|
Loading…
Reference in New Issue
Block a user