-
Notifications
You must be signed in to change notification settings - Fork 499
refactor(core): refactor input uploads #11204
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
🧪 E2E Preview environment🔑 Environment Variables for Local TestingThis is the preview URL for the E2E tests: https://e2e-studio-rd7defxg3.sanity.dev To run the E2E tests locally, you can use the following environment variables, then run 💬 Remember to build the project first with |
🧪 E2E Preview environmentWaiting for preview deployment to finish… |
📊 Playwright Test ReportThis report contains test results, including videos of failing tests. |
59ae036 to
c13567c
Compare
⚡️ Editor Performance ReportDeploying studio and running performance tests… |
c13567c to
a93dd2a
Compare
a93dd2a to
4ba6d0c
Compare
4ba6d0c to
b954bba
Compare
b954bba to
98158c7
Compare
98158c7 to
2cf9cc3
Compare
2cf9cc3 to
aa97f46
Compare
2e5d77e to
277faa4
Compare
277faa4 to
b6a5dc9
Compare
b6a5dc9 to
2010bb5
Compare
91a68cd to
ff3fd90
Compare
ff3fd90 to
e101d07
Compare
e101d07 to
4e0bb58
Compare
4e0bb58 to
114dd48
Compare
114dd48 to
afc8c7b
Compare
This will streamline how inputs handle drag and drop + paste files. It will add asset source support to array of object uploads as well.
afc8c7b to
1423abf
Compare
Description
This will streamline how inputs handle drag-and-drop and file pasting for upload.
Previously, the drag-and-drop logic was scattered throughout the input components, with each input having its own implementation, resulting in nearly identical functionality everywhere but a lot of duplicated code.
This PR will streamline this interaction through a standard component (UploadTarget). This will keep the input components themselves less complex, ensure the same UX pattern is being used everywhere, and make it easier to refactor this functionality in the future.
This PR will also enable asset source upload support for the Array of Object input with the same component.
I have replaced the
resolveUploaderconcept for asset (file) uploads with aonSelectFileproperty for the inputs instead, as this should now be delegated to the asset source uploaders instead of the internal Uploader concept. The internal uploader concept is still supported for an Array of Primitives. Dropping a text file on an array of strings will behave exactly as before (populate the array with items from the lines of text).I had a bit back and forth about whether the new prop should be
selectFilesorselectFile, and landed onselectFile. If you need to select multiple files (such as an array), simply call the function multiple times for each file.Another change with this PR is that when multiple asset sources support uploads, the user will be prompted to select a destination after the files are dropped. Previously, the user had to drop the files into a "destination-bucket". This was a bit much to handle for the user at the same time, and it gave us limited space to explain the differences between the destinations. Although this has not been implemented yet, the plan is to enhance how these destinations are presented to the user at a later point. This change also ensures that the paste and drop actions will function in the same way in this regard.
What to review
Image, File, Array, and Portable Text Input File Uploading.
readOnlymodes.Testing
Use the various inputs in the test studio (file, image, portable text (simple block). Change them to test
readOnlyandoptions.acceptNotes for release