From e2e4003b44f68cce28dca784f2e25530aaac6270 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Sun, 13 Oct 2024 22:30:18 +0200 Subject: [PATCH 1/4] fix: send json accept headers for POST requests --- src/account-settings/site-language/service.js | 11 ++++++++--- src/account-settings/third-party-auth/data/service.js | 3 ++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/account-settings/site-language/service.js b/src/account-settings/site-language/service.js index 66466949b..a96f23bd5 100644 --- a/src/account-settings/site-language/service.js +++ b/src/account-settings/site-language/service.js @@ -23,10 +23,15 @@ export async function patchPreferences(username, params) { export async function postSetLang(code) { const formData = new FormData(); + const requestConfig = { + headers: { + Accept: 'application/json', + 'X-Requested-With': 'XMLHttpRequest', + } + }; + const url = `${getConfig().LMS_BASE_URL}/i18n/setlang/`; formData.append('language', code); await getAuthenticatedHttpClient() - .post(`${getConfig().LMS_BASE_URL}/i18n/setlang/`, formData, { - headers: { 'X-Requested-With': 'XMLHttpRequest' }, - }); + .post(url, formData, requestConfig); } diff --git a/src/account-settings/third-party-auth/data/service.js b/src/account-settings/third-party-auth/data/service.js index 344913ee7..f3d07e53c 100644 --- a/src/account-settings/third-party-auth/data/service.js +++ b/src/account-settings/third-party-auth/data/service.js @@ -16,8 +16,9 @@ export async function getThirdPartyAuthProviders() { } export async function postDisconnectAuth(url) { + const requestConfig = { headers: { Accept: 'application/json' } }; const { data } = await getAuthenticatedHttpClient() - .post(url) + .post(url, {}, requestConfig) .catch(handleRequestError); return data; } From 8a4eecf6c2fdaaae14bdb4165ec38726de330ee0 Mon Sep 17 00:00:00 2001 From: Bryann Valderrama Date: Wed, 16 Oct 2024 10:33:37 -0500 Subject: [PATCH 2/4] fix: add missing trailing comma --- src/account-settings/site-language/service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/account-settings/site-language/service.js b/src/account-settings/site-language/service.js index a96f23bd5..5b8c9f2ef 100644 --- a/src/account-settings/site-language/service.js +++ b/src/account-settings/site-language/service.js @@ -27,7 +27,7 @@ export async function postSetLang(code) { headers: { Accept: 'application/json', 'X-Requested-With': 'XMLHttpRequest', - } + }, }; const url = `${getConfig().LMS_BASE_URL}/i18n/setlang/`; formData.append('language', code); From 8066ae58f112e907b01149242f9fdb1a4e817372 Mon Sep 17 00:00:00 2001 From: Brian Smith <112954497+brian-smith-tcril@users.noreply.github.com> Date: Tue, 22 Oct 2024 19:18:39 -0400 Subject: [PATCH 3/4] feat(deps): update header to 5.6.0 (#1144) --- package-lock.json | 9 ++++----- package.json | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index b3572f4a7..453ae34a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "AGPL-3.0", "dependencies": { "@edx/brand": "npm:@openedx/brand-openedx@^1.2.2", - "@edx/frontend-component-header": "5.5.0", + "@edx/frontend-component-header": "^5.6.0", "@edx/frontend-platform": "8.1.2", "@edx/openedx-atlas": "^0.6.0", "@fortawesome/fontawesome-svg-core": "^6.6.0", @@ -2010,10 +2010,9 @@ } }, "node_modules/@edx/frontend-component-header": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@edx/frontend-component-header/-/frontend-component-header-5.5.0.tgz", - "integrity": "sha512-nvpuTIx1o27LUGJ17HpOOm+PX0gg/YumWUMsrl1gSjbrTksyDLOxS1Y4thqlrWzD+dAgk5YKMowZM2BLiRDguQ==", - "license": "AGPL-3.0", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@edx/frontend-component-header/-/frontend-component-header-5.6.0.tgz", + "integrity": "sha512-ITLLrej6BbWVc/0baMkKg/ACTvUGSR188Rn/BC2Y82Tdu8gRsZB6+0GUsDX/6FJjeIazLXdUusKlfwVU90sXLA==", "dependencies": { "@fortawesome/fontawesome-svg-core": "6.6.0", "@fortawesome/free-brands-svg-icons": "6.6.0", diff --git a/package.json b/package.json index d7df66233..3cca35c71 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ ], "dependencies": { "@edx/brand": "npm:@openedx/brand-openedx@^1.2.2", - "@edx/frontend-component-header": "5.5.0", + "@edx/frontend-component-header": "^5.6.0", "@edx/frontend-platform": "8.1.2", "@edx/openedx-atlas": "^0.6.0", "@fortawesome/fontawesome-svg-core": "^6.6.0", From 538d85b5dd4677716a888bb96e8e0531b439aecc Mon Sep 17 00:00:00 2001 From: Muhammad Adeel Tajamul <77053848+muhammadadeeltajamul@users.noreply.github.com> Date: Wed, 23 Oct 2024 13:28:58 +0500 Subject: [PATCH 4/4] feat: removed never from cadence options (#1142) --- .env.development | 2 +- src/notification-preferences/data/constants.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.env.development b/.env.development index ee578f76e..c3c003740 100644 --- a/.env.development +++ b/.env.development @@ -28,7 +28,7 @@ ENABLE_COPPA_COMPLIANCE='' ENABLE_ACCOUNT_DELETION='' ENABLE_DOB_UPDATE='' MARKETING_EMAILS_OPT_IN='' -SHOW_EMAIL_CHANNEL='' +SHOW_EMAIL_CHANNEL='true' APP_ID= MFE_CONFIG_API_URL= PASSWORD_RESET_SUPPORT_LINK='mailto:support@example.com' diff --git a/src/notification-preferences/data/constants.js b/src/notification-preferences/data/constants.js index a3a3a9e5b..29091ce52 100644 --- a/src/notification-preferences/data/constants.js +++ b/src/notification-preferences/data/constants.js @@ -1,7 +1,6 @@ const EMAIL_CADENCE = { DAILY: 'Daily', WEEKLY: 'Weekly', - NEVER: 'Never', }; export default EMAIL_CADENCE;