@chat21/chat21-web-widget 5.0.71-rc.1 → 5.0.71-rc.12

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 (48) hide show
  1. package/.github/workflows/build.yml +2 -2
  2. package/CHANGELOG.md +40 -0
  3. package/Dockerfile +1 -1
  4. package/package.json +1 -1
  5. package/src/app/app.component.ts +73 -94
  6. package/src/app/component/conversation-detail/conversation/conversation.component.html +3 -2
  7. package/src/app/component/conversation-detail/conversation/conversation.component.scss +3 -2
  8. package/src/app/component/conversation-detail/conversation/conversation.component.ts +4 -11
  9. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.html +2 -3
  10. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.ts +2 -4
  11. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +1 -1
  12. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +8 -4
  13. package/src/app/component/last-message/last-message.component.scss +1 -1
  14. package/src/app/component/message/carousel/carousel.component.html +1 -1
  15. package/src/app/component/message/carousel/carousel.component.scss +1 -0
  16. package/src/app/component/message/carousel/carousel.component.ts +5 -4
  17. package/src/app/component/message/image/image.component.ts +0 -3
  18. package/src/app/providers/global-settings.service.ts +5 -0
  19. package/src/app/providers/translator.service.ts +2 -4
  20. package/src/app/sass/_variables.scss +1 -1
  21. package/src/app/utils/constants.ts +0 -3
  22. package/src/app/utils/globals.ts +4 -4
  23. package/src/app/utils/rules.ts +1 -1
  24. package/src/assets/i18n/en.json +5 -6
  25. package/src/assets/i18n/es.json +13 -10
  26. package/src/assets/i18n/fr.json +13 -10
  27. package/src/assets/i18n/it.json +13 -10
  28. package/src/assets/js/chat21client.js +5 -2
  29. package/src/assets/twp/chatbot-panel.html +205 -13
  30. package/src/assets/twp/index-dev.html +141 -33
  31. package/src/assets/twp/index.html +125 -39
  32. package/src/chat21-core/models/upload.ts +0 -1
  33. package/src/chat21-core/providers/abstract/upload.service.ts +3 -0
  34. package/src/chat21-core/providers/firebase/firebase-auth-service.ts +3 -3
  35. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +11 -20
  36. package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +2 -1
  37. package/src/chat21-core/providers/firebase/firebase-upload.service.ts +128 -6
  38. package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +1 -1
  39. package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +11 -21
  40. package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +7 -1
  41. package/src/chat21-core/providers/native/native-upload-service.ts +68 -0
  42. package/src/chat21-core/utils/constants.ts +24 -8
  43. package/src/chat21-core/utils/triggerHandler.ts +0 -1
  44. package/src/chat21-core/utils/utils-message.ts +31 -1
  45. package/src/chat21-core/utils/utils.ts +0 -39
  46. package/src/launch.js +0 -1
  47. package/src/widget-config-template.json +2 -2
  48. package/src/widget-config.json +2 -1
@@ -3,8 +3,8 @@ on:
3
3
  push:
4
4
  branches:
5
5
  - master # The default branch
