-
Notifications
You must be signed in to change notification settings - Fork 44
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
user can now delete image in topic separately #9008
Conversation
packages/commonwealth/client/scripts/views/modals/edit_topic_modal.tsx
Outdated
Show resolved
Hide resolved
packages/commonwealth/client/scripts/views/modals/edit_topic_modal.tsx
Outdated
Show resolved
Hide resolved
packages/commonwealth/client/scripts/views/modals/edit_topic_modal.tsx
Outdated
Show resolved
Hide resolved
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.
my general thought is that if we give user ability to add description as a rich text (or markdown) editor, then why the description in edit modal is just an inline input? Shouldn't we just put the editor component inside the modal? Your solution is kinda hacky, cause as you said, it works, but only for one image, not two etc. Adding editor to the modal should be straightforward
packages/commonwealth/client/scripts/views/modals/edit_topic_modal.tsx
Outdated
Show resolved
Hide resolved
@masvelio Yeah, I'll try putting in an editor and see how that works. I went with this current solution because a Topic has a character limit of 250, so 2 images felt like an unlikely edge case. But you're 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.
packages/commonwealth/client/scripts/views/modals/edit_topic_modal.tsx
Outdated
Show resolved
Hide resolved
packages/commonwealth/client/scripts/views/components/Comments/CommentEditor/CommentEditor.tsx
Outdated
Show resolved
Hide resolved
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.
Had similar comments as @masvelio and found another issue mentioned above. Otherwise LGTM.
@masvelio @mzparacha I merged master into this branch and for some reason some of these changes got included in this PR. I only changed files relating to the |
I had a look and seems like the linter added some minimal changes, no biggie. |
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.
packages/commonwealth/client/styles/components/react_quill/react_quill_editor.scss
Show resolved
Hide resolved
I followed these steps
|
@mzparacha I am unable to replicate your bug, I have tried many different ways of adding/updating/saving and they all work perfectly for me. |
I tried again and still reproducible for me. Screen.Recording.2024-09-27.at.8.08.12.PM.movcc: @Israellund |
@mzparacha I've tried your exact steps multiple times as well as many different iterations and I still can not replicate your error. I think @masvelio and @burtonator should look at this when they get a chance and see if they see the error. |
@mzparacha Figured out why you were seeing the error with the help of @timolegros. Will you both take a look and let me know if it's working for you? |
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.
Worked for me, Thanks @Israellund
Link to Issue
Closes: #8841
Description of Changes
edit_topic_modal
by clicking the "Remove image" button instead of having to manually delete the markdown.NOTE: This solution solves mostly for 1 image. It works for 2, but the user first has to delete the first image if they also want to delete the second image. Please let me know if you'd like for me to change the code to account for multiple images.
"How We Fixed It"
-added logic to look for
![image](<url>)
in the markdown and to display an image if present. And when "Remove image" is clicked the topic gets updated without the image markdown text.Test Plan
Deployment Plan
Other Considerations