Update CherryPickedContentWebPart.ts

This commit is contained in:
Christophe Humbert 2022-04-08 17:16:29 -07:00 committed by GitHub
parent ade60a5be7
commit e49c9ef222
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -147,7 +147,10 @@ export default class CherryPickedContentWebPart extends BaseClientSideWebPart<IC
.then((files): void => {
if (files.length) {
// store items
this.libraryItemsList = files.map(file => { return { key: file.Name, text: file.Name }; });
this.libraryItemsList = files.map(file => file.FileLeafRef)
.filter(rf => rf.match(/\.(htm?l|txt)$/i))
.sort()
.map(name => ({ key: name, text: name }));
// enable item selector
this.itemsDropdownDisabled = false;
// refresh the item selector control by repainting the property pane