6
- - branch-* # The other branches to be analyzed
7
- - features/*
6
+ - (branch|release)-.* # The other branches to be analyzed
7
+ - (features|release)/.*
8
8
  pull_request:
9
9
  types: [opened, synchronize, reopened]
10
10
  jobs:
package/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # chat21-web-widget ver 5.0
2
2
 
3
+ ### 5.0.71-rc.12
4
+ - changed: index.js, index-dev.js and chatbot-panel.js UI improved
5
+
6
+ ### 5.0.71-rc.11
7
+ - added: INFO_MESSAGE_TYPE enum added to manage info message keys into message.attributes object
8
+ - changed: translations aligned for all lang
9
+ - changed: index.js, index-dev.js and chatbot-panel.js UI improved
10
+
11
+ ### 5.0.71-rc.10
12
+ - bug-fixed: signInWithCustomToken override tiledesk_token key
13
+
14
+ ### 5.0.71-rc.9
15
+ - added: brandSrc env property
16
+
17
+ ### 5.0.71-rc.8
18
+ - chaged: chatbot-panel.html page UI (added header as style)
19
+ - bug-fixed: drop-zone area wrong height if footer in not visible
20
+ - bug-fixed: set archived conversations as read always
21
+
22
+ ### 5.0.71-rc.5
23
+ - bug-fixed: last-message box is visible also if text is empty
24
+
25
+ ### 5.0.71-rc.4
26
+ - added: uploadProfile method into upload.service files
27
+ - bug-fixed: if hiddenMessage is present and user restart conversation from header menu, flow does not restart from beginning
28
+ - bug-fixed: do not disable url buttons on carousel element
29
+ - bug-fixed: do not sound if convAdded is fired and on reconnect event
30
+ - bug-fixed: init Rules only if widget is closed
31
+ - removed: 'Powereb By Tiledesk' on conversation and home components only for cahtbot-panel.html page
32
+
33
+ ### 5.0.71-rc.3
34
+ - added: delete method for firebase-upload service
35
+ - added: size attribute to metadata object while uploading file
36
+ - bug-fixed: cannot read property of undefined while reading auth() in onOpenCloseWidget method with singleConversation mode active
37
+
38
+ ### 5.0.71-rc.2
39
+ - added: hiddenMessage tiledesk property to start a conversation with an hidden info message
40
+ - added: ability to listen from parent message and start a new Conversation with an hidden intentName info message
41
+ - changed: minor UI fix carousel component
42
+
3
43
  ### 5.0.71-rc.1
4
44
  - added: ability to start conversation from an intent hiddenMessage name
5
45
  - added: postMessage to notice parent the current message
package/Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
1
  ### STAGE 1: Build ###
2
2
 
3
3
  # We label our stage as ‘builder’
4
- FROM node:14.21.2-alpine as builder
4
+ FROM node:16.20.2-alpine3.18 as builder
5
5
 
6
6
  COPY package.json package-lock.json ./
7
7
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-web-widget",
3
3
  "author": "Tiledesk SRL",
4
- "version": "5.0.71-rc.1",
4
+ "version": "5.0.71-rc.12",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
@@ -138,6 +138,39 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
138
138
  this.logger.info('[APP-CONF]---------------- ngAfterViewInit: APP.COMPONENT ---------------- ')
139
139
  this.ngZone.run(() => {
140
140
  const that = this;
141
+ const subAddedConversation = this.conversationsHandlerService.conversationAdded.subscribe((conversation) => {
142
+ // that.ngZone.run(() => {
143
+ if (that.g.isOpen === true && conversation) {
144
+ that.g.setParameter('displayEyeCatcherCard', 'none');
145
+ that.triggerOnConversationUpdated(conversation);
146
+ that.logger.debug('[APP-COMP] obsAddedConversation ::: ', conversation);
147
+ if (conversation.attributes && conversation.attributes['subtype'] === 'info') {
148
+ return;
149
+ }
150
+ if (conversation.is_new) {
151
+ that.manageTabNotification(false, 'conv-added')
152
+ // this.soundMessage();
153
+ }
154
+ if(this.g.isOpen === false){
155
+ that.lastConversation = conversation;
156
+ that.g.isOpenNewMessage = true;
157
+ }
158
+ } else {
159
+ //widget closed
160
+
161
+ let badgeNewConverstionNumber = that.conversationsHandlerService.countIsNew()
162
+ that.g.setParameter('conversationsBadge', badgeNewConverstionNumber);
163
+ }
164
+ // that.manageTabNotification()
165
+ // });
166
+ if(conversation){
167
+ this.onImageLoaded(conversation)
168
+ this.onConversationLoaded(conversation)
169
+ }
170
+
171
+ });
172
+ this.subscriptions.push(subAddedConversation);
173
+
141
174
  const subChangedConversation = this.conversationsHandlerService.conversationChanged.subscribe((conversation) => {
142
175
  // that.ngZone.run(() => {
143
176
  if (conversation) {
@@ -148,9 +181,9 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
148
181
  that.disposeWidget();
149
182
  return;
150
183
  }
151
-
184
+
152
185
  if(conversation.is_new && conversation.sender !== this.g.senderId && !isInfo(conversation)){
153
- that.manageTabNotification();
186
+ that.manageTabNotification(conversation.sound, 'conv-changed');
154
187
  }
155
188
 
156
189
  if (that.g.isOpen === true) {
@@ -186,39 +219,6 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
186
219
  });
187
220
  this.subscriptions.push(subChangedConversation);
188
221
 
189
- const subAddedConversation = this.conversationsHandlerService.conversationAdded.subscribe((conversation) => {
190
- // that.ngZone.run(() => {
191
- if (that.g.isOpen === true && conversation) {
192
- that.g.setParameter('displayEyeCatcherCard', 'none');
193
- that.triggerOnConversationUpdated(conversation);
194
- that.logger.debug('[APP-COMP] obsAddedConversation ::: ', conversation);
195
- if (conversation.attributes && conversation.attributes['subtype'] === 'info') {
196
- return;
197
- }
198
- if (conversation.is_new) {
199
- that.manageTabNotification()
200
- // this.soundMessage();
201
- }
202
- if(this.g.isOpen === false){
203
- that.lastConversation = conversation;
204
- that.g.isOpenNewMessage = true;
205
- }
206
- } else {
207
- //widget closed
208
-
209
- let badgeNewConverstionNumber = that.conversationsHandlerService.countIsNew()
210
- that.g.setParameter('conversationsBadge', badgeNewConverstionNumber);
211
- }
212
- // that.manageTabNotification()
213
- // });
214
- if(conversation){
215
- this.onImageLoaded(conversation)
216
- this.onConversationLoaded(conversation)
217
- }
218
-
219
- });
220
- this.subscriptions.push(subAddedConversation);
221
-
222
222
  const subAddedArchivedConversations = this.archivedConversationsService.archivedConversationAdded.subscribe((conversation) => {
223
223
  // that.ngZone.run(() => {
224
224
  if (conversation) {
@@ -421,7 +421,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
421
421
  that.showWidget();
422
422
  }
423
423
 
424
- if(this.g.botsRules){
424
+ if(this.g.botsRules && !this.g.isOpen){
425
425
  const rules = new Rules(that.tiledeskRequestsService, that.appStorageService,that.g)
426
426
  rules.initRules(that.g.windowContext, that.g.tiledeskToken, user, that.generateNewUidConversation(), that.g.botsRules)
427
427
  }
@@ -690,42 +690,6 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
690
690
  }
691
691
  // ========= end:: START UI ============//
692
692
 
693
- // private openNewConversation() {
694
- // this.logger.debug('[APP-COMP] openNewConversation in APP COMPONENT');
695
- // this.g.newConversationStart = true;
696
- // // controllo i dipartimenti se sono 1 o 2 seleziono dipartimento e nascondo modale dipartimento
697
- // // altrimenti mostro modale dipartimenti
698
- // const preChatForm = this.g.preChatForm;
699
- // const attributes = this.g.attributes;
700
- // const departments = this.g.departments;
701
- // // that.g.wdLog(['departments: ', departments, departments.length);
702
- // if (preChatForm && (!attributes || !attributes.userFullname || !attributes.userEmail)) {
703
- // // if (preChatForm && (!attributes.userFullname || !attributes.userEmail)) {
704
- // this.isOpenConversation = false;
705
- // this.g.setParameter('isOpenPrechatForm', true);
706
- // // this.settingsSaverService.setVariable('isOpenPrechatForm', true);
707
- // this.isOpenSelectionDepartment = false;
708
- // if (departments && departments.length > 1 && this.g.departmentID == null) {
709
- // this.isOpenSelectionDepartment = true;
710
- // }
711
- // } else {
712
- // // this.g.isOpenPrechatForm = false;
713
- // this.g.setParameter('isOpenPrechatForm', false);
714
- // // this.settingsSaverService.setVariable('isOpenPrechatForm', false);
715
- // this.isOpenConversation = false;
716
- // this.isOpenSelectionDepartment = false;
717
- // if (departments && departments.length > 1 && this.g.departmentID == null) {
718
- // this.isOpenSelectionDepartment = true;
719
- // } else {
720
- // this.isOpenConversation = true;
721
- // }
722
- // }
723
-
724
- // this.logger.debug('[APP-COMP] isOpenPrechatForm', this.g.isOpenPrechatForm, ' isOpenSelectionDepartment:', this.isOpenSelectionDepartment);
725
- // if (this.g.isOpenPrechatForm === false && this.isOpenSelectionDepartment === false) {
726
- // this.startNewConversation();
727
- // }
728
- // }
729
693
 
730
694
  /**
731
695
  * genero un nuovo conversationWith
@@ -749,21 +713,10 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
749
713
  this.logger.debug('[APP-COMP] recipientId: ', this.g.recipientId);
750
714
  this.isConversationArchived = false;
751
715
 
752
- if(window.location.search && window.location.search.substring(1).split('&').find((param => param.includes('tiledesk_hiddenMessage')))){
753
- let hiddenMessage = window.location.search.substring(1).split('&').find((param => param.includes('tiledesk_hiddenMessage'))).split('=')[1]
754
- let participant = window.location.search.substring(1).split('&').find((param => param.includes('tiledesk_participants'))).split('=')[1]
755
- this.logger.debug('[APP-COMP] startNewConversation ', window.location.search.substring(1).split('&').find((param => param.includes('tiledesk_hiddenMessage'))))
756
- let message: any = {}
757
- message.attributes = { subtype: 'info', ...this.g.attributes}
758
- message.userAgent = this.g.attributes['client']
759
- message.request_id = newConvId
760
- message.sourcePage = this.g.attributes['sourcePage']
761
- message.language = this.g.lang
762
- message.text = '/'+ hiddenMessage
763
- message.participants = [ participant ]
764
- message.departmentid = this.g.attributes.departmentId
765
- // this.sendMessage(message)
766
- this.tiledeskRequestsService.sendMessageToRequest(newConvId, this.g.tiledeskToken, message)
716
+ /** allow to start conversation with an hidden message (without publishing 'new_conversation' event) */
717
+ this.logger.debug('[APP-COMP] AppComponent::startNewConversation hiddenMessage',this.g.hiddenMessage );
718
+ if(this.g.hiddenMessage){
719
+ this.onNewConversationWithMessage(this.g.hiddenMessage)
767
720
  return;
768
721
  }
