diff --git a/CHANGELOG.md b/CHANGELOG.md index 291b2f3b..b4f9ed5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,3 +18,12 @@ instructions, because git commits are used to generate release notes: --> + + +## v16.0.1 (2023-12-08) + +- [Improvement] Add a changelog file to this plugin. (by @regisb) +- [Feature] Improve support of auto-mounted ecommerce repository. (by @regisb) +- [Improvement] Added Typing to code, Makefile and test action to the repository and formatted code with Black and isort. (by @CodeWithEmad) +- [Feature] Add patch ecommerce-dockerfile-pre-assets. (by @igobranco) +- [Bugfix] Switch ecommerce MFE port from 1996 to 7296, as it clashes with the new learner dashboard. (by @regisb) diff --git a/changelog.d/20230320_152027_regis_changelog.md b/changelog.d/20230320_152027_regis_changelog.md deleted file mode 100644 index 8971794e..00000000 --- a/changelog.d/20230320_152027_regis_changelog.md +++ /dev/null @@ -1 +0,0 @@ -- [Improvement] Add a changelog file to this plugin. (by @regisb) diff --git a/changelog.d/20230519_161836_regis.md b/changelog.d/20230519_161836_regis.md deleted file mode 100644 index a1bc2f75..00000000 --- a/changelog.d/20230519_161836_regis.md +++ /dev/null @@ -1,12 +0,0 @@ - - - - - \ No newline at end of file diff --git a/changelog.d/20230919_104436_regis_auto_mount.md b/changelog.d/20230919_104436_regis_auto_mount.md deleted file mode 100644 index 2e051b24..00000000 --- a/changelog.d/20230919_104436_regis_auto_mount.md +++ /dev/null @@ -1 +0,0 @@ -- [Feature] Improve support of auto-mounted ecommerce repository. (by @regisb) diff --git a/changelog.d/20231118_174413_codewithemad.md b/changelog.d/20231118_174413_codewithemad.md deleted file mode 100644 index 952a3831..00000000 --- a/changelog.d/20231118_174413_codewithemad.md +++ /dev/null @@ -1 +0,0 @@ -- [Improvement] Added Typing to code, Makefile and test action to the repository and formatted code with Black and isort. (by @CodeWithEmad) \ No newline at end of file diff --git a/changelog.d/20231123_114642_ivo.branco.md b/changelog.d/20231123_114642_ivo.branco.md deleted file mode 100644 index 6dad610c..00000000 --- a/changelog.d/20231123_114642_ivo.branco.md +++ /dev/null @@ -1 +0,0 @@ -- [Feature] Add patch ecommerce-dockerfile-pre-assets. (by @igobranco) \ No newline at end of file diff --git a/tutorecommerce/__about__.py b/tutorecommerce/__about__.py index 5e5e9109..610c1115 100644 --- a/tutorecommerce/__about__.py +++ b/tutorecommerce/__about__.py @@ -1 +1 @@ -__version__ = "16.0.0" +__version__ = "16.0.1" diff --git a/tutorecommerce/patches/openedx-lms-development-settings b/tutorecommerce/patches/openedx-lms-development-settings index 9f38689e..4079bfcd 100644 --- a/tutorecommerce/patches/openedx-lms-development-settings +++ b/tutorecommerce/patches/openedx-lms-development-settings @@ -1,6 +1,10 @@ # Ecommerce +{% for app_name, app in iter_mfes() %} +{% if app_name == "orders" %} ECOMMERCE_PUBLIC_URL_ROOT = "http://{{ ECOMMERCE_HOST }}:8130" ECOMMERCE_API_URL = ECOMMERCE_PUBLIC_URL_ROOT + "/api/v2" -ORDER_HISTORY_MICROFRONTEND_URL = "http://{{ MFE_HOST }}:{{ ECOMMERCE_MFE_APP['port'] }}/{{ ECOMMERCE_MFE_APP['name'] }}/orders" +ORDER_HISTORY_MICROFRONTEND_URL = "http://{{ MFE_HOST }}:{{ app['port'] }}/{{ app_name }}/orders" MFE_CONFIG["ECOMMERCE_BASE_URL"] = ECOMMERCE_PUBLIC_URL_ROOT MFE_CONFIG["ORDER_HISTORY_URL"] = ORDER_HISTORY_MICROFRONTEND_URL +{% endif %} +{% endfor %} diff --git a/tutorecommerce/patches/openedx-lms-production-settings b/tutorecommerce/patches/openedx-lms-production-settings index 36eb632a..61116c6e 100644 --- a/tutorecommerce/patches/openedx-lms-production-settings +++ b/tutorecommerce/patches/openedx-lms-production-settings @@ -1,6 +1,6 @@ # Ecommerce ECOMMERCE_PUBLIC_URL_ROOT = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ ECOMMERCE_HOST }}" ECOMMERCE_API_URL = ECOMMERCE_PUBLIC_URL_ROOT + "/api/v2" -ORDER_HISTORY_MICROFRONTEND_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ MFE_HOST }}/{{ ECOMMERCE_MFE_APP['name'] }}/orders" +ORDER_HISTORY_MICROFRONTEND_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ MFE_HOST }}/orders/orders" MFE_CONFIG["ECOMMERCE_BASE_URL"] = ECOMMERCE_PUBLIC_URL_ROOT MFE_CONFIG["ORDER_HISTORY_URL"] = ORDER_HISTORY_MICROFRONTEND_URL diff --git a/tutorecommerce/plugin.py b/tutorecommerce/plugin.py index a8d0cedf..6bec0705 100644 --- a/tutorecommerce/plugin.py +++ b/tutorecommerce/plugin.py @@ -31,29 +31,6 @@ "OAUTH2_KEY_SSO": "ecommerce-sso", "OAUTH2_KEY_SSO_DEV": "ecommerce-sso-dev", "WORKER_JWT_ISSUER": "ecommerce-worker", # TODO do we need to keep this? - # Micro frontend applications - "MFE_APP": { - "name": "orders", - "repository": "https://github.com/edx/frontend-app-ecommerce", - "port": 1996, - }, - "PAYMENT_MFE_APP": { - "name": "payment", - "repository": "https://github.com/edx/frontend-app-payment", - "port": 1998, - "env": { - "production": { - # Hardcoded in edx-platform - "CURRENCY_COOKIE_NAME": "edx-price-l10n", - # TODO set customizable value - "CYBERSOURCE_URL": "https://testsecureacceptance.cybersource.com/silent/pay", - "SUPPORT_URL": "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/support", - }, - "development": { - "SUPPORT_URL": "http://{{ LMS_HOST }}:8000/support", - }, - }, - }, }, "unique": { "MYSQL_PASSWORD": "{{ 8|random_string }}", @@ -95,7 +72,7 @@ def _add_ecommerce_mfe_apps( { "orders": { "repository": "https://github.com/edx/frontend-app-ecommerce", - "port": 1996, + "port": 7296, }, "payment": { "repository": "https://github.com/edx/frontend-app-payment", diff --git a/tutorecommerce/templates/ecommerce/apps/ecommerce/settings/development.py b/tutorecommerce/templates/ecommerce/apps/ecommerce/settings/development.py index bf5a0cfa..30542e10 100644 --- a/tutorecommerce/templates/ecommerce/apps/ecommerce/settings/development.py +++ b/tutorecommerce/templates/ecommerce/apps/ecommerce/settings/development.py @@ -2,11 +2,15 @@ {% include "ecommerce/apps/ecommerce/settings/partials/common.py" %} -CORS_ORIGIN_WHITELIST = list(CORS_ORIGIN_WHITELIST) + [ - "http://{{ MFE_HOST }}:{{ ECOMMERCE_MFE_APP['port'] }}", - "http://{{ MFE_HOST }}:{{ ECOMMERCE_PAYMENT_MFE_APP['port'] }}", -] -CSRF_TRUSTED_ORIGINS = ["{{ MFE_HOST }}:{{ ECOMMERCE_MFE_APP['port'] }}"] +CORS_ORIGIN_WHITELIST = list(CORS_ORIGIN_WHITELIST) +{% for app_name, app in iter_mfes() %} +{% if app_name == "orders" %} +CORS_ORIGIN_WHITELIST.append("http://{{ MFE_HOST }}:{{ app['port'] }}") +CSRF_TRUSTED_ORIGINS = ["{{ MFE_HOST }}:{{ app['port'] }}"] +{% elif app_name == "payment" %} +CORS_ORIGIN_WHITELIST.append("http://{{ MFE_HOST }}:{{ app['port'] }}") +{% endif %} +{% endfor %} SOCIAL_AUTH_EDX_OAUTH2_PUBLIC_URL_ROOT = "http://{{ LMS_HOST }}:8000" diff --git a/tutorecommerce/templates/ecommerce/tasks/ecommerce/init b/tutorecommerce/templates/ecommerce/tasks/ecommerce/init index 7de70b11..9219b9a3 100644 --- a/tutorecommerce/templates/ecommerce/tasks/ecommerce/init +++ b/tutorecommerce/templates/ecommerce/tasks/ecommerce/init @@ -1,6 +1,8 @@ ./manage.py migrate --noinput ./manage.py oscar_populate_countries --initial-only +{% for app in iter_mfes() %} +{% if app["name"] == "payment" %} ./manage.py create_or_update_site \ --site-id=1 \ --site-domain={{ ECOMMERCE_HOST }}:8130 \ @@ -19,7 +21,7 @@ --payment-support-url="http://{{ LMS_HOST }}:8000/support" \ --discovery_api_url=http://{{ DISCOVERY_HOST }}:8381/api/v1/ \ --enable-microfrontend-for-basket-page=true \ - --payment-microfrontend-url="http://{{ MFE_HOST }}:{{ ECOMMERCE_PAYMENT_MFE_APP['port'] }}/{{ ECOMMERCE_PAYMENT_MFE_APP['name'] }}" + --payment-microfrontend-url="http://{{ MFE_HOST }}:{{ app['port'] }}/{{ app['name'] }}" # Production site ./manage.py create_or_update_site \ @@ -41,7 +43,9 @@ --payment-support-url="{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/support" \ --discovery_api_url={% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ DISCOVERY_HOST }}/api/v1/ \ --enable-microfrontend-for-basket-page=true \ - --payment-microfrontend-url="{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ MFE_HOST }}/{{ ECOMMERCE_PAYMENT_MFE_APP['name'] }}" + --payment-microfrontend-url="{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ MFE_HOST }}/{{ app['name'] }}" +{% endif %} +{% endfor %} if [ ! -e /openedx/ecommerce/node_modules ] then