-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
feat: Allow managing association to business units on departments' creation and update #32682
Conversation
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: e625cb2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 32 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…nto improve/monitors-manage-departments-units
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #32682 +/- ##
===========================================
+ Coverage 59.74% 59.84% +0.09%
===========================================
Files 2552 2554 +2
Lines 62869 63020 +151
Branches 14123 14133 +10
===========================================
+ Hits 37562 37713 +151
Misses 22900 22900
Partials 2407 2407
Flags with carried forward coverage won't be shown. Click here to find out more. |
apps/meteor/ee/app/livechat-enterprise/server/hooks/manageDepartmentUnit.ts
Outdated
Show resolved
Hide resolved
This PR currently has a merge conflict. Please resolve this and then re-add the |
…nto improve/monitors-manage-departments-units
|
Proposed changes (including videos or screenshots)
departmentUnit
object param tolivechat:saveDepartment
Meteor method,livechat/department
(POST) endpoint andlivechat/department
(PUT) endpoint;{}
) to this param removes the department from its associated unit (or just doesn't add the department to any unit, if provided on the creation of a new department). Providing{ _id: undefined }
ornull
triggers the same effect;_id
field in the object ({ _id: "unit-id" }
), the department will be associated to the unit with the specified_id
IF the user has the permission to do so.manage-livechat-departments
permission (this is already the current behavior), but there are additional conditions to associate a department with a specific unit when the new param is provided:livechat-monitor
), then they must be a supervisor of the specified unit. That is, they must be linked (as monitor) to the specified unit in order to add or remove departments from it;admin
orlivechat-manager
), any unit can be associated to the department (on creation or update)._id
field to the new param's object will trigger an error.Issue(s)
Steps to test or reproduce
Example request to the
livechat:saveDepartment
method (the new param is the last one that should be provided --{\"_id\":\"unit-id\"}
in the example):The command above triggers the creation of a new department associated with the unit with id
unit-id
. Change the firstnull
param to a validdepartment
string to edit it.Example request to the
livechat/department
POST endpoint (check the newdepartmentUnit
param):Example request to the
livechat/department/:id
PUT endpoint (check the newdepartmentUnit
param -- providing an empty object to it will remove the department from its associated unit):Further comments
SUP-613