mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-01 11:47:16 +08:00
Dropdown and multiselect components lack `InputTip`, which makes them not show any reason when validation fails. This commit also adds a new i18n message for select fields, after this commit, if a multiselect or dropdown custom field required has no option selected, it will display a `Please select a value for "XX" field` validation error when the Signup button is clicked.
18 lines
506 B
Ruby
18 lines
506 B
Ruby
# frozen_string_literal: true
|
|
|
|
Fabricator(:user_field) do
|
|
name { sequence(:name) { |i| "field_#{i}" } }
|
|
description "user field description"
|
|
field_type "text"
|
|
editable true
|
|
requirement "on_signup"
|
|
end
|
|
|
|
Fabricator(:user_field_dropdown, from: :user_field) do
|
|
field_type "dropdown"
|
|
after_create do |user_field|
|
|
Fabricate(:user_field_option, user_field: user_field)
|
|
Fabricate(:user_field_option, user_field: user_field)
|
|
Fabricate(:user_field_option, user_field: user_field)
|
|
end
|
|
end
|