0

Current Situation

I have a document library that uses the Classic experience. This is necessary because the page includes a custom webpart that displays buttons based on the current user’s permissions and the document status (stored in a custom column). One or two buttons may be displayed next to each file (buttons are not shown for folders) and a button may be displayed just below the folder contents. If the user is at the top level of the library, a warning message is displayed: “Don’t store files at the top level.”

Clicking the button displayed below the folder contents displays a modal dialog box. The dialog box includes a textarea and two buttons: “Send Email” and “Cancel”. Clicking the button labeled “Send Email” would send an email to the programmatically determined recipients with a link to the folder the user was browsing when they clicked the “Send Email” button. Clicking the button labeled “Cancel” would dismiss the modal without further action.

Current Issue

The code is using the SharePoint SendMail REST API endpoint to send the email. That endpoint now returns an error with a note prompting the developer to use the Graph API instead. The emails are not being sent anymore.

Potential Solutions

I have set up custom formatting to display the buttons for each row when I switch the library to use the Modern experience. I have also developed a SharePoint Framework webpart that, when shown on the same page with the library webpart, controls the visibility of those buttons based on the current user’s group membership.

I am investigating two paths forward but have hit a wall in both directions.

  • I would like to show the custom webpart at the top of the default library view, but I cannot find a way to do that. This would allow me to deploy the custom webpart as is.
  • I am open to building a modern page that includes the custom webpart and the library webpart, but I don’t know how to specify a deep link to that page such that the library webpart would automatically navigate to the provided path.

1 Answer 1

1
  1. The OOB document library view in modern experience does not allow to add new webpart so you have to create a modern page to add the custom webpart and library webpart.

  2. For redirection purpose, you can create a SPFx application customizer which will check if user is on a particular path (document library in this case) and redirect to modern page you are going to create.

3
  • Thank you, @harminder-singh! I got a similar response on the Microsoft Q&A. I am working on implementing this as an Application Customizer and will return here with my results. Commented Nov 19 at 12:55
  • @PaulRowe Thanks for the update! If my answer helped resolve your issue, could you please mark it as the accepted answer? This helps others find the solution more easily and keeps the thread organized. Thank you! Commented Nov 20 at 15:49
  • I haven't completed my implementation yet, but this does appear to be the right path. I had several configuration options in the Webpart implementation and I'm investigating a path that I found for making the Application Customizer configurable. Commented Nov 21 at 16:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.