Skip to content

Set card link on org dashboard pages to courseware url #2239

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

Merged
merged 2 commits into from
May 12, 2025

Conversation

gumaerc
Copy link
Contributor

@gumaerc gumaerc commented May 8, 2025

What are the relevant tickets?

Closes https://github.com/mitodl/hq/issues/7255

Description (What does it do?)

This PR alters DashboardCard to allow optionally specifying a URL for either the title or button. On organization dashboard pages, the title link is set to the same courseware URL that the button is set to, as requested in the above issue.

How can this be tested?

  • Ensure that you have a Posthog project configured and have run the basic setup for mit-learn
  • Enable both the enrollment-dashboard and mitlearn-organization-dashboard feature flags
  • Visit the dashboard at http://open.odl.local:8062/dashboard (or wherever your site is hosted), logging in if necessary
  • The "My Learning" dashboard should be unchanged by this PR
  • Click either "Organization X" or Organization Y" to open the UAI dashboard
  • Ensure that the title link points to the courseware URL, the same as the button

@gumaerc gumaerc added the Needs Review An open Pull Request that is ready for review label May 8, 2025
Copy link

github-actions bot commented May 8, 2025

OpenAPI Changes

Show/hide No detectable change.

Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

@@ -153,6 +153,8 @@ const OrgProgramDisplay: React.FC<{
dashboardResource={course}
courseNoun="Module"
offerUpgrade={false}
titleHref={course.run.coursewareUrl}
Copy link
Contributor

Choose a reason for hiding this comment

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

Though it's assumed the course from the API will always have a run and while we're typing locally in anticipation of the programs list API, could we add an optional chaining guard here just in case, ie. course.run?.coursewareUrl.

Copy link
Contributor

@jonkafton jonkafton left a comment

Choose a reason for hiding this comment

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

Looks good - left a comment/request.

@gumaerc gumaerc force-pushed the cg/org-page-courseware-url-title-and-button branch from 5b3f8a0 to 2d3ea59 Compare May 9, 2025 19:15
@gumaerc gumaerc merged commit 4737375 into main May 12, 2025
13 checks passed
@gumaerc gumaerc deleted the cg/org-page-courseware-url-title-and-button branch May 12, 2025 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review An open Pull Request that is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants