Another promising looking project I found is GitHub - openedx/frontend-app-learner-portal-enterprise: Enterprise Learner Portal. After setting up CORS via plugins, modifying .env.development accordingly, ensuring ENABLE_ENTERPRISE_INTEGRATIONS is on and running ./manage.py lms seed_enterprise_devstack_data in the lms container i do not get a log in page as stated in the README - instead i am being redirected to the learner dashboard immediately. The README mentions edx-enterprise, the old devstack and the lms container script partially failed cause it can’t find the catalog microservice - which once again is soon to be deprecated?
I am also aware that some Enterprise functionality is baked in by default into the Open edX image in the newer verisons. Via the Django admin panel I am able to successfully create an Enterprise Customer and an Enterprise Catalog Query however when I try to create an Enterprise Customer Catalog (based on the two previously mentioned) with courses linked to that customer i get an error:
AttributeError at /admin/enterprise/enterprisecustomercatalog/add/
‘NoneType’ object has no attribute ‘username"‘
I am a bit confused - to me it seems like as if the Enterprise functionality is only partially available in the newer tutor versions of open edx and still not whole without some of the old devstack services somehow integrated with the tutor deployment.
If anyone’s been through a similar issue I would be very thankful for any tips on how to tackle this problem or help in achieving my goal (I’ve also considered Django signals yet I leave that as a last resort).
If you are interested, you can watch that PR for updates.
However, I would really recommend finding an alternate solution that doesn’t involve the enterprise stack if possible. As you have noted, multiple services are somewhere in the deprecation path and they are at the moment built primarily for the needs of edx.org and can be best described as “source available”.
Similarly, you can modify the behaviour of the learner dashboard using the plugin slots in the MFE. For example, you can write a wrap plugin for the Course List Slot of the learner dashboard that filters the courses visible to the learner based on the data from any source.
Hey @arunmozhi, thanks for the answer and leading me towards the right direction. I have managed to add the wanted functionality by doing the following (assuming courses are created with the proper organization assigned):
Case A: User Logs In
Using a filter org.openedx.learning.student.login.requested.v1 I run a pipeline that extracts the company’s slug from the user’s email field.
Grab all courses from the DB and filter out the ones that don’t match the user’s organization.
If user not yet enrolled in any of the courses from the filtered list then enroll the user (that’s signing up handled, now for the showing part)
Using another filter org.openedx.learning.home.enrollment.api.rendered.v1 I “stamp” all the courses by modifying the (hijacked) field ‘mode’ of the course to some_specific_value
Then in the learner-dashboard MFE I modified the CourseCard component (just a guard clause - 1 if statement) to now show the course only if it’s ‘mode’ field is set to that some_specific_value.
I really thought about using the plugin slot you recommended here however it implies using own components and I am fine with the existing one. If I wanted to use the plugin I’d therefore have to re-implement/flatten the entire CourseCard logic into the plugin config to keep the original look and feel. Modifying it directly felt like a pragmatic choice at this point.
—
Unfortunately the log in filter is not called upon registration and the existing filter for registration org.openedx.learning.student.registration.requested.v1 happens before the user is saved to the database which makes it imposible to use it to register a user to a course.
I had Case B: User Registers solved by creating a basic post_save signal that goes by the same logic. Both cases need to be handled since automatic registration would be required if a new course is rolled out to existing customers.
I am happy my comments were helpful and you have the functionality you wanted.
In both of these scenarios, if you think there adding an extension point the MFE and the platform would be helpful, I would highly recommend contributing them upstream. It could reduce the code-drift maintenance burden for you in the future upgrades and make it available for others who wish to customize their user flows.