@tiledesk/tiledesk-server 2.2.39 → 2.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/LICENSE +14 -657
  3. package/README.md +17 -3
  4. package/app.js +14 -2
  5. package/channels/chat21/chat21WebHook.js +12 -1
  6. package/event/botEvent.js +1 -1
  7. package/event/subscriptionEvent.js +11 -0
  8. package/fonts/Roboto-Italic.ttf +0 -0
  9. package/fonts/Roboto-Medium.ttf +0 -0
  10. package/fonts/Roboto-MediumItalic.ttf +0 -0
  11. package/fonts/Roboto-Regular.ttf +0 -0
  12. package/middleware/passport.js +4 -1
  13. package/models/lead.js +2 -0
  14. package/models/request.js +38 -11
  15. package/models/subscriptionLog.js +34 -0
  16. package/models/tagLibrary.js +42 -0
  17. package/package.json +4 -11
  18. package/pubmodules/activities/activityArchiver.js +295 -0
  19. package/pubmodules/activities/index.js +3 -0
  20. package/pubmodules/activities/models/activity.js +88 -0
  21. package/pubmodules/activities/routes/activity.js +710 -0
  22. package/pubmodules/activities/test/activityRoute.js +85 -0
  23. package/pubmodules/analytics/analytics.js +1719 -0
  24. package/pubmodules/analytics/index.js +3 -0
  25. package/pubmodules/canned/cannedResponse.js +51 -0
  26. package/pubmodules/canned/cannedResponseRoute.js +157 -0
  27. package/pubmodules/canned/index.js +3 -0
  28. package/pubmodules/emailNotification/requestNotification.js +184 -26
  29. package/pubmodules/messageActions/messageActionsInterceptor.js +4 -2
  30. package/pubmodules/pubModulesManager.js +104 -5
  31. package/pubmodules/scheduler/tasks/closeAgentUnresponsiveRequestTask.js +3 -1
  32. package/pubmodules/scheduler/tasks/closeBotUnresponsiveRequestTask.js +3 -1
  33. package/pubmodules/trigger/default.js +271 -0
  34. package/pubmodules/trigger/event/actionEventEmitter.js +10 -0
  35. package/pubmodules/trigger/event/flowEventEmitter.js +10 -0
  36. package/pubmodules/trigger/event/triggerEventEmitter.js +10 -0
  37. package/pubmodules/trigger/index.js +3 -0
  38. package/pubmodules/trigger/models/trigger.js +149 -0
  39. package/pubmodules/trigger/rulesTrigger.js +1181 -0
  40. package/pubmodules/trigger/start.js +114 -0
  41. package/pubmodules/trigger/triggerRoute.js +150 -0
  42. package/routes/department.js +51 -0
  43. package/routes/group.js +140 -0
  44. package/routes/lead.js +24 -1
  45. package/routes/message.js +6 -3
  46. package/routes/project.js +52 -0
  47. package/routes/public-request.js +265 -2
  48. package/routes/request.js +83 -11
  49. package/routes/subscription.js +140 -0
  50. package/routes/tag.js +138 -0
  51. package/routes/user-request.js +3 -2
  52. package/routes/widget.js +16 -1
  53. package/routes/widgetLoader.js +31 -0
  54. package/services/emailService.js +189 -11
  55. package/services/faqService.js +1 -1
  56. package/services/leadService.js +2 -0
  57. package/services/modulesManager.js +7 -188
  58. package/services/requestService.js +364 -6
  59. package/services/subscriptionNotifier.js +485 -0
  60. package/template/email/assignedEmailMessage.html +1 -1
  61. package/template/email/assignedRequest.html +1 -1
  62. package/template/email/newMessage.html +1 -1
  63. package/template/email/newMessageFollower.html +236 -0
  64. package/template/email/passwordChanged.html +1 -1
  65. package/template/email/pooledEmailMessage.html +1 -1
  66. package/template/email/pooledRequest.html +1 -1
  67. package/template/email/resetPassword.html +2 -2
  68. package/template/email/ticket.html +1 -1
  69. package/test/messageRoute.js +69 -0
  70. package/test/requestService.js +3 -1
  71. package/views/messages.jade +2 -2
