{"action":"created","issue":{"url":"https://api.github.com/repos/stramel/vaadin-upload/issues/1","repository_url":"https://api.github.com/repos/stramel/vaadin-upload","labels_url":"https://api.github.com/repos/stramel/vaadin-upload/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/stramel/vaadin-upload/issues/1/comments","events_url":"https://api.github.com/repos/stramel/vaadin-upload/issues/1/events","html_url":"https://github.com/stramel/vaadin-upload/pull/1","id":271494678,"number":1,"title":"[REFACTOR] Rough Prototype","user":{"login":"stramel","id":855184,"avatar_url":"https://avatars1.githubusercontent.com/u/855184?v=4","gravatar_id":"","url":"https://api.github.com/users/stramel","html_url":"https://github.com/stramel","followers_url":"https://api.github.com/users/stramel/followers","following_url":"https://api.github.com/users/stramel/following{/other_user}","gists_url":"https://api.github.com/users/stramel/gists{/gist_id}","starred_url":"https://api.github.com/users/stramel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stramel/subscriptions","organizations_url":"https://api.github.com/users/stramel/orgs","repos_url":"https://api.github.com/users/stramel/repos","events_url":"https://api.github.com/users/stramel/events{/privacy}","received_events_url":"https://api.github.com/users/stramel/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-11-06T14:31:48Z","updated_at":"2017-11-10T19:53:07Z","closed_at":"2017-11-10T19:53:07Z","author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/stramel/vaadin-upload/pulls/1","html_url":"https://github.com/stramel/vaadin-upload/pull/1","diff_url":"https://github.com/stramel/vaadin-upload/pull/1.diff","patch_url":"https://github.com/stramel/vaadin-upload/pull/1.patch"},"body":"@jouni @marcus @platosha @admwx7 @haydenmcp @krumware\r\n\r\nPTAL This is first attempt at making `vaadin-upload` more modular. All feedback is welcome.\r\n\r\nA lot of files that are showing changed right now from working off an older commit and don't want to mess with rebasing yet. Best to start from [vaadin-upload-ajax-uploader](https://github.com/stramel/vaadin-upload/pull/1/files#diff-d3c90a35c198546b8b23caf8a051fc00)\r\n\r\n**Global TODOs:**\r\n- [x] i18n\r\n- [x] JSDocs\r\n- [ ] Unit Tests\r\n- [ ] Configurability (Slots)\r\n- [ ] Styling (Parts and CSS)\r\n- [ ] Visual Regression Tests\r\n\r\n---\r\n\r\n### `vaadin-upload`\r\n\r\nCreates a 100% backwards compatible version of the existing `vaadin-upload` component but built from new components. This is an optional component that allows users to migrate to the new breaking syntax without having to update all instances.\r\n\r\n**TODO:**\r\n- [x] Decide if this is worth keeping\r\n\r\n---\r\n\r\n### `vaadin-upload-ajax-uploader`\r\n\r\nAllows user to upload files using XHR. Fallsback to any specified uploader if not supported.\r\n\r\n**Mixes:**\r\n- `UploaderMixin`\r\n\r\n**Properties:**\r\n- `url`: Url to upload to\r\n- `method`: (Optional, defaults to `'POST'`) Method to use for request\r\n- `params`: (Optional, defaults to `{}`) Query params to send on request\r\n- `headers`: (Optional, defaults to `{}`) Headers to apply to XHR on request\r\n- `timeout`: (Optional, defaults to `0`) Timeout for XHR request\r\n- `withCredentials`: (Optional, defaults to `false`) True if request should be made with credentials\r\n- `formDataName`: (Optional, defaults to `'file'`) Name of the form data item\r\n\r\n**Events:**\r\n- `upload-preopen`: Cancelable, Fired before `xhr.open` is called. Allows canceling the upload before XHR is opened\r\n- `upload-preflight`: Cancelable, Fired before `xhr.send` is called. Allows canceling the upload before send or changing the send data.\r\n- `upload-start`: Fired after the XHR upload has started.\r\n- `upload-response`: Cancelable, Fired after XHR response comes back. Allows changing the response data.\r\n- `upload-error`: Fired after a failed XHR.\r\n- `upload-success`: Fired after a successful XHR.\r\n\r\n**TODO:**\r\n- [x] Error status'\r\n- [x] Implement abort logic\r\n- [x] Implement getEventDetails logic\r\n- [x] Parallel Uploads (Move to Enhancement)\r\n\r\n---\r\n\r\n### `vaadin-upload-dropzone`\r\n\r\nAllows creating a dropzone to handle file drag and drop.\r\n\r\n**Properties:**\r\n- `clickable`: (Optional, defaults to false) Allows the dropzone area to be clickable for triggering the file dialog\r\n- `dropTarget`: (Optional, defaults to self) Allows a user to specify different dropTargets: `document`, element id, element reference, or self.\r\n- `disabled`: (Optional, defaults to false) Disables the dropzone from triggering any file additions.\r\n- `invalid`: True if the files being dragged do not meet the specified criteria of the upload element\r\n- `active`: True if the dropzone has files being dragged over it\r\n\r\n**Slots:**\r\n- `upload`: Takes the upload element which handles validation and addition of files\r\n- DEFAULT: (Optional) Allows you to wrap contents with the dropzone.\r\n\r\n**TODO:**\r\n- [x] Handle Validation\r\n- [x] Decide what to do with `dragend` (Not firing)\r\n- [x] Handle folders (Move to Enhancement, appears to be Chrome only)\r\n\r\n---\r\n\r\n### `vaadin-upload-fetch-uploader`\r\n\r\n**TODO:**\r\n- [ ] Implement\r\n\r\n---\r\n\r\n### `vaadin-upload-file-list`\r\n\r\nImplements a virtual scroll list\r\n**NOTE:** I'm not convinced we should implement this as it just wraps `iron-list`\r\n\r\n**Properties:**\r\n- `files`: Files to display\r\n\r\n**Slots:**\r\n- DEFAULT: Allows you to provide how the file should display\r\n\r\n**TODO:**\r\n- [x] Decide if this should stay\r\n\r\n---\r\n\r\n### `vaadin-upload-file-uploader`\r\n\r\n**TODO:**\r\n- [ ] Implement\r\n\r\n---\r\n\r\n### `vaadin-upload-file`\r\n\r\nImplements the default file item visualization\r\n\r\n**Properties:**\r\n- `file`: File to display\r\n\r\n**TODO:**\r\n- [x] Solve actions\r\n- [x] Handle timing displays\r\n- [x] Handle errorMessage displays\r\n\r\n---\r\n\r\n### `vaadin-upload-icons`\r\n\r\nAdds the font icon data\r\n\r\n---\r\n\r\n### `vaadin-upload-image-preview`\r\n\r\nImplements a preview for images. Doesn't render non-images\r\n\r\n**Properties:**\r\n- `file`: Image to render\r\n- `alt`: (Optional, defaults to `file.name`) Alt that should be associated with the image preview\r\n\r\n**TODO:**\r\n- [x] Image resizing (Move to Enhancement)\r\n\r\n---\r\n\r\n### `vaadin-upload-localstorage-uploader`\r\n\r\n\"Uploads\" files to LocalStorage. Will fallback to any fallback uploader if LocalStorage is not supported. (Shouldn't ever not be supported on any modernish browser)\r\n**NOTE:** Limited to amount of LocalStorage the browser has allocated for the site.\r\n\r\n**Mixes:**\r\n- `UploaderMixin`\r\n\r\n**Properties:**\r\n- `path`: (Optional, defaults to \"files\") Path to store the files at.\r\n\r\n**TODO:**\r\n- [x] Handle subpaths, maybe? (ie. files.images) (Move to Enhancement)\r\n\r\n---\r\n\r\n### `vaadin-upload-mixin`\r\n\r\nImplements an interface for different upload components\r\n\r\n**Mixes:**\r\n- UtilsMixin\r\n\r\n**Properties:**\r\n- `files`: Notifies, List of files that have been added\r\n- `accept`: (Optional) List of MIME Types or file extensions to accept\r\n- `capture`: (Optional) Pass-through to `input` for capture type\r\n- `preventReload`: (Optional, defaults to `false`) Prevents navigating away when uploads are in progress\r\n- `disabled`: (Optional, defaults to `false`) Disables the input and button\r\n- `maxFileSize`: (Optional, defaults to `Infinity`) Maximum file size to allow. Specified in `unit` of choice.\r\n- `unit`: (Optional, defaults to `kB`) Unit to specify size in. (Useful for `maxFileSize`)\r\n- `invalid`: Notify, Reflects, If true, the component is invalid.\r\n- `required`: (Optional, defaults to false) Determines if this component should be able to fail validation.\r\n\r\n**Methods:**\r\n- `openFileDialog`: Allows user to trigger the open of the file dialog programmatically.\r\n- `remove`: Allows  user to remove a file\r\n- `addFiles`: Allows user to add a file or multiple files that are not complete. Returns Array of Promises\r\n- `validate`: Checks the validation state of the component. Component can override `__getValidity(file)` to implement the validation logic.\r\n- `validateFile`: Checks the validation state of the file.\r\n\r\n**TODO:**\r\n- [x] Merge validation\r\n- [x] Better way to handle event driven file operations\r\n- [x] Handle timings\r\n\r\n---\r\n\r\n### `vaadin-upload-multiple`\r\n\r\nImplements logic for allowing >= 1 files to be uploaded disabling the input and button after reaching max files. Also, keeps a list of the files uploaded.\r\n\r\n**Mixes:**\r\n- UploadMixin\r\n\r\n**Properties:**\r\n- `minFiles`: (Optional, defaults to `0`) Minimum number of files that must be added to be considered valid.\r\n- `maxFiles`: (Optional, defaults to `Infinity`) Maximum number of files that can be added.\r\n- `maxFilesReached`: Notifies, ReadOnly, True if `maxFiles` was reached.\r\n\r\n**Slots:**\r\n- `uploader`: Uploader goes in here\r\n\r\n---\r\n\r\n### `vaadin-upload-single`\r\n\r\nImplements logic allowing for a single file to be uploaded and not disabling the input after the single upload. Does not keep a list of files that have been uploaded. Only handles the latest file\r\n\r\n**Mixes:**\r\n- UploadMixin\r\n\r\n**Slots:**\r\n- `uploader`: Uploader goes in here\r\n\r\n**TODO:**\r\n- [x] Clear files on new file added\r\n\r\n---\r\n\r\n### `vaadin-upload-uploader-mixin`\r\n\r\nImplements the base logic for all uploaders.\r\n\r\n**Properties:**\r\n- `fallback`: (Optional) ReadOnly, If provided and the uploader isn't supported by the browser it will use this method instead. \r\n- `files`: Notifies, The files to upload\r\n- `auto`: (Optional, defaults to `false`) Upload immediately after adding\r\n- `retryOnError`: (Optional, defaults to `false`) If `true` it will automatically re-attempt a failed upload.\r\n- `maxRetries`: (Optional, defaults to `5`) Limits number of retry attempts. Only applies if `retryOnError` is `true`.\r\n- `clearOnComplete` (Optional, defaults to false) Removes the file upon completion. **NOTE:** Not sure if this is useful or better to have a method that can be called to clear on demand?\r\n\r\n**Methods:**\r\n- `retry`: Re-attempts to upload specified file. Returns a promise.\r\n- `abort`: Kills a in progress file upload. Returns a promise.\r\n- `uploadFiles`: Can take a single file or multiple to upload. Returns an Array of Promises.\r\n\r\n**Events:**\r\n- `upload-before`: Triggered before an actual upload process starts on a file.\r\n- `upload-abort`: Triggered when abort is called on a file. **NOTE:** Not sure if this is necessary\r\n- `upload-retry`: Triggered when retry is called on a file. **NOTE:** Not sure if this is necessary\r\n\r\n**TODO:**\r\n- [x] Implement `retryOnError` with `maxRetries`\r\n- [ ] Decide on if `clearOnComplete` is useful enough to implement\r\n- [ ] Decide if `abort` and `retry` events are useful enough to keep\r\n- [x] Implement online/offline logic. Need advice on what to do in these cases. (Move to Enhancement)\r\n\r\n---\r\n\r\n### `vaadin-upload-file-item-mixin`\r\n\r\n---\r\n\r\n### `vaadin-upload-video-preview`\r\n\r\nImplements logic to render a image preview of a video. Doesn't render if required features are not supported or not a video file.\r\n\r\n**Properties:**\r\n- `file`: The video file to render a image for.\r\n- `alt`: (Optional, defaults to `file.name`) A string to use as the alt tag of the image preview.\r\n\r\n**TODO:**\r\n- [x] Image resizing (Move to Enhancement)\r\n- [x] Maybe better detection of the video formats the browser will accept? (Move to Enhancement)\r\n"},"comment":{"url":"https://api.github.com/repos/stramel/vaadin-upload/issues/comments/343569959","html_url":"https://github.com/stramel/vaadin-upload/pull/1#issuecomment-343569959","issue_url":"https://api.github.com/repos/stramel/vaadin-upload/issues/1","id":343569959,"user":{"login":"stramel","id":855184,"avatar_url":"https://avatars1.githubusercontent.com/u/855184?v=4","gravatar_id":"","url":"https://api.github.com/users/stramel","html_url":"https://github.com/stramel","followers_url":"https://api.github.com/users/stramel/followers","following_url":"https://api.github.com/users/stramel/following{/other_user}","gists_url":"https://api.github.com/users/stramel/gists{/gist_id}","starred_url":"https://api.github.com/users/stramel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stramel/subscriptions","organizations_url":"https://api.github.com/users/stramel/orgs","repos_url":"https://api.github.com/users/stramel/repos","events_url":"https://api.github.com/users/stramel/events{/privacy}","received_events_url":"https://api.github.com/users/stramel/received_events","type":"User","site_admin":false},"created_at":"2017-11-10T19:53:07Z","updated_at":"2017-11-10T19:53:07Z","author_association":"OWNER","body":"Moved to https://github.com/vaadin/vaadin-upload/pull/227"}}
{"actor":{"display_login":"stramel"}}