Skip to content

Commit

Permalink
Add setting to enable globla search
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigok committed Feb 12, 2018
1 parent cea44dd commit 4d731fe
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,7 @@
"Message_DateFormat_Description": "See also: <a href=\"http://momentjs.com/docs/#/displaying/format/\" target=\"momemt\">Moment.js</a>",
"Message_deleting_blocked": "This message cannot be deleted anymore",
"Message_editing": "Message editing",
"Message_GlobalSearch": "Global Search",
"Message_GroupingPeriod": "Grouping Period (in seconds)",
"Message_GroupingPeriodDescription": "Messages will be grouped with previous message if both are from the same user and the elapsed time was less than the informed time in seconds.",
"Message_HideType_au": "Hide \"User Added\" messages",
Expand Down
8 changes: 7 additions & 1 deletion packages/rocketchat-lib/server/startup/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -1313,10 +1313,16 @@ RocketChat.settings.addGroup('Message', function() {
'public': true
});

return this.add('Message_HideType_mute_unmute', false, {
this.add('Message_HideType_mute_unmute', false, {
type: 'boolean',
'public': true
});

this.add('Message_GlobalSearch', false, {
type: 'boolean',
'public': true,
alert: 'This feature is currently in beta and could decrease the application performance! Please report bugs to github.com/RocketChat/Rocket.Chat/issues'
});
});

RocketChat.settings.addGroup('Meta', function() {
Expand Down
8 changes: 5 additions & 3 deletions packages/rocketchat-ui-flextab/client/tabs/messageSearch.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
<input type="text" class="rc-input__element" name="message-search" id="message-search" placeholder="{{tSearchMessages}}" autocomplete="off" />
</div>
</label>
<label>
<input type="checkbox" id="global-search" checked>{{_ "Global_Search"}}
</label>
{{#if allowGlobalSearch}}
<label>
<input type="checkbox" id="global-search" checked>{{_ "Global_Search"}}
</label>
{{/if}}
</div>
</form>
</div>
Expand Down
7 changes: 5 additions & 2 deletions packages/rocketchat-ui-flextab/client/tabs/messageSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Meteor.startup(function() {
}

FlowRouter.goToRoomById(message.rid);
RocketChat.MessageAction.hideDropDown();
// RocketChat.MessageAction.hideDropDown();

if (window.matchMedia('(max-width: 500px)').matches) {
Template.instance().tabBar.close();
Expand Down Expand Up @@ -59,8 +59,11 @@ Template.messageSearch.helpers({

message() {
return _.extend(this, { customClass: 'search', actionContext: 'search'});
}
},

allowGlobalSearch() {
return RocketChat.settings.get('Message_GlobalSearch');
}
});

Template.messageSearch.events({
Expand Down

0 comments on commit 4d731fe

Please sign in to comment.