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: recommendation click event #31

Merged
merged 1 commit into from
Aug 9, 2023

Conversation

MaxFrank13
Copy link
Member

When we fire the events for clicking on recommendations, we are passing an array (expandedList) to the extractProductKeys function. This utility function will use that array to determine which LOBs have been expanded in the UI.

When clicking on the "Show All" button, we have to make sure to add on the current product type because the expandedList that is stored in Context will not be updated by the time this event goes to fire.

product_keys: extractProductKeys(recommendations, [...expandedList, type]),

This code was unnecessarily duplicated in the two recommendation click events: edx.skills_builder.recommendaition.expanded.click and edx.skills_builder.recommendaition.click. This led to an error where clicking on a card in an unexpanded list of cards generated a payload with the expanded list instead.

@codecov-commenter
Copy link

Codecov Report

Merging #31 (10c551e) into main (445b365) will not change coverage.
Report is 1 commits behind head on main.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #31   +/-   ##
=======================================
  Coverage   91.59%   91.59%           
=======================================
  Files          30       30           
  Lines         369      369           
  Branches       68       68           
=======================================
  Hits          338      338           
  Misses         30       30           
  Partials        1        1           
Files Changed Coverage Δ
...builder-modal/view-results/RecommendationStack.jsx 90.90% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@MaxFrank13 MaxFrank13 merged commit 1412589 into main Aug 9, 2023
3 checks passed
@MaxFrank13 MaxFrank13 deleted the mfrank/APER-2761-fix-recommendation-click branch August 9, 2023 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants