@chat21/chat21-ionic 3.4.27-rc8 → 3.4.28

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 (153) hide show
  1. package/CHANGELOG.md +6 -48
  2. package/angular.json +0 -1
  3. package/package.json +1 -1
  4. package/src/app/app.component.ts +13 -68
  5. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.scss +3 -3
  6. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +1 -1
  7. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +1 -1
  8. package/src/app/chatlib/conversation-detail/message/avatar/avatar.component.html +1 -1
  9. package/src/app/chatlib/conversation-detail/message/avatar/avatar.component.ts +4 -4
  10. package/src/app/chatlib/conversation-detail/message/return-receipt/return-receipt.component.scss +3 -3
  11. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +9 -9
  12. package/src/app/components/bubbleMessageInfo-popover/bubbleinfo-popover.component.html +1 -1
  13. package/src/app/components/canned-response/canned-response.component.html +23 -26
  14. package/src/app/components/canned-response/canned-response.component.scss +2 -0
  15. package/src/app/components/canned-response/canned-response.component.ts +1 -3
  16. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +8 -8
  17. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +1 -24
  18. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +0 -30
  19. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +16 -29
  20. package/src/app/components/copilot-popover/copilot-popover.component.html +1 -1
  21. package/src/app/components/navbar/navbar.component.html +3 -3
  22. package/src/app/components/navbar/navbar.component.ts +38 -29
  23. package/src/app/components/project-item/project-item.component.ts +70 -52
  24. package/src/app/components/sidebar/sidebar.component.html +47 -67
  25. package/src/app/components/sidebar/sidebar.component.ts +117 -92
  26. package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +4 -4
  27. package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +14 -16
  28. package/src/app/modals/create-ticket/create-ticket.page.html +6 -6
  29. package/src/app/modals/create-ticket/create-ticket.page.ts +6 -8
  30. package/src/app/modals/loader-preview/loader-preview.page.ts +1 -1
  31. package/src/app/modals/send-whatsapp-template/send-whatsapp-template.page.scss +1 -1
  32. package/src/app/pages/conversation-detail/conversation-detail.page.html +3 -7
  33. package/src/app/pages/conversation-detail/conversation-detail.page.scss +1 -1
  34. package/src/app/pages/conversation-detail/conversation-detail.page.ts +4 -63
  35. package/src/app/pages/conversations-list/conversations-list.page.ts +8 -8
  36. package/src/app/pages/profile-info/profile-info.page.ts +3 -3
  37. package/src/app/services/brand/brand.service.ts +5 -5
  38. package/src/app/services/global-settings/global-settings.service.ts +2 -5
  39. package/src/app/services/tiledesk/tiledesk.service.ts +16 -0
  40. package/src/app/shared/shared.module.ts +0 -11
  41. package/src/app/utils/project-utils.ts +2 -2
  42. package/src/app/utils/utils-resources.ts +8 -7
  43. package/src/app/utils/utils.ts +1 -18
  44. package/src/assets/i18n/ar.json +1 -11
  45. package/src/assets/i18n/az.json +1 -11
  46. package/src/assets/i18n/de.json +1 -11
  47. package/src/assets/i18n/en.json +1 -11
  48. package/src/assets/i18n/es.json +1 -11
  49. package/src/assets/i18n/fr.json +1 -11
  50. package/src/assets/i18n/it.json +3 -13
  51. package/src/assets/i18n/kk.json +1 -11
  52. package/src/assets/i18n/pt.json +1 -11
  53. package/src/assets/i18n/ru.json +1 -11
  54. package/src/assets/i18n/sr.json +1 -11
  55. package/src/assets/i18n/sv.json +1 -11
  56. package/src/assets/i18n/tr.json +1 -11
  57. package/src/assets/i18n/uk.json +1 -11
  58. package/src/assets/i18n/uz.json +1 -12
  59. package/src/chat-config-template.json +0 -1
  60. package/src/chat-config.json +0 -1
  61. package/src/chat21-core/models/{projectUsers.ts → project_user.ts} +18 -12
  62. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +1 -1
  63. package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +1 -1
  64. package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +0 -3
  65. package/src/chat21-core/utils/constants.ts +2 -2
  66. package/src/chat21-core/utils/utils.ts +2 -10
  67. package/src/app/services/project_users/project-users.service.spec.ts +0 -16
  68. package/src/app/services/project_users/project-users.service.ts +0 -63
  69. package/src/app/utils/permissions.constants.ts +0 -138
  70. package/src/assets/js/agentDesktop-sdk.js +0 -47
  71. /package/src/assets/{images → img}/channel_icons/chat21.svg +0 -0
  72. /package/src/assets/{images → img}/channel_icons/direct.svg +0 -0
  73. /package/src/assets/{images → img}/channel_icons/email-logo.svg +0 -0
  74. /package/src/assets/{images → img}/channel_icons/form-logo_v2.svg +0 -0
  75. /package/src/assets/{images → img}/channel_icons/group.svg +0 -0
  76. /package/src/assets/{images → img}/channel_icons/messenger-logo.svg +0 -0
  77. /package/src/assets/{images → img}/channel_icons/telegram-logo.svg +0 -0
  78. /package/src/assets/{images → img}/channel_icons/voice.svg +0 -0
  79. /package/src/assets/{images → img}/channel_icons/whatsapp-logo.svg +0 -0
  80. /package/src/assets/{images → img}/default-avatar-x-select.png +0 -0
  81. /package/src/assets/{images → img}/f21ico-done.svg +0 -0
  82. /package/src/assets/{images → img}/f21ico-done_all.svg +0 -0
  83. /package/src/assets/{images → img}/f21ico-schedule.svg +0 -0
  84. /package/src/assets/{images → img}/file-alt-solid.png +0 -0
  85. /package/src/assets/{images → img}/icons/copilot.svg +0 -0
  86. /package/src/assets/{images → img}/json-file.svg +0 -0
  87. /package/src/assets/{images → img}/language_flag/ar.png +0 -0
  88. /package/src/assets/{images → img}/language_flag/az.png +0 -0
  89. /package/src/assets/{images → img}/language_flag/bg.png +0 -0
  90. /package/src/assets/{images → img}/language_flag/ca.png +0 -0
  91. /package/src/assets/{images → img}/language_flag/cs.png +0 -0
  92. /package/src/assets/{images → img}/language_flag/da.png +0 -0
  93. /package/src/assets/{images → img}/language_flag/de.png +0 -0
  94. /package/src/assets/{images → img}/language_flag/el.png +0 -0
  95. /package/src/assets/{images → img}/language_flag/en.png +0 -0
  96. /package/src/assets/{images → img}/language_flag/es.png +0 -0
  97. /package/src/assets/{images → img}/language_flag/fa.png +0 -0
  98. /package/src/assets/{images → img}/language_flag/fi.png +0 -0
  99. /package/src/assets/{images → img}/language_flag/fr.png +0 -0
  100. /package/src/assets/{images → img}/language_flag/he.png +0 -0
  101. /package/src/assets/{images → img}/language_flag/hi.png +0 -0
  102. /package/src/assets/{images → img}/language_flag/hr.png +0 -0
  103. /package/src/assets/{images → img}/language_flag/hu.png +0 -0
  104. /package/src/assets/{images → img}/language_flag/id.png +0 -0
  105. /package/src/assets/{images → img}/language_flag/it.png +0 -0
  106. /package/src/assets/{images → img}/language_flag/ja.png +0 -0
  107. /package/src/assets/{images → img}/language_flag/kk.png +0 -0
  108. /package/src/assets/{images → img}/language_flag/ko.png +0 -0
  109. /package/src/assets/{images → img}/language_flag/ml-IN.png +0 -0
  110. /package/src/assets/{images → img}/language_flag/ne-NP.png +0 -0
  111. /package/src/assets/{images → img}/language_flag/nl.png +0 -0
  112. /package/src/assets/{images → img}/language_flag/no.png +0 -0
  113. /package/src/assets/{images → img}/language_flag/pl.png +0 -0
  114. /package/src/assets/{images → img}/language_flag/pt-BR.png +0 -0
  115. /package/src/assets/{images → img}/language_flag/pt.png +0 -0
  116. /package/src/assets/{images → img}/language_flag/ro.png +0 -0
  117. /package/src/assets/{images → img}/language_flag/ru.png +0 -0
  118. /package/src/assets/{images → img}/language_flag/sk.png +0 -0
  119. /package/src/assets/{images → img}/language_flag/sl.png +0 -0
  120. /package/src/assets/{images → img}/language_flag/sr.png +0 -0
  121. /package/src/assets/{images → img}/language_flag/sv.png +0 -0
  122. /package/src/assets/{images → img}/language_flag/ta.png +0 -0
  123. /package/src/assets/{images → img}/language_flag/th.png +0 -0
  124. /package/src/assets/{images → img}/language_flag/tr.png +0 -0
  125. /package/src/assets/{images → img}/language_flag/uk.png +0 -0
  126. /package/src/assets/{images → img}/language_flag/uz.png +0 -0
  127. /package/src/assets/{images → img}/language_flag/vi.png +0 -0
  128. /package/src/assets/{images → img}/language_flag/zh-CN.png +0 -0
  129. /package/src/assets/{images → img}/language_flag/zh-TW.png +0 -0
  130. /package/src/assets/{logos → img/logos}/chat21-logo.png +0 -0
  131. /package/src/assets/{logos → img/logos}/logo.png +0 -0
  132. /package/src/assets/{logos → img/logos}/tiledesk-logo_new_white.svg +0 -0
  133. /package/src/assets/{logos → img/logos}/tiledesk-solo-logo.png +0 -0
  134. /package/src/assets/{logos → img/logos}/tiledesk_logo.svg +0 -0
  135. /package/src/assets/{logos → img/logos}/tiledesk_logo_no_text.svg +0 -0
  136. /package/src/assets/{logos → img/logos}/tiledesk_logo_white_small.svg +0 -0
  137. /package/src/assets/{images → img}/no_conversation.jpg +0 -0
  138. /package/src/assets/{images → img}/no_image.png +0 -0
  139. /package/src/assets/{images → img}/no_image_user.png +0 -0
  140. /package/src/assets/{images → img}/pin.svg +0 -0
  141. /package/src/assets/{images → img}/pinned.svg +0 -0
  142. /package/src/assets/{images → img}/priority_icons/high.svg +0 -0
  143. /package/src/assets/{images → img}/priority_icons/high_v2.svg +0 -0
  144. /package/src/assets/{images → img}/priority_icons/low.svg +0 -0
  145. /package/src/assets/{images → img}/priority_icons/low_v2.svg +0 -0
  146. /package/src/assets/{images → img}/priority_icons/medium.svg +0 -0
  147. /package/src/assets/{images → img}/priority_icons/medium_v2.svg +0 -0
  148. /package/src/assets/{images → img}/priority_icons/urgent.svg +0 -0
  149. /package/src/assets/{images → img}/priority_icons/urgent_v2.svg +0 -0
  150. /package/src/assets/{images → img}/teammate-status/avaible.svg +0 -0
  151. /package/src/assets/{images → img}/teammate-status/inactive.svg +0 -0
  152. /package/src/assets/{images → img}/teammate-status/unavaible.svg +0 -0
  153. /package/src/assets/{images → img}/whatsapp_background.png +0 -0
