@chat21/chat21-web-widget 5.0.46-rc.1 → 5.0.46-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.
Files changed (204) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/angular.json +2 -1
  3. package/coverage/widget/base.css +224 -0
  4. package/coverage/widget/block-navigation.js +87 -0
  5. package/coverage/widget/favicon.png +0 -0
  6. package/coverage/widget/index.html +881 -0
  7. package/coverage/widget/lcov.info +10516 -0
  8. package/coverage/widget/polyfills.ts.html +277 -0
  9. package/coverage/widget/prettify.css +1 -0
  10. package/coverage/widget/prettify.js +2 -0
  11. package/coverage/widget/sort-arrow-sprite.png +0 -0
  12. package/coverage/widget/sorter.js +196 -0
  13. package/coverage/widget/src/app/app.component.ts.html +6328 -0
  14. package/coverage/widget/src/app/component/conversation-detail/conversation/conversation.component.ts.html +3871 -0
  15. package/coverage/widget/src/app/component/conversation-detail/conversation/index.html +116 -0
  16. package/coverage/widget/src/app/component/conversation-detail/conversation-content/conversation-content.component.ts.html +925 -0
  17. package/coverage/widget/src/app/component/conversation-detail/conversation-content/index.html +116 -0
  18. package/coverage/widget/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts.html +1816 -0
  19. package/coverage/widget/src/app/component/conversation-detail/conversation-footer/index.html +116 -0
  20. package/coverage/widget/src/app/component/conversation-detail/conversation-header/conversation-header.component.ts.html +811 -0
  21. package/coverage/widget/src/app/component/conversation-detail/conversation-header/index.html +116 -0
  22. package/coverage/widget/src/app/component/conversation-detail/conversation-internal-frame/conversation-internal-frame.component.ts.html +397 -0
  23. package/coverage/widget/src/app/component/conversation-detail/conversation-internal-frame/index.html +116 -0
  24. package/coverage/widget/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.ts.html +991 -0
  25. package/coverage/widget/src/app/component/conversation-detail/conversation-preview/index.html +116 -0
  26. package/coverage/widget/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.ts.html +586 -0
  27. package/coverage/widget/src/app/component/eyeeye-catcher-card/index.html +116 -0
  28. package/coverage/widget/src/app/component/form/form-builder/form-builder.component.ts.html +664 -0
  29. package/coverage/widget/src/app/component/form/form-builder/index.html +116 -0
  30. package/coverage/widget/src/app/component/form/inputs/form-checkbox/form-checkbox.component.ts.html +208 -0
  31. package/coverage/widget/src/app/component/form/inputs/form-checkbox/index.html +116 -0
  32. package/coverage/widget/src/app/component/form/inputs/form-label/form-label.component.ts.html +157 -0
  33. package/coverage/widget/src/app/component/form/inputs/form-label/index.html +116 -0
  34. package/coverage/widget/src/app/component/form/inputs/form-radio-button/form-radio-button.component.ts.html +130 -0
  35. package/coverage/widget/src/app/component/form/inputs/form-radio-button/index.html +116 -0
  36. package/coverage/widget/src/app/component/form/inputs/form-select/form-select.component.ts.html +130 -0
  37. package/coverage/widget/src/app/component/form/inputs/form-select/index.html +116 -0
  38. package/coverage/widget/src/app/component/form/inputs/form-text/form-text.component.ts.html +301 -0
  39. package/coverage/widget/src/app/component/form/inputs/form-text/index.html +116 -0
  40. package/coverage/widget/src/app/component/form/inputs/form-textarea/form-textarea.component.ts.html +358 -0
  41. package/coverage/widget/src/app/component/form/inputs/form-textarea/index.html +116 -0
  42. package/coverage/widget/src/app/component/form/prechat-form/index.html +116 -0
  43. package/coverage/widget/src/app/component/form/prechat-form/prechat-form.component.ts.html +565 -0
  44. package/coverage/widget/src/app/component/home/home.component.ts.html +559 -0
  45. package/coverage/widget/src/app/component/home/index.html +116 -0
  46. package/coverage/widget/src/app/component/home-conversations/home-conversations.component.ts.html +985 -0
  47. package/coverage/widget/src/app/component/home-conversations/index.html +116 -0
  48. package/coverage/widget/src/app/component/last-message/index.html +116 -0
  49. package/coverage/widget/src/app/component/last-message/last-message.component.ts.html +484 -0
  50. package/coverage/widget/src/app/component/launcher-button/index.html +116 -0
  51. package/coverage/widget/src/app/component/launcher-button/launcher-button.component.ts.html +307 -0
  52. package/coverage/widget/src/app/component/list-all-conversations/index.html +116 -0
  53. package/coverage/widget/src/app/component/list-all-conversations/list-all-conversations.component.ts.html +676 -0
  54. package/coverage/widget/src/app/component/list-conversations/index.html +116 -0
  55. package/coverage/widget/src/app/component/list-conversations/list-conversations.component.ts.html +475 -0
  56. package/coverage/widget/src/app/component/menu-options/index.html +116 -0
  57. package/coverage/widget/src/app/component/menu-options/menu-options.component.ts.html +226 -0
  58. package/coverage/widget/src/app/component/message/avatar/avatar.component.ts.html +271 -0
  59. package/coverage/widget/src/app/component/message/avatar/index.html +116 -0
  60. package/coverage/widget/src/app/component/message/bubble-message/bubble-message.component.ts.html +655 -0
  61. package/coverage/widget/src/app/component/message/bubble-message/index.html +116 -0
  62. package/coverage/widget/src/app/component/message/buttons/action-button/action-button.component.ts.html +274 -0
  63. package/coverage/widget/src/app/component/message/buttons/action-button/index.html +116 -0
  64. package/coverage/widget/src/app/component/message/buttons/link-button/index.html +116 -0
  65. package/coverage/widget/src/app/component/message/buttons/link-button/link-button.component.ts.html +232 -0
  66. package/coverage/widget/src/app/component/message/buttons/text-button/index.html +116 -0
  67. package/coverage/widget/src/app/component/message/buttons/text-button/text-button.component.ts.html +235 -0
  68. package/coverage/widget/src/app/component/message/frame/frame.component.ts.html +199 -0
  69. package/coverage/widget/src/app/component/message/frame/index.html +116 -0
  70. package/coverage/widget/src/app/component/message/html/html.component.ts.html +184 -0
  71. package/coverage/widget/src/app/component/message/html/index.html +116 -0
  72. package/coverage/widget/src/app/component/message/image/image.component.ts.html +394 -0
  73. package/coverage/widget/src/app/component/message/image/index.html +116 -0
  74. package/coverage/widget/src/app/component/message/info-message/index.html +116 -0
  75. package/coverage/widget/src/app/component/message/info-message/info-message.component.ts.html +211 -0
  76. package/coverage/widget/src/app/component/message/like-unlike/index.html +116 -0
  77. package/coverage/widget/src/app/component/message/like-unlike/like-unlike.component.ts.html +151 -0
  78. package/coverage/widget/src/app/component/message/return-receipt/index.html +116 -0
  79. package/coverage/widget/src/app/component/message/return-receipt/return-receipt.component.ts.html +157 -0
  80. package/coverage/widget/src/app/component/message/text/index.html +116 -0
  81. package/coverage/widget/src/app/component/message/text/text.component.ts.html +190 -0
  82. package/coverage/widget/src/app/component/message-attachment/index.html +116 -0
  83. package/coverage/widget/src/app/component/message-attachment/message-attachment.component.ts.html +343 -0
  84. package/coverage/widget/src/app/component/selection-department/index.html +116 -0
  85. package/coverage/widget/src/app/component/selection-department/selection-department.component.ts.html +676 -0
  86. package/coverage/widget/src/app/component/send-button/index.html +116 -0
  87. package/coverage/widget/src/app/component/send-button/send-button.component.ts.html +154 -0
  88. package/coverage/widget/src/app/component/star-rating-widget/index.html +116 -0
  89. package/coverage/widget/src/app/component/star-rating-widget/star-rating-widget.component.ts.html +451 -0
  90. package/coverage/widget/src/app/directives/html-entities-encode.pipe.ts.html +136 -0
  91. package/coverage/widget/src/app/directives/index.html +146 -0
  92. package/coverage/widget/src/app/directives/marked.pipe.ts.html +166 -0
  93. package/coverage/widget/src/app/directives/safe-html.pipe.ts.html +136 -0
  94. package/coverage/widget/src/app/index.html +116 -0
  95. package/coverage/widget/src/app/providers/app-config.service.ts.html +247 -0
  96. package/coverage/widget/src/app/providers/global-settings.service.ts.html +5698 -0
  97. package/coverage/widget/src/app/providers/index.html +206 -0
  98. package/coverage/widget/src/app/providers/settings-saver.service.ts.html +253 -0
  99. package/coverage/widget/src/app/providers/star-rating-widget.service.ts.html +385 -0
  100. package/coverage/widget/src/app/providers/storage.service.ts.html +745 -0
  101. package/coverage/widget/src/app/providers/translator.service.ts.html +1498 -0
  102. package/coverage/widget/src/app/providers/waiting.service.ts.html +178 -0
  103. package/coverage/widget/src/app/utils/constants.ts.html +304 -0
  104. package/coverage/widget/src/app/utils/globals.ts.html +1939 -0
  105. package/coverage/widget/src/app/utils/index.html +146 -0
  106. package/coverage/widget/src/app/utils/utils.ts.html +1240 -0
  107. package/coverage/widget/src/chat21-core/models/conversation.ts.html +160 -0
  108. package/coverage/widget/src/chat21-core/models/index.html +146 -0
  109. package/coverage/widget/src/chat21-core/models/upload.ts.html +118 -0
  110. package/coverage/widget/src/chat21-core/models/user.ts.html +133 -0
  111. package/coverage/widget/src/chat21-core/providers/abstract/app-storage.service.ts.html +142 -0
  112. package/coverage/widget/src/chat21-core/providers/abstract/archivedconversations-handler.service.ts.html +184 -0
  113. package/coverage/widget/src/chat21-core/providers/abstract/conversation-handler-builder.service.ts.html +121 -0
  114. package/coverage/widget/src/chat21-core/providers/abstract/conversation-handler.service.ts.html +235 -0
  115. package/coverage/widget/src/chat21-core/providers/abstract/conversations-handler.service.ts.html +208 -0
  116. package/coverage/widget/src/chat21-core/providers/abstract/groups-handler.service.ts.html +160 -0
  117. package/coverage/widget/src/chat21-core/providers/abstract/image-repo.service.ts.html +169 -0
  118. package/coverage/widget/src/chat21-core/providers/abstract/index.html +296 -0
  119. package/coverage/widget/src/chat21-core/providers/abstract/logger.service.ts.html +136 -0
  120. package/coverage/widget/src/chat21-core/providers/abstract/messagingAuth.service.ts.html +238 -0
  121. package/coverage/widget/src/chat21-core/providers/abstract/notifications.service.ts.html +172 -0
  122. package/coverage/widget/src/chat21-core/providers/abstract/presence.service.ts.html +190 -0
  123. package/coverage/widget/src/chat21-core/providers/abstract/typing.service.ts.html +187 -0
  124. package/coverage/widget/src/chat21-core/providers/abstract/upload.service.ts.html +178 -0
  125. package/coverage/widget/src/chat21-core/providers/chat-manager.ts.html +895 -0
  126. package/coverage/widget/src/chat21-core/providers/custom-translate.service.ts.html +223 -0
  127. package/coverage/widget/src/chat21-core/providers/index.html +131 -0
  128. package/coverage/widget/src/chat21-core/providers/logger/customLogger.ts.html +265 -0
  129. package/coverage/widget/src/chat21-core/providers/logger/index.html +131 -0
  130. package/coverage/widget/src/chat21-core/providers/logger/loggerInstance.ts.html +142 -0
  131. package/coverage/widget/src/chat21-core/providers/tiledesk/index.html +131 -0
  132. package/coverage/widget/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts.html +655 -0
  133. package/coverage/widget/src/chat21-core/providers/tiledesk/tiledesk-requests.service.ts.html +241 -0
  134. package/coverage/widget/src/chat21-core/utils/constants.ts.html +409 -0
  135. package/coverage/widget/src/chat21-core/utils/index.html +176 -0
  136. package/coverage/widget/src/chat21-core/utils/triggerHandler.ts.html +1069 -0
  137. package/coverage/widget/src/chat21-core/utils/user-typing/index.html +116 -0
  138. package/coverage/widget/src/chat21-core/utils/user-typing/user-typing.component.ts.html +184 -0
  139. package/coverage/widget/src/chat21-core/utils/utils-message.ts.html +637 -0
  140. package/coverage/widget/src/chat21-core/utils/utils-user.ts.html +229 -0
  141. package/coverage/widget/src/chat21-core/utils/utils.ts.html +2221 -0
  142. package/coverage/widget/src/environments/environment.ts.html +205 -0
  143. package/coverage/widget/src/environments/index.html +116 -0
  144. package/coverage/widget/src/index.html +131 -0
  145. package/coverage/widget/src/models/index.html +116 -0
  146. package/coverage/widget/src/models/project.ts.html +319 -0
  147. package/coverage/widget/src/polyfills.ts.html +277 -0
  148. package/coverage/widget/src/test.ts.html +142 -0
  149. package/dist/assets/i18n/en.json +1 -1
  150. package/dist/assets/i18n/es.json +22 -9
  151. package/dist/assets/i18n/fr.json +20 -7
  152. package/dist/assets/i18n/it.json +24 -11
  153. package/dist/assets/twp/index-dev.html +1 -1
  154. package/dist/environments/real_data/widget-config-docker.json +0 -1
  155. package/dist/environments/real_data/widget-config-firebase.json +2 -2
  156. package/dist/environments/real_data/widget-config-native-mqtt.json +0 -1
  157. package/dist/iframe-style.css +8 -1
  158. package/dist/launch.js +1 -1
  159. package/dist/main.js +1 -1
  160. package/dist/vendor.js +1 -1
  161. package/package.json +1 -1
  162. package/src/app/app.component.scss +4 -3
  163. package/src/app/app.component.spec.ts +59 -18
  164. package/src/app/component/conversation-detail/conversation/conversation.component.spec.ts +12 -1
  165. package/src/app/component/conversation-detail/conversation/conversation.component.ts +4 -2
  166. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.spec.ts +7 -4
  167. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.spec.ts +11 -3
  168. package/src/app/component/conversation-detail/conversation-header/conversation-header.component.spec.ts +11 -4
  169. package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.spec.ts +9 -59
  170. package/src/app/component/form/form-builder/form-builder.component.spec.ts +9 -1
  171. package/src/app/component/form/inputs/form-textarea/form-textarea.component.html +5 -5
  172. package/src/app/component/form/inputs/form-textarea/form-textarea.component.spec.ts +1 -1
  173. package/src/app/component/form/inputs/form-textarea/form-textarea.component.ts +1 -1
  174. package/src/app/component/home/home.component.spec.ts +12 -3
  175. package/src/app/component/home-conversations/home-conversations.component.spec.ts +9 -1
  176. package/src/app/component/list-all-conversations/list-all-conversations.component.spec.ts +9 -11
  177. package/src/app/component/list-conversations/list-conversations.component.spec.ts +9 -1
  178. package/src/app/component/message/buttons/action-button/action-button.component.scss +1 -0
  179. package/src/app/component/message/buttons/link-button/link-button.component.scss +1 -0
  180. package/src/app/component/message/buttons/text-button/text-button.component.scss +1 -0
  181. package/src/app/component/message/frame/frame.component.spec.ts +16 -3
  182. package/src/app/component/message/frame/frame.component.ts +2 -2
  183. package/src/app/component/message/image/image.component.ts +46 -0
  184. package/src/app/component/message/info-message/info-message.component.spec.ts +9 -1
  185. package/src/app/component/message/return-receipt/return-receipt.component.spec.ts +17 -2
  186. package/src/app/component/message/text/text.component.spec.ts +2 -2
  187. package/src/app/providers/global-settings.service.ts +14 -0
  188. package/src/app/utils/globals.ts +4 -1
  189. package/src/assets/i18n/en.json +1 -1
  190. package/src/assets/i18n/es.json +22 -9
  191. package/src/assets/i18n/fr.json +20 -7
  192. package/src/assets/i18n/it.json +24 -11
  193. package/src/assets/twp/index-dev.html +1 -1
  194. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +5 -3
  195. package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +5 -3
  196. package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.spec.ts +29 -19
  197. package/src/chat21-core/utils/utils-message.ts +1 -1
  198. package/src/chat21-core/utils/utils.ts +3 -3
  199. package/src/environments/real_data/widget-config-docker.json +0 -1
  200. package/src/environments/real_data/widget-config-firebase.json +2 -2
  201. package/src/environments/real_data/widget-config-native-mqtt.json +0 -1
  202. package/src/iframe-style.css +8 -1
  203. package/src/launch.js +1 -1
  204. package/e2e/protractor.conf.js +0 -32
