Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mgt-file-list component should have filterFiles property to be able to use a custom filter #2874

Closed
eduardpaul opened this issue Nov 23, 2023 · 5 comments
Labels

Comments

@eduardpaul
Copy link

Proposal: Add filterFiles property to mgt-file-list so custom filter function could be provided by consumer

Description

As a consumer of this component i should be able to decide if specific document should be shown or not (currently only file extensions are supported). Using a filter function could solve most scenarios.

Rationale

Preferred Solution

Implement filterFiles property following the filterTasks implementation from to-do component.

Additional Context

Probably I will try to implement it myself any time soon.

@sebastienlevert
Copy link
Contributor

Thanks for your suggestion! We'd love to work with you on this request. Right now, the filterTasks on the to-do component does the filtering on the client side, which is OK for tasks as the amount of data is limited, but challenging for a file list. Today, we already support providing one of multiple file queries, but these won't support advanced filtering, and the search endpoints on the drive items is being deprecated, so this doesn't help in the future (https://devblogs.microsoft.com/microsoft365dev/transition-to-microsoft-graph-search-endpoint-for-onedrive-and-sharepoint/).

That being said, there are valid scenarios and would love your feedback. Is it more of a "search" scenario that could leverage an improved version of our search results component? Would client-side filtering "enough" for this concept? Let's brainstorm!

@eduardpaul
Copy link
Author

@sebastienlevert totally agree with you that client side filtering is not the best option to filter out results and it could be a pain when it comes to paginating results from graph api.

Our scenario is more about file management where we want to hide specific files (system files) from the end user and allow them to browse through folders and upload files. In SharePoint Online we are handling this by filtering certain content types in the list views. In this case, client-side filtering of file-list will do the trick.

One thing I'm not sure about is if it makes sense that the file-list component should have the file upload option. For example it generates an inconsistency with the configuration: if you activate upload and configure filequeries you will be showing documents from one place but the upload will be done in your onedrive. And as you pointed out, listing files (read-only scenarios with search, filtering,....) could be covered by a search-result component.

Probably in the long term it would be better to have a "file-explorer" or "file-manager" component with some basic add/upload, delete, move, copy and paste functionality that you could point to a specific library, folder,. and replace file-list with search result component.

@sebastienlevert
Copy link
Contributor

To your last point, we have been having a long-standing PR that does exactly what you are mentioning (minus the file filtering). #2564

It might be useful to look at this branch (very outdated to be honest) and see if this could help with your scenario.

Now back to the file filter scenario, I think it makes sense for "light" filters, maybe not large complex filters... I think we could document this caveat and I'd agree it deliver some scenarios... We're happy for you to send a PR and we'll happily review and help with the process!

@sebastienlevert
Copy link
Contributor

At the moment, this is not something we're likely to prioritize. That being said, the Graph Toolkit is an open source project and we'll be happy to support and review if you want to contribute to its codebase! Please let us know if you'd be happy to help and implement this capability. If not, it's absolutely fine, we'll go and close the issue and might re-open it later if we reconsider our priorities. Thanks!

@sebastienlevert sebastienlevert added the Needs: Author Feedback Issue needs response from issue author label Jan 30, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

2 participants