@@ -2,7 +2,7 @@
2
2
  <div class="logo">
3
3
  <!-- <a class="logo-img-wpr" [ngClass]="{'small-sidebar-logo-img-wpr' : SIDEBAR_IS_SMALL === true }">
4
4
  <div class="logo-img" (click)="goToHome()" style="cursor: pointer;">
5
- <img class="small-sidebar__logo" src="assets/logos/tiledesk-solo-logo.svg" />
5
+ <img class="small-sidebar__logo" src="assets/img/logos/tiledesk-solo-logo.svg" />
6
6
  </div>
7
7
  </a> -->
8
8
 
@@ -12,7 +12,7 @@
12
12
  style="cursor: pointer;" [ngClass]="{'small-sidebar-avatar' : SIDEBAR_IS_SMALL === true, 'small-sidebar-avatar-with-avatar': SIDEBAR_IS_SMALL === true && !USER_PHOTO_PROFILE_EXIST}">
13
13
 
14
14
  <img *ngIf="USER_PHOTO_PROFILE_EXIST" id="sidebaravatar-img" class="sidebar-avatar" [src]="photo_profile_URL"
15
- onerror="this.src='assets/images/no_image_user.png'" />
15
+ onerror="this.src='assets/img/no_image_user.png'" />
16
16
 
17
17
  <div *ngIf="!USER_PHOTO_PROFILE_EXIST" id="sidebaravatar-no-img" class="sidebar-avatar"
18
18
  [ngStyle]="{'background': 'linear-gradient(rgb(255,255,255) -125%,' + currentUser?.fillColour + ')'}">
@@ -57,27 +57,25 @@
57
57
  <!-- ------------------------------------------- -->
58
58
  <!-- HOME (click)="goToHome()"" -->
59
59
  <!-- ------------------------------------------- -->
60
- <ng-container *ngIf="roles?.[PERMISSIONS.HOME_READ]">
61
- <div matTooltip="Home" #tooltip="matTooltip" matTooltipPosition='right'
62
- matTooltipHideDelay="100" matTooltipClass="custom-mat-tooltip">
63
- <a target="_self" href="{{ URLS.HOME }}" class="customAncor">
64
- <span>
65
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" width="24px" height="24px" fill="none">
66
- <path d="M240-200h120v-240h240v240h120v-360L480-740 240-560v360Zm-80 80v-480l320-240 320 240v480H520v-240h-80v240H160Zm320-350Z" />
67
- </svg>
68
- </span>
69
- </a>
70
- </div>
71
- </ng-container>
60
+ <div matTooltip="Home" #tooltip="matTooltip" matTooltipPosition='right'
61
+ matTooltipHideDelay="100" matTooltipClass="custom-mat-tooltip">
62
+ <a target="_self" href="{{ dashboard_home_url }}" class="customAncor">
63
+ <span>
64
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" width="24px" height="24px" fill="none">
65
+ <path d="M240-200h120v-240h240v240h120v-360L480-740 240-560v360Zm-80 80v-480l320-240 320 240v480H520v-240h-80v240H160Zm320-350Z" />
66
+ </svg>
67
+ </span>
68
+ </a>
69
+ </div>
72
70
 
