-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Conversation
@@ -0,0 +1,31 @@ | |||
Meteor.methods({ | |||
'livechat:removeRoom'(rid) { | |||
if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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
# Conflicts: # server/startup/migrations/v109.js
New permission added. |
{{#if isClosed}} | ||
<td><a href="#remove" class="remove-livechat-room"><i class="icon-trash"></i></a></td> | ||
{{else}} | ||
<th> </th> |
There was a problem hiding this comment.
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> </th> | ||
{{/if}} | ||
{{/requiresPermission}} |
There was a problem hiding this comment.
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
server/startup/migrations/v113.js
Outdated
@@ -0,0 +1,20 @@ | |||
RocketChat.Migrations.add({ | |||
version: 109, |
There was a problem hiding this comment.
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 =)
server/startup/migrations/v109.js
Outdated
@@ -1,16 +1,20 @@ | |||
RocketChat.Migrations.add({ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reversed file deletion.
@sampaiodiego, fixes submitted. |
# Conflicts: # package-lock.json # server/startup/migrations/v113.js
server/startup/migrations/v109.js
Outdated
@@ -1,16 +0,0 @@ | |||
RocketChat.Migrations.add({ |
There was a problem hiding this comment.
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?
# Conflicts: # server/startup/migrations/v121.js
There was a problem hiding this 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
@sampaiodiego, migration conflict fixed. |
We really need to be able to delete all livechat history! |
@dhpowrhost, please open a new issue describing your requirement. Thanks. |
@RocketChat/core
Closes #5481
This PR adds a new button to the current chats list, allowing to remove closed LiveChat rooms.