Skip to content

feat: Remove upsell banner on course home - #499

Merged
bmedx merged 1 commit into
masterfrom
bmedx/remove_upsell_banner_3
Jun 24, 2021
Merged

feat: Remove upsell banner on course home#499
bmedx merged 1 commit into
masterfrom
bmedx/remove_upsell_banner_3

Conversation

@bmedx

@bmedx bmedx commented Jun 22, 2021

Copy link
Copy Markdown
Contributor

REV-2233: The upsell banner now duplicates the sidebar banner. Removing it in favor of the new implementation on course home, but keeping the masquerade message that shows instructors when a learner lost access to the course.

REV-2233: The upsell banner now duplicates the sidebar banner. Removing it in favor of the new implementation on course home, but keeping the masquerade message that shows instructors when a learner lost access to the course.
userTimezone,
} = payload;

if (!accessExpiration) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removing this check and the masqueradingExpiredCourse check below were what caused the production issue.

@codecov

codecov Bot commented Jun 22, 2021

Copy link
Copy Markdown

Codecov Report

Merging #499 (c39f995) into master (0c55863) will increase coverage by 0.01%.
The diff coverage is 94.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #499      +/-   ##
==========================================
+ Coverage   84.59%   84.61%   +0.01%     
==========================================
  Files         213      214       +1     
  Lines        3610     3627      +17     
  Branches      869      872       +3     
==========================================
+ Hits         3054     3069      +15     
- Misses        539      541       +2     
  Partials       17       17              
Impacted Files Coverage Δ
.../access-expiration-alert/AccessExpirationAlert.jsx 77.27% <ø> (-4.55%) ⬇️
...piration-alert/AccessExpirationAlertMasquerade.jsx 90.00% <90.00%> (ø)
src/alerts/access-expiration-alert/hooks.js 100.00% <100.00%> (ø)
src/course-home/outline-tab/OutlineTab.jsx 84.31% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0c55863...c39f995. Read the comment docs.

});
await fetchAndRender();
await screen.findByText('This learner does not have access to this course.', { exact: false });
const check = await screen.queryByText('This learner does not have access to this course.', { exact: false });

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I changed this test to mirror the one below to make sure they are actually both working.

});

it('shows expiration', async () => {
it('does not have special masquerade text', async () => {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the new test to make sure the masquerade banner doesn't show up if we're not masquerading.

if (!masqueradingExpiredCourse) {
return null;
}

@dianekaplan dianekaplan Jun 23, 2021

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not a comment on the code, but on the cause of the prod issue: I'm confused why not including that last bit (return null if not masqueradingExpiredCourse) made the bug. I think we only include this component if (masqueradingExpiredCourse). How can we have if masqueradingExpiredCourse and also !masqueradingExpiredCourse?

Answer from Brian's slack (all clear now): There are two paths to display the masquerade “user lost access” banner:
1- Via the AccessExpirationAlert on non-course home pages
2- Via the hook on the course home page
This bit above worked for #1 since AccessExpirationAlert already performs that check. The hook on #2 didn’t perform that check (but does perform a different check for accessExpiration). So the course home case showed the banner.

}

export function useAccessExpirationAlertMasquerade(accessExpiration, userTimezone, topic) {
const isVisible = !!accessExpiration; // If it exists, show it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for the comment here- I had to look up "!!"

@bmedx
bmedx merged commit 554e63d into master Jun 24, 2021
@bmedx
bmedx deleted the bmedx/remove_upsell_banner_3 branch June 24, 2021 16:46
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.

2 participants