Skip to content

Commit

Permalink
Merge pull request #1344 from appsembler/bugfix/a11y-fixes-settings-p…
Browse files Browse the repository at this point in the history
…rofile

PTAD-requested a11y fixes for Account Settings, Profile
  • Loading branch information
bryanlandia authored May 15, 2023
2 parents 04230fe + 6540257 commit 0a66b5c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,10 @@ export class StudentAccountDeletion extends React.Component {
<span>{bodyDeletion} </span>
<span>{bodyDeletion2}</span>
</p>
<p
className="account-settings-header-subtitle"
dangerouslySetInnerHTML={{ __html: loseAccessText }}
/>
<p
className="account-settings-header-subtitle-warning"
dangerouslySetInnerHTML={{ __html: acctDeletionWarningText }}
/>
<p
className="account-settings-header-subtitle"
dangerouslySetInnerHTML={{ __html: changeAcctInfoText }}
/>
<Button
id="delete-account-btn"
className={['btn-outline-primary']}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ class StudentAccountDeletionConfirmationModal extends React.Component {
<span>{bodyDeletion} </span>
<span>{bodyDeletion2}</span>
</p>
<p dangerouslySetInnerHTML={{ __html: loseAccessText }} />
</div>
</div>
)}
Expand Down
30 changes: 24 additions & 6 deletions lms/static/js/student_account/views/account_settings_factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@
required: true,
title: gettext('Country or Region of Residence'),
valueAttribute: 'country',
options: fieldsData.country.options,
groupOptions: [{
selectOptions: fieldsData.country.options,
nullValueOptionLabel: gettext('(Not Specified)')
}],
persistChanges: true,
helpMessage: gettext('The country or region where you live.')
};
Expand Down Expand Up @@ -180,7 +183,10 @@
gettext('The language used throughout this site. This site is currently available in a limited number of languages. Changing the value of this field will cause the page to refresh.'), // eslint-disable-line max-len
{platform_name: platformName}
),
options: fieldsData.language.options,
groupOptions: [{
nullValueOptionLabel: gettext('Default (English)'),
selectOptions: fieldsData.language.options
}],
persistChanges: true,
focusNextID: '#u-field-select-country'
})
Expand Down Expand Up @@ -211,7 +217,10 @@
model: userAccountModel,
title: gettext('Education Completed'),
valueAttribute: 'level_of_education',
options: fieldsData.level_of_education.options,
groupOptions: [{
selectOptions: fieldsData.level_of_education.options,
nullValueOptionLabel: gettext('(Not Specified)')
}],
persistChanges: true
})
},
Expand All @@ -220,7 +229,10 @@
model: userAccountModel,
title: gettext('Gender'),
valueAttribute: 'gender',
options: fieldsData.gender.options,
groupOptions: [{
selectOptions: fieldsData.gender.options,
nullValueOptionLabel: gettext('(Not Specified)')
}],
persistChanges: true
})
},
Expand All @@ -229,7 +241,10 @@
model: userAccountModel,
title: gettext('Year of Birth'),
valueAttribute: 'year_of_birth',
options: fieldsData.year_of_birth.options,
groupOptions: [{
selectOptions: fieldsData.year_of_birth.options,
nullValueOptionLabel: gettext('(Not Specified)')
}],
persistChanges: true
})
},
Expand All @@ -238,7 +253,10 @@
model: userAccountModel,
title: gettext('Preferred Language'),
valueAttribute: 'language_proficiencies',
options: fieldsData.preferred_language.options,
groupOptions: [{
selectOptions: fieldsData.preferred_language.options,
nullValueOptionLabel: gettext('(Not Specified)')
}],
persistChanges: true
})
}
Expand Down
2 changes: 1 addition & 1 deletion lms/templates/student_account/account_settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<script type="text/javascript">
window.auth = ${ auth | n, dump_js_escaped_json };
window.isActive = ${ user.is_active | n, dump_js_escaped_json };
window.additionalSiteSpecificDeletionText = "${ static.get_value('SITE_SPECIFIC_DELETION_TEXT', _(' and access to private sites offered by MIT Open Learning, Wharton Executive Education, and Harvard Medical School')) | n, js_escaped_string }";
window.additionalSiteSpecificDeletionText = "${ static.get_value('SITE_SPECIFIC_DELETION_TEXT', '') | n, js_escaped_string }";
window.mktgRootLink = "${ static.marketing_link('ROOT') | n, js_escaped_string }";
window.platformName = "${ platform_name | n, js_escaped_string }";
window.siteName = "${ static.get_value('SITE_NAME', settings.SITE_NAME) | n, js_escaped_string }";
Expand Down

0 comments on commit 0a66b5c

Please sign in to comment.