@@ -1,4 +1,5 @@
1
- import { async, ComponentFixture, TestBed } from '@angular/core/testing';
1
+ import { async, ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
2
+ import { DomSanitizer } from '@angular/platform-browser';
2
3
 
3
4
  import { FrameComponent } from './frame.component';
4
5
 
@@ -6,9 +7,18 @@ describe('FrameComponent', () => {
6
7
  let component: FrameComponent;
7
8
  let fixture: ComponentFixture<FrameComponent>;
8
9
 
9
- beforeEach(async(() => {
10
+ beforeEach(waitForAsync(() => {
10
11
  TestBed.configureTestingModule({
11
- declarations: [ FrameComponent ]
12
+ declarations: [ FrameComponent ],
13
+ providers: [
14
+ {
15
+ provide: DomSanitizer,
16
+ useValue: {
17
+ sanitize: () => 'safeString',
18
+ bypassSecurityTrustResourceUrl: () => 'safeString'
19
+ }
20
+ }
21
+ ,]
12
22
  })
13
23
  .compileComponents();
14
24
  }));
@@ -20,6 +30,9 @@ describe('FrameComponent', () => {
20
30
  });
21
31
 
22
32
  it('should create', () => {
33
+ component.url = component['sanitizer'].bypassSecurityTrustResourceUrl('http://www.tiledesk.com');
34
+ console.log('cccccc', component)
35
+ fixture.detectChanges();
23
36
  expect(component).toBeTruthy();
24
37
  });
25
38
  });
@@ -1,4 +1,4 @@
1
- import { DomSanitizer } from '@angular/platform-browser';
1
+ import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
2
2
  import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
3
3
 
4
4
  @Component({
@@ -13,7 +13,7 @@ export class FrameComponent implements OnInit {
13
13
  @Input() height: number;
14
14
  @Output() onElementRendered = new EventEmitter<{element: string, status: boolean}>();
15
15
 
16
- url: any;
16
+ url: SafeResourceUrl = null
17
17
  loading: boolean = true
18
18
  constructor(private sanitizer: DomSanitizer) { }
19
19
 
@@ -1,3 +1,4 @@
1
+ import { Globals } from 'src/app/utils/globals';
1
2
  import { Component, Input, OnInit, SimpleChanges, EventEmitter, Output } from '@angular/core';
2
3
  import { popupUrl } from 'src/chat21-core/utils/utils';
3
4
  import { saveAs} from 'file-saver';
@@ -51,6 +52,51 @@ export class ImageComponent implements OnInit {
51
52
  // a.click();
52
53
  // a.remove();
53
54
  saveAs(url, fileName);
55
+ // this.onClickImage()
56
+ }
57
+
58
+ onClickImage(){
59
+
60
+ // var ifrm = document.createElement("iframe");
61
+ // ifrm.setAttribute("frameborder", "0");
62
+ // ifrm.setAttribute("border", "0");
63
+ // ifrm.setAttribute('id','tiledeskiframe');
64
+ // ifrm.setAttribute('tiledesk_context','parent');
65
+ // ifrm.setAttribute('style', 'width: 100%; height: 100%; position: fixed; top: 0px; left: 0px; z-index: 2147483003; border: 0px;')
66
+
67
+ // var iframeContent = '<html>'
68
+ // iframeContent += '<head></head>'
69
+ // iframeContent += '<body>'
70
+ // iframeContent += '<div class="frame-root">'
71
+ // iframeContent += '<div class="frame-content">'
72
+ // iframeContent += '<div class="tiledesk-popup" style="opacity: 1;"></div>'
73
+ // iframeContent += '<div role="button" tabindex="-1" class="tidio-popup-1y163m9">'
74
+ // iframeContent += '<button type="button" data-testid="closeButton" class="tidio-popup-fru4e5 >'
75
+ // iframeContent += '<svg id="ic_close" fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg>'
76
+ // iframeContent += '</button>'
77
+ // iframeContent += '<a href="#popup" data-testid="popupImage-wrapper" class="tidio-popup-vgwcqv" style="opacity: 1; transform: translate3d(0px, 0px, 0px);">'
78
+ // iframeContent += '<img src="'+this.metadata.src+'" alt="popup" class="tidio-popup-wuejeg">'
79
+ // iframeContent += '</a>'
80
+ // iframeContent += '</div>'
81
+ // iframeContent += '</div>'
82
+ // iframeContent += '</div>'
83
+ // iframeContent +='</body>'
84
+ // iframeContent +='</html>'
85
+
86
+ // var tiledeskdiv = this.globals.windowContext.document.getElementById('tiledeskdiv');
87
+
88
+ // tiledeskdiv.appendChild(ifrm);
89
+ // ifrm.contentWindow.document.open();
90
+ // ifrm.contentWindow.document.write(iframeContent);
91
+ // ifrm.contentWindow.document.close();
92
+
93
+ // ifrm.onload = function(ev) {
94
+ // // var button = document.getElementById("button");
95
+ // // button.addEventListener("click", function(event){
96
+ // // alert(event.target);
97
+ // // });
98
+ // };
99
+
54
100
  }
55
101
 
56
102
 
@@ -1,17 +1,22 @@
1
+ import { CustomLogger } from './../../../../chat21-core/providers/logger/customLogger';
2
+ import { LoggerInstance } from './../../../../chat21-core/providers/logger/loggerInstance';
1
3
  import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
2
4
  import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
3
5
  import { MarkedPipe } from '../../../directives/marked.pipe';
4
6
 
5
7
  import { InfoMessageComponent } from './info-message.component';
8
+ import { NGXLogger } from 'ngx-logger';
6
9
 
7
10
  describe('InfoMessageComponent', () => {
8
11
  let component: InfoMessageComponent;
9
12
  let fixture: ComponentFixture<InfoMessageComponent>;
13
+ let ngxlogger: NGXLogger;
14
+ let customLogger = new CustomLogger(ngxlogger)
10
15
 
11
16
  beforeEach(waitForAsync(() => {
12
17
  TestBed.configureTestingModule({
13
18
  declarations: [ InfoMessageComponent, MarkedPipe ],
14
- providers: [LoggerService]
19
+ providers: [LoggerService, NGXLogger]
15
20
  })
16
21
  .compileComponents();
17
22
  }));
@@ -19,6 +24,9 @@ describe('InfoMessageComponent', () => {
19
24
  beforeEach(() => {
20
25
  fixture = TestBed.createComponent(InfoMessageComponent);
21
26
  component = fixture.componentInstance;
27
+ LoggerInstance.setInstance(customLogger)
28
+ let logger = LoggerInstance.getInstance()
29
+ component['logger']= logger
22
30
  fixture.detectChanges();
23
31
  });
24
32
 
@@ -1,4 +1,6 @@
1
- import { async, ComponentFixture, TestBed } from '@angular/core/testing';
1
+ import { async, ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
2
+ import { By } from '@angular/platform-browser';
3
+ import { MSG_STATUS_SENT } from 'src/chat21-core/utils/constants';
2
4
 
3
5
  import { ReturnReceiptComponent } from './return-receipt.component';
4
6
 
@@ -6,7 +8,7 @@ describe('ReturnReceiptComponent', () => {
6
8
  let component: ReturnReceiptComponent;
7
9
  let fixture: ComponentFixture<ReturnReceiptComponent>;
8
10
 
9
- beforeEach(async(() => {
11
+ beforeEach(waitForAsync(() => {
10
12
  TestBed.configureTestingModule({
11
13
  declarations: [ ReturnReceiptComponent ]
12
14
  })
@@ -22,4 +24,17 @@ describe('ReturnReceiptComponent', () => {
22
24
  it('should create', () => {
23
25
  expect(component).toBeTruthy();
24
26
  });
27
+
28
+ it('shold render MSG_STATUS_SENT icon', ()=> {
29
+ component.status= MSG_STATUS_SENT
30
+ fixture.detectChanges();
31
+ expect(component.status).toBe(MSG_STATUS_SENT)
32
+ })
33
+
34
+ // it('shold render MSG_STATUS_SENT icon', ()=> {
35
+ // component.status= MSG_STATUS_SENT
36
+ // fixture.detectChanges();
37
+ // let element = fixture.debugElement.query(By.css('icon'))
38
+ // expect(element.classes).toBeE('icon')
39
+ // })
25
40
  });
@@ -1,6 +1,6 @@
1
1
  import { HtmlEntitiesEncodePipe } from './../../../directives/html-entities-encode.pipe';
2
2
  import { MarkedPipe } from './../../../directives/marked.pipe';
3
- import { async, ComponentFixture, TestBed } from '@angular/core/testing';
3
+ import { async, ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
4
4
 
5
5
  import { TextComponent } from './text.component';
6
6
 
@@ -8,7 +8,7 @@ describe('TextComponent', () => {
8
8
  let component: TextComponent;
9
9
  let fixture: ComponentFixture<TextComponent>;
10
10
 
11
- beforeEach(async(() => {
11
+ beforeEach(waitForAsync(() => {
12
12
  TestBed.configureTestingModule({
13
13
  declarations: [
14
14
  TextComponent,
@@ -989,6 +989,11 @@ export class GlobalSettingsService {
989
989
  // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > continueConversationBeforeTime:: ', TEMP]);
990
990
  if (TEMP !== undefined) {
991
991
  globals.continueConversationBeforeTime = +TEMP;
992
+ }
993
+ TEMP = tiledeskSettings['participants'];
994
+ // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > participants:: ', TEMP]);
995
+ if (TEMP !== undefined) {
996
+ globals.participants = TEMP.split(',').map(key => { return key.trim()});;
992
997
  }
993
998
  }
994
999
 
@@ -1244,6 +1249,10 @@ export class GlobalSettingsService {
1244
1249
  if (TEMP !== null) {
1245
1250
  this.globals.continueConversationBeforeTime = +TEMP;
1246
1251
  }
1252
+ TEMP = el.nativeElement.getAttribute('participants');
1253
+ if (TEMP !== null) {
1254
+ this.globals.participants = TEMP.split(',').map(key => { return key.trim()});
1255
+ }
1247
1256
 
1248
1257
  }
1249
1258
 
@@ -1671,6 +1680,11 @@ export class GlobalSettingsService {
1671
1680
  if (TEMP) {
1672
1681
  globals.continueConversationBeforeTime = +TEMP;
1673
1682
  }
1683
+
1684
+ TEMP = getParameterByName(windowContext, 'tiledesk_participants');
1685
+ if (TEMP) {
1686
+ globals.participants = TEMP.split(',').map(key => { return key.trim()});
1687
+ }
1674
1688
  }
1675
1689
 
1676
1690
  /**
@@ -215,6 +215,7 @@ export class Globals {
215
215
  typingLocation: string; // ******* new ********
216
216
  allowReopen: boolean; // ******* new ********
217
217
  continueConversationBeforeTime: number; // ******* new ********
218
+ participants: Array<string>; // ******* new ********
218
219
  constructor(
219
220
  ) {
220
221
  // console.log(' ---------------- 1: initDefafultParameters ---------------- ');
@@ -303,7 +304,7 @@ export class Globals {
303
304
  (color of the header, color of the launcher button,
304
305
  other minor elements). Permitted values: Hex color
305
306
  codes, e.g. #87BC65 and RGB color codes, e.g. rgb(135,188,101) */
306
- this.themeColorOpacity = 50
307
+ this.themeColorOpacity = 100
307
308
  /**allows you to change opacity in background headers component
308
309
  * Permitted values: [0..1] */
309
310
  this.themeForegroundColor = convertColorToRGBA('#ffffff', 100);
@@ -386,6 +387,8 @@ export class Globals {
386
387
  /** enable the user to reopen a closed conversation */
387
388
  this.continueConversationBeforeTime = 48;
388
389
  /** enable user to continue archived confersation before the value time from last timeout message */
390
+ this.participants = [];
391
+ /** enable user to talk with specific chat-bots/humans */
389
392
 
390
393
  this.showWaitTime = true;
391
394
 
@@ -65,7 +65,7 @@
65
65
  "INFO_SUPPORT_CHAT_CLOSED":"Chat closed",
66
66
  "INFO_SUPPORT_LEAD_UPDATED":"Lead updated",
67
67
  "INFO_SUPPORT_MEMBER_LEFT_GROUP":"removed from group",
68
- "INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"has left the conversations",
68
+ "INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"has left the conversation",
69
69
  "INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "A new support request has been assigned to you",
70
70
 
71
71
  "LABEL_PRECHAT_USER_FULLNAME": "Full name",
@@ -10,7 +10,6 @@
10
10
  "LABEL_ERROR_FIELD_NAME": "Campo obligatorio (mínimo 5 caracteres).",
11
11
  "LABEL_FIELD_EMAIL": "Email",
12
12
  "LABEL_ERROR_FIELD_EMAIL": "Introduzca una dirección de correo electrónico válida.",
13
- "LABEL_ERROR_FIELD_REQUIRED":"Campo requerido",
14
13
  "LABEL_WRITING": "esta escribiendo...",
15
14
  "LABEL_SEND_NEW_MESSAGE": "Enviar un mensaje nuevo",
16
15
  "AGENT_NOT_AVAILABLE": " Fuera de línea",
@@ -39,10 +38,11 @@
39
38
  "WELLCOME_TITLE": "Hola, bienvenido a Tiledesk 👋",
40
39
  "WELLCOME_MSG": "¿Cómo podemos ayudar?",
41
40
  "OPTIONS": "opciones",
42
- "SOUND_OFF": "sonido apagado",
43
- "SOUND_ON": "sonido encendido",
44
- "LOGOUT": "cerrar sesión",
41
+ "SOUND_OFF": "Sonido apagado",
42
+ "SOUND_ON": "Sonido encendido",
43
+ "LOGOUT": "Cerrar sesión",
45
44
  "CLOSE": "cerca",
45
+ "RESTART":"Reiniciar",
46
46
  "PREV_CONVERSATIONS": "Tus conversaciones",
47
47
  "YOU": "Tú",
48
48
  "SHOW_ALL_CONV": "mostrar todo",
@@ -52,7 +52,9 @@
52
52
  "WAITING_TIME_FOUND": "El equipo típicamente responde en $reply_time",
53
53
  "WAITING_TIME_NOT_FOUND": "El equipo responderá lo antes posible",
54
54
  "CLOSED": "CERRADA",
55
-
55
+ "CLOSE_CHAT": "Cerrar chat",
56
+ "MINIMIZE":"Minimizar",
57
+ "MAXIMIZE":"Maximizar",
56
58
  "INFO_SUPPORT_USER_ADDED_SUBJECT":"tú",
57
59
  "INFO_SUPPORT_USER_ADDED_YOU_VERB":"han sido agregados a ",
58
60
  "INFO_SUPPORT_USER_ADDED_COMPLEMENT":"joined",
@@ -63,15 +65,26 @@
63
65
  "INFO_SUPPORT_MEMBER_LEFT_GROUP":"eliminado del grupo",
64
66
  "INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"abandonó la conversación",
65
67
  "INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Se le ha asignado una nueva solicitud de soporte",
68
+ "TICKET_TAKING":"La solicitud ha sido recibida y el personal de asistencia está tratando con ella. \nPara agregar más comentarios, responda a este correo electrónico.",
69
+
70
+ "LABEL_ERROR_FIELD_REQUIRED": "Campo obligatorio",
71
+ "SENT_AN_ATTACHMENT": "envió un archivo adjunto",
72
+ "SENT_AN_IMAGE": "envió una imagen",
66
73
 
74
+ "LABEL_PRECHAT_USER_FULLNAME": "Nombre completo",
75
+ "LABEL_PRECHAT_USER_EMAIL": "Correo electrónico",
76
+ "LABEL_PRECHAT_USER_EMAIL_ERROR": "Dirección de correo electrónico no válida",
77
+ "LABEL_PRECHAT_USER_PHONE": "Teléfono",
78
+ "LABEL_PRECHAT_USER_PHONE_ERROR": "Se requiere teléfono",
79
+ "LABEL_PRECHAT_FIRST_MESSAGE": "Tu mensaje para el equipo de soporte",
80
+ "LABEL_PRECHAT_STATIC_TERMS_PRIVACY": "Antes de continuar con la conversación, acepte nuestros <a href='https://tiledesk.com/termsofservice/' target='_blank'>Términos</a> y <a href='https:/ /tiledesk.com/privacy.html' target='_blank'>Política de privacidad</a>",
81
+ "LABEL_PRECHAT_ACCEPT_TERMS_PRIVACY": "Acepto",
82
+ "PRECHAT_REQUIRED_ERROR": "Este campo es obligatorio",
83
+
67
84
  "LABEL_TODAY": "hoy",
68
85
  "LABEL_TOMORROW": "ayer",
69
86
  "LABEL_LAST_ACCESS": "ultimo acceso",
70
87
  "LABEL_TO": "a",
71
88
  "ARRAY_DAYS": ["Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domingo"],
72
-
73
- "SENT_AN_ATTACHMENT": "envió un archivo adjunto",
74
- "SENT_AN_IMAGE":"envió una imagen",
75
-
76
89
  "LABEL_PREVIEW": "Avance"
77
90
  }
@@ -10,7 +10,6 @@
10
10
  "LABEL_ERROR_FIELD_NAME": "Nom demandé (minimum 2 caractères).",
11
11
  "LABEL_FIELD_EMAIL": "Email",
12
12
  "LABEL_ERROR_FIELD_EMAIL": "Entrer une adresse email valide.",
13
- "LABEL_ERROR_FIELD_REQUIRED":"Champs requis",
14
13
  "LABEL_WRITING": "écrit ...",
15
14
  "LABEL_SEND_NEW_MESSAGE": "Envoyez un nouveau message",
16
15
  "AGENT_NOT_AVAILABLE": " Hors ligne",
@@ -43,6 +42,7 @@
43
42
  "SOUND_ON": "Sound on",
44
43
  "LOGOUT": "Connectez-out",
45
44
  "CLOSE": "Fermer",
45
+ "RESTART":"Redémarrer",
46
46
  "PREV_CONVERSATIONS": "Vos conversations",
47
47
  "YOU": "Toi",
48
48
  "SHOW_ALL_CONV": "voir tout",
@@ -51,8 +51,10 @@
51
51
  "SEE_PREVIOUS": "voir les conversations précédentes",
52
52
  "WAITING_TIME_FOUND": "L'équipe répond généralement en $reply_time",
53
53
  "WAITING_TIME_NOT_FOUND": "Nous vous répondrons dans les plus brefs délais",
54
- "CLOSED": "FERMÉE",
55
-
54
+ "CLOSED": "Fermé",
55
+ "CLOSE_CHAT": "Fermer le chat",
56
+ "MINIMIZE":"Minimiser",
57
+ "MAXIMIZE":"Maximiser",
56
58
  "INFO_SUPPORT_USER_ADDED_SUBJECT":"toi",
57
59
  "INFO_SUPPORT_USER_ADDED_YOU_VERB":"ont été ajoutés à ",
58
60
  "INFO_SUPPORT_USER_ADDED_COMPLEMENT":"rejointe",
@@ -63,15 +65,26 @@
63
65
  "INFO_SUPPORT_MEMBER_LEFT_GROUP":"supprimé du groupe",
64
66
  "INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"a quitté la conversation",
65
67
  "INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Une nouvelle demande de support vous a été attribuée",
68
+ "TICKET_TAKING":"La demande a été reçue et le personnel d'assistance la traite.\nPour ajouter d'autres commentaires, répondez à cet e-mail.",
69
+
70
+ "LABEL_ERROR_FIELD_REQUIRED": "Champ obligatoire",
71
+ "SENT_AN_ATTACHMENT": "envoyé une pièce jointe",
72
+ "SENT_AN_IMAGE": "envoyé une image",
73
+
74
+ "LABEL_PRECHAT_USER_FULLNAME": "Nom complet",
75
+ "LABEL_PRECHAT_USER_EMAIL": "E-mail",
76
+ "LABEL_PRECHAT_USER_EMAIL_ERROR": "Adresse e-mail invalide",
77
+ "LABEL_PRECHAT_USER_PHONE": "Téléphone",
78
+ "LABEL_PRECHAT_USER_PHONE_ERROR": "Le téléphone est requis",
79
+ "LABEL_PRECHAT_FIRST_MESSAGE": "Votre message pour l'équipe d'assistance",
80
+ "LABEL_PRECHAT_STATIC_TERMS_PRIVACY": "Avant de poursuivre la conversation, veuillez accepter nos <a href='https://tiledesk.com/termsofservice/' target='_blank'>Conditions</a> et <a href='https:/ /tiledesk.com/privacy.html' target='_blank'>Politique de confidentialité</a>",
81
+ "LABEL_PRECHAT_ACCEPT_TERMS_PRIVACY": "Je suis d'accord",
82
+ "PRECHAT_REQUIRED_ERROR": "Ce champ est obligatoire",
66
83
 
67
84
  "LABEL_TODAY": "aujourd'hui",
68
85
  "LABEL_TOMORROW": "hier",
69
86
  "LABEL_LAST_ACCESS": "dernier accès",
70
87
  "LABEL_TO": "à",
71
88
  "ARRAY_DAYS": ["Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche"],
72
-
73
- "SENT_AN_ATTACHMENT": "envoyé une pièce jointe",
74
- "SENT_AN_IMAGE":"envoyé une image",
75
-
76
89
  "LABEL_PREVIEW": "Aperçu"
77
90
  }
@@ -10,7 +10,6 @@
10
10
  "LABEL_ERROR_FIELD_NAME": "Nome richiesto (minimo 2 caratteri).",
11
11
  "LABEL_FIELD_EMAIL": "Email",
12
12
  "LABEL_ERROR_FIELD_EMAIL": "Inserisci un indirizzo email valido.",
13
- "LABEL_ERROR_FIELD_REQUIRED":"Campo obbligatorio",
14
13
  "LABEL_WRITING": "sta scrivendo...",
15
14
  "LABEL_SEND_NEW_MESSAGE": "Invia un nuovo messaggio",
16
15
  "AGENT_NOT_AVAILABLE": " Offline",
@@ -39,10 +38,11 @@
39
38
  "WELLCOME_TITLE": "Ciao, benvenuto su Tiledesk 👋",
40
39
  "WELLCOME_MSG": "Come possiamo aiutarti?",
41
40
  "OPTIONS": "opzioni",
42
- "SOUND_OFF": "suono spento",
43
- "SOUND_ON": "suono acceso",
44
- "LOGOUT": "disconnetti",
41
+ "SOUND_OFF": "Suono spento",
42
+ "SOUND_ON": "Suono acceso",
43
+ "LOGOUT": "Disconnetti",
45
44
  "CLOSE": "Chiudi",
45
+ "RESTART":"Ricomincia",
46
46
  "PREV_CONVERSATIONS": "Le tue conversazioni",
47
47
  "YOU": "Tu",
48
48
  "SHOW_ALL_CONV": "vedi tutte",
@@ -51,8 +51,10 @@
51
51
  "SEE_PREVIOUS": "vedi precedenti",
52
52
  "WAITING_TIME_FOUND": "Il team tipicamente risponde in $reply_time",
53
53
  "WAITING_TIME_NOT_FOUND": "Vi risponderemo appena possibile",
54
- "CLOSED": "CHIUSA",
55
-
54
+ "CLOSED": "Chiusa",
55
+ "CLOSE_CHAT": "Chiudi chat",
56
+ "MINIMIZE":"Minimizza",
57
+ "MAXIMIZE":"Massimizza",
56
58
  "INFO_SUPPORT_USER_ADDED_SUBJECT":"tu",
57
59
  "INFO_SUPPORT_USER_ADDED_YOU_VERB":"sei stato aggiunto ",
58
60
  "INFO_SUPPORT_USER_ADDED_COMPLEMENT":"si è unito",
@@ -63,15 +65,26 @@
63
65
  "INFO_SUPPORT_MEMBER_LEFT_GROUP":"ha lasciato il gruppo",
64
66
  "INFO_SUPPORT_MEMBER_ABANDONED_GROUP": "ha abbandonato la conversazione",
65
67
  "INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Una nuova richiesta di supporto è stata assegnata a te",
68
+ "TICKET_TAKING":"La richiesta è stata ricevuta e il personale di assistenza se ne sta occupando.\nPer aggiungere ulteriori commenti, rispondi a questa email.",
69
+
70
+ "LABEL_ERROR_FIELD_REQUIRED": "Campo richiesto",
71
+ "SENT_AN_ATTACHMENT": "ha inviato un allegato",
72
+ "SENT_AN_IMAGE":"ha inviato un'immagine",
73
+
74
+ "LABEL_PRECHAT_USER_FULLNAME": "Nome completo",
75
+ "LABEL_PRECHAT_USER_EMAIL": "E-mail",
76
+ "LABEL_PRECHAT_USER_EMAIL_ERROR": "Indirizzo email non valido",
77
+ "LABEL_PRECHAT_USER_PHONE": "Telefono",
78
+ "LABEL_PRECHAT_USER_PHONE_ERROR": "Telefono richiesto",
79
+ "LABEL_PRECHAT_FIRST_MESSAGE": "Il tuo messaggio per il team di supporto",
80
+ "LABEL_PRECHAT_STATIC_TERMS_PRIVACY": "Prima di procedere nella conversazione, accetta i nostri <a href='https://tiledesk.com/termsofservice/' target='_blank'>Termini</a> e <a href='https:/ /tiledesk.com/privacy.html' target='_blank'>Norme sulla privacy</a>",
81
+ "LABEL_PRECHAT_ACCEPT_TERMS_PRIVACY": "Sono d'accordo",
82
+ "PRECHAT_REQUIRED_ERROR": "Questo campo è obbligatorio",
66
83
 
67
84
  "LABEL_TODAY": "oggi",
68
85
  "LABEL_TOMORROW": "ieri",
69
86
  "LABEL_LAST_ACCESS": "ultimo accesso",
70
- "LABEL_TO": "alle",
87
+ "LABEL_TO": "a",
71
88
  "ARRAY_DAYS": ["Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato", "Domenica"],
72
-
73
- "SENT_AN_ATTACHMENT": "ha inviato un allegato",
74
- "SENT_AN_IMAGE":"ha inviato un'immagine",
75
-
76
89
  "LABEL_PREVIEW": "Anteprima"
77
90
  }
@@ -1722,7 +1722,7 @@
1722
1722
  <div class="row">
1723
1723
  <div class="col-md-5 formElement"><span><em><strong>themeColorOpacity</strong></em></span></div>
1724
1724
  <div class="col-md-5 formElement">
1725
- <input class="form-range" type="range" id="themeColorOpacity" name="themeColorOpacity" min="0" max="100" value="50" style="width: 80%;" oninput="onChangeThemeColorOpacity()"><label class="col-form-label" id="themeColorOpacityText">50 %</label>
1725
+ <input class="form-range" type="range" id="themeColorOpacity" name="themeColorOpacity" min="0" max="100" value="100" style="width: 80%;" oninput="onChangeThemeColorOpacity()"><label class="col-form-label" id="themeColorOpacityText">100 %</label>
1726
1726
  </div>
1727
1727
  <div class="col-md-2">
1728
1728
  <button class="btn btn-light" onclick="onClickThemeColorOpacity()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
@@ -236,6 +236,10 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
236
236
  if(this.isValidMessage(msg)){
237
237
  // msg.attributes && msg.attributes['subtype'] === 'info'
238
238
  let isInfoMessage = messageType(MESSAGE_TYPE_INFO, msg)
239
+ if(isInfoMessage){
240
+ this.messageInfo.next(msg)
241
+ }
242
+
239
243
  if(isInfoMessage && hideInfoMessage(msg, this.showInfoMessage)){
240
244
  //if showBubbleInfoMessage array keys not includes msg.attributes.messagelabel['key'] exclude CURRENT INFO MESSAGE
241
245
  return;
@@ -247,9 +251,7 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
247
251
  }
248
252
  }
249
253
 
250
- if(isInfoMessage){
251
- this.messageInfo.next(msg)
252
- }
254
+
253
255
 
254
256
  this.addRepalceMessageInArray(msg.uid, msg);
255
257
  this.messageAdded.next(msg);
@@ -217,6 +217,10 @@ export class MQTTConversationHandler extends ConversationHandlerService {
217
217
  const msg = this.messageGenerate(messageSnapshot);
218
218
  msg.uid = msg.message_id;
219
219
  let isInfoMessage = messageType(MESSAGE_TYPE_INFO, msg)
220
+ if(isInfoMessage){
221
+ this.messageInfo.next(msg)
222
+ }
223
+
220
224
  if(isInfoMessage && hideInfoMessage(msg, this.showInfoMessage)){
221
225
  //if showBubbleInfoMessage array keys not includes msg.attributes.messagelabel['key'] exclude CURRENT INFO MESSAGE
222
226
  return;
@@ -228,9 +232,7 @@ export class MQTTConversationHandler extends ConversationHandlerService {
228
232
  }
229
233
  }
230
234
 
231
- if(isInfoMessage){
232
- this.messageInfo.next(msg)
233
- }
235
+
234
236
 
235
237
  // imposto il giorno del messaggio per visualizzare o nascondere l'header data
236
238
  msg.headerDate = null;
@@ -3,15 +3,19 @@ import { TestBed } from '@angular/core/testing';
3
3
  import { AppStorageService } from '../abstract/app-storage.service';
4
4
  import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
5
5
  import { TiledeskAuthService } from './tiledesk-auth.service';
6
+ import { NGXLogger } from 'ngx-logger';
7
+ import { CustomLogger } from '../logger/customLogger';
8
+ import { LoggerInstance } from '../logger/loggerInstance';
6
9
 
7
10
  describe('TiledeskAuthService', () => {
8
11
  // let httpClientMock;
9
12
  let httpMock: HttpTestingController;
10
13
  let service : TiledeskAuthService;
11
14
  let appStorage: AppStorageService;
15
+ let ngxlogger: NGXLogger;
16
+ let customLogger = new CustomLogger(ngxlogger)
12
17
 
13
18
  beforeEach(() => {
14
-
15
19
  TestBed.configureTestingModule({
16
20
  providers: [
17
21
  TiledeskAuthService,
@@ -22,11 +26,17 @@ describe('TiledeskAuthService', () => {
22
26
  })
23
27
 
24
28
  // httpClientMock = jasmine.createSpyObj(['getAllObjects']);
25
- httpMock = TestBed.get(HttpTestingController);
26
- service = TestBed.get(TiledeskAuthService);
27
- appStorage = TestBed.get(AppStorageService)
29
+ httpMock = TestBed.inject(HttpTestingController);
30
+ service = TestBed.inject(TiledeskAuthService);
31
+ appStorage = TestBed.inject(AppStorageService)
32
+
33
+ LoggerInstance.setInstance(customLogger)
34
+ let logger = LoggerInstance.getInstance()
35
+ service['logger']= logger
28
36
  });
29
37
 
38
+
39
+
30
40
  afterEach(() => {
31
41
  // After every test, assert that there are no more pending requests.
32
42
  httpMock.verify();
@@ -56,23 +66,23 @@ describe('TiledeskAuthService', () => {
56
66
  }
57
67
  }
58
68
 
59
- it('signInAnonymously api return tiledeskToken', (done) => {
60
- const base_url = 'https://tiledesk-server-pre.herokuapp.com/'
61
- const projectId = '6013ec749b32000045be650e'
62
- service.appStorage = appStorage
69
+ // it('signInAnonymously api return tiledeskToken', (done) => {
70
+ // const base_url = 'https://tiledesk-server-pre.herokuapp.com/'
71
+ // const projectId = '6013ec749b32000045be650e'
72
+ // service.appStorage = appStorage
63
73
 
64
- service.initialize(base_url)
65
- service.signInAnonymously(projectId).then(response => {
66
- console.log('response', response)
67
- // expect(response).not.toBeUndefined()
68
- // done()
69
- // fail()
70
- });
74
+ // service.initialize(base_url)
75
+ // service.signInAnonymously(projectId).then(response => {
76
+ // console.log('response', response)
77
+ // // expect(response).not.toBeUndefined()
78
+ // // done()
79
+ // // fail()
80
+ // });
71
81
 
72
- const req = httpMock.expectOne(service.SERVER_BASE_URL + 'auth/signinAnonymously');
73
- expect(req.request.method).toBe('POST');
74
- req.flush(dummyResponseSignInAnonymously);
75
- })
82
+ // const req = httpMock.expectOne(service.SERVER_BASE_URL + 'auth/signinAnonymously');
83
+ // expect(req.request.method).toBe('POST');
84
+ // req.flush(dummyResponseSignInAnonymously);
85
+ // })
76
86
 
77
87
 
78
88
  });
@@ -64,7 +64,7 @@ export function isUserBanned(message: any){
64
64
 
65
65
  /** */
66
66
  export function isMine(message: any) {
67
- if (message.isSender) {
67
+ if (message && message.isSender) {
68
68
  return true;
69
69
  }
70
70
  return false;
@@ -405,20 +405,20 @@ export function detectIfIsMobile(windowContext) {
405
405
  export function convertColorToRGBA(color, opacity) {
406
406
  let result = color;
407
407
  // console.log('convertColorToRGBA' + color, opacity);
408
- if ( color.indexOf('#') > -1 ) {
408
+ if (color && color.indexOf('#') > -1 ) {
409
409
  color = color.replace('#', '');
410
410
  const r = parseInt(color.substring(0, 2), 16);
411
411
  const g = parseInt(color.substring(2, 4), 16);
412
412
  const b = parseInt(color.substring(4, 6), 16);
413
413
  result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')';
414
- } else if ( color.indexOf('rgba') > -1 ) {
414
+ } else if (color && color.indexOf('rgba') > -1 ) {
415
415
  const rgb = color.split(',');
416
416
  const r = rgb[0].substring(5);
417
417
  const g = rgb[1];
418
418
  const b = rgb[2];
419
419
  // const b = rgb[2].substring(1, rgb[2].length - 1);
420
420
  result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')';
421
- } else if ( color.indexOf('rgb(') > -1 ) {
421
+ } else if (color && color.indexOf('rgb(') > -1 ) {
422
422
  const rgb = color.split(',');
423
423
  // console.log(rgb);
424
424
  const r = rgb[0].substring(4);
@@ -23,6 +23,5 @@
23
23
  },
24
24
  "apiUrl": "http://localhost:3000/",
25
25
  "baseImageUrl": "http://localhost:3000/",
26
- "dashboardUrl": "http://localhost:8081/dashboard/",
27
26
  "authPersistence": "LOCAL"
28
27
  }