Unverified Commit 68890dab by Waheed Ahmed Committed by GitHub

Merge pull request #16559 from edx/waheed/LEARNER-2862-tag-enterprise-tickets

Added tag enterprise tickets functionality.
parents 787df105 a119d5b9
......@@ -6,7 +6,9 @@ import PropTypes from 'prop-types';
class ShowErrors extends React.Component {
render() {
window.scrollTo(0, 0);
if (this.props.errorList.length > 0) {
window.scrollTo(0, 0);
}
return this.props.errorList.length > 0 &&
<div className="col-sm-12">
<div className="alert alert-danger" role="alert">
......
......@@ -42,6 +42,7 @@ class RenderForm extends React.Component {
body: $('#message').val(),
uploads: $.map($('.uploaded-files button'), n => n.id),
},
tags: this.props.context.zendeskTags,
};
let course;
......
......@@ -6,7 +6,8 @@ from django.views.generic import View
from edxmako.shortcuts import render_to_response
from student.models import CourseEnrollment
from openedx.core.djangoapps.site_configuration import helpers
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.features.enterprise_support import api as enterprise_api
class ContactUsView(View):
......@@ -16,12 +17,27 @@ class ContactUsView(View):
def get(self, request):
context = {
'platform_name': helpers.get_value('platform_name', settings.PLATFORM_NAME),
'platform_name': configuration_helpers.get_value('platform_name', settings.PLATFORM_NAME),
'zendesk_api_host': settings.ZENDESK_URL,
'access_token': settings.ZENDESK_OAUTH_ACCESS_TOKEN,
'custom_fields': settings.ZENDESK_CUSTOM_FIELDS
}
# Tag all issues with LMS to distinguish channel in Zendesk; requested by student support team
zendesk_tags = ['LMS']
# Per edX support, we would like to be able to route feedback items by site via tagging
current_site_name = configuration_helpers.get_value("SITE_NAME")
if current_site_name:
current_site_name = current_site_name.replace(".", "_")
zendesk_tags.append("site_name_{site}".format(site=current_site_name))
if request.user.is_authenticated():
context['user_enrollments'] = CourseEnrollment.enrollments_for_user(request.user)
enterprise_learner_data = enterprise_api.get_enterprise_learner_data(site=request.site, user=request.user)
if enterprise_learner_data:
zendesk_tags.append('enterprise_learner')
context['zendesk_tags'] = zendesk_tags
return render_to_response("support/contact_us.html", context)
......@@ -4,7 +4,7 @@
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from openedx.core.djangolib.js_utils import js_escaped_string
from openedx.core.djangolib.js_utils import js_escaped_string, dump_js_escaped_json
%>
<%inherit file="../main.html"/>
......@@ -33,9 +33,10 @@ from openedx.core.djangolib.js_utils import js_escaped_string
'loginQuery': "/login${login_query() | n, js_escaped_string}",
'dashboardUrl': "${reverse('dashboard') | n, js_escaped_string}",
'homepageUrl': "${marketing_link('ROOT') | n, js_escaped_string}",
'zendeskApiHost': "${zendeskApiHost | n, js_escaped_string}",
'zendeskApiHost': "${zendesk_api_host | n, js_escaped_string}",
'accessToken': "${access_token | n, js_escaped_string}",
'customFields': "${custom_fields | n, js_escaped_string}",
'customFields': ${custom_fields | n, dump_js_escaped_json},
'zendeskTags': ${zendesk_tags | n, dump_js_escaped_json},
}
% if user.is_authenticated():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment