Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] threads review/adjustments #572

Closed
wants to merge 90 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
46f65b4
removed sidenav button
ggazzo Feb 13, 2019
6da53aa
removed slashcommands
ggazzo Feb 13, 2019
0fe376f
create thread message action function improved
ggazzo Feb 13, 2019
c2f7fbb
thread from message box method refactor
ggazzo Feb 13, 2019
f8f4c96
Merge branch 'develop' of github.com:RocketChat/Rocket.Chat into threads
ggazzo Feb 14, 2019
74392fa
moved create thread and channel to popup
ggazzo Feb 19, 2019
c953ad6
delete room, deletes all chain
ggazzo Feb 19, 2019
9443868
added addRoomAccessValidator to allow user to join private subthreads
ggazzo Feb 19, 2019
0466e1b
Merge branch 'pr/11803-mrsimpson-core/threading' into threads
ggazzo Feb 20, 2019
fa889d4
fix imports
ggazzo Feb 20, 2019
f8caa84
fix imports
ggazzo Feb 20, 2019
ab8c169
Merge branch 'core/threading' of github.com:assistify/Rocket.Chat int…
ggazzo Feb 20, 2019
2332f0e
deleting message will delete the thread
ggazzo Feb 20, 2019
5c964e2
fix back icon
ggazzo Feb 20, 2019
00c59f2
Regression: Add debounce on admin users search to avoid blocking by D…
MarcosSpessatto Feb 21, 2019
0369f89
fixed logic to prune thread message
ggazzo Feb 21, 2019
af87678
Merge branch 'develop' into threads
ggazzo Feb 21, 2019
8a7fa76
send message system on thread created
ggazzo Feb 22, 2019
e1e7507
Merge branch 'threads' of github.com:RocketChat/Rocket.Chat into threads
ggazzo Feb 22, 2019
cdfc3c0
Move mongo config away from cors package (#13531)
rodrigok Feb 22, 2019
5f0180d
[IMPROVE] Allow custom rocketchat username for crowd users and enable…
steerben Feb 22, 2019
61debea
[IMPROVE] Disable X-Powered-By header in all known express middleware…
sampaiodiego Feb 25, 2019
5addfc4
fix typo and changed _id for username
ggazzo Feb 25, 2019
23942a8
Merge branch 'develop' into threads
ggazzo Feb 25, 2019
b96b825
Regression: fix app pages styles (#13567)
ggazzo Feb 25, 2019
361ca5b
Regression: Handle showing/hiding input in messageBox (#13564)
tassoevan Feb 25, 2019
9eeee74
Merge remote-tracking branch 'origin/develop' into threads
ggazzo Feb 25, 2019
b878efa
Depack: Use mainModule for root files (#13508)
rodrigok Feb 26, 2019
c5edd57
Fix SauMonitor (#13553)
MarcosSpessatto Feb 26, 2019
79edb4c
Fix missing import (#13573)
MarcosSpessatto Feb 26, 2019
50adf45
[IMPROVE] Remove dangling side-nav styles (#13584)
tassoevan Feb 28, 2019
f04fbf7
[FIX] allow user to logout before set username (#13439)
ggazzo Feb 28, 2019
b16fe93
Fix: Mongo.setConnectionOptions was not being set correctly (#13586)
rodrigok Feb 28, 2019
8f40051
[FIX] mention-links not being always resolved (#11745)
mrsimpson Mar 1, 2019
8bddc37
Fix issue cannot list channels by name (#12952)
huydang284 Mar 1, 2019
576c38a
[FIX] Typo in a referrer header in inject.js file (#13469)
algomaster99 Mar 1, 2019
36a0fc3
[FIX] Right arrows in default HTML content (#13502)
tassoevan Mar 1, 2019
fd47795
[NEW] legal notice page (#12472)
localguru Mar 1, 2019
2f94689
[FIX] .bin extension added to attached file names (#13468)
Hudell Mar 1, 2019
9672b4f
[NEW] reply with a file (#12095)
rssilva Mar 1, 2019
3e28428
[FIX] Ability to activate an app installed by zip even offline (#13563)
MarcosSpessatto Mar 2, 2019
84633d2
[NEW] Permission to assign roles (#13597)
MarcosSpessatto Mar 2, 2019
0105b8d
Add better positioning for tooltips on edges (#13472)
tassoevan Mar 2, 2019
39e8fe1
Fix rest Rate limiter to refresh routes when time or number of calls …
MarcosSpessatto Mar 2, 2019
474c918
Fix attachment dates that are null from showing December... (#13428)
wreiske Mar 2, 2019
d0e0325
correct german translations (#13299)
soenkef Mar 2, 2019
dcc9b3e
Fix lint
rodrigok Mar 2, 2019
54b8dbd
[FIX] Fixed rocketchat-oembed meta fragment pulling (#13056)
wreiske Mar 2, 2019
2e9b0ff
[IMPROVE] Deprecate fixCordova helper (#13598)
tassoevan Mar 2, 2019
afdfd75
[FIX] Non-latin room names and other slugifications (#13467)
tassoevan Mar 2, 2019
1343fe6
Add offset parameter to channels.history, groups.history, dm.history …
xbolshe Mar 2, 2019
5ec74ad
Fix wrong imports (#13601)
rodrigok Mar 4, 2019
e7227de
Add retries to docker-compose.yml, to wait for MongoDB to be ready (#…
tiangolo Mar 4, 2019
561a851
[FIX] Change userId of rate limiter, change to logged user (#13442)
MarcosSpessatto Mar 4, 2019
5bd7e12
Force some words to translate in other languages (#13367)
tassoevan Mar 4, 2019
2aa0562
Fixes #13187 (#13599)
knrt10 Mar 4, 2019
bdde3f8
[NEW] Show department field on Livechat visitor panel (#13530)
renatobecker Mar 4, 2019
5787fb2
[FIX] Bugfix markdown Marked link new tab (#13245)
DeviaVir Mar 4, 2019
dc51cdc
Update README.md (#13612)
Mr-Linus Mar 5, 2019
a080cd9
[NEW] Federation (#12370)
alansikora Mar 6, 2019
76b5f7f
LingoHub Update :rocket: (#13623)
engelgabriel Mar 6, 2019
02c6312
Regression: Fix API tests #13625
sampaiodiego Mar 6, 2019
fe9f809
Fix threading i18n (#13578)
mrsimpson Mar 6, 2019
074a712
Merge branch 'develop' into threads
sampaiodiego Mar 6, 2019
22002de
Allow sending message before joining a thread
sampaiodiego Mar 7, 2019
773ed6f
Allow any character on thread name
sampaiodiego Mar 7, 2019
1e54d65
Fix 404 error when trying to see a not joined thread
sampaiodiego Mar 7, 2019
46b5231
Change thread icon
sampaiodiego Mar 7, 2019
6ec15c8
Do not allow change avatars of another users without permission (#13629)
MarcosSpessatto Mar 7, 2019
dce3144
auto invite user, freeze thread settings
ggazzo Mar 7, 2019
d656657
Merge branch 'threads' of github.com:RocketChat/Rocket.Chat into threads
sampaiodiego Mar 7, 2019
7773fa6
Create threads as private groups
sampaiodiego Mar 7, 2019
d005119
Prevent nested threads
sampaiodiego Mar 7, 2019
2c68516
fix search room
ggazzo Mar 7, 2019
09ae45c
name suggestion
ggazzo Mar 7, 2019
8b57358
changed text field name
ggazzo Mar 7, 2019
782b007
Fix getRoomById too-many-calls by adding a memoize
sampaiodiego Mar 7, 2019
33a3a6f
threads sidebar
ggazzo Mar 7, 2019
16e90e2
Create a new message to notify about a thread
sampaiodiego Mar 7, 2019
4045d3d
Merge branch 'threads' of github.com:RocketChat/Rocket.Chat into threads
sampaiodiego Mar 7, 2019
98d40c0
removed useless code
ggazzo Mar 7, 2019
a4ce2d0
Merge branch 'develop' into threads
ggazzo Mar 7, 2019
f933e59
useless configs
ggazzo Mar 7, 2019
3885401
Merge branch 'threads' of github.com:RocketChat/Rocket.Chat into threads
ggazzo Mar 7, 2019
30900b7
Merge branch 'threads' of github.com:RocketChat/Rocket.Chat into threads
sampaiodiego Mar 8, 2019
881980e
Fix tests
sampaiodiego Mar 8, 2019
108c13b
Move package to mainModule
sampaiodiego Mar 8, 2019
359b12e
Respect setting to show threads on sidebar
sampaiodiego Mar 8, 2019
574b96f
Remove slash command files
sampaiodiego Mar 8, 2019
d2be600
Add condition to show threads category
sampaiodiego Mar 8, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ rocketchat:slackbridge
rocketchat:slashcommands-archive
rocketchat:slashcommands-asciiarts
rocketchat:slashcommands-create
rocketchat:slashcommands-create-thread
rocketchat:slashcommands-help
rocketchat:slashcommands-hide
rocketchat:slashcommands-invite
Expand Down
3 changes: 1 addition & 2 deletions .meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ rocketchat:mailer@0.0.1
rocketchat:mailmessages@0.0.1
rocketchat:mapview@0.0.1
rocketchat:markdown@0.0.2
rocketchat:metrics@0.0.1
rocketchat:mentions@0.0.1
rocketchat:mentions-flextab@0.0.1
rocketchat:message-action@0.0.1
Expand All @@ -204,6 +203,7 @@ rocketchat:message-mark-as-unread@0.0.1
rocketchat:message-pin@0.0.1
rocketchat:message-snippet@0.0.1
rocketchat:message-star@0.0.1
rocketchat:metrics@0.0.1
rocketchat:migrations@0.0.1
rocketchat:models@1.0.0
rocketchat:monitoring@2.30.2_3
Expand All @@ -226,7 +226,6 @@ rocketchat:slackbridge@0.0.1
rocketchat:slashcommands-archive@0.0.1
rocketchat:slashcommands-asciiarts@0.0.1
rocketchat:slashcommands-create@0.0.1
rocketchat:slashcommands-create-thread@0.0.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you not like the slash command? I use it frequently myself

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will reinsert :)

rocketchat:slashcommands-help@0.0.1
rocketchat:slashcommands-hide@0.0.1
rocketchat:slashcommands-invite@0.0.1
Expand Down
69 changes: 29 additions & 40 deletions packages/assistify-threading/client/createThreadMessageAction.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,37 @@
import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker';
import { RocketChat } from 'meteor/rocketchat:lib';
import { FlowRouter } from 'meteor/kadira:flow-router';
import { ReactiveVar } from 'meteor/reactive-var';
import { Tracker } from 'meteor/tracker';
import { ChatMessage } from 'meteor/rocketchat:models';
import { call } from 'meteor/rocketchat:lib';

const condition = (rid, uid) => {
if (!RocketChat.models.Subscriptions.findOne({ rid })) {
return false;
}
return uid !== Meteor.userId() ? RocketChat.authz.hasPermission('start-thread-other-user') : RocketChat.authz.hasPermission('start-thread');
};

Meteor.startup(function() {
const instance = this;
instance.room = new ReactiveVar('');
RocketChat.MessageAction.addButton({
id: 'start-thread',
icon: 'thread',
label: 'Thread_start',
context: ['message', 'message-mobile'],
action() {
const message = this._arguments[1];
Meteor.call('createThreadFromMessage', message, function(error, result) {
if (result) {
// remove the hidden message from the UI - the message list is not reactive
Tracker.nonreactive(function() {
ChatMessage.remove({
_id: message._id,
});
});
Tracker.autorun(() => {
if (RocketChat.settings.get('Thread_from_context_menu') !== 'button') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

much better... Kind-of-ashamed...

return RocketChat.MessageAction.removeButton('start-thread');
}

// navigate to the newly created room
FlowRouter.goToRoomById(result._id);
}
});
},
condition(message) {
if (RocketChat.models.Subscriptions.findOne({ rid: message.rid }) == null) {
return false;
}
if (RocketChat.settings.get('Thread_from_context_menu') !== 'button') {
return false;
}
if (message.u._id !== Meteor.userId()) {
return RocketChat.authz.hasAtLeastOnePermission('start-thread-other-user');
} else {
return RocketChat.authz.hasAtLeastOnePermission('start-thread');
}
},
order: 0,
group: 'menu',
RocketChat.MessageAction.addButton({
id: 'start-thread',
icon: 'thread',
label: 'Thread_start',
context: ['message', 'message-mobile'],
async action() {
const [, message] = this._arguments;
const { _id } = await call('createThreadFromMessage', message);
FlowRouter.goToRoomById(_id);
},
condition({ rid, u: { _id: uid } }) {
return condition(rid, uid);
},
order: 0,
group: 'menu',
});
});
});
24 changes: 17 additions & 7 deletions packages/assistify-threading/client/threadFromMessageBox.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { FlowRouter } from 'meteor/kadira:flow-router';
import { Tracker } from 'meteor/tracker';

RocketChat.messageBox.actions.add('Create_new', 'Thread', {
id: 'start-thread',
icon: 'thread',
condition: () => (navigator.getUserMedia || navigator.webkitGetUserMedia) && RocketChat.settings.get('FileUpload_Enabled') && RocketChat.settings.get('Message_VideoRecorderEnabled') && (!RocketChat.settings.get('FileUpload_MediaTypeWhiteList') || RocketChat.settings.get('FileUpload_MediaTypeWhiteList').match(/video\/webm|video\/\*/i)),
action() {
return FlowRouter.go('create-thread');
},
Meteor.startup(function() {
Tracker.autorun(() => {
if (RocketChat.settings.get('Thread_from_context_menu') !== 'button') {
return RocketChat.messageBox.actions.remove('Create_new');
}
RocketChat.messageBox.actions.add('Create_new', 'Thread', {
id: 'start-thread',
icon: 'thread',
condition: () => true,
action() {
return FlowRouter.go('create-thread');
},
});

});
});

This file was deleted.

19 changes: 0 additions & 19 deletions packages/rocketchat-slashcommands-create-thread/package.js

This file was deleted.

17 changes: 0 additions & 17 deletions packages/rocketchat-slashcommands-create-thread/server/server.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/rocketchat-ui-sidenav/client/sideNav.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
<aside class="sidebar sidebar--{{sidebarViewMode}} {{#if sidebarHideAvatar}}sidebar--hide-avatar{{/if}}" role="navigation">
{{> sidebarHeader }}
{{#if loggedInUser}}
{{#if threadingFromSidebar}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I absolutely understand you didn't like that button - I don't like it either. But: Is there a replacement for that? I believe there should be an option to start a thread without opening the room first.

<button class="create-thread-sidebar-button rc-button rc-button--primary js-create-thread">{{> icon icon="plus"}} {{_ "Thread_start"}}</button>
{{/if}}
<div class="unread-rooms background-primary-action-color color-primary-action-contrast top-unread-rooms hidden">
{{_ "More_unreads"}} <i class="icon-up-big"></i>
</div>
Expand Down
8 changes: 0 additions & 8 deletions packages/rocketchat-ui-sidenav/client/sideNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ Template.sideNav.helpers({
return String(settings.get('Layout_Sidenav_Footer')).trim();
},

threadingFromSidebar() {
return RocketChat.authz.hasPermission('start-thread') && RocketChat.getUserPreference(Meteor.userId(), 'sidebarShowThreads') && !Meteor.isCordova;
},

roomType() {
return roomTypes.getTypes().map((roomType) => ({
template: roomType.customTemplate || 'roomList',
Expand Down Expand Up @@ -68,10 +64,6 @@ Template.sideNav.events({
'dropped .sidebar'(e) {
return e.preventDefault();
},

'click .js-create-thread'() {
return FlowRouter.go('create-thread');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you left the route, as far as I can see. 👍

},
});

Template.sideNav.onRendered(function() {
Expand Down