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

[Dynamic Form] Cannot create folder in library folder #1901

Closed
martinlingstuyl opened this issue Nov 8, 2024 · 2 comments · Fixed by #1912
Closed

[Dynamic Form] Cannot create folder in library folder #1901

martinlingstuyl opened this issue Nov 8, 2024 · 2 comments · Fixed by #1912
Assignees
Labels
status:fixed-next-drop Issue will be fixed in upcoming release.
Milestone

Comments

@martinlingstuyl
Copy link
Contributor

martinlingstuyl commented Nov 8, 2024

Category

[x] Enhancement

[x] Bug

[ ] Question

Not sure if I would call this a bug. It certainly is unexpected behavior though.

Version

Please specify what version of the library you are using: 3.18.1

It's not resolved in the latest version 3.19.

Expected / Desired Behavior / Question

I can use the Dynamic Form on a library for creating document sets. However, the document sets will always be created in the root of the library. Even if I've clicked the new button from a subfolder. I'd like to be able to create something in the folder where I currently am located.

Observed Behavior

A document set, created using a dynamic form, is always created in the root of the library.

Steps to Reproduce

  1. Add the document set feature to a sharepoint site / library.
  2. Add a dynamic form in your spfx solution, using the contentTypeId of the document set.
  3. Navigate to a subfolder in the library. Click new
  4. Create the document set using the dynamic form.

Location in code

The location where this goes wrong:
https://github.com/pnp/sp-dev-fx-controls-react/blob/master/src/controls/dynamicForm/DynamicForm.tsx#L590C11-L592C13

const newFolder = await library.rootFolder.addSubFolderUsingPath(
  folderTitle
);

It should take into account the RootFolder of the form, which can be a subfolder of the library. This information is available as a querystring variable.

@martinlingstuyl
Copy link
Contributor Author

If you like you can assign me to this one @joelfmrodrigues, I'm in need of this for a customer, so I can build it in.

martinlingstuyl added a commit to martinlingstuyl/sp-dev-fx-controls-react that referenced this issue Nov 13, 2024
martinlingstuyl added a commit to martinlingstuyl/sp-dev-fx-controls-react that referenced this issue Nov 19, 2024
joelfmrodrigues added a commit that referenced this issue Nov 27, 2024
Adds ability to create files/folders in subfolder using DynamicForm. Closes #1901
@joelfmrodrigues joelfmrodrigues added this to the 3.20.0 milestone Nov 27, 2024
@joelfmrodrigues joelfmrodrigues added the status:fixed-next-drop Issue will be fixed in upcoming release. label Nov 27, 2024
@joelfmrodrigues
Copy link
Collaborator

PR merged and will be in the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:fixed-next-drop Issue will be fixed in upcoming release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants