Skip to content

New search standard and user search - #9912

Merged
skjnldsv merged 7 commits into
masterfrom
search-standard
Jun 19, 2018
Merged

New search standard and user search#9912
skjnldsv merged 7 commits into
masterfrom
search-standard

Conversation

@skjnldsv

@skjnldsvskjnldsv commented Jun 19, 2018

Copy link
Copy Markdown
Member

This is a tricky one!
Fixes#2657

  • Added support for user search in the new users vue list
  • Added support for simple registration of a search in javascript
    • new OCA.Search(searchfunction, resetfunction)
    • Any app can register this with plain pure js and simply add its manager.
  • Deprecated OCA.Search is now OCA.Search.Core to ensure devs migrate their search system to this as well.
  • Fixed design of the global search in Files

@MorrisJobke

Copy link
Copy Markdown
Member

Conflicts :/

@juliusknorrjuliusknorr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍 Works nicely also with multiple instances on one page.

@skjnldsvskjnldsv mentioned this pull request Jun 19, 2018
@MorrisJobke

Copy link
Copy Markdown
Member

I added one user "test1" and searched for "test", then I got one result, then two, then three and it stopped after 4:

bildschirmfoto 2018-06-19 um 16 15 22
bildschirmfoto 2018-06-19 um 16 15 24

Same happens with two users in the result set:

bildschirmfoto 2018-06-19 um 16 16 49

@codecov

codecovBot commented Jun 19, 2018

Copy link
Copy Markdown

Codecov Report

Merging #9912 into master will increase coverage by 0.01%.
The diff coverage is 9.75%.

@@ Coverage Diff @@## master #9912 +/- ##
===========================================
+ Coverage 52.08% 52.1% +0.01% 
Complexity 25910 25910 ===========================================
Files 1642 1642 Lines 95898 95721 -177 Branches 1318 1289 -29 ===========================================
- Hits 49950 49873 -77 + Misses 45948 45848 -100
Impacted FilesCoverage ΔComplexity Δ
core/templates/layout.user.php0% <0%> (ø)0 <0> (ø)⬇️
lib/private/legacy/template.php30.32% <100%> (+0.91%)42 <0> (ø)⬇️
core/search/js/search.js9.52% <5.26%> (-28.49%)0 <0> (ø)
apps/files_trashbin/lib/Expiration.php91.93% <0%> (+1.61%)29% <0%> (ø)⬇️

@skjnldsv

Copy link
Copy Markdown
MemberAuthor

@MorrisJobke done

@skjnldsvskjnldsv mentioned this pull request Jun 19, 2018

@MorrisJobkeMorrisJobke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tested and works 👍

@MorrisJobkeMorrisJobke added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Jun 19, 2018
@MorrisJobke

Copy link
Copy Markdown
Member

I found another small issue:

  • open the apps management
  • type in the search term
  • press enter
  • before: it did nothing and just searched
  • after: it does a POST request resulting in a white page

@skjnldsv

Copy link
Copy Markdown
MemberAuthor

@MorrisJobke the app management need to be updated to this standard as well, I'll handle it in a sec :)

@MorrisJobkeMorrisJobke added 2. developing Work in progress and removed 4. to release Ready to be released and/or waiting for tests to finish labels Jun 19, 2018
skjnldsvand others added 7 commits June 19, 2018 23:53
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
@skjnldsvskjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 2. developing Work in progress labels Jun 19, 2018
@skjnldsv
skjnldsv merged commit 625bdf0 into masterJun 19, 2018
@skjnldsv
skjnldsv deleted the search-standard branch June 19, 2018 22:45
}
}
// Show search
document.getElementById('searchbox').style.display = 'block';

@kyrofakyrofaJul 13, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This line is wreaking havoc on my automated tests, throwing this on the login page:

TypeError: document.getElementById(...)isnullinsearch.js:84:4initializehttp://localhost/core/search/js/search.js:84:4Searchhttp://localhost/core/search/js/search.js:37:3initializehttp://localhost/core/search/js/searchprovider.js:384:11Searchhttp://localhost/core/search/js/searchprovider.js:34:3<anonymous> http://localhost/core/search/js/searchprovider.js:432:16
_.delay/<http://localhost/core/vendor/core.js:781:14

Firefox shows this as well.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

It's a deeper issue as there is no real reason why the search needs to me initiated on the login page :p

@nickvergessen

Copy link
Copy Markdown
Member

Since this patch the search icon/bar is visible on any app again, although there might not be search functionality available, eg activity, talk, settings, …

Can we do something about this?

@skjnldsv

Copy link
Copy Markdown
MemberAuthor

@nickvergessen this shouldn't. Who is registering the search on those apps?

@nickvergessen

nickvergessen commented Jul 18, 2018

Copy link
Copy Markdown
Member

I added a break point at console.debug('New search handler registered');

initialize (search.js#63)
Search (search.js#37)
initialize (searchprovider.js#384)
Search (searchprovider.js#34)
(anonym) (searchprovider.js#432)
(anonym) (underscore.js#768)

¯\(ツ)

@skjnldsv

Copy link
Copy Markdown
MemberAuthor

This registration shouldn't be there on every page :/

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

Labels

4. to releaseReady to be released and/or waiting for tests to finishenhancementfeature: searchfeature: users and groups

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@skjnldsv@MorrisJobke@nickvergessen@kyrofa@juliusknorr