Commit 0d9146a2 by Douglas Hall Committed by GitHub

Merge pull request #15196 from open-craft/uman/OC-2662

[ENT-370] Update Support Link on Sign In Page
parents c140ef32 13ac08a4
......@@ -94,6 +94,7 @@ from lms.envs.common import (
HELP_TOKENS_BOOKS,
SUPPORT_SITE_LINK,
PASSWORD_RESET_SUPPORT_LINK,
ACTIVATION_EMAIL_SUPPORT_LINK,
CONTACT_EMAIL,
......
......@@ -128,6 +128,9 @@ def login_and_registration_form(request, initial_mode="login"):
'third_party_auth_hint': third_party_auth_hint or '',
'platform_name': configuration_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME),
'support_link': configuration_helpers.get_value('SUPPORT_SITE_LINK', settings.SUPPORT_SITE_LINK),
'password_reset_support_link': configuration_helpers.get_value(
'PASSWORD_RESET_SUPPORT_LINK', settings.PASSWORD_RESET_SUPPORT_LINK
) or settings.SUPPORT_SITE_LINK,
'account_activation_messages': account_activation_messages,
# Include form descriptions retrieved from the user API.
......@@ -555,6 +558,9 @@ def account_settings_context(request):
}
},
'platform_name': configuration_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME),
'password_reset_support_link': configuration_helpers.get_value(
'PASSWORD_RESET_SUPPORT_LINK', settings.PASSWORD_RESET_SUPPORT_LINK
) or settings.SUPPORT_SITE_LINK,
'user_accounts_api_url': reverse("accounts_api", kwargs={'username': user.username}),
'user_preferences_api_url': reverse('preferences_api', kwargs={'username': user.username}),
'disable_courseware_js': True,
......
......@@ -309,9 +309,11 @@ ENABLE_COMPREHENSIVE_THEMING = ENV_TOKENS.get('ENABLE_COMPREHENSIVE_THEMING', EN
# Marketing link overrides
MKTG_URL_LINK_MAP.update(ENV_TOKENS.get('MKTG_URL_LINK_MAP', {}))
# Intentional defaults.
SUPPORT_SITE_LINK = ENV_TOKENS.get('SUPPORT_SITE_LINK', SUPPORT_SITE_LINK)
PASSWORD_RESET_SUPPORT_LINK = ENV_TOKENS.get('PASSWORD_RESET_SUPPORT_LINK', SUPPORT_SITE_LINK)
ACTIVATION_EMAIL_SUPPORT_LINK = ENV_TOKENS.get(
'ACTIVATION_EMAIL_SUPPORT_LINK', SUPPORT_SITE_LINK # Intentional default.
'ACTIVATION_EMAIL_SUPPORT_LINK', SUPPORT_SITE_LINK
)
# Mobile store URL overrides
......
......@@ -137,6 +137,7 @@
"SITE_NAME": "localhost:8003",
"STATIC_URL_BASE": "/static/",
"SUPPORT_SITE_LINK": "https://support.example.com",
"PASSWORD_RESET_SUPPORT_LINK": "https://support.example.com/password-reset-help.html",
"ACTIVATION_EMAIL_SUPPORT_LINK": "https://support.example.com/activation-email-help.html",
"SYSLOG_SERVER": "",
"TECH_SUPPORT_EMAIL": "technical@example.com",
......
......@@ -2271,6 +2271,7 @@ MKTG_URL_LINK_MAP = {
STATIC_TEMPLATE_VIEW_DEFAULT_FILE_EXTENSION = 'html'
SUPPORT_SITE_LINK = ''
PASSWORD_RESET_SUPPORT_LINK = ''
ACTIVATION_EMAIL_SUPPORT_LINK = ''
############################# SOCIAL MEDIA SHARING #############################
......
......@@ -361,6 +361,7 @@ MKTG_URL_LINK_MAP = {
}
SUPPORT_SITE_LINK = 'https://support.example.com'
PASSWORD_RESET_SUPPORT_LINK = 'https://support.example.com/password-reset-help.html'
ACTIVATION_EMAIL_SUPPORT_LINK = 'https://support.example.com/activation-email-help.html'
############################ STATIC FILES #############################
......
......@@ -14,50 +14,15 @@ define(['backbone',
'use strict';
describe('edx.user.AccountSettingsFactory', function() {
var FIELDS_DATA = {
'country': {
'options': Helpers.FIELD_OPTIONS
}, 'gender': {
'options': Helpers.FIELD_OPTIONS
}, 'language': {
'options': Helpers.FIELD_OPTIONS
}, 'level_of_education': {
'options': Helpers.FIELD_OPTIONS
}, 'password': {
'url': '/password_reset'
}, 'year_of_birth': {
'options': Helpers.FIELD_OPTIONS
}, 'preferred_language': {
'options': Helpers.FIELD_OPTIONS
}, 'time_zone': {
'options': Helpers.FIELD_OPTIONS
}
};
var AUTH_DATA = {
'providers': [
{
'id': 'oa2-network1',
'name': 'Network1',
'connected': true,
'accepts_logins': 'true',
'connect_url': 'yetanother1.com/auth/connect',
'disconnect_url': 'yetanother1.com/auth/disconnect'
},
{
'id': 'oa2-network2',
'name': 'Network2',
'connected': true,
'accepts_logins': 'true',
'connect_url': 'yetanother2.com/auth/connect',
'disconnect_url': 'yetanother2.com/auth/disconnect'
}
]
};
var createAccountSettingsPage = function() {
var context = AccountSettingsPage(
FIELDS_DATA, [], AUTH_DATA, Helpers.USER_ACCOUNTS_API_URL, Helpers.USER_PREFERENCES_API_URL, 'edX'
Helpers.FIELDS_DATA,
[],
Helpers.AUTH_DATA,
Helpers.PASSWORD_RESET_SUPPORT_LINK,
Helpers.USER_ACCOUNTS_API_URL,
Helpers.USER_PREFERENCES_API_URL,
Helpers.PLATFORM_NAME
);
return context.accountSettingsView;
};
......
......@@ -7,12 +7,63 @@ define(['underscore'], function(_) {
var IMAGE_UPLOAD_API_URL = '/api/profile_images/v0/staff/upload';
var IMAGE_REMOVE_API_URL = '/api/profile_images/v0/staff/remove';
var FIND_COURSES_URL = '/courses';
var PASSWORD_RESET_SUPPORT_LINK = 'https://support.edx.org/hc/en-us/articles/206212088-What-if-I-did-not-receive-a-password-reset-message-'; // eslint-disable-line max-len
var PLATFORM_NAME = 'edX';
var PROFILE_IMAGE = {
image_url_large: '/media/profile-images/image.jpg',
has_image: true
};
var FIELD_OPTIONS = [
['0', 'Option 0'],
['1', 'Option 1'],
['2', 'Option 2'],
['3', 'Option 3']
];
var TIME_ZONE_RESPONSE = [{
time_zone: 'America/Guyana',
description: 'America/Guyana (ECT, UTC-0500)'
}];
var FIELDS_DATA = {
country: {
options: FIELD_OPTIONS
}, gender: {
options: FIELD_OPTIONS
}, language: {
options: FIELD_OPTIONS
}, level_of_education: {
options: FIELD_OPTIONS
}, password: {
url: '/password_reset'
}, year_of_birth: {
options: FIELD_OPTIONS
}, preferred_language: {
options: FIELD_OPTIONS
}, time_zone: {
options: FIELD_OPTIONS
}
};
var AUTH_DATA = {
providers: [
{
id: 'oa2-network1',
name: 'Network1',
connected: true,
accepts_logins: 'true',
connect_url: 'yetanother1.com/auth/connect',
disconnect_url: 'yetanother1.com/auth/disconnect'
},
{
id: 'oa2-network2',
name: 'Network2',
connected: true,
accepts_logins: 'true',
connect_url: 'yetanother2.com/auth/connect',
disconnect_url: 'yetanother2.com/auth/disconnect'
}
]
};
var IMAGE_MAX_BYTES = 1024 * 1024;
var IMAGE_MIN_BYTES = 100;
var DEFAULT_ACCOUNT_SETTINGS_DATA = {
username: 'student',
name: 'Student',
......@@ -28,35 +79,19 @@ define(['underscore'], function(_) {
profile_image: PROFILE_IMAGE,
accomplishments_shared: false
};
var createAccountSettingsData = function(options) {
return _.extend(_.extend({}, DEFAULT_ACCOUNT_SETTINGS_DATA), options);
};
var DEFAULT_USER_PREFERENCES_DATA = {
'pref-lang': '2',
'time_zone': null
};
var createAccountSettingsData = function(options) {
return _.extend(_.extend({}, DEFAULT_ACCOUNT_SETTINGS_DATA), options);
};
var createUserPreferencesData = function(options) {
return _.extend(_.extend({}, DEFAULT_USER_PREFERENCES_DATA), options);
};
var FIELD_OPTIONS = [
['0', 'Option 0'],
['1', 'Option 1'],
['2', 'Option 2'],
['3', 'Option 3']
];
var TIME_ZONE_RESPONSE = [{
time_zone: 'America/Guyana',
description: 'America/Guyana (ECT, UTC-0500)'
}];
var IMAGE_MAX_BYTES = 1024 * 1024;
var IMAGE_MIN_BYTES = 100;
var expectLoadingIndicatorIsVisible = function(view, visible) {
if (visible) {
expect($('.ui-loading-indicator')).not.toHaveClass('is-hidden');
......@@ -88,10 +123,6 @@ define(['underscore'], function(_) {
}
};
var expectSettingsSectionsButNotFieldsToBeRendered = function(accountSettingsView) {
expectSettingsSectionsAndFieldsToBeRendered(accountSettingsView, false);
};
var expectSettingsSectionsAndFieldsToBeRendered = function(accountSettingsView, fieldsAreRendered) {
var sectionsData = accountSettingsView.options.tabSections.aboutTabSections;
......@@ -99,7 +130,8 @@ define(['underscore'], function(_) {
expect(sectionElements.length).toBe(sectionsData.length);
_.each(sectionElements, function(sectionElement, sectionIndex) {
expect($(sectionElement).find('.section-header').text().trim()).toBe(sectionsData[sectionIndex].title);
expect($(sectionElement).find('.section-header').text()
.trim()).toBe(sectionsData[sectionIndex].title);
var sectionFieldElements = $(sectionElement).find('.u-field');
......@@ -115,6 +147,10 @@ define(['underscore'], function(_) {
});
};
var expectSettingsSectionsButNotFieldsToBeRendered = function(accountSettingsView) {
expectSettingsSectionsAndFieldsToBeRendered(accountSettingsView, false);
};
return {
USER_ACCOUNTS_API_URL: USER_ACCOUNTS_API_URL,
USER_PREFERENCES_API_URL: USER_PREFERENCES_API_URL,
......@@ -122,13 +158,17 @@ define(['underscore'], function(_) {
FIND_COURSES_URL: FIND_COURSES_URL,
IMAGE_UPLOAD_API_URL: IMAGE_UPLOAD_API_URL,
IMAGE_REMOVE_API_URL: IMAGE_REMOVE_API_URL,
PASSWORD_RESET_SUPPORT_LINK: PASSWORD_RESET_SUPPORT_LINK,
PLATFORM_NAME: PLATFORM_NAME,
PROFILE_IMAGE: PROFILE_IMAGE,
FIELD_OPTIONS: FIELD_OPTIONS,
TIME_ZONE_RESPONSE: TIME_ZONE_RESPONSE,
FIELDS_DATA: FIELDS_DATA,
AUTH_DATA: AUTH_DATA,
IMAGE_MAX_BYTES: IMAGE_MAX_BYTES,
IMAGE_MIN_BYTES: IMAGE_MIN_BYTES,
PROFILE_IMAGE: PROFILE_IMAGE,
createAccountSettingsData: createAccountSettingsData,
createUserPreferencesData: createUserPreferencesData,
FIELD_OPTIONS: FIELD_OPTIONS,
TIME_ZONE_RESPONSE: TIME_ZONE_RESPONSE,
expectLoadingIndicatorIsVisible: expectLoadingIndicatorIsVisible,
expectLoadingErrorIsVisible: expectLoadingErrorIsVisible,
expectElementContainsField: expectElementContainsField,
......
......@@ -72,6 +72,7 @@
this.platformName = options.platform_name;
this.supportURL = options.support_link;
this.passwordResetSupportUrl = options.password_reset_support_link;
this.createAccountOption = options.account_creation_allowed;
// The login view listens for 'sync' events from the reset model
......@@ -129,6 +130,7 @@
accountActivationMessages: this.accountActivationMessages,
platformName: this.platformName,
supportURL: this.supportURL,
passwordResetSupportUrl: this.passwordResetSupportUrl,
createAccountOption: this.createAccountOption
});
......
......@@ -13,6 +13,7 @@
fieldsData,
ordersHistoryData,
authData,
passwordResetSupportUrl,
userAccountsApiUrl,
userPreferencesApiUrl,
accountUserId,
......@@ -76,6 +77,7 @@
screenReaderTitle: gettext('Reset Your Password'),
valueAttribute: 'password',
emailAttribute: 'email',
passwordResetSupportUrl: passwordResetSupportUrl,
linkTitle: gettext('Reset Your Password'),
linkHref: fieldsData.password.url,
helpMessage: StringUtils.interpolate(
......@@ -191,7 +193,7 @@
),
fields: _.map(authData.providers, function(provider) {
return {
'view': new AccountSettingsFieldViews.AuthFieldView({
view: new AccountSettingsFieldViews.AuthFieldView({
title: provider.name,
valueAttribute: 'auth-' + provider.id,
helpMessage: '',
......@@ -208,10 +210,10 @@
ordersHistoryData.unshift(
{
'title': gettext('ORDER NAME'),
'order_date': gettext('ORDER PLACED'),
'price': gettext('TOTAL'),
'number': gettext('ORDER NUMBER')
title: gettext('ORDER NAME'),
order_date: gettext('ORDER PLACED'),
price: gettext('TOTAL'),
number: gettext('ORDER NUMBER')
}
);
......@@ -228,7 +230,7 @@
orderNumber = 'orderId';
}
return {
'view': new AccountSettingsFieldViews.OrderHistoryFieldView({
view: new AccountSettingsFieldViews.OrderHistoryFieldView({
totalPrice: order.price,
orderId: order.number,
orderDate: order.order_date,
......
......@@ -25,8 +25,7 @@
field_order_history_template,
StringUtils,
HtmlUtils
)
{
) {
var AccountSettingsFieldViews = {
ReadonlyFieldView: FieldViews.ReadonlyFieldView.extend({
fieldTemplate: field_readonly_account_template
......@@ -44,7 +43,7 @@
this.indicators.success,
StringUtils.interpolate(
gettext('We\'ve sent a confirmation message to {new_email_address}. Click the link in the message to update your email address.'), // eslint-disable-line max-len
{'new_email_address': this.fieldValue()}
{new_email_address: this.fieldValue()}
)
);
}
......@@ -53,7 +52,7 @@
fieldTemplate: field_dropdown_account_template,
saveSucceeded: function() {
var data = {
'language': this.modelValue()
language: this.modelValue()
};
var view = this;
......@@ -189,9 +188,19 @@
successMessage: function() {
return HtmlUtils.joinHtml(
this.indicators.success,
StringUtils.interpolate(
gettext('We\'ve sent a message to {email_address}. Click the link in the message to reset your password.'), // eslint-disable-line max-len
{'email_address': this.model.get(this.options.emailAttribute)}
HtmlUtils.interpolateHtml(
gettext('We\'ve sent a message to {email}. Click the link in the message to reset your password. Didn\'t receive the message? Contact {anchorStart}technical support{anchorEnd}.'), // eslint-disable-line max-len
{
email: this.model.get(this.options.emailAttribute),
anchorStart: HtmlUtils.HTML(
StringUtils.interpolate(
'<a href="{passwordResetSupportUrl}">', {
passwordResetSupportUrl: this.options.passwordResetSupportUrl
}
)
),
anchorEnd: HtmlUtils.HTML('</a>')
}
)
);
}
......@@ -209,7 +218,7 @@
saveValue: function() {
if (this.persistChanges === true) {
var attributes = {},
value = this.fieldValue() ? [{'code': this.fieldValue()}] : [];
value = this.fieldValue() ? [{code: this.fieldValue()}] : [];
attributes[this.options.valueAttribute] = value;
this.saveAttributes(attributes);
}
......
......@@ -41,6 +41,7 @@ from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_str
fieldsData,
ordersHistoryData,
authData,
'${ password_reset_support_link | n, js_escaped_string }',
'${ user_accounts_api_url | n, js_escaped_string }',
'${ user_preferences_api_url | n, js_escaped_string }',
${ user.id | n, dump_js_escaped_json },
......
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