@@ -0,0 +1,236 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html lang="en" xmlns="http://www.w3.org/1999/xhtml" style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
3
+
4
+ <head>
5
+ <meta name="viewport" content="width=device-width" />
6
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
7
+ <title>New Ticket from TileDesk</title>
8
+
9
+ <style type="text/css">
10
+ img {
11
+ max-width: 100%;
12
+ margin-left:16px;
13
+ margin-bottom:16px;
14
+ text-align:center !important;
15
+ }
16
+ body {
17
+ -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6em;
18
+ }
19
+ body {
20
+ background-color: #f6f6f6;
21
+ }
22
+
23
+ @media only screen and (max-width: 640px) {
24
+ body {
25
+ padding: 0 !important;
26
+ }
27
+ h1 {
28
+ font-weight: 800 !important; margin: 20px 0 5px !important;
29
+ text-align:center !important;
30
+ }
31
+ h2 {
32
+ font-weight: 800 !important; margin: 20px 0 5px !important;
33
+ }
34
+ h3 {
35
+ font-weight: 800 !important; margin: 20px 0 5px !important;
36
+ }
37
+ h4 {
38
+ font-weight: 800 !important; margin: 20px 0 5px !important;
39
+ }
40
+ h1 {
41
+ font-size: 22px !important;
42
+ }
43
+ h2 {
44
+ font-size: 18px !important;
45
+ }
46
+ h3 {
47
+ font-size: 16px !important;
48
+ }
49
+ .container {
50
+ padding: 0 !important; width: 100% !important;
51
+ }
52
+ .content {
53
+ padding: 0 !important;
54
+ }
55
+ .content-wrap {
56
+ padding: 10px !important;
57
+ }
58
+ .invoice {
59
+ width: 100% !important;
60
+ }
61
+ }
62
+ </style>
63
+ </head>
64
+
65
+ <body itemscope itemtype="http://schema.org/EmailMessage" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6em; background-color: #f6f6f6; margin: 0;" bgcolor="#f6f6f6">
66
+
67
+ {{#if baseScope.replyEnabled}}
68
+ <div>\# Please type your reply above this line \#</div>
69
+ {{/if}}
70
+
71
+ <table class="main" width="100%" cellpadding="0" cellspacing="0" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; border-radius: 3px; background-color: #fff; margin: 0; border: 1px solid #e9e9e9;" bgcolor="#fff">
72
+
73
+ <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
74
+ <td class="alert alert-warning" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 16px; vertical-align: top; font-weight: 500; text-align: center; border-radius: 3px 3px 0 0; margin: 0;" align="center" valign="top">
75
+
76
+ <div style="text-align:center">
77
+ <a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
78
+ <img src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" style="width:20%;outline:none;text-decoration:none;border:none;min-height:36px" class="CToWUd">
79
+ </a>
80
+ </div>
81
+ </td>
82
+ </tr>
83
+
84
+ <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
85
+
86
+ <td class="alert alert-warning" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 16px; vertical-align: top; font-weight: 500; text-align: center; border-radius: 3px 3px 0 0; margin: 0;" align="center" valign="top">
87
+ <div>
88
+ <h2>You are a follower of the ticket number: #{{message.request.ticket_id}}</h2>
89
+ </div>
90
+
91
+ </td>
92
+ </tr>
93
+
94
+ <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
95
+ <td class="content-wrap" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 20px;" valign="top">
96
+ <table width="100%" cellpadding="0" cellspacing="0" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
97
+
98
+
99
+ <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
100
+ <td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
101
+ Sender: <strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">{{message.senderFullname}}</strong>
102
+ </td>
103
+ </tr>
104
+
105
+
106
+
107
+ <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
108
+ <td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
109
+ {{#ifEquals message.type "text"}}
110
+ <div style="white-space: pre-wrap;">{{{msgText}}}</div>
111
+ {{/ifEquals}}
112
+ {{#ifEquals message.type "image"}}
113
+ <img src="{{message.metadata.src}}"/>
114
+ {{#if msgText}}
115
+ <div style="white-space: pre-wrap;">{{{msgText}}}</div>
116
+ {{/if}}
117
+ {{/ifEquals}}
118
+ {{#ifEquals message.type "file"}}
119
+ <a href="{{message.metadata.src}}">{{message.metadata.name}}</a>
120
+ {{/ifEquals}}
121
+ {{#ifEquals message.type "frame"}}
122
+ <a href="{{message.metadata.src}}">{{message.metadata.name}}</a>
123
+ {{#if msgText}}
124
+ <div style="white-space: pre-wrap;">{{{msgText}}}</div>
125
+ {{/if}}
126
+ {{/ifEquals}}
127
+
128
+ {{#if message.attributes}}
129
+ {{#if message.attributes.attachment}}
130
+ {{#if message.attributes.attachment.buttons}}
131
+ {{#each message.attributes.attachment.buttons}}
132
+ {{#ifEquals this.type "url"}}
133
+ <li><a href="{{this.link}}" class="dynamic_button">{{this.value}}</a></li>
134
+ {{else}}
135
+ <li><a href="mailto:{{../message.request.request_id}}@{{../baseScope.inboundDomain}}?subject=Re:%20{{../message.request.subject}}&body={{this.value}}" class="dynamic_button">{{this.value}}</a></li>
136
+ {{/ifEquals}}
137
+ {{/each}}
138
+
139
+
140
+ {{/if}}
141
+ {{/if}}
142
+ {{/if}}
143
+
144
+ <!-- {{#if message.attributes.intent_info}}
145
+ {{#if message.attributes.intent_info.others}}
146
+ Others:
147
+ {{#each message.attributes.intent_info.others}}
148
+ <li><span>{{this.answer}}</span></li>
149
+ {{/each}}
150
+ {{/if}}
151
+ {{/if}} -->
152
+
153
+
154
+
155
+
156
+
157
+ </td>
158
+ </tr>
159
+
160
+
161
+
162
+
163
+
164
+
165
+ <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
166
+ <td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
167
+ Project name : <strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">{{project.name}}</strong>
168
+ </td>
169
+ </tr>
170
+
171
+
172
+ <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
173
+ <td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
174
+ Department name : <strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">{{message.request.department.name}}</strong>
175
+ </td>
176
+ </tr>
177
+
178
+ <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
179
+ <td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
180
+ Source page : <strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">{{message.request.sourcePage}}</strong>
181
+ </td>
182
+ </tr>
183
+
184
+ <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
185
+ <td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
186
+ Contact name : <strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">{{message.request.lead.fullname}}</strong>
187
+ </td>
188
+ </tr>
189
+
190
+
191
+
192
+
193
+ <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
194
+ <td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
195
+ Channel : <strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
196
+
197
+ {{#ifEquals message.request.channel.name "chat21"}}
198
+ Chat
199
+ {{else}}
200
+ {{message.request.channel.name}}
201
+ {{/ifEquals}}
202
+
203
+
204
+ </strong>
205
+ </td>
206
+ </tr>
207
+
208
+
209
+
210
+ <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
211
+ <td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
212
+ Priority : <strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">{{message.request.priority}}</strong>
213
+ </td>
214
+ </tr>
215
+
216
+
217
+ <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
218
+ <td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
219
+ </td>
220
+ </tr>
221
+ </table>
222
+ </td>
223
+ </tr>
224
+ </table>
225
+ <div class="footer" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; clear: both; color: #999; margin: 0; padding: 20px;">
226
+ <table width="100%" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
227
+ <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
228
+ <td class="aligncenter content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; vertical-align: top; color: #999; text-align: center; margin: 0; padding: 0 0 20px;" align="center" valign="top">
229
+ <span><a href="http://www.tiledesk.com" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; color: #999; text-decoration: underline; margin: 0;" > Tiledesk.com </a></span>
230
+ <!-- <br><span><a href="%unsubscribe_url%" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; color: #999; text-decoration: underline; margin: 0;">Unsubscribe</a></span> -->
231
+ </td>
232
+ </tr>
233
+ </table>
234
+
235
+ </body>
236
+ </html>
@@ -72,7 +72,7 @@
72
72
 
73
73
  <div style="text-align:center">
74
74
  <a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
75
- <img src="https://tiledesk.com/tiledesk-logo-x1.png" style="width:50%;outline:none;text-decoration:none;border:none;" class="CToWUd">
75
+ <img src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" style="width:50%;outline:none;text-decoration:none;border:none;" class="CToWUd">
76
76
  </a>
77
77
  </div>
78
78
  <table class="main" width="100%" cellpadding="0" cellspacing="0" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; border-radius: 3px; background-color: #fff; margin: 0; border: 1px solid #e9e9e9;" bgcolor="#fff">
@@ -82,7 +82,7 @@
82
82
 
83
83
  <div style="text-align:center">
84
84
  <a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
85
- <img src="https://tiledesk.com/tiledesk-logo-x1.png" style="width:10%;outline:none;text-decoration:none;border:none;min-height:36px" class="CToWUd">
85
+ <img src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" style="width:10%;outline:none;text-decoration:none;border:none;min-height:36px" class="CToWUd">
86
86
  </a>
87
87
  </div>
88
88
  </tr>
@@ -82,7 +82,7 @@
82
82
 
83
83
  <div style="text-align:center">
84
84
  <a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
85
- <img src="https://tiledesk.com/tiledesk-logo-x1.png" style="width:10%;outline:none;text-decoration:none;border:none;min-height:36px" class="CToWUd">
85
+ <img src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" style="width:10%;outline:none;text-decoration:none;border:none;min-height:36px" class="CToWUd">
86
86
  </a>
87
87
  </div>
88
88
  </tr>
@@ -71,7 +71,7 @@
71
71
 
72
72
  <div style="text-align:center">
73
73
  <a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
74
- <img src="https://tiledesk.com/tiledesk-logo-x1.png" style="width:50%;outline:none;text-decoration:none;border:none;" class="CToWUd">
74
+ <img src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" style="width:50%;outline:none;text-decoration:none;border:none;" class="CToWUd">
75
75
  </a>
76
76
  </div>
77
77
 
@@ -99,7 +99,7 @@
99
99
  Reset My Password
100
100
  </a>
101
101
  </div>
102
- <br><br>If you did not forgot your password you can safely ignore this email.
102
+ <br><br>If you didn't forget your password you can safely ignore this email.
103
103
  <br><br><span style="font-size:12px; ">If you're having trouble clicking the "Reset My Password" button, copy and paste the URL below into your web browser: </span>
104
104
  <br>
105
105
  <span style="color:#03a5e8; font-size:12px; ">{{baseScope.baseUrl}}/#/resetpassword/{{resetPswRequestId}}</span>
@@ -75,7 +75,7 @@
75
75
 
76
76
  <div style="text-align:center">
77
77
  <a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
78
- <img src="https://tiledesk.com/tiledesk-logo-x1.png" style="width:20%;outline:none;text-decoration:none;border:none;min-height:36px" class="CToWUd">
78
+ <img src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" style="width:20%;outline:none;text-decoration:none;border:none;min-height:36px" class="CToWUd">
79
79
  </a>
80
80
  </div>
81
81
  </td>
@@ -720,6 +720,75 @@ it('createWithPriority', function (done) {
720
720
 
721
721
 
722
722
 
723
+
724
+ // mocha test/messageRoute.js --grep 'createSimpleWithFollowers'
725
+
726
+ it('createSimpleWithFollowers', function (done) {
727
+ // this.timeout(10000);
728
+
729
+ var email = "test-message-create-" + Date.now() + "@email.com";
730
+ var pwd = "pwd";
731
+
732
+ userService.signup( email ,pwd, "Test Firstname", "Test lastname").then(function(savedUser) {
733
+ projectService.createAndReturnProjectAndProjectUser("message-create", savedUser._id).then(function(savedProjectAndPU) {
734
+
735
+ var savedProject = savedProjectAndPU.project;
736
+
737
+ chai.request(server)
738
+ .post('/'+ savedProject._id + '/requests/req123-createSimpleWithFollowers/messages')
739
+ .auth(email, pwd)
740
+ .set('content-type', 'application/json')
741
+ .send({"text":"text", "followers": [savedProjectAndPU.project_user._id.toString()]})
742
+ .end(function(err, res) {
743
+ //console.log("res", res);
744
+ console.log("res.body", JSON.stringify(res.body));
745
+ res.should.have.status(200);
746
+ res.body.should.be.a('object');
747
+
748
+ expect(res.body.sender).to.equal(savedUser._id.toString());
749
+ // expect(res.body.sender).to.equal(savedProjectAndPU.project_user._id.toString());
750
+ // expect(res.body.senderFullname).to.equal("senderFullname");
751
+ expect(res.body.recipient).to.equal("req123-createSimpleWithFollowers");
752
+ expect(res.body.text).to.equal("text");
753
+ expect(res.body.id_project).to.equal(savedProject._id.toString());
754
+ expect(res.body.createdBy).to.equal(savedUser._id.toString());
755
+ expect(res.body.status).to.equal(0);
756
+
757
+ expect(res.body.request.request_id).to.equal("req123-createSimpleWithFollowers");
758
+ expect(res.body.request.requester._id).to.equal(savedProjectAndPU.project_user._id.toString());
759
+ // expect(res.body.request.requester_id).to.equal("sender");
760
+ expect(res.body.request.first_text).to.equal("text");
761
+ expect(res.body.request.id_project).to.equal(savedProject._id.toString());
762
+ expect(res.body.request.createdBy).to.equal(savedUser._id.toString());
763
+
764
+ // expect(res.body.request.messages_count).to.equal(1);
765
+
766
+ expect(res.body.request.status).to.equal(200);
767
+ expect(res.body.request.snapshot.agents.length).to.equal(1);
768
+ expect(res.body.request.participants.length).to.equal(1);
769
+ expect(res.body.request.department).to.not.equal(null);
770
+ expect(res.body.request.lead).to.not.equal(null);
771
+
772
+ expect(res.body.channel_type).to.equal("group");
773
+ expect(res.body.channel.name).to.equal("chat21");
774
+ expect(res.body.request.channel.name).to.equal("chat21");
775
+
776
+
777
+ expect(res.body.request.location).to.equal(undefined);
778
+
779
+ expect(res.body.request.followers[0]).to.equal(savedProjectAndPU.project_user._id.toString());
780
+
781
+
782
+ done();
783
+ });
784
+ });
785
+ });
786
+ });
787
+
788
+
789
+
790
+
791
+
723
792
  it('getall', function (done) {
724
793
  // this.timeout(10000);
725
794
 
@@ -686,13 +686,15 @@ describe('RequestService', function () {
686
686
  savedProject._id, "5badfe5d553d1844ad654072"),
687
687
  messageService.create("5badfe5d553d1844ad654072", "test sender", savedRequest.request_id, "hello2",
688
688
  savedProject._id, "5badfe5d553d1844ad654072")]).then(function(all) {
689
- requestService.closeRequestByRequestId(savedRequest.request_id, savedProject._id).then(function(closedRequest) {
689
+ // closeRequestByRequestId(request_id, id_project, skipStatsUpdate, notify, closed_by)
690
+ requestService.closeRequestByRequestId(savedRequest.request_id, savedProject._id, false, true, "user1").then(function(closedRequest) {
690
691
  winston.debug("resolve closedRequest", closedRequest.toObject());
691
692
  expect(closedRequest.status).to.equal(1000);
692
693
  expect(closedRequest.closed_at).to.not.equal(null);
693
694
  expect(closedRequest.transcript).to.contains("hello1");
694
695
  expect(closedRequest.transcript).to.contains("hello2");
695
696
  expect(closedRequest.snapshot.agents).to.equal(undefined);
697
+ expect(closedRequest.closed_by).to.equal("user1");
696
698
 
697
699
  done();
698
700
  }).catch(function(err){
@@ -2,7 +2,7 @@ extends layout
2
2
 
3
3
  block content
4
4
  div(class="transcript-container")
5
- img.className#IdName(src="https://tiledesk.com/tiledesk-logo-x1.png" alt="tiledesk logo")
5
+ img.className#IdName(src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" alt="tiledesk logo")
6
6
 
7
7
  div(class="transcript-wrapper")
8
8
  h1(class="transcript-title") Chat Transcript
@@ -10,7 +10,7 @@ block content
10
10
 
11
11
  each message in messages
12
12
  p(class="transcript-p")
13
- span(class="transcript-chat-date") [#{message.createdAt.toLocaleString('it', { timeZone: 'UTC' })}]
13
+ span(class="transcript-chat-date") [#{message.createdAt.toLocaleString('en', { timeZone: 'UTC' })}]
14
14
  span(class="transcript-chat-sender") #{message.senderFullname}:
15
15
  span(class="transcript-chat-msg") #{message.text}
16
16