@chat21/chat21-ionic 3.0.61-rc8 → 3.0.61

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 (89) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/README.md +6 -0
  3. package/angular.json +2 -0
  4. package/config.xml +0 -1
  5. package/deploy_pre.sh +1 -1
  6. package/deploy_prod.sh +1 -1
  7. package/env.sample +1 -1
  8. package/package.json +4 -4
  9. package/src/app/app-routing.module.ts +15 -0
  10. package/src/app/app.component.ts +12 -9
  11. package/src/app/app.module.ts +11 -3
  12. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +36 -25
  13. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +160 -50
  14. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +108 -18
  15. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +21 -36
  16. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +19 -7
  17. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +35 -40
  18. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +1 -1
  19. package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.ts +13 -10
  20. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +3 -2
  21. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +2 -0
  22. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +142 -71
  23. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +57 -20
  24. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +32 -9
  25. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +98 -24
  26. package/src/app/components/ddp-header/ddp-header.component.html +9 -2
  27. package/src/app/components/ddp-header/ddp-header.component.ts +93 -18
  28. package/src/app/components/project-item/project-item.component.html +1 -1
  29. package/src/app/components/project-item/project-item.component.scss +1 -1
  30. package/src/app/components/project-item/project-item.component.ts +3 -3
  31. package/src/app/components/sidebar/sidebar.component.html +65 -52
  32. package/src/app/components/sidebar/sidebar.component.scss +23 -0
  33. package/src/app/components/sidebar/sidebar.component.ts +74 -26
  34. package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +20 -9
  35. package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +20 -3
  36. package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +24 -8
  37. package/src/app/pages/conversation-detail/conversation-detail.module.ts +5 -1
  38. package/src/app/pages/conversation-detail/conversation-detail.page.html +19 -10
  39. package/src/app/pages/conversation-detail/conversation-detail.page.scss +28 -0
  40. package/src/app/pages/conversation-detail/conversation-detail.page.ts +229 -389
  41. package/src/app/pages/conversations-list/conversations-list.page.ts +646 -454
  42. package/src/app/pages/create-canned-response/create-canned-response-routing.module.ts +17 -0
  43. package/src/app/pages/create-canned-response/create-canned-response.module.ts +30 -0
  44. package/src/app/pages/create-canned-response/create-canned-response.page.html +150 -0
  45. package/src/app/pages/create-canned-response/create-canned-response.page.scss +55 -0
  46. package/src/app/pages/create-canned-response/create-canned-response.page.spec.ts +24 -0
  47. package/src/app/pages/create-canned-response/create-canned-response.page.ts +319 -0
  48. package/src/app/pages/create-requester/create-requester-routing.module.ts +17 -0
  49. package/src/app/pages/create-requester/create-requester.module.ts +28 -0
  50. package/src/app/pages/create-requester/create-requester.page.html +67 -0
  51. package/src/app/pages/create-requester/create-requester.page.scss +30 -0
  52. package/src/app/pages/create-requester/create-requester.page.spec.ts +24 -0
  53. package/src/app/pages/create-requester/create-requester.page.ts +138 -0
  54. package/src/app/pages/create-ticket/create-ticket-routing.module.ts +17 -0
  55. package/src/app/pages/create-ticket/create-ticket.module.ts +28 -0
  56. package/src/app/pages/create-ticket/create-ticket.page.html +171 -0
  57. package/src/app/pages/create-ticket/create-ticket.page.scss +52 -0
  58. package/src/app/pages/create-ticket/create-ticket.page.spec.ts +24 -0
  59. package/src/app/pages/create-ticket/create-ticket.page.ts +432 -0
  60. package/src/app/pages/loader-preview/loader-preview.page.ts +2 -11
  61. package/src/app/pages/profile-info/profile-info.page.html +2 -2
  62. package/src/app/pages/profile-info/profile-info.page.scss +12 -1
  63. package/src/app/services/tiledesk/tiledesk.service.ts +190 -0
  64. package/src/app/shared/shared.module.ts +1 -1
  65. package/src/assets/i18n/de.json +37 -1
  66. package/src/assets/i18n/en.json +37 -1
  67. package/src/assets/i18n/es.json +38 -2
  68. package/src/assets/i18n/fr.json +38 -2
  69. package/src/assets/i18n/it.json +38 -2
  70. package/src/assets/i18n/pt.json +38 -2
  71. package/src/assets/i18n/ru.json +38 -2
  72. package/src/assets/i18n/sr.json +38 -2
  73. package/src/assets/i18n/tr.json +37 -1
  74. package/src/assets/images/default-avatar-x-select.png +0 -0
  75. package/src/assets/images/priority_icons/high.svg +3 -0
  76. package/src/assets/images/priority_icons/high_v2.svg +14 -0
  77. package/src/assets/images/priority_icons/low.svg +10 -0
  78. package/src/assets/images/priority_icons/low_v2.svg +14 -0
  79. package/src/assets/images/priority_icons/medium.svg +16 -0
  80. package/src/assets/images/priority_icons/medium_v2.svg +11 -0
  81. package/src/assets/images/priority_icons/urgent.svg +4 -0
  82. package/src/assets/images/priority_icons/urgent_v2.svg +16 -0
  83. package/src/chat-config-mqtt.json +25 -16
  84. package/src/chat-config-template.json +5 -4
  85. package/src/chat-config.json +1 -0
  86. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +8 -3
  87. package/src/chat21-core/utils/constants.ts +2 -0
  88. package/src/chat21-core/utils/utils-message.ts +19 -0
  89. package/src/global.scss +33 -9
@@ -52,7 +52,7 @@
52
52
  #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center; ">
53
53
  <a class="customAncor" style="margin-right: 0px !important">
54
54
  <!-- <i class="material-icons sidebar-icons">chat</i> -->
55
- <span id="openchat-span" style="position: relative;top: 10px;vertical-align: middle;">
55
+ <span id="openchat-span" style="position: relative;top: 9px;vertical-align: middle;">
56
56
  <svg id="openchat-svg" version="1.1" xmlns="http://www.w3.org/2000/svg"
57
57
  xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 23 21"
58
58
  style="enable-background:new 0 0 23 21;" xml:space="preserve"
@@ -71,11 +71,12 @@
71
71
  </li>
72
72
 
73
73
  <!-- ------------------------------------------- -->
74
- <!-- HOME -->
74
+ <!-- HOME (click)="goToHome()"" -->
75
75
  <!-- ------------------------------------------- -->
76
- <li (click)="goToHome()" matTooltip="Home" #tooltip="matTooltip" matTooltipPosition='right'
76
+
77
+ <li matTooltip="Home" #tooltip="matTooltip" matTooltipPosition='right'
77
78
  matTooltipHideDelay="100" matTooltipClass="custom-mat-tooltip">
78
- <a class="customAncor">
79
+ <a target="_self" href="{{ dashboard_home_url }}" class="customAncor">
79
80
  <i class="material-icons sidebar-icons">
80
81
  home
81
82
  </i>
@@ -84,16 +85,16 @@
84
85
 
85
86
 
86
87
  <!-- ---------------------------------- -->
87
- <!-- Bot -->
88
+ <!-- Bot (click)="goToBots()" -->
88
89
  <!-- ---------------------------------- -->
89
90
  <ng-container *ngIf="USER_ROLE !== 'agent'">
90
- <li (click)="goToBots()" id="bot-anchor-wpr" matTooltipClass="custom-mat-tooltip" matTooltip="Bots"
91
+ <li id="bot-anchor-wpr" matTooltipClass="custom-mat-tooltip" matTooltip="Bots"
91
92
  #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
92
- <a id="bot-anchor" #botbtn class="customAncor" style="height: 40px;margin-right: 0px !important;">
93
+ <a target="_self" href="{{ dashboard_bots_url }}" id="bot-anchor" #botbtn class="customAncor" style="height: 40px;margin-right: 0px !important;">
93
94
  <span class="bot-icon-wpr">
94
95
  <svg version="1.1" id="Objects" xmlns="http://www.w3.org/2000/svg"
95
96
  xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 30"
96
- style="enable-background:new 0 0 30 30;" xml:space="preserve" style="width: 25px;height: 25px;margin-top: 6px;">
97
+ style="enable-background:new 0 0 30 30;" xml:space="preserve" style="width: 25px;height: 25px;margin-top: 7px;">
97
98
  <g>
98
99
  <g>
99
100
  <path class="chat-bot-icon-st0" d="M24.6,12.6c-0.1,0-0.2,0-0.3,0c-1.6-2.9-4.5-5.8-9.2-5.8c-4.7,0-7.6,2.9-9.2,5.8c-0.2,0-0.4-0.1-0.6-0.1
@@ -114,73 +115,85 @@
114
115
  </ng-container>
115
116
 
116
117
  <!-- ------------------------------------------- -->
117
- <!-- REQUESTS (VISITORS) -->
118
+ <!-- Conversations (MONITOR) (click)="goToConversations()" -->
118
119
  <!-- ------------------------------------------- -->
