From 7aeb82a7ff5353028d3fdcda426a34097285013c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Thu, 8 Dec 2022 14:09:33 +0100 Subject: [PATCH] fix: profile url when accessed from other MFEs In the account MFE (for instance), the top-right menu link to the profile MFE was incorrect, as it included an "undefined/" portion. (cherry picked from commit 7403e5edc970839e0bab4557e3e8d28946afcc3a) --- tutormfe/patches/openedx-lms-development-settings | 3 +++ tutormfe/patches/openedx-lms-production-settings | 3 +++ 2 files changed, 6 insertions(+) diff --git a/tutormfe/patches/openedx-lms-development-settings b/tutormfe/patches/openedx-lms-development-settings index c3c5bc57..45dce39f 100644 --- a/tutormfe/patches/openedx-lms-development-settings +++ b/tutormfe/patches/openedx-lms-development-settings @@ -27,6 +27,9 @@ CSRF_TRUSTED_ORIGINS.append("{{ MFE_HOST }}:{{ app["port"] }}") # https://openedx.github.io/frontend-platform/module-Config.html MFE_CONFIG = { "BASE_URL": "{{ MFE_HOST }}", + {%- if MFE_PROFILE_MFE_APP %} + "ACCOUNT_PROFILE_URL": "http://{{ MFE_HOST }}:{{ MFE_PROFILE_MFE_APP["port"] }}", + {%- endif %} "CREDENTIALS_BASE_URL": "/csrf/api/v1/token", "DISCOVERY_API_BASE_URL": "{% if DISCOVERY_HOST is defined %}http://{{ DISCOVERY_HOST }}:8381{% endif %}", "FAVICON_URL": "http://{{ LMS_HOST }}/favicon.ico", diff --git a/tutormfe/patches/openedx-lms-production-settings b/tutormfe/patches/openedx-lms-production-settings index 8120950a..c9d3a3aa 100644 --- a/tutormfe/patches/openedx-lms-production-settings +++ b/tutormfe/patches/openedx-lms-production-settings @@ -24,6 +24,9 @@ ALLOWED_HOSTS.append("{{ MFE_HOST }}") # Start of Dynamic config API settings MFE_CONFIG = { "BASE_URL": "{{ MFE_HOST }}", + {%- if MFE_PROFILE_MFE_APP %} + "ACCOUNT_PROFILE_URL": "{% if ENABLE_HTTPS %}https://{% else %}http://{% endif %}{{ MFE_HOST }}/{{ MFE_PROFILE_MFE_APP["name"] }}", + {%- endif %} "CREDENTIALS_BASE_URL": "/csrf/api/v1/token", "DISCOVERY_API_BASE_URL": "{% if DISCOVERY_HOST is defined %}{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ DISCOVERY_HOST }}{% endif %}", "FAVICON_URL": "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/favicon.ico",