769
722
 
@@ -958,7 +911,6 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
958
911
  }).then((res)=> { this.showWidget() });
959
912
  return;
960
913
  }
961
-
962
914
  this.conversationsHandlerService.getLastConversation((conv, error)=> {
963
915
  this.logger.debug('[APP-COMP] getConverationRESTApi: conversation from rest API --> ', conv)
964
916
  if(error){
@@ -1431,9 +1383,9 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
1431
1383
  };
1432
1384
 
1433
1385
  /** set state reinit */
1434
- windowContext['tiledesk'].startConversation = function () {
1386
+ windowContext['tiledesk'].startConversation = function (text: string) {
1435
1387
  ngZone.run(() => {
1436
- windowContext['tiledesk']['angularcomponent'].component.onNewConversation();
1388
+ windowContext['tiledesk']['angularcomponent'].component.onNewConversation(text);
1437
1389
  });
1438
1390
  };
1439
1391
 
@@ -1521,7 +1473,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
1521
1473
  }
1522
1474
  }
1523
1475
 
1524
- private manageTabNotification() {
1476
+ private manageTabNotification(canSound: boolean, calledby: string) {
1525
1477
  if (!this.isTabVisible) {
1526
1478
  // TAB IS HIDDEN --> manage title and SOUND
1527
1479
  // this.g.windowContext.parent.title = "HIDDEN"
@@ -1541,7 +1493,9 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
1541
1493
  }
1542
1494
  }, 1000);
1543
1495
  }