119
- <li (click)="goToConversations()" matTooltipClass="custom-mat-tooltip" matTooltip="{{ conversations_lbl }}"
120
- #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
121
- <a class="customAncor" style="height: 40px;margin-right: 0px !important;">
122
- <!-- <i class="material-icons sidebar-icons">forum</i> -->
123
- <span class="realtime-icon-wpr" >
124
-
125
- <svg version="1.1" id="Livello_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
126
- viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve" style="width: 30px;height: 30px;margin-top: 6px;">
127
-
128
- <path class="realtime-icon-st3" d="M17.9,11.6l-1.4,1.9l-3.2-5.6l-1-2l-0.2,0.2l-3.7,6.4l-3-4.8L2.7,9.9v2.4l2.4-1.8L9,16.2l3.3-6.2l4,6.7l2.7-3.3
129
- l0.9,0c0.5-0.7,1-1.4,1.4-2L17.9,11.6z"/>
130
- </svg>
131
- </span>
132
-
133
- </a>
134
- </li>
135
-
136
-
120
+ <ng-container *ngIf="USER_ROLE !== 'agent'">
121
+ <li matTooltipClass="custom-mat-tooltip" matTooltip="Monitor"
122
+ #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
123
+ <a target="_self" href="{{ dashboard_convs_url }}" class="customAncor" style="height: 40px;margin-right: 0px !important;">
124
+ <!-- <i class="material-icons sidebar-icons">forum</i> -->
125
+ <span class="realtime-icon-wpr" >
126
+
127
+ <svg version="1.1" id="Livello_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
128
+ viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve" style="width: 30px;height: 30px;margin-top: 5px;">
129
+
130
+ <path class="realtime-icon-st3" d="M17.9,11.6l-1.4,1.9l-3.2-5.6l-1-2l-0.2,0.2l-3.7,6.4l-3-4.8L2.7,9.9v2.4l2.4-1.8L9,16.2l3.3-6.2l4,6.7l2.7-3.3
131
+ l0.9,0c0.5-0.7,1-1.4,1.4-2L17.9,11.6z"/>
132
+ </svg>
133
+ </span>
134
+
135
+ </a>
136
+ </li>
137
+ </ng-container>
137
138
 
138
139
  <!-- ------------------------------------------- -->
139
- <!-- CONTACTS (LEADS) -->
140
+ <!-- CONTACTS (LEADS) (click)="goToContacts()" -->
140
141
  <!-- ------------------------------------------- -->
141
- <li (click)="goToContacts()" matTooltipClass="custom-mat-tooltip" matTooltip="{{ contacts_lbl }}"
142
+ <li matTooltipClass="custom-mat-tooltip" matTooltip="{{ contacts_lbl }}"
142
143
  #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
143
- <a class="customAncor">
144
+ <a target="_self" href="{{ dashboard_contacts_url }}" class="customAncor">
144
145
  <i class="material-icons sidebar-icons">contacts</i>
145
146
  </a>
146
147
  </li>
147
148
 
148
149
  <!-- ------------------------------------------- -->
149
- <!-- APPS -->
150
+ <!-- APPS (click)="goToAppStore()" -->
150
151
  <!-- ------------------------------------------- -->
151
152
  <ng-container *ngIf="isVisibleAPP && USER_ROLE !== 'agent'">
152
- <li (click)="goToAppStore()" matTooltipClass="custom-mat-tooltip" matTooltip="{{ apps_lbl }}"
153
+ <li matTooltipClass="custom-mat-tooltip" matTooltip="{{ apps_lbl }}"
153
154
  #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
154
- <a class="customAncor">
155
+ <a target="_self" href="{{ dashboard_app_url }}" class="customAncor" style="margin-right: 0px !important;">
155
156
  <!-- <i class="material-icons sidebar-icons">apps</i> -->
156
- <i class="material-icons sidebar-icons">dashboard_customize</i>
157
-
157
+ <!-- <i class="material-icons sidebar-icons">dashboard_customize</i> -->
158
+ <span class="dashboard-customize-icon-wpr">
159
+ <svg version="1.1" id="Livello_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
160
+ viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve" style="width: 20px;height: 20px;margin-top: 10px;">
161
+ <path class="dashboard_customize-st0" d="M0,0h24v24H0V0z"/>
162
+ <path class="dashboard_customize-st1" d="M3,3h8v8H3V3z M13,3h8v8h-8V3z M3,13h8v8H3V13z M18,13h-2v3h-3v2h3v3h2v-3h3v-2h-3V13z"/>
163
+ </svg>
164
+ </span>
158
165
  </a>
159
166
  </li>
160
167
  </ng-container>
161
168
 
162
169
  <!-- ------------------------------------------- -->
163
- <!-- ANALYTICS -->
170
+ <!-- ANALYTICS (click)="goToAnalytics()" -->
164
171
  <!-- ------------------------------------------- -->
165
172
  <ng-container *ngIf="isVisibleANA && USER_ROLE !== 'agent'">
166
- <li (click)="goToAnalytics()" matTooltipClass="custom-mat-tooltip" matTooltip="{{ analytics_lbl }}"
167
- #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
168
- <a class="customAncor">
173
+ <li matTooltipClass="custom-mat-tooltip" matTooltip="{{ analytics_lbl }}"
174
+ #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;" >
175
+ <a target="_self" href="{{ dashboard_analytics_url }}" class="customAncor" style="margin-right: 0px !important;">
169
176
  <!-- <i class="material-icons sidebar-icons">trending_up</i> -->
170
177
  <!-- <i class="material-icons sidebar-icons"> analytics </i> -->
