Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
Overhang.IO committed Dec 8, 2023
2 parents c867b48 + 434dfd7 commit bd82a18
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 50 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,12 @@ instructions, because git commits are used to generate release notes:
-->

<!-- scriv-insert-here -->

<a id='changelog-16.0.1'></a>
## 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)
1 change: 0 additions & 1 deletion changelog.d/20230320_152027_regis_changelog.md

This file was deleted.

12 changes: 0 additions & 12 deletions changelog.d/20230519_161836_regis.md

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/20230919_104436_regis_auto_mount.md

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/20231118_174413_codewithemad.md

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/20231123_114642_ivo.branco.md

This file was deleted.

2 changes: 1 addition & 1 deletion tutorecommerce/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "16.0.0"
__version__ = "16.0.1"
6 changes: 5 additions & 1 deletion tutorecommerce/patches/openedx-lms-development-settings
Original file line number Diff line number Diff line change
@@ -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 %}
2 changes: 1 addition & 1 deletion tutorecommerce/patches/openedx-lms-production-settings
Original file line number Diff line number Diff line change
@@ -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
25 changes: 1 addition & 24 deletions tutorecommerce/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}",
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
8 changes: 6 additions & 2 deletions tutorecommerce/templates/ecommerce/tasks/ecommerce/init
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -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 \
Expand All @@ -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
Expand Down

0 comments on commit bd82a18

Please sign in to comment.