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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paste image 馃崫 馃柤 #337

Merged
merged 8 commits into from Feb 15, 2019

Conversation

Projects
None yet
3 participants
@dkarter
Copy link
Contributor

dkarter commented Feb 9, 2019

This PR allows one to paste an image directly into the textarea for editing a post or into one of the editors (Vim/ACE). It is meant to imitate the experience on Github when pasting photos into a textbox.

See for yourself:
demo

If the user does not have a Imgur Client Id there will be an error in the console, but otherwise they will not notice any change.

when not setup

Unfortunately this is a difficult feature to test since it is making the request from the client side and therefore stubbing it will be a difficult undertaking, but I did test it thoroughly manually and ensured all the existing tests are passing.

Consider this a first iteration on this feature. Future iterations can wrap the image upload in our own API which would make this easier to test with Bypass and ultimately find a way to host the images ourselves. For now I believe this is a decent first pass at this type of feature which should make creating TILs faster and more fun.

@hashrocketeer hashrocketeer had a problem deploying to tilex-staging-pr-337 Feb 9, 2019 Failure

@dkarter dkarter changed the title Paste image [WIP] Paste image Feb 9, 2019

"@babel/preset-env"
]
"presets": ["@babel/preset-env"],
"plugins": [["@babel/plugin-proposal-class-properties", { "loose": false }]]

This comment has been minimized.

@dkarter

dkarter Feb 9, 2019

Author Contributor

Enables arrow functions inside classes e.g.

class SomeClass {
   normalFunction() {
     return 'foo';
   }

   boundFunction = () => {
     return this.normalFunction();
   }
}

dkarter added some commits Feb 3, 2019

Use Elixir 1.7.0 compiled with OTP 21
By default asdf will install Elixir compiled with an older version of
Erlang (20)
Add support for bound arrow functions in classes
This allows us to use something like:

```
class Example {
  otherFunc() {

  }

  handleEvent = () => {
    this.otherFunc()
  }
}
```

Eliminating the need to bind functions to `this` in the constructor.
Upload images on paste to post form
When an image is pasted on to the post form it will be automatically
uploaded to Imgur and the link would be pasted into the form as a
markdown image tag.

@dkarter dkarter force-pushed the paste-image branch from f2f0ae3 to 4c85b4d Feb 9, 2019

@hashrocketeer hashrocketeer temporarily deployed to tilex-staging-pr-337 Feb 9, 2019 Inactive

@hashrocketeer hashrocketeer temporarily deployed to tilex-staging-pr-337 Feb 9, 2019 Inactive

@dkarter dkarter force-pushed the paste-image branch from 7a1695b to 5838338 Feb 9, 2019

@hashrocketeer hashrocketeer temporarily deployed to tilex-staging-pr-337 Feb 9, 2019 Inactive

@dkarter dkarter changed the title [WIP] Paste image Paste image Feb 9, 2019

@dkarter dkarter requested review from chriserin and jwworth Feb 9, 2019

Set up inheritance of IMGUR_CLIENT_ID
To enable the feature in the review app on heroku

@hashrocketeer hashrocketeer temporarily deployed to tilex-staging-pr-337 Feb 9, 2019 Inactive

@hashrocketeer hashrocketeer temporarily deployed to tilex-staging Feb 9, 2019 Inactive

@hashrocketeer hashrocketeer temporarily deployed to tilex-staging-pr-337 Feb 9, 2019 Inactive

@hashrocketeer hashrocketeer temporarily deployed to tilex-staging Feb 9, 2019 Inactive

@hashrocketeer hashrocketeer temporarily deployed to tilex-staging-pr-337 Feb 9, 2019 Inactive

@hashrocketeer hashrocketeer temporarily deployed to tilex-staging Feb 9, 2019 Inactive

@hashrocketeer hashrocketeer temporarily deployed to tilex-staging Feb 9, 2019 Inactive

@dkarter dkarter force-pushed the paste-image branch from eba570e to 2a2b404 Feb 9, 2019

@hashrocketeer hashrocketeer temporarily deployed to tilex-staging Feb 9, 2019 Inactive

@hashrocketeer hashrocketeer temporarily deployed to tilex-staging-pr-337 Feb 9, 2019 Inactive

Support multiple CORS origins
Also per usage instructions move CORS plug call to Endpoint:
https://github.com/mschae/cors_plug/blob/master/README.md#usage

@dkarter dkarter force-pushed the paste-image branch from 2a2b404 to 253e6a5 Feb 9, 2019

@dkarter dkarter changed the title Paste image Paste image 馃崫 馃柤 Feb 15, 2019

@chriserin chriserin merged commit b304857 into master Feb 15, 2019

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

@chriserin chriserin deleted the paste-image branch Feb 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.