feat: update configs (#721)
This commit is contained in:
21
.env
21
.env
@@ -13,22 +13,23 @@ ORDER_HISTORY_URL=null
|
|||||||
REFRESH_ACCESS_TOKEN_ENDPOINT=null
|
REFRESH_ACCESS_TOKEN_ENDPOINT=null
|
||||||
SEGMENT_KEY=''
|
SEGMENT_KEY=''
|
||||||
SITE_NAME=null
|
SITE_NAME=null
|
||||||
USER_INFO_COOKIE_NAME=null
|
|
||||||
AUTHN_MINIMAL_HEADER=true
|
|
||||||
LOGIN_ISSUE_SUPPORT_LINK=''
|
|
||||||
USER_SURVEY_COOKIE_NAME=null
|
|
||||||
COOKIE_DOMAIN=null
|
|
||||||
AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK=null
|
|
||||||
INFO_EMAIL=''
|
INFO_EMAIL=''
|
||||||
DISABLE_ENTERPRISE_LOGIN=''
|
# ***** Cookies *****
|
||||||
REGISTER_CONVERSION_COOKIE_NAME=null
|
REGISTER_CONVERSION_COOKIE_NAME=null
|
||||||
|
USER_SURVEY_COOKIE_NAME=null
|
||||||
|
# ***** Links *****
|
||||||
|
LOGIN_ISSUE_SUPPORT_LINK=''
|
||||||
|
AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK=null
|
||||||
|
# ***** Features flags *****
|
||||||
|
DISABLE_ENTERPRISE_LOGIN=''
|
||||||
|
ENABLE_COOKIE_POLICY_BANNER=''
|
||||||
|
ENABLE_DYNAMIC_REGISTRATION_FIELDS=''
|
||||||
ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN=''
|
ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN=''
|
||||||
MARKETING_EMAILS_OPT_IN=''
|
MARKETING_EMAILS_OPT_IN=''
|
||||||
ENABLE_COPPA_COMPLIANCE=''
|
|
||||||
SHOW_CONFIGURABLE_EDX_FIELDS=''
|
SHOW_CONFIGURABLE_EDX_FIELDS=''
|
||||||
SHOW_DYNAMIC_PROFILING_PAGE=''
|
# ***** Zendesk related keys *****
|
||||||
ZENDESK_KEY=''
|
ZENDESK_KEY=''
|
||||||
ZENDESK_LOGO_URL=''
|
ZENDESK_LOGO_URL=''
|
||||||
|
# ***** Miscellaneous *****
|
||||||
APP_ID=''
|
APP_ID=''
|
||||||
MFE_CONFIG_API_URL=''
|
MFE_CONFIG_API_URL=''
|
||||||
ENABLE_COOKIE_POLICY_BANNER=''
|
|
||||||
|
|||||||
@@ -18,22 +18,18 @@ ORDER_HISTORY_URL='http://localhost:1996/orders'
|
|||||||
REFRESH_ACCESS_TOKEN_ENDPOINT='http://localhost:18000/login_refresh'
|
REFRESH_ACCESS_TOKEN_ENDPOINT='http://localhost:18000/login_refresh'
|
||||||
SEGMENT_KEY=''
|
SEGMENT_KEY=''
|
||||||
SITE_NAME='Your Platform Name Here'
|
SITE_NAME='Your Platform Name Here'
|
||||||
|
INFO_EMAIL='info@example.com'
|
||||||
|
# ***** Cookies *****
|
||||||
|
REGISTER_CONVERSION_COOKIE_NAME='openedx-user-register-conversion'
|
||||||
|
SESSION_COOKIE_DOMAIN='localhost'
|
||||||
USER_INFO_COOKIE_NAME='edx-user-info'
|
USER_INFO_COOKIE_NAME='edx-user-info'
|
||||||
AUTHN_MINIMAL_HEADER=true
|
USER_SURVEY_COOKIE_NAME='openedx-user-survey-type'
|
||||||
LOGIN_ISSUE_SUPPORT_LINK='/login-issue-support-url'
|
# ***** Links *****
|
||||||
|
LOGIN_ISSUE_SUPPORT_LINK='http://localhost:18000/login-issue-support-url'
|
||||||
TOS_AND_HONOR_CODE='http://localhost:18000/honor'
|
TOS_AND_HONOR_CODE='http://localhost:18000/honor'
|
||||||
TOS_LINK='http://localhost:18000/tos'
|
TOS_LINK='http://localhost:18000/tos'
|
||||||
PRIVACY_POLICY='http://localhost:18000/privacy'
|
PRIVACY_POLICY='http://localhost:18000/privacy'
|
||||||
USER_SURVEY_COOKIE_NAME='openedx-user-survey-type'
|
|
||||||
COOKIE_DOMAIN='localhost'
|
|
||||||
AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK='http://localhost:1999/welcome'
|
AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK='http://localhost:1999/welcome'
|
||||||
INFO_EMAIL='info@edx.org'
|
# ***** Miscellaneous *****
|
||||||
DISABLE_ENTERPRISE_LOGIN=''
|
|
||||||
REGISTER_CONVERSION_COOKIE_NAME='openedx-user-register-conversion'
|
|
||||||
ENABLE_COPPA_COMPLIANCE=''
|
|
||||||
MARKETING_EMAILS_OPT_IN=''
|
|
||||||
ZENDESK_KEY=''
|
|
||||||
ZENDESK_LOGO_URL=''
|
|
||||||
APP_ID=''
|
APP_ID=''
|
||||||
MFE_CONFIG_API_URL=''
|
MFE_CONFIG_API_URL=''
|
||||||
SHOW_CONFIGURABLE_EDX_FIELDS='true'
|
|
||||||
|
|||||||
5
.env.private.example
Normal file
5
.env.private.example
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# Copy these to the .env.private to enable edX specific functionality on local system
|
||||||
|
ENABLE_COOKIE_POLICY_BANNER='true'
|
||||||
|
ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN='true'
|
||||||
|
MARKETING_EMAILS_OPT_IN='true'
|
||||||
|
SHOW_CONFIGURABLE_EDX_FIELDS='true'
|
||||||
@@ -16,15 +16,7 @@ ORDER_HISTORY_URL='http://localhost:1996/orders'
|
|||||||
REFRESH_ACCESS_TOKEN_ENDPOINT='http://localhost:18000/login_refresh'
|
REFRESH_ACCESS_TOKEN_ENDPOINT='http://localhost:18000/login_refresh'
|
||||||
SEGMENT_KEY=''
|
SEGMENT_KEY=''
|
||||||
SITE_NAME='Your Platform Name Here'
|
SITE_NAME='Your Platform Name Here'
|
||||||
USER_INFO_COOKIE_NAME='edx-user-info'
|
|
||||||
LOGIN_ISSUE_SUPPORT_LINK='https://login-issue-support-url.com'
|
|
||||||
USER_SURVEY_COOKIE_NAME='openedx-user-survey-type'
|
USER_SURVEY_COOKIE_NAME='openedx-user-survey-type'
|
||||||
AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK='http://localhost:1999/welcome'
|
|
||||||
DISABLE_ENTERPRISE_LOGIN=''
|
|
||||||
REGISTER_CONVERSION_COOKIE_NAME='openedx-user-register-conversion'
|
REGISTER_CONVERSION_COOKIE_NAME='openedx-user-register-conversion'
|
||||||
MARKETING_EMAILS_OPT_IN=''
|
|
||||||
ENABLE_COPPA_COMPLIANCE=''
|
|
||||||
ZENDESK_KEY=''
|
|
||||||
ZENDESK_LOGO_URL=''
|
|
||||||
APP_ID=''
|
APP_ID=''
|
||||||
MFE_CONFIG_API_URL=''
|
MFE_CONFIG_API_URL=''
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
coverage/*
|
coverage/*
|
||||||
dist/
|
dist/
|
||||||
|
docs
|
||||||
node_modules/
|
node_modules/
|
||||||
__mocks__/
|
__mocks__/
|
||||||
__snapshots__/
|
__snapshots__/
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,6 +5,7 @@ node_modules
|
|||||||
npm-debug.log
|
npm-debug.log
|
||||||
coverage
|
coverage
|
||||||
module.config.js
|
module.config.js
|
||||||
|
.env.private
|
||||||
|
|
||||||
dist/
|
dist/
|
||||||
src/i18n/transifex_input.json
|
src/i18n/transifex_input.json
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
# The following users are the owners of all frontend-app-authn files
|
# The following users are the owners of all frontend-app-authn files
|
||||||
* @edx/vanguards
|
* @openedx/vanguards
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
|
|
||||||
nick: Authn MFE
|
nick: Authn MFE
|
||||||
oeps: {}
|
oeps: {}
|
||||||
owner: edx/vanguards
|
owner: openedx/vanguards
|
||||||
openedx-release:
|
openedx-release:
|
||||||
ref: master
|
ref: master
|
||||||
|
|||||||
25
src/config/index.js
Normal file
25
src/config/index.js
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
const configuration = {
|
||||||
|
// Cookies related configs
|
||||||
|
SESSION_COOKIE_DOMAIN: process.env.SESSION_COOKIE_DOMAIN,
|
||||||
|
REGISTER_CONVERSION_COOKIE_NAME: process.env.REGISTER_CONVERSION_COOKIE_NAME || null,
|
||||||
|
USER_SURVEY_COOKIE_NAME: process.env.USER_SURVEY_COOKIE_NAME || null,
|
||||||
|
// Features
|
||||||
|
DISABLE_ENTERPRISE_LOGIN: process.env.DISABLE_ENTERPRISE_LOGIN || '',
|
||||||
|
ENABLE_COOKIE_POLICY_BANNER: process.env.ENABLE_COOKIE_POLICY_BANNER || false,
|
||||||
|
ENABLE_DYNAMIC_REGISTRATION_FIELDS: process.env.ENABLE_DYNAMIC_REGISTRATION_FIELDS || false,
|
||||||
|
ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN: process.env.ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN || false,
|
||||||
|
MARKETING_EMAILS_OPT_IN: process.env.MARKETING_EMAILS_OPT_IN || '',
|
||||||
|
SHOW_CONFIGURABLE_EDX_FIELDS: process.env.SHOW_CONFIGURABLE_EDX_FIELDS || false,
|
||||||
|
// Links
|
||||||
|
ACTIVATION_EMAIL_SUPPORT_LINK: process.env.ACTIVATION_EMAIL_SUPPORT_LINK || null,
|
||||||
|
AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK: process.env.AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK || null,
|
||||||
|
LOGIN_ISSUE_SUPPORT_LINK: process.env.LOGIN_ISSUE_SUPPORT_LINK || null,
|
||||||
|
PASSWORD_RESET_SUPPORT_LINK: process.env.PASSWORD_RESET_SUPPORT_LINK || null,
|
||||||
|
PRIVACY_POLICY: process.env.PRIVACY_POLICY || null,
|
||||||
|
TOS_AND_HONOR_CODE: process.env.TOS_AND_HONOR_CODE || null,
|
||||||
|
TOS_LINK: process.env.TOS_LINK || null,
|
||||||
|
// Miscellaneous
|
||||||
|
INFO_EMAIL: process.env.INFO_EMAIL || '',
|
||||||
|
};
|
||||||
|
|
||||||
|
export default configuration;
|
||||||
@@ -3,7 +3,7 @@ import Cookies from 'universal-cookie';
|
|||||||
|
|
||||||
export function setCookie(cookieName, cookieValue, cookieExpiry) {
|
export function setCookie(cookieName, cookieValue, cookieExpiry) {
|
||||||
const cookies = new Cookies();
|
const cookies = new Cookies();
|
||||||
const options = { domain: getConfig().COOKIE_DOMAIN, path: '/' };
|
const options = { domain: getConfig().SESSION_COOKIE_DOMAIN, path: '/' };
|
||||||
if (cookieExpiry) {
|
if (cookieExpiry) {
|
||||||
options.expires = cookieExpiry;
|
options.expires = cookieExpiry;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
import { ErrorPage } from '@edx/frontend-platform/react';
|
import { ErrorPage } from '@edx/frontend-platform/react';
|
||||||
import { messages as paragonMessages } from '@edx/paragon';
|
import { messages as paragonMessages } from '@edx/paragon';
|
||||||
|
|
||||||
|
import configuration from './config';
|
||||||
import appMessages from './i18n';
|
import appMessages from './i18n';
|
||||||
import MainApp from './MainApp';
|
import MainApp from './MainApp';
|
||||||
|
|
||||||
@@ -27,26 +28,7 @@ subscribe(APP_INIT_ERROR, (error) => {
|
|||||||
initialize({
|
initialize({
|
||||||
handlers: {
|
handlers: {
|
||||||
config: () => {
|
config: () => {
|
||||||
mergeConfig({
|
mergeConfig(configuration);
|
||||||
LOGIN_ISSUE_SUPPORT_LINK: process.env.LOGIN_ISSUE_SUPPORT_LINK || null,
|
|
||||||
ACTIVATION_EMAIL_SUPPORT_LINK: process.env.ACTIVATION_EMAIL_SUPPORT_LINK || null,
|
|
||||||
PASSWORD_RESET_SUPPORT_LINK: process.env.PASSWORD_RESET_SUPPORT_LINK || null,
|
|
||||||
TOS_AND_HONOR_CODE: process.env.TOS_AND_HONOR_CODE || null,
|
|
||||||
TOS_LINK: process.env.TOS_LINK || null,
|
|
||||||
PRIVACY_POLICY: process.env.PRIVACY_POLICY || null,
|
|
||||||
USER_SURVEY_COOKIE_NAME: process.env.USER_SURVEY_COOKIE_NAME || null,
|
|
||||||
COOKIE_DOMAIN: process.env.COOKIE_DOMAIN,
|
|
||||||
AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK: process.env.AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK || null,
|
|
||||||
DISABLE_ENTERPRISE_LOGIN: process.env.DISABLE_ENTERPRISE_LOGIN || '',
|
|
||||||
INFO_EMAIL: process.env.INFO_EMAIL || '',
|
|
||||||
REGISTER_CONVERSION_COOKIE_NAME: process.env.REGISTER_CONVERSION_COOKIE_NAME || null,
|
|
||||||
ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN: process.env.ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN || false,
|
|
||||||
MARKETING_EMAILS_OPT_IN: process.env.MARKETING_EMAILS_OPT_IN || '',
|
|
||||||
ENABLE_COPPA_COMPLIANCE: process.env.ENABLE_COPPA_COMPLIANCE || '',
|
|
||||||
ENABLE_DYNAMIC_REGISTRATION_FIELDS: process.env.ENABLE_DYNAMIC_REGISTRATION_FIELDS || false,
|
|
||||||
SHOW_CONFIGURABLE_EDX_FIELDS: process.env.SHOW_CONFIGURABLE_EDX_FIELDS || false,
|
|
||||||
ENABLE_COOKIE_POLICY_BANNER: process.env.ENABLE_COOKIE_POLICY_BANNER || false,
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
messages: [
|
messages: [
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { getConfig, mergeConfig } from '@edx/frontend-platform';
|
import { getConfig } from '@edx/frontend-platform';
|
||||||
import { injectIntl, IntlProvider } from '@edx/frontend-platform/i18n';
|
import { injectIntl, IntlProvider } from '@edx/frontend-platform/i18n';
|
||||||
import { mount } from 'enzyme';
|
import { mount } from 'enzyme';
|
||||||
|
|
||||||
@@ -9,9 +9,6 @@ import TermsOfService from '../registrationFields/TermsOfService';
|
|||||||
const IntlTermsOfService = injectIntl(TermsOfService);
|
const IntlTermsOfService = injectIntl(TermsOfService);
|
||||||
|
|
||||||
describe('TermsOfServiceTest', () => {
|
describe('TermsOfServiceTest', () => {
|
||||||
mergeConfig({
|
|
||||||
TOS_LINK: 'http://tos-and-honor-code.com',
|
|
||||||
});
|
|
||||||
let value = false;
|
let value = false;
|
||||||
|
|
||||||
const changeHandler = (e) => {
|
const changeHandler = (e) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user