Skip to content

Commit

Permalink
feat: this allows to change the editable behavior for the full name f…
Browse files Browse the repository at this point in the history
…ield

https://edunext.atlassian.net/browse/FUTUREX-521
(cherry picked from commit f9176f1)
  • Loading branch information
andrey-canon authored and johanseto committed Jan 23, 2024
1 parent bbabb05 commit 80e74f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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

0 comments on commit 80e74f9

Please sign in to comment.