Skip to content
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

[WiP] Selecting multiple files for deleting on left menu #368

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

guergana
Copy link
Collaborator

@guergana guergana commented May 5, 2024


Still TODO: make sure the first selected file is the one displayed on the View Panel. Right now it changes.

@guergana guergana marked this pull request as draft May 5, 2024 15:31
Copy link

cloudflare-pages bot commented May 6, 2024

Deploying opendataeditor with  Cloudflare Pages  Cloudflare Pages

Latest commit: d0cabb9
Status: ✅  Deploy successful!
Preview URL: https://90589de4.opendataeditor.pages.dev
Branch Preview URL: https://341-selecting-multiple-files.opendataeditor.pages.dev

View logs

@guergana guergana force-pushed the 341-selecting-multiple-files-menu branch from 9f0f583 to 2b23a80 Compare June 2, 2024 11:15
return (
<InputDialog
open={true}
value={path}
value={paths[0]}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how moving file works. This might need to be reworked as well for multiple files

return (
<InputDialog
open={true}
value={path}
value={paths[0]}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as with moving files. This might need to be adjusted for multiSelection

for (const path of paths) {
await client.fileDelete({ path })
onFileDelete(path)
}
},
moveFile: async (path, toPath) => {
const { client, onFileCreate } = get()
const result = await client.fileMove({ path, toPath, deduplicate: true })
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how this works. haven't tested it yet

if (paths === newPaths) return
set({ paths: newPaths })
if (!newPaths) return
if (record?.path === newPaths[0]) return
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what this is doing. using only the first path just in case. Is it for the history? Do we need to modify the record to add all the selected paths?

if (selectors.isFolder(get())) return
await openFile(newPath)
// if more than one file is selected, display the only the first one
if (paths && paths[0] !== newPaths[0]) await openFile(newPaths[0])
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still not working 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem selecting multiple files on the left menu
1 participant