pnpcore icon indicating copy to clipboard operation
pnpcore copied to clipboard

API Mappings for `_api/navigation/menuState`

Open JakeStanger opened this issue 1 year ago • 2 comments

Category

  • [x] Feature request

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

JakeStanger avatar Aug 17 '23 14:08 JakeStanger

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

jansenbe avatar Aug 17 '23 16:08 jansenbe

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.

JakeStanger avatar Aug 17 '23 17:08 JakeStanger