Skip to content

[LiveComponent][RFC] Simple file upload handling #299

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

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6d78662
Fix code style
Lustmored Mar 11, 2022
84c59e0
Pass data as parameter within body to allow multipart data
Lustmored Mar 11, 2022
8b0762f
Add file upload to _makeRequest
Lustmored Mar 11, 2022
0439394
Introduce file modifier to pass files from live targets to action
Lustmored Mar 11, 2022
d07e589
Rename modifier to `files` and send all files by default
Lustmored Mar 11, 2022
19bc270
Fix failing test
Lustmored Mar 11, 2022
e31f591
Don't update file targets in morhpdom
Lustmored Mar 18, 2022
8e53081
Remove multiple files key handling - should be done by consumer
Lustmored Mar 25, 2022
365efa2
Add file upload info to docs
Lustmored Apr 1, 2022
7d81214
Throw when no file target is found
Lustmored May 13, 2022
dbb0cd1
Throw on missing live component data and fix test
Lustmored May 13, 2022
4426e73
Introduce LiveFileArg attribute and use it to autowire files
Lustmored May 13, 2022
b776f84
Autowire files only when files are sent
Lustmored May 13, 2022
820e899
Handle nested property paths in files
Lustmored May 13, 2022
e6d2331
Code Style
Lustmored May 13, 2022
2e22f1e
Reuse variable
Lustmored May 13, 2022
2f0e127
Remove file targets hack
Lustmored Jun 3, 2022
3dfe5ae
Rename files modifier to upload_files
Lustmored Jun 3, 2022
6b7a90b
Only save files on update and send them when needed
Lustmored Jun 3, 2022
3948f00
Add uploadFile shortcut method
Lustmored Jun 3, 2022
eaa70b4
Don't throw on unreadable property path
Lustmored Jun 3, 2022
77a6797
Empty fallback is unnecessary here
Lustmored Jun 3, 2022
d829cdd
Remove pointless constraints attribute
Lustmored Jun 3, 2022
50baf14
Expect file model to have simple name and remove PropertyAccessor spa…
Lustmored Jun 3, 2022
c0a5736
Make autowiring smart to some extent
Lustmored Jun 3, 2022
ddcc41c
Code style
Lustmored Jun 3, 2022
d05836a
Fix single file upload
Lustmored Jun 10, 2022
b5ed999
Code Style
Lustmored Jun 10, 2022
07fd789
Handle uploaded files in ComponentWithFormTrait by adding them to dat…
Lustmored Jun 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove file targets hack
  • Loading branch information
Lustmored committed Jun 24, 2022
commit 2f0e127a38d581d3f4a33c3346cd57ddfe365d11
3 changes: 0 additions & 3 deletions src/LiveComponent/assets/dist/live_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1422,9 +1422,6 @@ class default_1 extends Controller {
if (fromEl.hasAttribute('data-live-ignore')) {
return false;
}
if (this.fileTargets.includes(fromEl)) {
return false;
}
return true;
}
});
Expand Down
5 changes: 0 additions & 5 deletions src/LiveComponent/assets/src/live_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -648,11 +648,6 @@ export default class extends Controller {
return false;
}

// Don't update file targets
if (this.fileTargets.includes(fromEl)) {
return false;
}

return true;
}
});
Expand Down