feat: add ExpiryIndicatorClassic functionality with configuration and rendering
- Implemented ExpiryIndicatorClassic.js for managing expiry dates in SharePoint lists. - Created classic-elements.xml to define the module for ExpiryIndicator assets. - Added upgrade-actions-v2.xml to apply the new element manifests. - Introduced ExpiryModels.test.ts for unit testing the expiry configuration and rules validation.
This commit is contained in:
@@ -22,8 +22,10 @@ $context.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
|
||||
try {
|
||||
$list = $context.Web.Lists.GetByTitle($ListTitle)
|
||||
$field = $list.Fields.GetByInternalNameOrTitle($ExpiryFieldInternalName)
|
||||
$customActions = $list.UserCustomActions
|
||||
$context.Load($list)
|
||||
$context.Load($field)
|
||||
$context.Load($customActions)
|
||||
$context.ExecuteQuery()
|
||||
|
||||
if ($field.ClientSideComponentId -ne $FieldCustomizerComponentId) {
|
||||
@@ -34,8 +36,16 @@ try {
|
||||
$field.ClientSideComponentId = [Guid]::Empty
|
||||
$field.ClientSideComponentProperties = ''
|
||||
$field.Update()
|
||||
|
||||
$customActions | Where-Object {
|
||||
$_.Name -eq 'ExpiryIndicator.Classic.ScriptLink' -or
|
||||
$_.Name -eq 'ExpiryIndicator.Classic.Ribbon'
|
||||
} | ForEach-Object {
|
||||
$_.DeleteObject()
|
||||
}
|
||||
|
||||
$context.ExecuteQuery()
|
||||
Write-Host 'ExpiryIndicator-Verknüpfung wurde entfernt. Feld und Daten bleiben unverändert.'
|
||||
Write-Host 'ExpiryIndicator-Verknüpfung und Classic-Registrierungen wurden entfernt. Feld und Daten bleiben unverändert.'
|
||||
}
|
||||
}
|
||||
finally {
|
||||
|
||||
Reference in New Issue
Block a user