-
Notifications
You must be signed in to change notification settings - Fork 80
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: delete collection [FC-0062] #1333
Conversation
Thanks for the pull request, @navinkarkera! What's next?Please work through the following steps to get your changes 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. 🔘 Let us know that your PR is ready for review:Who will review my changes?This repository is currently maintained by Where 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. |
2ebdce8
to
9f9e537
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1333 +/- ##
=======================================
Coverage 93.00% 93.01%
=======================================
Files 1035 1035
Lines 19570 19630 +60
Branches 4157 4100 -57
=======================================
+ Hits 18201 18258 +57
- Misses 1304 1310 +6
+ Partials 65 62 -3 ☔ View full report in Codecov by Sentry. |
dabeaa8
to
5088ef4
Compare
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.
@navinkarkera I agree with your a11y concerns here, and proposed a way to address them. If you don't agree, I think it's worth asking Product for advice here.
import { Settings as IconSettings } from '@openedx/paragon/icons'; | ||
import { capitalize } from 'lodash'; | ||
|
||
const ProcessingNotification = ({ isShow, title }) => ( | ||
const ProcessingNotification = ({ isShow, title, action }) => ( |
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.
Concerns: Adding the undo button in a toast doesn't seem the best option in terms of accessibility.
I was going to reply to this to say that we rely on Paragon components to do the right thing re accessibility, but I see that this ProcessingNotification
isn't actually using Paragon's Toast
component!
So ya, this is a valid accessibility concern. Do you have time to convert this component to a proper Toast ?
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.
Do you have time to convert this component to a proper Toast ?
@pomegranited Took some time but it is done now.
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.
Please make the UX team aware of us. They originally asked us not to use Toast, because they wanted the same sort of animated notifications on the right-hand side of the screen that are used in the course experience. I do prefer the consistency of using Toast everywhere though.
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.
@bradenmacdonald We can move the Toast popup to the bottom-right (for dir=ltr) and make sure it's positioned over the sidebar? Then we get the benefits of the Toast component and UX get their positioning.
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.
@pomegranited Sounds good to me, please just confirm with @sdaitzman @jmakowski1123 . I'm not sure why we didn't do that before but I think the Paragon toasts can't be moved?
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.
@bradenmacdonald Huh, really? I don't see why not, but I don't have context on this discussion either. Will see what @navinkarkera can do.
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.
@pomegranited See #1211 and this comment. As long as you can satisfy those concerns, please definitely convert this to a standard toast :)
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.
@bradenmacdonald @pomegranited Done. Moved standard toast over to right side and it has same animation as before and it automatically goes away after few seconds.
Also, if no onClose handler is passed (which is the case in course outline and units), the close icon is hidden at which point it looks same (a bit wider but that can be changed if require) as before.
Before:
After
@sdaitzman @jmakowski1123 Let me know if this looks good or if you want us to make some changes.
<Button | ||
variant="primary" | ||
onClick={action.onClick} | ||
>{action.label} | ||
</Button> |
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.
The toast action button color looks too low contrast against the toast background:
I think if we can use a proper Toast
component, this issue takes care of itself, e.g.
expect(openMenuItem).toHaveAttribute('href', '/library/lb:org1:Demo_Course/collection/collection-display-name/'); | ||
}); | ||
|
||
it('should show confirmation box, delete collection and show toast to undo deletion', async () => { |
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.
Thank you for testing this feature so thoroughly!
dbd4c1e
to
fe44d65
Compare
@pomegranited Thanks for the review! I have now converted |
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.
👍 Works perfectly @navinkarkera !
- I tested this on my tutor dev stack
- I read through the code and tests
- I checked for accessibility issues by using my keyboard to navigate
- Includes documentation
- User-facing strings are extracted for translation
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.
@navinkarkera I added some small comments. Also, you need to fix conflicts
5436424
to
316166b
Compare
Description
Adds delete option to collection card menu. It displays a confirmation box before deleting and a toast with button to undo delete action for 10 seconds.
Supporting information
Private-ref
: FAL-3851Testing instructions
Concerns
Adding the undo button in a toast doesn't seem the best option in terms of accessibility.