Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MBS-11722: Don't preselect basic as language proficiency #2145

Merged
merged 1 commit into from Aug 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/MusicBrainz/Server/Form/Role/UserProfile.pm
Expand Up @@ -3,7 +3,7 @@ package MusicBrainz::Server::Form::Role::UserProfile;
use HTML::FormHandler::Moose::Role;
use List::MoreUtils qw( any all );
use MusicBrainz::Server::Form::Utils qw( language_options select_options_tree validate_username );
use MusicBrainz::Server::Translation qw( l ln );
use MusicBrainz::Server::Translation qw( l ln N_l );
use MusicBrainz::Server::Validation qw( is_valid_url );

has_field 'username' => (
Expand Down Expand Up @@ -53,11 +53,13 @@ has_field 'languages' => (

has_field 'languages.language_id' => (
type => 'Select',
messages => { required => N_l('A language is required.') },
required => 1
);

has_field 'languages.fluency' => (
type => 'Select',
messages => { required => N_l('A fluency level is required.') },
required => 1
);

Expand Down
6 changes: 4 additions & 2 deletions root/static/scripts/account/components/EditProfileForm.js
Expand Up @@ -280,13 +280,13 @@ class EditProfileForm extends React.Component<Props, State> {
{field.languages.field.map((languageField, index) => (
<li className="language" key={index}>
<SelectField
allowEmpty={false}
allowEmpty
field={languageField.field.language_id}
onChange={(e) => this.handleLanguageChange(e, index)}
options={this.state.languageOptions}
/>
<SelectField
allowEmpty={false}
allowEmpty
field={languageField.field.fluency}
onChange={(e) => this.handleFluencyChange(e, index)}
options={fluencyOptions}
Expand All @@ -300,6 +300,8 @@ class EditProfileForm extends React.Component<Props, State> {
{l('Remove')}
</button>
</span>
<FieldErrors field={languageField.field.language_id} />
<FieldErrors field={languageField.field.fluency} />
</li>
))}
<li key="add">
Expand Down