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

Disable search field in case there is no search available to the curr… #16810

Merged
merged 3 commits into from
Jun 9, 2015

Conversation

DeepDiver1975
Copy link
Member

…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

@DeepDiver1975 DeepDiver1975 added this to the 8.1-current milestone Jun 8, 2015
@karlitschek
Copy link
Contributor

yep. noticed this too. Please back port 👍

if(self.hasFilter(getCurrentApp())) {
return;
}
if ($searchResults.length === 0) {
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Same issue here

Copy link
Member Author

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

Copy link
Member Author

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?

Copy link
Contributor

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.

@oparoz
Copy link
Contributor

oparoz commented Jun 8, 2015

Which apps can we test this with?
I've tested with galleryplus, after having disabled the part in the app which already hides the field and it did not re-appear.

@DeepDiver1975
Copy link
Member Author

Files should show the search - same for the mail app.

@MorrisJobke
Copy link
Contributor

@oparoz Personal/admin settings should not show the search box

@oparoz
Copy link
Contributor

oparoz commented Jun 9, 2015

OK, so I can confirm that it doesn't work properly when reaching the settings page :)

@DeepDiver1975
Copy link
Member Author

search is not opt-in - please review and test

@MorrisJobke @oparoz @jancborchardt @PVince81 @blizzz THX

@nickvergessen
Copy link
Contributor

settings/apps does not have the search box anymore, although it allowed to filter the long lists.

@DeepDiver1975
Copy link
Member Author

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'));
Copy link
Member Author

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?

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Member Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed

@scrutinizer-notifier
Copy link

A new inspection was created.

@DeepDiver1975
Copy link
Member Author

@nickvergessen fixed - care to take a second look? THX

@nickvergessen
Copy link
Contributor

Works better good now and also resolves #16823

@jancborchardt
Copy link
Member

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. 👍

@oparoz
Copy link
Contributor

oparoz commented Jun 9, 2015

Removes the field in Gallery+, Settings
Keeps the field in Files, Apps

Seems to work
👍

@ghost
Copy link

ghost commented Jun 9, 2015

🚀 Test PASSed.🚀
chuck

DeepDiver1975 added a commit that referenced this pull request Jun 9, 2015
…nted

Disable search field in case there is no search available to the curr…
@DeepDiver1975 DeepDiver1975 merged commit 5f4f7e6 into master Jun 9, 2015
@DeepDiver1975 DeepDiver1975 deleted the disable-search-if-not-implemented branch June 9, 2015 21:49
@MorrisJobke
Copy link
Contributor

@DeepDiver1975 Please create the backport PRs

@BernhardPosselt BernhardPosselt mentioned this pull request Jul 6, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Aug 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nothing happens when users use the search field in most apps
8 participants