diff --git a/packages/rocketchat-google-vision/.npm/package/npm-shrinkwrap.json b/packages/rocketchat-google-vision/.npm/package/npm-shrinkwrap.json index 689607dbd9b6..070d577237f3 100644 --- a/packages/rocketchat-google-vision/.npm/package/npm-shrinkwrap.json +++ b/packages/rocketchat-google-vision/.npm/package/npm-shrinkwrap.json @@ -1,9 +1,9 @@ { "dependencies": { "ajv": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", - "from": "ajv@>=4.9.1 <5.0.0" + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.2.2.tgz", + "from": "ajv@>=5.1.0 <6.0.0" }, "ansi-regex": { "version": "2.1.1", @@ -41,9 +41,9 @@ "from": "asn1@>=0.2.3 <0.3.0" }, "assert-plus": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", - "from": "assert-plus@>=0.2.0 <0.3.0" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "from": "assert-plus@>=1.0.0 <2.0.0" }, "async": { "version": "2.5.0", @@ -56,14 +56,14 @@ "from": "asynckit@>=0.4.0 <0.5.0" }, "aws-sign2": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", - "from": "aws-sign2@>=0.6.0 <0.7.0" + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "from": "aws-sign2@>=0.7.0 <0.8.0" }, "aws4": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", - "from": "aws4@>=1.2.1 <2.0.0" + "from": "aws4@>=1.6.0 <2.0.0" }, "balanced-match": { "version": "1.0.0", @@ -81,9 +81,9 @@ "from": "bcrypt-pbkdf@>=1.0.0 <2.0.0" }, "boom": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", - "from": "boom@>=2.0.0 <3.0.0" + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", + "from": "boom@>=4.0.0 <5.0.0" }, "brace-expansion": { "version": "1.1.8", @@ -171,9 +171,16 @@ "from": "create-error-class@>=3.0.2 <4.0.0" }, "cryptiles": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", - "from": "cryptiles@>=2.0.0 <3.0.0" + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", + "from": "cryptiles@>=3.0.0 <4.0.0", + "dependencies": { + "boom": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", + "from": "boom@>=5.0.0 <6.0.0" + } + } }, "crypto-random-string": { "version": "1.0.0", @@ -183,14 +190,7 @@ "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "from": "dashdash@>=1.12.0 <2.0.0", - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "from": "assert-plus@>=1.0.0 <2.0.0" - } - } + "from": "dashdash@>=1.12.0 <2.0.0" }, "decamelize": { "version": "1.2.0", @@ -242,15 +242,20 @@ "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", "from": "extsprintf@1.3.0" }, + "fast-deep-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", + "from": "fast-deep-equal@>=1.0.0 <2.0.0" + }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "from": "forever-agent@>=0.6.1 <0.7.0" }, "form-data": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", - "from": "form-data@>=2.1.1 <2.2.0" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.1.tgz", + "from": "form-data@>=2.3.1 <2.4.0" }, "fs.realpath": { "version": "1.0.0", @@ -277,14 +282,7 @@ "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "from": "getpass@>=0.1.1 <0.2.0", - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "from": "assert-plus@>=1.0.0 <2.0.0" - } - } + "from": "getpass@>=0.1.1 <0.2.0" }, "glob": { "version": "7.1.2", @@ -933,14 +931,14 @@ "from": "gtoken@>=1.2.1 <2.0.0" }, "har-schema": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", - "from": "har-schema@>=1.0.5 <2.0.0" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "from": "har-schema@>=2.0.0 <3.0.0" }, "har-validator": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", - "from": "har-validator@>=4.2.1 <4.3.0" + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", + "from": "har-validator@>=5.0.3 <5.1.0" }, "hash-stream-validation": { "version": "0.2.1", @@ -948,19 +946,19 @@ "from": "hash-stream-validation@>=0.2.1 <0.3.0" }, "hawk": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", - "from": "hawk@>=3.1.3 <3.2.0" + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", + "from": "hawk@>=6.0.2 <6.1.0" }, "hoek": { - "version": "2.16.3", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "from": "hoek@>=2.0.0 <3.0.0" + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.0.tgz", + "from": "hoek@>=4.0.0 <5.0.0" }, "http-signature": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", - "from": "http-signature@>=1.1.0 <1.2.0" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "from": "http-signature@>=1.2.0 <1.3.0" }, "imurmurhash": { "version": "0.1.4", @@ -1027,6 +1025,11 @@ "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", "from": "json-schema@0.2.3" }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "from": "json-schema-traverse@>=0.3.0 <0.4.0" + }, "json-stable-stringify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", @@ -1045,14 +1048,7 @@ "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "from": "jsprim@>=1.2.2 <2.0.0", - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "from": "assert-plus@1.0.0" - } - } + "from": "jsprim@>=1.2.2 <2.0.0" }, "jwa": { "version": "1.1.5", @@ -1142,7 +1138,7 @@ "oauth-sign": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "from": "oauth-sign@>=0.8.1 <0.9.0" + "from": "oauth-sign@>=0.8.2 <0.9.0" }, "object-assign": { "version": "4.1.1", @@ -1170,9 +1166,9 @@ "from": "path-is-absolute@>=1.0.0 <2.0.0" }, "performance-now": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", - "from": "performance-now@>=0.2.0 <0.3.0" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "from": "performance-now@>=2.1.0 <3.0.0" }, "pify": { "version": "2.3.0", @@ -1225,9 +1221,9 @@ "from": "punycode@>=1.4.1 <2.0.0" }, "qs": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", - "from": "qs@>=6.4.0 <6.5.0" + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "from": "qs@>=6.5.1 <6.6.0" }, "readable-stream": { "version": "2.3.3", @@ -1235,8 +1231,8 @@ "from": "readable-stream@>=2.2.2 <3.0.0" }, "request": { - "version": "2.81.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", + "version": "2.82.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.82.0.tgz", "from": "request@>=2.79.0 <3.0.0" }, "retry-request": { @@ -1260,9 +1256,9 @@ "from": "signal-exit@>=3.0.2 <4.0.0" }, "sntp": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", - "from": "sntp@>=1.0.0 <2.0.0" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.0.2.tgz", + "from": "sntp@>=2.0.0 <3.0.0" }, "split-array-stream": { "version": "1.0.3", @@ -1272,14 +1268,7 @@ "sshpk": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", - "from": "sshpk@>=1.7.0 <2.0.0", - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "from": "assert-plus@>=1.0.0 <2.0.0" - } - } + "from": "sshpk@>=1.7.0 <2.0.0" }, "stream-events": { "version": "1.0.2", @@ -1309,7 +1298,7 @@ "stringstream": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "from": "stringstream@>=0.0.4 <0.1.0" + "from": "stringstream@>=0.0.5 <0.1.0" }, "strip-ansi": { "version": "3.0.1", @@ -1329,7 +1318,7 @@ "tough-cookie": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", - "from": "tough-cookie@>=2.3.0 <2.4.0" + "from": "tough-cookie@>=2.3.2 <2.4.0" }, "tunnel-agent": { "version": "0.6.0", @@ -1359,19 +1348,12 @@ "uuid": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", - "from": "uuid@>=3.0.0 <4.0.0" + "from": "uuid@>=3.1.0 <4.0.0" }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "from": "verror@1.10.0", - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "from": "assert-plus@>=1.0.0 <2.0.0" - } - } + "from": "verror@1.10.0" }, "window-size": { "version": "0.1.4", diff --git a/packages/rocketchat-i18n/i18n/en.i18n.json b/packages/rocketchat-i18n/i18n/en.i18n.json index 2dff5bac7fb2..3fd343c7f753 100644 --- a/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/packages/rocketchat-i18n/i18n/en.i18n.json @@ -704,6 +704,7 @@ "Hide_flextab": "Hide right side bar with click", "Hide_Group_Warning": "Are you sure you want to hide the group \"%s\"?", "Hide_Private_Warning": "Are you sure you want to hide the discussion with \"%s\"?", + "Hide_Livechat_Warning": "Are you sure you want to hide the livechat with \"%s\"?", "Hide_room": "Hide room", "Hide_Room_Warning": "Are you sure you want to hide the room \"%s\"?", "Hide_roles": "Hide roles", @@ -981,6 +982,7 @@ "Least_Amount": "Least Amount", "Leave_Group_Warning": "Are you sure you want to leave the group \"%s\"?", "Leave_Private_Warning": "Are you sure you want to leave the discussion with \"%s\"?", + "Leave_Livechat_Warning": "Are you sure you want to leave the livechat with \"%s\"?", "Leave_room": "Leave room", "Leave_Room_Warning": "Are you sure you want to leave the room \"%s\"?", "Leave_the_current_channel": "Leave the current channel", diff --git a/packages/rocketchat-theme/client/imports/components/sidebar/sidebar-item.css b/packages/rocketchat-theme/client/imports/components/sidebar/sidebar-item.css index 5d11a43474ff..98248e46e3d2 100644 --- a/packages/rocketchat-theme/client/imports/components/sidebar/sidebar-item.css +++ b/packages/rocketchat-theme/client/imports/components/sidebar/sidebar-item.css @@ -18,6 +18,16 @@ border-radius: var(--sidebar-item-radius); align-items: center; + &:hover { + & .sidebar-item__menu { + display: block; + } + + & .badge { + display: none; + } + } + &--active { background-color: var(--color-dark-light); } @@ -122,6 +132,14 @@ font-size: var(--sidebar-item-text-size); line-height: var(--sidebar-item-height); } + + &__menu { + display: none; + + &-icon { + fill: var(--color-white); + } + } } .rtl .sidebar-item__user-status { diff --git a/packages/rocketchat-ui-master/public/icons.svg b/packages/rocketchat-ui-master/public/icons.svg index 9307d5af1fd6..f84e5c748a13 100644 --- a/packages/rocketchat-ui-master/public/icons.svg +++ b/packages/rocketchat-ui-master/public/icons.svg @@ -61,4 +61,5 @@ + diff --git a/packages/rocketchat-ui-sidenav/client/sidebarItem.html b/packages/rocketchat-ui-sidenav/client/sidebarItem.html index ae562f081e0e..34cd13069b97 100644 --- a/packages/rocketchat-ui-sidenav/client/sidebarItem.html +++ b/packages/rocketchat-ui-sidenav/client/sidebarItem.html @@ -17,8 +17,11 @@ {{#if unread}} - {{unread}} + {{unread}} {{/if}} + diff --git a/packages/rocketchat-ui-sidenav/client/sidebarItem.js b/packages/rocketchat-ui-sidenav/client/sidebarItem.js index a2ab60595169..bf3b20c2152b 100644 --- a/packages/rocketchat-ui-sidenav/client/sidebarItem.js +++ b/packages/rocketchat-ui-sidenav/client/sidebarItem.js @@ -1,4 +1,4 @@ -/* globals menu */ +/* globals menu popover */ Template.sidebarItem.helpers({ canLeave() { @@ -17,6 +17,44 @@ Template.sidebarItem.helpers({ Template.sidebarItem.events({ 'click [data-id], click .sidebar-item__link'() { return menu.close(); + }, + 'click .sidebar-item__menu'(e) { + const config = { + popoverClass: 'sidebar-item', + columns: [ + { + groups: [ + { + items: [ + { + icon: 'eye-off', + name: t('Hide_room'), + type: 'sidebar-item', + id: 'hide' + }, + { + icon: 'sign-out', + name: t('Leave_room'), + type: 'sidebar-item', + id: 'leave' + } + ] + } + ] + } + ], + mousePosition: { + x: e.clientX, + y: e.clientY + }, + data: { + template: this.t, + rid: this.rid, + name: this.name + } + }; + + popover.open(config); } }); diff --git a/packages/rocketchat-ui/client/views/app/popover.js b/packages/rocketchat-ui/client/views/app/popover.js index 2755feaa8032..639ffe4626d9 100644 --- a/packages/rocketchat-ui/client/views/app/popover.js +++ b/packages/rocketchat-ui/client/views/app/popover.js @@ -52,8 +52,6 @@ Template.popover.onRendered(function() { left = mousePosition.x - popoverWidth; } else if (mousePosition.x <= popoverWidth) { left = isRtl() ? mousePosition.x + 10 : 10; - } else if (mousePosition.x <= windowWidth / 2) { - left = mousePosition.x; } else { left = mousePosition.x - popoverWidth; } @@ -129,5 +127,85 @@ Template.popover.events({ } popover.close(); + }, + 'click [data-type="sidebar-item"]'(e, instance) { + popover.close(); + const { rid, name, template } = instance.data.data; + + if (e.currentTarget.dataset.id === 'hide') { + let warnText; + switch (template) { + case 'c': warnText = 'Hide_Room_Warning'; break; + case 'p': warnText = 'Hide_Group_Warning'; break; + case 'd': warnText = 'Hide_Private_Warning'; break; + case 'l': warnText = 'Hide_Livechat_Warning'; break; + } + + return swal({ + title: t('Are_you_sure'), + text: warnText ? t(warnText, name) : '', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#DD6B55', + confirmButtonText: t('Yes_hide_it'), + cancelButtonText: t('Cancel'), + closeOnConfirm: true, + html: false + }, function() { + if (['channel', 'group', 'direct'].includes(FlowRouter.getRouteName()) && (Session.get('openedRoom') === rid)) { + FlowRouter.go('home'); + } + + Meteor.call('hideRoom', rid, function(err) { + if (err) { + handleError(err); + } else if (rid === Session.get('openedRoom')) { + Session.delete('openedRoom'); + } + }); + }); + } else { + let warnText; + switch (template) { + case 'c': warnText = 'Leave_Room_Warning'; break; + case 'p': warnText = 'Leave_Group_Warning'; break; + case 'd': warnText = 'Leave_Private_Warning'; break; + case 'l': warnText = 'Hide_Livechat_Warning'; break; + } + + swal({ + title: t('Are_you_sure'), + text: t(warnText, name), + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#DD6B55', + confirmButtonText: t('Yes_leave_it'), + cancelButtonText: t('Cancel'), + closeOnConfirm: false, + html: false + }, function(isConfirm) { + if (isConfirm) { + Meteor.call('leaveRoom', rid, function(err) { + if (err) { + swal({ + title: t('Warning'), + text: handleError(err, false), + type: 'warning', + html: false + }); + } else { + swal.close(); + if (['channel', 'group', 'direct'].includes(FlowRouter.getRouteName()) && (Session.get('openedRoom') === rid)) { + FlowRouter.go('home'); + } + + RoomManager.close(rid); + } + }); + } else { + swal.close(); + } + }); + } } });