discourse/app/assets/javascripts/admin/addon/components/site-settings/integer.hbs
Martin Brennan 68a912952c
FIX: min/max not passed to NumberField for site settings (#24402)
When we started using NumberField for integer site settings
in e113eff663, we did not end up
passing down a min/max value for the integer to the field, which
meant that for some fields where negative numbers were allowed
we were not accepting that as valid input.

This commit passes down the min/max options from the server for
integer settings then in turn passes them down to NumberField.

c.f. https://meta.discourse.org/t/delete-user-self-max-post-count-not-accepting-1-to-disable/285162
2023-11-16 12:37:05 +10:00

9 lines
316 B
Handlebars

<NumberField
@value={{this.value}}
@classNames="input-setting-integer"
@min={{(if this.setting.min this.setting.min null)}}
@max={{(if this.setting.max this.setting.max null)}}
/>
<SettingValidationMessage @message={{this.validationMessage}} />
<div class="desc">{{html-safe this.setting.description}}</div>