Skip to content
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

Handle the case where the pasted data is not an image #7628

Merged
merged 3 commits into from
Apr 4, 2024

Conversation

shefalijoshi
Copy link
Contributor

@shefalijoshi shefalijoshi commented Mar 20, 2024

Closes VIPEROMCT-474

Describe your changes:

When pasting text (or text and image together), the paste event handler was adding the image to the entry and saving the entry. The textarea blur event handler never got a chance to get triggered, so the entry's text update would get ignored.

Now, when there is any pasting in the text area, we're ensuring that both images and text are updated appropriately.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Is this a notable change that will require a special callout in the release notes? For example, will this break compatibility with existing APIs or projects that consume these plugins?

Author Checklist

  • Changes address original issue?
  • Tests included and/or updated with changes?
  • Has this been smoke tested?
  • Have you associated this PR with a type: label? Note: this is not necessarily the same as the original issue.
  • Have you associated a milestone with this PR? Note: leave blank if unsure.
  • Testing instructions included in associated issue OR is this a dependency/testcase change?

Reviewer Checklist

  • Changes appear to address issue?
  • Reviewer has tested changes by following the provided instructions?
  • Changes appear not to be breaking changes?
  • Appropriate automated tests included?
  • Code style and in-line documentation are appropriate?

@shefalijoshi shefalijoshi requested a review from akhenry March 20, 2024 17:17
@shefalijoshi shefalijoshi requested a review from jvigliotta March 20, 2024 19:56
@shefalijoshi shefalijoshi added this to the Target:4.0.0 milestone Mar 20, 2024
@@ -384,7 +384,7 @@ export default {

this.manageEmbedLayout();
},
async addImageFromPaste(event) {
async addImageOrTextFromPaste(event) {
const clipboardItems = Array.from(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check for empty clippboard item?

@akhenry
Copy link
Contributor

akhenry commented Mar 27, 2024

@shefalijoshi e2e test please

@akhenry akhenry added the pr:e2e:couchdb npm run test:e2e:couchdb label Apr 4, 2024
@akhenry akhenry modified the milestones: Target:4.0.1, Target:4.0.0 Apr 4, 2024
@akhenry akhenry enabled auto-merge (squash) April 4, 2024 20:58
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Apr 4, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 55.93%. Comparing base (e3adeb6) to head (c91ee23).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7628      +/-   ##
==========================================
- Coverage   56.33%   55.93%   -0.41%     
==========================================
  Files         672      672              
  Lines       27124    27124              
  Branches     2632     2632              
==========================================
- Hits        15281    15171     -110     
- Misses      11515    11624     +109     
- Partials      328      329       +1     
Flag Coverage Δ
e2e-full 23.63% <ø> (ø)
e2e-stable 59.55% <ø> (-0.86%) ⬇️
unit 49.08% <0.00%> (-0.01%) ⬇️
Files Coverage Δ
src/plugins/notebook/components/NotebookEntry.vue 16.31% <0.00%> (ø)

... and 21 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e3adeb6...c91ee23. Read the comment docs.

@akhenry akhenry merged commit d33da65 into master Apr 4, 2024
25 checks passed
@akhenry akhenry deleted the fix-notebook-paste-text-or-image branch April 4, 2024 21:30
akhenry added a commit that referenced this pull request Apr 4, 2024
akhenry added a commit that referenced this pull request Apr 4, 2024
Revert "Handle the case where the pasted data is not an image (#7628)"

This reverts commit d33da65.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants