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

567 simple #613

Merged
merged 7 commits into from
Jan 25, 2022
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

Every change is marked with issue ID.

## 1.3.2 - 07.01.2022
## 1.3.2 - 25.01.2022

### Added

Expand All @@ -13,6 +13,7 @@ Every change is marked with issue ID.
### Changed

- Added support for syncing number and currency fields in project properties
- Added fix for not resetting portfolio navigation on upgrade #567
- Reformulated GtShowInPorfolio description to encompass more than uncertainties #615
- Changed behavior when deleting a status report #597
- Changed behavior when deleting timeline item #569
Expand Down
34 changes: 27 additions & 7 deletions Install/Install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -329,20 +329,24 @@ if (-not $SkipTemplate.IsPresent) {
Apply-PnPProvisioningTemplate "$BasePath\Taxonomy.pnp" -ErrorAction Stop
Write-Host "[SUCCESS] Successfully applied PnP template [Taxonomy] to [$Url]" -ForegroundColor Green
}

Write-Host "[INFO] Applying PnP template [Portfolio] to [$Url]"
$Instance = Read-PnPProvisioningTemplate "$BasePath\Portfolio.pnp"
$Instance.SupportedUILanguages[0].LCID = $LanguageId
Apply-PnPProvisioningTemplate -InputInstance $Instance -Handlers SupportedUILanguages
Apply-PnPProvisioningTemplate "$BasePath\Portfolio.pnp" -ExcludeHandlers SupportedUILanguages -ErrorAction Stop
Write-Host "[SUCCESS] Successfully applied PnP template [Portfolio] to [$Url]" -ForegroundColor Green

if ($Upgrade.IsPresent) {
Write-Host "[INFO] Applying PnP template [Portfolio] to [$Url]"
Apply-PnPProvisioningTemplate "$BasePath\Portfolio.pnp" -ExcludeHandlers Navigation -ErrorAction Stop
Write-Host "[SUCCESS] Successfully applied PnP template [Portfolio] to [$Url]" -ForegroundColor Green

Write-Host "[INFO] Applying PnP content template (Handlers:Files) to [$Url]"
Apply-PnPProvisioningTemplate "$BasePath\Portfolio_content.$LanguageCode.pnp" -Handlers Files -ErrorAction Stop
Write-Host "[SUCCESS] Successfully applied PnP content template to [$Url]" -ForegroundColor Green
}
else {
Write-Host "[INFO] Applying PnP template [Portfolio] to [$Url]"
$Instance = Read-PnPProvisioningTemplate "$BasePath\Portfolio.pnp"
$Instance.SupportedUILanguages[0].LCID = $LanguageId
Apply-PnPProvisioningTemplate -InputInstance $Instance -Handlers SupportedUILanguages
Apply-PnPProvisioningTemplate "$BasePath\Portfolio.pnp" -ExcludeHandlers SupportedUILanguages -ErrorAction Stop
Write-Host "[SUCCESS] Successfully applied PnP template [Portfolio] to [$Url]" -ForegroundColor Green

Write-Host "[INFO] Applying PnP content template to [$Url]"
Apply-PnPProvisioningTemplate "$BasePath\Portfolio_content.$LanguageCode.pnp" -ErrorAction Stop
Write-Host "[SUCCESS] Successfully applied PnP content template to [$Url]" -ForegroundColor Green
Expand Down Expand Up @@ -402,6 +406,22 @@ catch {
Write-Host "[WARNING] Failed to run post-install steps: $($_.Exception.Message)" -ForegroundColor Yellow
}

if ($Upgrade.IsPresent) {
try {
$LastInstall = Get-PnPListItem -List "Installasjonslogg" -Query "<View><Query><OrderBy><FieldRef Name='Created' Ascending='False' /></OrderBy></Query></View>" | Select-Object -First 1
if ($null -ne $LastInstall) {
$PreviousVersion = $LastInstall.FieldValues["InstallVersion"]

if ($PreviousVersion -lt "1.2.7") {
Write-Host "[INFO] In version v1.2.7 we added 'Prosjekttidslinje' to the top navigation. Adding this navigation item now as part of the upgrade"
Add-PnPNavigationNode -Location TopNavigationBar -Title "Prosjekttidslinje" -Url "$($Uri.LocalPath)/SitePages/Prosjekttidslinje.aspx"
}
}
}
catch {
Write-Host "[WARNING] Failed to run upgrade steps: $($_.Exception.Message)" -ForegroundColor Yellow
}
}

$sw.Stop()

Expand Down