Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Fix: Modern page text alignment issue #2469

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public override TokenParser ProvisionObjects(Web web, ProvisioningTemplate templ

// Write page level status messages, needed in case many pages are provisioned
currentPageIndex++;
WriteSubProgress("ClientSidePage",$"Create {pageName} stub",currentPageIndex,template.ClientSidePages.Count);
WriteSubProgress("ClientSidePage", $"Create {pageName} stub", currentPageIndex, template.ClientSidePages.Count);

url = UrlUtility.Combine(web.ServerRelativeUrl, url);

Expand Down Expand Up @@ -216,7 +216,7 @@ public override TokenParser ProvisionObjects(Web web, ProvisioningTemplate templ

page.PageHeader.LayoutType = (Pages.ClientSidePageHeaderLayoutType)Enum.Parse(typeof(ClientSidePageHeaderLayoutType), clientSidePage.Header.LayoutType.ToString());
#if !SP2019
page.PageHeader.TextAlignment = (Pages.ClientSidePageHeaderTitleAlignment)Enum.Parse(typeof(ClientSidePageHeaderTextAlignment), clientSidePage.Header.TextAlignment.ToString());
page.PageHeader.TextAlignment = (Pages.ClientSidePageHeaderTitleAlignment)Enum.Parse(typeof(Pages.ClientSidePageHeaderTitleAlignment), clientSidePage.Header.TextAlignment.ToString());
page.PageHeader.ShowTopicHeader = clientSidePage.Header.ShowTopicHeader;
page.PageHeader.ShowPublishDate = clientSidePage.Header.ShowPublishDate;
page.PageHeader.TopicHeader = clientSidePage.Header.TopicHeader;
Expand Down Expand Up @@ -690,4 +690,4 @@ public override bool WillExtract(Web web, ProvisioningTemplate template, Provisi
}
}
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class ClientSidePageContentsHelper
public void ExtractClientSidePage(Web web, ProvisioningTemplate template, ProvisioningTemplateCreationInformation creationInfo, PnPMonitoredScope scope, string pageUrl, string pageName, bool isHomePage, bool isTemplate = false)
{
bool excludeAuthorInformation = false;
if(creationInfo.ExtractConfiguration != null && creationInfo.ExtractConfiguration.Pages != null)
if (creationInfo.ExtractConfiguration != null && creationInfo.ExtractConfiguration.Pages != null)
{
excludeAuthorInformation = creationInfo.ExtractConfiguration.Pages.ExcludeAuthorInformation;
}
Expand Down Expand Up @@ -77,7 +77,7 @@ public void ExtractClientSidePage(Web web, ProvisioningTemplate template, Provis

if (pageToExtract.PageHeader != null)
{

var extractedHeader = new ClientSidePageHeader()
{
Type = (ClientSidePageHeaderType)Enum.Parse(typeof(Pages.ClientSidePageHeaderType), pageToExtract.PageHeader.Type.ToString()),
Expand All @@ -86,7 +86,7 @@ public void ExtractClientSidePage(Web web, ProvisioningTemplate template, Provis
TranslateY = pageToExtract.PageHeader.TranslateY,
LayoutType = (ClientSidePageHeaderLayoutType)Enum.Parse(typeof(Pages.ClientSidePageHeaderLayoutType), pageToExtract.PageHeader.LayoutType.ToString()),
#if !SP2019
TextAlignment = (ClientSidePageHeaderTextAlignment)Enum.Parse(typeof(Pages.ClientSidePageHeaderTitleAlignment), pageToExtract.PageHeader.TextAlignment.ToString()),
TextAlignment = (ClientSidePageHeaderTextAlignment)Enum.Parse(typeof(ClientSidePageHeaderTextAlignment), pageToExtract.PageHeader.TextAlignment.ToString()),
ShowTopicHeader = pageToExtract.PageHeader.ShowTopicHeader,
ShowPublishDate = pageToExtract.PageHeader.ShowPublishDate,
TopicHeader = pageToExtract.PageHeader.TopicHeader,
Expand Down Expand Up @@ -488,7 +488,7 @@ public void ExtractClientSidePage(Web web, ProvisioningTemplate template, Provis
}
}

#region Helper methods
#region Helper methods
private static void CollectImageFilesFromGenericGuids(Regex regexGuidPattern, Regex regexGuidPatternEncoded, string jsonControlData, List<Guid> fileGuids)
{
// grab all the guids in the already tokenized json and check try to get them as a file
Expand Down Expand Up @@ -744,7 +744,7 @@ private string TokenizeJsonTextData(Web web, string json)

return json;
}
#endregion
#endregion
}
#endif
}
}