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

lib: Add onlyDirectories option to FileAutoComplete #20777

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

mvollmer
Copy link
Member

No description provided.

@mvollmer mvollmer requested a review from jelly July 19, 2024 08:33
@mvollmer
Copy link
Member Author

I am going to use this in cockpit-project/cockpit-machines#1730

@mvollmer
Copy link
Member Author

mvollmer commented Jul 19, 2024

We can also add a option to fslist1 to filter before sending it. That might potentially save a lot of data traffic if people hit a massive directory but are not actually interested in the files in there.

@jelly
Copy link
Member

jelly commented Jul 19, 2024

We can also add a option to fslist1 to filter before sending it. That might potentially save a lot of data traffic if people hit a massive directory but are not actually interested in the files in there.

I would do that in fsinfo which is the new hotness and something the file-autocomplete component should use. But we can't yet everywhere for example not in podman.

@@ -117,7 +117,8 @@ export class FileAutoComplete extends React.Component {

channel.addEventListener("message", (ev, data) => {
const item = JSON.parse(data);
if (item && item.path && item.event == 'present') {
if (item && item.path && item.event == 'present' &&
(!this.props.onlyDirectories || item.type == 'directory')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test.

@mvollmer mvollmer merged commit 43564c7 into cockpit-project:main Jul 19, 2024
75 of 77 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants