Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions documentation/Add-PnPVivaConnectionsDashboardACE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ online version: https://pnp.github.io/powershell/cmdlets/Add-PnPVivaConnectionsD
# Add-PnPVivaConnectionsDashboardACE

## SYNOPSIS
Add an Adaptive card extension in the Viva connections dashboard page. This requires that you connect to a SharePoint Home site and have configured the Viva connections page.
Add an Adaptive card extension in the Viva connections dashboard page. This requires that you connect to a SharePoint Team or Communication site and have configured the Viva connections page.
Comment thread
gautamdsheth marked this conversation as resolved.
Resolved

## SYNTAX

Expand All @@ -20,7 +20,7 @@ Add-PnPVivaConnectionsDashboardACE [-Identity <DefaultACE>] [-Title <string>] [-

## DESCRIPTION

Allows to add a new an Adaptive card extension in the Viva Home dashboard page. Before running the command it is required you are connect to a SharePoint Home site and have configured the Viva connections page.
Allows to add a new an Adaptive card extension in the Viva Home dashboard page. Before running the command it is required you are connected to a SharePoint Team or Communication site and have configured the Viva connections page.
Comment thread
gautamdsheth marked this conversation as resolved.
Resolved

## EXAMPLES

Expand Down
2 changes: 1 addition & 1 deletion documentation/Get-PnPVivaConnectionsDashboardACE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ online version: https://pnp.github.io/powershell/cmdlets/Get-PnPVivaConnectionsD
# Get-PnPVivaConnectionsDashboardACE

## SYNOPSIS
Returns the Adaptive card extensions from the Viva connections dashboard page. This requires that you connect to a SharePoint Home site and have configured the Viva connections page.
Returns the Adaptive card extensions from the Viva connections dashboard page. This requires that you connect to a SharePoint Team or Communication site and have configured the Viva connections page.
Comment thread
gautamdsheth marked this conversation as resolved.
Resolved

## SYNTAX

Expand Down
2 changes: 1 addition & 1 deletion documentation/Remove-PnPVivaConnectionsDashboardACE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ online version: https://pnp.github.io/powershell/cmdlets/Remove-PnPVivaConnectio
# Remove-PnPVivaConnectionsDashboardACE

## SYNOPSIS
Removes the Adaptive card extensions from the Viva connections dashboard page. This requires that you connect to a SharePoint Home site and have configured the Viva connections page.
Removes the Adaptive card extensions from the Viva connections dashboard page. This requires that you connect to a SharePoint Team or Communication site and have configured the Viva connections page.
Comment thread
gautamdsheth marked this conversation as resolved.
Resolved

## SYNTAX

Expand Down
2 changes: 1 addition & 1 deletion documentation/Set-PnPVivaConnectionsDashboardACE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ online version: https://pnp.github.io/powershell/cmdlets/Update-PnPVivaConnectio
# Set-PnPVivaConnectionsDashboardACE

## SYNOPSIS
Update the Adaptive card extension in the Viva Connections dashboard page. This requires that you connect to a SharePoint Home site and have configured the Viva Connections page.
Update the Adaptive card extension in the Viva Connections dashboard page. This requires that you connect to a SharePoint Team or Communication site and have configured the Viva Connections page.
Comment thread
gautamdsheth marked this conversation as resolved.
Resolved

## SYNTAX

Expand Down
7 changes: 3 additions & 4 deletions src/Commands/Viva/AddVivaConnectionsDashboardACE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ public class AddVivaConnectionsDashboardACE : PnPWebCmdlet
protected override void ExecuteCmdlet()
{
var pnpContext = Connection.PnPContext;
if (pnpContext.Site.IsHomeSite())
IVivaDashboard dashboard = pnpContext.Web.GetVivaDashboard();
if (dashboard != null)
{
IVivaDashboard dashboard = pnpContext.Web.GetVivaDashboard();

var cardDesignerACE = dashboard.NewACE(Identity, CardSize);
cardDesignerACE.Title = Title;
if (ParameterSpecified(nameof(PropertiesJSON)))
Expand Down Expand Up @@ -70,7 +69,7 @@ protected override void ExecuteCmdlet()
}
else
{
LogWarning("Connected site is not a home site");
LogError("Dashboard not found");
Comment thread
gautamdsheth marked this conversation as resolved.
Resolved
}
}
}
Expand Down
23 changes: 8 additions & 15 deletions src/Commands/Viva/GetVivaConnectionsDashboardACE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,23 @@ public class GetVivaConnectionsDashboard : PnPWebCmdlet
protected override void ExecuteCmdlet()
{
var pnpContext = Connection.PnPContext;
if (pnpContext.Site.IsHomeSite())
{
IVivaDashboard dashboard = pnpContext.Web.GetVivaDashboard();

if (ParameterSpecified(nameof(Identity)))
IVivaDashboard dashboard = pnpContext.Web.GetVivaDashboard();
if (ParameterSpecified(nameof(Identity)))
{
var aceToRetrieve = Identity.GetACE(dashboard, this);
if (aceToRetrieve != null)
{
Comment thread
gautamdsheth marked this conversation as resolved.
Resolved
var aceToRetrieve = Identity.GetACE(dashboard, this);
if (aceToRetrieve != null)
{
WriteObject(aceToRetrieve);
}
else
{
LogWarning("ACE with specified identifier not found");
}
WriteObject(aceToRetrieve);
}
else
{
WriteObject(dashboard.ACEs, true);
LogWarning("ACE with specified identifier not found");
}
}
else
{
LogWarning("Connected site is not a home site");
WriteObject(dashboard?.ACEs, true);
}
}
}
Expand Down
9 changes: 4 additions & 5 deletions src/Commands/Viva/RemoveVivaConnectionsDashboardACE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ public class RemoveVivaConnectionsACE : PnPWebCmdlet
protected override void ExecuteCmdlet()
{
var pnpContext = Connection.PnPContext;
if (pnpContext.Site.IsHomeSite())
IVivaDashboard dashboard = pnpContext.Web.GetVivaDashboard();
if (dashboard != null)
{
IVivaDashboard dashboard = pnpContext.Web.GetVivaDashboard();
var aceToRemove = Identity.GetACE(dashboard, this);

if (aceToRemove != null)
{
dashboard.RemoveACE(aceToRemove.InstanceId);
Expand All @@ -30,8 +29,8 @@ protected override void ExecuteCmdlet()
}
else
{
LogWarning("Connected site is not a home site");
LogError("Dashboard not found");
Comment thread
gautamdsheth marked this conversation as resolved.
Resolved
}
}
}
}
}
9 changes: 3 additions & 6 deletions src/Commands/Viva/SetVivaConnectionsDashboardACE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,10 @@ public class SetVivaConnectionsACE : PnPWebCmdlet
protected override void ExecuteCmdlet()
{
var pnpContext = Connection.PnPContext;
if (pnpContext.Site.IsHomeSite())
IVivaDashboard dashboard = pnpContext.Web.GetVivaDashboard();
if (dashboard != null)
{
IVivaDashboard dashboard = pnpContext.Web.GetVivaDashboard();

var aceToUpdate = Identity.GetACE(dashboard, this);

if (aceToUpdate != null)
{
bool updateRequired = false;
Expand Down Expand Up @@ -105,7 +103,6 @@ protected override void ExecuteCmdlet()
}

dashboard.Save();

dashboard = pnpContext.Web.GetVivaDashboard();
WriteObject(dashboard, true);
}
Expand All @@ -117,7 +114,7 @@ protected override void ExecuteCmdlet()
}
else
{
LogWarning("Connected site is not a home site");
LogError("Dashboard not found");
Comment thread
gautamdsheth marked this conversation as resolved.
Resolved
}
}
}
Expand Down
Loading