Add Portal Settings Web Part with styles, localization, and tests

- Implemented the PortalSettings Web Part with a new manifest and TypeScript file.
- Created SCSS styles for the Web Part, defining various UI elements and responsive design.
- Added localization support for English and German languages.
- Developed tests for Provider Registry and static assets validation.
- Included PowerShell script for project validation.
This commit is contained in:
Torsten Brendgen
2026-07-21 22:43:35 +02:00
parent 62fef65c12
commit 10f7463094
49 changed files with 2411 additions and 462 deletions

View File

@@ -0,0 +1,55 @@
param(
[Parameter(Mandatory = $true)]
[string]$SiteUrl,
[string]$PageName = 'PortalSettingsV3',
[switch]$Publish
)
$ErrorActionPreference = 'Stop'
$componentId = 'c41d05ec-0682-4af0-b807-649806ed56b3'
if (-not (Get-Command Connect-PnPOnline -ErrorAction SilentlyContinue)) {
throw 'PnP PowerShell wurde nicht gefunden. Bitte das zur SharePoint-SE-Umgebung passende PnP-Modul laden.'
}
Connect-PnPOnline -Url $SiteUrl -CurrentCredentials
$pageFileName = if ($PageName.EndsWith('.aspx', [StringComparison]::OrdinalIgnoreCase)) { $PageName } else { $PageName + '.aspx' }
$pageIdentity = $pageFileName.Substring(0, $pageFileName.Length - 5)
$page = Get-PnPClientSidePage -Identity $pageFileName -ErrorAction SilentlyContinue
if (-not $page) {
Write-Host "Erstelle moderne Seite $pageFileName ..." -ForegroundColor Yellow
$page = Add-PnPClientSidePage -Name $pageIdentity -LayoutType Article
}
else {
Write-Host "Verwende vorhandene moderne Seite $pageFileName." -ForegroundColor Yellow
}
$existingControl = @($page.Controls | Where-Object {
$_.WebPartId -and $_.WebPartId.ToString().Equals($componentId, [StringComparison]::OrdinalIgnoreCase)
}) | Select-Object -First 1
if (-not $existingControl) {
if (-not $page.Sections -or $page.Sections.Count -eq 0) {
Add-PnPClientSidePageSection -Page $page -SectionTemplate OneColumn -Order 1 | Out-Null
}
$component = Get-PnPAvailableClientSideComponents -Page $page | Where-Object {
$_.Id.ToString().Equals($componentId, [StringComparison]::OrdinalIgnoreCase)
} | Select-Object -First 1
if (-not $component) {
throw 'Das Portal Settings V3 WebPart ist nicht verfügbar. Ist die App im Root Web installiert beziehungsweise aktualisiert?'
}
Add-PnPClientSideWebPart -Page $page -Component $component -Section 1 -Column 1 -Order 1 | Out-Null
Write-Host 'Portal Settings WebPart wurde hinzugefügt.' -ForegroundColor Green
}
else {
Write-Host 'Portal Settings WebPart ist bereits vorhanden.' -ForegroundColor Green
}
$page.Save()
if ($Publish) { $page.Publish() }
Write-Host ("Fertig: " + $SiteUrl.TrimEnd('/') + '/SitePages/' + $pageFileName) -ForegroundColor Green