Giter VIP home page Giter VIP logo

attaches's People

Contributors

artsur avatar dependabot[bot] avatar gday avatar github-actions[bot] avatar gohabereg avatar ivansieder avatar jerinjacob1999 avatar nespecc avatar polinashneider avatar robonetphy avatar talyguryn avatar tatianafomina avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

attaches's Issues

Getting error: "File upload failed" for no reason

The uploading works fine, the response is also correct, the file gets displayed in the builder although without the file name for some reason.

Editorjs config:

      attaches: {
              class: AttachesTool,
              config: {
                  additionalRequestHeaders: {
                      "X-CSRF-TOKEN": this.token,
                  },
                  endpoint: '/admin/builder/upload-file',
              }
          },

Laravel Controller:

          public function upload_file() {
              if (request()->file('file')) {
                 
                  $file = request()->file('file');
      
                  $extension = $file->extension();
      
                  $size = $file->getSize();
      
                  $fileName = $file->getClientOriginalName();
      
                  $time = date('H-i-s');
      
                  $date = date('d-m-Y');
      
                  Storage::disk('public')->put('uploads/categories/'.$date.'/'.$time.'_'.$fileName, file_get_contents($file));
      
                  return response()->json([
                      'success' => 1, 
                      'file' => [
                          'url' => asset('/storage/uploads/categories/'.$date.'/'.$time.'_'.$fileName),
                          'size' => $size,
                          'extension' => $extension,
                          'name' => $fileName
                      ]
                  ], 200);
              }
          }

Result:

Getting "File Upload Failed" although it is uploaded and the file is displayed in the builder but without the file name.

Option to over ride title

Is it possible to over ride title: 'Attaches' which is shown on hover of icon inside editor?

static get toolbox() {
  return {
    icon: Icon,
    title: 'Attaches'
  };
}

errors running npm run build

Dependencies in package.json seem to be missing

npm install
npm run build

fails with:

> @editorjs/[email protected] build /.../attaches
> webpack --mode production


Insufficient number of arguments or no entry found.
Alternatively, run 'webpack(-cli) --help' for usage info.

Hash: 46a985958e381b5d6669
Version: webpack 4.42.1
Time: 107ms
Built at: 04/11/2020 3:15:30 PM

ERROR in Entry module not found: Error: Can't resolve 'babel-loader' in '/home/yoel/src/editorjs/attaches'
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @editorjs/[email protected] build: `webpack --mode production`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the @editorjs/[email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /../.npm/_logs/2020-04-11T19_15_30_973Z-debug.log

And installing babel-loader just run into more problems.

Option to handle the deletion of files

give a option to configure a route to send a request when deleting files, to remove the file from a cloud for example, when the file is deleted from the editor

ClassName misstake

In the latest release it is not "AttachementTool" - it is "AttachesTool".

Update readme.md

Custom upload function

editor-js/image provides a uploadByFile function. I think simply an endpoint is not enough for attaches either. E.g. I have to pass CSRF-token and do other stuff.

Add customer headers to config

This is a really excellent editor.
I want to know how to add a custom header to the attaches tool. I have an API that requires an authorization token to be sent before you can upload a file

Error handling on 413

Is it possible to show human readable error on 413 - Request Entity Too Large? Now I`m getting error only in console and user has no chance to find out what actually happened.

Thanks for otherwise great plugin!

Backend response fields not optional

In the section about backend response format, the text says

Can contain data you want to store.

I've implemented a simple upload handler which returns only { success : 1 } response, but the component fails with the message

File upload failed

The same thing happens when I add an empty file: { } section to response.

If I add the url field inside file object, the error changes to

Cannot read property 'split' of undefined

The message is the same if I add the title field inside the file object.

Once I added the name field into the file object, everything works as expected.

Note that in all these instances, the actual upload works โ€“ the file is properly stored inside the dedicated uploads folder.

I am using the latest dist version downloaded from the master branch today.

The way I see it, either docs need to reflect that name is a required response field inside the file object, or it needs to default to some name if one isn't returned.

Happy to supply more details if needed and thank you for all your work on this.

Not supported in editor Js read-only mode

Hello, i am using attaches plugin for my project and it works fine but when the editor js is in read-only mode, i got an Error. When debugging i got this index.js:1 Editor.js is not ready because of Error: To enable read-only mode all connected tools should support it. Tools attached don't support read-only mode..

Is their a way to enable support for read-only mode or suggestion on how to handle this

Status code "201 Created" fails silently

My backend responds with 201 when saving a new file. This fails silently. I have to change status code to 200 in the backend for it to work.

Same backend works fine with the "images" plugin.

Finder opens twice after adding the attaches field

Hi,

When you add an attaches field, the finder/explorer opens automatically.
But this takes like a second or so before it opens.

When in the meantime you click on the select a file box, the finder opens again after you selected a file initially in the automatically opened finder. So in that case the finder opens twice, which is a bit confusing.

Maybe it's better to disable click events on the button till the finder has opened initially? Or disable initially opening the finder?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.