Aktualisiere Version auf 1.1.1, füge Unterstützung für die Aufteilung von Taxonomie-Werten hinzu und verbessere die Handhabung von Kategoriewerten im Accordion-WebPart

This commit is contained in:
Torsten Brendgen
2026-08-26 23:35:10 +02:00
parent be1701eef3
commit 3ee1247efe
8 changed files with 56 additions and 19 deletions
+10 -2
View File
@@ -66,7 +66,8 @@ export default class AccordionWebPart extends BaseClientSideWebPart<IAccordionWe
this.properties.categoryField || '',
this.properties.sortField || this.properties.titleField,
this.properties.sortAscending !== false,
this.properties.selectedCategory || ''
this.properties.selectedCategory || '',
this.getFieldType(this.properties.categoryField)
).then((items: IAccordionItem[]): void => {
if (this.disposed || version !== this.requestVersion) { return; }
if (!items.length) { this.renderStatus(strings.EmptyMessage, false); return; }
@@ -238,7 +239,7 @@ export default class AccordionWebPart extends BaseClientSideWebPart<IAccordionWe
}
this.loadingCategories = true;
this.refreshPropertyPane();
return this.service.getCategoryValues(listId, categoryField).then((categories: string[]): void => {
return this.service.getCategoryValues(listId, categoryField, this.getFieldType(categoryField)).then((categories: string[]): void => {
this.categories = categories;
if (categories.indexOf(this.properties.selectedCategory) < 0) { this.properties.selectedCategory = ''; }
}).catch((error: Error): void => {
@@ -281,6 +282,13 @@ export default class AccordionWebPart extends BaseClientSideWebPart<IAccordionWe
return field.type === 'TaxonomyFieldType' || field.type === 'TaxonomyFieldTypeMulti';
}
private getFieldType(internalName: string): string {
for (let i: number = 0; i < this.fields.length; i++) {
if (this.fields[i].internalName === internalName) { return this.fields[i].type; }
}
return '';
}
private isConfigured(): boolean {
return !!(this.service && this.properties.listId && this.properties.titleField && this.properties.contentField);
}