171
- <i class="material-icons sidebar-icons"> bar_chart </i>
172
-
178
+ <!-- <i class="material-icons sidebar-icons"> bar_chart </i> -->
179
+ <span class="bar-chart-icon-wpr">
180
+ <svg version="1.1" id="Livello_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
181
+ viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve" style="width: 20px;height: 20px;margin-top: 10px;">
182
+ <path class="bar-chart-icon-st0" d="M0,0h24v24H0V0z"/>
183
+ <path class="bar-chart-icon-st1" d="M5,9.2h3V19H5V9.2z M10.6,5h2.8v14h-2.8V5z M16.2,13H19v6h-2.8V13z"/>
184
+ </svg>
185
+ </span>
173
186
  </a>
174
187
  </li>
175
188
  </ng-container>
176
189
 
177
190
  <!-- ------------------------------------------- -->
178
- <!-- ACTIVITIES -->
191
+ <!-- ACTIVITIES (click)="goToActivities()" -->
179
192
  <!-- ------------------------------------------- -->
180
193
  <ng-container *ngIf="isVisibleACT">
181
- <li *ngIf="USER_ROLE !== 'agent'" (click)="goToActivities()" matTooltipClass="custom-mat-tooltip"
194
+ <li *ngIf="USER_ROLE !== 'agent'" matTooltipClass="custom-mat-tooltip"
182
195
  matTooltip="{{ activities_lbl }}" #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
183
- <a class="customAncor">
196
+ <a target="_self" href="{{ dashboard_activities_url }}" class="customAncor">
184
197
  <i class="material-icons sidebar-icons">assignment</i>
185
198
  </a>
186
199
  </li>
@@ -188,21 +201,21 @@
188
201
 
189
202
 
190
203
  <!-- ------------------------------------------- -->
191
- <!-- REQUESTS HISTORY -->
204
+ <!-- REQUESTS HISTORY (click)="goToHistory()" -->
192
205
  <!-- ------------------------------------------- -->
193
- <li (click)="goToHistory()" matTooltipClass="custom-mat-tooltip" matTooltip="{{ history_lbl }}"
206
+ <li matTooltipClass="custom-mat-tooltip" matTooltip="{{ history_lbl }}"
194
207
  #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
195
- <a class="customAncor">
208
+ <a target="_self" href="{{ dashboard_history_url }}" class="customAncor">
196
209
  <i class="material-icons sidebar-icons">history</i>
197
210
  </a>
198
211
  </li>
199
212
 
200
- <!-- ------------------------------------------- -->
201
- <!-- SETTINGS -->
202
- <!-- ------------------------------------------- -->
203
- <li *ngIf="USER_ROLE !== 'agent'" (click)="goToSettings_CannedResponses()" matTooltipClass="custom-mat-tooltip"
213
+ <!-- ----------------------------------------------------------------------------------- -->
214
+ <!-- SETTINGS // old: goToSettings_CannedResponses() *ngIf="USER_ROLE !== 'agent'" (click)="goToWidgetSetUpOrToCannedResponses()" -->
215
+ <!-- ----------------------------------------------------------------------------------- -->
216
+ <li *ngIf="USER_ROLE !== 'agent'" matTooltipClass="custom-mat-tooltip"
204
217
  matTooltip="{{ settings_lbl }}" #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
205
- <a class="customAncor">
218
+ <a target="_self" href="{{ dashboard_settings_url }}" class="customAncor">
206
219
  <i class="material-icons sidebar-icons">settings</i>
207
220
  </a>
208
221
  </li>
@@ -24,6 +24,21 @@
24
24
  fill: #647491
25
25
  }
26
26
 
27
+ .dashboard_customize-st0{
28
+ fill:none;
29
+ }
30
+ .dashboard_customize-st1{
31
+ fill:#647491;
32
+ }
33
+
34
+ .bar-chart-icon-st0{
35
+ fill:none;
36
+ }
37
+
38
+ .bar-chart-icon-st1{
39
+ fill:#647491;
40
+ }
41
+
27
42
  #bot-anchor-wpr:hover > #bot-anchor > .bot-icon-wpr > svg > g > g > .chat-bot-icon-st0 {
28
43
  fill: #a9afbb ;
29
44
  }
@@ -32,6 +47,14 @@ li:hover > a > .realtime-icon-wpr > svg > path {
32
47
  fill: #a9afbb;
33
48
  }
34
49
 
50
+ li:hover > a > .dashboard-customize-icon-wpr > svg > .dashboard_customize-st1 {
51
+ fill: #a9afbb;
52
+ }
53
+
54
+ li:hover > a > .bar-chart-icon-wpr > svg > .bar-chart-icon-st1{
55
+ fill: #a9afbb;
56
+ }
57
+
35
58
  #sidebaravatar-altenative-user-avatar {
36
59
  // line-height: 2.9;
37
60
  font-weight: 400;
@@ -13,7 +13,7 @@ import { EventsService } from 'src/app/services/events-service';
13
13
  import { tranlatedLanguage } from '../../../chat21-core/utils/constants';
14
14
 
15
15
  // utils
