Aktualisiere Versionsnummern auf 1.0.11 in package.json, package-solution.json, ExpiryIndicatorFieldCustomizer.manifest.json, ExpiryIndicatorApplicationCustomizer.manifest.json und ExpiryIndicatorCommandSet.manifest.json; verbessere die Unterstützung für SharePoint-Taxonomiewerte in der Logik zur Wertübereinstimmung in ExpiryModels.ts und aktualisiere die README.md mit neuen Informationen zu Managed-Metadata-Feldern.
This commit is contained in:
@@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user