From b703b94f58c15cea876c599ff380328da830c5ae Mon Sep 17 00:00:00 2001 From: Gabriel Delavald Date: Mon, 16 Apr 2018 11:28:34 -0300 Subject: [PATCH 01/79] Adds option to show real name on user popup list (#10444) [NEW] Shows user's real name on autocomplete popup --- packages/rocketchat-ui/client/components/popupList.html | 6 +++++- packages/rocketchat-ui/client/components/popupList.js | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/rocketchat-ui/client/components/popupList.html b/packages/rocketchat-ui/client/components/popupList.html index a0450ca1db94..ce6e0f77a7e0 100644 --- a/packages/rocketchat-ui/client/components/popupList.html +++ b/packages/rocketchat-ui/client/components/popupList.html @@ -19,6 +19,10 @@ {{>avatar username=item.username}} - {{{modifier item.username}}} + {{#if showRealNames}} + {{item.name}} ({{{modifier item.username}}}) + {{else}} + {{{modifier item.username}}} + {{/if}} diff --git a/packages/rocketchat-ui/client/components/popupList.js b/packages/rocketchat-ui/client/components/popupList.js index 32be871dd80c..ac13e550bc99 100644 --- a/packages/rocketchat-ui/client/components/popupList.js +++ b/packages/rocketchat-ui/client/components/popupList.js @@ -29,3 +29,9 @@ Template.popupList_default.helpers({ }; } }); + +Template.popupList_item_default.helpers({ + showRealNames() { + return RocketChat.settings.get('UI_Use_Real_Name'); + } +}); From 5cdcda88184a7fee62ab7dddf5265c36df971ccf Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Mon, 16 Apr 2018 09:29:44 -0500 Subject: [PATCH 02/79] Remove the developer warning on the rest api (#10441) --- packages/rocketchat-api/server/api.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/packages/rocketchat-api/server/api.js b/packages/rocketchat-api/server/api.js index 7f62e48678e8..4fde2efa0e2b 100644 --- a/packages/rocketchat-api/server/api.js +++ b/packages/rocketchat-api/server/api.js @@ -146,20 +146,7 @@ class API extends Restivus { return RocketChat.API.v1.failure(e.message, e.error); } - result = result ? result : RocketChat.API.v1.success(); - - if ( - /(channels|groups)\./.test(route) - && result - && result.body - && result.body.success === true - && (result.body.channel || result.body.channels || result.body.group || result.body.groups) - ) { - // TODO: Remove this after three versions have been released. That means at 0.64 this should be gone. ;) - result.body.developerWarning = '[WARNING]: The "usernames" field has been removed for performance reasons. Please use the "*.members" endpoint to get a list of members/users in a room.'; - } - - return result; + return result ? result : RocketChat.API.v1.success(); }; for (const [name, helperMethod] of this.getHelperMethods()) { From f6a08e6b95faf825d4d569cdff0e93e4a992e67d Mon Sep 17 00:00:00 2001 From: Gabriel Delavald Date: Mon, 16 Apr 2018 11:33:15 -0300 Subject: [PATCH 03/79] Adds autocomplete option to settings fields (#10439) [NEW] Prevent the browser to autocomplete some setting fields --- .../server/functions/settings.js | 3 +++ .../rocketchat-lib/server/startup/settings.js | 6 ++++-- packages/rocketchat-ui-admin/client/admin.html | 18 +++++++++--------- packages/rocketchat-ui-admin/client/admin.js | 7 +++++++ 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/packages/rocketchat-lib/server/functions/settings.js b/packages/rocketchat-lib/server/functions/settings.js index cef8a2d960e6..8bed7e4c383d 100644 --- a/packages/rocketchat-lib/server/functions/settings.js +++ b/packages/rocketchat-lib/server/functions/settings.js @@ -74,6 +74,9 @@ RocketChat.settings.add = function(_id, value, options = {}) { if (hiddenSettings[_id] != null) { options.hidden = true; } + if (options.autocomplete == null) { + options.autocomplete = true; + } if (typeof process !== 'undefined' && process.env && process.env[`OVERWRITE_SETTING_${ _id }`]) { let value = process.env[`OVERWRITE_SETTING_${ _id }`]; if (value.toLowerCase() === 'true') { diff --git a/packages/rocketchat-lib/server/startup/settings.js b/packages/rocketchat-lib/server/startup/settings.js index 9b0904c01a34..ed8ca9ab7d18 100644 --- a/packages/rocketchat-lib/server/startup/settings.js +++ b/packages/rocketchat-lib/server/startup/settings.js @@ -1006,12 +1006,14 @@ RocketChat.settings.addGroup('Email', function() { this.add('SMTP_Username', '', { type: 'string', env: true, - i18nLabel: 'Username' + i18nLabel: 'Username', + autocomplete: false }); this.add('SMTP_Password', '', { type: 'password', env: true, - i18nLabel: 'Password' + i18nLabel: 'Password', + autocomplete: false }); this.add('From_Email', '', { type: 'string', diff --git a/packages/rocketchat-ui-admin/client/admin.html b/packages/rocketchat-ui-admin/client/admin.html index caeb39260959..b3ebf3a57ec0 100644 --- a/packages/rocketchat-ui-admin/client/admin.html +++ b/packages/rocketchat-ui-admin/client/admin.html @@ -56,25 +56,25 @@ {{#if multiline}} {{else}} - + {{/if}} {{/if}} {{#if $eq type 'relativeUrl'}} - + {{/if}} {{#if $eq type 'password'}} - + {{/if}} {{#if $eq type 'int'}} - + {{/if}} {{#if $eq type 'boolean'}} - - + + {{/if}} {{#if $eq type 'select'}} @@ -103,7 +103,7 @@ {{/if}} {{#if $eq editor 'expression'}}
- +
{{/if}}
@@ -118,7 +118,7 @@ {{/if}} {{#if $eq type 'font'}} - + {{/if}} {{#if $eq type 'code'}} @@ -143,7 +143,7 @@ {{#if hasChanges section}} {{_ "Save_to_enable_this_action"}} {{else}} - + {{/if}} {{/if}} diff --git a/packages/rocketchat-ui-admin/client/admin.js b/packages/rocketchat-ui-admin/client/admin.js index 645de8e8b588..5553324ade1c 100644 --- a/packages/rocketchat-ui-admin/client/admin.js +++ b/packages/rocketchat-ui-admin/client/admin.js @@ -191,6 +191,13 @@ Template.admin.helpers({ }; } }, + canAutocomplete() { + if (this.autocomplete === false) { + return { + autocomplete: 'off' + }; + } + }, hasChanges(section) { const group = FlowRouter.getParam('group'); const query = { From c9c0d8d8bdf9f3dc26d6ec8cf4ef14765b9b46e7 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Mon, 16 Apr 2018 11:35:53 -0300 Subject: [PATCH 04/79] added delete channel button (#10438) [FIX] Button to delete rooms by the owners wasn't appearing --- .../client/views/channelSettings.html | 6 +++--- .../client/views/channelSettings.js | 2 +- .../rocketchat-theme/client/imports/forms/button.css | 9 ++++++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/rocketchat-channel-settings/client/views/channelSettings.html b/packages/rocketchat-channel-settings/client/views/channelSettings.html index a24334281aa2..89f36607485b 100644 --- a/packages/rocketchat-channel-settings/client/views/channelSettings.html +++ b/packages/rocketchat-channel-settings/client/views/channelSettings.html @@ -245,8 +245,8 @@
+ {{#if canDeleteRoom}} + + {{/if}} diff --git a/packages/rocketchat-channel-settings/client/views/channelSettings.js b/packages/rocketchat-channel-settings/client/views/channelSettings.js index 3e13b3e06777..2f85b8d4389f 100644 --- a/packages/rocketchat-channel-settings/client/views/channelSettings.js +++ b/packages/rocketchat-channel-settings/client/views/channelSettings.js @@ -14,7 +14,7 @@ const common = { }); const roomType = room && room.t; - return roomType && RocketChat.roomTypes.roomTypes[room.t].canBeDeleted(room); + return roomType && RocketChat.roomTypes.roomTypes[roomType].canBeDeleted(room); }, canEditRoom() { const { _id } = Template.instance().room; diff --git a/packages/rocketchat-theme/client/imports/forms/button.css b/packages/rocketchat-theme/client/imports/forms/button.css index fc19732a90cc..b23df6a93aab 100644 --- a/packages/rocketchat-theme/client/imports/forms/button.css +++ b/packages/rocketchat-theme/client/imports/forms/button.css @@ -4,7 +4,11 @@ } &--icon > svg { - margin: 0 5px; + margin: 0 5px 0 -5px; + + .rtl & { + margin: 0 -5px 0 5px; + } font-size: 20px; fill: currentColor; @@ -107,6 +111,9 @@ border-style: solid; background: transparent; } + &--stack { + width: 100%; + } &.loading { position: relative; From 9502915e076841e983008d6bc920d29713117c3e Mon Sep 17 00:00:00 2001 From: Gabriel Delavald Date: Mon, 16 Apr 2018 11:38:45 -0300 Subject: [PATCH 05/79] Add reply box to quote and add quote on reply (#10437) [NEW] Add message preview when quoting another message --- packages/rocketchat-lib/client/MessageAction.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/rocketchat-lib/client/MessageAction.js b/packages/rocketchat-lib/client/MessageAction.js index 79747da1631d..dc6afdb31636 100644 --- a/packages/rocketchat-lib/client/MessageAction.js +++ b/packages/rocketchat-lib/client/MessageAction.js @@ -103,6 +103,7 @@ Meteor.startup(function() { action() { const message = this._arguments[1]; const {input} = chatMessages[message.rid]; + input.value = `@${ message.u.username } `; $(input) .focus() .data('reply', message) @@ -263,14 +264,10 @@ Meteor.startup(function() { action() { const message = this._arguments[1]; const {input} = chatMessages[message.rid]; - const url = RocketChat.MessageAction.getPermaLink(message._id); - const text = `[ ](${ url }) `; - if (input.value) { - input.value += input.value.endsWith(' ') ? '' : ' '; - } - input.value += text; - input.focus(); - $(input).trigger('change').trigger('input'); + $(input) + .focus() + .data('reply', message) + .trigger('dataChange'); }, condition(message) { if (RocketChat.models.Subscriptions.findOne({rid: message.rid}) == null) { From bdd28e9f7816dffe29ff6921dcec110daa44b6f6 Mon Sep 17 00:00:00 2001 From: Gabriel Delavald Date: Mon, 16 Apr 2018 11:39:46 -0300 Subject: [PATCH 06/79] Add some missing translations (#10435) * Add some missing translations * Add sv and pt-br translations --- packages/rocketchat-i18n/i18n/en.i18n.json | 1 + packages/rocketchat-i18n/i18n/pt-BR.i18n.json | 1 + packages/rocketchat-i18n/i18n/sv.i18n.json | 3 ++- packages/rocketchat-ui-flextab/client/tabs/membersList.html | 2 +- packages/rocketchat-ui/client/views/app/directory.html | 6 +++--- packages/rocketchat-ui/client/views/app/home.html | 2 +- packages/rocketchat-ui/client/views/app/popover.html | 2 +- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/rocketchat-i18n/i18n/en.i18n.json b/packages/rocketchat-i18n/i18n/en.i18n.json index 793fd1f1703d..2a545530cbbe 100644 --- a/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/packages/rocketchat-i18n/i18n/en.i18n.json @@ -428,6 +428,7 @@ "Comment_to_leave_on_closing_session": "Comment to Leave on Closing Session", "Common_Access": "Common Access", "Compact": "Compact", + "Computer": "Computer", "Confirm_password": "Confirm your password", "Content": "Content", "Conversation": "Conversation", diff --git a/packages/rocketchat-i18n/i18n/pt-BR.i18n.json b/packages/rocketchat-i18n/i18n/pt-BR.i18n.json index 364f0bc9908c..d3b22d8378c3 100644 --- a/packages/rocketchat-i18n/i18n/pt-BR.i18n.json +++ b/packages/rocketchat-i18n/i18n/pt-BR.i18n.json @@ -428,6 +428,7 @@ "Comment_to_leave_on_closing_session": "Comentário ao fechar sessão", "Common_Access": "Acesso comum", "Compact": "Compacto", + "Computer": "Computador", "Confirm_password": "Confirmar a senha", "Content": "Conteúdo", "Conversation": "Conversa", diff --git a/packages/rocketchat-i18n/i18n/sv.i18n.json b/packages/rocketchat-i18n/i18n/sv.i18n.json index c9a7348d6e20..6380667695bf 100644 --- a/packages/rocketchat-i18n/i18n/sv.i18n.json +++ b/packages/rocketchat-i18n/i18n/sv.i18n.json @@ -428,6 +428,7 @@ "Comment_to_leave_on_closing_session": "Kommentera att lämna på avslutande session", "Common_Access": "Gemensam åtkomst", "Compact": "Kompakt", + "Computer": "Dator", "Confirm_password": "Bekräfta ditt lösenord", "Content": "Innehåll", "Conversation": "Konversation", @@ -2242,4 +2243,4 @@ "your_message_optional": "ditt meddelande (valfri)", "Your_password_is_wrong": "Ditt lösenord är fel!", "Your_push_was_sent_to_s_devices": "Din push skickades till %s enheter" -} \ No newline at end of file +} diff --git a/packages/rocketchat-ui-flextab/client/tabs/membersList.html b/packages/rocketchat-ui-flextab/client/tabs/membersList.html index 6120ce4a177b..651b3e73f1a5 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/membersList.html +++ b/packages/rocketchat-ui-flextab/client/tabs/membersList.html @@ -9,7 +9,7 @@
{{> icon block="rc-input__icon-svg" icon="magnifier"}}
- +