Skip to content

Commit

Permalink
3.1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Micke-K committed Jul 12, 2021
1 parent 06688e7 commit fb46337
Show file tree
Hide file tree
Showing 31 changed files with 890 additions and 165 deletions.
13 changes: 8 additions & 5 deletions Core.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This module handles the WPF UI

function Get-ModuleVersion
{
'3.1.3'
'3.1.4'
}

function Start-CoreApp
Expand Down Expand Up @@ -914,14 +914,17 @@ function Add-SettingCheckBox

function Add-SettingComboBox
{
param($id, $value, $itemsData)
param($id, $value, $settingObj)

$nameProp = ?? $settingObj.DisplayMemberPath "Name"
$valueProp = ?? $settingObj.SelectedValuePath "Value"

$xaml = @"
<ComboBox $wpfNS Name="$($id)" DisplayMemberPath="Name" SelectedValuePath="ClientId" />
<ComboBox $wpfNS Name="$($id)" DisplayMemberPath="$($nameProp)" SelectedValuePath="$($valueProp)" />
"@
$xamlObj = [Windows.Markup.XamlReader]::Parse($xaml)

$xamlObj.ItemsSource = $itemsData
$xamlObj.ItemsSource = $settingObj.ItemsSource
if($value)
{
$xamlObj.SelectedValue = $value
Expand Down Expand Up @@ -979,7 +982,7 @@ function Add-SettingValue
}
elseif($settingValue.Type -eq "List")
{
$settingObj = Add-SettingComboBox $id $value $settingValue.ItemsSource
$settingObj = Add-SettingComboBox $id $value $settingValue
}
else
{
Expand Down
Binary file modified Documentation/Strings-cs.json
Binary file not shown.
Binary file modified Documentation/Strings-de.json
Binary file not shown.
Binary file modified Documentation/Strings-en.json
Binary file not shown.
Binary file modified Documentation/Strings-es.json
Binary file not shown.
Binary file modified Documentation/Strings-fr.json
Binary file not shown.
Binary file modified Documentation/Strings-hu.json
Binary file not shown.
Binary file modified Documentation/Strings-it.json
Binary file not shown.
Binary file modified Documentation/Strings-ja.json
Binary file not shown.
Binary file modified Documentation/Strings-ko.json
Binary file not shown.
Binary file modified Documentation/Strings-nl.json
Binary file not shown.
Binary file modified Documentation/Strings-pl.json
Binary file not shown.
Binary file modified Documentation/Strings-pt.json
Binary file not shown.
Binary file modified Documentation/Strings-ru.json
Binary file not shown.
Binary file modified Documentation/Strings-sv.json
Binary file not shown.
Binary file modified Documentation/Strings-tr.json
Binary file not shown.
Binary file modified Documentation/Strings-zh-chs.json
Binary file not shown.
Binary file modified Documentation/Strings-zh-cht.json
Binary file not shown.
Binary file modified Documentation/Strings-zh-hans.json
Binary file not shown.
Binary file modified Documentation/Strings-zh-hant.json
Binary file not shown.
Binary file modified Documentation/Strings-zh.json
Binary file not shown.
18 changes: 3 additions & 15 deletions Extensions/Compare.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Objects can be compared based on Properties or Documentatation info.

function Get-ModuleVersion
{
'1.0.4'
'1.0.5'
}

function Invoke-InitializeModule
Expand Down Expand Up @@ -370,14 +370,8 @@ function Invoke-BulkCompareNamedObjects
Write-Log "----------------------------------------------------------------"
Write-Log "Compare $($item.ObjectType.Title) objects"
Write-Log "----------------------------------------------------------------"

$url = $item.ObjectType.API
if($item.ObjectType.QUERYLIST)
{
$url = "$($url.Trim())?$($item.ObjectType.QUERYLIST.Trim())"
}

$graphObjects = @(Get-GraphObjects -Url $url -property $item.ObjectType.ViewProperties -objectType $item.ObjectType)
$graphObjects = @(Get-GraphObjects -property $item.ObjectType.ViewProperties -objectType $item.ObjectType)

$nameProp = ?? $item.ObjectType.NameProperty "displayName"

Expand Down Expand Up @@ -512,14 +506,8 @@ function Start-BulkCompareExportObjects
if([IO.Directory]::Exists($folder))
{
Save-Setting "" "LastUsedFullPath" $folder

$url = $item.ObjectType.API
if($item.ObjectType.QUERYLIST)
{
$url = "$($url.Trim())?$($item.ObjectType.QUERYLIST.Trim())"
}

$graphObjects = @(Get-GraphObjects -Url $url -property $item.ObjectType.ViewProperties -objectType $item.ObjectType)
$graphObjects = @(Get-GraphObjects -property $item.ObjectType.ViewProperties -objectType $item.ObjectType)

foreach ($fileObj in @(Get-GraphFileObjects $folder -ObjectType $item.ObjectType))
{
Expand Down
10 changes: 2 additions & 8 deletions Extensions/Copy.psm1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function Get-ModuleVersion
{
'1.0.0'
'1.0.1'
}

function Invoke-InitializeModule
Expand Down Expand Up @@ -105,14 +105,8 @@ function Start-BulkCopyObjects
Write-Log "----------------------------------------------------------------"
Write-Log "Copy $($item.ObjectType.Title) objects"
Write-Log "----------------------------------------------------------------"

$url = $item.ObjectType.API
if($item.ObjectType.QUERYLIST)
{
$url = "$($url.Trim())?$($item.ObjectType.QUERYLIST.Trim())"
}

$graphObjects = @(Get-GraphObjects -Url $url -property $item.ObjectType.ViewProperties -objectType $item.ObjectType)
$graphObjects = @(Get-GraphObjects -property $item.ObjectType.ViewProperties -objectType $item.ObjectType)

$nameProp = ?? $item.ObjectType.NameProperty "displayName"

Expand Down
10 changes: 2 additions & 8 deletions Extensions/Documentation.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $global:documentationProviders = @()

function Get-ModuleVersion
{
'1.0.3'
'1.0.4'
}

function Invoke-InitializeModule
Expand Down Expand Up @@ -3281,14 +3281,8 @@ function Show-DocumentationForm
foreach($objectType in ($global:currentViewObject.ViewItems | Where GroupId -eq $objGroup.GroupId))
{
Write-Status "Get $($objectType.Title) objects"

$url = $objectType.API
if($objectType.QUERYLIST)
{
$url = "$($url.Trim())?$($objectType.QUERYLIST.Trim())"
}

$graphObjects = @(Get-GraphObjects -Url $url -property $objectType.ViewProperties -objectType $objectType)
$graphObjects = @(Get-GraphObjects -property $objectType.ViewProperties -objectType $objectType)

if($objectType.PostListCommand)
{
Expand Down
173 changes: 172 additions & 1 deletion Extensions/DocumentationCustom.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This module will also document some objects based on PowerShell functions

function Get-ModuleVersion
{
'1.0.2'
'1.0.3'
}

function Invoke-InitializeModule
Expand Down Expand Up @@ -85,6 +85,13 @@ function Invoke-CDDocumentObject
return [PSCustomObject]@{
Properties = @("Name","Value","Category","SubCategory")
}
}
elseif($type -eq '#microsoft.graph.notificationMessageTemplate')
{
Invoke-CDDocumentNotification $documentationObj
return [PSCustomObject]@{
Properties = @("Name","Value","Category","SubCategory")
}
}
}

Expand Down Expand Up @@ -2155,7 +2162,9 @@ function Get-CDDocumentPolicySetValue
}
# ToDo: Add support for all PolicySet items
}
#endregion

#region Custom Profile
function Invoke-CDDocumentCustomOMAUri
{
param($documentationObj)
Expand Down Expand Up @@ -2264,6 +2273,168 @@ function Invoke-CDDocumentCustomOMAUri
})
}
}
}
#endregion

