Pnp-modern-search: Export / Import Capability for Web Part Configuration

Created on 9 Feb 2021  路  12Comments  路  Source: microsoft-search/pnp-modern-search

Is your feature request related to a problem? Please describe.

As I was working on the issue #759, it occurred to me that it would be great if we could somehow export the settings from one MSWP for import to another.

Describe the solution you'd like

Take my example in #759: I want to have a modern search -enabled page in each Hub Site, which is scoped to that Hub Site. I'm taking advantage of the great capabilities in the v4 Web Parts, of course. Those capabilities are myriad, and remembering exactly which settings it took to get to a particular solution is difficult.

Describe alternatives you've considered

I can open the two pages in two browser tabs and copy/paste from one to the other, of course, and that's what I will probably do. But that is error prone and I'm not that reliable. :)

I could clone the page with ShareGate or PowerShell.

But think of the Power User who doesn't have the tools or skills and would like to reproduce functionality in multiple locations.

enhancement

All 12 comments

What you are looking for is the classic export web part feature, so I think getting this in the SPFx framework is a better approach.

Right now I'm more inclined to have docs describe how to use Add-PnPClientSideWebPart etc to solve it.

I'm thinking about it a little differently. If we could export the configuration settings and then import them into another like Web Part, it would make life easier.

I see what you mean about pushing it up a level. But having an exported JSON file give up more options, IMO.

@sympmarc I do see where you're coming from. I have an idea I'll explore, and then get back to you :)

@wobba @sympmarc something like this https://pnp.github.io/sp-dev-fx-property-controls/controls/PropertyPanePropertyEditor? In this case, we need to ensure dynamic data properties are correctly handled

@FranckyC that was exactly what I was planning to explore 馃槄 I think we could just add this control, and if it works it works, if not for some dynamic stuff, too bad. Get's you well underway.

I remember have tried this long time ago but without success. Hope you will find way to get it work correctly ;)

That's definitely along the lines I was thinking. It even gives us a way to put some source control around our settings!

The control works ok.. testing on v3.18 now, but it doesn't persist the dynamic connection. I know that works using PnP templates, so probably a runtime thing which I'll look into a bit more.

Logged https://github.com/pnp/sp-dev-fx-property-controls/issues/331 to support Page context dynamic data at least. Which means scenarios where you use query param or nav bar search box you can export/import. For connected web parts you would need to make the connection manually afterwards.

@wobba @FranckyC et al: Looks like v4.2.1 adds this? I see it listed in the v3 release notes, but not v4.2.1 Thanks for doing this!

Forgot to tag this issue on the release notes when I added the code for this yesterday. Updated :)

Was this page helpful?
0 / 5 - 0 ratings