fix: replace username with name in contact us form (#34252)

Description: Replace username with name in contact us form
VAN-1822
This commit is contained in:
Blue
2024-02-26 10:21:49 +05:00
committed by GitHub
parent ab4f62777c
commit c0020a8769
2 changed files with 5 additions and 2 deletions

View File

@@ -131,13 +131,14 @@ function LoggedInUser({
<div className="row">
<div
className="col-sm-12 user-info"
data-name={userInformation.fullName}
data-username={userInformation.username}
data-email={userInformation.email}
>
<p>
{StringUtils.interpolate(
gettext('What can we help you with, {username}?'),
{ username: userInformation.username },
gettext('What can we help you with, {fullName}?'),
{ fullName: userInformation.fullName },
)}
</p>
</div>
@@ -176,6 +177,7 @@ LoggedInUser.propTypes = {
reDirectUser: PropTypes.func.isRequired,
userInformation: PropTypes.shape({
course_id: PropTypes.string,
fullName: PropTypes.string,
username: PropTypes.string,
email: PropTypes.string,
// eslint-disable-next-line react/forbid-prop-types

View File

@@ -41,6 +41,7 @@ from openedx.core.djangolib.js_utils import js_escaped_string, dump_js_escaped_j
% if user.is_authenticated:
context['user'] = {
'fullName': "${user.profile.name | n, js_escaped_string}",
'username': "${user.username | n, js_escaped_string}",
'email': "${user.email | n, js_escaped_string}",
'course_id': "${course_id | n, js_escaped_string}"