16
- import { avatarPlaceholder, getColorBck} from 'src/chat21-core/utils/utils-user';
16
+ import { avatarPlaceholder, getColorBck } from 'src/chat21-core/utils/utils-user';
17
17
 
18
18
  @Component({
19
19
  selector: 'app-sidebar',
@@ -49,6 +49,15 @@ export class SidebarComponent implements OnInit {
49
49
  countClickOnOpenUserDetailSidebar: number = 0
50
50
  USER_PHOTO_PROFILE_EXIST: boolean;
51
51
  currentUser: any;
52
+ dashboard_home_url: string;
53
+ dashboard_bots_url: string;
54
+ dashboard_convs_url: string;
55
+ dashboard_contacts_url: string;
56
+ dashboard_app_url: string;
57
+ dashboard_analytics_url: string;
58
+ dashboard_activities_url: string;
59
+ dashboard_history_url: string;
60
+ dashboard_settings_url: string;
52
61
  constructor(
53
62
  public imageRepoService: ImageRepoService,
54
63
  public appStorageService: AppStorageService,
@@ -59,13 +68,13 @@ export class SidebarComponent implements OnInit {
59
68
  public appConfigProvider: AppConfigProvider,
60
69
  private translate: TranslateService,
61
70
  public events: EventsService,
62
-
71
+
63
72
  ) { }
64
73
 
65
74
  ngOnInit() {
66
75
  this.DASHBOARD_URL = this.appConfig.getConfig().dashboardUrl + '#/project/';
67
76
  // console.log('[SIDEBAR] DASHBOARD_URL ', this.DASHBOARD_URL)
68
- this.getStoredProjectAndDashboardBaseUrl()
77
+ this.getStoredProjectAndUserRole()
69
78
  this.subcribeToAuthStateChanged()
70
79
  this.listenTocurrentProjectUserUserAvailability$()
71
80
  this.getOSCODE();
@@ -84,9 +93,47 @@ export class SidebarComponent implements OnInit {
84
93
  // height: '35px'
85
94
  // };
86
95
  // }
96
+
97
+
87
98
  }
88
99
 
89
100
 
101
+ getStoredProjectAndUserRole() {
102
+ const stored_project = localStorage.getItem('last_project')
103
+ this.logger.log('[SIDEBAR] stored_project ', stored_project)
104
+ if (stored_project && stored_project !== 'undefined') {
105
+ const project = JSON.parse(stored_project)
106
+ this.logger.log('[SIDEBAR] project ', project)
107
+
108
+ this.project_id = project.id_project.id
109
+ this.logger.log('[SIDEBAR] project_id ', this.project_id)
110
+
111
+ this.USER_ROLE = project.role;
112
+ this.logger.log('[SIDEBAR] USER_ROLE ', this.USER_ROLE)
113
+ this.buildURLs(this.USER_ROLE)
114
+ } else {
115
+ this.logger.log('[SIDEBAR] stored_project ', stored_project)
116
+ }
117
+ }
118
+
119
+ buildURLs(USER_ROLE) {
120
+ this.dashboard_home_url = this.DASHBOARD_URL + this.project_id + '/home'
121
+ this.dashboard_bots_url = this.DASHBOARD_URL + this.project_id + '/bots'
122
+ this.dashboard_convs_url = this.DASHBOARD_URL + this.project_id + '/wsrequests'
123
+ this.dashboard_contacts_url = this.DASHBOARD_URL + this.project_id + '/contacts'
124
+ this.dashboard_app_url = this.DASHBOARD_URL + this.project_id + '/app-store'
125
+ this.dashboard_analytics_url = this.DASHBOARD_URL + this.project_id + '/analytics'
126
+ this.dashboard_activities_url = this.DASHBOARD_URL + this.project_id + '/activities'
127
+ this.dashboard_history_url = this.DASHBOARD_URL + this.project_id + '/history'
128
+ this.dashboard_settings_url = ''
129
+ if (USER_ROLE !== 'agent') {
130
+ this.dashboard_settings_url = this.DASHBOARD_URL + this.project_id + '/widget-set-up'
131
+ } else if (USER_ROLE === 'agent') {
132
+ this.dashboard_settings_url = this.DASHBOARD_URL + this.project_id + '/cannedresponses'
133
+ }
134
+
135
+ }
136
+
90
137
  subcribeToAuthStateChanged() {
91
138
  this.messagingAuthService.BSAuthStateChanged.subscribe((state) => {
92
139
  this.logger.log('[SIDEBAR] BSAuthStateChanged ', state)
@@ -106,12 +153,12 @@ export class SidebarComponent implements OnInit {
106
153
  }
107
154
 
108
155
  checkIfExistPhotoProfile(imageUrl) {
109
- this.verifyImageURL(imageUrl, (imageExists) => {
156
+ this.verifyImageURL(imageUrl, (imageExists) => {
110
157
 
111
158
  if (imageExists === true) {
112
159
  this.USER_PHOTO_PROFILE_EXIST = true;
113
160
  this.logger.log('[SIDEBAR] photo_profile_URL IMAGE EXIST ', imageExists)
114
-
161
+
115
162
  } else {
116
163
  this.USER_PHOTO_PROFILE_EXIST = false;
117
164
  this.logger.log('[SIDEBAR] photo_profile_URL IMAGE EXIST ', imageExists)
@@ -134,7 +181,7 @@ export class SidebarComponent implements OnInit {
134
181
  currentUser['fullname_initial'] = 'N/A'
135
182
  currentUser['fillColour'] = 'rgb(98, 100, 167)'
136
183
  }
137
- }
184
+ }
138
185
 
139
186
  verifyImageURL(image_url, callBack) {
140
187
  const img = new Image();
@@ -380,36 +427,21 @@ export class SidebarComponent implements OnInit {
380
427
 
381
428
 
382
429
 
383
-
384
- getStoredProjectAndDashboardBaseUrl() {
385
- const stored_project = localStorage.getItem('last_project')
386
- // console.log('[SIDEBAR] stored_project ', stored_project)
387
- if (stored_project) {
388
- const project = JSON.parse(stored_project)
389
- this.logger.log('[SIDEBAR] project ', project)
390
-
391
- this.project_id = project.id_project.id
392
- this.logger.log('[SIDEBAR] project_id ', this.project_id)
393
-
394
- this.USER_ROLE = project.role;
395
- this.logger.log('[SIDEBAR] USER_ROLE ', this.USER_ROLE)
396
- }
397
- }
398
-
399
430
  goToHome() {
400
431
  let url = this.DASHBOARD_URL + this.project_id + '/home'
432
+ this.dashboard_home_url = url;
401
433
  const myWindow = window.open(url, '_self');
402
434
  myWindow.focus();
403
435
  }
404
436
 
405
- goToConversations() {
406
- let url = this.DASHBOARD_URL + this.project_id + '/wsrequests'
437
+ goToBots() {
438
+ let url = this.DASHBOARD_URL + this.project_id + '/bots'
407
439
  const myWindow = window.open(url, '_self');
408
440
  myWindow.focus();
409
441
  }
410
442
 
411
- goToBots() {
412
- let url = this.DASHBOARD_URL + this.project_id + '/bots'
443
+ goToConversations() {
444
+ let url = this.DASHBOARD_URL + this.project_id + '/wsrequests'
413
445
  const myWindow = window.open(url, '_self');
414
446
  myWindow.focus();
415
447
  }
@@ -446,12 +478,28 @@ export class SidebarComponent implements OnInit {
446
478
  myWindow.focus();
447
479
  }
448
480
 
481
+ goToWidgetSetUpOrToCannedResponses() {
482
+ if (this.USER_ROLE !== 'agent') {
483
+ this.goToWidgetSetUp()
484
+ } else if (this.USER_ROLE === 'agent') {
485
+ this.goToSettings_CannedResponses()
486
+ }
487
+ }
488
+
489
+ goToWidgetSetUp() {
490
+ let url = this.DASHBOARD_URL + this.project_id + '/widget-set-up'
491
+ const myWindow = window.open(url, '_self');
492
+ myWindow.focus();
493
+ }
494
+
449
495
  goToSettings_CannedResponses() {
450
496
  let url = this.DASHBOARD_URL + this.project_id + '/cannedresponses'
451
497
  const myWindow = window.open(url, '_self');
452
498
  myWindow.focus();
453
499
  }
454
500
 
501
+
502
+
455
503
  public translations() {
456
504
  const keys = [
457
505
  'Available',
@@ -21,11 +21,11 @@
21
21
 
22
22
  <!-- (click)="goToUserProfile()" -->
23
23
  <div role="button" class="user-details-avatar">
24
- <img *ngIf="USER_PHOTO_PROFILE_EXIST" class="user-img-in-sidebar-user-details" [src]="photo_profile_URL"
24
+ <img *ngIf="USER_PHOTO_PROFILE_EXIST" class="user-img-in-sidebar-user-details" [src]="photo_profile_URL"
25
25
  onerror="this.src='assets/images/no_image_user.png'" />
26
26
 
27
- <div *ngIf="!USER_PHOTO_PROFILE_EXIST" class="user-img-in-sidebar-user-details"
28
- [ngStyle]="{'background': 'linear-gradient(rgb(255,255,255) -125%,' + user?.fillColour + ')'}">
27
+ <div *ngIf="!USER_PHOTO_PROFILE_EXIST" class="user-img-in-sidebar-user-details"
28
+ [ngStyle]="{'background': 'linear-gradient(rgb(255,255,255) -125%,' + user?.fillColour + ')'}">
29
29
  <span id="sidebaravatar-altenative-user-avatar" class="sidebar-user-details-altenative-user-avatar">
30
30
  {{ user?.fullname_initial }}
31
31
  </span>
@@ -76,7 +76,7 @@
76
76
  <section *ngIf="isVisiblePAY" class="user-details-plan-info">
77
77
  <span>
78
78
  <div> {{prjct_name}} </div>
79
- <div style="display: inline-block;"> {{ profile_name_translated }} </div>
79
+ <div style="display: inline-block;"> {{ profile_name_translated }} </div>
80
80
 
81
81
  <div *ngIf="plan_type === 'payment' && plan_subscription_is_active === false"
82
82
  style="color:#f44336; position:relative; top: -1px;;display: inline-block;">
@@ -99,12 +99,23 @@
99
99
  border-top: 1px solid rgba(255, 255,255, 0.2);"> -->
100
100
 
101
101
 
102
- <section class="user-details-footer-section" (click)=onLogout()
102
+ <section class="user-details-footer-section"
103
103
  [ngClass]="{'footer-margin-top-pricing-no-visible': isVisiblePAY === false }">
104
- <i class="material-icons user-details-logout-icon">
105
- logout
106
- </i>
107
- <div> Logout</div>
104
+ <div role="button" class="logout-btn-wpr" (click)=onLogout()>
105
+ <i class="material-icons user-details-logout-icon" >
106
+ logout
107
+ </i>
108
+ <div class="user-details-logout-text">
109
+ {{LOGOUT_msg}}
110
+ </div>
111
+ </div>
112
+ </section>
113
+
114
+ <section class="user-details-footer-chat-version">
115
+ <div class="chat-version">
116
+ <!-- &copy; {{test | date: 'yyyy'}} {{company_name}} ver {{version}} -->
117
+ ver {{version}}
118
+ </div>
108
119
  </section>
109
120
 
110
121
  </div>
@@ -253,28 +253,45 @@ button.user-details-btn-close {
253
253
  margin: auto;
254
254
  position: absolute;
255
255
  text-align: center;
256
- cursor: pointer;
256
+
257
257
  padding-bottom: 15px;
258
258
  padding-top: 200px;
259
259
  font-size: 16px;
260
260
  font-weight: 400;
261
261
  // bottom: 50px;
262
+ bottom: 55px;
262
263
  // top:355px
263
264
  }
264
265
 
266
+ .logout-btn-wpr {
267
+ cursor: pointer;
268
+ }
269
+
265
270
  .footer-margin-top-pricing-no-visible {
266
271
  padding-top: 240px;
267
272
  }
268
273
  .user-details-logout-icon {
269
274
  color: #a9afbb;
270
275
  font-size: 30px;
271
- margin-top: 30px;
276
+ // margin-top: 30px;
272
277
  }
273
278
 
274
279
  .user-details-logout-icon:hover {
275
280
  color: #fff;
276
281
  }
277
282
 
283
+ .user-details-footer-chat-version {
284
+ position: absolute;
285
+ bottom: 11px;
286
+ text-align: center;
287
+ margin: auto;
288
+ transform: translateX(-50%);
289
+ left: 50%;
290
+ margin: auto;
291
+ font-size: 12px;
292
+ font-weight: 400;
293
+ }
294
+
278
295
  :host ::ng-deep .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-bar {
279
296
  background-color: #a9afbb;
280
297
  margin-left: 30px;
@@ -315,4 +332,4 @@ button.user-details-btn-close {
315
332
  font-weight: 400;
316
333
  font-family: "Poppins";
317
334
  font-size: 32px;
318
- }
335
+ }
@@ -11,7 +11,8 @@ import { skip } from 'rxjs/operators';
11
11
  import { AppConfigProvider } from 'src/app/services/app-config';
12
12
  import { EventsService } from 'src/app/services/events-service';
13
13
  import { tranlatedLanguage } from '../../../chat21-core/utils/constants';
14
- import { avatarPlaceholder, getColorBck} from 'src/chat21-core/utils/utils-user';
14
+ import { avatarPlaceholder, getColorBck } from 'src/chat21-core/utils/utils-user';
15
+ import * as PACKAGE from 'package.json';
15
16
  @Component({
16
17
  selector: 'app-sidebar-user-details',
17
18
  templateUrl: './sidebar-user-details.component.html',
@@ -40,6 +41,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
40
41
  PAYD_PLAN_NAME_ENTERPRISE_msg: string;
41
42
  PRO_PLAN_TRIAL_msg: string;
42
43
  FREE_PLAN_msg: string;
44
+ LOGOUT_msg: string;
43
45
  profile_name_translated: string;
44
46
  SubscriptionPaymentProblem: string;
45
47
  user: any
@@ -53,8 +55,10 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
53
55
  public_Key: any
54
56
  plan_name: string;
55
57
  plan_subscription_is_active: boolean;
56
- USER_PHOTO_PROFILE_EXIST: boolean;
57
-
58
+ USER_PHOTO_PROFILE_EXIST: boolean;
59
+ version: string
60
+ test: Date = new Date();
61
+ company_name: string = 'Tiledesk'
58
62
  constructor(
59
63
  private translate: TranslateService,
60
64
  public tiledeskAuthService: TiledeskAuthService,
@@ -68,6 +72,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
68
72
  ) { }
69
73
 
70
74
  ngOnInit() {
75
+ this.version = PACKAGE.version;
71
76
  this.getCurrentChatLangAndTranslateLabels();
72
77
  this.subcribeToAuthStateChanged();
73
78
  this.listenTocurrentProjectUserUserAvailability$();
@@ -95,12 +100,12 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
95
100
  }
96
101
 
97
102
  checkIfExistPhotoProfile(imageUrl) {
98
- this.verifyImageURL(imageUrl, (imageExists) => {
103
+ this.verifyImageURL(imageUrl, (imageExists) => {
99
104
 
100
105
  if (imageExists === true) {
101
106
  this.USER_PHOTO_PROFILE_EXIST = true;
102
107
  this.logger.log('[SIDEBAR-USER-DETAILS] photo_profile_URL IMAGE EXIST ', imageExists)
103
-
108
+
104
109
  } else {
105
110
  this.USER_PHOTO_PROFILE_EXIST = false;
106
111
  this.logger.log('[SIDEBAR-USER-DETAILS] photo_profile_URL IMAGE EXIST ', imageExists)
@@ -124,7 +129,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
124
129
  currentUser['fullname_initial'] = 'N/A'
125
130
  currentUser['fillColour'] = 'rgb(98, 100, 167)'
126
131
  }
127
- }
132
+ }
128
133
 
129
134
  verifyImageURL(image_url, callBack) {
130
135
  const img = new Image();
@@ -198,7 +203,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
198
203
  this.logger.log('[SIDEBAR-USER-DETAILS] chat_lang: ', this.chat_lang);
199
204
  }
200
205
 
201
-
206
+
202
207
  if (tranlatedLanguage.includes(this.chat_lang)) {
203
208
  this.logger.log('[SIDEBAR-USER-DETAILS] tranlatedLanguage includes', this.chat_lang, ': ', tranlatedLanguage.includes(this.chat_lang))
204
209
  this.translate.use(this.chat_lang);
@@ -218,6 +223,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
218
223
  this.getIsBusyTranslation();
219
224
  this.getSubscriptionPaymentProblemTranslation();
220
225
  this.getThePlanHasExpiredTranslation();
226
+ this.getLogoutTranslation();
221
227
  }
222
228
 
223
229
 
@@ -276,6 +282,15 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
276
282
  });
277
283
  }
278
284
 
285
+ getLogoutTranslation() {
286
+ this.translate.get('LABEL_LOGOUT')
287
+ .subscribe((text: string) => {
288
+ // this.deleteContact_msg = text;
289
+ // console.log('[SIDEBAR-USER-DETAILS] - GET Logout label ', text)
290
+ this.LOGOUT_msg = text
291
+ });
292
+ }
293
+
279
294
  getSubscriptionPaymentProblemTranslation() {
280
295
  this.translate.get('SubscriptionPaymentProblem')
281
296
  .subscribe((text: string) => {
@@ -298,7 +313,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
298
313
  getCurrentStoredProject() {
299
314
  try {
300
315
  const project = localStorage.getItem('last_project')
301
- if (project) {
316
+ if (project && project !== 'undefined') {
302
317
  const projectObjct = JSON.parse(localStorage.getItem('last_project'))
303
318
  // console.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT ', projectObjct)
304
319
 
@@ -388,6 +403,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
388
403
  });
389
404
  }
390
405
 
406
+
391
407
 
392
408
 
393
409
  listenTocurrentProjectUserUserAvailability$() {
@@ -35,6 +35,9 @@ import { SharedModule } from 'src/app/shared/shared.module';
35
35
  // import { SharedConversationInfoModule } from 'src/app/shared/shared-conversation-info.module';
36
36
  import { NgxLinkifyjsModule } from 'ngx-linkifyjs';
37
37
  import { ScrollbarThemeModule } from '../../utils/scrollbar-theme.directive';
38
+ import { PickerModule } from '@ctrl/ngx-emoji-mart';
39
+
40
+
38
41
  @NgModule({
39
42
  imports: [
40
43
  CommonModule,
@@ -43,6 +46,7 @@ import { ScrollbarThemeModule } from '../../utils/scrollbar-theme.directive';
43
46
  TooltipModule,
44
47
  ConversationDetailPageRoutingModule,
45
48
  ScrollbarThemeModule,
49
+ PickerModule,
46
50
  TranslateModule.forChild({
47
51
  loader: {
48
52
  provide: TranslateLoader,
@@ -58,7 +62,7 @@ import { ScrollbarThemeModule } from '../../utils/scrollbar-theme.directive';
58
62
  declarations: [
59
63
  ConversationDetailPage,
60
64
  HeaderConversationDetailComponent,
61
- MessageTextAreaComponent,
65
+ MessageTextAreaComponent
62
66
  // BubbleDayMessageComponent,
63
67
  // BubbleSystemMessageComponent,
64
68
  // BubbleMyMessageComponent,