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
298 stars 192 forks source link

API to work with Viva Connections Dashboard #664

Closed mgwojciech closed 2 years ago

mgwojciech commented 2 years ago

Category

Describe the feature

Hello, I was thinking about api to help with Viva Dashboard management. What I have in mind is possibility to create the dashboard and manage default adaptive card (stuff like add default card with option to extend the model to custom ACE's).

Is it something You would welcome in the library or should I do it in separate solution?

Describe the solution you'd like

I'm thinking something like could be useful:

VivaDashboardManager manager = new VivaDashboardManager(context); VivaDashboard dashboard = manager.EnsureDashboardExists(); List aces = dashboard.ACEs; dashboad.AddACE(new DefaultACE()); manager.UpdateDashboard(dashboard);

Additional context

jansenbe commented 2 years ago

Hi @mgwojciech ,

Adding support for configuring the Viva connections dashboard is definitely something we should add. The Viva dashboard in reality is a special page type that hosts "ACE web parts" and this means that most of the current page API can work. Below are for example the json properties of a custom ACE on my dashboard:

{
    "id": "b9ff762c-7564-49dd-951d-c33351f7766c",
    "instanceId": "27ace3af-1eae-4b01-bf65-9202388ea34f",
    "title": "XYZ",
    "description": "Calling into an Azure AD secured API",
    "audiences": [],
    "serverProcessedContent": {
        "htmlStrings": {},
        "searchablePlainTexts": {},
        "imageSources": {},
        "links": {}
    },
    "dataVersion": "1.0",
    "properties": {
        "title": "XYZ",
        "description": "Checking licenses...",
        "iconProperty": "https://image.flaticon.com/icons/png/512/747/747055.png",
        "apiAbsUrl": "https://vivaconnections.azurewebsites.net/",
        "appId": "0c72c790-ce9e-422c-a17f-9e6607a0ba58"
    },
    "iconProperty": "https://image.flaticon.com/icons/png/512/747/747055.png",
    "cardSize": "Medium"
}

The main differences between a dashboard page and a regular page are:

So what do you think about the following implementation:

Above approach should not require too much work as most of the existing page implementation can be reused while still offering a simple VivaConnectionsDashboard type to work with the dashboard.

Let me know what you think, if you want to talk about this then ping me in Teams so we can have a call.

Thanks for wanting to work on this @mgwojciech !

mgwojciech commented 2 years ago

Thanks, Looks like a plan. I'll start this week and reach out if I run into any issues.

jansenbe commented 2 years ago

Thanks a ton for working on this @mgwojciech and apologies merging took so long, but the good news is that your PR has been merged now :-)