sp-dev-fx-controls-react icon indicating copy to clipboard operation
sp-dev-fx-controls-react copied to clipboard

ISSUE 1683 Fix: (DynamicForm) Added the option to edit file name

Open gruizdev opened this issue 1 year ago • 3 comments

Added the option to edit file name when the form points to a document library and an item is being edited

Q A
Bug fix? [ X ]
New feature? [ ]
New sample? [ ]
Related issues? fixes #1683

What's in this Pull Request?

When the control DynamicForm is configured to display an item in a document library, the field Name (FileLeafRef) does not come through to edit.

To amend that behaviour, I have performed the following changes:

DynamicForm.tsx

  • The function that retrieves the fields (getFormFields) has been modified to bring the field FileLeafRef when an item id has been provided (hence editing an item)
  • The function that provides the information needed to display the fields (getFieldInformations) has been modified to include a case for File fields and retrieve the file name

DynamicField.tsx

  • A new case has been added to display a File field by displaying a text box with the file name

SPService.ts

  • A new function has been added to SPService to retrieve the file name of a document library item (getFileName)

gruizdev avatar Dec 17 '23 20:12 gruizdev

@gruizdev - sorry for the long delay. Could you please resolve the conflict?

Thanks!

AJIXuMuK avatar Feb 11 '24 23:02 AJIXuMuK

@gruizdev would you be able to resolve the conflicts or need some help with this? There are more PRs that target this control and ideally we would merge them in order of submission.

joelfmrodrigues avatar May 14 '24 23:05 joelfmrodrigues

Hi @gruizdev,

Are you still working on this one? Do you need any assistance?

michaelmaillot avatar Aug 05 '24 23:08 michaelmaillot