diff --git a/packages/rocketchat-i18n/i18n/en.i18n.json b/packages/rocketchat-i18n/i18n/en.i18n.json
index bac7e5b8e50d..60d32127e5e8 100644
--- a/packages/rocketchat-i18n/i18n/en.i18n.json
+++ b/packages/rocketchat-i18n/i18n/en.i18n.json
@@ -1242,6 +1242,7 @@
"Message_DateFormat_Description": "See also: Moment.js",
"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",
diff --git a/packages/rocketchat-lib/server/startup/settings.js b/packages/rocketchat-lib/server/startup/settings.js
index 2271edd7005c..1aa1c27c51eb 100644
--- a/packages/rocketchat-lib/server/startup/settings.js
+++ b/packages/rocketchat-lib/server/startup/settings.js
@@ -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() {
diff --git a/packages/rocketchat-ui-flextab/client/tabs/messageSearch.html b/packages/rocketchat-ui-flextab/client/tabs/messageSearch.html
index 4eb73b180bc5..91b5d256cc5d 100644
--- a/packages/rocketchat-ui-flextab/client/tabs/messageSearch.html
+++ b/packages/rocketchat-ui-flextab/client/tabs/messageSearch.html
@@ -14,9 +14,11 @@
-
+ {{#if allowGlobalSearch}}
+
+ {{/if}}
diff --git a/packages/rocketchat-ui-flextab/client/tabs/messageSearch.js b/packages/rocketchat-ui-flextab/client/tabs/messageSearch.js
index a3a6a658f4bf..5fd559a1f188 100644
--- a/packages/rocketchat-ui-flextab/client/tabs/messageSearch.js
+++ b/packages/rocketchat-ui-flextab/client/tabs/messageSearch.js
@@ -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();
@@ -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({