-
Notifications
You must be signed in to change notification settings - Fork 174
feat: Adds notification tray slot #638
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: Adds notification tray slot #638
Conversation
|
Thanks for the pull request, @farhaanbukhsh! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
arbrandes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this might still be a draft. There are a couple of CI failures, and there's no documentation for the slot.
src/desktop-header/DesktopHeader.jsx
Outdated
| <div className={`container-fluid ${logoClasses}`}> | ||
| <div className="nav-container position-relative d-flex align-items-center"> | ||
| <LogoSlot {...logoProps} /> | ||
| {/* <LogoSlot {...logoProps} /> */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not actually removing the LogoSlot, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just testing few things
Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com>
5de8cd5 to
87faedc
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #638 +/- ##
==========================================
+ Coverage 73.01% 73.59% +0.57%
==========================================
Files 55 56 +1
Lines 504 515 +11
Branches 100 100
==========================================
+ Hits 368 379 +11
Misses 133 133
Partials 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@xitij2000 @arbrandes, you both can review this while I update testing instructions for it. |
|
@farhaanbukhsh My concern here is that this slot is just not needed. I don't think it's adding anything. If notifications were a core feature, wrapping it in a slot would make sense since you could then override a platform feature, however it's part of a plugin, so you can simply not install it. Any component that needs to be added can simply be added to the LearningHelpSlot and it will end up in exactly the same space. So here is my suggestion, if we have to add this slot, we should not call this the Additionally, the slot for mobile and studio should have a different name. |
Thanks a lot for the comment @xitij2000 , FWIW, the discussion is to make notifications a core plugin and going forward, it would have an even more permanent addition to the platform in terms of thinking, product proposal or code. We have had a discussion about the slots, and since the notification tray was implemented as a plugin slot widget, this is the path of least resistance to integrate with the platform; hence, we are keeping the slot in. Hope it is clearer to you now. :) |
|
@farhaanbukhsh Adding a plugin slot for it is okay; however, it shouldn't be called Maybe there can be some conventions around this, but from what I see a slot should either be about after the component its wrapping, or its location on the page. |
If you see this slot it is being added with an intention to be used @xitij2000 so I feel for now it's okay to go with NotificationTraySlot and if we get use it in a more generic sense then we can rename it later. Hence, I think have a specific name makes more sense, what do you think? |
I don't feel intention is a good reason. Because then you can end up with a dozen slots in the same place by different people because they all want different features in the same place, whereas they could all put what they want in the same slot. Also because the whole point of slots is that they allow control over the UI. So someone might want to put the notification icon in a different place, which is the benefit that slots provide. Additionally, as I mentioned above, you should create separate slots for mobile, studio, learner, etc., instead of using the same slot in each place. CC: @bradenmacdonald Could you give your input here as well? The TLDR is, the we're adding a new slot called |
|
@xitij2000, now that I think about it, it does make more sense to rename the plugin so that we have a clear distinction and generic names of slots. Let me rename them, and then you can have a look. Thank you for your patience. |
| const NotificationTraySlot = () => ( | ||
| <PluginSlot | ||
| id="org.openedx.frontend.layout.notification_tray.v1" | ||
| idAliases={['notification_tray_plugin']} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed for a new slot.
|
@arbrandes @xitij2000 you can have a look at #644 and please provide your review on it. |
|
closing this in favour of #644 |
This PR is turned obsolete with #644, we have kept this PR up for sandbox provisioning and will close this soon
Addition of the NotificationTray slot, this slot is used to add a notification tray to the learner dashboard, studio, and learning MFE. This in turn helps to add the same slot to other MFEs as well since all of them use the same header.
Private Refs:
https://tasks.opencraft.com/browse/BB-10062
https://tasks.opencraft.com/browse/BB-10060
Discussions: Link to any public dicussions about this PR or the design/architecture. Otherwise omit this.
Dependencies: None
Screenshots:
Sandbox URL: TBD - sandbox is being provisioned.Merge deadline: "None" if there's no rush, "ASAP" if it's critical, or provide a specific date if there is one.Testing instructions:
npm ci && npm run buildtutor dev stop learner-dashboardtutor mount listsif is is not mounted you can addtutor mounts add /path_to/edx-devstack/frontend-app-learner-dashboardand build the imagetutor images build openedx-devcp -r /path_to/edx-devstack/frontend-component-header/dist /path_to/edx-devstack/frontend-app-learner-dashboard/node_modules/@edx/frontend-component-header. This copies the built codebase to the frontend-component-headernpm i @edx/frontend-plugin-notificationsnpm run dev, after this if we see learner dashboard we should see notification icon button.