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

Upload images from local files #232

Merged
merged 9 commits into from Jun 28, 2023

Conversation

Mukund-Tandon
Copy link
Contributor

fixes: #200

Screen.Recording.2023-06-21.at.3.26.37.PM.mov

@codecov
Copy link

codecov bot commented Jun 21, 2023

Codecov Report

Merging #232 (c6267ee) into main (a1ae5ea) will decrease coverage by 0.23%.
The diff coverage is 43.65%.

@@            Coverage Diff             @@
##             main     #232      +/-   ##
==========================================
- Coverage   62.63%   62.41%   -0.23%     
==========================================
  Files         243      246       +3     
  Lines       10772    10847      +75     
==========================================
+ Hits         6747     6770      +23     
- Misses       4025     4077      +52     
Impacted Files Coverage Δ
..._component/image_block_component/base64_image.dart 0.00% <0.00%> (ø)
.../src/editor/util/file_picker/file_picker_impl.dart 0.00% <0.00%> (ø)
...c/editor/util/file_picker/file_picker_service.dart 0.00% <0.00%> (ø)
...t/image_block_component/image_block_component.dart 56.25% <42.85%> (-23.24%) ⬇️
...ent/image_block_component/image_upload_widget.dart 66.66% <49.15%> (-10.80%) ⬇️
...mponent/image_block_component/resizable_image.dart 52.77% <52.77%> (ø)
lib/src/infra/html_converter.dart 50.58% <66.66%> (-0.01%) ⬇️
lib/src/plugins/html/html_document_decoder.dart 82.91% <66.66%> (-0.43%) ⬇️

... and 1 file with indirect coverage changes

@Mukund-Tandon Mukund-Tandon marked this pull request as ready for review June 22, 2023 15:55
@LucasXu0
Copy link
Collaborator

Hey, @Mukund-Tandon Any updates?

@Mukund-Tandon
Copy link
Contributor Author

Hey, @Mukund-Tandon Any updates?

I am working on it will sumbit a changes by tommorow, sorry for the delay
Screenshot 2023-06-26 at 2 37 45 PM

@LucasXu0
Copy link
Collaborator

@Mukund-Tandon Okay, just let me know if you need any help.

…th and also changed the ui of uploading image
@Mukund-Tandon
Copy link
Contributor Author

@LucasXu0 , please can you review this , I have made the UI changes and also handled the case where if the image is not found at its source it should display error. I am working on writing test for these.

Screen.Recording.2023-06-27.at.4.19.42.PM.mov

@LucasXu0
Copy link
Collaborator

Nice, I will check it out. Also, I plan to modify something on your branch.

@LucasXu0
Copy link
Collaborator

Suddenly, I have another idea to solve the deleted image problem. I plan to save the image value as base64, then we don't need to handle the error anymore.

Let me do that on your branch.

@LucasXu0
Copy link
Collaborator

FYI, @Mukund-Tandon. I have submitted the code. Please check them.

By the way, please rebase or merge the main branch as the pull request conflicts with it.

@Mukund-Tandon
Copy link
Contributor Author

FYI, @Mukund-Tandon. I have submitted the code. Please check them.

By the way, please rebase or merge the main branch as the pull request conflicts with it.

Ok, I have updated my branch to resolve the merge conflicts .I will be now fixing some failing tests and will add more.

@LucasXu0
Copy link
Collaborator

@Mukund-Tandon Have you updated the branch? I didn't see any new commits.

@Mukund-Tandon
Copy link
Contributor Author

Mukund-Tandon commented Jun 28, 2023

@Mukund-Tandon Have you updated the branch? I didn't see any new commits.

Just pushed the changes 😅

@Mukund-Tandon
Copy link
Contributor Author

@LucasXu0 ,I had a doubt, what is the use of the files under image(location - lib/src/render/image
Screenshot 2023-06-28 at 12 05 53 PM

@LucasXu0
Copy link
Collaborator

@Mukund-Tandon They're deprecated.

Are you working on fixing the tests? If not, I can do that.

@Mukund-Tandon
Copy link
Contributor Author

Mukund-Tandon commented Jun 28, 2023

@Mukund-Tandon They're deprecated.

Are you working on fixing the tests? If not, I can do that.

Yes I am working on the test, actually the tests of these files where only remaining failing test , so should I delete the test file of under image?

@LucasXu0
Copy link
Collaborator

No worries. Let me fix them.

@Mukund-Tandon
Copy link
Contributor Author

No worries. Let me fix them.

Ok, so now should I proceed to work on other issues?

@LucasXu0
Copy link
Collaborator

No worries. Let me fix them.

Ok, so now should I proceed to work on other issues?

Yep. Just choose the issues you want to solve.

@LucasXu0 LucasXu0 merged commit ed75bf6 into AppFlowy-IO:main Jun 28, 2023
4 of 7 checks passed
zoli added a commit to zoli/appflowy-editor that referenced this pull request Jun 28, 2023
* main:
  feat: support uploading images from local files  (AppFlowy-IO#232)
  fix: desktop tooltips incorrect (AppFlowy-IO#259)
  fix: add underline syntax parser (AppFlowy-IO#256)
  chore: add reload function into editor state
  fix: ignore the same value update in input service (AppFlowy-IO#257)
  Revert "feat: support mobile IME (AppFlowy-IO#255)"
  feat: support item count filter in selection menu results  (AppFlowy-IO#254)
  feat: support mobile IME (AppFlowy-IO#255)
  feat: replace DeltaTextInputClient with TextInputClient (AppFlowy-IO#253)
@Mukund-Tandon Mukund-Tandon deleted the upload_image_from_file_200 branch June 29, 2023 11:00
@Davidzhu001
Copy link

does it has a callback so i can upload image

@Mukund-Tandon
Copy link
Contributor Author

does it has a callback so i can upload image

Hi, I don't completely understand your question, but we can upload an image from our local device as well as paste an image URL.

Screen.Recording.2023-08-01.at.1.42.41.PM.mov

Is there anything I am missing?

@Davidzhu001
Copy link

Davidzhu001 commented Aug 1, 2023

I am thinking if the user choose a image.
i can get the event and upload the image to my server.
then I got a url from the server. so i can call editorState.insertImageNode('');

or does the editor has a callback event, so i can listen when user choose a local image

@Davidzhu001
Copy link

image when this button is clicked, is there event i can listen?

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

Successfully merging this pull request may close these issues.

[FR] Add support to upload images from local files
3 participants