ifmeorg / ifme

Free, open source mental health communication web app to share experiences with loved ones
http://www.if-me.org/
GNU Affero General Public License v3.0
1.47k stars 742 forks source link

Embed external images in Moments and Strategies editor #2205

Closed Rxthew closed 1 year ago

Rxthew commented 1 year ago

Description

Implemented changes to allow editor to embed an image after the user provides an appropriate link via prompt.

More Details

This was implemented to conform with the rest of the workflow which uses pell.

One concern I have is that behind the scenes pell relies heavily on the document.execCommand property which is deprecated.

This is also highlighted as an issue in the repository itself.

Corresponding Issue

Issue 2141

Screenshots

Peek Issue 2141


Reviewing this pull request? Check out our Code Review Practices guide if you haven't already!

welcome[bot] commented 1 year ago

Thank you for opening this pull request with us! Be sure to follow our Pull Request Practices. Let us know if you have any questions on Slack.

Rxthew commented 1 year ago

Great start, thanks so much for working on this 🎉

I pulled down your branch and the functionality works as expected!

A few things we need to address are making sure very large images are scaled to fix the container or else this will happen:

In the editor:

On the post page:

Through CSS, we want to set max-width: 100%;.

Hello,

Sorry this took so long, I've completed it this a while ago but I'm still experiencing issues with my dev environment.

I spent some time getting more familiar with the repository and I realised there was no dedicated component for posts so I added a class in the ERB files. This involved importing the containers from the core assets module into the global scss file, and I was a little uncomfortable with that so If there is a less disruptive approach I may have overlooked I could go back and make changes.

welcome[bot] commented 1 year ago

Thank you for merging this pull request with us! If you haven't already, in another pull request, please add yourself to our About page.