FIX: Incorrect error message when post isn't long enough
This commit is contained in:
parent
3830bb7d78
commit
a93dfece70
|
@ -1,10 +1,12 @@
|
|||
import StringBuffer from 'discourse/mixins/string-buffer';
|
||||
import { iconHTML } from 'discourse/helpers/fa-icon';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
export default Ember.Component.extend(StringBuffer, {
|
||||
classNameBindings: [':popup-tip', 'good', 'bad', 'shownAt::hide'],
|
||||
animateAttribute: null,
|
||||
bouncePixels: 6,
|
||||
bounceDelay: 100,
|
||||
rerenderTriggers: ['validation.reason'],
|
||||
|
||||
click() {
|
||||
this.set('shownAt', false);
|
||||
|
@ -32,7 +34,7 @@ export default Ember.Component.extend({
|
|||
}
|
||||
}.observes('shownAt'),
|
||||
|
||||
render(buffer) {
|
||||
renderString(buffer) {
|
||||
const reason = this.get('validation.reason');
|
||||
if (!reason) { return; }
|
||||
|
||||
|
|
|
@ -564,6 +564,7 @@ const ComposerView = Discourse.View.extend(Ember.Evented, {
|
|||
replyValidation: function() {
|
||||
const replyLength = this.get('model.replyLength'),
|
||||
missingChars = this.get('model.missingReplyCharacters');
|
||||
|
||||
let reason;
|
||||
if (replyLength < 1) {
|
||||
reason = I18n.t('composer.error.post_missing');
|
||||
|
@ -576,7 +577,7 @@ const ComposerView = Discourse.View.extend(Ember.Evented, {
|
|||
}
|
||||
|
||||
if (reason) {
|
||||
return Discourse.InputValidation.create({ failed: true, reason: reason });
|
||||
return Discourse.InputValidation.create({ failed: true, reason });
|
||||
}
|
||||
}.property('model.reply', 'model.replyLength', 'model.missingReplyCharacters', 'model.minimumPostLength'),
|
||||
|
||||
|
|
Loading…
Reference in New Issue