Skip to content

Commit bf2eb37

Browse files
authored
MBS-11722: Don't preselect basic as language proficiency (metabrainz#2145)
Users are apparently often selecting "basic" when it seems incorrect, probably because it is selected by default. "Arabic" is also selected by default, and we seem to have 900+ users with "Arabic (basic)". This might be true, but I find it unlikely.
1 parent 974faf8 commit bf2eb37

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/MusicBrainz/Server/Form/Role/UserProfile.pm

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package MusicBrainz::Server::Form::Role::UserProfile;
33
use HTML::FormHandler::Moose::Role;
44
use List::MoreUtils qw( any all );
55
use MusicBrainz::Server::Form::Utils qw( language_options select_options_tree validate_username );
6-
use MusicBrainz::Server::Translation qw( l ln );
6+
use MusicBrainz::Server::Translation qw( l ln N_l );
77
use MusicBrainz::Server::Validation qw( is_valid_url );
88

99
has_field 'username' => (
@@ -53,11 +53,13 @@ has_field 'languages' => (
5353

5454
has_field 'languages.language_id' => (
5555
type => 'Select',
56+
messages => { required => N_l('A language is required.') },
5657
required => 1
5758
);
5859

5960
has_field 'languages.fluency' => (
6061
type => 'Select',
62+
messages => { required => N_l('A fluency level is required.') },
6163
required => 1
6264
);
6365

root/static/scripts/account/components/EditProfileForm.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -280,13 +280,13 @@ class EditProfileForm extends React.Component<Props, State> {
280280
{field.languages.field.map((languageField, index) => (
281281
<li className="language" key={index}>
282282
<SelectField
283-
allowEmpty={false}
283+
allowEmpty
284284
field={languageField.field.language_id}
285285
onChange={(e) => this.handleLanguageChange(e, index)}
286286
options={this.state.languageOptions}
287287
/>
288288
<SelectField
289-
allowEmpty={false}
289+
allowEmpty
290290
field={languageField.field.fluency}
291291
onChange={(e) => this.handleFluencyChange(e, index)}
292292
options={fluencyOptions}
@@ -300,6 +300,8 @@ class EditProfileForm extends React.Component<Props, State> {
300300
{l('Remove')}
301301
</button>
302302
</span>
303+
<FieldErrors field={languageField.field.language_id} />
304+
<FieldErrors field={languageField.field.fluency} />
303305
</li>
304306
))}
305307
<li key="add">

0 commit comments

Comments
 (0)