73
71
  <!-- -------------------------------------------------------- -->
74
72
  <!-- @ Knowledge Bases -->
75
73
  <!-- -------------------------------------------------------- -->
76
- <ng-container *ngIf="USER_ROLE !== 'agent' && isVisibleKNB && roles?.[PERMISSIONS.KB_READ]">
74
+ <ng-container *ngIf="USER_ROLE !== 'agent' && isVisibleKNB">
77
75
  <div id="bot-anchor-wpr" matTooltipClass="custom-mat-tooltip"
78
- matTooltip="{{translationsMap?.get('Knowledgebases')}}" #tooltip="matTooltip" matTooltipPosition='right'
76
+ matTooltip="Knowledge Bases" #tooltip="matTooltip" matTooltipPosition='right'
79
77
  matTooltipHideDelay="100" routerLinkActive="item-active">
80
- <a target="_self" href="{{ URLS.KNOWLEDGEBASE }}" class="customAncor">
78
+ <a target="_self" href="{{ dashboard_knb_url }}" class="customAncor">
81
79
  <span>
82
80
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" width="24px" height="24px" fill="none">
83
81
  <path d="M390-120q-51 0-88-35.5T260-241q-60-8-100-53t-40-106q0-21 5.5-41.5T142-480q-11-18-16.5-38t-5.5-42q0-61 40-105.5t99-52.5q3-51 41-86.5t90-35.5q26 0 48.5 10t41.5 27q18-17 41-27t49-10q52 0 89.5 35t40.5 86q59 8 99.5 53T840-560q0 22-5.5 42T818-480q11 18 16.5 38.5T840-400q0 62-40.5 106.5T699-241q-5 50-41.5 85.5T570-120q-25 0-48.5-9.5T480-156q-19 17-42 26.5t-48 9.5Zm130-590v460q0 21 14.5 35.5T570-200q20 0 34.5-16t15.5-36q-21-8-38.5-21.5T550-306q-10-14-7.5-30t16.5-26q14-10 30-7.5t26 16.5q11 16 28 24.5t37 8.5q33 0 56.5-23.5T760-400q0-5-.5-10t-2.5-10q-17 10-36.5 15t-40.5 5q-17 0-28.5-11.5T640-440q0-17 11.5-28.5T680-480q33 0 56.5-23.5T760-560q0-33-23.5-56T680-640q-11 18-28.5 31.5T613-587q-16 6-31-1t-20-23q-5-16 1.5-31t22.5-20q15-5 24.5-18t9.5-30q0-21-14.5-35.5T570-760q-21 0-35.5 14.5T520-710Zm-80 460v-460q0-21-14.5-35.5T390-760q-21 0-35.5 14.5T340-710q0 16 9 29.5t24 18.5q16 5 23 20t2 31q-6 16-21 23t-31 1q-21-8-38.5-21.5T279-640q-32 1-55.5 24.5T200-560q0 33 23.5 56.5T280-480q17 0 28.5 11.5T320-440q0 17-11.5 28.5T280-400q-21 0-40.5-5T203-420q-2 5-2.5 10t-.5 10q0 33 23.5 56.5T280-320q20 0 37-8.5t28-24.5q10-14 26-16.5t30 7.5q14 10 16.5 26t-7.5 30q-14 19-32 33t-39 22q1 20 16 35.5t35 15.5q21 0 35.5-14.5T440-250Zm40-230Z" />
@@ -91,10 +89,10 @@
91
89
  <!-- ---------------------------------- -->
92
90
  <!-- Bot (click)="goToBots()" -->
93
91
  <!-- ---------------------------------- -->
94
- <ng-container *ngIf="USER_ROLE !== 'agent' && roles?.[PERMISSIONS.FLOWS_READ]">
95
- <div id="bot-anchor-wpr" matTooltipClass="custom-mat-tooltip" matTooltip="{{translationsMap?.get('Flows')}}"
92
+ <ng-container *ngIf="USER_ROLE !== 'agent'">
93
+ <div id="bot-anchor-wpr" matTooltipClass="custom-mat-tooltip" matTooltip="Bots"
96
94
  #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
97
- <a target="_self" href="{{ URLS.BOTS }}" id="bot-anchor" #botbtn class="customAncor">
95
+ <a target="_self" href="{{ dashboard_bots_url }}" id="bot-anchor" #botbtn class="customAncor">
98
96
  <span class="bot-icon-wpr">
99
97
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"width="24px" height="24px" fill="none">
100
98
  <path d="M12,21.9c-1,0-1.8-0.3-2.5-1c-0.7-0.7-1-1.5-1-2.5c0-0.8,0.3-1.6,0.8-2.2c0.5-0.6,1.2-1,1.9-1.2v-2.3H5.5V9H3 V2.5h6.4V9H7v2.3h10V8.9c-0.8-0.2-1.4-0.6-1.9-1.2c-0.5-0.6-0.8-1.3-0.8-2.2c0-1,0.3-1.8,1-2.5c0.7-0.7,1.5-1,2.5-1 c1,0,1.8,0.3,2.5,1c0.7,0.7,1,1.5,1,2.5c0,0.8-0.3,1.6-0.8,2.2c-0.5,0.6-1.2,1-1.9,1.2v3.9h-5.7v2.3c0.8,0.2,1.4,0.6,1.9,1.2 c0.5,0.6,0.8,1.3,0.8,2.2c0,1-0.3,1.8-1,2.5C13.8,21.6,13,21.9,12,21.9z M17.8,7.5c0.5,0,1-0.2,1.4-0.6c0.4-0.4,0.6-0.8,0.6-1.4 c0-0.5-0.2-1-0.6-1.4c-0.4-0.4-0.8-0.6-1.4-0.6c-0.5,0-1,0.2-1.4,0.6C16,4.5,15.8,5,15.8,5.5c0,0.5,0.2,1,0.6,1.4S17.2,7.5,17.8,7.5 z M4.5,7.5H8V4H4.5C4.5,4,4.5,7.5,4.5,7.5z M12,20.4c0.5,0,1-0.2,1.4-0.6S14,19,14,18.5s-0.2-1-0.6-1.4c-0.4-0.4-0.8-0.6-1.4-0.6 c-0.5,0-1,0.2-1.4,0.6S10,17.9,10,18.5s0.2,1,0.6,1.4C11,20.2,11.5,20.4,12,20.4z" />
@@ -107,10 +105,10 @@
107
105
  <!-- ------------------------------------------- -->
108
106
  <!-- Conversations (MONITOR) (click)="goToConversations()" -->
109
107
  <!-- ------------------------------------------- -->
110
- <ng-container *ngIf="isVisibleMON && roles?.[PERMISSIONS.INBOX_READ]">
111
- <div matTooltipClass="custom-mat-tooltip" matTooltip="{{translationsMap?.get('Monitor')}}"
108
+ <ng-container *ngIf="isVisibleMON">
109
+ <div matTooltipClass="custom-mat-tooltip" matTooltip="Monitor"
112
110
  #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
113
- <a target="_self" href="{{ URLS.MONITOR }}" class="customAncor">
111
+ <a target="_self" href="{{ dashboard_convs_url }}" class="customAncor">
114
112
  <!-- <i class="material-icons sidebar-icons">forum</i> -->
115
113
  <span>
116
114
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" width="24px" height="24px" fill="none">
@@ -125,27 +123,13 @@
125
123
 
126
124
  <div class="nav-custom sidebar-bottom">
127
125
 
128
- <!-- ----------------------------- -->
129
- <!-- WA broadcasts -->
130
- <!-- ----------------------------- -->
131
- <ng-container *ngIf="USER_ROLE !== 'agent' && roles?.[PERMISSIONS.AUTOMATIONSLOG_READ]">
132
- <div matTooltipClass="custom-mat-tooltip" matTooltip="{{translationsMap?.get('WhatsAppBroadcasts')}}"
133
- #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
134
- <a target="_self" href="{{ URLS.WHATSAPP }}" class="customAncor">
135
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 48 48" height="24" width="24">
136
- <path fill="none" fill-rule="evenodd" d="M40.6666 7.3156c-2.1744 -2.1755 -4.7577 -3.8995 -7.6012 -5.0726C30.222 1.0699 27.1745 0.4708 24.0986 0.4801 11.1899 0.4801 0.6816 10.936 0.6763 23.79c-0.0057 4.093 1.0733 8.1145 3.1269 11.655L0.48 47.52l12.4163 -3.2413c3.4367 1.8619 7.2841 2.8363 11.193 2.835h0.0094c12.9076 0 23.415 -10.4569 23.4212 -23.31 0.0078 -3.0653 -0.594 -6.1017 -1.7706 -8.9324 -1.1766 -2.8306 -2.9043 -5.399 -5.0827 -7.5557ZM24.0987 43.1794h-0.0084c-3.4845 0.001 -6.9057 -0.9315 -9.9078 -2.7007l-0.7109 -0.42 -7.3678 1.9236 1.9666 -7.1494 -0.463 -0.735C5.659 31.0132 4.6267 27.4386 4.6306 23.79c0 -10.6815 8.7371 -19.3724 19.4754 -19.3724 5.1513 -0.0092 10.0953 2.0281 13.7446 5.6638 3.6493 3.6357 5.705 8.572 5.715 13.7233 -0.0041 10.6827 -8.737 19.3747 -19.4669 19.3747Zm10.6774 -14.51c-0.5849 -0.2919 -3.465 -1.701 -3.9984 -1.8952 -0.5334 -0.1943 -0.9271 -0.292 -1.3167 0.2919 -0.3895 0.5837 -1.512 1.89 -1.8532 2.2837 -0.3413 0.3938 -0.6826 0.4368 -1.2675 0.1449 -0.5847 -0.2918 -2.4716 -0.9062 -4.707 -2.8906 -1.7399 -1.5446 -2.9137 -3.4513 -3.255 -4.0341 -0.3413 -0.5828 -0.0368 -0.8988 0.2561 -1.1886 0.2636 -0.2614 0.5849 -0.6804 0.8779 -1.0206 0.2929 -0.3403 0.3906 -0.5839 0.5848 -0.9723 0.1943 -0.3885 0.0976 -0.7288 -0.0483 -1.0195 -0.1459 -0.2909 -1.3167 -3.1585 -1.8039 -4.325 -0.4757 -1.1361 -0.9576 -0.9818 -1.3167 -0.9996 -0.3413 -0.0168 -0.7349 -0.021 -1.1225 -0.021 -0.2961 0.0077 -0.5875 0.0765 -0.856 0.2018 -0.2685 0.1253 -0.5081 0.3048 -0.7043 0.5269 -0.5364 0.5838 -2.0485 1.995 -2.0485 4.8594s2.1001 5.6364 2.3898 6.0248c0.2899 0.3886 4.1265 6.2717 9.997 8.7948 1.0901 0.4669 2.204 0.8763 3.337 1.2264 1.4017 0.4431 2.6775 0.3812 3.6854 0.2311 1.1246 -0.167 3.4651 -1.4092 3.9512 -2.7699 0.4862 -1.3608 0.4872 -2.5263 0.3413 -2.7689 -0.146 -0.2426 -0.5366 -0.3895 -1.1225 -0.6804Z" clip-rule="evenodd" stroke-width="1"></path>
137
- </svg>
138
- </a>
139
- </div>
140
- </ng-container>
141
-
142
126
  <!-- ------------------------------------------- -->
143
127
  <!-- CONTACTS (LEADS) (click)="goToContacts()" -->
144
128
  <!-- ------------------------------------------- -->
145
- <ng-container *ngIf="isVisibleCNT && roles?.[PERMISSIONS.LEADS_READ]">
146
- <div matTooltipClass="custom-mat-tooltip" matTooltip="{{translationsMap?.get('LABEL_CONTACTS')}}"
129
+ <ng-container *ngIf="isVisibleCNT">
130
+ <div matTooltipClass="custom-mat-tooltip" matTooltip="{{ contacts_lbl }}"
147
131
  #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
148
- <a target="_self" href="{{ URLS.CONTACTS }}" class="customAncor">
132
+ <a target="_self" href="{{ dashboard_contacts_url }}" class="customAncor">
149
133
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" width="24px" height="24px" fill="none">
150
134
  <path d="M160-40v-80h640v80H160Zm0-800v-80h640v80H160Zm320 400q50 0 85-35t35-85q0-50-35-85t-85-35q-50 0-85 35t-35 85q0 50 35 85t85 35ZM160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm70-80q45-56 109-88t141-32q77 0 141 32t109 88h70v-480H160v480h70Zm118 0h264q-29-20-62.5-30T480-280q-36 0-69.5 10T348-240Zm132-280q-17 0-28.5-11.5T440-560q0-17 11.5-28.5T480-600q17 0 28.5 11.5T520-560q0 17-11.5 28.5T480-520Zm0 40Z" />
151
135
  </svg>
@@ -157,10 +141,10 @@
157
141
  <!-- ------------------------------------------- -->
158
142
  <!-- ANALYTICS (click)="goToAnalytics()" -->
159
143
  <!-- ------------------------------------------- -->
160
- <ng-container *ngIf="USER_ROLE !== 'agent' && isVisibleANA && roles?.[PERMISSIONS.ANALYTICS_READ]">
161
- <div matTooltipClass="custom-mat-tooltip" matTooltip="{{translationsMap?.get('Analytics')}}"
144
+ <ng-container *ngIf="isVisibleANA && USER_ROLE !== 'agent'">
145
+ <div matTooltipClass="custom-mat-tooltip" matTooltip="{{ analytics_lbl }}"
162
146
  #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" >
163
- <a target="_self" href="{{ URLS.ANALYTICS }}" class="customAncor">
147
+ <a target="_self" href="{{ dashboard_analytics_url }}" class="customAncor">
164
148
  <!-- <i class="material-icons sidebar-icons">trending_up</i> -->
165
149
  <!-- <i class="material-icons sidebar-icons"> analytics </i> -->
166
150
  <!-- <i class="material-icons sidebar-icons"> bar_chart </i> -->
@@ -176,10 +160,10 @@
176
160
  <!-- ------------------------------------------- -->