#region Notification
function Invoke-CDDocumentNotification
{
param($documentationObj)

$obj = $documentationObj.Object
$objectType = $documentationObj.ObjectType

$script:objectSeparator = ?? $global:cbDocumentationObjectSeparator.SelectedValue ([System.Environment]::NewLine)
$script:propertySeparator = ?? $global:cbDocumentationPropertySeparator.SelectedValue ","

###################################################
# Basic info
###################################################

Add-BasicDefaultValues $obj $objectType

Add-BasicPropertyValue (Get-LanguageString "TableHeaders.configurationType") (Get-LanguageString "Titles.notifications")

###################################################
# Settings
###################################################

$category = Get-LanguageString "TableHeaders.settings"

if($obj.brandingOptions)
{
$brandingOptions = $obj.brandingOptions.Split(',')
}
else
{
$brandingOptions = @()
}

foreach($brandingOption in @('includeCompanyLogo','includeCompanyName','includeContactInformation','includeCompanyPortalLink'))
{
if($brandingOption -eq 'includeCompanyLogo')
{
$label = (Get-LanguageString "NotificationMessage.companyLogo")
}
elseif($brandingOption -eq 'includeCompanyName')
{
$label = (Get-LanguageString "NotificationMessage.companyName")
}
elseif($brandingOption -eq 'includeContactInformation')
{
$label = (Get-LanguageString "NotificationMessage.companyContact")
}
elseif($brandingOption -eq 'includeCompanyPortalLink')
{
$label = (Get-LanguageString "NotificationMessage.iwLink")
}

if(($brandingOption -in $brandingOptions))
{
$value = Get-LanguageString "BooleanActions.enable"
}
else
{
$value = Get-LanguageString "BooleanActions.disable"
}

Add-CustomSettingObject ([PSCustomObject]@{
Name = $label
Value = $value
EntityKey = $brandingOption
Category = $category
SubCategory = $null
})
}

#$subCategory = Get-LanguageString "NotificationMessage.localeLabel"
$subCategory = Get-LanguageString "NotificationMessage.listTitle"

foreach($template in $obj.localizedNotificationMessages)
{
$first,$second = $template.locale.Split('-')
$baseInfo = [cultureinfo]$first
$lng = $baseInfo.EnglishName.ToLower()
if($first -eq 'en')
{
if($second -eq "US")
{
$lng = ($lng + "US")
}
elseif($second -eq "GB")
{
$lng = ($lng + "UK")
}
}
elseif($first -eq 'es')
{
if($second -eq "es")
{
$lng = ($lng + "Spain")
}
elseif($second -eq "mx")
{
$lng = ($lng + "Mexico")
}
}
elseif($first -eq 'fr')
{
if($second -eq "ca")
{
$lng = ($lng + "Canada")
}
elseif($second -eq "fr")
{
$lng = ($lng + "France")
}
}
elseif($first -eq 'pt')
{
if($second -eq "pt")
{
$lng = ($lng + "Portugal")
}
elseif($second -eq "br")
{
$lng = ($lng + "Brazil")
}
}
elseif($first -eq 'zh')
{
if($second -eq "tw")
{
$lng = ($lng + "Traditional")
}
elseif($second -eq "cn")
{
$lng = ($lng + "Simplified")
}
}
elseif($first -eq 'nb')
{
$lng = "norwegian"
}

$label = Get-LanguageString "NotificationMessage.NotificationMessageTemplatesTab.$lng"

if(-not $label) { continue }

$value = $template.subject

if($template.isDefault)
{
$value = ($value + $script:objectSeparator + (Get-LanguageString "NotificationMessage.isDefaultLocale") + ": " + (Get-LanguageString "SettingDetails.trueOption"))
}

$fullValue = ($value + $script:objectSeparator + $template.messageTemplate)

Add-CustomSettingObject ([PSCustomObject]@{
Name = $label
Value = $fullValue
EntityKey = $template.locale
Category = $category
SubCategory = $subCategory
})
}
}
#endregion
Loading

0 comments on commit fb46337

Please sign in to comment.