@chat21/chat21-ionic 3.0.60-rc2 → 3.0.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/LICENSE +661 -21
  3. package/deploy_pre.sh +45 -6
  4. package/deploy_prod.sh +34 -9
  5. package/env.sample +1 -1
  6. package/package.json +1 -1
  7. package/src/app/app.component.ts +45 -21
  8. package/src/app/app.module.ts +2 -2
  9. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +62 -36
  10. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +42 -13
  11. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +13 -6
  12. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +38 -3
  13. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +8 -6
  14. package/src/app/components/image-viewer/image-viewer.component.scss +2 -2
  15. package/src/app/components/project-item/project-item.component.html +140 -118
  16. package/src/app/components/project-item/project-item.component.scss +167 -90
  17. package/src/app/components/project-item/project-item.component.ts +41 -20
  18. package/src/app/pages/conversation-detail/conversation-detail.module.ts +2 -1
  19. package/src/app/pages/conversation-detail/conversation-detail.page.html +36 -43
  20. package/src/app/pages/conversation-detail/conversation-detail.page.ts +199 -110
  21. package/src/app/pages/conversations-list/conversations-list.page.html +9 -5
  22. package/src/app/pages/conversations-list/conversations-list.page.scss +12 -1
  23. package/src/app/pages/conversations-list/conversations-list.page.ts +24 -6
  24. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +16 -11
  25. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +157 -63
  26. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +51 -16
  27. package/src/app/shared/shared.module.ts +6 -5
  28. package/src/assets/i18n/de.json +209 -0
  29. package/src/assets/i18n/en.json +24 -8
  30. package/src/assets/i18n/es.json +209 -0
  31. package/src/assets/i18n/fr.json +209 -0
  32. package/src/assets/i18n/it.json +42 -34
  33. package/src/assets/i18n/pt.json +209 -0
  34. package/src/assets/i18n/ru.json +209 -0
  35. package/src/assets/i18n/tr.json +209 -0
  36. package/src/assets/js/chat21client.js +16 -3
  37. package/src/chat-config-mqtt.json +2 -1
  38. package/src/chat-config-pre-test.json +2 -0
  39. package/src/chat-config-template.json +1 -0
  40. package/src/chat-config.json +1 -0
  41. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +54 -43
  42. package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +23 -0
  43. package/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts +1 -1
  44. package/src/chat21-core/utils/constants.ts +2 -0
  45. package/src/chat21-core/utils/utils.ts +12 -1
  46. package/src/global.scss +4 -0
@@ -92,6 +92,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
92
92
  public conv_type: string;
93
93
 
94
94
  public tagsCanned: any = [];
95
+ public tagsCannedCount: number
95
96
  public tagsCannedFilter: any = [];
96
97
  public HIDE_CANNED_RESPONSES: boolean = false;
97
98
 
@@ -104,14 +105,16 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
104
105
  MESSAGE_TYPE_OTHERS = MESSAGE_TYPE_OTHERS;
105
106
 
106
107
  arrowkeyLocation = -1;
107
-
108
+ public_Key: any;
109
+ areVisibleCAR: boolean
108
110
  //SOUND
109
111
  setTimeoutSound: any;
110
112
  audio: any
111
113
  isOpenInfoConversation: boolean;
112
114
  USER_HAS_OPENED_CLOSE_INFO_CONV: boolean = false
113
115
  isHovering: boolean = false;
114
-
116
+ conversation_count: number;
117
+ showSpinner: boolean = true
115
118
  dropEvent: any
116
119
  isMine = isMine;
117
120
  isInfo = isInfo;
@@ -180,7 +183,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
180
183
  this.conversationWithFullname = params.get('FullNameConv');
181
184
  this.conv_type = params.get('Convtype');
182
185
 
183
- this.events.publish('supportconvid:haschanged', this.conversationWith);
186
+ this.events.publish('supportconvid:haschanged', this.conversationWith);
184
187
  });
185
188
 
186
189
  }
@@ -205,7 +208,70 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
205
208
 
206
209
  // }
207
210
  // });
