Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: add ListsShowHeaderAndNavigation property to PnPTenantSite and PnPSite cmdlets #3233

Merged
Show file tree
Hide file tree
Changes from all commits
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
15 changes: 15 additions & 0 deletions documentation/Set-PnPSite.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Set-PnPSite [-Identity <String>]
[-ScriptSafeDomainName <string>]
[-BlockDownloadPolicy <Boolean>] [-ExcludeBlockDownloadPolicySiteOwners <Boolean>]
[-ExcludedBlockDownloadGroupIds <Guid[]>]
[-ListsShowHeaderAndNavigation <Boolean>]
[-Connection <PnPConnection>]
```

Expand Down Expand Up @@ -584,6 +585,20 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -ListsShowHeaderAndNavigation
Set a property on a site collection to make all lists always load with the site elements intact.

```yaml
Type: Boolean
Parameter Sets: Set Properties

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Wait
Wait for the operation to complete

Expand Down
15 changes: 15 additions & 0 deletions documentation/Set-PnPTenantSite.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Set-PnPTenantSite [-Identity] <String> [-Title <String>] [-LocaleId <UInt32>] [-
[-MediaTranscription <MediaTranscriptionPolicyType>]
[-BlockDownloadPolicy <Boolean>] [-ExcludeBlockDownloadPolicySiteOwners <Boolean>]
[-ExcludedBlockDownloadGroupIds <Guid[]>]
[-ListsShowHeaderAndNavigation <Boolean>]
[-Wait]
[-Connection <PnPConnection>]
```
Expand Down Expand Up @@ -722,6 +723,20 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -ListsShowHeaderAndNavigation
Set a property on a site collection to make all lists always load with the site elements intact.

```yaml
Type: Boolean
Parameter Sets: Set Properties

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Wait
Wait for the operation to complete

Expand Down
9 changes: 9 additions & 0 deletions src/Commands/Admin/SetTenantSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ public class SetTenantSite : PnPAdminCmdlet
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
public Guid[] ExcludedBlockDownloadGroupIds;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
public bool? ListsShowHeaderAndNavigation;

[Parameter(Mandatory = false)]
public SwitchParameter Wait;

Expand Down Expand Up @@ -528,6 +531,12 @@ private void SetSiteProperties(Func<TenantOperationMessage, bool> timeoutFunctio
updateRequired = true;
}

if (ParameterSpecified(nameof(ListsShowHeaderAndNavigation)) && ListsShowHeaderAndNavigation.HasValue)
{
props.ListsShowHeaderAndNavigation = ListsShowHeaderAndNavigation.Value;
updateRequired = true;
}

if (updateRequired)
{
var op = props.Update();
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Base/ConnectOnline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ private static bool PingHost(string nameOrAddress)
}
return false;
}
catch(Exception ex)
catch
{
return false;
}
Expand Down
12 changes: 11 additions & 1 deletion src/Commands/Site/SetSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ public class SetSite : PnPSharePointCmdlet
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
public Guid[] ExcludedBlockDownloadGroupIds;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
public bool? ListsShowHeaderAndNavigation;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_LOCKSTATE)]
public SwitchParameter Wait;

Expand Down Expand Up @@ -397,6 +400,12 @@ protected override void ExecuteCmdlet()
executeQueryRequired = true;
}

if (ParameterSpecified(nameof(ListsShowHeaderAndNavigation)) && ListsShowHeaderAndNavigation.HasValue)
{
siteProperties.ListsShowHeaderAndNavigation = ListsShowHeaderAndNavigation.Value;
executeQueryRequired = true;
}

if (executeQueryRequired)
{
siteProperties.Update();
Expand Down Expand Up @@ -451,6 +460,7 @@ private bool IsTenantProperty() =>
RequestFilesLinkEnabled.HasValue ||
BlockDownloadPolicy.HasValue ||
ExcludeBlockDownloadPolicySiteOwners.HasValue ||
ParameterSpecified(nameof(ExcludedBlockDownloadGroupIds));
ParameterSpecified(nameof(ExcludedBlockDownloadGroupIds)) ||
ListsShowHeaderAndNavigation.HasValue;
}
}