177
161
  <!-- ACTIVITIES (click)="goToActivities()" -->
178
162
  <!-- ------------------------------------------- -->
179
- <ng-container *ngIf="isVisibleACT && roles?.[PERMISSIONS.ACTIVITIES_READ]">
163
+ <ng-container *ngIf="isVisibleACT">
180
164
  <div *ngIf="USER_ROLE !== 'agent'" matTooltipClass="custom-mat-tooltip"
181
- matTooltip="{{translationsMap?.get('Activities')}}" #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
182
- <a target="_self" href="{{ URLS.ACTIVITIES }}" class="customAncor">
165
+ matTooltip="{{ activities_lbl }}" #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
166
+ <a target="_self" href="{{ dashboard_activities_url }}" class="customAncor">
183
167
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" width="24px" height="24px" fill="none">
184
168
  <path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h168q13-36 43.5-58t68.5-22q38 0 68.5 22t43.5 58h168q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm80-80h280v-80H280v80Zm0-160h400v-80H280v80Zm0-160h400v-80H280v80Zm200-190q13 0 21.5-8.5T510-820q0-13-8.5-21.5T480-850q-13 0-21.5 8.5T450-820q0 13 8.5 21.5T480-790ZM200-200v-560 560Z" />
185
169
  </svg>
@@ -190,30 +174,26 @@
190
174
  <!-- ------------------------------------------- -->
191
175
  <!-- REQUESTS HISTORY (click)="goToHistory()" -->
192
176
  <!-- ------------------------------------------- -->
193
- <ng-container *ngIf="roles?.[PERMISSIONS.HISTORY_READ]">
194
- <div matTooltipClass="custom-mat-tooltip" matTooltip="{{translationsMap?.get('History')}}"
195
- #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
196
- <a target="_self" href="{{URLS.HISTORY}}" class="customAncor">
197
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" width="24px" height="24px" fill="none">
198
- <path d="M480-120q-138 0-240.5-91.5T122-440h82q14 104 92.5 172T480-200q117 0 198.5-81.5T760-480q0-117-81.5-198.5T480-760q-69 0-129 32t-101 88h110v80H120v-240h80v94q51-64 124.5-99T480-840q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-480q0 75-28.5 140.5t-77 114q-48.5 48.5-114 77T480-120Zm112-192L440-464v-216h80v184l128 128-56 56Z" />
199
- </svg>
200
- </a>
201
- </div>
202
- </ng-container>
177
+ <div matTooltipClass="custom-mat-tooltip" matTooltip="{{ history_lbl }}"
178
+ #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
179
+ <a target="_self" href="{{ dashboard_history_url }}" class="customAncor">
180
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" width="24px" height="24px" fill="none">
181
+ <path d="M480-120q-138 0-240.5-91.5T122-440h82q14 104 92.5 172T480-200q117 0 198.5-81.5T760-480q0-117-81.5-198.5T480-760q-69 0-129 32t-101 88h110v80H120v-240h80v94q51-64 124.5-99T480-840q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-480q0 75-28.5 140.5t-77 114q-48.5 48.5-114 77T480-120Zm112-192L440-464v-216h80v184l128 128-56 56Z" />
182
+ </svg>
183
+ </a>
184
+ </div>
203
185
 
204
186
  <!-- ----------------------------------------------------------------------------------- -->
205
187
  <!-- SETTINGS // old: goToSettings_CannedResponses() *ngIf="USER_ROLE !== 'agent'" (click)="goToWidgetSetUpOrToCannedResponses()" -->
206
188
  <!-- ----------------------------------------------------------------------------------- -->
207
- <ng-container *ngIf="roles?.[PERMISSIONS.SETTINGS_READ]">
208
- <div *ngIf="USER_ROLE !== 'agent'" matTooltipClass="custom-mat-tooltip"
209
- matTooltip="{{translationsMap?.get('Settings')}}" #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
210
- <a target="_self" href="{{URLS.SETTINGS}}" class="customAncor">
211
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" width="24px" height="24px" fill="none">
212
- <path d="m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z" />
213
- </svg>
214
- </a>
215
- </div>
216
- </ng-container>
189
+ <div *ngIf="USER_ROLE !== 'agent'" matTooltipClass="custom-mat-tooltip"
190
+ matTooltip="{{ settings_lbl }}" #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
191
+ <a target="_self" href="{{ dashboard_settings_url }}" class="customAncor">
192
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" width="24px" height="24px" fill="none">
193
+ <path d="m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z" />
194
+ </svg>
195
+ </a>
196
+ </div>
217
197
 
218
198
  <div class="sidebar-separator">
219
199
  <!-- <i class="material-symbols-outlined sidebar-icons">
@@ -230,7 +210,7 @@
230
210
  <!-- ------------------------------------------- -->
231
211
  <!-- LOGO BRAND (click)="goToOfficialSite()" -->
232
212
  <!-- ------------------------------------------- -->
233
- <a target="_blank" href="{{ URLS.TILEDESK }}" class="customAncor">
213
+ <a target="_blank" href="{{ tiledesk_url }}" class="customAncor">
234
214
  <img [src]="LOGOS_ITEMS['COMPANY_LOGO_NO_TEXT'].icon">
235
215
  </a>
236
216
  </div>
@@ -15,10 +15,7 @@ import { tranlatedLanguage } from '../../../chat21-core/utils/constants';
15
15
  // utils
16
16
  import { avatarPlaceholder, getColorBck } from 'src/chat21-core/utils/utils-user';
17
17
  import { BRAND_BASE_INFO, LOGOS_ITEMS } from 'src/app/utils/utils-resources';
18
- import { getOSCode, hasRole } from 'src/app/utils/utils';
19
- import { PERMISSIONS } from 'src/app/utils/permissions.constants';
20
- import { ProjectUser } from 'src/chat21-core/models/projectUsers';
21
- import { ProjectUsersService } from 'src/app/services/project_users/project-users.service';
18
+ import { getOSCode } from 'src/app/utils/utils';
22
19
 
