diff --git a/documentation/Add-PnPVivaConnectionsDashboardACE.md b/documentation/Add-PnPVivaConnectionsDashboardACE.md index 6509dade3c..25a728d8a0 100644 --- a/documentation/Add-PnPVivaConnectionsDashboardACE.md +++ b/documentation/Add-PnPVivaConnectionsDashboardACE.md @@ -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 site or Communication site and have configured the Viva connections page. ## SYNTAX @@ -20,7 +20,7 @@ Add-PnPVivaConnectionsDashboardACE [-Identity ] [-Title ] [- ## 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 you to add a new Adaptive card extension in the Viva Connections dashboard page. Before running the command, you must be connected to a SharePoint Team site or Communication site and have configured the Viva connections page. ## EXAMPLES diff --git a/documentation/Get-PnPVivaConnectionsDashboardACE.md b/documentation/Get-PnPVivaConnectionsDashboardACE.md index fe702c523a..e557c300df 100644 --- a/documentation/Get-PnPVivaConnectionsDashboardACE.md +++ b/documentation/Get-PnPVivaConnectionsDashboardACE.md @@ -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 site or Communication site and have configured the Viva connections page. ## SYNTAX diff --git a/documentation/Remove-PnPVivaConnectionsDashboardACE.md b/documentation/Remove-PnPVivaConnectionsDashboardACE.md index ff55d59f31..13005a3eb4 100644 --- a/documentation/Remove-PnPVivaConnectionsDashboardACE.md +++ b/documentation/Remove-PnPVivaConnectionsDashboardACE.md @@ -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 site or Communication site and have configured the Viva connections page. ## SYNTAX diff --git a/documentation/Set-PnPVivaConnectionsDashboardACE.md b/documentation/Set-PnPVivaConnectionsDashboardACE.md index bafe60c283..8f89bd277b 100644 --- a/documentation/Set-PnPVivaConnectionsDashboardACE.md +++ b/documentation/Set-PnPVivaConnectionsDashboardACE.md @@ -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 site or Communication site and have configured the Viva Connections page. ## SYNTAX diff --git a/src/Commands/Viva/AddVivaConnectionsDashboardACE.cs b/src/Commands/Viva/AddVivaConnectionsDashboardACE.cs index ca3b1eec94..0ec44b7c74 100644 --- a/src/Commands/Viva/AddVivaConnectionsDashboardACE.cs +++ b/src/Commands/Viva/AddVivaConnectionsDashboardACE.cs @@ -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))) @@ -70,7 +69,7 @@ protected override void ExecuteCmdlet() } else { - LogWarning("Connected site is not a home site"); + LogError("Viva Connections dashboard not found. Create or configure the Viva Connections dashboard page (Dashboard.aspx) on the connected SharePoint Team site or Communication site."); } } } diff --git a/src/Commands/Viva/GetVivaConnectionsDashboardACE.cs b/src/Commands/Viva/GetVivaConnectionsDashboardACE.cs index c2d2033b9a..7901994a39 100644 --- a/src/Commands/Viva/GetVivaConnectionsDashboardACE.cs +++ b/src/Commands/Viva/GetVivaConnectionsDashboardACE.cs @@ -13,30 +13,29 @@ public class GetVivaConnectionsDashboard : 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(); + LogError("Viva Connections dashboard not found. Create or configure the Viva Connections dashboard page (Dashboard.aspx) on the connected SharePoint Team site or Communication site."); + return; + } - if (ParameterSpecified(nameof(Identity))) + if (ParameterSpecified(nameof(Identity))) + { + var aceToRetrieve = Identity.GetACE(dashboard, this); + if (aceToRetrieve != null) { - 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); } } } diff --git a/src/Commands/Viva/RemoveVivaConnectionsDashboardACE.cs b/src/Commands/Viva/RemoveVivaConnectionsDashboardACE.cs index 28e175c265..958a2dc3be 100644 --- a/src/Commands/Viva/RemoveVivaConnectionsDashboardACE.cs +++ b/src/Commands/Viva/RemoveVivaConnectionsDashboardACE.cs @@ -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); @@ -30,8 +29,8 @@ protected override void ExecuteCmdlet() } else { - LogWarning("Connected site is not a home site"); + LogError("Viva Connections dashboard not found. Create or configure the Viva Connections dashboard page (Dashboard.aspx) on the connected SharePoint Team site or Communication site."); } } } -} +} \ No newline at end of file diff --git a/src/Commands/Viva/SetVivaConnectionsDashboardACE.cs b/src/Commands/Viva/SetVivaConnectionsDashboardACE.cs index 8b836644d8..ff4c836e54 100644 --- a/src/Commands/Viva/SetVivaConnectionsDashboardACE.cs +++ b/src/Commands/Viva/SetVivaConnectionsDashboardACE.cs @@ -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; @@ -105,7 +103,6 @@ protected override void ExecuteCmdlet() } dashboard.Save(); - dashboard = pnpContext.Web.GetVivaDashboard(); WriteObject(dashboard, true); } @@ -117,7 +114,7 @@ protected override void ExecuteCmdlet() } else { - LogWarning("Connected site is not a home site"); + LogError("Viva Connections dashboard not found. Create or configure the Viva Connections dashboard page (Dashboard.aspx) on the connected SharePoint Team site or Communication site."); } } }