eduNEXT / eox-tenant

Plugin for managing multiple tenants (organizations) within a single Open edX instance.
GNU Affero General Public License v3.0
7 stars 4 forks source link

feat: adds FilterTenantAwareLinksFromStudio in filters pipeline #219

Open jignaciopm opened 1 month ago

jignaciopm commented 1 month ago

Description

This PR adds a custom filter pipeline to get LMS_ROOT_URL value for org from tenant site.

The idea is including some changes in openedx-filters and edx-platform repositories to anyone implement the filter function, and one clear example to use is this custom pipeline on eox-tenant plugin.

Dependencies:

  1. Install the plugin with the changes in openedx/edx-platform and openedx/openedx-filters branches. Use the Tutor instructions to install the eox-tenant django plugin with the changes in this branch.

  2. Create a Tenant and import a certificate course (You need to create a tenant for Studio too). Go on to create sites: http://local.edly.io:8000/admin/eox_tenant/tenantconfig/

  3. Add the following configurations to your configuration site and Studio tenant.

    "OPEN_EDX_FILTERS_CONFIG": {
                "org.openedx.learning.course_about.page.url.requested.v1": {
                    "fail_silently": false,
                    "pipeline": [
                        "eox_tenant.filters.pipeline.OrgAwareCourseAboutPageURL"
                    ]
                },
                "org.openedx.course_authoring.lms.page.url.requested.v1": {
                    "fail_silently": false,
                    "pipeline": [
                        "eox_tenant.filters.pipeline.OrgAwareLMSURLStudio"
                    ]
                }
            }

    or too you can add settings in /env/apps/openedx/settings/cms/development.py

  4. Go to Settings-> Schedule & Details, click on the “Course Summary Page” link, which should direct you to the URL of the specific tenant Captura de pantalla de 2024-10-01 23-39-30

  5. Verify that the link of the "Invite your students" button in the body refers to the URL of the specific tenant

  6. Also check for a link to a course summary below the “course overview” text box. Captura de pantalla de 2024-10-01 23-40-55

  7. Go to Content -> Files & uploads, verify the absolute links of any asset (In the Web button), which should lead to the URL of the specific tenant

Example Tenant Config

{
    "EDNX_USE_SIGNAL": true,
    "LMS_BASE": "tenant-a.local.edly.io:8000",
    "LMS_ROOT_URL": "tenant-a.local.edly.io:8000",
    "PLATFORM_NAME": "TEST-THEMING",
    "SITE_NAME": "tenant-a.local.edly.io",
    "THEME_OPTIONS": {
        "scripts": {
            "/login": [
                {
                    "content": "alert('This is a test for the inline script');",
                    "type": "inline"
                }
            ]
        },
        "theme": {
            "grandparent": "test-3",
            "name": "test-1",
            "parent": "test-2"
        }
    },
    "course_org_filter": [
        "DEMO"
    ]
}

Additional information

Checklist for Merge

mariajgrimaldi commented 1 month ago

Please, review these changes related to my last comment here: https://github.com/eduNEXT/eox-tenant/commit/08b320f65f183bbbd4fcd06d011c5ce60be91f2c

jignaciopm commented 1 month ago

@mariajgrimaldi about your comment https://github.com/eduNEXT/eox-tenant/pull/219#issuecomment-2391793411 Don't you think the name should be FilterOrgAwareLMSURLStudio instead of just OrgAwareLMSURLStudio? :thinking: