-
Notifications
You must be signed in to change notification settings - Fork 437
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
Instantly display the 'You reported the X' message #15299
Conversation
Review app will appear here: http://obs-reviewlab.opensuse.org/dmarcoux-report-ux |
There is one case missing: reporting a comment on a Request (redesigned page) requires a refresh to see the yellow text about the report inside the bubble. Compare these two comment bubbles. This is what I did:
|
Oh right, I forgot that. The comments are different there... I'll have a look. |
function showYouReportedMessage(reportLinkId, reportableType, reportableId, message) { | ||
switch(reportableType) { | ||
case 'Comment': | ||
// Comments differ depending on where they are, so this is why we have two ways. If an element isn't found, nothing will happen... |
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 won't say this is great. As I wrote in the PR description, given how the comments are rendered, I decided to do it this way.
@dmarcoux could you please get rid of the white background behind the flag icon? (in the yellow text). It seems it's somehow inherited but not needed in the places where the text is displayed. |
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 leave my approval. Only missing the change of the background color.
A page refresh isn't needed anymore for the message to appear. For comments, the implementation isn't really robust, but considering how the comments are rendered, this is what we can do without refactoring a lot of code. In the best scenario, rendering a comment would be as simple as rendering a single view component. It would then be unneccessary to fiddle much with JavaScript, re-rendering the comment view component would be the solution. As for projects and packages, it's not possible to re-render the side_links partials since they depend upon so many objects and we don't have those in webui/reports_controller.
A page refresh isn't needed anymore for the message to appear.
For comments, the implementation isn't really robust, but considering how the comments are rendered, this is what we can do without refactoring a lot of code. In the best scenario, rendering a comment would be as simple as rendering a view component. It would then be unneccessary to fiddle much with JavaScript, re-rendering the comment view component would be the solution.
As for projects and packages, it's not possible to re-render the side_links partials since they depend upon so many objects and we don't have those in webui/reports_controller.