pentacent / keila

Open Source Newsletter Tool.
https://keila.io
GNU Affero General Public License v3.0
1.33k stars 69 forks source link

Add Image Uploads #139

Closed wmnnd closed 1 year ago

wmnnd commented 2 years ago

This pull request implements #38 in the newKeila.Files context.

Currently, only local file storage is supported, but serving those files from a different domain is possible (and encouraged). There are currently also no image-specific features.

Browsing uploaded images is possible with a new LiveComponent file manager:

Screenshot from 2022-09-01 12-19-24

Implements #38 and #138.

wmnnd commented 1 year ago

Added another small feature: Double-clicking on an image or clicking on the image button when an image is selected now allows modifying an existing image node.

wmnnd commented 1 year ago

@panoramix360 & @gbottari: I think this PR is ready to go. Would you like to give it another look?

panoramix360 commented 1 year ago

@wmnnd nice!

I'll look into that :D

wmnnd commented 1 year ago

@panoramix360 Did you have a chance to give the PR a look yet?

panoramix360 commented 1 year ago

Hi @wmnnd!

Sorry for the delayed answer, I just joined another company recently and was busy on onboarding and stuff haha

Looking through it now!

panoramix360 commented 1 year ago

@wmnnd

Strange, it seems that the WYSIWYG editor is not opening here: image

panoramix360 commented 1 year ago

Your code is really clean on this one :) everything is split into small modules and it seems extensible.

Since I don't use Elixir professionally yet, I really learned a lot of things by reading your code, so thank you for that! 😄

Is there a possibility to the user/DevOps change the upload for a server/CDN folder?

It could be good to write something about it on the documentation, on how to create a new adapter to store files remotely. What do you think?

I made some small comments on the code as well, let me know what you think!

Wrapping up, I think it's a pretty good update on Keila 💯

Again, sorry for the delay in reviewing these, I'll look through the issues again and pick one to contribute, now that my schedule is more stable hehe

wmnnd commented 1 year ago

Thank you so much for taking a look and for your kind words @panoramix360!

I’ve set up the code in such a way that it’s theoretically relatively easy to add another file storage adapter for, say, S3, but I think that’s something that can be added if there’s demand for it and someone who wants to take it on :smile: I’ll take a look at your other notes tomorrow.