-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Disable search field in case there is no search available to the curr… #16810
Conversation
…ent selected app - fixes #14544
yep. noticed this too. Please back port 👍 |
if(self.hasFilter(getCurrentApp())) { | ||
return; | ||
} | ||
if ($searchResults.length === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? This is always !== 0, because it is the div with the selector '#searchResults` and if it not exists it gets created. If I remove the if statement it works as intended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was testing this with gallery and $searchResults is empty - I took this as criteria to disable search .... let me have a second look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aha - gallery has no div for app-content and the search result tag cannot be inserted
Maybe we shall not automatically add that div - if an app implements the search is should add the div explicitly.
@PVince81 @butonic @jancborchardt @MorrisJobke @nickvergessen @oparoz objections?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and make the "search results" opt-in instead of opt-out.
Which apps can we test this with? |
Files should show the search - same for the mail app. |
@oparoz Personal/admin settings should not show the search box |
OK, so I can confirm that it doesn't work properly when reaching the settings page :) |
search is not opt-in - please review and test |
settings/apps does not have the search box anymore, although it allowed to filter the long lists. |
damn 👿 |
.append($searchResults) | ||
.find('.viewcontainer').css('min-height', 'initial'); | ||
} | ||
$searchResults.load(OC.webroot + '/core/search/templates/part.results.html', function () { | ||
OC.Search = new OCA.Search($('#searchbox'), $('#searchresults')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PVince81 because the search object here is not instanciated right away the plugins are not all loaded and therefor filtering is not longer working.
What would be the ideal solution to get some kind of execution order into this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The non-ideal hacky way:
_.defer(function() { OC.Search = ... }
.
I'll need to dig deeper into this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do think the search box should be opt-in (at least in the future).
An app/page should tell whether it needs the search box so it can be shown and trigger events.
Else it's all just guessing / hackery.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The non-ideal hacky way:
_.defer(function() { OC.Search = ... }.I'll need to dig deeper into this.
THX - works - but I guess this is not deterministic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
A new inspection was created. |
@nickvergessen fixed - care to take a second look? THX |
Works better good now and also resolves #16823 |
Good call on not showing the search box when it’s not available. Also serves as a visual reminder that we need to introduce it in some places. 👍 |
Removes the field in Gallery+, Settings Seems to work |
…nted Disable search field in case there is no search available to the curr…
@DeepDiver1975 Please create the backport PRs |
…ent selected app - fixes #14544
@oparoz @jancborchardt @nickvergessen @PVince81 @butonic
@karlitschek we have this non working search field in some apps since oc8 - backport is kind of reasonable