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

New Folder Button on Filepicker Dialog (Type Choose) #19438

Closed
JonathanTreffler opened this issue Feb 12, 2020 · 5 comments
Closed

New Folder Button on Filepicker Dialog (Type Choose) #19438

JonathanTreffler opened this issue Feb 12, 2020 · 5 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement
Milestone

Comments

@JonathanTreffler
Copy link

Is your feature request related to a problem? Please describe.
I am currently working on a PR to a nextcloud app called flowupload (e-alfred/flowupload#73).
In my PR you can chose the upload directory with a filepicker Dialog and it would be really useful to have a button to create a new folder.

This button exists on different filepicker Types (like OC.dialogs.FILEPICKER_TYPE_COPY):
image

... but not on OC.dialogs.FILEPICKER_TYPE_CHOOSE:
image
... it doesn't exist

Describe the solution you'd like
A button like on FILEPICKER_TYPE_COPY would be nice.

Additional context
This is the code i open the dialog with:

OC.dialogs.filepicker("Select a new Upload Folder", function(path) { ... }, false, 'httpd/unix-directory', true, OC.dialogs.FILEPICKER_TYPE_CHOOSE);
@JonathanTreffler JonathanTreffler added 0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement labels Feb 12, 2020
@kesselb
Copy link
Contributor

kesselb commented Feb 12, 2020

var newButton = self.$filePicker.find('.actions.creatable .button-add')
if (type === self.FILEPICKER_TYPE_CHOOSE) {
newButton.hide()
}

It seems the button is already there just hidden. I would try to make it visible. Probably a bit cleaner than making the button visible is to use FILEPICKER_TYPE_CUSTOM (not sure if available for Nextcloud 17) and push/trigger the choose action manually.

@kesselb
Copy link
Contributor

kesselb commented Feb 12, 2020

cc @nextcloud/javascript opinions? I think it should be possible by using FILEPICKER_TYPE_CUSTOM but haven't tested it.

@JonathanTreffler
Copy link
Author

Is there any reason the button is hidden ?

@kesselb
Copy link
Contributor

kesselb commented Feb 21, 2020

Might be fixed by #19539

@JonathanTreffler
Copy link
Author

Might be fixed by #19539

This change is in the branch stable19 and it does fix my problem 👍

@MorrisJobke MorrisJobke added this to the Nextcloud 19 milestone May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement
Projects
None yet
Development

No branches or pull requests

3 participants