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] Button to remove closed LiveChat rooms #10301

Merged
merged 10 commits into from
Jun 14, 2018

Conversation

renatobecker-zz
Copy link

@renatobecker-zz renatobecker-zz commented Apr 2, 2018

@RocketChat/core

Closes #5481

This PR adds a new button to the current chats list, allowing to remove closed LiveChat rooms.

screen shot 2018-04-02 at 4 33 19 pm

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-10301 April 2, 2018 19:31 Inactive
@sampaiodiego sampaiodiego added this to the 0.64.0 milestone Apr 3, 2018
@@ -0,0 +1,31 @@
Meteor.methods({
'livechat:removeRoom'(rid) {
if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) {
Copy link
Member

@sampaiodiego sampaiodiego Apr 16, 2018

Choose a reason for hiding this comment

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

instead of checking permission for view-livechat-manager can you please change to something like remove-closed-livechat-rooms and add this permission to the livechat-manager role (and to admin as well)? a migration might be needed.

it will be also needed a test on the UI to show the delete button

this way we can admins can for example remove this ability from livechat managers, so only admins could do it.

Copy link
Author

Choose a reason for hiding this comment

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

@sampaiodiego, thanks for your feedback.
Sorry, but I have a question: In your comment you're requesting the creation of a new permission(remove-closed-livechat-rooms) and add this to livechat-agent and admin roles.
Okay, I understand your request but, if I'm not wrong, the users with the livechat-agent role can't access the /livechat-manager/current route, am I right?
If I'm right, this role will never have effect to livechat-agent users..
I will be waiting for your feedback to make other changes on this PR.

Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

oh sry, you're absolutely right.. what I meant to say was livechar-manager role (and not livechat-agent).. I'll edit my comment to reflect that. thx

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-10301 April 18, 2018 16:40 Inactive
# Conflicts:
#	server/startup/migrations/v109.js
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-10301 April 18, 2018 16:55 Inactive
@renatobecker-zz
Copy link
Author

New permission added.

{{#if isClosed}}
<td><a href="#remove" class="remove-livechat-room"><i class="icon-trash"></i></a></td>
{{else}}
<th>&nbsp;</th>
Copy link
Member

Choose a reason for hiding this comment

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

please, change to <td>

{{else}}
<th>&nbsp;</th>
{{/if}}
{{/requiresPermission}}
Copy link
Member

Choose a reason for hiding this comment

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

please add an {{else}} block with an empty <td> so it does not break the table if the user does not have the required permission

@@ -0,0 +1,20 @@
RocketChat.Migrations.add({
version: 109,
Copy link
Member

Choose a reason for hiding this comment

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

please, change version to 113 as the file name =)

@@ -1,16 +1,20 @@
RocketChat.Migrations.add({
Copy link
Member

Choose a reason for hiding this comment

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

I think this is not needed anymore.. it is now on version 113

Copy link
Author

Choose a reason for hiding this comment

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

Reversed file deletion.

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-10301 April 19, 2018 13:43 Inactive
@renatobecker-zz
Copy link
Author

@sampaiodiego, fixes submitted.

# Conflicts:
#	package-lock.json
#	server/startup/migrations/v113.js
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-10301 May 18, 2018 21:01 Inactive
@rodrigok rodrigok modified the milestones: 0.65.0, 0.66.0 May 22, 2018
@@ -1,16 +0,0 @@
RocketChat.Migrations.add({
Copy link
Member

Choose a reason for hiding this comment

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

this should not be deleted right?

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-10301 May 27, 2018 18:35 Inactive
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-10301 May 27, 2018 18:58 Inactive
sampaiodiego
sampaiodiego previously approved these changes Jun 13, 2018
Copy link
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.

can you please fix the migration conflict? thx

@renatobecker-zz
Copy link
Author

@sampaiodiego, migration conflict fixed.

@sampaiodiego sampaiodiego merged commit 7689f2e into develop Jun 14, 2018
@sampaiodiego sampaiodiego deleted the allow-to-remove-closed-livechat-rooms branch June 14, 2018 15:35
@rodrigok rodrigok mentioned this pull request Jun 28, 2018
@denogio
Copy link

denogio commented Sep 11, 2018

We really need to be able to delete all livechat history!

@renatobecker-zz
Copy link
Author

@dhpowrhost, please open a new issue describing your requirement.

Thanks.

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.

Unable to delete closed Livechat
6 participants