From 80e74f9e009e1212f8e9ece2d1d9849c4dfe6f6e Mon Sep 17 00:00:00 2001 From: andrey-canon Date: Tue, 19 Sep 2023 13:28:06 -0500 Subject: [PATCH] feat: this allows to change the editable behavior for the full name field https://edunext.atlassian.net/browse/FUTUREX-521 (cherry picked from commit f9176f159b711b5f542530d30aede429c2b53186) --- .../js/student_account/views/account_settings_factory.js | 5 +++-- lms/templates/student_account/account_settings.html | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lms/static/js/student_account/views/account_settings_factory.js b/lms/static/js/student_account/views/account_settings_factory.js index 0cc84f8f6674..b498c9778ad9 100644 --- a/lms/static/js/student_account/views/account_settings_factory.js +++ b/lms/static/js/student_account/views/account_settings_factory.js @@ -32,7 +32,8 @@ extendedProfileFields, displayAccountDeletion, isSecondaryEmailFeatureEnabled, - betaLanguage + betaLanguage, + allowFullNameChange ) { var $accountSettingsElement, userAccountModel, userPreferencesModel, aboutSectionsData, accountsSectionData, ordersSectionData, accountSettingsView, showAccountSettingsPage, @@ -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) }; diff --git a/lms/templates/student_account/account_settings.html b/lms/templates/student_account/account_settings.html index d5418d62f741..a51d45499ead 100644 --- a/lms/templates/student_account/account_settings.html +++ b/lms/templates/student_account/account_settings.html @@ -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 }', @@ -74,6 +75,7 @@ displayAccountDeletion, isSecondaryEmailFeatureEnabled, ${ beta_language | n, dump_js_escaped_json }, + allowFullNameChange, );