@chat21/chat21-ionic 3.4.27-rc19 → 3.4.27-rc20

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
@@ -8,6 +8,9 @@
8
8
  ### **Copyrigth**:
9
9
  *Tiledesk SRL*
10
10
 
11
+ # 3.4.27-rc20
12
+ - **added**: onOpenTicketExternally event in triggerEvents service
13
+
11
14
  # 3.4.27-rc19
12
15
  - **added**: window.parent['openTicketOnHDA']
13
16
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-ionic",
3
3
  "author": "Tiledesk SRL",
4
- "version": "3.4.27-rc19",
4
+ "version": "3.4.27-rc20",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://tiledesk.com/",
7
7
  "repository": {
@@ -87,6 +87,7 @@ import { ProjectUsersService } from 'src/app/services/project_users/project-user
87
87
  import { ProjectUser } from 'src/chat21-core/models/projectUsers';
88
88
  import { getOSCode, hasRole } from 'src/app/utils/utils';
89
89
  import { PERMISSIONS } from 'src/app/utils/permissions.constants';
90
+ import { TriggerEvents } from 'src/app/services/triggerEvents/triggerEvents';
90
91
 
91
92
  @Component({
92
93
  selector: 'app-conversation-detail',
@@ -254,6 +255,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
254
255
  private events: EventsService,
255
256
  private webSocketService: WebsocketService,
256
257
  public projectPlanUtils: ProjectPlanUtils,
258
+ public triggerEvents: TriggerEvents,
257
259
  private g: Globals,
258
260
  ) {
259
261
  // Change list on date change
@@ -1940,10 +1942,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1940
1942
 
1941
1943
  onOpenTicket(event) {
1942
1944
  this.logger.debug('[CONVS-DETAIL] openTicketOnExternalService - conversationWith ', this.conversationWith)
1943
- if(window.parent['openTicketOnHDA']){
1944
- window.parent['openTicketOnHDA'](this.conversationWith)
1945
- }
1946
-
1945
+ const detailOBJ = { event: 'onOpenTicketExternally', request_id: this.conversationWith, conversation: this.conversation }
1946
+ this.triggerEvents.triggerOnOpenTicketExternally(detailOBJ)
1947
1947
  }
1948
1948
  // -------------- START SCROLL/RESIZE -------------- //
1949
1949
  /** */
@@ -103,7 +103,7 @@ export class TriggerEvents {
103
103
  }
104
104
 
105
105
  public triggerOnUpdateNewConversationBadge(detailObj: {}) {
106
- this.logger.debug(' ---------------- triggerOnInitEvent ---------------- ', detailObj);
106
+ this.logger.debug(' ---------------- triggerOnUpdateNewConversationBadge ---------------- ', detailObj);
107
107
  try {
108
108
  const onBeforeInit = new CustomEvent('onUpdateNewConversationBadge', { detail: detailObj });
109
109
  const windowContext = this.windowContext;
@@ -116,5 +116,19 @@ export class TriggerEvents {
116
116
  }
117
117
  }
118
118
 
119
+ public triggerOnOpenTicketExternally(detailObj: {}) {
120
+ this.logger.debug(' ---------------- triggerOnOpenTicketExternally ---------------- ', detailObj);
121
+ try {
122
+ const onBeforeInit = new CustomEvent('onOpenTicketExternally', { detail: detailObj });
123
+ const windowContext = this.windowContext;
124
+ if (windowContext){
125
+ // windowContext.document.dispatchEvent(onNewConversation);
126
+ windowContext.postMessage({type: "onOpenTicketExternally", detail: detailObj }, '*')
127
+ }
128
+ } catch (e) {
129
+ this.logger.error('[TRIGGER-HANDLER] > Error:' + e);
130
+ }
131
+ }
132
+
119
133
 
120
134
  }