23
20
  @Component({
24
21
  selector: 'app-sidebar',
@@ -34,7 +31,7 @@ export class SidebarComponent implements OnInit {
34
31
  IS_AVAILABLE: boolean = false;
35
32
  IS_INACTIVE: boolean = true;
36
33
  IS_BUSY: boolean;
37
- // isVisibleAPP: boolean;
34
+ isVisibleAPP: boolean;
38
35
  isVisibleANA: boolean;
39
36
  isVisibleACT: boolean;
40
37
  isVisibleMON: boolean;
@@ -44,10 +41,9 @@ export class SidebarComponent implements OnInit {
44
41
  project_id: string;
45
42
  DASHBOARD_URL: string;
46
43
  // HAS_CLICKED_OPEN_USER_DETAIL: boolean = false
47
- public translationsMap: Map<string, string>;
44
+ public translationMap: Map<string, string>;
48
45
  public_Key: any;
49
46
  conversations_lbl: string;
50
- whatsappbroadcast_lbl: string;
51
47
  contacts_lbl: string;
52
48
  apps_lbl: string;
53
49
  analytics_lbl: string;
@@ -57,14 +53,19 @@ export class SidebarComponent implements OnInit {
57
53
  countClickOnOpenUserDetailSidebar: number = 0
58
54
  USER_PHOTO_PROFILE_EXIST: boolean;
59
55
  currentUser: any;
60
- URLS: { [key: string]: string} = {};
61
-
62
- public projectUser: ProjectUser;
63
- public roles: { [key: string]: boolean }
64
-
56
+ dashboard_home_url: string;
57
+ dashboard_knb_url: string;
58
+ dashboard_bots_url: string;
59
+ dashboard_convs_url: string;
60
+ dashboard_contacts_url: string;
61
+ dashboard_app_url: string;
62
+ dashboard_analytics_url: string;
63
+ dashboard_activities_url: string;
64
+ dashboard_history_url: string;
65
+ dashboard_settings_url: string;
66
+ tiledesk_url: string;
65
67
  LOGOS_ITEMS = LOGOS_ITEMS;
66
68
  BRAND_BASE_INFO = BRAND_BASE_INFO;
67
- PERMISSIONS = PERMISSIONS;
68
69
  constructor(
69
70
  public imageRepoService: ImageRepoService,
70
71
  public appStorageService: AppStorageService,
@@ -74,13 +75,12 @@ export class SidebarComponent implements OnInit {
74
75
  public wsService: WebsocketService,
75
76
  public appConfigProvider: AppConfigProvider,
76
77
  private translate: TranslateService,
77
- public projectUsersService: ProjectUsersService,
78
78
  public events: EventsService,
79
79
 
80
80
  ) { }
81
81
 
82
82
  ngOnInit() {
83
- this.URLS.TILEDESK = BRAND_BASE_INFO['COMPANY_SITE_URL'] as string
83
+ this.tiledesk_url = BRAND_BASE_INFO['COMPANY_SITE_URL'] as string
84
84
 
85
85
  this.DASHBOARD_URL = this.appConfig.getConfig().dashboardUrl + '#/project/';
86
86
  this.getStoredProjectAndUserRole()
@@ -92,36 +92,33 @@ export class SidebarComponent implements OnInit {
92
92
 
93
93
 
94
94
  getStoredProjectAndUserRole() {
95
- this.events.subscribe('storage:last_project',async (project) =>{
95
+ this.events.subscribe('storage:last_project',project =>{
96
96
  this.logger.log('[SIDEBAR] stored_project ', project)
97
97
  if (project && project !== 'undefined') {
98
98
  this.project_id = project.id_project.id
99
99
  this.USER_ROLE = project.role;
100
100
  this.buildURLs(this.USER_ROLE)
101
- this.projectUser = await this.projectUsersService.getProjectUserByProjectId(project.id_project.id)
102
- this.roles = this.checkRoles()
103
- this.logger.log('[SIDEBAR] roles ', this.roles)
104
101
  }
105
102
  })
106
103
  }
107
104
 
108
105
  buildURLs(USER_ROLE) {
109
- const base = this.DASHBOARD_URL + this.project_id;
110
-
111
- this.URLS = {
112
- HOME: `${base}/home`,
113
- KNOWLEDGEBASE: `${base}/knowledge-bases`,
114
- BOTS: `${base}/bots`,
115
- MONITOR: `${base}/wsrequests`,
116
- WHATSAPP: `${base}/automations`,
117
- CONTACTS: `${base}/contacts`,
118
- APPSTORE: `${base}/app-store`,
119
- ANALYTICS: `${base}/analytics`,
120
- ACTIVITIES: `${base}/activities`,
121
- HISTORY: `${base}/history`,
122
- SETTINGS: USER_ROLE !== 'agent' ? `${base}/widget-set-up` : `${base}/cannedresponses`,
123
- TILEDESK: 'https://www.tiledesk.com'
124
- };
106
+ this.dashboard_home_url = this.DASHBOARD_URL + this.project_id + '/home'
107
+ this.dashboard_knb_url = this.DASHBOARD_URL + this.project_id + '/knowledge-bases'
108
+ this.dashboard_bots_url = this.DASHBOARD_URL + this.project_id + '/bots'
109
+ this.dashboard_convs_url = this.DASHBOARD_URL + this.project_id + '/wsrequests'
110
+ this.dashboard_contacts_url = this.DASHBOARD_URL + this.project_id + '/contacts'
111
+ this.dashboard_app_url = this.DASHBOARD_URL + this.project_id + '/app-store'
112
+ this.dashboard_analytics_url = this.DASHBOARD_URL + this.project_id + '/analytics'
113
+ this.dashboard_activities_url = this.DASHBOARD_URL + this.project_id + '/activities'
114
+ this.dashboard_history_url = this.DASHBOARD_URL + this.project_id + '/history'
115
+ this.dashboard_settings_url = ''
116
+ if (USER_ROLE !== 'agent') {
117
+ this.dashboard_settings_url = this.DASHBOARD_URL + this.project_id + '/widget-set-up'
118
+ } else if (USER_ROLE === 'agent') {
119
+ this.dashboard_settings_url = this.DASHBOARD_URL + this.project_id + '/cannedresponses'
120
+ }
121
+ this.tiledesk_url = 'https://www.tiledesk.com'
125
122
 
126
123
  }
127
124
 
@@ -243,7 +240,6 @@ export class SidebarComponent implements OnInit {
243
240
  this.logger.error('[SIDEBAR] - ngOnInit - currentUser not found in storage ')
244
241
  }
245
242
  this.translateLabels()
246
- this.translations()
247
243
  }
248
244
 
249
245
 
@@ -260,7 +256,6 @@ export class SidebarComponent implements OnInit {
260
256
 
261
257
  this.translate.get(keys).subscribe((text: string) => {
262
258
  this.conversations_lbl = text['Conversations'];
263
- this.whatsappbroadcast_lbl = text['WhatsAppBroadcasts']
264
259
  this.contacts_lbl = text['LABEL_CONTACTS']
265
260
  this.apps_lbl = text['Apps']
266
261
  this.analytics_lbl = text['Analytics']
@@ -276,55 +271,13 @@ export class SidebarComponent implements OnInit {
276
271
 
277
272
  this.isVisibleANA = getOSCode("ANA", this.public_Key);
278
273
  this.isVisibleACT = getOSCode("ACT", this.public_Key);
274
+ this.isVisibleAPP = getOSCode("APP", this.public_Key);
279
275
  this.isVisibleMON = getOSCode("MON", this.public_Key);
280
276
  this.isVisibleCNT = getOSCode("CNT", this.public_Key);
281
277
  this.isVisibleKNB = getOSCode("KNB", this.public_Key);
282
-
278
+
283
279
  }
284
280
 
285
-
286
- checkRoles(): { [key: string]: boolean } {
287
- const permissionKeys = [
288
- 'HOME_READ',
289
- 'KB_READ',
290
- 'FLOWS_READ',
291
- 'INBOX_READ',
292
- 'AUTOMATIONSLOG_READ',
293
- 'LEADS_READ',
294
- 'ANALYTICS_READ',
295
- 'ACTIVITIES_READ',
296
- 'HISTORY_READ',
297
- 'PROJECTSETTINGS_GENERAL_READ',
298
- 'PROJECTSETTINGS_DEVELOPER_READ',
299
- 'PROJECTSETTINGS_SMARTASSIGNMENT_READ',
300
- 'PROJECTSETTINGS_NOTIFICATION_READ',
301
- 'PROJECTSETTINGS_SECURITY_READ',
302
- 'PROJECTSETTINGS_BANNED_READ',
303
- 'PROJECTSETTINGS_ADVANCED_READ'
304
- ] as const;
305
-
306
- const roles: { [key: string]: boolean } = {};
307
- for (const key of permissionKeys) {
308
- const permission = PERMISSIONS[key];
309
- roles[permission] = hasRole(this.projectUser, permission);
310
- }
311
-
312
-
313
- let settingRoleKEys = [
314
- 'PROJECTSETTINGS_GENERAL_READ',
315
- 'PROJECTSETTINGS_DEVELOPER_READ',
316
- 'PROJECTSETTINGS_SMARTASSIGNMENT_READ',
317
- 'PROJECTSETTINGS_NOTIFICATION_READ',
318
- 'PROJECTSETTINGS_SECURITY_READ',
319
- 'PROJECTSETTINGS_BANNED_READ',
320
- 'PROJECTSETTINGS_ADVANCED_READ'
321
- ] as const;
322
- roles[PERMISSIONS.SETTINGS_READ] = settingRoleKEys.some(settingKey => roles[PERMISSIONS[settingKey]]);
323
-
324
- return roles;
325
-
326
- }
327
-
328
281
  listenTocurrentProjectUserUserAvailability$() {
329
282
  this.wsService.currentProjectUserAvailability$.subscribe((data) => {
330
283
  this.logger.log('[SIDEBAR] - $UBSC TO WS USER AVAILABILITY & BUSY STATUS RES ', data);
@@ -374,20 +327,92 @@ export class SidebarComponent implements OnInit {
374
327
  }
375
328
  }
376
329
 
330
+ goToHome() {
331
+ let url = this.DASHBOARD_URL + this.project_id + '/home'
332
+ this.dashboard_home_url = url;
333
+ const myWindow = window.open(url, '_self');
334
+ myWindow.focus();
335
+ }
336
+
337
+ goToBots() {
338
+ let url = this.DASHBOARD_URL + this.project_id + '/bots/my-chatbots/all'
339
+ const myWindow = window.open(url, '_self');
340
+ myWindow.focus();
341
+ }
342
+
343
+ goToConversations() {
344
+ let url = this.DASHBOARD_URL + this.project_id + '/wsrequests'
345
+ const myWindow = window.open(url, '_self');
346
+ myWindow.focus();
347
+ }
348
+
349
+ goToContacts() {
350
+ let url = this.DASHBOARD_URL + this.project_id + '/contacts'
351
+ const myWindow = window.open(url, '_self');
352
+ myWindow.focus();
353
+ }
354
+
355
+ goToAppStore() {
356
+ let url = this.DASHBOARD_URL + this.project_id + '/app-store'
357
+ const myWindow = window.open(url, '_self');
358
+ myWindow.focus();
359
+ }
360
+
361
+ goToAnalytics() {
362
+ let url = this.DASHBOARD_URL + this.project_id + '/analytics'
363
+ const myWindow = window.open(url, '_self');
364
+ myWindow.focus();
365
+ }
366
+
367
+ goToActivities() {
368
+ let url = this.DASHBOARD_URL + this.project_id + '/activities'
369
+ const myWindow = window.open(url, '_self');
370
+ myWindow.focus();
371
+ }
372
+
373
+ goToHistory() {
374
+ let url = this.DASHBOARD_URL + this.project_id + '/history'
375
+ const myWindow = window.open(url, '_self');
376
+ myWindow.focus();
377
+ }
378
+
379
+ goToWidgetSetUpOrToCannedResponses() {
380
+ if (this.USER_ROLE !== 'agent') {
381
+ this.goToWidgetSetUp()
382
+ } else if (this.USER_ROLE === 'agent') {
383
+ this.goToSettings_CannedResponses()
384
+ }
385
+ }
386
+
387
+ goToWidgetSetUp() {
388
+ let url = this.DASHBOARD_URL + this.project_id + '/widget-set-up'
389
+ const myWindow = window.open(url, '_self');
390
+ myWindow.focus();
391
+ }
392
+
393
+ goToSettings_CannedResponses() {
394
+ let url = this.DASHBOARD_URL + this.project_id + '/cannedresponses'
395
+ const myWindow = window.open(url, '_self');
396
+ myWindow.focus();
397
+ }
398
+
399
+
400
+
377
401
  public translations() {
378
402
  const keys = [
379
- 'Monitor',
380
- 'Flows',
381
- 'Knowledgebases',
382
- 'WhatsAppBroadcasts',
383
- 'LABEL_CONTACTS',
384
- 'Apps',
385
- 'Analytics',
386
- 'Activities',
387
- 'History',
388
- 'Settings'
403
+ 'LABEL_AVAILABLE',
404
+ 'LABEL_NOT_AVAILABLE',
405
+ 'LABEL_BUSY',
406
+ 'VIEW_ALL_CONVERSATIONS',
407
+ 'CONVERSATIONS_IN_QUEUE',
408
+ 'CONVERSATION_IN_QUEUE',
409
+ 'NO_CONVERSATION_IN_QUEUE',
410
+ 'PINNED_PROJECT',
411
+ 'CHANGE_PINNED_PROJECT',
412
+ "CHANGE_TO_YOUR_STATUS_TO_AVAILABLE",
413
+ "CHANGE_TO_YOUR_STATUS_TO_UNAVAILABLE"
389
414
  ];
390
- this.translationsMap = this.translateService.translateLanguage(keys);
415
+ this.translationMap = this.translateService.translateLanguage(keys);
391
416
  }
392
417
 
393
418
 
@@ -22,7 +22,7 @@
22
22
  <!-- (click)="goToUserProfile()" -->
23
23
  <div role="button" class="user-details-avatar">
24
24
  <img *ngIf="USER_PHOTO_PROFILE_EXIST" class="user-img-in-sidebar-user-details" [src]="photo_profile_URL"
25
- onerror="this.src='assets/images/no_image_user.png'" />
25
+ onerror="this.src='assets/img/no_image_user.png'" />
26
26
 
27
27
  <div *ngIf="!USER_PHOTO_PROFILE_EXIST" class="user-img-in-sidebar-user-details"
28
28
  [ngStyle]="{'background': 'linear-gradient(rgb(255,255,255) -125%,' + user?.fillColour + ')'}">
@@ -51,7 +51,7 @@
51
51
  <div class="user-details-role">
52
52
  <h3>{{ USER_ROLE_LABEL }} </h3>
53
53
 
54
- <div class="user-details-view-profile" (click)="goToUserProfile()">
54
+ <div *ngIf="BRAND_BASE_INFO['DISPLAY_EDIT_PROFILE']" class="user-details-view-profile" (click)="goToUserProfile()">
55
55
  {{translationsMap.get('EditProfile')}}
56
56
  </div>
57
57
 
@@ -81,11 +81,11 @@
81
81
  [searchable]="false">
82
82
  <ng-template ng-label-tmp let-item="item">
83
83
  <img style="width: 15px;height: 15px;position: relative; top: 1px;" height="15" width="15" [src]="item?.avatar" />
84
- <span id="sidebaravatar_{{item.name}}" style="text-transform: capitalize; margin-left:8px"> {{item.label | translate}} </span>
84
+ <span id="sidebaravatar_{{item.name}}" style="text-transform: capitalize; margin-left:8px"> {{item.label}} </span>
85
85
  </ng-template>
86
86
  <ng-template ng-option-tmp let-item="item" let-index="index">
87
87
  <img style="width: 15px;height: 15px;position: relative; top: 1px;" height="15" width="15" [src]="item?.avatar" />
88
- <span id="sidebaravatar_{{item.name}}" style="text-transform: capitalize; margin-left:8px"> {{item.label | translate}} </span>
88
+ <span id="sidebaravatar_{{item.name}}" style="text-transform: capitalize; margin-left:8px"> {{item.label}} </span>
89
89
  </ng-template>
90
90
  </ng-select>
91
91
  </section>
@@ -52,9 +52,9 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
52
52
 
53
53
  selectedStatus: any;
54
54
  teammateStatus = [
55
- { id: 1, name: 'Available', avatar: 'assets/images/teammate-status/avaible.svg', label: "LABEL_AVAILABLE" },
56
- { id: 2, name: 'Unavailable', avatar: 'assets/images/teammate-status/unavaible.svg', label: "LABEL_NOT_AVAILABLE" },
57
- { id: 3, name: 'Inactive', avatar: 'assets/images/teammate-status/inactive.svg', label: "LABEL_INACTIVE" },
55
+ { id: 1, name: 'Available', avatar: 'assets/img/teammate-status/avaible.svg', label: "LABEL_AVAILABLE" },
56
+ { id: 2, name: 'Unavailable', avatar: 'assets/img/teammate-status/unavaible.svg', label: "LABEL_NOT_AVAILABLE" },
57
+ { id: 3, name: 'Inactive', avatar: 'assets/img/teammate-status/inactive.svg', label: "LABEL_INACTIVE" },
58
58
  ];
59
59
 
60
60
  translationsMap: Map<string, string> = new Map();
@@ -194,13 +194,13 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
194
194
  this.chat_lang = ''
195
195
  if (this.browserLang && !stored_preferred_lang) {
196
196
  this.chat_lang = this.browserLang
197
- // this.flag_url = "assets/images/language_flag/" + this.chat_lang + ".png"
197
+ // this.flag_url = "assets/img/language_flag/" + this.chat_lang + ".png"
198
198
 
199
199
  this.logger.log('[SIDEBAR-USER-DETAILS] flag_url: ', this.flag_url);
200
200
  this.logger.log('[SIDEBAR-USER-DETAILS] chat_lang: ', this.chat_lang);
201
201
  } else if (this.browserLang && stored_preferred_lang) {
202
202
  this.chat_lang = stored_preferred_lang
203
- // this.flag_url = "assets/images/language_flag/" + this.chat_lang + ".png"
203
+ // this.flag_url = "assets/img/language_flag/" + this.chat_lang + ".png"
204
204
  this.logger.log('[SIDEBAR-USER-DETAILS] flag_url: ', this.flag_url);
205
205
  this.logger.log('[SIDEBAR-USER-DETAILS] chat_lang: ', this.chat_lang);
206
206
  }
@@ -208,11 +208,11 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
208
208
  if (tranlatedLanguage.includes(this.chat_lang)) {
209
209
  this.logger.log('[SIDEBAR-USER-DETAILS] tranlatedLanguage includes', this.chat_lang, ': ', tranlatedLanguage.includes(this.chat_lang))
210
210
  this.translate.use(this.chat_lang);
211
- this.flag_url = "assets/images/language_flag/" + this.chat_lang + ".png"
211
+ this.flag_url = "assets/img/language_flag/" + this.chat_lang + ".png"
212
212
  } else {
213
213
  this.logger.log('[SIDEBAR-USER-DETAILS] tranlatedLanguage includes', this.chat_lang, ': ', tranlatedLanguage.includes(this.chat_lang))
214
214
  this.translate.use('en');
215
- this.flag_url = "assets/images/language_flag/en.png"
215
+ this.flag_url = "assets/img/language_flag/en.png"
216
216
  this.chat_lang = 'en'
217
217
  }
218
218
 
@@ -242,9 +242,9 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
242
242
  .set('SubscriptionPaymentProblem', text['SubscriptionPaymentProblem'])
243
243
  .set('ThePlanHasExpired', text['ThePlanHasExpired'])
244
244
 
245
- // this.teammateStatus.forEach(element => {
246
- // element.label = this.translationsMap.get(element.label)
247
- // });
245
+ this.teammateStatus.forEach(element => {
246
+ element.label = this.translationsMap.get(element.label)
247
+ });
248
248
 
249
249
  });
250
250
  }
@@ -261,7 +261,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
261
261
  listenToCurrentStoredProject() {
262
262
  this.events.subscribe('storage:last_project', projectObjct => {
263
263
  if (projectObjct && projectObjct !== 'undefined') {
264
- this.logger.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT ', projectObjct)
264
+ // this.logger.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT ', projectObjct)
265
265
 
266
266
  //TODO: recuperare info da root e non da id_project
267
267
  this.project = {
@@ -284,8 +284,6 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
284
284
  } else if (this.project.profile.type === 'payment' && this.project.profile.name === 'enterprise') {
285
285
  this.getEnterprisePlanTranslation();
286
286
  }
287
-
288
- this.wsService.subscriptionToWsCurrentProjectUserAvailability(this.project._id, projectObjct._id);
289
287
  }
290
288
  })
291
289
 
@@ -331,14 +329,14 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
331
329
  // this.logger.log('teammateStatus ', this.teammateStatus)
332
330
  this.selectedStatus = this.teammateStatus[2].id;
333
331
  this.logger.debug('[SIDEBAR-USER-DETAILS] - PROFILE_STATUS selected option', this.teammateStatus[2].name);
334
- // this.teammateStatus = this.teammateStatus.slice(0)
332
+ this.teammateStatus = this.teammateStatus.slice(0)
335
333
  } else if (projectUser['user_available'] === false && (projectUser['profileStatus'] === '' || !projectUser['profileStatus'])) {
336
334
  this.selectedStatus = this.teammateStatus[1].id;
337
335
  this.logger.debug('[SIDEBAR-USER-DETAILS] - PROFILE_STATUS selected option', this.teammateStatus[1].name);
338
- // this.teammateStatus = this.teammateStatus.slice(0)
336
+ this.teammateStatus = this.teammateStatus.slice(0)
339
337
  } else if (projectUser['user_available'] === true && (projectUser['profileStatus'] === '' || !projectUser['profileStatus'])) {
340
338
  this.selectedStatus = this.teammateStatus[0].id
341
- // this.teammateStatus = this.teammateStatus.slice(0)
339
+ this.teammateStatus = this.teammateStatus.slice(0)
342
340
  this.logger.debug('[SIDEBAR-USER-DETAILS] - PROFILE_STATUS selected option', this.teammateStatus[0].name);
343
341
  }
344
342
  this.IS_BUSY = projectUser['isBusy']