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

Cannot add an image to post #36

Closed
Moai- opened this issue Aug 13, 2019 · 1 comment
Closed

Cannot add an image to post #36

Moai- opened this issue Aug 13, 2019 · 1 comment
Assignees

Comments

@Moai-
Copy link

Moai- commented Aug 13, 2019

I think this might be two issues, please let me know if I should split this; but the crux of the problem is that adding images to posts does not work.

  1. After uploading the file, a notification is shown signifying a successful upload, but nothing else happens. This is because the ref for the MentionsInput is never set, which is how your code appends the div with the image in it. Simply adding inputRef={this.textAreaRef} after line 160 in PostEditor.ts makes that code work. However, the image still does not show up, because...

  2. The S3 must be misconfigured somewhere. If you go directly to the link that S3 gives you, you're served an AccessDenied error like this (https://saas-posts.s3.us-west-1.amazonaws.com/877/ud3vncvuzc594lc9okpo/03Tomopteris_helgolandica.jpg?AWSAccessKeyId=AKIAI3ZSOZXFCGWGWL7Q&Content-Type=image%2Fjpeg&Expires=1565717571&Signature=5p5%2FNA2cHdUutBC6ivvDtiDCqno%3D&x-amz-acl=private). I so far have not figured out why this part is breaking; putting posts into the team avatars bucket didn't solve the issue, even though team avatars upload fine. Unfortunately I was not at all familiar with S3 before beginning to work with SaaS boilerplate, so my knowledge here is limited.

I am able to reproduce this on my own deployment, as well as on Async Labs' test deployment (https://saas-app.async-await.com). The link above is to an image I tried to upload onto Async's bucket as part of a post. I've looked through existing issues, commit comments, and the TODO to see whether this is a delayed feature, but since it's not mentioned elsewhere, I must assume it is a bug.

tima101 added a commit that referenced this issue Aug 13, 2019
@tima101
Copy link
Member

tima101 commented Aug 13, 2019

@Moai- I can confirm problem. Thanks for reporting it.

Uploading file on the post was working as expected.
However:

  • insertion of fileUrl into post's content was not working
  • loading of uploaded file was not working

I pushed fixes: dc71871

I deployed and tested at https://saas-app.async-await.com
File upload works as expected.

Instructions on passing env vars and CORS configuration can be found here:
https://github.com/async-labs/saas#running-app-locally

@tima101 tima101 self-assigned this Aug 13, 2019
@tima101 tima101 added Assigned - Async Issue is assigned to at least one person. PR is assigned to at least one person. Ready to test - Async Issue is implemented and ready for testing. PR is merged. and removed Assigned - Async Issue is assigned to at least one person. PR is assigned to at least one person. labels Aug 13, 2019
@tima101 tima101 closed this as completed Oct 20, 2020
@tima101 tima101 removed the Ready to test - Async Issue is implemented and ready for testing. PR is merged. label Oct 20, 2020
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

No branches or pull requests

2 participants