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

[NEW] Search Provider Framework #10110

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
71ea121
first concept
tkurz Feb 22, 2018
bba0793
first provider implmentation for mongo search
tkurz Mar 2, 2018
2940c2f
Merge branch 'develop-upstream' into #8381-poc
tkurz Mar 7, 2018
155f590
add some admin features
tkurz Mar 7, 2018
db6211d
smaller fixes and restructuring
tkurz Mar 7, 2018
11775f0
many adaptions regarding ui, smaller fix for 'searchMessages'
tkurz Mar 9, 2018
c1fc513
add search example directly to i18n strings
tkurz Mar 9, 2018
feb137b
set multiple languages
tkurz Mar 9, 2018
4d0e10b
smaller fixes regarding ui, i18n; some documentation
tkurz Mar 12, 2018
91c23d2
Merge branch 'develop-upstream' into #8381-poc
tkurz Mar 12, 2018
caf3628
Add i18n description for url parameter
tkurz Mar 12, 2018
e0328e8
move Readme to the right place
tkurz Mar 12, 2018
152fc55
smaller changes for linter
tkurz Mar 12, 2018
3e00331
test failed due to class renaming, should fix the test
tkurz Mar 13, 2018
12d019f
enabled stopping of running indexing process in chatpal
tkurz Mar 14, 2018
48fe6fb
fixes missing channel names on direct messages
tkurz Mar 14, 2018
4f19d54
enable on keyup search for providers without autocompletion
tkurz Mar 14, 2018
09afe77
default search result type for chatpal is now configurable, ALL is de…
tkurz Mar 14, 2018
ea394f8
fixes smaller styling issue
tkurz Mar 14, 2018
768c11a
filter non valid (non accessible) results
tkurz Mar 14, 2018
b4ffaa9
fix naming bug in validation service
tkurz Mar 14, 2018
0cc3c0d
adapt code style and remove debuging leftover
tkurz Mar 14, 2018
24104fc
Merge branch 'develop' into #8381-search_provider_concept
tkurz Mar 16, 2018
5b75560
Merge branch 'develop' into #8381-search_provider_concept
tkurz Mar 19, 2018
6636eeb
fixes a bug that is caused by node request body serialization
tkurz Mar 19, 2018
9eea47a
first try of suggestions
tkurz Mar 22, 2018
1d29294
ping with stats
tkurz Mar 22, 2018
0f34bff
enable very simple suggestions
tkurz Mar 22, 2018
afa3643
set new suggestion endpoint
tkurz Mar 23, 2018
d94f246
adapt chatpal suggester to new model
tkurz Mar 26, 2018
1ddbc2e
smaller styling, ui and i18n issues
tkurz Mar 26, 2018
1756be2
hide suggestions on enter
tkurz Mar 26, 2018
a6da899
adapt to changes chatpal suggestion api
tkurz Mar 26, 2018
abff45c
fix code style
tkurz Mar 26, 2018
e41fb23
add setting to disable suggestions + fix config bug
tkurz Mar 26, 2018
ba0cf07
fix bug regarding url update
tkurz Mar 26, 2018
ae99543
make icon in search box configurable and add icon for chatpal (+adapt…
tkurz Apr 3, 2018
35bd886
Merge branch 'develop' into #8381-search_provider_concept
tkurz Apr 3, 2018
44b707d
Merge branch 'develop' into #8381-search_provider_concept
tkurz Apr 10, 2018
8d8fe8b
#8381 removes underscore functions where it is possible (fixes https:…
tkurz Apr 15, 2018
9afad4f
#8381 removes addFiles for server in package.json and add it to mainM…
tkurz Apr 15, 2018
c178771
remove debugging outputs
tkurz Apr 15, 2018
ca60b34
#8381 replace futures with promises (fixes https://github.com/RocketC…
tkurz Apr 15, 2018
58ee03a
#8381 enable simple caching in order to reduce the number of db calls…
tkurz Apr 15, 2018
84d9dc9
#8381 remove logging (leftover from development) (fixes https://githu…
tkurz Apr 15, 2018
1cd2dbd
#8381 avoid callback functions and replace with Promises (fixes https…
tkurz Apr 15, 2018
a8ff9da
#8381 replace future by promise (fixes https://github.com/RocketChat/…
tkurz Apr 15, 2018
71c7dcf
#8381 switched from db cursor to eventemmitter (fixes https://github.…
tkurz Apr 15, 2018
925d821
#8381 fixes chatpal admin page (header link + ui)
tkurz Apr 15, 2018
90872a7
#8381 use flex instead of inline-block (fixes https://github.com/Rock…
tkurz Apr 15, 2018
3e51c47
Merge branch 'rocketchat-local/develop' into redlink-local/#8381-sear…
tkurz Apr 15, 2018
16a6ae9
fix smaller lint issue and remove develop console output
tkurz Apr 15, 2018
fbbefbe
#8381 fixes issue that wrong user was displayed for a message
tkurz Apr 18, 2018
7a6c525
#8381 remove clear div and set css to flex (fixes https://github.com/…
tkurz Apr 18, 2018
d6ba7aa
Merge branch 'rocketchat/develop' into redlink/#8381-search_provider_…
tkurz Apr 18, 2018
7e417d5
remove remaining float and clear divs (fixes https://github.com/Rocke…
tkurz Apr 19, 2018
abef5ba
load terms and conditions for chatpal from backend service
tkurz Apr 19, 2018
e3a28d0
fix some typos and add german translation for search framework and Ch…
tkurz Apr 19, 2018
fe5cf57
Merge branch 'develop' into #8381-search_provider_concept
tkurz Apr 19, 2018
08449c9
add payload from searches (like e.g. type filter) to suggestion reque…
tkurz Apr 19, 2018
eb1561c
Merge branch '#8381-search_provider_concept' of https://github.com/re…
tkurz Apr 19, 2018
facb8a3
Merge branch 'develop' into #8381-search_provider_concept
tkurz Apr 19, 2018
39e8fcb
fix typo
tkurz Apr 20, 2018
36b79c0
remove console log (fixes https://github.com/RocketChat/Rocket.Chat/p…
tkurz Apr 20, 2018
dfecb5e
Merge branch '#8381-search_provider_concept' of https://github.com/re…
tkurz Apr 20, 2018
4ef4883
remove current search ui and add migration of Message_GlobalSearch se…
tkurz Apr 20, 2018
af1f3d2
Merge branch 'develop' into #8381-search_provider_concept
tkurz Apr 20, 2018
7acd770
Remove Message_GlobalSearch setting
sampaiodiego Apr 20, 2018
1f1185d
Update and rename v113.js to v114.js
sampaiodiego Apr 20, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,6 @@ todda00:friendly-slugs
yasaricli:slugify
yasinuslu:blaze-meta
rocketchat:version-check

rocketchat:search
chatpal:search
2 changes: 2 additions & 0 deletions .meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ [email protected]
[email protected]
[email protected]
cfs:[email protected]
chatpal:[email protected]
[email protected]
[email protected]
dandv:[email protected]
Expand Down Expand Up @@ -200,6 +201,7 @@ rocketchat:[email protected]
rocketchat:[email protected]
rocketchat:[email protected]
rocketchat:[email protected]
rocketchat:[email protected]
rocketchat:[email protected]
rocketchat:[email protected]
rocketchat:[email protected]
Expand Down
9 changes: 9 additions & 0 deletions packages/chatpal-search/client/route.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FlowRouter.route('/admin/chatpal', {
name: 'chatpal-admin',
action() {
return BlazeLayout.render('main', {
center: 'ChatpalAdmin',
pageTitle: t('Chatpal_AdminPage')
});
}
});
310 changes: 310 additions & 0 deletions packages/chatpal-search/client/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,310 @@
.chatpal-admin-link {
color:red !important;
text-decoration: underline !important;
}

.chatpalProvider .search-form {
padding: 0 24px;
}

.chatpal_search-loader {
position: relative;
margin-top: 50px;
}

.chatpal-search-container {
display: flex;
flex-direction: column;
flex: 1;
}

.chatpal-search-result {
position: relative;
overflow: auto;
overflow-x: hidden;
padding: 0 24px 24px;
background-color: #f1f1f1;
flex: 1;
}

.chatpal-search-typefilter {
display: flex;
}

.chatpal-search-typefilter li {
cursor: pointer;
display: flex;
flex: 0 0 50%;
border-bottom: 4px solid white;
height: 35px;
justify-content: center;
padding-top: 10px;
}

.chatpal-search-typefilter li.selected {
border-bottom: 4px solid #125074;
}

.chatpal-admin-header {
font-size: 18px;
margin-bottom: 20px;
}

.chatpal-search-result-header {
margin: 20px 0;
font-weight: bold;
}

.chatpal-search-result-single {
background-color: white;
padding: 10px;
border: 1px solid #e6e6e6;
margin-bottom: 10px;
min-height: 92px;
position: relative;
}


.chatpal-search-result-user {
background-color: white;
padding: 10px;
border: 1px solid #e6e6e6;
margin-bottom: 10px;
min-height: 40px;
position: relative;
}

.chatpal-search-result-user .chatpal-avatar {
width: 36px;
height: 36px;
position: absolute;
}

.chatpal-search-result-user .chatpal-avatar .chatpal-avatar-image {
background-repeat: no-repeat;
background-size: contain;
width: 100%;
height: 100%;
}

.chatpal-search-result-user h2 {
padding-left: 45px;
margin-bottom: 5px;
}

.chatpal-search-result-user .direct-message {
padding-left: 45px;
font-size: 14px;
font-weight: bold;
}

.chatpal-channel {
flex: 1 1 auto;
}

.chatpal-search-result-user .chatpal-channel {
font-weight: bold;
}

.chatpal-show-more-messages {
font-size: 14px;
font-weight: bold;
color: #125074;
text-align: center;
cursor: pointer;
margin-bottom: 20px;
}

.chatpal-show-more-messages:hover {
text-decoration: underline;
}

.chatpal-search-result-user .direct-message a {
color: #125074;
}

.chatpal-search-result-user .direct-message a:hover {
text-decoration: underline;
}

.chatpal-search-result-single h2 {
margin-bottom: 20px;
display: flex;
align-items: center;
}

.chatpal-search-result-single .chatpal-avatar {
width: 36px;
height: 36px;
position: absolute;
}

.chatpal-search-result-single .chatpal-avatar .chatpal-avatar-image {
background-repeat: no-repeat;
background-size: contain;
width: 100%;
height: 100%;
}

.chatpal-search-result-single .chatpal-name {
padding: 0 0 0 46px;
font-size: 14px;
color: #444;
font-weight: bold;
}

.chatpal-search-result-single .chatpal-date {
font-size: 12px;
color: #a0a0a0;
font-weight: normal;
}

.chatpal-search-result-single .chatpal-time {
font-size: 12px;
color: #a0a0a0;
margin-left: 3px;
}

.chatpal-search-result-single .chatpal-message {
padding: 0 0 0 46px;
line-height: 20px;
margin-top: 5px;
overflow-x: hidden;
}

.chatpal-search-result-single .chatpal-message em {
font-style: normal;
background-color: #FAF9C8;
}

.chatpal-search-result-single .chatpal-link {
display: none;
flex: 20;
color: #125074;
}

.chatpal-search-result-single .chatpal-link:hover {
text-decoration: underline;
}

.chatpal-search-result-single:hover .chatpal-link {
display: inline-block;
}

.chatpal-paging {
text-align: center;
margin: 30px 0 50px 0;
}

.chatpal-paging-text {
display: inline-block;
position: relative;
top: -2px;
}

.chatpal-paging .chatpal-paging-button {
color: #125074;
cursor: pointer;
font-size: 20px;
display: inline-block;
}

.chatpal-paging .chatpal-paging-prev {
padding-right: 10px;
}

.chatpal-paging .chatpal-paging-next {
padding-left: 10px;
}

.chatpal-search-info {
margin-top: 40px;
padding: 10px;
}

.chatpal-search-welcome {
text-align: center;
padding-top: 40px;
}

.chatpal-search-result-room h2 {
padding-left: 0 !important;
}

.chatpal-search-result-list em {
font-style: normal;
background-color: #FAF9C8;
}

.chatpal-search-result-room .chatpal-link {
display: none;
margin-left: 3px;
color: #125074;
}

.chatpal-search-result-room:hover .chatpal-link {
display: inline-block;
}

.chatpal-search-result-room .chatpal-link:hover{
text-decoration: underline;
}

.chatpal-search-pills div {
background-color: #f1f1f1;
padding: 2px 5px;
display: inline-block;
margin-right: 5px;
border-radius: 3px;
margin-top: 5px;
}

.apikey h2 {
margin-top: 20px;
}

.apikey .key {
background-color: #f1f1f1;
position: relative;
margin: 20px 0;
font-size: 20px;
text-align: center;
padding: 10px;
}

.apikey a {
text-decoration: underline;
}

.chatpal-suggestion {
padding: 10px;
display: flex;
justify-items: center;
}

.chatpal-suggestion-text {
flex: 1 1 auto;
}

.chatpal-suggestion-hint {
display: none;
}

.rocket-search-suggestion-item.active .chatpal-suggestion-hint {
display: block;
}

.chatpalProvider .rc-input__icon {
width: 26px;
left: 10px;
top: 3px;
}

.chatpalProvider .rc-input__icon-svg {
font-size: 26px !important;
}

.chatpalProvider .rocket-search-suggestion-item.active, .chatpalProvider .rocket-search-suggestion-item:hover {
background-color: #125074;
color: white;
}
55 changes: 55 additions & 0 deletions packages/chatpal-search/client/template/admin.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<template name="ChatpalAdmin">
<section class="page-container page-list">
<header class="rc-header">
<div class="rc-header__wrap">
<span class="rc-header__block">
{{_ pageTitle}}
</span>
</div>
</header>
<div class="content">
{{#unless isAdmin}}
<p>{{_ "You_are_not_authorized_to_view_this_page"}}</p>
{{else}}
<form>
<div class="rocket-form">
<fieldset>
<div class="input-line">
<label>{{_ "Chatpal_Email_Address"}}</label>
<div>
<input class="rc-input__element" type="text" autocomplete="off" name="email">
</div>
</div>
<div class="input-line">
<label>{{_ "Chatpal_Terms_and_Conditions"}}</label>
<div id="chatpal-tac" class="chatpal-tac rc-input__element">
{{{tac}}}
</div>
</div>
<div class="input-line">
<div>
<label>
<input type="checkbox" name="readtac">
{{_ "Chatpal_TAC_read"}}
</label>
</div>
</div>
</fieldset>
<div class="submit">
<button class="button primary send"><span>{{_ "Chatpal_create_key"}}</span></button>
</div>
</div>
</form>
{{#if apiKey}}
<div class="apikey">
<h2>Here is your Chatpal Api Key</h2>
<div class="key">
{{apiKey}}
</div><!-- TODO copy to clipboard -->
<p>Please copy the key and insert it in the key field of the Chatpal Provider in the <a href="./admin/Search">Search Admin Page</a>.</p>
</div>
{{/if}}
{{/unless}}
</div>
</section>
</template>
Loading