Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds FilterTenantAwareLinksFromStudio in filters pipeline #219

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jignaciopm
Copy link
Contributor

@jignaciopm jignaciopm commented Oct 1, 2024

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:

Testing instructions

  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

  1. 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

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

  3. 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

  4. 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

  • Tested in a remote environment
  • Updated documentation
  • Rebased master/main
  • Squashed commits

@mariajgrimaldi
Copy link
Collaborator

Please, review these changes related to my last comment here: 08b320f

@github-actions github-actions bot added size/m and removed size/s labels Oct 3, 2024
@jignaciopm jignaciopm force-pushed the jipm/add_tenant_aware_filter branch 2 times, most recently from 7963cbf to 2f04adb Compare October 3, 2024 22:52
@jignaciopm
Copy link
Contributor Author

@mariajgrimaldi about your comment #219 (comment) Don't you think the name should be FilterOrgAwareLMSURLStudio instead of just OrgAwareLMSURLStudio? 🤔

eox_tenant/filters/README.rst Outdated Show resolved Hide resolved
eox_tenant/filters/pipeline.py Outdated Show resolved Hide resolved
eox_tenant/filters/test/test_pipeline.py Outdated Show resolved Hide resolved
eox_tenant/filters/test/test_pipeline.py Outdated Show resolved Hide resolved
mariajgrimaldi
mariajgrimaldi previously approved these changes Oct 9, 2024
Copy link
Collaborator

@mariajgrimaldi mariajgrimaldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good enough, thank you. Please, remember to add a new entry to the changelog.

eox_tenant/filters/pipeline.py Show resolved Hide resolved
eox_tenant/filters/pipeline.py Show resolved Hide resolved
eox_tenant/filters/test/test_pipeline.py Outdated Show resolved Hide resolved
@mariajgrimaldi mariajgrimaldi self-requested a review October 9, 2024 11:28
Copy link
Collaborator

@mariajgrimaldi mariajgrimaldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll approve once tests pass. Thank you.

Copy link
Collaborator

@mariajgrimaldi mariajgrimaldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! @jignaciopm, remember to update the requirements so the latest openedx-filters version is used during tests (although new definitions are not used, I think it's still important to do so). Let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants