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

[NEW] WIP: custom mention groups #16311

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

maciek134
Copy link

@maciek134 maciek134 commented Jan 22, 2020

Don't mind the commit message, it will be rebased.

Closes RocketChat/feature-requests#634

This implements custom mention groups. When creating a group an admin can set:

  • name
  • description
  • whether the group also notifies a specific role
  • whether the group also notifies a specific group (so in combination with a few other options you can make a transparent copy that notifies offline users too)
  • whether users can join this group themselves WIP
  • whether the group notifies offline people (like @all vs @here)
  • whether the group notifies people outside a channel
  • whether the group works in specific channels only

Here is an example of how it looks like for the user:

WIP:

  • I need to finish adding tests, at the moment the coverage of these features is close to zero
  • I need to finish UI for allowing users to assign themselves to the groups that have it enabled
  • missing translations

@lgtm-com
Copy link

lgtm-com bot commented Jan 22, 2020

This pull request introduces 7 alerts when merging 85b9672 into bf17f4c - view on LGTM.com

new alerts:

  • 7 for Unused variable, import, function or class

@fdellwing
Copy link

I rly would like to test it, but I'm somehow unable to start RC from your fork.

Error Log

[11:16 root@FADE-Test Rocket.Chat] (feat/group-notifications) > meteor --allow-superuser npm start

Even with METEOR_ALLOW_SUPERUSER or --allow-superuser, permissions in your app directory will be incorrect if you ever attempt to perform any Meteor tasks as a normal user. If you need to fix your permissions, run the following command
from the root of your project:

  sudo chown -Rh <username> .meteor/local

                                              
> Rocket.Chat@2.5.0-develop start /root/Rocket.Chat
> meteor


Even with METEOR_ALLOW_SUPERUSER or --allow-superuser, permissions in your app directory will be incorrect if you ever attempt to perform any Meteor tasks as a normal user. If you need to fix your permissions, run the following command
from the root of your project:

  sudo chown -Rh <username> .meteor/local

[[[[[ ~/Rocket.Chat ]]]]]                     

=> Started proxy.                             
WARNING: npm peer requirements (for juliancwirko:postcss) not installed:
 - postcss@7.0.6 installed, postcss@^6.0.22 needed
 - postcss-load-config@2.0.0 installed, postcss-load-config@^1.2.0 needed

Read more about installing npm peer dependencies:
  http://guide.meteor.com/using-packages.html#peer-npm-dependencies

=> Meteor 1.9 is available. Update this project with 'meteor update'.
=> Started MongoDB.                           
Browserslist: caniuse-lite is outdated. Please run next command `npm update`
/root/.meteor/packages/coffeescript/.1.0.17.mg38nj.fxnij++os+web.browser+web.cordova/plugin.compileCoffeescript.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:116
      throw error;
      ^

Error: spawn ENOMEM
    at ChildProcess.spawn (internal/child_process.js:313:11)
    at exports.spawn (child_process.js:508:9)
    at exports.execFile (child_process.js:218:15)
    at resolve (/root/.meteor/packages/meteor-tool/.1.8.3.g4mka5.pvict++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/files.ts:141:7)
    at new Promise (<anonymous>)
    at Object.findGitCommitHash (/root/.meteor/packages/meteor-tool/.1.8.3.g4mka5.pvict++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/files.ts:138:10)
    at /tools/isobuild/bundler.js:2963:66
    at /tools/isobuild/bundler.js:3370:22
    at Object.capture (/tools/utils/buildmessage.js:283:5)
    at bundle (/tools/isobuild/bundler.js:3185:31)
    at files.withCache (/tools/isobuild/bundler.js:3130:32)
    at Slot.withValue (/root/.meteor/packages/meteor-tool/.1.8.3.g4mka5.pvict++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/@wry/context/lib/context.js:73:29)
    at Object.withCache (/root/.meteor/packages/meteor-tool/.1.8.3.g4mka5.pvict++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/files.ts:1647:39)
    at Object.bundle (/tools/isobuild/bundler.js:3130:16)
    at Profile.run (/tools/runners/run-app.js:572:24)
    at Function.run (/root/.meteor/packages/meteor-tool/.1.8.3.g4mka5.pvict++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/tool-env/tools/tool-env/profile.ts:289:14)
    at bundleApp (/tools/runners/run-app.js:571:34)
    at AppRunner._runOnce (/tools/runners/run-app.js:613:35)
    at AppRunner._fiber (/tools/runners/run-app.js:929:28)
    at /tools/runners/run-app.js:401:12
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Rocket.Chat@2.5.0-develop start: `meteor`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the Rocket.Chat@2.5.0-develop start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Will try to find the problem.

@fdellwing
Copy link

fdellwing commented Jan 23, 2020

Got it to run (it takes over 5gb of RAM, that was the problem).

Sadly RC still does not work and there are two errors in devtools:

Error: Cannot find module 'meteor/mizzao:autocomplete' modules-runtime.js:232:12
There is no route for the path: / kadira_flow-router.js:517:13
uncaught exception: undefined

The page stays grey with the loading bubbles.

Running the develop branch from RocketChat/Rocket.Chat works fine.


I ran meteor add mizzao:autocomplete and now get another error:

Error: There are multiple templates named 'inputAutocomplete'. Each template needs a unique name. templating-runtime.js:55:13
There is no route for the path: / kadira_flow-router.js:517:13
uncaught exception: undefined

@maciek134
Copy link
Author

@fdellwing weird, I didn't add any dependencies and the autocomplete module was already used in RC. Maybe try rm -rf node_modules and meteor npm install?

@fdellwing
Copy link

Doing grep -r 'meteor/mizzao:autocomplete' on the develop branch shows no result. But you import it in line 6 of app/ui/client/components/userAutocomplete.js.

@maciek134
Copy link
Author

maciek134 commented Jan 23, 2020

@fdellwing I see it now, PR #15956 released in 2.4.0 on 2019-12-27 removed this library, I guess a simple pull --rebase isn't going to be enough, I'll have to look through the codebase again, a lot has changed since I started working on this.

@fdellwing
Copy link

fdellwing commented Jan 24, 2020

[08:29 root@FADE-Test Rocket.Chat] (feat/group-notifications[**]) > git diff
      1 diff --git a/app/ui/client/components/userAutocomplete.js b/app/ui/client/components/userAutocomplete.js
      2 index b4ca24077..97f0b9180 100644
      3 --- a/app/ui/client/components/userAutocomplete.js
      4 +++ b/app/ui/client/components/userAutocomplete.js
      5 @@ -3,7 +3,7 @@ import { ReactiveVar } from 'meteor/reactive-var';
      6  import { Blaze } from 'meteor/blaze';
      7  import { Session } from 'meteor/session';
      8  import { Template } from 'meteor/templating';
      9 -import { AutoComplete } from 'meteor/mizzao:autocomplete';
     10 +import { AutoComplete } from '../../../meteor-autocomplete/client';
     11  import { Deps } from 'meteor/deps';
     12  
     13  import './userAutocomplete.html';

Seems to work atm, no idea if it breaks something further down the line.


Edit: Found something not working with this autocomplete. Every autocomplete now searches the users instead of roles, groups or channel.

@maciek134
Copy link
Author

Oh yeah, that's not going to work, the new autocomplete uses REST, while the old one used subscriptions. I'll try to push a fix in the evening, along with linting and proper tests.

@fdellwing
Copy link

Any news on this?

@maciek134
Copy link
Author

maciek134 commented Feb 11, 2020

Sorry, I've been on a vacation. I'll push the fixes today.

EDIT: pushed fixes, now it should work. I've also added missing translations and fixed linting. I'll add missing tests and users assigning themselves tomorrow.

Don't mind the commit message, it will be rebased.
@fdellwing
Copy link

fdellwing commented Feb 13, 2020

Sadly, this happens:

uncaught exception: Error: Match error: Match error: Expected string, got function match.js:42:4
    check match.js:42
    on client.js:152
    onAll Notifications.js:62
    Notifications Notifications.js:21
    module Notifications.js:99
    fileEvaluate modules-runtime.js:346
    require modules-runtime.js:248
    moduleLink modules.js:389
    module CachedCollection.js:1
    fileEvaluate modules-runtime.js:346
    require modules-runtime.js:248
    moduleLink modules.js:389
    module index.js:1
    fileEvaluate modules-runtime.js:346
    require modules-runtime.js:248
    moduleLink modules.js:389
    module index.js:1
    fileEvaluate modules-runtime.js:346
    require modules-runtime.js:248
    moduleLink modules.js:389
    module settings.js:1
    fileEvaluate modules-runtime.js:346
    require modules-runtime.js:248
    moduleLink modules.js:389
    module index.js:1
    fileEvaluate modules-runtime.js:346
    require modules-runtime.js:248
    require modules-runtime.js:268
    module index.js:4
    module app.js:79867
    fileEvaluate modules-runtime.js:346
    require modules-runtime.js:248
    moduleLink modules.js:389
    module common.js:1
    fileEvaluate modules-runtime.js:346
    require modules-runtime.js:248
    moduleLink modules.js:389
    module index.js:1
    fileEvaluate modules-runtime.js:346
    require modules-runtime.js:248
    moduleLink modules.js:389
    module importPackages.js:1
    fileEvaluate modules-runtime.js:346
    require modules-runtime.js:248
    moduleLink modules.js:389
    module main.js:1
    fileEvaluate modules-runtime.js:346
    require modules-runtime.js:248
    require modules-runtime.js:268
    <anonym> app.js:95818

And the app goes in endless grey window mode.

@ag0r4n
Copy link

ag0r4n commented Feb 13, 2020

Will it be possible to notify all members of another channel ?

@maciek134
Copy link
Author

@fdellwing investigating
@ag0r4n not right now, I didn't implement that as this didn't come up in the linked issue. When the PR is out of WIP I guess core developers can decide if this should go here (my thinking would be to have this separate, so you just type #channelName and it notifies)

@fdellwing
Copy link

@maciek134 Any news?

@maciek134
Copy link
Author

I'll take another stab at it over the weekend, had no time the last couple of weeks.

@joshua0623
Copy link

Hey @maciek134, are there any updates? This is a much needed feature for us, thank you for working on it!

@maciek134
Copy link
Author

@joshua0623 sorry, I've been focusing on the whole COVID-19 thing. Once I complete the current crunch I'll get back to this as I understand effective communication is vital these days.

@rodrigok rodrigok self-assigned this May 30, 2020
@danel1
Copy link

danel1 commented Jun 3, 2020

Any news here? :-)

@maciek134
Copy link
Author

@danel1 I'm in the process if finishing this up, started last weekend but didn't manage to finish yet, hopefully will have it ready this week.

@fdellwing
Copy link

Any news?

@maciek134
Copy link
Author

@fdellwing shouldn't have waited so long, it's a pain to update now, I'm slowly getting it to work.

@danel1
Copy link

danel1 commented Aug 20, 2020

@rodrigok @maciek134 Sorry but this is really getting annoying. This feature has been requested by sooo many people in so many PR's/FR's and it just gets completely ignored by the dev-team?

@maciek134
Copy link
Author

maciek134 commented Aug 20, 2020

@danel1 I'm not a part of the dev team, I'm just a guy providing his spare time. If you mean the PR getting ignored - it's not, because it's a draft, because it's not ready to be merged yet. It needs the 1k+ commits from develop merged back, which I'm working on (edit: this part is done, all I need to do now is finish the admin pages).

@sviat9440
Copy link

How run rocketchat on this branch?
image
There is no packages/rocketchat-livechat/.npm/plugin/Livechat-new-11d3d3v.74ky

@maciek134
Copy link
Author

@sviat9440 I didn't push the fixes because they are not complete yet, hence the WIP status. Although this error looks like it's caused by a wrong setup. Either way I'm finishing the admin templates now, I'll try to push before Friday.

@sviat9440
Copy link

I also think this is due to a misconfiguration.
But I did everything according to this instruction

@runiq
Copy link

runiq commented Aug 31, 2020

Nothing to add, I just want to thank @maciek134 for their tireless support on this. <3

@maciek134
Copy link
Author

@runiq thanks :)
Progress update: fixed admin side of things for group listing / creation. Next up: users dropdown and editing.

@fdellwing
Copy link

@maciek134 How is it going?

@maciek134
Copy link
Author

I'll try to push it over the weekend, only small stuff left.

@danel1
Copy link

danel1 commented Oct 19, 2020

I'll try to push it over the weekend, only small stuff left.

any news on this @maciek134 ?

@sviat9440
Copy link

Any news?))

@maciek134
Copy link
Author

Got hit with so much overtime I don't remember most of what happened in the last months of 2020. I fixed the admin side of things (again) and I'm hoping to move this out of WIP this weekend. 🤞

@fdellwing
Copy link

Any progress?

@sviat9440
Copy link

@maciek134 :)

@Schoaf
Copy link

Schoaf commented Mar 31, 2021

OMG - is it really comming??

@fdellwing
Copy link

Sadly I do not think this will come. RC now has its teams feature that allows mentioning groups but they put it behind the EE license.

@sviat9440
Copy link

@fdellwing Can you tell us more?

@fdellwing
Copy link

#20966

@sviat9440
Copy link

@fdellwing what is EE?

@fdellwing
Copy link

https://rocket.chat/de/pricing/

Their Enterprise Edition.

@sviat9440
Copy link

@fdellwing Is it possible to enable this on Rocket Chat Server?

@fdellwing
Copy link

Well, if you buy the license? Sure.

@maciek134
Copy link
Author

Uh, everyone who was waiting for this - sorry it took so long it got implemented in EE first. Once my company stopped using RC I didn't have enough time to work on this and what time I could spare wasn't even enough to keep up with upstream changes. To be fair the Teams feature looks much better than this.

Given that the Teams mentions are EE only I don't think this can even be merged anymore? @rodrigok you were assigned to this at some point, let me know if this is worth working on - at this point I'd just take a few days off to finish it.

@CLAassistant
Copy link

CLAassistant commented Dec 17, 2021

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Notifications - Implementing custom group notifications