211
+ this.getConversations();
208
212
  this.watchToConnectionStatus();
213
+ this.getOSCODE()
214
+ }
215
+
216
+ getConversations() {
217
+ this.conversationsHandlerService.conversationAdded.subscribe((conv) => {
218
+ // console.log('[CONVS-DETAIL] - conv ', conv)
219
+ const conversations = this.conversationsHandlerService.conversations;
220
+ // console.log('[CONVS-DETAIL] conversations', conversations);
221
+ this.conversation_count = conversations.length;
222
+ this.logger.log('[CONVS-DETAIL] conversation_count', this.conversation_count);
223
+ });
224
+
225
+ this.conversationsHandlerService.conversationChanged.subscribe((conv) => {
226
+ // console.log('[CONVS-DETAIL] - conv ', conv)
227
+ const conversations = this.conversationsHandlerService.conversations;
228
+ // console.log('[CONVS-DETAIL] conversations', conversations);
229
+ this.conversation_count = conversations.length;
230
+ this.logger.log('[CONVS-DETAIL] conversation_count', this.conversation_count);
231
+ });
232
+
233
+ this.conversationsHandlerService.conversationRemoved.subscribe((conv) => {
234
+ // console.log('[CONVS-DETAIL] - conv ', conv)
235
+ const conversations = this.conversationsHandlerService.conversations;
236
+ // console.log('[CONVS-DETAIL] conversations', conversations);
237
+ this.conversation_count = conversations.length;
238
+ this.logger.log('[CONVS-DETAIL] conversation_count', this.conversation_count);
239
+ });
240
+
241
+ setTimeout(() => {
242
+ this.showSpinner = false
243
+ }, 2000);
244
+
245
+ }
246
+
247
+
248
+ getOSCODE() {
249
+ this.public_Key = this.appConfigProvider.getConfig().t2y12PruGU9wUtEGzBJfolMIgK;
250
+ this.logger.log('[CONVS-DETAIL] AppConfigService getAppConfig public_Key', this.public_Key);
251
+
252
+ let keys = this.public_Key.split("-");
253
+ this.logger.log('[CONVS-DETAIL] PUBLIC-KEY - public_Key keys', keys)
254
+
255
+ keys.forEach(key => {
256
+
257
+
258
+ if (key.includes("CAR")) {
259
+ let car = key.split(":");
260
+ if (car[1] === "F") {
261
+ this.areVisibleCAR = false;
262
+ this.logger.log('[CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
263
+ } else {
264
+ this.areVisibleCAR = true;
265
+ this.logger.log('[CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
266
+ }
267
+ }
268
+
269
+ });
270
+
271
+ if (!this.public_Key.includes("CAR")) {
272
+ this.areVisibleCAR = false;
273
+ this.logger.log('[CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
274
+ }
209
275
  }
210
276
 
211
277
  watchToConnectionStatus() {
@@ -327,6 +393,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
327
393
  this.subscriptions = [];
328
394
  this.setHeightTextArea();
329
395
  this.tagsCanned = []; // list of canned
396
+
330
397
  this.messages = []; // list messages of conversation
331
398
  this.isFileSelected = false; // indicates if a file has been selected (image to upload)
332
399
  this.openInfoMessage = false; // indicates whether the info message panel is open
@@ -417,7 +484,11 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
417
484
  'CONTACT_ID',
418
485
  'USER_ID',
419
486
  "UPLOAD",
420
- "CANNED_RESPONSES"
487
+ "CANNED_RESPONSES",
488
+ "NO_CANNED_RESPONSES",
489
+ "YES_CANNED_RESPONSES",
490
+ "THERE_ARE_NO_CANNED_RESPONSES_AVAILABLE",
491
+ "TO_CREATE_THEM_GO_TO_THE_PROJECT"
421
492
  ];
422
493
 
423
494
  this.translationMap = this.customTranslateService.translateLanguage(keys);
@@ -435,6 +506,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
435
506
  'INFO_SUPPORT_USER_ADDED_VERB',
436
507
  'INFO_SUPPORT_CHAT_REOPENED',
437
508
  'INFO_SUPPORT_CHAT_CLOSED',
509
+ 'INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU',
438
510
  'LABEL_TODAY',
439
511
  'LABEL_TOMORROW',
440
512
  'LABEL_LAST_ACCESS',
@@ -894,90 +966,93 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
894
966
  // ----------------------------------------------------------
895
967
  // DISPLAY CANNED RESPONSES if message.lastIndexOf("/")
896
968
  // ----------------------------------------------------------
897
- setTimeout(() => {
898
- if (this.conversationWith.startsWith("support-group")) {
899
-
900
- const pos = message.lastIndexOf("/");
901
- // console.log("[CONVS-DETAIL] - returnChangeTextArea - canned responses pos of / (using lastIndexOf) ", pos);
902
-
903
- // test
904
- // var rest = message.substring(0, message.lastIndexOf("/") + 1);
905
- // var last = message.substring(message.lastIndexOf("/") + 1, message.length);
906
- // console.log('[CONVS-DETAIL] - returnChangeTextArea rest', rest);
907
- // console.log('[CONVS-DETAIL] - returnChangeTextArea last', last);
908
- // console.log('[CONVS-DETAIL] - returnChangeTextArea last', last.length);
909
- // if (last.length === 1 && last.trim() === '') {
910
- // console.log('[CONVS-DETAIL] - returnChangeTextArea last is a white space ');
911
- // } else if (last.length === 1 && last.trim() !== '') {
912
- // console.log('[CONVS-DETAIL] - returnChangeTextArea last is NOT space ');
913
- // }
914
-
915
-
916
- if (pos >= 0) {
917
- var strSearch = message.substr(pos + 1);
918
- this.logger.log("[CONVS-DETAIL] - returnChangeTextArea - canned responses strSearch ", strSearch);
919
-
920
- // --------------------------------------------
921
- // Load canned responses
922
- // --------------------------------------------
923
- this.loadTagsCanned(strSearch, this.conversationWith);
924
-
925
- // ------------------------------------------------------------------------------------------------------------------------------------------
926
- // Hide / display Canned when the SLASH has POSITION POS 0 and checking if there is a space after the SLASH (in this case it will be hidden)
927
- // ------------------------------------------------------------------------------------------------------------------------------------------
928
-
929
- var after_slash = message.substring(message.lastIndexOf("/") + 1, message.length);
930
- if (pos === 0 && after_slash.length === 1 && after_slash.trim() === '') {
931
- this.logger.log('[CONVS-DETAIL] - returnChangeTextArea after_slash --> there is a white space after ');
932
- this.HIDE_CANNED_RESPONSES = true
933
- this.tagsCannedFilter = []
934
- } else if (pos === 0 && after_slash.length === 0) {
935
- this.logger.log('[CONVS-DETAIL] - returnChangeTextArea after_slash --> there is NOT a white space after');
936
- this.HIDE_CANNED_RESPONSES = false
937
- }
938
-
939
-
940
- if (pos > 0) {
969
+ if (this.areVisibleCAR) {
970
+ setTimeout(() => {
971
+ if (this.conversationWith.startsWith("support-group")) {
972
+
973
+ const pos = message.lastIndexOf("/");
974
+ // console.log("[CONVS-DETAIL] - returnChangeTextArea - canned responses pos of / (using lastIndexOf) ", pos);
975
+
976
+ // test
977
+ // var rest = message.substring(0, message.lastIndexOf("/") + 1);
978
+ // var last = message.substring(message.lastIndexOf("/") + 1, message.length);
979
+ // console.log('[CONVS-DETAIL] - returnChangeTextArea rest', rest);
980
+ // console.log('[CONVS-DETAIL] - returnChangeTextArea last', last);
981
+ // console.log('[CONVS-DETAIL] - returnChangeTextArea last', last.length);
982
+ // if (last.length === 1 && last.trim() === '') {
983
+ // console.log('[CONVS-DETAIL] - returnChangeTextArea last is a white space ');
984
+ // } else if (last.length === 1 && last.trim() !== '') {
985
+ // console.log('[CONVS-DETAIL] - returnChangeTextArea last is NOT space ');
986
+ // }
987
+
988
+
989
+ if (pos >= 0) {
990
+ var strSearch = message.substr(pos + 1);
991
+ this.logger.log("[CONVS-DETAIL] - returnChangeTextArea - canned responses strSearch ", strSearch);
992
+
993
+ // --------------------------------------------
994
+ // Load canned responses
995
+ // --------------------------------------------
996
+ this.loadTagsCanned(strSearch, this.conversationWith);
941
997
 
942
998
  // ------------------------------------------------------------------------------------------------------------------------------------------
943
- // Hide / display Canned when the SLASH has POSITION POS > and checking if there is a space after the SLASH (in this case they it be hidden)
944
- // and if there is not a space before the SLASH (in this it will be hidden)
999
+ // Hide / display Canned when the SLASH has POSITION POS 0 and checking if there is a space after the SLASH (in this case it will be hidden)
945
1000
  // ------------------------------------------------------------------------------------------------------------------------------------------
946
1001
 
947
- let beforeSlash = message.substr(pos - 1)
948
- let afterSlash = message.substr(pos + 1)
949
- this.logger.log('[CONVS-DETAIL] - returnChangeTextArea * POS ', pos);
950
-
951
- this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash', beforeSlash);
952
- this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> afterSlash', afterSlash);
953
- var afterSlashParts = afterSlash.split("/")
954
- var beforeSlashParts = beforeSlash.split("/")
955
- this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> afterSlash parts', afterSlashParts);
956
- this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash parts', beforeSlashParts);
957
-
958
- if (beforeSlashParts.length === 2) {
959
- if (beforeSlashParts[0].indexOf(' ') >= 0 && afterSlashParts[0] === '') {
960
- this.HIDE_CANNED_RESPONSES = false
961
- this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash there is a white space After Not');
962
- // if (beforeSlashParts[0].indexOf(' ') >= 0 && afterSlashParts[0].indexOf(' ') >= 0)
963
- } else if (beforeSlashParts[0].indexOf(' ') < 0 && afterSlashParts[0] === '') {
964
- this.HIDE_CANNED_RESPONSES = true;
965
- this.tagsCannedFilter = []
966
- this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash not thete is a white space After Not');
967
- } else if (beforeSlashParts[0].indexOf(' ') >= 0 && afterSlashParts[0] === ' ') {
968
- this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash not thete is a white space After YES');
969
- this.HIDE_CANNED_RESPONSES = true;
970
- this.tagsCannedFilter = []
1002
+ var after_slash = message.substring(message.lastIndexOf("/") + 1, message.length);
1003
+ if (pos === 0 && after_slash.length === 1 && after_slash.trim() === '') {
1004
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea after_slash --> there is a white space after ');
1005
+ this.HIDE_CANNED_RESPONSES = true
1006
+ this.tagsCannedFilter = []
1007
+ } else if (pos === 0 && after_slash.length === 0) {
1008
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea after_slash --> there is NOT a white space after');
1009
+ this.HIDE_CANNED_RESPONSES = false
1010
+ }
1011
+
1012
+
1013
+ if (pos > 0) {
1014
+
1015
+ // ------------------------------------------------------------------------------------------------------------------------------------------
1016
+ // Hide / display Canned when the SLASH has POSITION POS > and checking if there is a space after the SLASH (in this case they it be hidden)
1017
+ // and if there is not a space before the SLASH (in this it will be hidden)
1018
+ // ------------------------------------------------------------------------------------------------------------------------------------------
1019
+
1020
+ let beforeSlash = message.substr(pos - 1)
1021
+ let afterSlash = message.substr(pos + 1)
1022
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea * POS ', pos);
1023
+
1024
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash', beforeSlash);
1025
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> afterSlash', afterSlash);
1026
+ var afterSlashParts = afterSlash.split("/")
1027
+ var beforeSlashParts = beforeSlash.split("/")
1028
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> afterSlash parts', afterSlashParts);
1029
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash parts', beforeSlashParts);
1030
+
1031
+ if (beforeSlashParts.length === 2) {
1032
+ if (beforeSlashParts[0].indexOf(' ') >= 0 && afterSlashParts[0] === '') {
1033
+ this.HIDE_CANNED_RESPONSES = false
1034
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash there is a white space After Not');
1035
+ // if (beforeSlashParts[0].indexOf(' ') >= 0 && afterSlashParts[0].indexOf(' ') >= 0)
1036
+ } else if (beforeSlashParts[0].indexOf(' ') < 0 && afterSlashParts[0] === '') {
1037
+ this.HIDE_CANNED_RESPONSES = true;
1038
+ this.tagsCannedFilter = []
1039
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash not thete is a white space After Not');
1040
+ } else if (beforeSlashParts[0].indexOf(' ') >= 0 && afterSlashParts[0] === ' ') {
1041
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash not thete is a white space After YES');
1042
+ this.HIDE_CANNED_RESPONSES = true;
1043
+ this.tagsCannedFilter = []
1044
+ }
971
1045
  }
972
1046
  }
973
- }
974
1047
 
975
1048
 
976
- } else {
977
- this.tagsCannedFilter = [];
1049
+ } else {
1050
+ this.tagsCannedFilter = [];
1051
+ }
978
1052
  }
979
- }
980
- }, 300);
1053
+ }, 300);
1054
+
1055
+ }
981
1056
  // ./ CANNED RESPONSES //
982
1057
 
983
1058
  } catch (err) {
@@ -1056,7 +1131,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1056
1131
  this.logger.log('[CONVS-DETAIL] - loadTagsCanned getCannedResponses RES', res);
1057
1132
 
1058
1133
  this.tagsCanned = res
1059
-
1134
+ this.tagsCannedCount = res.length
1135
+ this.logger.log('[CONVS-DETAIL] - loadTagsCanned getCannedResponses tagsCannedCount', this.tagsCannedCount);
1060
1136
  if (this.HIDE_CANNED_RESPONSES === false) {
1061
1137
  this.showTagsCanned(strSearch);
1062
1138
  }
@@ -1086,10 +1162,12 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1086
1162
  strReplace = "<b class='highlight-search-string'>" + strSearch + "</b>";
1087
1163
  }
1088
1164
  for (var i = 0; i < this.tagsCannedFilter.length; i++) {
1089
-
1090
1165
  const textCanned = "<div class='cannedText'>" + this.replacePlaceholderInCanned(this.tagsCannedFilter[i].text) + "</div>";
1091
1166
  this.tagsCannedFilter[i].title = "<div class='cannedContent'><div class='cannedTitle'>" + this.tagsCannedFilter[i].title.toString().replace(strSearch, strReplace.trim()) + "</div>" + textCanned + '</div>';
1092
-
1167
+ }
1168
+ if (this.tagsCannedCount === 0) {
1169
+ const nocanned = { 'title': "<div class='cannedContent'><div class='cannedTitle nocannedTitle'>" + this.translationMap.get('THERE_ARE_NO_CANNED_RESPONSES_AVAILABLE') + ".</div><div class='cannedText'>" + this.translationMap.get('TO_CREATE_THEM_GO_TO_THE_PROJECT') + "</div></div>", "text": "There are no canned responses available" }
1170
+ this.tagsCannedFilter.push(nocanned)
1093
1171
  }
1094
1172
  }
1095
1173
 
@@ -1105,10 +1183,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1105
1183
 
1106
1184
  replacePlaceholderInCanned(str) {
1107
1185
  this.logger.log('[CONVS-DETAIL] - replacePlaceholderInCanned str ', str);
1108
-
1109
-
1110
1186
  str = str.replace('$recipient_name', this.conversationWithFullname);
1111
-
1112
1187
  if (this.loggedUser && this.loggedUser.fullname) {
1113
1188
  str = str.replace('$agent_name', this.loggedUser.fullname);
1114
1189
  }
@@ -1133,8 +1208,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1133
1208
  this.arrowkeyLocation = -1
1134
1209
  this.tagsCannedFilter = [];
1135
1210
  this.logger.log("[CONVS-DETAIL] replaceTagInMessage canned text ", canned.text);
1136
- // // prendo val input
1137
-
1138
1211
 
1139
1212
 
1140
1213
  // replace text
@@ -1158,23 +1231,43 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1158
1231
 
1159
1232
 
1160
1233
  hasClickedOpenCannedResponses($event) {
1161
- this.logger.log('[CONVS-DETAIL] - hasClickedOpenCannedResponses ', $event)
1234
+ this.logger.log('[CONVS-DETAIL] - hasClickedOpenCannedResponses ', $event)
1162
1235
  const elTextArea = this.rowTextArea['el'];
1163
1236
  const textArea = elTextArea.getElementsByTagName('ion-textarea')[0];
1164
-
1165
- this.logger.log("[CONVS-DETAIL] replaceTagInMessage textArea ", textArea);
1166
- this.logger.log("[CONVS-DETAIL] replaceTagInMessage textArea value", textArea.value)
1167
- this.insertAtCursor(textArea, '/')
1168
- }
1169
1237
 
1170
- insertAtCursor(myField, myValue) {
1171
- this.logger.log('[CANNED-RES-EDIT-CREATE] - insertAtCursor - myValue ', myValue );
1172
- this.logger.log('[CANNED-RES-EDIT-CREATE] - insertAtCursor - myField ', myField );
1173
-
1238
+ this.logger.log("[CONVS-DETAIL] hasClickedOpenCannedResponses textArea ", textArea);
1239
+ this.logger.log("[CONVS-DETAIL] hasClickedOpenCannedResponses textArea value", textArea.value)
1240
+ this.insertAtCursor(textArea, '/');
1241
+ // console.log('[CONVS-DETAIL] hasClickedOpenCannedResponses textArea.value', textArea.value)
1242
+ // setTimeout(() => {
1243
+ // // if (textArea.value === '/') {
1244
+ // // textArea.focus();
1245
+ // textArea.setFocus();
1246
+ // // }
1247
+ // }, 1500);
1248
+
1249
+ this.setCaretPosition(textArea)
1250
+ }
1251
+
1252
+ setCaretPosition(ctrl) {
1253
+ ctrl.value.trim()
1254
+ ctrl.setFocus();
1255
+ }
1256
+
1257
+ insertAtCursor(myField, myValue) {
1258
+ this.logger.log('[CONVS-DETAIL] - insertAtCursor - myValue ', myValue);
1259
+ this.logger.log('[CONVS-DETAIL] - insertAtCursor - myField ', myField);
1260
+
1261
+
1262
+ // myValue = ' ' + myValue;
1263
+
1264
+ // console.log('[CONVS-DETAIL] - GET TEXT AREA - Here yes myValue ', myValue);
1265
+ // console.log('[CONVS-DETAIL] - GET TEXT AREA - Here yes textArea value length', myField.value.length);
1266
+
1267
+ if (myField.value.length > 0) {
1174
1268
  myValue = ' ' + myValue;
1175
- this.logger.log('[CANNED-RES-EDIT-CREATE] - GET TEXT AREA - QUI ENTRO myValue ', myValue );
1176
-
1177
-
1269
+ }
1270
+
1178
1271
  //IE support
1179
1272
  if (myField.selection) {
1180
1273
  myField.focus();
@@ -1185,19 +1278,19 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1185
1278
  //MOZILLA and others
1186
1279
  else if (myField.selectionStart || myField.selectionStart == '0') {
1187
1280
  var startPos = myField.selectionStart;
1188
- this.logger.log('[CANNED-RES-EDIT-CREATE] - insertAtCursor - startPos ', startPos);
1189
-
1281
+ this.logger.log('[CONVS-DETAIL] - insertAtCursor - startPos ', startPos);
1282
+
1190
1283
  var endPos = myField.selectionEnd;
1191
- this.logger.log('[CANNED-RES-EDIT-CREATE] - insertAtCursor - endPos ', endPos);
1192
-
1284
+ this.logger.log('[CONVS-DETAIL] - insertAtCursor - endPos ', endPos);
1285
+
1193
1286
  myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length);
1194
-
1287
+
1195
1288
  // place cursor at end of text in text input element
1196
1289
  myField.focus();
1197
1290
  var val = myField.value; //store the value of the element
1198
1291
  myField.value = ''; //clear the value of the element
1199
1292
  myField.value = val + ' '; //set that value back.
1200
-
1293
+
1201
1294
  // this.cannedResponseMessage = myField.value;
1202
1295
 
1203
1296
  // this.texareaIsEmpty = false;
@@ -1208,10 +1301,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1208
1301
  }
1209
1302
  }
1210
1303
 
1211
-
1212
-
1213
-
1214
-
1215
1304
  @HostListener('document:keydown', ['$event'])
1216
1305
  handleKeyboardEvent(event: KeyboardEvent) {
1217
1306
  // this.logger.log("CONVERSATION-DETAIL handleKeyboardEvent event.key ", event.key);
@@ -36,12 +36,16 @@
36
36
  </ion-avatar>
37
37
  <ion-label part="message-text" class="waiting-for-network-msg"> Waiting for network</ion-label>
38
38
  </ion-item>
39
-
40
- <ion-item *ngIf="supportMode && displayNewConvsItem" class="ion-no-padding open-iframe-item"
41
- button="true"
42
- (click)="openUnsevedConversationIframe()">
39
+ <!-- button="true" (click)="openUnsevedConversationIframe()" -->
40
+ <ion-item *ngIf="supportMode && displayNewConvsItem" class="ion-no-padding open-iframe-item">
43
41
  <div tabindex="0"></div>
44
- <app-project-item (projectIdEvent)="getLastProjectId($event)"></app-project-item>
42
+ <!-- <ion-note class="pinned-project">
43
+ {{ 'PINNED_PROJECT' | translate }}
44
+ </ion-note> -->
45
+
46
+ <app-project-item style="width: 100%;"
47
+ (openUnsevedConvsEvent)="openUnsevedConversationIframe($event)"
48
+ (projectIdEvent)="getLastProjectId($event)"></app-project-item>
45
49
  </ion-item>
46
50
 
47
51
  <span
@@ -297,6 +297,17 @@ ion-list {
297
297
  .open-iframe-item {
298
298
  padding-left: 0px !important ;
299
299
  padding-right: 0px !important;
300
- height: 55px !important;
300
+ // height: 55px !important;
301
301
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
302
+ --background-hover: #ffffff;
303
+ cursor:default !important;
304
+ }
305
+
306
+ .pinned-project {
307
+
308
+ color: #3880ff;
309
+ position: absolute;
310
+ right: 8px;
311
+ top: 2px;
312
+ // font-size: 12px !important;
302
313
  }
@@ -72,6 +72,8 @@ export class ConversationListPage implements OnInit {
72
72
  subscription: Subscription;
73
73
 
74
74
  public UNASSIGNED_CONVS_URL: any;
75
+ public PROJECTS_FOR_PANEL_URL: any;
76
+ public IFRAME_URL: any;
75
77
  public hasClickedOpenUnservedConvIframe: boolean = false;
76
78
  public lastProjectId: string;
77
79
  public isOnline: boolean = true;
@@ -239,24 +241,40 @@ export class ConversationListPage implements OnInit {
239
241
  this.lastProjectId = projectid;
240
242
  }
241
243
 
242
- openUnsevedConversationIframe() {
244
+ openUnsevedConversationIframe(event) {
245
+ this.logger.log('[CONVS-LIST-PAGE] openUnsevedConversationIframe ', event)
243
246
  this.hasClickedOpenUnservedConvIframe = true
244
247
  this.logger.log('[CONVS-LIST-PAGE] - HAS CLIKED OPEN UNSERVED REQUEST IFRAME', this.hasClickedOpenUnservedConvIframe);
245
248
  const DASHBOARD_BASE_URL = this.appConfigProvider.getConfig().dashboardUrl;
249
+ // http://localhost:4204/#/projects-for-panel
250
+ this.PROJECTS_FOR_PANEL_URL = DASHBOARD_BASE_URL + '#/projects-for-panel';
246
251
  this.UNASSIGNED_CONVS_URL = DASHBOARD_BASE_URL + '#/project/' + this.lastProjectId + '/unserved-request-for-panel';
252
+
253
+ if (event === 'pinbtn') {
254
+ this.IFRAME_URL = this.PROJECTS_FOR_PANEL_URL
255
+ } else {
256
+ this.IFRAME_URL = this.UNASSIGNED_CONVS_URL
257
+ }
258
+
247
259
  this.logger.log('[CONVS-LIST-PAGE] - HAS CLIKED OPEN UNSERVED REQUEST IFRAME > UNASSIGNED CONVS URL', this.UNASSIGNED_CONVS_URL);
248
- this.openUnassignedConversations(this.UNASSIGNED_CONVS_URL)
260
+ this.openUnassignedConversations(this.IFRAME_URL, event)
249
261
  }
250
262
 
251
263
  // ---------------------------------------------------------
252
264
  // Opens the Unassigned Conversations iframe
253
265
  // ---------------------------------------------------------
254
- openUnassignedConversations(UNASSIGNED_CONVS_URL) {
255
-
266
+ openUnassignedConversations(IFRAME_URL: string, event) {
256
267
  if (checkPlatformIsMobile()) {
257
- presentModal(this.modalController, UnassignedConversationsPage, { unassigned_convs_url: UNASSIGNED_CONVS_URL });
268
+ presentModal(this.modalController, UnassignedConversationsPage, {
269
+ iframe_URL: IFRAME_URL,
270
+ callerBtn: event
271
+ });
258
272
  } else {
259
- this.navService.push(UnassignedConversationsPage, { unassigned_convs_url: UNASSIGNED_CONVS_URL });
273
+ this.navService.push(UnassignedConversationsPage, {
274
+ iframe_URL: IFRAME_URL,
275
+ callerBtn: event
276
+
277
+ });
260
278
  }
261
279
  }
262
280
 
@@ -1,6 +1,11 @@
1
1
  <ion-header>
2
2
  <ion-toolbar>
3
- <ion-title>{{translationMap?.get('NewConversations') }}</ion-title>
3
+ <ion-title *ngIf="callerBtn !== 'pinbtn'" style="font-size: 16px;">
4
+ {{translationMap?.get('UnassignedConversations') }}
5
+ </ion-title>
6
+ <ion-title *ngIf="callerBtn === 'pinbtn'" style="font-size: 16px;">
7
+ {{translationMap?.get('PIN_A_PROJECT') }}
8
+ </ion-title>
4
9
  <ion-buttons slot="end">
5
10
  <ion-button ion-button fill="clear" (click)="onClose()">
6
11
  <ion-icon slot="icon-only" name="close"></ion-icon>
@@ -9,14 +14,14 @@
9
14
  </ion-toolbar>
10
15
  </ion-header>
11
16
 
12
- <ion-content overflow-scroll="true" id="iframe-ion-content"
13
- [ngClass]="{'ion-content-black-background' : isProjectsForPanel === true}">
17
+ <ion-content overflow-scroll="true" id="iframe-ion-content"
18
+ [ngClass]="{'ion-content-black-background' : isProjectsForPanel === true}">
14
19
  <!-- <iframe id="i_frame" style="width:100%; height:99%" frameBorder="0" allowfullscreen [src]="unassigned_convs_url_sanitized"></iframe> -->
15
- <!-- <div class="stretchspinner-unassigned-convs">
16
- <div class="rect1"></div>
17
- <div class="rect2"></div>
18
- <div class="rect3"></div>
19
- <div class="rect4"></div>
20
- <div class="rect5"></div>
21
- </div> -->
22
- </ion-content>
20
+ <div class="loader-spinner-wpr">
21
+ <div id="loader" class="loader">
22
+ <svg class="circular" viewBox="25 25 50 50">
23
+ <circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10" />
24
+ </svg>
25
+ </div>
26
+ </div>
27
+ </ion-content>