pnp / pnpcore

The PnP Core SDK is a modern .NET SDK designed to work for Microsoft 365. It provides a unified object model for working with SharePoint Online and Teams which is agnostic to the underlying API's being called
https://aka.ms/pnp/coresdk/docs
MIT License
308 stars 195 forks source link

API Mappings for `_api/navigation/menuState` #1257

Open JakeStanger opened 1 year ago

JakeStanger commented 1 year ago

Category

Describe the feature

There are some SP navigation settings that can only be set via the _api/navigation/menuState and _api/navigation/saveMenuState REST API. Currently these are not nicely exposed via PnP Core.

Describe the solution you'd like

As a minimum, It should be possible to get and save the menu state directly, using built-in PnP Core methods.

Ideally, some of the options should also be exposed via the regular navigation, with PnP Core automatically switching endpoint accordingly. For example, the "open in a new tab" option should be settable on NavigationNodeOptions, and then the library will use saveMenuState instead of the 'regular' web navigation endpoint.

Additional context

PnP PowerShell implementation for Add-PnPNavigationNode cmdlet, which aligns with the above: https://github.com/pnp/powershell/blob/ccee58d064da543e40a4a7a872ad9574f8a108ed/src/Commands/Navigation/AddNavigationNode.cs#L125

jansenbe commented 1 year ago

@JakeStanger : that would make sense as a change. Is this something you could take on?

JakeStanger commented 1 year ago

Possibly, but it wouldn't be short-term nor something I could commit to I'm afraid.

I will likely need a solution to this for a work project in a few weeks, so time constraints will control whether I can add something in here or not. I'll do my best to keep you updated.