From 2091bc45bdccd3c3f5a27f059ffbdfeb72fbf245 Mon Sep 17 00:00:00 2001 From: Torsten Brendgen Date: Fri, 17 Jul 2026 23:56:59 +0200 Subject: [PATCH] =?UTF-8?q?Aktualisiere=20Versionsnummern=20auf=201.0.11?= =?UTF-8?q?=20in=20package.json,=20package-solution.json,=20ExpiryIndicato?= =?UTF-8?q?rFieldCustomizer.manifest.json,=20ExpiryIndicatorApplicationCus?= =?UTF-8?q?tomizer.manifest.json=20und=20ExpiryIndicatorCommandSet.manifes?= =?UTF-8?q?t.json;=20verbessere=20die=20Unterst=C3=BCtzung=20f=C3=BCr=20Sh?= =?UTF-8?q?arePoint-Taxonomiewerte=20in=20der=20Logik=20zur=20Wert=C3=BCbe?= =?UTF-8?q?reinstimmung=20in=20ExpiryModels.ts=20und=20aktualisiere=20die?= =?UTF-8?q?=20README.md=20mit=20neuen=20Informationen=20zu=20Managed-Metad?= =?UTF-8?q?ata-Feldern.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 13 +++++++++++ config/package-solution.json | 4 ++-- package.json | 2 +- src/common/ExpiryModels.ts | 23 +++++++++++++++++-- ...piryIndicatorFieldCustomizer.manifest.json | 2 +- ...dicatorApplicationCustomizer.manifest.json | 2 +- .../ExpiryIndicatorCommandSet.manifest.json | 2 +- 7 files changed, 40 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 99fb01d..0840e92 100644 --- a/README.md +++ b/README.md @@ -217,6 +217,19 @@ Die Regeln werden von oben nach unten geprüft. Dabei gilt: 3. Die erste passende Regel liefert Laufzeit und Farbregeln. 4. Existiert das Feld nicht oder passt kein Wert, werden Standardlaufzeit und Standard-Farbregeln verwendet. +Bei Managed-Metadata-Feldern sollte `columnValue` die Term-GUID enthalten. SharePoint Server liefert im +REST-Ergebnis teilweise die WssId anstelle der lesbaren Bezeichnung im Feld `Label`; die Term-GUID bleibt +dagegen stabil. Der Vergleich der GUID erfolgt ohne Beachtung der Groß-/Kleinschreibung. Beispiel: + +```json +{ + "columnName": "eGovPersDat", + "columnValue": "0d19386a-ebe1-4955-ad12-164d7846bca6", + "lifeTime": { "value": 1, "unit": "years" }, + "columnRule": [] +} +``` + Nach **Speichern** wird die Konfiguration als JSON direkt in `ClientSideComponentProperties` des mit dem ExpiryIndicator gebundenen lokalen Listenfeldes gespeichert. Damit verwendet die App denselben Konfigurationsmechanismus wie andere SPFx-Extensions und benötigt keine zusätzliche Konfigurationsliste. diff --git a/config/package-solution.json b/config/package-solution.json index e25e546..36cad5a 100644 --- a/config/package-solution.json +++ b/config/package-solution.json @@ -3,7 +3,7 @@ "solution": { "name": "expiry-indicator-client-side-solution", "id": "68bb6d2d-9895-45b4-88e8-b98835faa981", - "version": "1.0.10.0", + "version": "1.0.11.0", "includeClientSideAssets": true, "skipFeatureDeployment": false, "features": [ @@ -11,7 +11,7 @@ "title": "ExpiryIndicator extension registration", "description": "Registers ExpiryIndicator commands and its settings Application Customizer. Does not provision ExpiryDate.", "id": "913402af-ab9a-4974-9f86-5c2159ae41db", - "version": "1.0.10.0", + "version": "1.0.11.0", "assets": { "elementManifests": [ "elements.xml" diff --git a/package.json b/package.json index 4684a82..4d09a17 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "expiry-indicator", - "version": "1.0.10", + "version": "1.0.11", "private": true, "engines": { "node": ">=6.9.0 <9.0.0" diff --git a/src/common/ExpiryModels.ts b/src/common/ExpiryModels.ts index 0c6b5d1..4d06b25 100644 --- a/src/common/ExpiryModels.ts +++ b/src/common/ExpiryModels.ts @@ -218,12 +218,32 @@ function valueMatches(rawValue: any, configuredValue: string): boolean { return values.some((value: any): boolean => { if (value && typeof value === 'object') { + // SharePoint taxonomy values are not consistent across REST versions. In + // SharePoint Server the Label may contain the WssId instead of the term + // label, whereas TermGuid remains stable. + if (typeof value.TermGuid === 'string' && equalsIgnoreCase(value.TermGuid, configuredValue)) { + return true; + } + return String(value.Title || value.LookupValue || value.Label || value.Value || '') === configuredValue; } - return String(value) === configuredValue; + + const textValue: string = String(value); + if (textValue === configuredValue) { + return true; + } + + // Also support serialized taxonomy values such as "Label|TermGuid" and + // "-1;#Label|TermGuid". + const separatorIndex: number = textValue.lastIndexOf('|'); + return separatorIndex >= 0 && equalsIgnoreCase(textValue.substring(separatorIndex + 1), configuredValue); }); } +function equalsIgnoreCase(left: string, right: string): boolean { + return left.toLowerCase() === right.toLowerCase(); +} + function isColumnRuleOperator(value: string): boolean { return value === 'lessThan' || value === 'lessOrEqual' || value === 'equal' || value === 'greaterOrEqual' || value === 'greaterThan'; @@ -237,4 +257,3 @@ function isColor(value: string): boolean { /^[a-zA-Z]+$/.test(value) ); } - diff --git a/src/extensions/expiryIndicator/ExpiryIndicatorFieldCustomizer.manifest.json b/src/extensions/expiryIndicator/ExpiryIndicatorFieldCustomizer.manifest.json index 22f4608..d02937f 100644 --- a/src/extensions/expiryIndicator/ExpiryIndicatorFieldCustomizer.manifest.json +++ b/src/extensions/expiryIndicator/ExpiryIndicatorFieldCustomizer.manifest.json @@ -4,7 +4,7 @@ "alias": "ExpiryIndicatorFieldCustomizer", "componentType": "Extension", "extensionType": "FieldCustomizer", - "version": "1.0.10", + "version": "1.0.11", "manifestVersion": 2, "requiresCustomScript": false } diff --git a/src/extensions/expiryIndicatorApplicationCustomizer/ExpiryIndicatorApplicationCustomizer.manifest.json b/src/extensions/expiryIndicatorApplicationCustomizer/ExpiryIndicatorApplicationCustomizer.manifest.json index e5a448d..271f106 100644 --- a/src/extensions/expiryIndicatorApplicationCustomizer/ExpiryIndicatorApplicationCustomizer.manifest.json +++ b/src/extensions/expiryIndicatorApplicationCustomizer/ExpiryIndicatorApplicationCustomizer.manifest.json @@ -4,7 +4,7 @@ "alias": "ExpiryIndicatorApplicationCustomizer", "componentType": "Extension", "extensionType": "ApplicationCustomizer", - "version": "1.0.10", + "version": "1.0.11", "manifestVersion": 2, "requiresCustomScript": false } diff --git a/src/extensions/expiryIndicatorCommandSet/ExpiryIndicatorCommandSet.manifest.json b/src/extensions/expiryIndicatorCommandSet/ExpiryIndicatorCommandSet.manifest.json index c4204a6..b3df457 100644 --- a/src/extensions/expiryIndicatorCommandSet/ExpiryIndicatorCommandSet.manifest.json +++ b/src/extensions/expiryIndicatorCommandSet/ExpiryIndicatorCommandSet.manifest.json @@ -4,7 +4,7 @@ "alias": "ExpiryIndicatorCommandSet", "componentType": "Extension", "extensionType": "ListViewCommandSet", - "version": "1.0.10", + "version": "1.0.11", "manifestVersion": 2, "requiresCustomScript": false, "items": {