From 44475b9efcb0e9ce54e3c0277ff925abfe22a15d Mon Sep 17 00:00:00 2001 From: usama sadiq Date: Thu, 13 Jun 2019 19:39:55 +0500 Subject: [PATCH] Support Contact Form Updated - Changed the Subject text field to drop down. - Added aditional text to guide learners to course forums. --- .../static/support/jsx/logged_in_user.jsx | 26 +++++++++++++++++-- .../support/jsx/single_support_form.jsx | 17 ++++++++---- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/lms/djangoapps/support/static/support/jsx/logged_in_user.jsx b/lms/djangoapps/support/static/support/jsx/logged_in_user.jsx index 4cd6aea81c..8a6f19a25d 100644 --- a/lms/djangoapps/support/static/support/jsx/logged_in_user.jsx +++ b/lms/djangoapps/support/static/support/jsx/logged_in_user.jsx @@ -12,6 +12,9 @@ function LoggedInUser({ userInformation, setErrorState, zendeskApiHost, submitFo if (userInformation.enrollments) { courseElement = (
+

+ {gettext('For inquiries regarding assignments, grades, or structure of a specific course, please post in the discussion forums for that course directly.')} +

+ + + + + + + + + + + + + + +
); + return (
- - + {subjectElement}
diff --git a/lms/djangoapps/support/static/support/jsx/single_support_form.jsx b/lms/djangoapps/support/static/support/jsx/single_support_form.jsx index 2c989fa395..164ca65973 100644 --- a/lms/djangoapps/support/static/support/jsx/single_support_form.jsx +++ b/lms/djangoapps/support/static/support/jsx/single_support_form.jsx @@ -37,8 +37,8 @@ class RenderForm extends React.Component { $userInfo = $('.user-info'), request = new XMLHttpRequest(), $course = $('#course'), + $subject = $('#subject'), data = { - subject: $('#subject').val(), comment: { body: $('#message').val(), }, @@ -67,6 +67,17 @@ class RenderForm extends React.Component { value: course, }]; + let subject; + subject = $subject.find(':selected').val(); + if (!subject) { + subject = $subject.val(); + } + if (!subject) { + $('#subject').closest('.form-group').addClass('has-error'); + errors.push(gettext('Select a subject for your support request.')); + } + data.subject = subject; + if (this.validateData(data, errors)) { request.open('POST', url, true); request.setRequestHeader('Content-type', 'application/json;charset=UTF-8'); @@ -94,10 +105,6 @@ class RenderForm extends React.Component { } validateData(data, errors) { - if (!data.subject) { - errors.push(gettext('Enter a subject for your support request.')); - $('#subject').closest('.form-group').addClass('has-error'); - } if (!data.comment.body) { errors.push(gettext('Enter some details for your support request.')); $('#message').closest('.form-group').addClass('has-error');