@buerokratt-ria/common-gui-components 0.0.34 → 0.0.35
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
CHANGED
|
@@ -4,6 +4,15 @@ All changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## Template [MajorVersion.MediterraneanVersion.MinorVersion] - DD-MM-YYYY
|
|
6
6
|
|
|
7
|
+
## [0.0.35] - 09.01.2026
|
|
8
|
+
|
|
9
|
+
- Fixed Pagination on date change
|
|
10
|
+
- Fix Profile Picture and namu UI conflict
|
|
11
|
+
|
|
12
|
+
## [0.0.34] - 30.12.2025
|
|
13
|
+
|
|
14
|
+
- Fix building dependents
|
|
15
|
+
|
|
7
16
|
## [0.0.33] - 22.12.2025
|
|
8
17
|
|
|
9
18
|
- Updated domain logic change
|
package/package.json
CHANGED
|
@@ -1024,7 +1024,10 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
|
|
|
1024
1024
|
onChange={(v) => {
|
|
1025
1025
|
field.onChange(v);
|
|
1026
1026
|
const start = formatISO(startOfDay(new Date(v)));
|
|
1027
|
+
const resetPagination = { pageIndex: 0, pageSize: pagination.pageSize };
|
|
1028
|
+
setPagination(resetPagination);
|
|
1027
1029
|
setSearchParams((params) => {
|
|
1030
|
+
params.set("page", "1");
|
|
1028
1031
|
params.set('start', start);
|
|
1029
1032
|
return params;
|
|
1030
1033
|
});
|
|
@@ -1032,7 +1035,7 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
|
|
|
1032
1035
|
startDate: start,
|
|
1033
1036
|
endDate: formatISO(endOfDay(new Date(endDate))),
|
|
1034
1037
|
customerSupportIds: passedCustomerSupportIds,
|
|
1035
|
-
pagination,
|
|
1038
|
+
pagination: resetPagination,
|
|
1036
1039
|
sorting,
|
|
1037
1040
|
search,
|
|
1038
1041
|
});
|
|
@@ -1056,7 +1059,10 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
|
|
|
1056
1059
|
onChange={(v) => {
|
|
1057
1060
|
field.onChange(v);
|
|
1058
1061
|
const end = formatISO(endOfDay(new Date(v)));
|
|
1062
|
+
const resetPagination = { pageIndex: 0, pageSize: pagination.pageSize };
|
|
1063
|
+
setPagination(resetPagination);
|
|
1059
1064
|
setSearchParams((params) => {
|
|
1065
|
+
params.set("page", "1");
|
|
1060
1066
|
params.set('end', end);
|
|
1061
1067
|
return params;
|
|
1062
1068
|
});
|
|
@@ -1064,7 +1070,7 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
|
|
|
1064
1070
|
startDate: formatISO(startOfDay(new Date(startDate))),
|
|
1065
1071
|
endDate: end,
|
|
1066
1072
|
customerSupportIds: passedCustomerSupportIds,
|
|
1067
|
-
pagination,
|
|
1073
|
+
pagination: resetPagination,
|
|
1068
1074
|
sorting,
|
|
1069
1075
|
search,
|
|
1070
1076
|
});
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
display: flex;
|
|
106
106
|
flex-direction: column;
|
|
107
107
|
gap: 4px;
|
|
108
|
-
padding-left: 56px;
|
|
109
108
|
position: relative;
|
|
109
|
+
padding-left: 0px !important;
|
|
110
110
|
|
|
111
111
|
&:not(:last-child) {
|
|
112
112
|
margin-bottom: 8px;
|
|
@@ -148,9 +148,13 @@
|
|
|
148
148
|
&--buerokratt,
|
|
149
149
|
&--chatbot {
|
|
150
150
|
#{$self} {
|
|
151
|
+
&__group-header {
|
|
152
|
+
align-items: center;
|
|
153
|
+
}
|
|
154
|
+
|
|
151
155
|
&__group-initials {
|
|
152
156
|
background-color: get-color(sapphire-blue-10);
|
|
153
|
-
|
|
157
|
+
position: relative;
|
|
154
158
|
}
|
|
155
159
|
|
|
156
160
|
&__group-name {
|
|
@@ -158,6 +162,7 @@
|
|
|
158
162
|
text-align: left;
|
|
159
163
|
margin-left: 0;
|
|
160
164
|
font-size: $veera-font-size-100;
|
|
165
|
+
padding-top: 0;
|
|
161
166
|
}
|
|
162
167
|
|
|
163
168
|
&__messages {
|
|
@@ -165,6 +170,7 @@
|
|
|
165
170
|
flex-direction: column;
|
|
166
171
|
gap: 4px;
|
|
167
172
|
align-items: flex-start;
|
|
173
|
+
padding-left: 50px;
|
|
168
174
|
}
|
|
169
175
|
|
|
170
176
|
&__message-text {
|
|
@@ -172,8 +178,7 @@
|
|
|
172
178
|
color: get-color(white);
|
|
173
179
|
|
|
174
180
|
:any-link {
|
|
175
|
-
background: url('../../static/icons/link-external-blue.svg')
|
|
176
|
-
no-repeat right center;
|
|
181
|
+
background: url('../../static/icons/link-external-blue.svg') no-repeat right center;
|
|
177
182
|
padding-right: 1.25em;
|
|
178
183
|
color: blue;
|
|
179
184
|
text-decoration: underline;
|
|
@@ -186,18 +191,57 @@
|
|
|
186
191
|
}
|
|
187
192
|
}
|
|
188
193
|
|
|
194
|
+
&--end-user {
|
|
195
|
+
#{$self} {
|
|
196
|
+
&__group-header {
|
|
197
|
+
display: flex;
|
|
198
|
+
justify-content: flex-end;
|
|
199
|
+
align-items: center;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
&__messages {
|
|
204
|
+
display: flex;
|
|
205
|
+
flex-direction: column;
|
|
206
|
+
gap: 4px;
|
|
207
|
+
align-items: flex-end;
|
|
208
|
+
padding-left: 50px !important;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
&__message-text {
|
|
212
|
+
background-color: get-color(black-coral-10);
|
|
213
|
+
color: get-color(white);
|
|
214
|
+
|
|
215
|
+
:any-link {
|
|
216
|
+
background: url('../../static/icons/link-external-white.svg') no-repeat right center;
|
|
217
|
+
padding-right: 1.25em;
|
|
218
|
+
color: white;
|
|
219
|
+
text-decoration: underline;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
&:hover {
|
|
223
|
+
background-color: #535665;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
189
228
|
&--backoffice-user {
|
|
190
229
|
#{$self} {
|
|
230
|
+
&__group-header {
|
|
231
|
+
align-items: center;
|
|
232
|
+
}
|
|
233
|
+
|
|
191
234
|
&__group-initials {
|
|
192
235
|
background-color: get-color(black-coral-10);
|
|
193
236
|
color: get-color(white);
|
|
194
|
-
|
|
237
|
+
position: relative;
|
|
195
238
|
}
|
|
196
239
|
|
|
197
240
|
&__group-name {
|
|
198
241
|
text-align: left;
|
|
199
242
|
margin-left: 0;
|
|
200
243
|
font-size: $veera-font-size-100;
|
|
244
|
+
padding-top: 0;
|
|
201
245
|
}
|
|
202
246
|
|
|
203
247
|
&__messages {
|
|
@@ -205,6 +249,7 @@
|
|
|
205
249
|
flex-direction: column;
|
|
206
250
|
gap: 4px;
|
|
207
251
|
align-items: flex-start;
|
|
252
|
+
padding-left: 50px;
|
|
208
253
|
}
|
|
209
254
|
|
|
210
255
|
&__message-text {
|
|
@@ -212,8 +257,7 @@
|
|
|
212
257
|
color: get-color(white);
|
|
213
258
|
|
|
214
259
|
:any-link {
|
|
215
|
-
background: url('../../static/icons/link-external-white.svg')
|
|
216
|
-
no-repeat right center;
|
|
260
|
+
background: url('../../static/icons/link-external-white.svg') no-repeat right center;
|
|
217
261
|
padding-right: 1.25em;
|
|
218
262
|
color: white;
|
|
219
263
|
text-decoration: underline;
|
|
@@ -231,6 +275,13 @@
|
|
|
231
275
|
}
|
|
232
276
|
}
|
|
233
277
|
|
|
278
|
+
&__group-header {
|
|
279
|
+
display: flex;
|
|
280
|
+
align-items: flex-start;
|
|
281
|
+
gap: 12px;
|
|
282
|
+
min-height: 40px;
|
|
283
|
+
}
|
|
284
|
+
|
|
234
285
|
&__group-initials {
|
|
235
286
|
display: flex;
|
|
236
287
|
align-items: center;
|
|
@@ -256,7 +307,10 @@
|
|
|
256
307
|
margin-left: 10rem;
|
|
257
308
|
margin-right: 3rem;
|
|
258
309
|
text-align: right;
|
|
259
|
-
|
|
310
|
+
white-space: nowrap;
|
|
311
|
+
overflow: hidden;
|
|
312
|
+
text-overflow: ellipsis;
|
|
313
|
+
max-width: 100%;
|
|
260
314
|
}
|
|
261
315
|
|
|
262
316
|
&__messages {
|
|
@@ -264,6 +318,7 @@
|
|
|
264
318
|
flex-direction: column;
|
|
265
319
|
gap: 4px;
|
|
266
320
|
align-items: flex-end;
|
|
321
|
+
padding-left: 50px;
|
|
267
322
|
}
|
|
268
323
|
|
|
269
324
|
&__messageContainer {
|
|
@@ -327,8 +382,7 @@
|
|
|
327
382
|
}
|
|
328
383
|
|
|
329
384
|
:any-link {
|
|
330
|
-
background: url('../../static/icons/link-external-blue.svg') no-repeat
|
|
331
|
-
right center;
|
|
385
|
+
background: url('../../static/icons/link-external-blue.svg') no-repeat right center;
|
|
332
386
|
padding-right: 1.25em;
|
|
333
387
|
color: blue;
|
|
334
388
|
text-decoration: underline;
|
|
@@ -358,6 +412,28 @@
|
|
|
358
412
|
user-select: none;
|
|
359
413
|
}
|
|
360
414
|
|
|
415
|
+
&__message-failed-wrapper {
|
|
416
|
+
gap: 2px;
|
|
417
|
+
margin-left: -22px;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
&__message-failed {
|
|
421
|
+
color: red;
|
|
422
|
+
display: flex;
|
|
423
|
+
font-size: 11px;
|
|
424
|
+
line-height: $veera-line-height-500;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
&__message-failed-content {
|
|
428
|
+
margin-top: 4px;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
&__message-failed-buttons {
|
|
432
|
+
display: flex;
|
|
433
|
+
gap: 20px;
|
|
434
|
+
justify-content: center;
|
|
435
|
+
}
|
|
436
|
+
|
|
361
437
|
&__message-status {
|
|
362
438
|
color: get-color(black-coral-6);
|
|
363
439
|
font-size: 11px;
|
|
@@ -377,31 +453,31 @@
|
|
|
377
453
|
}
|
|
378
454
|
|
|
379
455
|
.edit-toolbar {
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
456
|
+
display: grid;
|
|
457
|
+
grid-template-columns: 2fr 1fr;
|
|
458
|
+
grid-template-rows: auto auto;
|
|
459
|
+
gap: 10px;
|
|
384
460
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
461
|
+
&__header {
|
|
462
|
+
align-items: center;
|
|
463
|
+
display: flex;
|
|
464
|
+
grid-column: 1;
|
|
465
|
+
grid-row: 1;
|
|
466
|
+
}
|
|
391
467
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
468
|
+
&__textarea {
|
|
469
|
+
grid-column: 1;
|
|
470
|
+
grid-row: 2;
|
|
471
|
+
}
|
|
396
472
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
}
|
|
473
|
+
&__edit-actions {
|
|
474
|
+
display: flex;
|
|
475
|
+
grid-column: 2;
|
|
476
|
+
grid-row: 2;
|
|
477
|
+
gap: 10px;
|
|
478
|
+
justify-content: flex-end;
|
|
404
479
|
}
|
|
480
|
+
}
|
|
405
481
|
|
|
406
482
|
.title {
|
|
407
483
|
font-size: 13px;
|
|
@@ -426,7 +502,7 @@
|
|
|
426
502
|
}
|
|
427
503
|
|
|
428
504
|
.reset p {
|
|
429
|
-
margin:
|
|
505
|
+
margin: 0 0 0.5rem;
|
|
430
506
|
padding: 0;
|
|
431
507
|
}
|
|
432
508
|
|
|
@@ -445,3 +521,31 @@
|
|
|
445
521
|
text-decoration: none;
|
|
446
522
|
color: inherit;
|
|
447
523
|
}
|
|
524
|
+
|
|
525
|
+
.newMessageContainer {
|
|
526
|
+
position: absolute;
|
|
527
|
+
bottom: 115px;
|
|
528
|
+
right: 0;
|
|
529
|
+
background: transparent;
|
|
530
|
+
display: flex;
|
|
531
|
+
justify-content: flex-end;
|
|
532
|
+
padding-right: 10px;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
.newMessage {
|
|
536
|
+
display: inline-block;
|
|
537
|
+
width: max-content;
|
|
538
|
+
background-color: lightgray;
|
|
539
|
+
padding: 6px 28px;
|
|
540
|
+
border-radius: 8px;
|
|
541
|
+
margin-bottom: 2px;
|
|
542
|
+
margin-left: auto;
|
|
543
|
+
margin-right: 20px !important;
|
|
544
|
+
font-size: 18px;
|
|
545
|
+
|
|
546
|
+
&:hover {
|
|
547
|
+
cursor: pointer;
|
|
548
|
+
background-color: get-color(sapphire-blue-10);
|
|
549
|
+
color: white;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
display: flex;
|
|
52
52
|
flex-direction: column;
|
|
53
53
|
gap: 4px;
|
|
54
|
-
padding-left: 56px;
|
|
55
54
|
position: relative;
|
|
55
|
+
padding-left: 0px !important;
|
|
56
56
|
|
|
57
57
|
&:not(:last-child) {
|
|
58
58
|
margin-bottom: 8px;
|
|
@@ -61,10 +61,13 @@
|
|
|
61
61
|
&--buerokratt,
|
|
62
62
|
&--chatbot {
|
|
63
63
|
#{$self} {
|
|
64
|
+
&__group-header {
|
|
65
|
+
align-items: center;
|
|
66
|
+
}
|
|
67
|
+
|
|
64
68
|
&__group-initials {
|
|
65
69
|
background-color: get-color(sapphire-blue-10);
|
|
66
|
-
|
|
67
|
-
top: 0;
|
|
70
|
+
position: relative;
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
&__group-name {
|
|
@@ -72,6 +75,7 @@
|
|
|
72
75
|
text-align: left;
|
|
73
76
|
margin-left: 0;
|
|
74
77
|
font-size: $veera-font-size-100;
|
|
78
|
+
padding-top: 0;
|
|
75
79
|
}
|
|
76
80
|
|
|
77
81
|
&__messages {
|
|
@@ -79,6 +83,7 @@
|
|
|
79
83
|
flex-direction: column;
|
|
80
84
|
gap: 4px;
|
|
81
85
|
align-items: flex-start;
|
|
86
|
+
padding-left: 50px;
|
|
82
87
|
}
|
|
83
88
|
|
|
84
89
|
&__message-text {
|
|
@@ -97,25 +102,73 @@
|
|
|
97
102
|
}
|
|
98
103
|
}
|
|
99
104
|
|
|
105
|
+
&--end-user {
|
|
106
|
+
#{$self} {
|
|
107
|
+
&__group-header {
|
|
108
|
+
display: flex;
|
|
109
|
+
justify-content: flex-end;
|
|
110
|
+
align-items: center;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&__group-initials {
|
|
115
|
+
background-color: get-color(sapphire-blue-10);
|
|
116
|
+
position: relative !important;
|
|
117
|
+
right: 0px !important;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&__messages {
|
|
121
|
+
display: flex;
|
|
122
|
+
flex-direction: column;
|
|
123
|
+
gap: 4px;
|
|
124
|
+
align-items: flex-end;
|
|
125
|
+
padding-left: 50px !important;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&__message-text {
|
|
129
|
+
background-color: get-color(black-coral-10);
|
|
130
|
+
color: get-color(white);
|
|
131
|
+
|
|
132
|
+
:any-link {
|
|
133
|
+
background: url('../../static/icons/link-external-white.svg') no-repeat right center;
|
|
134
|
+
padding-right: 1.25em;
|
|
135
|
+
color: white;
|
|
136
|
+
text-decoration: underline;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&:hover {
|
|
140
|
+
background-color: #535665;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
100
145
|
&--backoffice-user {
|
|
101
146
|
#{$self} {
|
|
147
|
+
&__group-header {
|
|
148
|
+
display: flex;
|
|
149
|
+
justify-content: flex-end;
|
|
150
|
+
align-items: center;
|
|
151
|
+
}
|
|
152
|
+
|
|
102
153
|
&__group-initials {
|
|
103
154
|
background-color: get-color(black-coral-10);
|
|
104
155
|
color: get-color(white);
|
|
105
|
-
|
|
156
|
+
position: relative;
|
|
106
157
|
}
|
|
107
158
|
|
|
108
159
|
&__group-name {
|
|
109
160
|
text-align: left;
|
|
110
161
|
margin-left: 0;
|
|
111
162
|
font-size: $veera-font-size-100;
|
|
163
|
+
padding-top: 0;
|
|
112
164
|
}
|
|
113
165
|
|
|
114
166
|
&__messages {
|
|
115
167
|
display: flex;
|
|
116
168
|
flex-direction: column;
|
|
117
169
|
gap: 4px;
|
|
118
|
-
align-items: flex-
|
|
170
|
+
align-items: flex-end;
|
|
171
|
+
padding-left: 50px;
|
|
119
172
|
}
|
|
120
173
|
|
|
121
174
|
&__message-text {
|
|
@@ -135,6 +188,13 @@
|
|
|
135
188
|
}
|
|
136
189
|
}
|
|
137
190
|
|
|
191
|
+
&__group-header {
|
|
192
|
+
display: flex;
|
|
193
|
+
align-items: flex-start;
|
|
194
|
+
gap: 12px;
|
|
195
|
+
min-height: 40px;
|
|
196
|
+
}
|
|
197
|
+
|
|
138
198
|
&__group-initials,
|
|
139
199
|
&__group-event-initials {
|
|
140
200
|
display: flex;
|
|
@@ -150,6 +210,7 @@
|
|
|
150
210
|
color: get-color(black-coral-6);
|
|
151
211
|
position: absolute;
|
|
152
212
|
right: 0;
|
|
213
|
+
top: 0;
|
|
153
214
|
}
|
|
154
215
|
|
|
155
216
|
&__group-initials {
|
|
@@ -169,7 +230,10 @@
|
|
|
169
230
|
margin-left: 10rem;
|
|
170
231
|
margin-right: 3rem;
|
|
171
232
|
text-align: right;
|
|
172
|
-
|
|
233
|
+
white-space: nowrap;
|
|
234
|
+
overflow: hidden;
|
|
235
|
+
text-overflow: ellipsis;
|
|
236
|
+
max-width: 100%;
|
|
173
237
|
}
|
|
174
238
|
|
|
175
239
|
&__group-event-name {
|
|
@@ -181,6 +245,7 @@
|
|
|
181
245
|
flex-direction: column;
|
|
182
246
|
gap: 4px;
|
|
183
247
|
align-items: flex-end;
|
|
248
|
+
padding-left: 50px;
|
|
184
249
|
}
|
|
185
250
|
|
|
186
251
|
&__message {
|
|
@@ -199,6 +264,8 @@
|
|
|
199
264
|
line-height: $veera-line-height-500;
|
|
200
265
|
transition: all .25s ease-out;
|
|
201
266
|
cursor: pointer;
|
|
267
|
+
word-break: break-word;
|
|
268
|
+
white-space: pre-wrap;
|
|
202
269
|
|
|
203
270
|
:any-link {
|
|
204
271
|
text-decoration: underline;
|
|
@@ -12,6 +12,7 @@ import "./HistoricalChat.scss";
|
|
|
12
12
|
import { apiDev } from "../../services/api";
|
|
13
13
|
import ChatEvent from "../../ui-components/ChatEvent";
|
|
14
14
|
import { ToastContextType } from "../../context";
|
|
15
|
+
import { AUTHOR_ROLES } from "../../utils/constants";
|
|
15
16
|
|
|
16
17
|
type ChatProps = {
|
|
17
18
|
chat: ChatType;
|
|
@@ -64,6 +65,11 @@ const HistoricalChat: FC<ChatProps> = ({
|
|
|
64
65
|
const [lastMessage, setLastMessage] = useState<Message>();
|
|
65
66
|
const [statuses, setStatuses] = useState(chatStatuses);
|
|
66
67
|
|
|
68
|
+
const messageGroupsRef = useRef(messageGroups);
|
|
69
|
+
const setMessageGroupsState = (data: GroupedMessage[]) => {
|
|
70
|
+
messageGroupsRef.current = data;
|
|
71
|
+
setMessageGroups(data);
|
|
72
|
+
};
|
|
67
73
|
useEffect(() => {
|
|
68
74
|
getMessages();
|
|
69
75
|
}, [trigger]);
|
|
@@ -100,55 +106,64 @@ const HistoricalChat: FC<ChatProps> = ({
|
|
|
100
106
|
useEffect(() => {
|
|
101
107
|
if (!messagesList) return;
|
|
102
108
|
let groupedMessages: GroupedMessage[] = [];
|
|
103
|
-
messagesList.forEach((message
|
|
104
|
-
const currentMessage = message;
|
|
105
|
-
const content = currentMessage.content?.trim() ?? "";
|
|
106
|
-
|
|
107
|
-
if (content.startsWith("#service,") || content.startsWith("#common_service,")) {
|
|
108
|
-
const allPreviousButtons = messagesList
|
|
109
|
-
.slice(0, i)
|
|
110
|
-
.flatMap((msg) => (msg.buttons ? JSON.parse(msg.buttons) : []));
|
|
111
|
-
currentMessage.content = allPreviousButtons.find((b: any) => b.payload.includes(content))?.title ?? content;
|
|
112
|
-
}
|
|
113
|
-
|
|
109
|
+
messagesList.forEach((message) => {
|
|
114
110
|
const lastGroup = groupedMessages[groupedMessages.length - 1];
|
|
115
|
-
if (
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
111
|
+
if (
|
|
112
|
+
lastGroup &&
|
|
113
|
+
lastGroup.type === AUTHOR_ROLES.BACKOFFICE_USER &&
|
|
114
|
+
lastGroup.messages.at(-1) &&
|
|
115
|
+
message.event === CHAT_EVENTS.READ
|
|
116
|
+
) {
|
|
117
|
+
lastGroup.messages.push(message);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (lastGroup?.type === message.authorRole) {
|
|
121
|
+
if (!message.event || message.event === "" || message.event === "greeting") {
|
|
122
|
+
lastGroup.messages.push({ ...message });
|
|
123
|
+
} else if (message.event === CHAT_EVENTS.WAITING_VALIDATION && chat.status === CHAT_STATUS.VALIDATING) {
|
|
124
|
+
groupedMessages.push({
|
|
125
|
+
name: "Bürokratt",
|
|
126
|
+
type: "buerokratt",
|
|
127
|
+
title: "",
|
|
128
|
+
messages: [{ ...message }],
|
|
128
129
|
});
|
|
129
130
|
} else {
|
|
130
131
|
groupedMessages.push({
|
|
131
132
|
name: "",
|
|
132
133
|
type: "event",
|
|
133
134
|
title: "",
|
|
134
|
-
messages: [{ ...
|
|
135
|
+
messages: [{ ...message }],
|
|
135
136
|
});
|
|
136
137
|
}
|
|
137
|
-
} else {
|
|
138
|
+
} else if (!message.event || message.event === "" || message.event === "greeting") {
|
|
138
139
|
const isBackOfficeUser =
|
|
139
|
-
|
|
140
|
-
? `${
|
|
140
|
+
message.authorRole === "backoffice-user"
|
|
141
|
+
? `${message.authorFirstName} ${message.authorLastName}`
|
|
141
142
|
: BACKOFFICE_NAME.DEFAULT;
|
|
142
143
|
groupedMessages.push({
|
|
143
|
-
name:
|
|
144
|
-
type:
|
|
145
|
-
title:
|
|
146
|
-
messages: [{ ...
|
|
144
|
+
name: message.authorRole === "end-user" ? endUserFullName : isBackOfficeUser,
|
|
145
|
+
type: message.authorRole,
|
|
146
|
+
title: message.csaTitle ?? "",
|
|
147
|
+
messages: [{ ...message }],
|
|
148
|
+
});
|
|
149
|
+
} else if (message.event === CHAT_EVENTS.WAITING_VALIDATION && chat.status === CHAT_STATUS.VALIDATING) {
|
|
150
|
+
groupedMessages.push({
|
|
151
|
+
name: "Bürokratt",
|
|
152
|
+
type: "buerokratt",
|
|
153
|
+
title: "",
|
|
154
|
+
messages: [{ ...message }],
|
|
155
|
+
});
|
|
156
|
+
} else {
|
|
157
|
+
groupedMessages.push({
|
|
158
|
+
name: "",
|
|
159
|
+
type: "event",
|
|
160
|
+
title: "",
|
|
161
|
+
messages: [{ ...message }],
|
|
147
162
|
});
|
|
148
163
|
}
|
|
149
164
|
});
|
|
150
165
|
|
|
151
|
-
|
|
166
|
+
setMessageGroupsState(groupedMessages);
|
|
152
167
|
const lastMessage = messagesList[messagesList.length - 1];
|
|
153
168
|
if (
|
|
154
169
|
lastMessage?.event?.toLowerCase() === CHAT_EVENTS.CLIENT_LEFT_FOR_UNKNOWN_REASONS ||
|
|
@@ -184,23 +199,34 @@ const HistoricalChat: FC<ChatProps> = ({
|
|
|
184
199
|
} else {
|
|
185
200
|
return (
|
|
186
201
|
<div key={message.id}>
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
<
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
202
|
+
{group.name.trim() && (
|
|
203
|
+
<div className="historical-chat__group-header">
|
|
204
|
+
<div className="historical-chat__group-event-initials">
|
|
205
|
+
{group.type === "buerokratt" || group.type === "chatbot" ? (
|
|
206
|
+
<BykLogoWhite height={24} />
|
|
207
|
+
) : (
|
|
208
|
+
(() => {
|
|
209
|
+
if (group.name) {
|
|
210
|
+
const initials = group.name
|
|
211
|
+
.split(" ")
|
|
212
|
+
.map((n) => n[0])
|
|
213
|
+
.join("")
|
|
214
|
+
.toUpperCase();
|
|
215
|
+
return <>{initials}</>;
|
|
216
|
+
} else {
|
|
217
|
+
return <></>;
|
|
218
|
+
}
|
|
219
|
+
})()
|
|
220
|
+
)}
|
|
221
|
+
</div>
|
|
222
|
+
{group.name && (
|
|
223
|
+
<div className="historical-chat__group-event-name">
|
|
224
|
+
{group.name}
|
|
225
|
+
{group.title.length > 0 && <div className="title">{group.title}</div>}
|
|
226
|
+
</div>
|
|
227
|
+
)}
|
|
228
|
+
</div>
|
|
229
|
+
)}
|
|
204
230
|
<div className="historical-chat__messages">
|
|
205
231
|
<ChatMessage
|
|
206
232
|
message={message}
|
|
@@ -231,6 +257,7 @@ const HistoricalChat: FC<ChatProps> = ({
|
|
|
231
257
|
eventGroup(group)
|
|
232
258
|
) : (
|
|
233
259
|
<>
|
|
260
|
+
<div className="historical-chat__group-header">
|
|
234
261
|
<div className="historical-chat__group-initials">
|
|
235
262
|
{group.type === "buerokratt" || group.type === "chatbot" ? (
|
|
236
263
|
<BykLogoWhite height={24} />
|
|
@@ -248,6 +275,7 @@ const HistoricalChat: FC<ChatProps> = ({
|
|
|
248
275
|
{group.name}
|
|
249
276
|
{group.title.length > 0 && <div className="title">{group.title}</div>}
|
|
250
277
|
</div>
|
|
278
|
+
</div>
|
|
251
279
|
<div className="historical-chat__messages">
|
|
252
280
|
{group.messages.map((message, i) => (
|
|
253
281
|
<ChatMessage
|