Skip to content
This repository was archived by the owner on Aug 28, 2026. It is now read-only.
This repository was archived by the owner on Aug 28, 2026. It is now read-only.

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

Open

Description

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

Activity

  1. moved this from Needs Triage 🔍 to Proposed 💡 in Graph Toolkiton Jul 4, 2022
  2. aaclage commented on Oct 7, 2022

    @aaclage
    Contributor

    Hi Sébastien Levert (@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?

  3. sebastienlevert commented on Oct 7, 2022

    @sebastienlevert
    CollaboratorAuthor

    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 André Lage (@aaclage)!

  4. sebastienlevert commented on Oct 24, 2022

    @sebastienlevert
    CollaboratorAuthor

    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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions