pnp / pnp/sp-dev-fx-controls-react
Feature Enhancement on ListItemAttachments
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 433
- Forks
- 418
- Avg merge
- 5d 6m
- Merged PRs (30d)
- 19
Description
Category
[x] Enhancement
Version
Version of the library: [@pnp/spfx-controls-react": "3.8.1"]
Enhancement
Please provide the ability to allow a certain group to add or remove attachments.
A typical Use-Case:
In a quality process, certain technical users (Members of SharePoint-Security-Group XY) are allowed to add attachments in the NewForm and the EditForm of a SPFx Forms Customizer. They are not allowed to delete attachments in the EditForm.
Certain clerks (Members of SharePoint-Security-Group AB) are allowed to add and remove attachments.
You could extend IListItemAttachmentsProps.ts with two new props
groupNameAdd?: string;
groupNameDelete?: string;
And also extend IListItemAttachmentsState.ts with these properties.
Then in ListItemAttachments.tsx you could assign the props to state and implement a function to determine if the current user is a member of the given groups and set the state of these two properties.
The render function could then evaluate the state to activate/deactivate the delete- and/or the add-Icon
It would also be helpful to have public properties to identify if the user added or removed attachments in a EditForm.
This would help to run business logic right from the form or in a Nintex Automation Cloud Workflow.
Thanks!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with IListItemAttachmentsProps.ts, IListItemAttachmentsState.ts, and ListItemAttachments.tsx. Review how props and state currently control attachment actions, then determine how group membership and public attachment-change properties should fit the existing control. Done means the requested add/delete permissions and edit-form change indicators are supported and covered by the project’s relevant tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- authorization, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100