Skip to content

Conversation

@andrii-hantkovskyi
Copy link
Contributor

@andrii-hantkovskyi andrii-hantkovskyi commented Jun 3, 2025

Add org_image_url to Course Discovery Index

This PR adds an org_image_url field to the course discovery index to expose the organization's logo alongside course metadata.

Key changes:

  • Adds org_image_url to the course index data via course_organization_image_url(course).
  • Introduces the course_organization_image_url helper, returning the organization's logo or a default placeholder if none is set.
  • Configures DEFAULT_ORG_LOGO_URL in settings as the fallback logo path.
  • Updates course discovery indexing logic to include the new organization image field.

These changes enable clients to display organization branding in course listings, supporting improved visual context and a richer UI experience.

Unit and integration tests should verify correct selection of organization logos and fallback behavior when a logo is missing.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jun 3, 2025
@openedx-webhooks
Copy link

openedx-webhooks commented Jun 3, 2025

Thanks for the pull request, @andrii-hantkovskyi!

This repository is currently maintained by @openedx/wg-maintenance-edx-platform.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Jun 3, 2025
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Jun 3, 2025
@andrii-hantkovskyi andrii-hantkovskyi self-assigned this Jun 11, 2025
@andrii-hantkovskyi andrii-hantkovskyi marked this pull request as ready for review June 11, 2025 17:24
@andrii-hantkovskyi
Copy link
Contributor Author

andrii-hantkovskyi commented Jun 11, 2025

@diana-villalvazo-wgu, whenever you have some time, could you please take a look at this PR?

@andrii-hantkovskyi andrii-hantkovskyi requested review from diana-villalvazo-wgu and removed request for kdmccormick June 11, 2025 17:39
@sarina
Copy link
Contributor

sarina commented Jun 17, 2025

@andrii-hantkovskyi for all PRs related to FC-86, please remember to put "FC-86" in the title of each pull request.

@sarina sarina changed the title feat: add org_image_url to course_discovery index feat: add org_image_url to course_discovery index FC-86 Jun 17, 2025
# .. setting_default: organization_logos/_placeholder.png # FIXME: change to correct placeholder
# .. setting_description: The default logo URL for organizations that do not have a logo set.
# .. setting_warning: This URL is used as a placeholder for organizations that do not have a logo set.
DEFAULT_ORG_LOGO_URL = 'organization_logos/_placeholder.png' # FIXME: change to correct placeholder
Copy link
Contributor

@sarina sarina Jun 17, 2025

Choose a reason for hiding this comment

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

How should this FIXME be addressed? We shouldn't put FIXMEs in the code because it looks like this code is in an incomplete state. Is this placeholder logo being provided by the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the tip about adding that placeholder to the code, added :)

# .. setting_default: organization_logos/_placeholder.png # FIXME: change to correct placeholder
# .. setting_description: The default logo URL for organizations that do not have a logo set.
# .. setting_warning: This URL is used as a placeholder for organizations that do not have a logo set.
DEFAULT_ORG_LOGO_URL = 'organization_logos/_placeholder.png' # FIXME: change to correct placeholder
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a piece of checked in asset that will always be there or will this be a broken link unless the operators do something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After Sarina's comment, I decided to add placeholder.png to this PR so that the link won't be broken

@andrii-hantkovskyi andrii-hantkovskyi changed the title feat: add org_image_url to course_discovery index FC-86 feat: [FC-86] add org_image_url to course_discovery index FC-86 Jun 18, 2025
@andrii-hantkovskyi andrii-hantkovskyi force-pushed the rg/axm-course-catalog-add-org-image-url-indexing branch from e756c1b to 66c03af Compare June 18, 2025 16:07
@sarina
Copy link
Contributor

sarina commented Jun 18, 2025

I would not use the edX logo as a placeholder logo. I believe we already have a placeholder image for a site logo, I'm not sure you need to make a new one. It's two overlapping circles and it's rendered in the header already.

@andrii-hantkovskyi
Copy link
Contributor Author

Removed placeholder, now refers to logo.png

Copy link
Contributor

@feanil feanil left a comment

Choose a reason for hiding this comment

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

Also, should there be a test for this or should the courseware API tests be updated to ensure this data is coming through correctly?

# .. setting_default: 'images/logo.png'
# .. setting_description: The default logo path for organizations that do not have a logo set.
# .. setting_warning: This path is used as a placeholder for organizations that do not have a logo set.
DEFAULT_ORG_LOGO_PATH = 'images/logo.png'
Copy link
Contributor

Choose a reason for hiding this comment

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

Having this only support being a path under the current STATIC_URL is a bit limiting. I think you should instead have the setting be the DEFAULT_ORG_LOGO_URL and accept any valid URLs here. By default it can be something like:

DEFAULT_ORG_LOGO_URL = Derived(lambda settings: settings.STATIC_URL + 'images/logo.png')

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@feanil feanil merged commit 3a3b3fa into openedx:master Jun 23, 2025
49 checks passed
@github-project-automation github-project-automation bot moved this from Waiting on Author to Done in Contributions Jun 23, 2025
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

8 participants