1544
- this.soundMessage()
1496
+ this.logger.debug('[APP-COMP] manageTabNotification canSound:calledby---->', canSound, calledby)
1497
+ if(canSound)
1498
+ this.soundMessage()
1545
1499
  }
1546
1500
 
1547
1501
 
@@ -1600,7 +1554,8 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
1600
1554
  if(this.g.singleConversation){
1601
1555
  this.isOpenHome = false;
1602
1556
  this.g.setParameter('isOpenPrechatForm', false)
1603
- this.manageWidgetSingleConversation()
1557
+ this.initConversationsHandler(this.g.tenant, this.g.senderId)
1558
+ // this.manageWidgetSingleConversation()
1604
1559
  } else if (this.g.startFromHome) {
1605
1560
  this.isOpenHome = true;
1606
1561
  this.isOpenConversation = false;
@@ -1763,8 +1718,9 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
1763
1718
  * carico conversazione - stack 1
1764
1719
  * home - stack 0
1765
1720
  */
1766
- onNewConversation() {
1721
+ onNewConversation(text?: string) {
1767
1722
  this.logger.debug('[APP-COMP] returnNewConversation in APP COMPONENT');
1723
+ if(text) this.g.setParameter('hiddenMessage', text);
1768
1724
  this.g.newConversationStart = true;
1769
1725
  // controllo i dipartimenti se sono 1 o 2 seleziono dipartimento e nascondo modale dipartimento
1770
1726
  // altrimenti mostro modale dipartimenti
@@ -1801,6 +1757,28 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
1801
1757
  }
1802
1758
  }
1803
1759
 
1760
+
1761
+ onNewConversationWithMessage(text: string, subType: string = 'info'){
1762
+ this.logger.log('[APP-COMP] onNewConversationWithMessage in APP COMPONENT', text);
1763
+
1764
+ const newConvId = this.generateNewUidConversation();
1765
+ this.g.setParameter('recipientId', newConvId);
1766
+ this.appStorageService.setItem('recipientId', newConvId)
1767
+
1768
+ let message: any = {}
1769
+ message.attributes = { subtype: subType, ...this.g.attributes}
1770
+ message.userAgent = this.g.attributes['client']
1771
+ message.request_id = newConvId
1772
+ message.sourcePage = this.g.attributes['sourcePage']
1773
+ message.language = this.g.lang
1774
+ message.text = '/'+ text
1775
+ message.participants = this.g.participants
1776
+ message.departmentid = this.g.attributes.departmentId
1777
+ // this.sendMessage(message)
1778
+ this.tiledeskRequestsService.sendMessageToRequest(newConvId, this.g.tiledeskToken, message)
1779
+ return;
1780
+ }
1781
+
1804
1782
  /**
1805
1783
  * MODAL HOME:
1806
1784
  * open all-conversation
@@ -1867,6 +1845,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
1867
1845
  */
1868
1846
  onNewConversationButtonClicked(event){
1869
1847
  this.logger.debug('[APP-COMP] onNewConversationButtonClicked');
1848
+ this.g.setParameter('hiddenMessage', null)
1870
1849
 
1871
1850
  this.isOpenConversation = false;
1872
1851
  this.g.singleConversation? this.isOpenHome = false: null;
@@ -37,9 +37,10 @@
37
37
  (onMenuOptionShow)="onMenuOption($event)">
38
38
  </chat-conversation-header>
39
39
 
40
- <div id="dropZone_container" *ngIf="isHovering">
40
+ <div id="dropZone_container" *ngIf="isHovering"
41
+ [class.hideTextReply]="hideFooterTextReply && g?.poweredBy">
41
42
  <div class="drop">
42
- drop zone
43
+ <!-- drop zone -->
43
44
  </div>
44
45
  </div>
45
46
 
@@ -9,7 +9,8 @@
9
9
  --foregroundColor: var(--col-msg-sent);
10
10
  }
11
11
 
12
- :host chat-conversation-content.hideTextReply ::ng-deep .chat21-sheet-content{
12
+ :host chat-conversation-content.hideTextReply ::ng-deep .chat21-sheet-content,
13
+ :host #dropZone_container.hideTextReply{
13
14
 
14
15
  bottom: var(--chat-footer-height) !important
15
16
  }
@@ -143,7 +144,7 @@
143
144
  #dropZone_container{
144
145
  position: absolute;
145
146
  top: 52px;
146
- bottom: 56px;
147
+ bottom: calc(var(--chat-footer-logo-height) + var(--chat-footer-height));
147
148
  left: 0;
148
149
  right: 0;
149
150
  background-color: rgba(240,248,255,0.6);
@@ -16,7 +16,6 @@ import {
16
16
  import { MessageModel } from 'src/chat21-core/models/message';
17
17
 
18
18
  // utils
19
- import { isPopupUrl } from 'src/app/utils/utils';
20
19
  import { v4 as uuidv4 } from 'uuid';
21
20
 
22
21
 
@@ -40,10 +39,9 @@ import { TypingService } from 'src/chat21-core/providers/abstract/typing.service
40
39
  import { CustomTranslateService } from 'src/chat21-core/providers/custom-translate.service';
41
40
  import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
42
41
  import { TiledeskRequestsService } from 'src/chat21-core/providers/tiledesk/tiledesk-requests.service';
43
- import { LIVE_PAGE } from 'src/chat21-core/utils/constants';
44
- import { getDateDifference, popupUrl } from 'src/chat21-core/utils/utils';
42
+ import { INFO_MESSAGE_TYPE } from 'src/chat21-core/utils/constants';
43
+ import { getDateDifference } from 'src/chat21-core/utils/utils';
45
44
  import { isJustRecived, isUserBanned } from 'src/chat21-core/utils/utils-message';
46
- import { AppComponent } from '../../../app.component';
47
45
  import { ConversationContentComponent } from '../conversation-content/conversation-content.component';
48
46
  // import { TranslateService } from '@ngx-translate/core';
49
47
 
@@ -113,11 +111,6 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
113
111
  isOpenAttachmentPreview: Boolean = false;
114
112
  attachments: Array<{ file: Array<any>, metadata: {}}>
115
113
 
116
-
117
-
118
- isPopupUrl = isPopupUrl;
119
- popupUrl = popupUrl;
120
-
121
114
  // availableAgentsStatus = false; // indica quando è impostato lo stato degli agenti nel subscribe
122
115
  messages: Array<MessageModel> = [];
123
116
 
@@ -173,7 +166,7 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
173
166
  public g: Globals,
174
167
  public starRatingWidgetService: StarRatingWidgetService,
175
168
  public sanitizer: DomSanitizer,
176
- public appComponent: AppComponent,
169
+ // public appComponent: AppComponent,
177
170
  public appStorageService: AppStorageService,
178
171
  public conversationHandlerBuilderService: ConversationHandlerBuilderService,
179
172
  public appConfigService: AppConfigService,
@@ -634,7 +627,7 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
634
627
  const message= 'Moved to: [' + this.g.attributes.sourceTitle + '](' + this.g.attributes.sourcePage + ')'
635
628
  const attributes={
636
629
  subtype: 'info/support',
637
- messagelabel: {key: LIVE_PAGE}
630
+ messagelabel: {key: INFO_MESSAGE_TYPE.LIVE_PAGE}
638
631
  }
639
632
  this.logger.debug('[CONV-COMP] sendLivePage --> attributes+message', attributes, message)
640
633
  this.conversationFooter.sendMessage(message, TYPE_MSG_TEXT, null, attributes);
@@ -63,7 +63,7 @@
63
63
  <!-- [ngClass]="{'slide-in-left': !isFirstMessage(message?.sender, i)}" -->
64
64
  <chat-bubble-message class="messages msg_receive"
65
65
  [ngClass]="{'slide-in-left': false}"
66
- [class.no-background]="(isImage(message) || isFrame(message)) && ((message?.text && message?.text.trim() === '') || !message?.text)"
66
+ [class.no-background]="(isImage(message) || isFrame(message) || isCarousel(message)) && ((message?.text && message?.text.trim() === '') || !message?.text)"
67
67
  [class.emoticon]="isEmojii(message?.text)"
68
68
  [style.margin-left]="isSameSender(message?.sender, i)? '50px': null"
69
69
  [ngStyle]="{'background': stylesMap.get('bubbleReceivedBackground'), 'color': stylesMap.get('bubbleReceivedTextColor')}"
@@ -109,8 +109,7 @@
109
109
  </div>
110
110
 
111
111
  <!-- carousel -->
112
- <div *ngIf="message?.attributes && message?.attributes?.attachment
113
- && message?.attributes?.attachment?.gallery" [ngClass]="{'slide-in-left': false}" class="carousel_container">
112
+ <div *ngIf="isCarousel(message)" [ngClass]="{'slide-in-left': false}" class="carousel_container">
114
113
  <chat-carousel class="carousel_container"
115
114
  [message]="message"
116
115
  [isConversationArchived]="isConversationArchived"
@@ -5,8 +5,7 @@ import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service
5
5
  import { UploadService } from 'src/chat21-core/providers/abstract/upload.service';
6
6
  import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
7
7
  import { MESSAGE_TYPE_INFO, MESSAGE_TYPE_MINE, MESSAGE_TYPE_OTHERS } from 'src/chat21-core/utils/constants';
8
- import { isPopupUrl, popupUrl } from 'src/chat21-core/utils/utils';
9
- import { isEmojii, isFirstMessage, isFrame, isImage, isInfo, isLastMessage, isMine, isSameSender, messageType } from 'src/chat21-core/utils/utils-message';
8
+ import { isCarousel, isEmojii, isFirstMessage, isFrame, isImage, isInfo, isLastMessage, isMine, isSameSender, messageType } from 'src/chat21-core/utils/utils-message';
10
9
 
11
10
  @Component({
12
11
  selector: 'chat-conversation-content',
@@ -43,8 +42,7 @@ export class ConversationContentComponent implements OnInit {
43
42
  // ========= end:: gestione scroll view messaggi ======= //
44
43
 
45
44
  // ========= begin:: dichiarazione funzioni ======= //
46
- isPopupUrl = isPopupUrl;
47
- popupUrl = popupUrl;
45
+ isCarousel = isCarousel;
48
46
  // ========= end:: dichiarazione funzioni ======= //
49
47
 
50
48
  // ========== begin:: set icon status message ======= //
@@ -248,7 +248,7 @@ textarea:active{
248
248
  // position: absolute;
249
249
  bottom: 100%;
250
250
  width: 100%;
251
- // height: 22px;
251
+ height: var(--chat-footer-logo-height);
252
252
  display: flex;
253
253
  align-items: center;
254
254
  justify-content: center;
@@ -131,6 +131,7 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
131
131
  if (event.target.files && event.target.files[0]) {
132
132
  const nameFile = event.target.files[0].name;
133
133
  const typeFile = event.target.files[0].type;
134
+ const size = event.target.files[0].size
134
135
  const reader = new FileReader();
135
136
  that.logger.debug('[CONV-FOOTER] OK preload: ', nameFile, typeFile, reader);
136
137
  reader.addEventListener('load', function () {
@@ -146,7 +147,7 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
146
147
  that.logger.debug('[CONV-FOOTER] onload image');
147
148
  // that.arrayFilesLoad.push(imageXLoad);
148
149
  const uid = (new Date().getTime()).toString(36); // imageXLoad.src.substring(imageXLoad.src.length - 16);
149
- that.arrayFilesLoad[0] = { uid: uid, file: imageXLoad, type: typeFile };
150
+ that.arrayFilesLoad[0] = { uid: uid, file: imageXLoad, type: typeFile, size: size };
150
151
  that.logger.debug('[CONV-FOOTER] OK: ', that.arrayFilesLoad[0]);
151
152
  // SEND MESSAGE
152
153
  that.loadFile();
@@ -159,7 +160,7 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
159
160
  };
160
161
  // that.arrayFilesLoad.push(imageXLoad);
161
162
  const uid = (new Date().getTime()).toString(36); // imageXLoad.src.substring(imageXLoad.src.length - 16);
162
- that.arrayFilesLoad[0] = { uid: uid, file: fileXLoad, type: typeFile };
163
+ that.arrayFilesLoad[0] = { uid: uid, file: fileXLoad, type: typeFile, size: size };
163
164
  that.logger.debug('[CONV-FOOTER] OK: ', that.arrayFilesLoad[0]);
164
165
  // SEND MESSAGE
165
166
  that.loadFile();
@@ -182,6 +183,7 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
182
183
  const fileXLoad = this.arrayFilesLoad[0].file;
183
184
  const uid = this.arrayFilesLoad[0].uid;
184
185
  const type = this.arrayFilesLoad[0].type;
186
+ const size = this.arrayFilesLoad[0].size
185
187
  this.logger.debug('[CONV-FOOTER] that.fileXLoad: ', type);
186
188
  let metadata;
187
189
  if (type.startsWith('image') && !type.includes('svg')) {
@@ -191,14 +193,16 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
191
193
  'width': fileXLoad.width,
192
194
  'height': fileXLoad.height,
193
195
  'type': type,
194
- 'uid': uid
196
+ 'uid': uid,
197
+ 'size': size
195
198
  };
196
199
  } else {
197
200
  metadata = {
198
201
  'name': fileXLoad.title,
199
202
  'src': fileXLoad.src,
200
203
  'type': type,
201
- 'uid': uid
204
+ 'uid': uid,
205
+ 'size': size
202
206
  };
203
207
  }
204
208
  this.logger.debug('[CONV-FOOTER] metadata -------> ', metadata);
@@ -110,7 +110,7 @@
110
110
  margin-left: 45px;
111
111
  margin-right: 16px;
112
112
  border-radius: 12px 12px 12px 12px;
113
- padding: 5px;
113
+ padding: 0px 5px;
114
114
  }
115
115
 
116
116
  .previewNewMessagge.no-background{
@@ -22,7 +22,7 @@
22
22
  <div class="buttons" *ngIf="card?.buttons && card?.buttons.length > 0">
23
23
  <div *ngFor="let button of card?.buttons"
24
24
  class="single-button action"
25
- [ngClass]="{'disabled': (isConversationArchived || !isLastMessage), 'active': button?.active}"
25
+ [ngClass]="{'disabled': (isConversationArchived || button.type !== TYPE_BUTTON.URL), 'active': button?.active}"
26
26
  (click)="actionButtonClick($event, button, i)" >
27
27
  {{button.value}}
28
28
  </div>
@@ -129,6 +129,7 @@
129
129
  background: transparent!important;
130
130
  display: block;
131
131
  max-width: 100% !important;
132
+ width: 100%;
132
133
  border-radius: 8px 8px 0px 0px;
133
134
 
134
135
  }
@@ -1,5 +1,7 @@
1
1
  import { Component, ElementRef, EventEmitter, Input, OnInit, Output, SimpleChange, SimpleChanges, ViewChildren } from '@angular/core';
2
2
  import { MessageModel } from 'src/chat21-core/models/message';
3
+ import { TYPE_BUTTON } from 'src/chat21-core/utils/constants';
4
+ import { isCarousel } from 'src/chat21-core/utils/utils-message';
3
5
 
4
6
  @Component({
5
7
  selector: 'chat-carousel',
@@ -30,11 +32,11 @@ export class CarouselComponent implements OnInit{
30
32
  hoverTextColor: string;
31
33
  type: string;
32
34
  button: any;
33
-
35
+ TYPE_BUTTON = TYPE_BUTTON;
34
36
  constructor(private elementRef: ElementRef) { }
35
37
 
36
38
  ngOnInit() {
37
- console.log('[CAROUSEL-MESSAGE] hello', this.message)
39
+ console.log('[CAROUSEL-MESSAGE] hello', this.message, isCarousel(this.message))
38
40
 
39
41
 
40
42
  this.wrapper = this.elementRef.nativeElement.querySelector('.wrapper')
@@ -95,7 +97,7 @@ export class CarouselComponent implements OnInit{
95
97
  let gap = 17
96
98
  let cardPerView = Math.round(this.carousel.offsetWidth / width);
97
99
 
98
- console.log('go to -->', direction, width, this.firstCardWidth, cardPerView, this.carousel.offsetWidth)
100
+ // console.log('go to -->', direction, width, this.firstCardWidth, cardPerView, this.carousel.offsetWidth)
99
101
 
100
102
  // this.carousel.scrollLeft += direction == "previous" ? -(width+gap) : width+gap;
101
103
  this.carousel.scrollLeft += direction == "previous" ? -width : width;
@@ -110,7 +112,6 @@ export class CarouselComponent implements OnInit{
110
112
  actionButtonClick(ev, button, index){
111
113
  this.button = button
112
114
  this.type = button.type
113
- console.log('buttonnnnnnn', ev, button)
114
115
  if ( button && ((button.action && button.action !== '') || (button.link && button.link !== '') || button.text !== '' )) {
115
116
 
116
117
  //set clicked button as the active one
@@ -1,6 +1,5 @@
1
1
  import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
2
2
  import { saveAs } from 'file-saver';
3
- import { popupUrl } from 'src/chat21-core/utils/utils';
4
3
 
5
4
  @Component({
6
5
  selector: 'chat-image',
@@ -16,9 +15,7 @@ export class ImageComponent implements OnInit {
16
15
 
17
16
  loading: boolean = true
18
17
  tooltipMessage: string;
19
-
20
18
 
21
- popupUrl = popupUrl;
22
19
 
23
20
  constructor() { }
24
21
 
@@ -1774,6 +1774,11 @@ export class GlobalSettingsService {
1774
1774
  if (TEMP) {
1775
1775
  globals.disconnetTime = stringToNumber(TEMP);
1776
1776
  }
1777
+
1778
+ TEMP = getParameterByName(windowContext, 'tiledesk_hiddenMessage');
1779
+ if (TEMP) {
1780
+ globals.hiddenMessage = TEMP;
1781
+ }
1777
1782
 
1778
1783
  }
1779
1784