From 4952ecb413dbd549ee03c1a4f144dea4dc11ccbd Mon Sep 17 00:00:00 2001 From: Sagirov Eugeniy Date: Fri, 29 Apr 2022 19:19:01 +0300 Subject: [PATCH] feat: Account pages. Added ACCOUNT_PROFILE_URL and ACCOUNT_SETTINGS_URL settings. --- .env.development | 2 ++ .env.test | 2 ++ src/config.js | 4 ++++ src/setupTest.js | 2 ++ 4 files changed, 10 insertions(+) diff --git a/.env.development b/.env.development index 26bd22668..874001281 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,7 @@ EXAMPLE_VAR=Example Value ACCESS_TOKEN_COOKIE_NAME=edx-jwt-cookie-header-payload +ACCOUNT_PROFILE_URL=http://localhost:1995 +ACCOUNT_SETTINGS_URL=http://localhost:1997 BASE_URL=http://localhost:8080 CREDENTIALS_BASE_URL=http://localhost:18150 CSRF_TOKEN_API_PATH=/csrf/api/v1/token diff --git a/.env.test b/.env.test index 26bd22668..874001281 100644 --- a/.env.test +++ b/.env.test @@ -1,5 +1,7 @@ EXAMPLE_VAR=Example Value ACCESS_TOKEN_COOKIE_NAME=edx-jwt-cookie-header-payload +ACCOUNT_PROFILE_URL=http://localhost:1995 +ACCOUNT_SETTINGS_URL=http://localhost:1997 BASE_URL=http://localhost:8080 CREDENTIALS_BASE_URL=http://localhost:18150 CSRF_TOKEN_API_PATH=/csrf/api/v1/token diff --git a/src/config.js b/src/config.js index b6d3532a5..9ace83640 100644 --- a/src/config.js +++ b/src/config.js @@ -41,6 +41,8 @@ function extractRegex(envVar) { const ENVIRONMENT = process.env.NODE_ENV; let config = { ACCESS_TOKEN_COOKIE_NAME: process.env.ACCESS_TOKEN_COOKIE_NAME, + ACCOUNT_PROFILE_URL: process.env.ACCOUNT_PROFILE_URL, + ACCOUNT_SETTINGS_URL: process.env.ACCOUNT_SETTINGS_URL, BASE_URL: process.env.BASE_URL, PUBLIC_PATH: process.env.PUBLIC_PATH || '/', CREDENTIALS_BASE_URL: process.env.CREDENTIALS_BASE_URL, @@ -168,6 +170,8 @@ export function ensureConfig(keys, requester = 'unspecified application code') { * @name ConfigDocument * @memberof module:Config * @property {string} ACCESS_TOKEN_COOKIE_NAME + * @property {string} ACCOUNT_PROFILE_URL + * @property {string} ACCOUNT_SETTINGS_URL * @property {string} BASE_URL The URL of the current application. * @property {string} CREDENTIALS_BASE_URL * @property {string} CSRF_TOKEN_API_PATH diff --git a/src/setupTest.js b/src/setupTest.js index 5bac1e543..5954768be 100644 --- a/src/setupTest.js +++ b/src/setupTest.js @@ -10,6 +10,8 @@ Enzyme.configure({ adapter: new Adapter() }); // These configuration values are usually set in webpack's EnvironmentPlugin however // Jest does not use webpack so we need to set these so for testing process.env.ACCESS_TOKEN_COOKIE_NAME = 'edx-jwt-cookie-header-payload'; +process.env.ACCOUNT_PROFILE_URL = 'http://localhost:1995'; +process.env.ACCOUNT_SETTINGS_URL = 'http://localhost:1997'; process.env.BASE_URL = 'localhost:8080'; process.env.CREDENTIALS_BASE_URL = 'http://localhost:18150'; process.env.CSRF_TOKEN_API_PATH = '/csrf/api/v1/token';