microsoft-graph-toolkit icon indicating copy to clipboard operation
microsoft-graph-toolkit copied to clipboard

`mgt-file-list` should support both filtering by file extensions but also return folders

Open sebastienlevert opened this issue 1 year ago • 1 comments

Proposal: mgt-file-list should support both filtering by file extensions but also return folders

Description

Right now, when filtering by file extension, we automatically lose the ability to drill through the file hierarchy as we only return the current folders files, but ignore folders.

Rationale

This would allow for a more fined-grained experience and would help with #1741

Preferred Solution

Adding a new property on the mgt-file-list component to allow something like :

<mgt-file-list file-extensions="pdf,docx" preserve-folders></mgt-file-list>
Attribute Property Description
preserve-folders preserveFolders Only available when file-extensions is used. Will return folders when specified. Default false

sebastienlevert avatar Jul 04 '22 18:07 sebastienlevert

Hello sebastienlevert, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

ghost avatar Jul 04 '22 18:07 ghost

Hi @sebastienlevert, to retrieve folder from file-extensions just need to be include in the array as empty.

You can test using https://mgt.dev/?path=/story/components-mgt-file-list-properties--get-file-list-by-extensions Sample: File extension with folders <mgt-file-list file-extensions="docx, xlsx,"></mgt-file-list> Sample: Just folders <mgt-file-list file-extensions=""></mgt-file-list>

Did i miss something?

aaclage avatar Oct 07 '22 14:10 aaclage

You win! I wasn't aware... I think we should definitely make our documentation more clear about this. Would you be willing to take a stab at our docs and explicitly call out this scenario? Good catch @aaclage!

sebastienlevert avatar Oct 07 '22 17:10 sebastienlevert

Thanks for the PR. After review of the issue, this is mostly using an undocumented feature and could leak other files (files without extensions). I think this feature is still valid and we will be working on it based on our priorities. Thanks!

sebastienlevert avatar Oct 24 '22 20:10 sebastienlevert