-
Notifications
You must be signed in to change notification settings - Fork 0
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
Prevent Users from drag/drop and copy/paste images into the text editor #1270
Comments
Caitlin needs to discuss this change with customer. |
@AbhishekPAnil can users add (embed) video content to descriptions? Or is that not allowed as well? |
Need to test if they can embedd videos to description. |
Yes we do already have a field for that. I am asking just to know what the text field currently supports. Not suggesting people should add video to descriptions. :) |
I was able to embed in this test event (draft), but I don't know what the impact is or if it works. |
A mitigation possibility: Is there a way to set up a MB limit, to accommodate any combination of number of files / filesize? ChatGPT Here's an example of how you can implement this in a React component: Example React Component with Total File Size Limit
Explanation files: An array that holds the dropped files. Prevents the default behavior to allow the drop event. Prevent Default Behavior: Prevents the default drop action. The drop zone is defined with onDragOver and onDrop event handlers. |
NOTE: These are the only upcoming events that I found with images embedded into descriptions, in both French and English pages. https://cms.footlight.io/dashboard/6308ef4a7f771f00431d939a/events/66acd44fd09b4d00634bd9d4 https://cms.footlight.io/dashboard/6308ef4a7f771f00431d939a/events/66acd9ecd09b4d00634bdcf4 |
Note to @AbhishekPAnil: For now, do not stop users from embedding video from youtube into the text field. Please check what happens if you drag/copy-paste video into the description - if it's a link, it's okay; if its huge, that doesn't work |
cc @AbhishekPAnil
|
The only issue faced now is ,while uploading the image from the local system into the editor,the image is saved in the form of an image tag with a base64 src data |
This will be solved by uploading the image to the s3 and then using the url from the api response to update the src inside the image tag. |
@AbhishekPAnil |
For my test: To check the image data, I will inspect the image in the read-only page. Otherwise, I can check with Abhishek |
1. Image tests:https://staging.cms.footlight.io/dashboard/6308ef4a7f771f00431d939a/events/66ba19674be0ab00a039defa Please check these three events. https://pr-1275.dla06mbe0wyl7.amplifyapp.com/dashboard/6308ef4a7f771f00431d939a/events?page=1&order=asc&sortBy=upcomingEventDate&query=caitlin In test event 3, some of the images also look like they are base64. Even ones that I uploaded from my desktop using the upload button. Test 2 seems okay, but please check 2. Video link test:I can add the video link but the link is not completely visible: 3. When I publish, too many popupsI get to success messages instead of one. You can reproduce it by saving any of my test events as draft and then republish. |
Let me check with the images .The images shouldn't be in base64. The video link layout issue exists since our editor is only manually expandable. |
cc @AbhishekPAnil Will solve this bug in this issue. |
@AbhishekPAnil let's hold off on implementing this feature (i.e. adding buttons for images and video). Furthermore, we will not add the video option at all (remove that button completely). Main point: this is on hold so I will unassign you and assign myself. After discussing this with @saumier and I want to go back to the customer at Tout Culture to see if they can use our existing solution (image gallery). If they really want to keepimages in the descriptions, then we may implement this as a special feature that would only be available for Tout Culture (it would not be available in any other CMS for any other customer). I will let you know the final decision. |
Note that we will definitely be removing the ability to drag/drop or copy/paste images into descriptions. Stay tuned! |
We may have to treat this as a separate issue. |
I have updated the PR with the above changes. |
Here is the new design for image gallery https://www.figma.com/design/DBnSSMT9Etfm6guDKKSp8O/Culture-Creates---Footlight-Calendar?node-id=9647-90907&t=ESgAxxnpWTxhlWcJ-1 |
Hi @AbhishekPAnil I tested copy/paste and drag and drop of images into the description. This works, as in, nothing is getting added to the description. PASSED |
@sahalali @AbhishekPAnil this is now approved to be deployed to PRODUCTION. thanks! |
This is deployed in production |
Currently, users can copy/paste and drag/drop images directly into the text editor. This behavior can lead to slowing down of the listing api's , since the images are not passed through our image server. To maintain a consistent user experience and prevent potential problems, we need to disable the ability to copy/paste and drag/drop images into the text editor.
Ref slack message : https://culturecreates.slack.com/archives/C02B18SN3FU/p1722702723875049
Expected Behavior
Steps to Reproduce
Proposed Solution
quill format
.onDrop
function.Also ,ensure that other types of content (e.g., text, links) can still be copied/pasted and dragged/dropped into the text editor.
The text was updated successfully, but these errors were encountered: