Skip to content

[NEW] Custom user status#9353

Closed
Hudell wants to merge 27 commits intoRocketChat:developfrom
Hudell:custom_user_status
Closed

[NEW] Custom user status#9353
Hudell wants to merge 27 commits intoRocketChat:developfrom
Hudell:custom_user_status

Conversation

@Hudell
Copy link
Copy Markdown
Contributor

@Hudell Hudell commented Jan 8, 2018

Closes #2422
Closes #11403

@RocketChat/core

This PR adds a "Custom User Status" option to the admin page, where an admin can register any number of custom User Statuses, choosing a name and type (online, away, busy or offline).

The type will be the actual status of the user, but the custom status name will be displayed next to the user's name as well.

Users will also be able to write their own custom status text.

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-9353 January 8, 2018 14:56 Inactive
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-9353 January 8, 2018 15:45 Inactive
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@RocketChat RocketChat deleted a comment Jan 8, 2018
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-9353 March 27, 2018 14:10 Inactive
@Hudell Hudell removed the request for review from ggazzo April 18, 2018 00:48
Copy link
Copy Markdown
Member

@sampaiodiego sampaiodiego left a comment

Choose a reason for hiding this comment

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

still need a deeper review. but already added a few comments.

'rocketchat:ui'
]);

api.addFiles('client/rocketchat.js');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please use more concise file names.. for this one I would chose either userStatus.js or startup.js

//find
findByName(name, options) {
const query = {
$or: [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you don't need a $or operator to only one condition

findByNameExceptID(name, except, options) {
const query = {
_id: { $nin: [ except ] },
$or: [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same as above, you don't need a $or operator to only one condition

FlowRouter.route('/admin/user-status-custom', {
name: 'user-status-custom',
subscriptions(/*params, queryParams*/) {
this.register('CustomUserStatus', Meteor.subscribe('CustomUserStatus'));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would to use template level subscriptions instead of router level subscriptions, but I was not even able to find the CustomUserStatus .. is this valid?

buttonTitle: t('Update'),
buttonAction: () => {
return () => {
const elText = jQuery('input[type=text][name=custom-status]')[0];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

jQuery 😱

RocketChat.callbacks.run('userStatusManuallySet', e.currentTarget.dataset.id);
popover.close();
},
'click [data-type="open"]'(e) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is this really needed?

@graywolf336
Copy link
Copy Markdown
Contributor

@Hudell Can you add screenshots of this?

@Hudell
Copy link
Copy Markdown
Contributor Author

Hudell commented Apr 24, 2018

Screenshot

@kaiiiiiiiii
Copy link
Copy Markdown
Contributor

Why not a page under “My Account” where you can add custom user statuses and then show them in the dropdown in addition to the default ones.

Would look a lot cleaner I think :)

@Hudell
Copy link
Copy Markdown
Contributor Author

Hudell commented Apr 24, 2018

The PR actually includes a page like that, but on the admin settings. That way admins can register new custom status for everybody to use.

I hadn't thought of doing the same on the user level, but it could be interesting.

@Hudell
Copy link
Copy Markdown
Contributor Author

Hudell commented Apr 25, 2019

Closed in favor of #13933

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Job title next to status Additional user statuses