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

feat: removes sidebar upgrade notification component #1410

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Zacharis278
Copy link
Contributor

@Zacharis278 Zacharis278 commented Jun 20, 2024

Followup to #1368.

These components are specific to edx.org and will be moved to a 2U owned plugin. There are some open questions and I'd like to go back and manually test everything once the 2U plugin is updated to no longer import these. Leaving this in draft state for now.

edx.org has migrated these components to a 2U owned plugin. This code is no longer being used and can be deprecated. While the LockPaywall is also unused we have opted not to remove it as originally intended. See note below

Removed by this PR
  • LockPaywall: Upgrade ad shown in place of graded unit if content gating is enabled No longer included in this PR
  • UpgradeNotification: Sidebar upgrade advertisement
  • UpsellBullets: Only used by Upgrade/Paywall Cannot be removed since we're keeping the LockPaywall
Not Removed by this PR
  • Other instances of the Upgrade Button
Open Questions

Unsure on what to do with the LockPaywall. Should this actually be removed? It puts us in a weird state where 'nothing' would be displayed if content gating is enabled and that plugin slot isn't configured. I'm thinking this should either be reworked so the shouldDisplayContentGating logic moves into the plugin itself or we don't touch LockPaywall at all here.

Decision: We will not be removing the LockPaywall as part of this effort

Copy link

codecov bot commented Jun 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.02%. Comparing base (7efe8f5) to head (397f6a7).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1410      +/-   ##
==========================================
+ Coverage   88.87%   89.02%   +0.15%     
==========================================
  Files         307      306       -1     
  Lines        5285     5168     -117     
  Branches     1344     1280      -64     
==========================================
- Hits         4697     4601      -96     
+ Misses        572      551      -21     
  Partials       16       16              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -34,9 +33,7 @@ const UnitSuspense = ({
pluginProps={{
courseId,
}}
>
<LockPaywall courseId={courseId} />
Copy link
Contributor Author

@Zacharis278 Zacharis278 Jun 21, 2024

Choose a reason for hiding this comment

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

I had this removed originally but after thinking it through my instinct is we actually don't want to touch this. I'll leave it here for now to discuss.

Is content gating edx.org specific or a core feature of Open edX that should have an associated paywall/view in this MFE?

Copy link
Member

Choose a reason for hiding this comment

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

My instinct is that this should remain as it feels like a core feature of Open edX, but I'm guessing you're leaving here to confirm with Axim?

jest.mock('@edx/frontend-platform/analytics');

/* eslint-disable react/prop-types */
jest.mock('@openedx/frontend-plugin-framework', () => ({
Copy link
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 only addition here since there are tests that rely on a close button within the notification that toggle the sidebar. We need a 'mock' notification now since there is no default

@Zacharis278
Copy link
Contributor Author

FYI @arbrandes

Copy link
Member

@varshamenon4 varshamenon4 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! Just added some comments and questions.

} = useModel('courseHomeMeta', courseId);

const {
accessExpiration,
Copy link
Member

Choose a reason for hiding this comment

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

The props removed here are just the ones that are no longer being used by the UpgradeNotification, correct?

@@ -198,21 +187,7 @@ const OutlineTab = ({ intl }) => {
<PluginSlot
id="outline_tab_notifications_slot"
pluginProps={{ courseId }}
>
Copy link
Member

Choose a reason for hiding this comment

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

Nice, so clean!

@@ -81,24 +74,7 @@ const NotificationsWidget = () => {
setNotificationCurrentState: setUpgradeNotificationCurrentState,
toggleSidebar: onToggleSidebar,
}}
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: the notificationCurrentState and setNotificationCurrentState in the PluginSlot pluginProps above can also be removed, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

these are still needed since pluggable notification components use this as a callback to open or close the sidebar

@@ -34,9 +33,7 @@ const UnitSuspense = ({
pluginProps={{
courseId,
}}
>
<LockPaywall courseId={courseId} />
Copy link
Member

Choose a reason for hiding this comment

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

My instinct is that this should remain as it feels like a core feature of Open edX, but I'm guessing you're leaving here to confirm with Axim?

@Zacharis278 Zacharis278 changed the title feat: removes sidebar upgrade and fbe paywall feat: removes sidebar upgrade notification component Jun 28, 2024
@Zacharis278 Zacharis278 marked this pull request as ready for review July 29, 2024 15:43
@Zacharis278
Copy link
Contributor Author

@arbrandes as requested this is a follow up to remove unused code as part of openedx/platform-roadmap#332.

I'll leave timing of merging this up to Axim since this has already been removed from edx.org

@Zacharis278
Copy link
Contributor Author

@arbrandes is there still desire to have this removed as part of the 2U work? I'm clearing out this project on our end and this is the only open task.

@bradenmacdonald
Copy link
Contributor

@Zacharis278 @arbrandes I would like to get this merged. Is there anything blocking merging it? An open question about LockPaywall ?

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