-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #945 from JohnDuprey/dev
Hudu Extension
- Loading branch information
Showing
16 changed files
with
1,045 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
Modules/CippExtensions/Private/Hudu/Get-HuduFormattedBlock.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
function Get-HuduFormattedBlock ($Heading, $Body) { | ||
return @" | ||
<div class="nasa__block" style="margin-bottom: 20px;"> | ||
<header class='nasa__block-header' style="padding-top: 15px;"> | ||
<h1>$Heading</h1> | ||
</header> | ||
<div style="padding-left: 15px; padding-right: 15px; padding-bottom: 15px;"> | ||
$Body | ||
</div> | ||
</div> | ||
"@ | ||
} |
13 changes: 13 additions & 0 deletions
13
Modules/CippExtensions/Private/Hudu/Get-HuduFormattedField.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function Get-HuduFormattedField ($Title, $Value) { | ||
return @" | ||
<div class="card__item"> | ||
<div class="card__item-slot"> | ||
$Title | ||
</div> | ||
<div class="card__item-slot"> | ||
$Value | ||
</div> | ||
</div> | ||
"@ | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function Get-HuduLinkBlock($URL, $Icon, $Title) { | ||
return "<div class='o365__app' style='text-align:center'><a href=$URL target=_blank><h3><i class=`"$Icon`"> </i>$Title</h3></a></div>" | ||
} |
28 changes: 28 additions & 0 deletions
28
Modules/CippExtensions/Public/Extension Functions/Add-HuduAssetLayoutM365Field.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
function Add-HuduAssetLayoutM365Field { | ||
Param( | ||
$AssetLayoutId | ||
) | ||
|
||
$M365Field = @{ | ||
position = 0 | ||
label = 'Microsoft 365' | ||
field_type = 'RichText' | ||
show_in_list = $false | ||
required = $false | ||
expiration = $false | ||
} | ||
|
||
$AssetLayout = Get-HuduAssetLayouts -LayoutId $AssetLayoutId | ||
|
||
if ($AssetLayout.fields.label -contains 'Microsoft 365') { | ||
return $AssetLayout | ||
} | ||
|
||
$AssetLayoutFields = [System.Collections.Generic.List[object]]::new() | ||
$AssetLayoutFields.Add($M365Field) | ||
foreach ($Field in $AssetLayout.fields) { | ||
$Field.position++ | ||
$AssetLayoutFields.Add($Field) | ||
} | ||
Set-HuduAssetLayout -Id $AssetLayoutId -Fields $AssetLayoutFields | ||
} |
14 changes: 14 additions & 0 deletions
14
Modules/CippExtensions/Public/Extension Functions/Get-ExtensionCacheData.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
function Get-ExtensionCacheData { | ||
param( | ||
$TenantFilter | ||
) | ||
|
||
$Table = Get-CIPPTable -TableName CacheExtensionSync | ||
$CacheData = Get-CIPPAzDataTableEntity @Table -Filter "PartitionKey eq '$TenantFilter'" | ||
|
||
$Return = @{} | ||
foreach ($Data in $CacheData) { | ||
$Return[$Data.RowKey] = $Data.Data | ConvertFrom-Json -ErrorAction SilentlyContinue | ||
} | ||
return [PSCustomObject]$Return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,4 @@ function Get-HuduMapping { | |
|
||
return $MappingObj | ||
|
||
} | ||
} |
Oops, something went wrong.