@chat21/chat21-ionic 3.0.90-rc.1 → 3.0.90-rc.3
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.
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/app/app-routing.module.ts +5 -1
- package/src/app/app.module.ts +3 -1
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +20 -16
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +67 -61
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +27 -19
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +17 -3
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +47 -0
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +38 -1
- package/src/app/chatlib/conversation-detail/message/options/options.component.html +5 -0
- package/src/app/chatlib/conversation-detail/message/options/options.component.scss +34 -0
- package/src/app/chatlib/conversation-detail/message/options/options.component.spec.ts +24 -0
- package/src/app/chatlib/conversation-detail/message/options/options.component.ts +54 -0
- package/src/app/components/bubbleMessageInfo-popover/bubbleinfo-popover.component.html +15 -3
- package/src/app/components/bubbleMessageInfo-popover/bubbleinfo-popover.component.scss +26 -0
- package/src/app/components/bubbleMessageInfo-popover/bubbleinfo-popover.component.ts +23 -2
- package/src/app/modals/json-message/json-message-routing.module.ts +17 -0
- package/src/app/modals/json-message/json-message.module.ts +30 -0
- package/src/app/modals/json-message/json-message.page.html +15 -0
- package/src/app/modals/json-message/json-message.page.scss +17 -0
- package/src/app/modals/json-message/json-message.page.spec.ts +24 -0
- package/src/app/modals/json-message/json-message.page.ts +50 -0
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +1 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +1 -1
- package/src/app/shared/shared.module.ts +3 -0
- package/src/assets/i18n/ar.json +2 -1
- package/src/assets/i18n/az.json +2 -1
- package/src/assets/i18n/de.json +2 -1
- package/src/assets/i18n/en.json +2 -1
- package/src/assets/i18n/es.json +2 -1
- package/src/assets/i18n/fr.json +2 -1
- package/src/assets/i18n/it.json +2 -1
- package/src/assets/i18n/kk.json +2 -1
- package/src/assets/i18n/pt.json +2 -1
- package/src/assets/i18n/ru.json +2 -1
- package/src/assets/i18n/sr.json +2 -1
- package/src/assets/i18n/sv.json +2 -1
- package/src/assets/i18n/tr.json +2 -1
- package/src/assets/i18n/uk.json +2 -1
- package/src/assets/i18n/uz.json +2 -1
- package/src/assets/images/json-file.svg +1 -0
- package/src/global.scss +18 -0
- package/src/variables.scss +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# chat21-ionic ver 3.0
|
|
2
2
|
|
|
3
|
+
### 3.0.90-rc.3
|
|
4
|
+
- added: options menu and popover on click to show copy, canned and Json response options
|
|
5
|
+
- changed: icon-button moved outside bubble-message only for the first message of each sender
|
|
6
|
+
|
|
7
|
+
### 3.0.90-rc.2
|
|
8
|
+
- added: info and copy icon on received messages
|
|
9
|
+
- added: flash icon to distinguish chat offline message sent also by email
|
|
10
|
+
|
|
3
11
|
### 3.0.90-rc.1
|
|
4
12
|
- added: autofocus on first input
|
|
5
13
|
- added: tiledesk logo on sidebar
|
package/package.json
CHANGED
|
@@ -64,7 +64,11 @@ const routes: Routes = [
|
|
|
64
64
|
{
|
|
65
65
|
path: 'send-email',
|
|
66
66
|
loadChildren: () => import('./modals/send-email/send-email.module').then( m => m.SendEmailModalModule)
|
|
67
|
-
}
|
|
67
|
+
},
|
|
68
68
|
{
|
|
69
|
+
path: 'json-message',
|
|
70
|
+
loadChildren: () => import('./modals/json-message/json-message.module').then( m => m.JsonMessagePageModule)
|
|
71
|
+
}
|
|
72
|
+
|
|
69
73
|
|
|
70
74
|
|
|
71
75
|
|
package/src/app/app.module.ts
CHANGED
|
@@ -88,6 +88,7 @@ import { LoaderPreviewPageModule } from './modals/loader-preview/loader-preview.
|
|
|
88
88
|
import { CreateTicketPageModule } from './modals/create-ticket/create-ticket.module';
|
|
89
89
|
import { CreateCannedResponsePageModule } from './modals/create-canned-response/create-canned-response.module';
|
|
90
90
|
import { SendEmailModalModule } from './modals/send-email/send-email.module';
|
|
91
|
+
import { JsonMessagePageModule } from './modals/json-message/json-message.module';
|
|
91
92
|
// UTILS
|
|
92
93
|
import { ScrollbarThemeModule } from './utils/scrollbar-theme.directive';
|
|
93
94
|
import { SharedModule } from 'src/app/shared/shared.module';
|
|
@@ -294,7 +295,8 @@ const appInitializerFn = (appConfig: AppConfigProvider, logger: NGXLogger) => {
|
|
|
294
295
|
SendEmailModalModule,
|
|
295
296
|
CreateTicketPageModule,
|
|
296
297
|
CreateRequesterPageModule,
|
|
297
|
-
CreateCannedResponsePageModule
|
|
298
|
+
CreateCannedResponsePageModule,
|
|
299
|
+
JsonMessagePageModule
|
|
298
300
|
],
|
|
299
301
|
bootstrap: [AppComponent],
|
|
300
302
|
|
|
@@ -98,20 +98,24 @@
|
|
|
98
98
|
|
|
99
99
|
<div class="message-date-hover"> {{message.timestamp | date:'HH:mm' }} </div>
|
|
100
100
|
|
|
101
|
-
<ng-container *ngIf="areVisibleCAR && supportMode">
|
|
101
|
+
<!-- <ng-container *ngIf="areVisibleCAR && supportMode">
|
|
102
102
|
<ion-button shape="round" size="small" class="btn-add-msg canned" ion-button fill="clear"
|
|
103
103
|
(click)="presentCreateCannedResponseModal(message)" [tooltip]="addAsCannedResponseTooltipText"
|
|
104
104
|
[options]="tooltipOptions" placement="bottom">
|
|
105
105
|
<ion-icon slot="icon-only" name="flash-outline" style="font-size: 1em;"> </ion-icon>
|
|
106
106
|
<span class="add-canned-response-add-icon">+</span>
|
|
107
107
|
</ion-button>
|
|
108
|
-
</ng-container>
|
|
108
|
+
</ng-container> -->
|
|
109
109
|
|
|
110
110
|
|
|
111
111
|
<div class="bubble-container">
|
|
112
112
|
|
|
113
|
-
<div class="email-logo" *ngIf="message?.attributes?.channel && message?.attributes?.channel
|
|
113
|
+
<div class="email-logo" *ngIf="message?.attributes?.channel && message?.attributes?.channel.includes(TYPE_MSG_EMAIL)">
|
|
114
114
|
<ion-icon name="mail"></ion-icon>
|
|
115
|
+
<ion-icon name="flash"
|
|
116
|
+
*ngIf="message?.attributes?.channel.includes('offline_')"
|
|
117
|
+
[ngStyle]="{'color': stylesMap.get('bubbleSentBackground')}">
|
|
118
|
+
</ion-icon>
|
|
115
119
|
</div>
|
|
116
120
|
|
|
117
121
|
<!--backgroundColor non viene ancora usato -->
|
|
@@ -127,7 +131,8 @@
|
|
|
127
131
|
[fontFamily]="stylesMap.get('fontFamily')"
|
|
128
132
|
(onBeforeMessageRender)="onBeforeMessageRenderFN($event)"
|
|
129
133
|
(onAfterMessageRender)="onAfterMessageRenderFN($event)"
|
|
130
|
-
(onElementRendered)="onElementRenderedFN($event)"
|
|
134
|
+
(onElementRendered)="onElementRenderedFN($event)"
|
|
135
|
+
(onOptionsMessage)="onClickOptionsMessage($event)">
|
|
131
136
|
</chat-bubble-message>
|
|
132
137
|
</div>
|
|
133
138
|
|
|
@@ -174,28 +179,27 @@
|
|
|
174
179
|
(onBeforeMessageRender)="onBeforeMessageRenderFN($event)"
|
|
175
180
|
(onAfterMessageRender)="onAfterMessageRenderFN($event)"
|
|
176
181
|
(onElementRendered)="onElementRenderedFN($event)"
|
|
177
|
-
(
|
|
182
|
+
(onOptionsMessage)="onClickOptionsMessage($event)">
|
|
178
183
|
</chat-bubble-message>
|
|
179
184
|
|
|
180
|
-
<div class="options-container">
|
|
181
|
-
<div class="copy-logo" (click)="onClickCopyMesage($event, message)" *ngIf="message.text.trim() !== ''">
|
|
182
|
-
<ion-icon name="copy-outline"></ion-icon>
|
|
183
|
-
</div>
|
|
184
|
-
<!-- <div class="menu-logo" (click)="onClickBubbleMenu($event, message)">
|
|
185
|
-
<ion-icon name="caret-down"></ion-icon>
|
|
186
|
-
</div> -->
|
|
187
|
-
</div>
|
|
188
|
-
|
|
189
185
|
</div>
|
|
190
186
|
|
|
191
|
-
<ng-container *ngIf="
|
|
187
|
+
<ng-container *ngIf="message?.attributes && message?.attributes?.sourcePage && !isSameSender(message?.sender, i)">
|
|
188
|
+
<ion-button shape="round" size="small" class="btn-info-msg " ion-button fill="clear"
|
|
189
|
+
(click)="onClickInfoMessage(message, i)" [tooltip]="addAsCannedResponseTooltipText"
|
|
190
|
+
[options]="tooltipOptions" placement="bottom">
|
|
191
|
+
<ion-icon slot="icon-only" name="information-circle-outline"></ion-icon>
|
|
192
|
+
</ion-button>
|
|
193
|
+
</ng-container>
|
|
194
|
+
|
|
195
|
+
<!-- <ng-container *ngIf="areVisibleCAR && supportMode">
|
|
192
196
|
<ion-button shape="round" size="small" class="btn-add-msg canned" ion-button fill="clear"
|
|
193
197
|
(click)="presentCreateCannedResponseModal(message)" [tooltip]="addAsCannedResponseTooltipText"
|
|
194
198
|
[options]="tooltipOptions" placement="bottom">
|
|
195
199
|
<ion-icon slot="icon-only" name="flash-outline" style="font-size: 1em;"> </ion-icon>
|
|
196
200
|
<span class="add-canned-response-add-icon">+</span>
|
|
197
201
|
</ion-button>
|
|
198
|
-
</ng-container>
|
|
202
|
+
</ng-container> -->
|
|
199
203
|
<!-- <ng-container *ngIf="supportMode">
|
|
200
204
|
<ion-button shape="round" size="small" class="btn-add-msg emoji" ion-button fill="clear"
|
|
201
205
|
(click)="presentEmojiiModal()" tooltip="{{addAsCannedResponseTooltipText}}"
|
|
@@ -33,6 +33,46 @@
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
|
|
37
|
+
//------- MANAGE CHAT-OPTIONS component :: INIT ------- //
|
|
38
|
+
:host .base_sent .msg_sent.no-background ::ng-deep > div{
|
|
39
|
+
.options-container{
|
|
40
|
+
background: transparent;
|
|
41
|
+
|
|
42
|
+
.options-logo{
|
|
43
|
+
color:var(--bck-msg-sent);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:host .base_receive .msg_receive.no-background ::ng-deep > div{
|
|
50
|
+
.options-container{
|
|
51
|
+
background: transparent;
|
|
52
|
+
|
|
53
|
+
.options-logo{
|
|
54
|
+
color: var(--bck-msg-received);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:host .base_sent .msg_sent ::ng-deep > div {
|
|
61
|
+
.options-container{
|
|
62
|
+
right: unset;
|
|
63
|
+
left: 1;
|
|
64
|
+
border-top-right-radius: unset;
|
|
65
|
+
border-top-left-radius: 16px;
|
|
66
|
+
background: radial-gradient(at top left,rgba(#2a6ac1,1) 60%,rgba(#2a6ac1,0) 80%);
|
|
67
|
+
flex-direction: row;
|
|
68
|
+
|
|
69
|
+
.options-logo{
|
|
70
|
+
color: #ffffff;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//------- MANAGE CHAT-OPTIONS component :: END ------- //
|
|
75
|
+
|
|
36
76
|
.manage_conversation_info_container{
|
|
37
77
|
height: 34px;
|
|
38
78
|
display: flex;
|
|
@@ -211,6 +251,14 @@ ion-item {
|
|
|
211
251
|
height: 16px;
|
|
212
252
|
border-radius: 3px;
|
|
213
253
|
color: rgb(135, 150, 175);
|
|
254
|
+
|
|
255
|
+
ion-icon[name="flash"]{
|
|
256
|
+
position: absolute;
|
|
257
|
+
top: -5px;
|
|
258
|
+
left: -4px;
|
|
259
|
+
color: var(--bubble-blue);
|
|
260
|
+
font-size: small;
|
|
261
|
+
}
|
|
214
262
|
}
|
|
215
263
|
|
|
216
264
|
}
|
|
@@ -227,7 +275,8 @@ ion-item {
|
|
|
227
275
|
|
|
228
276
|
|
|
229
277
|
&:hover .message-date-hover,
|
|
230
|
-
&:hover .btn-add-msg,
|
|
278
|
+
&:hover .btn-add-msg,
|
|
279
|
+
&:hover .btn-options-msg,
|
|
231
280
|
&:hover .options-container{
|
|
232
281
|
display: block;
|
|
233
282
|
}
|
|
@@ -287,60 +336,6 @@ ion-item {
|
|
|
287
336
|
max-width: 100% !important;
|
|
288
337
|
}
|
|
289
338
|
|
|
290
|
-
.options-container{
|
|
291
|
-
position: relative;
|
|
292
|
-
display: none;
|
|
293
|
-
-webkit-box-align: center;
|
|
294
|
-
align-items: center;
|
|
295
|
-
-webkit-box-pack: center;
|
|
296
|
-
justify-content: center;
|
|
297
|
-
top: 0px;
|
|
298
|
-
right: 30px;
|
|
299
|
-
height: 16px;
|
|
300
|
-
margin: 5px;
|
|
301
|
-
z-index: 2;
|
|
302
|
-
}
|
|
303
|
-
.menu-logo{
|
|
304
|
-
// background-color: var(--list-bkg-color);
|
|
305
|
-
// box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.4);
|
|
306
|
-
// position: relative;
|
|
307
|
-
// display: flex;
|
|
308
|
-
// -webkit-box-align: center;
|
|
309
|
-
// align-items: center;
|
|
310
|
-
// -webkit-box-pack: center;
|
|
311
|
-
// justify-content: center;
|
|
312
|
-
// top: 0px;
|
|
313
|
-
// right: 30px;
|
|
314
|
-
// z-index: 2;
|
|
315
|
-
width: 20px;
|
|
316
|
-
border-radius: 3px;
|
|
317
|
-
color: rgb(135, 150, 175);
|
|
318
|
-
|
|
319
|
-
&:hover{
|
|
320
|
-
cursor: pointer;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
.copy-logo{
|
|
325
|
-
// background-color: var(--list-bkg-color);
|
|
326
|
-
// box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.4);
|
|
327
|
-
// position: relative;
|
|
328
|
-
// display: flex;
|
|
329
|
-
// -webkit-box-align: center;
|
|
330
|
-
// align-items: center;
|
|
331
|
-
// -webkit-box-pack: center;
|
|
332
|
-
// justify-content: center;
|
|
333
|
-
// top: 0px;
|
|
334
|
-
// right: 50px;
|
|
335
|
-
// z-index: 2;
|
|
336
|
-
width: 20px;
|
|
337
|
-
border-radius: 3px;
|
|
338
|
-
color: rgb(135, 150, 175);
|
|
339
|
-
|
|
340
|
-
&:hover{
|
|
341
|
-
cursor: pointer;
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
339
|
|
|
345
340
|
}
|
|
346
341
|
|
|
@@ -349,10 +344,10 @@ ion-item {
|
|
|
349
344
|
display: none;
|
|
350
345
|
width: 75%;
|
|
351
346
|
align-items: center;
|
|
352
|
-
color:
|
|
347
|
+
color: var(--icon-color);
|
|
353
348
|
font-size: 12px;
|
|
354
349
|
svg{
|
|
355
|
-
fill:
|
|
350
|
+
fill: var(--icon-color);
|
|
356
351
|
margin-right: 5px;
|
|
357
352
|
}
|
|
358
353
|
&.show{
|
|
@@ -364,23 +359,28 @@ ion-item {
|
|
|
364
359
|
color: #647491;
|
|
365
360
|
font-size: 12px;
|
|
366
361
|
align-self: center;
|
|
367
|
-
|
|
362
|
+
margin: 0px 5px;
|
|
368
363
|
display: none;
|
|
369
364
|
|
|
370
365
|
}
|
|
371
366
|
|
|
372
|
-
|
|
367
|
+
|
|
368
|
+
.btn-add-msg, .btn-info-msg, .btn-options-msg {
|
|
373
369
|
border-radius: 50%;
|
|
374
370
|
--padding-end: 5px;
|
|
375
371
|
--padding-start: 5px;
|
|
376
|
-
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.13);
|
|
372
|
+
// box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.13);
|
|
377
373
|
display: none;
|
|
378
374
|
align-self: center;
|
|
379
375
|
margin: 0px 5px;
|
|
380
376
|
|
|
377
|
+
:hover{
|
|
378
|
+
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.13);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
381
|
ion-icon{
|
|
382
382
|
font-size: 1.2em;
|
|
383
|
-
color: var(--
|
|
383
|
+
color: var(--icon-color)
|
|
384
384
|
}
|
|
385
385
|
|
|
386
386
|
.add-canned-response-add-icon{
|
|
@@ -393,6 +393,12 @@ ion-item {
|
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
395
|
|
|
396
|
+
.btn-info-msg{
|
|
397
|
+
display: block;
|
|
398
|
+
height: 25px;
|
|
399
|
+
width: 25px;
|
|
400
|
+
}
|
|
401
|
+
|
|
396
402
|
/* LOADING */
|
|
397
403
|
/*http://tobiasahlin.com/spinkit/*/
|
|
398
404
|
#chat21-spinner {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { JsonMessagePage } from './../../../modals/json-message/json-message.page';
|
|
1
2
|
import { BubbleInfoPopoverComponent } from '../../../components/bubbleMessageInfo-popover/bubbleinfo-popover.component';
|
|
2
3
|
import { MessageModel } from 'src/chat21-core/models/message';
|
|
3
4
|
import { ConversationContentComponent } from '../conversation-content/conversation-content.component';
|
|
@@ -151,18 +152,26 @@ export class IonConversationDetailComponent extends ConversationContentComponent
|
|
|
151
152
|
this.onAddUploadingBubble.emit(value);
|
|
152
153
|
}
|
|
153
154
|
|
|
154
|
-
|
|
155
|
-
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] - onClickBubbleMenu');
|
|
156
|
-
|
|
155
|
+
onClickOptionsMessage(event:{option: string, message: MessageModel}){
|
|
156
|
+
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] - onClickBubbleMenu', event);
|
|
157
|
+
if(event.option==='copy'){
|
|
158
|
+
this.onClickCopyMessage(event.message)
|
|
159
|
+
}else if(event.option === 'addCanned'){
|
|
160
|
+
if(this.areVisibleCAR && this.supportMode){
|
|
161
|
+
this.presentCreateCannedResponseModal(event.message)
|
|
162
|
+
}
|
|
163
|
+
}else if(event.option === 'jsonInfo'){
|
|
164
|
+
this.presentJsonMessageModal(event.message)
|
|
165
|
+
}
|
|
157
166
|
}
|
|
158
167
|
|
|
159
|
-
|
|
160
|
-
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] -
|
|
168
|
+
onClickCopyMessage(message: MessageModel){
|
|
169
|
+
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] - onClickCopyMessage');
|
|
161
170
|
navigator.clipboard.writeText(message.text)
|
|
162
171
|
this.presentToast()
|
|
163
172
|
}
|
|
164
173
|
|
|
165
|
-
|
|
174
|
+
onClickInfoMessage(message: MessageModel, index: number){
|
|
166
175
|
if(message && message.attributes && message.attributes.sourcePage){
|
|
167
176
|
this.showSourceInfo = !this.showSourceInfo
|
|
168
177
|
this.showSourceInfoIndex = index
|
|
@@ -212,26 +221,25 @@ export class IonConversationDetailComponent extends ConversationContentComponent
|
|
|
212
221
|
return await modal.present()
|
|
213
222
|
}
|
|
214
223
|
|
|
215
|
-
async
|
|
224
|
+
async presentJsonMessageModal(message: MessageModel): Promise<any> {
|
|
225
|
+
this.logger.log('[BUBBLE-MESSAGE] PRESENT JSON MESSAGE MODAL ')
|
|
216
226
|
const attributes = {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
cssClass: 'my-custom-class',
|
|
227
|
+
message: message
|
|
228
|
+
}
|
|
229
|
+
const modal: HTMLIonModalElement = await this.modalController.create({
|
|
230
|
+
component: JsonMessagePage,
|
|
231
|
+
cssClass: 'json-modal-class',
|
|
223
232
|
componentProps: attributes,
|
|
224
|
-
|
|
225
|
-
|
|
233
|
+
swipeToClose: false,
|
|
234
|
+
backdropDismiss: false,
|
|
226
235
|
keyboardClose: true,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
popover.onDidDismiss().then((dataReturned: any) => {
|
|
236
|
+
})
|
|
237
|
+
modal.onDidDismiss().then((dataReturned: any) => {
|
|
230
238
|
//
|
|
231
239
|
this.logger.log('[BUBBLE-MESSAGE] ', dataReturned.data)
|
|
232
240
|
})
|
|
233
241
|
|
|
234
|
-
return await
|
|
242
|
+
return await modal.present()
|
|
235
243
|
}
|
|
236
244
|
|
|
237
245
|
async presentToast(){
|
package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html
CHANGED
|
@@ -2,14 +2,23 @@
|
|
|
2
2
|
<!-- [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px'}" -->
|
|
3
3
|
<!-- isImage >{{isImage(message) }} message.metadata.width {{message?.metadata?.width }} -->
|
|
4
4
|
<!-- 'width': (isImage(message) || isFrame(message))? sizeImage?.width : null -->
|
|
5
|
-
<div id="bubble-message"
|
|
5
|
+
<div id="bubble-message" [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px' }" class="messages primary-color">
|
|
6
6
|
|
|
7
|
+
<!-- <div class="options-container" >
|
|
8
|
+
<div class="options-logo" (click)="onClickOptionsMessage($event, message)" >
|
|
9
|
+
<ion-icon name="chevron-down"></ion-icon>
|
|
10
|
+
</div>
|
|
11
|
+
</div> -->
|
|
12
|
+
<chat-options
|
|
13
|
+
[message]="message"
|
|
14
|
+
(onOptionsMessage)="onOptionsMessageFN($event)">
|
|
15
|
+
</chat-options>
|
|
7
16
|
|
|
8
17
|
<div>
|
|
9
18
|
|
|
10
19
|
<div *ngIf="messageType(MESSAGE_TYPE_OTHERS, message) && !isSameSender"
|
|
11
20
|
[style.color]="convertColorToRGBA(fontColor, 65)"
|
|
12
|
-
[ngStyle]="{'
|
|
21
|
+
[ngStyle]="{'padding': (isImage(message) || isFrame(message))? '10px 16px 8px 16px': '10px 8px 0px 8px'}" class="message_sender_fullname">
|
|
13
22
|
{{message?.sender_fullname}}
|
|
14
23
|
</div>
|
|
15
24
|
<!-- message type:: image -->
|
|
@@ -47,7 +56,11 @@
|
|
|
47
56
|
|
|
48
57
|
|
|
49
58
|
<!-- [tooltip]="timeTooltipLeft" [options]="tooltipOptions" placement="left" content-type="template" (click)="handleTooltipEvents($event)" -->
|
|
50
|
-
<div *ngIf="message?.text">
|
|
59
|
+
<div *ngIf="message?.text" style="display: flex; margin: 0px 0px 0px 0px;">
|
|
60
|
+
|
|
61
|
+
<!-- <ng-template #timeTooltipLeft>
|
|
62
|
+
<span>{{message.timestamp | amTimeAgo}} ({{message.timestamp | amLocal | amDateFormat: 'L HH:mm:ss'}})</span>
|
|
63
|
+
</ng-template> -->
|
|
51
64
|
|
|
52
65
|
<chat-text *ngIf="message?.type !=='html'"
|
|
53
66
|
[text]="message?.text"
|
|
@@ -62,6 +75,7 @@
|
|
|
62
75
|
</chat-html>
|
|
63
76
|
|
|
64
77
|
</div>
|
|
78
|
+
|
|
65
79
|
</div>
|
|
66
80
|
|
|
67
81
|
</div>
|
package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss
CHANGED
|
@@ -5,12 +5,59 @@
|
|
|
5
5
|
border-radius: 8px;
|
|
6
6
|
padding: 0;
|
|
7
7
|
word-wrap: break-word;
|
|
8
|
+
position: relative;
|
|
8
9
|
// padding: 14px;
|
|
9
10
|
// padding: 6px 6px 6px 6px;
|
|
10
11
|
// box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
|
|
11
12
|
// -webkit-animation: heartbeat 1.5s ease-in-out both;
|
|
12
13
|
// animation: heartbeat 1.5s ease-in-out both;
|
|
13
14
|
|
|
15
|
+
&:hover{
|
|
16
|
+
chat-options{
|
|
17
|
+
// display: flex;
|
|
18
|
+
visibility: visible;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
chat-options{
|
|
23
|
+
visibility: hidden;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// .options-container{
|
|
27
|
+
// display: flex;
|
|
28
|
+
// visibility: hidden;
|
|
29
|
+
// flex-direction: row-reverse;
|
|
30
|
+
// position: absolute;
|
|
31
|
+
// top: 0px;
|
|
32
|
+
// right: 0px;
|
|
33
|
+
// height: 25px;
|
|
34
|
+
// width: 40px;
|
|
35
|
+
// padding: 5px;
|
|
36
|
+
// z-index: 2;
|
|
37
|
+
// background: radial-gradient(at top right,rgba(240, 242, 247,1) 60%,rgba(240, 242, 247,0) 80%);
|
|
38
|
+
// border-top-right-radius: 16px;
|
|
39
|
+
|
|
40
|
+
// .options-logo{
|
|
41
|
+
// // display: none;
|
|
42
|
+
// display: flex;
|
|
43
|
+
// -webkit-box-align: center;
|
|
44
|
+
// align-items: center;
|
|
45
|
+
// -webkit-box-pack: center;
|
|
46
|
+
// /* width: 20px; */
|
|
47
|
+
// height: 16px;
|
|
48
|
+
// border-radius: 3px;
|
|
49
|
+
// color: rgb(135, 150, 175);
|
|
50
|
+
// text-align: left;
|
|
51
|
+
// justify-content: center;
|
|
52
|
+
// font-size: initial;
|
|
53
|
+
|
|
54
|
+
// &:hover{
|
|
55
|
+
// cursor: pointer;
|
|
56
|
+
// }
|
|
57
|
+
// }
|
|
58
|
+
|
|
59
|
+
// }
|
|
60
|
+
|
|
14
61
|
.message_sender_fullname{
|
|
15
62
|
font-size: 12px;
|
|
16
63
|
font-weight: 600;
|
package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts
CHANGED
|
@@ -8,8 +8,9 @@ import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
|
|
|
8
8
|
import { TranslateService } from '@ngx-translate/core';
|
|
9
9
|
import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
|
|
10
10
|
import * as moment from 'moment';
|
|
11
|
-
import { ModalController } from '@ionic/angular';
|
|
11
|
+
import { ModalController, PopoverController } from '@ionic/angular';
|
|
12
12
|
import { convertColorToRGBA } from 'src/chat21-core/utils/utils';
|
|
13
|
+
import { BubbleInfoPopoverComponent } from 'src/app/components/bubbleMessageInfo-popover/bubbleinfo-popover.component';
|
|
13
14
|
@Component({
|
|
14
15
|
selector: 'chat-bubble-message',
|
|
15
16
|
templateUrl: './bubble-message.component.html',
|
|
@@ -25,6 +26,8 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
|
|
|
25
26
|
@Output() onBeforeMessageRender = new EventEmitter();
|
|
26
27
|
@Output() onAfterMessageRender = new EventEmitter();
|
|
27
28
|
@Output() onElementRendered = new EventEmitter<{element: string, status: boolean}>();
|
|
29
|
+
@Output() onOptionsMessage = new EventEmitter<{option: string, message: MessageModel}>();
|
|
30
|
+
|
|
28
31
|
isImage = isImage;
|
|
29
32
|
isFile = isFile;
|
|
30
33
|
isFrame = isFrame;
|
|
@@ -57,6 +60,7 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
|
|
|
57
60
|
private translate: TranslateService,
|
|
58
61
|
public tiledeskAuthService: TiledeskAuthService,
|
|
59
62
|
public modalController: ModalController,
|
|
63
|
+
private popoverController: PopoverController
|
|
60
64
|
) {
|
|
61
65
|
// console.log('BUBBLE-MSG Hello !!!!')
|
|
62
66
|
}
|
|
@@ -178,6 +182,39 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
|
|
|
178
182
|
}, showDelay);
|
|
179
183
|
}
|
|
180
184
|
|
|
185
|
+
|
|
186
|
+
// onClickOptionsMessage(event, message){
|
|
187
|
+
// this.logger.log('[BUBBLE-MESSAGE] - onClickOptionsMessage', message);
|
|
188
|
+
// this.presentPopover(event, message)
|
|
189
|
+
// }
|
|
190
|
+
onOptionsMessageFN(event){
|
|
191
|
+
this.onOptionsMessage.emit(event)
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
// async presentPopover(ev: any, message: MessageModel) {
|
|
196
|
+
// const attributes = {
|
|
197
|
+
// message: message,
|
|
198
|
+
// conversationWith: message.recipient
|
|
199
|
+
// }
|
|
200
|
+
// const popover = await this.popoverController.create({
|
|
201
|
+
// component: BubbleInfoPopoverComponent,
|
|
202
|
+
// cssClass: 'info-popover',
|
|
203
|
+
// componentProps: attributes,
|
|
204
|
+
// event: ev,
|
|
205
|
+
// translucent: true,
|
|
206
|
+
// keyboardClose: true,
|
|
207
|
+
// showBackdrop: false
|
|
208
|
+
// });
|
|
209
|
+
// popover.onDidDismiss().then((dataReturned: any) => {
|
|
210
|
+
// this.logger.log('[BUBBLE-MESSAGE] presentPopover dismissed. Returned value::', dataReturned.data)
|
|
211
|
+
// if(dataReturned.data){
|
|
212
|
+
// this.onOptionsMessage.emit({option: dataReturned.data.option, message: message})
|
|
213
|
+
// }
|
|
214
|
+
// })
|
|
215
|
+
|
|
216
|
+
// return await popover.present();
|
|
217
|
+
// }
|
|
181
218
|
// ========= begin:: event emitter function ============//
|
|
182
219
|
|
|
183
220
|
// returnOpenAttachment(event: String) {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
.options-container{
|
|
2
|
+
display: flex;
|
|
3
|
+
// visibility: hidden;
|
|
4
|
+
flex-direction: row-reverse;
|
|
5
|
+
position: absolute;
|
|
6
|
+
top: 0px;
|
|
7
|
+
right: 0px;
|
|
8
|
+
height: 25px;
|
|
9
|
+
width: 40px;
|
|
10
|
+
padding: 5px;
|
|
11
|
+
z-index: 2;
|
|
12
|
+
background: radial-gradient(at top right,rgba(240, 242, 247,1) 60%,rgba(240, 242, 247,0) 80%);
|
|
13
|
+
border-top-right-radius: 16px;
|
|
14
|
+
|
|
15
|
+
.options-logo{
|
|
16
|
+
// display: none;
|
|
17
|
+
display: flex;
|
|
18
|
+
-webkit-box-align: center;
|
|
19
|
+
align-items: center;
|
|
20
|
+
-webkit-box-pack: center;
|
|
21
|
+
/* width: 20px; */
|
|
22
|
+
height: 16px;
|
|
23
|
+
border-radius: 3px;
|
|
24
|
+
color: rgb(135, 150, 175);
|
|
25
|
+
text-align: left;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
font-size: initial;
|
|
28
|
+
|
|
29
|
+
&:hover{
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { IonicModule } from '@ionic/angular';
|
|
3
|
+
|
|
4
|
+
import { OptionsComponent } from './options.component';
|
|
5
|
+
|
|
6
|
+
describe('OptionsComponent', () => {
|
|
7
|
+
let component: OptionsComponent;
|
|
8
|
+
let fixture: ComponentFixture<OptionsComponent>;
|
|
9
|
+
|
|
10
|
+
beforeEach(async(() => {
|
|
11
|
+
TestBed.configureTestingModule({
|
|
12
|
+
declarations: [ OptionsComponent ],
|
|
13
|
+
imports: [IonicModule.forRoot()]
|
|
14
|
+
}).compileComponents();
|
|
15
|
+
|
|
16
|
+
fixture = TestBed.createComponent(OptionsComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { PopoverController } from '@ionic/angular';
|
|
2
|
+
import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
|
|
3
|
+
import { BubbleInfoPopoverComponent } from 'src/app/components/bubbleMessageInfo-popover/bubbleinfo-popover.component';
|
|
4
|
+
import { MessageModel } from 'src/chat21-core/models/message';
|
|
5
|
+
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
6
|
+
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'chat-options',
|
|
10
|
+
templateUrl: './options.component.html',
|
|
11
|
+
styleUrls: ['./options.component.scss'],
|
|
12
|
+
})
|
|
13
|
+
export class OptionsComponent implements OnInit {
|
|
14
|
+
|
|
15
|
+
@Input() message: MessageModel
|
|
16
|
+
@Output() onOptionsMessage = new EventEmitter<{option: string, message: MessageModel}>();
|
|
17
|
+
|
|
18
|
+
private logger: LoggerService = LoggerInstance.getInstance()
|
|
19
|
+
|
|
20
|
+
constructor(private popoverController: PopoverController) { }
|
|
21
|
+
|
|
22
|
+
ngOnInit() {}
|
|
23
|
+
|
|
24
|
+
onClickOptionsMessage(event, message){
|
|
25
|
+
this.logger.log('[BUBBLE-MESSAGE] - onClickOptionsMessage', message);
|
|
26
|
+
this.presentPopover(event, message)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
async presentPopover(ev: any, message: MessageModel) {
|
|
31
|
+
const attributes = {
|
|
32
|
+
message: message,
|
|
33
|
+
conversationWith: message.recipient
|
|
34
|
+
}
|
|
35
|
+
const popover = await this.popoverController.create({
|
|
36
|
+
component: BubbleInfoPopoverComponent,
|
|
37
|
+
cssClass: 'info-popover',
|
|
38
|
+
componentProps: attributes,
|
|
39
|
+
event: ev,
|
|
40
|
+
translucent: true,
|
|
41
|
+
keyboardClose: true,
|
|
42
|
+
showBackdrop: false
|
|
43
|
+
});
|
|
44
|
+
popover.onDidDismiss().then((dataReturned: any) => {
|
|
45
|
+
this.logger.log('[BUBBLE-MESSAGE] presentPopover dismissed. Returned value::', dataReturned.data)
|
|
46
|
+
if(dataReturned.data){
|
|
47
|
+
this.onOptionsMessage.emit({option: dataReturned.data.option, message: message})
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
return await popover.present();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
}
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<ion-list lines="none" class="ion-no-padding">
|
|
2
|
+
<ion-item button="true" (click)="onClickOption('copy')">
|
|
3
|
+
<ion-icon name="copy-outline" slot="start"></ion-icon>
|
|
4
|
+
<ion-label>{{translationsMap?.get('COPY')}}</ion-label>
|
|
5
|
+
</ion-item>
|
|
6
|
+
<ion-item button="true" (click)="onClickOption('addCanned')">
|
|
7
|
+
<ion-icon name="flash-outline" slot="start"></ion-icon>
|
|
8
|
+
<!-- <span class="add-canned-response-add-icon">+</span> -->
|
|
9
|
+
<ion-label>{{translationsMap?.get('AddAsCannedResponse')}}</ion-label>
|
|
10
|
+
</ion-item>
|
|
11
|
+
<ion-item button="true" (click)="onClickOption('jsonInfo')">
|
|
12
|
+
<ion-icon src="assets/images/json-file.svg" slot="start"></ion-icon>
|
|
13
|
+
<ion-label>{{translationsMap?.get('JSON_RESPONSE')}}</ion-label>
|
|
14
|
+
</ion-item>
|
|
15
|
+
</ion-list>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
ion-list{
|
|
2
|
+
background-color: var(--bck-msg-received);
|
|
3
|
+
padding: 0px;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
ion-item{
|
|
7
|
+
--background: transparent;
|
|
8
|
+
--padding-start: 0px;
|
|
9
|
+
--padding-end: 0px;
|
|
10
|
+
--background-hover: #000000 !important;
|
|
11
|
+
font-size: 12px;
|
|
12
|
+
|
|
13
|
+
ion-icon{
|
|
14
|
+
margin-right: 5px;
|
|
15
|
+
margin-left: 10px;
|
|
16
|
+
font-size: 20px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&:hover{
|
|
20
|
+
font-weight: bold;
|
|
21
|
+
ion-icon {
|
|
22
|
+
color: black;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
@@ -3,6 +3,7 @@ import { LoggerInstance } from './../../../chat21-core/providers/logger/loggerIn
|
|
|
3
3
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
4
4
|
import { MessageModel } from './../../../chat21-core/models/message';
|
|
5
5
|
import { Component, Input, OnInit } from '@angular/core';
|
|
6
|
+
import { CustomTranslateService } from 'src/chat21-core/providers/custom-translate.service';
|
|
6
7
|
|
|
7
8
|
@Component({
|
|
8
9
|
selector: 'ion-bubbleinfo-popover',
|
|
@@ -12,17 +13,37 @@ import { Component, Input, OnInit } from '@angular/core';
|
|
|
12
13
|
export class BubbleInfoPopoverComponent implements OnInit {
|
|
13
14
|
|
|
14
15
|
@Input() message: MessageModel
|
|
15
|
-
|
|
16
|
+
|
|
17
|
+
public translationsMap: Map<string, string>;
|
|
16
18
|
private logger: LoggerService = LoggerInstance.getInstance()
|
|
17
19
|
|
|
18
|
-
constructor(
|
|
20
|
+
constructor(
|
|
21
|
+
private ctr: PopoverController,
|
|
22
|
+
private customTranslateService: CustomTranslateService,
|
|
23
|
+
) { }
|
|
19
24
|
|
|
20
25
|
ngOnInit() {
|
|
21
26
|
this.logger.debug('[BUBBLE-INFO-POPOVER] ngOnInit message data:', this.message)
|
|
27
|
+
this.initTranslations()
|
|
22
28
|
}
|
|
23
29
|
|
|
24
30
|
onClose(){
|
|
25
31
|
this.ctr.dismiss()
|
|
26
32
|
}
|
|
27
33
|
|
|
34
|
+
initTranslations(){
|
|
35
|
+
let keys= [
|
|
36
|
+
"AddAsCannedResponse",
|
|
37
|
+
"COPY",
|
|
38
|
+
"JSON_RESPONSE"
|
|
39
|
+
]
|
|
40
|
+
this.translationsMap = this.customTranslateService.translateLanguage(keys)
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
onClickOption(option: 'copy' | 'addCanned' | 'jsonInfo'){
|
|
45
|
+
this.logger.debug('[BUBBLE-INFO-POPOVER] clicked option:', option)
|
|
46
|
+
this.ctr.dismiss({option: option})
|
|
47
|
+
}
|
|
48
|
+
|
|
28
49
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { Routes, RouterModule } from '@angular/router';
|
|
3
|
+
|
|
4
|
+
import { JsonMessagePage } from './json-message.page';
|
|
5
|
+
|
|
6
|
+
const routes: Routes = [
|
|
7
|
+
{
|
|
8
|
+
path: '',
|
|
9
|
+
component: JsonMessagePage
|
|
10
|
+
}
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
@NgModule({
|
|
14
|
+
imports: [RouterModule.forChild(routes)],
|
|
15
|
+
exports: [RouterModule],
|
|
16
|
+
})
|
|
17
|
+
export class JsonMessagePageRoutingModule {}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { FormsModule } from '@angular/forms';
|
|
4
|
+
|
|
5
|
+
import { IonicModule } from '@ionic/angular';
|
|
6
|
+
|
|
7
|
+
import { JsonMessagePageRoutingModule } from './json-message-routing.module';
|
|
8
|
+
|
|
9
|
+
import { JsonMessagePage } from './json-message.page';
|
|
10
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
11
|
+
import { HttpClient } from '@angular/common/http';
|
|
12
|
+
import { createTranslateLoader } from 'src/chat21-core/utils/utils';
|
|
13
|
+
|
|
14
|
+
@NgModule({
|
|
15
|
+
imports: [
|
|
16
|
+
CommonModule,
|
|
17
|
+
FormsModule,
|
|
18
|
+
IonicModule,
|
|
19
|
+
JsonMessagePageRoutingModule,
|
|
20
|
+
TranslateModule.forChild({
|
|
21
|
+
loader: {
|
|
22
|
+
provide: TranslateModule,
|
|
23
|
+
useFactory: (createTranslateLoader),
|
|
24
|
+
deps: [HttpClient]
|
|
25
|
+
}
|
|
26
|
+
}),
|
|
27
|
+
],
|
|
28
|
+
declarations: [JsonMessagePage]
|
|
29
|
+
})
|
|
30
|
+
export class JsonMessagePageModule {}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<ion-header no-border class="ion-no-border">
|
|
2
|
+
<ion-toolbar>
|
|
3
|
+
<ion-title>{{'JSON_RESPONSE' | translate}}</ion-title>
|
|
4
|
+
|
|
5
|
+
<ion-buttons slot="end">
|
|
6
|
+
<ion-button ion-button fill="clear" (click)="closeModal()">
|
|
7
|
+
<ion-icon slot="icon-only" name="close"></ion-icon>
|
|
8
|
+
</ion-button>
|
|
9
|
+
</ion-buttons>
|
|
10
|
+
</ion-toolbar>
|
|
11
|
+
</ion-header>
|
|
12
|
+
|
|
13
|
+
<ion-content>
|
|
14
|
+
<pre class="json" id=json></pre>
|
|
15
|
+
</ion-content>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { IonicModule } from '@ionic/angular';
|
|
3
|
+
|
|
4
|
+
import { JsonMessagePage } from './json-message.page';
|
|
5
|
+
|
|
6
|
+
describe('JsonMessagePage', () => {
|
|
7
|
+
let component: JsonMessagePage;
|
|
8
|
+
let fixture: ComponentFixture<JsonMessagePage>;
|
|
9
|
+
|
|
10
|
+
beforeEach(async(() => {
|
|
11
|
+
TestBed.configureTestingModule({
|
|
12
|
+
declarations: [ JsonMessagePage ],
|
|
13
|
+
imports: [IonicModule.forRoot()]
|
|
14
|
+
}).compileComponents();
|
|
15
|
+
|
|
16
|
+
fixture = TestBed.createComponent(JsonMessagePage);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { MessageModel } from './../../../chat21-core/models/message';
|
|
2
|
+
import { Component, Input, OnInit, ElementRef } from '@angular/core';
|
|
3
|
+
import { ModalController } from '@ionic/angular';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'app-json-message',
|
|
7
|
+
templateUrl: './json-message.page.html',
|
|
8
|
+
styleUrls: ['./json-message.page.scss'],
|
|
9
|
+
})
|
|
10
|
+
export class JsonMessagePage implements OnInit {
|
|
11
|
+
|
|
12
|
+
@Input() message: MessageModel
|
|
13
|
+
@Input() translationsMap: Map<string, string>;
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
constructor(
|
|
17
|
+
public viewCtrl: ModalController,
|
|
18
|
+
public el: ElementRef
|
|
19
|
+
) { }
|
|
20
|
+
|
|
21
|
+
ngOnInit() {
|
|
22
|
+
var str = JSON.stringify(this.message, undefined, 4);
|
|
23
|
+
this.el.nativeElement.querySelector('#json').innerHTML = this.syntaxHighlight(str)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
closeModal(){
|
|
27
|
+
this.viewCtrl.dismiss()
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
syntaxHighlight(json) {
|
|
32
|
+
json = json.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
33
|
+
return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) {
|
|
34
|
+
var cls = 'number';
|
|
35
|
+
if (/^"/.test(match)) {
|
|
36
|
+
if (/:$/.test(match)) {
|
|
37
|
+
cls = 'key';
|
|
38
|
+
} else {
|
|
39
|
+
cls = 'string';
|
|
40
|
+
}
|
|
41
|
+
} else if (/true|false/.test(match)) {
|
|
42
|
+
cls = 'boolean';
|
|
43
|
+
} else if (/null/.test(match)) {
|
|
44
|
+
cls = 'null';
|
|
45
|
+
}
|
|
46
|
+
return '<span class="' + cls + '">' + match + '</span>';
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
}
|
|
@@ -57,7 +57,7 @@ import { PickerModule } from '@ctrl/ngx-emoji-mart';
|
|
|
57
57
|
NgxLinkifyjsModule,
|
|
58
58
|
],
|
|
59
59
|
// entryComponents: [MessageTextAreaComponent],
|
|
60
|
-
entryComponents: [],
|
|
60
|
+
entryComponents: [ BubbleInfoPopoverComponent],
|
|
61
61
|
declarations: [
|
|
62
62
|
ConversationDetailPage,
|
|
63
63
|
HeaderConversationDetailComponent,
|
|
@@ -1022,7 +1022,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1022
1022
|
this.sendEmail(msg).subscribe(status => {
|
|
1023
1023
|
if(status){
|
|
1024
1024
|
//SEND MESSAGE ALSO AS EMAIL
|
|
1025
|
-
attributes['channel']= TYPE_MSG_EMAIL
|
|
1025
|
+
attributes['channel']= 'offline_'+TYPE_MSG_EMAIL
|
|
1026
1026
|
}
|
|
1027
1027
|
|
|
1028
1028
|
this.conversationHandlerService.sendMessage(
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OptionsComponent } from './../chatlib/conversation-detail/message/options/options.component';
|
|
1
2
|
import { HeaderConversationsListUnassigned } from './../components/conversations-list/header-conversations-list-unassigned/header-conversations-list-unassigned.component';
|
|
2
3
|
import { NavbarComponent } from './../components/navbar/navbar.component';
|
|
3
4
|
import { FormsModule } from '@angular/forms';
|
|
@@ -80,6 +81,7 @@ import { SafeHtmlPipe } from '../directives/safe-html.pipe';
|
|
|
80
81
|
InfoMessageComponent,
|
|
81
82
|
ReturnReceiptComponent,
|
|
82
83
|
TextComponent,
|
|
84
|
+
OptionsComponent,
|
|
83
85
|
HtmlComponent,
|
|
84
86
|
InfoContentComponent,
|
|
85
87
|
InfoSupportGroupComponent,
|
|
@@ -120,6 +122,7 @@ import { SafeHtmlPipe } from '../directives/safe-html.pipe';
|
|
|
120
122
|
InfoMessageComponent,
|
|
121
123
|
ReturnReceiptComponent,
|
|
122
124
|
TextComponent,
|
|
125
|
+
OptionsComponent,
|
|
123
126
|
InfoContentComponent,
|
|
124
127
|
InfoSupportGroupComponent,
|
|
125
128
|
InfoDirectComponent,
|
package/src/assets/i18n/ar.json
CHANGED
package/src/assets/i18n/az.json
CHANGED
package/src/assets/i18n/de.json
CHANGED
package/src/assets/i18n/en.json
CHANGED
package/src/assets/i18n/es.json
CHANGED
package/src/assets/i18n/fr.json
CHANGED
package/src/assets/i18n/it.json
CHANGED
package/src/assets/i18n/kk.json
CHANGED
package/src/assets/i18n/pt.json
CHANGED
package/src/assets/i18n/ru.json
CHANGED
package/src/assets/i18n/sr.json
CHANGED
package/src/assets/i18n/sv.json
CHANGED
package/src/assets/i18n/tr.json
CHANGED
package/src/assets/i18n/uk.json
CHANGED
package/src/assets/i18n/uz.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg id="Capa_1" data-name="Capa 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44.93 34.1"><path d="M15.34,25.33V18.51A1.74,1.74,0,0,1,17.1,16.8a1.71,1.71,0,1,0,0-3.41,5.21,5.21,0,0,0-5.28,5.12v6.82A3.47,3.47,0,0,1,8.3,28.74a1.71,1.71,0,1,0,0,3.41,3.47,3.47,0,0,1,3.52,3.41v6.82a5.2,5.2,0,0,0,5.28,5.11,1.71,1.71,0,1,0,0-3.41,1.73,1.73,0,0,1-1.76-1.7V35.56a6.69,6.69,0,0,0-2.43-5.12A6.68,6.68,0,0,0,15.34,25.33Z" transform="translate(-6.54 -13.39)"/><ellipse cx="22.89" cy="11.08" rx="2.64" ry="2.56"/><path d="M29.43,33.85a1.74,1.74,0,0,0-1.76,1.71v5.11a1.76,1.76,0,0,0,3.52,0V35.56A1.74,1.74,0,0,0,29.43,33.85Z" transform="translate(-6.54 -13.39)"/><path d="M45.09,30.44a6.69,6.69,0,0,0-2.43,5.12v6.82a1.73,1.73,0,0,1-1.76,1.7,1.71,1.71,0,1,0,0,3.41,5.2,5.2,0,0,0,5.28-5.11V35.56a3.47,3.47,0,0,1,3.52-3.41,1.71,1.71,0,1,0,0-3.41,3.47,3.47,0,0,1-3.52-3.41V18.51a5.21,5.21,0,0,0-5.28-5.12,1.71,1.71,0,1,0,0,3.41,1.74,1.74,0,0,1,1.76,1.71v6.82A6.68,6.68,0,0,0,45.09,30.44Z" transform="translate(-6.54 -13.39)"/></svg>
|
package/src/global.scss
CHANGED
|
@@ -748,6 +748,17 @@ ul.dropdown-menu > li > a {
|
|
|
748
748
|
//MODALS
|
|
749
749
|
.modal-wrapper{
|
|
750
750
|
border-radius: 16px !important;
|
|
751
|
+
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
.json-modal-class .modal-wrapper{
|
|
755
|
+
--height: 90%;
|
|
756
|
+
--width: 70%;
|
|
757
|
+
span.key{ color: red; }
|
|
758
|
+
span.number { color:#6eb4bc; }
|
|
759
|
+
span.boolean { color:#a693e0; }
|
|
760
|
+
span.null { color:#e09393; }
|
|
761
|
+
span.key { color: #a9d18f; }
|
|
751
762
|
}
|
|
752
763
|
|
|
753
764
|
|
|
@@ -760,3 +771,10 @@ ul.dropdown-menu > li > a {
|
|
|
760
771
|
}
|
|
761
772
|
}
|
|
762
773
|
|
|
774
|
+
|
|
775
|
+
//POPOVER
|
|
776
|
+
.info-popover{
|
|
777
|
+
.popover-content{
|
|
778
|
+
width: 250px;
|
|
779
|
+
}
|
|
780
|
+
}
|