From ed25895267ea7dccbc7c026b20de65b1b43032d3 Mon Sep 17 00:00:00 2001 From: Farhanah Sheets Date: Fri, 17 Apr 2020 13:53:51 -0400 Subject: [PATCH 1/3] Update wording for clarity and bug fix for API expectations --- .../static/support/jsx/logged_in_user.jsx | 10 +++++----- .../static/support/jsx/single_support_form.jsx | 18 +++++++++--------- .../support/static/support/jsx/success.jsx | 2 +- 3 files changed, 15 insertions(+), 15 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 034ac7c947..b4b2d0a95b 100644 --- a/lms/djangoapps/support/static/support/jsx/logged_in_user.jsx +++ b/lms/djangoapps/support/static/support/jsx/logged_in_user.jsx @@ -34,10 +34,10 @@ function LoggedInUser({ userInformation, setErrorState, zendeskApiHost, submitFo ); } - let subjectElement; - subjectElement = (
- - @@ -83,7 +83,7 @@ function LoggedInUser({ userInformation, setErrorState, zendeskApiHost, submitFo
- {subjectElement} + {topicElement}
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 164ca65973..61e1aa05d9 100644 --- a/lms/djangoapps/support/static/support/jsx/single_support_form.jsx +++ b/lms/djangoapps/support/static/support/jsx/single_support_form.jsx @@ -37,7 +37,7 @@ class RenderForm extends React.Component { $userInfo = $('.user-info'), request = new XMLHttpRequest(), $course = $('#course'), - $subject = $('#subject'), + $topic = $('#topic'), data = { comment: { body: $('#message').val(), @@ -67,16 +67,16 @@ class RenderForm extends React.Component { value: course, }]; - let subject; - subject = $subject.find(':selected').val(); - if (!subject) { - subject = $subject.val(); + let topic; + topic = $topic.find(':selected').val(); + if (!topic) { + topic = $topic.val(); } - if (!subject) { - $('#subject').closest('.form-group').addClass('has-error'); - errors.push(gettext('Select a subject for your support request.')); + if (!topic) { + $('#topic').closest('.form-group').addClass('has-error'); + errors.push(gettext('Select a topic for your support request.')); } - data.subject = subject; + data.subject = topic; // Zendesk API requires 'subject' if (this.validateData(data, errors)) { request.open('POST', url, true); diff --git a/lms/djangoapps/support/static/support/jsx/success.jsx b/lms/djangoapps/support/static/support/jsx/success.jsx index 1b594c9759..92eb4ac859 100644 --- a/lms/djangoapps/support/static/support/jsx/success.jsx +++ b/lms/djangoapps/support/static/support/jsx/success.jsx @@ -28,7 +28,7 @@ function Success({ platformName, homepageUrl, dashboardUrl, isLoggedIn }) {
-

{gettext('Thank you for submitting a request!')}

+

{gettext('Thank you for submitting a request! We appreciate your patience while we work to review your request.')}

From 8f909e0b3543eb8ee35022c8b22967f8e1664b4a Mon Sep 17 00:00:00 2001 From: Farhanah Sheets Date: Fri, 17 Apr 2020 15:18:34 -0400 Subject: [PATCH 2/3] Attempting to add more logging --- openedx/core/djangoapps/zendesk_proxy/v1/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openedx/core/djangoapps/zendesk_proxy/v1/views.py b/openedx/core/djangoapps/zendesk_proxy/v1/views.py index 0899a3a797..af15535923 100644 --- a/openedx/core/djangoapps/zendesk_proxy/v1/views.py +++ b/openedx/core/djangoapps/zendesk_proxy/v1/views.py @@ -1,6 +1,7 @@ """ Define request handlers used by the zendesk_proxy djangoapp """ +import logging from rest_framework import status from rest_framework.parsers import JSONParser @@ -10,6 +11,7 @@ from rest_framework.views import APIView from openedx.core.djangoapps.zendesk_proxy.utils import create_zendesk_ticket +logger = logging.getLogger(__name__) REQUESTS_PER_HOUR = 50 @@ -62,7 +64,8 @@ class ZendeskPassthroughView(APIView): custom_fields=request.data['custom_fields'], tags=request.data['tags'] ) - except KeyError: + except KeyError as key: + logger.error('Zendesk Proxy Bad Request: %s', key) return Response(status=status.HTTP_400_BAD_REQUEST) return Response( From 7feddd3afa795eb6e934aa42378af781776c3d1c Mon Sep 17 00:00:00 2001 From: Farhanah Sheets Date: Fri, 17 Apr 2020 15:34:10 -0400 Subject: [PATCH 3/3] Log update --- openedx/core/djangoapps/zendesk_proxy/v1/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openedx/core/djangoapps/zendesk_proxy/v1/views.py b/openedx/core/djangoapps/zendesk_proxy/v1/views.py index af15535923..25f5640e27 100644 --- a/openedx/core/djangoapps/zendesk_proxy/v1/views.py +++ b/openedx/core/djangoapps/zendesk_proxy/v1/views.py @@ -65,7 +65,7 @@ class ZendeskPassthroughView(APIView): tags=request.data['tags'] ) except KeyError as key: - logger.error('Zendesk Proxy Bad Request: %s', key) + logger.error('Zendesk Proxy Bad Request KeyError: %s', key) return Response(status=status.HTTP_400_BAD_REQUEST) return Response(