-
Notifications
You must be signed in to change notification settings - Fork 275
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
General
: Add capability to remove course icon
#5691
Conversation
General
: Add capability to remove course icon
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.
Tested on TS1, works! My suggestions:
- Remove the confirmation dialog, as clicking on "cancel" aborts the course editing and the icon is still there. You already need to confirm deleting by clicking on "save".
- Move the button next to the upload form, maybe label it "Remove Icon". In my opinion it can also does not need to be red colored, as it is not a destructive action.
Feel free to wait for feedback from other reviewers before applying these requests.
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.
Looked through the code and left some comments.
I mostly agree with Moritz‘ comments, but I actually like the red color of the button, since you’re still deleting something, even though you have to save the modification afterwards.
cy.get('.no-image').should('exist'); | ||
cy.intercept(PUT, BASE_API + 'courses').as('updateCourseQuery'); | ||
cy.get('#save-entity').click(); | ||
cy.wait('@updateCourseQuery').then((_) => { |
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 think you can also leave out the _ completely when it’s unused
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.
Deleting the course icon works as expected. Tested on ts1
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.
Removing icon worked.
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.
Rechecked thee code changes, looks good to me
Checklist
General
Client
Motivation and Context
#5526
Description
When Delete Icon Button is clicked, the course icon is set to null. When the Save Button is clicked, the Course Update API will be called. The Course Update API will set the course icon to null and delete the previous course icon file.
Steps for Testing
Prerequisites:
Review Progress
Code Review
Manual Tests
Test Coverage
Screenshots
Desktop
![Screen Shot 2022-10-19 at 2 45 12 PM](https://user-images.githubusercontent.com/10885503/196694701-82c7e185-a653-4bec-901c-c37d5fc4762e.png)
Mobile
![Screen Shot 2022-10-19 at 2 45 28 PM](https://user-images.githubusercontent.com/10885503/196694726-005e23f1-aee2-4bb5-ae4b-0abed088afe1.png)