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

feat: this allows to change the editable behavior for the full name f… #9

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
extendedProfileFields,
displayAccountDeletion,
isSecondaryEmailFeatureEnabled,
betaLanguage
betaLanguage,
allowFullNameChange
) {
var $accountSettingsElement, userAccountModel, userPreferencesModel, aboutSectionsData,
accountsSectionData, ordersSectionData, accountSettingsView, showAccountSettingsPage,
Expand Down Expand Up @@ -104,7 +105,7 @@
helpMessage: gettext('The name that is used for ID verification and that appears on your certificates.'), // eslint-disable-line max-len,
persistChanges: true
};
if (syncLearnerProfileData && enterpriseReadonlyAccountFields.fields.indexOf('name') !== -1) {
if (!allowFullNameChange || (syncLearnerProfileData && enterpriseReadonlyAccountFields.fields.indexOf('name') !== -1)) {
fullnameFieldView = {
view: new AccountSettingsFieldViews.ReadonlyFieldView(fullNameFieldData)
};
Expand Down
2 changes: 2 additions & 0 deletions lms/templates/student_account/account_settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
contactEmail = '${ static.get_contact_email_address() | n, js_escaped_string }',
allowEmailChange = ${ bool(settings.FEATURES['ALLOW_EMAIL_ADDRESS_CHANGE']) | n, dump_js_escaped_json },
socialPlatforms = ${ settings.SOCIAL_PLATFORMS | n, dump_js_escaped_json },
allowFullNameChange = ${ bool(settings.FEATURES.get('ALLOW_FULL_NAME_CHANGE')) | n, dump_js_escaped_json },

syncLearnerProfileData = ${ bool(sync_learner_profile_data) | n, dump_js_escaped_json },
enterpriseName = '${ enterprise_name | n, js_escaped_string }',
Expand Down Expand Up @@ -74,6 +75,7 @@
displayAccountDeletion,
isSecondaryEmailFeatureEnabled,
${ beta_language | n, dump_js_escaped_json },
allowFullNameChange,
);
</%static:require_module>

Expand Down
Loading