Skip to content

Commit

Permalink
[NEW] Add Search Provider Framework (#10110)
Browse files Browse the repository at this point in the history
[NEW] Search Provider Framework
  • Loading branch information
tkurz authored and rodrigok committed Apr 20, 2018
1 parent bc548e7 commit 68b0641
Show file tree
Hide file tree
Showing 75 changed files with 3,761 additions and 229 deletions.
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 @@ caching-compiler@1.1.11
caching-html-compiler@1.1.2
callback-hook@1.1.0
cfs:http-methods@0.0.32
chatpal:search@0.0.1
check@1.3.1
coffeescript@1.0.17
dandv:caret-position@2.1.1
Expand Down Expand Up @@ -200,6 +201,7 @@ rocketchat:postcss@1.0.0
rocketchat:push-notifications@0.0.1
rocketchat:reactions@0.0.1
rocketchat:sandstorm@0.0.1
rocketchat:search@0.0.1
rocketchat:slackbridge@0.0.1
rocketchat:slashcommands-archive@0.0.1
rocketchat:slashcommands-asciiarts@0.0.1
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

0 comments on commit 68b0641

Please sign in to comment.