-
Notifications
You must be signed in to change notification settings - Fork 67
feat: Add drag and drop in public sharing page ✨ #3413
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
Conversation
BundleMonFiles updated (4)
Unchanged files (17)
Total files change +16.89KB +0.34% Groups updated (2)
Unchanged groups (1)
Final result: ✅ View report in BundleMon website ➡️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's more a feat
than a fix
in my opinion 🤔
No need to use DropzoneDnD? I don't remember if we have dnd feature on public pages...
@JF-Cozy there is a ticket that require to add drag and drop in public page https://www.notion.so/linagora/Public-shared-page-add-drag-and-drop-22362718bad180e98f13d504d4f68868?source=copy_link and it's marked as bug |
451212e
to
865e691
Compare
865e691
to
20f086f
Compare
Ok, but it's not, it's a lack of feature, not the same. But anyway, it's a detail... |
I just took a look, we don't use virtualized table on public page, so no need to use DropzoneDnD |
20f086f
to
b756e28
Compare
@lethemanh don't forget to modify |
b756e28
to
e746b11
Compare
@JF-Cozy I've remove prop |
LGTM, but there is a small issue: I just tested and the drag&drop works, just a small issue with the folder view not being updated after the upload is complete ( it refreshes if you upload via the create button ). i made a small video: dragdrop.mp4edit: after some checking, the dropzone component dispatches the uploadFiles call with fileUploadedCallback = () => null and this approach relies on the cozy-realtime to handle the update and this won't happen because the publicly shared folder view can't subscribe to the events. one possible solution is to update the Dropzone component to support this case: export const Dropzone = ({
displayedFolder,
disabled,
refreshFolderContent = null,
children,
}) => {
const client = useClient()
const { t } = useI18n()
const { isMobile } = useBreakpoints()
const { showAlert } = useAlert()
const sharingState = useSharingContext()
const vaultClient = useVaultClient()
const dispatch = useDispatch()
const fileUploadCallback = refreshFolderContent
? refreshFolderContent
: () => null
const onDrop = async (files, _, evt) => {
if (!canDrop(evt)) return
const filesToUpload = canHandleFolders(evt) ? evt.dataTransfer.items : files
dispatch(
uploadFiles(
filesToUpload,
displayedFolder.id,
sharingState,
fileUploadCallback,
{
client,
vaultClient,
showAlert,
t,
}
)
)
} and in the <Dropzone
disabled={!hasWritePermissions}
displayedFolder={displayedFolder}
refreshFolderContent={refreshFolderContent}
> |
e746b11
to
5440ab7
Compare
5440ab7
to
964fa77
Compare
@rezk2ll I've updated |
No description provided.