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

fix non-credit filter #1301

Merged
merged 1 commit into from
Jan 25, 2024
Merged

fix non-credit filter #1301

merged 1 commit into from
Jan 25, 2024

Conversation

abeglova
Copy link
Contributor

What are the relevant tickets?

None.

Selecting 'Non-Credit' at https://ocw.mit.edu/search/ does not work. This fixes the issue

Description (What does it do?)

We have parameter validation for the ocw search. Unfortunately, the parameter validation needs to be updated when we update the results from the api.

How can this be tested?

Set
SEARCH_API_URL=https://open.mit.edu/api/v0/search/
Run yarn start www
Turn CORS off in your browser
Go to http://localhost:3000/search/

Verify that you can select non-credit

Additional Context

Needing to manually update the possible parameters every time they change isn't great.

Once ocw is migrated to the new search api and mitodl/mit-learn#269 is implemented we can get the possible parameters from the client that will be created by mitodl/mit-learn#269

@github-actions github-actions bot temporarily deployed to pull request January 25, 2024 20:59 Inactive
@github-actions github-actions bot temporarily deployed to pull request January 25, 2024 20:59 Inactive
Copy link

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

@gumaerc gumaerc self-assigned this Jan 25, 2024
Copy link
Collaborator

@gumaerc gumaerc left a comment

Choose a reason for hiding this comment

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

👍 LGTM

Although, it's worth noting that I had to set some other env variables locally to get this to work. STATIC_API_BASE_URL, RESOURCE_BASE_URL and SITEMAP_DOMAIN need to be set to prod (https://ocw.mit.edu) if you are hitting prod search. Without this, the page would simply refresh upon selecting Non-Credit and the facet would not be selected. I'm not sure which of the vars made the difference, likely either STATIC_API_BASE_URL or RESOURCE_BASE_URL.

@abeglova abeglova merged commit ec0db8e into main Jan 25, 2024
6 checks passed
This was referenced Jan 25, 2024
@ibrahimjaved12
Copy link
Contributor

Thanks for fixing this! @abeglova
I had changed Non Credit to Non-Credit in ocw-hugo-projects, but I wasn't aware that there was a coupling of this in ocw-hugo-themes.

@odlbot odlbot mentioned this pull request Jan 29, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants