@chat21/chat21-ionic 3.4.27-rc3 → 3.4.27-rc4

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,10 @@
8
8
  ### **Copyrigth**:
9
9
  *Tiledesk SRL*
10
10
 
11
+ # 3.4.27-rc4
12
+ - **bug-fixed**: extractUrls function is not able to detect url start with www or without https/http
13
+ - **bug-fixed**: if message is sent with keydown, error on domain check is not showed
14
+
11
15
  # 3.4.27-rc3
12
16
  - **bug-fixed**: cannot set user availability if supportMode is enabled and tiledesk_projectID url params is set
13
17
 
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-rc3",
4
+ "version": "3.4.27-rc4",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://tiledesk.com/",
7
7
  "repository": {
@@ -566,8 +566,10 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
566
566
  if (!text.includes("/")) {
567
567
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - SEND MESSAGE 1 message: ', message);
568
568
  this.logger.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea SEND MESSAGE 1 message: ", message);
569
- this.messageString = '';
569
+
570
570
  this.sendMessage(text);
571
+ // this.messageString = '';
572
+
571
573
  this.countClicks = 0
572
574
  } else if (text.includes("/") && pos === 0 && this.countClicks > 1 && this.tagsCannedFilter.length > 0) {
573
575
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - tagsCannedFilter.length 2: ', this.tagsCannedFilter.length);
@@ -579,9 +581,10 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
579
581
  this.logger.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea SEND MESSAGE 2 this.countClicks: ", this.countClicks);
580
582
  this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown in msg-texarea SEND MESSAGE 2 this.countClicks: ", this.countClicks);
581
583
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - SEND MESSAGE 2 message: ', message);
582
- this.messageString = '';
583
-
584
+
584
585
  this.sendMessage(text);
586
+ // this.messageString = '';
587
+
585
588
  this.countClicks = 0
586
589
  } else if (text.includes("/") && pos > 0 && this.countClicks > 1 && this.tagsCannedFilter.length > 0 && text.substr(-1) !== '/') {
587
590
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - tagsCannedFilter.length 3: ', this.tagsCannedFilter.length);
@@ -593,17 +596,19 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
593
596
  this.logger.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea SEND MESSAGE 2 this.countClicks: ", this.countClicks);
594
597
  this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown in msg-texarea SEND MESSAGE 2 this.countClicks: ", this.countClicks);
595
598
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - SEND MESSAGE 2 message: ', message);
596
- this.messageString = '';
597
-
599
+
598
600
  this.sendMessage(text);
601
+ // this.messageString = '';
602
+
599
603
  this.countClicks = 0
600
604
  } else if (text.includes("/") && this.tagsCannedFilter.length === 0) {
601
605
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - tagsCannedFilter.length 3: ', this.tagsCannedFilter.length);
602
606
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - SEND MESSAGE 3 message: ', message);
603
607
  this.logger.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea SEND MESSAGE 3 message: ", message);
604
- this.messageString = '';
605
-
608
+
606
609
  this.sendMessage(text);
610
+ // this.messageString = '';
611
+
607
612
  this.countClicks = 0
608
613
 
609
614
  }
@@ -81,11 +81,11 @@
81
81
  [searchable]="false">
82
82
  <ng-template ng-label-tmp let-item="item">
83
83
  <img style="width: 15px;height: 15px;position: relative; top: 1px;" height="15" width="15" [src]="item?.avatar" />
84
- <span id="sidebaravatar_{{item.name}}" style="text-transform: capitalize; margin-left:8px"> {{item.label}} </span>
84
+ <span id="sidebaravatar_{{item.name}}" style="text-transform: capitalize; margin-left:8px"> {{item.label | translate}} </span>
85
85
  </ng-template>
86
86
  <ng-template ng-option-tmp let-item="item" let-index="index">
87
87
  <img style="width: 15px;height: 15px;position: relative; top: 1px;" height="15" width="15" [src]="item?.avatar" />
88
- <span id="sidebaravatar_{{item.name}}" style="text-transform: capitalize; margin-left:8px"> {{item.label}} </span>
88
+ <span id="sidebaravatar_{{item.name}}" style="text-transform: capitalize; margin-left:8px"> {{item.label | translate}} </span>
89
89
  </ng-template>
90
90
  </ng-select>
91
91
  </section>
@@ -242,9 +242,9 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
242
242
  .set('SubscriptionPaymentProblem', text['SubscriptionPaymentProblem'])
243
243
  .set('ThePlanHasExpired', text['ThePlanHasExpired'])
244
244
 
245
- this.teammateStatus.forEach(element => {
246
- element.label = this.translationsMap.get(element.label)
247
- });
245
+ // this.teammateStatus.forEach(element => {
246
+ // element.label = this.translationsMap.get(element.label)
247
+ // });
248
248
 
249
249
  });
250
250
  }
@@ -261,7 +261,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
261
261
  listenToCurrentStoredProject() {
262
262
  this.events.subscribe('storage:last_project', projectObjct => {
263
263
  if (projectObjct && projectObjct !== 'undefined') {
264
- // this.logger.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT ', projectObjct)
264
+ this.logger.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT ', projectObjct)
265
265
 
266
266
  //TODO: recuperare info da root e non da id_project
267
267
  this.project = {
@@ -331,14 +331,14 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
331
331
  // this.logger.log('teammateStatus ', this.teammateStatus)
332
332
  this.selectedStatus = this.teammateStatus[2].id;
333
333
  this.logger.debug('[SIDEBAR-USER-DETAILS] - PROFILE_STATUS selected option', this.teammateStatus[2].name);
334
- this.teammateStatus = this.teammateStatus.slice(0)
334
+ // this.teammateStatus = this.teammateStatus.slice(0)
335
335
  } else if (projectUser['user_available'] === false && (projectUser['profileStatus'] === '' || !projectUser['profileStatus'])) {
336
336
  this.selectedStatus = this.teammateStatus[1].id;
337
337
  this.logger.debug('[SIDEBAR-USER-DETAILS] - PROFILE_STATUS selected option', this.teammateStatus[1].name);
338
- this.teammateStatus = this.teammateStatus.slice(0)
338
+ // this.teammateStatus = this.teammateStatus.slice(0)
339
339
  } else if (projectUser['user_available'] === true && (projectUser['profileStatus'] === '' || !projectUser['profileStatus'])) {
340
340
  this.selectedStatus = this.teammateStatus[0].id
341
- this.teammateStatus = this.teammateStatus.slice(0)
341
+ // this.teammateStatus = this.teammateStatus.slice(0)
342
342
  this.logger.debug('[SIDEBAR-USER-DETAILS] - PROFILE_STATUS selected option', this.teammateStatus[0].name);
343
343
  }
344
344
  this.IS_BUSY = projectUser['isBusy']
@@ -22,6 +22,9 @@ import { MatTooltipModule } from '@angular/material/tooltip';
22
22
  import { MatSnackBarModule } from '@angular/material/snack-bar';
23
23
  import { MatSlideToggleModule } from '@angular/material/slide-toggle';
24
24
  import { SafeHtmlPipe } from '../directives/safe-html.pipe';
25
+ import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
26
+ import { createTranslateLoader } from 'src/chat21-core/utils/utils';
27
+ import { HttpClient } from '@angular/common/http';
25
28
 
26
29
  // import { MessageTextAreaComponent } from '../components/conversation-detail/message-text-area/message-text-area.component'; // MessageTextAreaComponent is part of the declarations ConversationDetailPageModule
27
30
 
@@ -140,6 +143,14 @@ import { SafeHtmlPipe } from '../directives/safe-html.pipe';
140
143
  NgSelectModule,
141
144
  FormsModule,
142
145
 
146
+ TranslateModule.forChild({
147
+ loader: {
148
+ provide: TranslateLoader,
149
+ useFactory: (createTranslateLoader),
150
+ deps: [HttpClient]
151
+ }
152
+ })
153
+
143
154
  ],
144
155
  schemas: [
145
156
  CUSTOM_ELEMENTS_SCHEMA,
@@ -1018,6 +1018,14 @@ export function isAllowedUrlInText(text: string, allowedUrls: string[]) {
1018
1018
  }
1019
1019
 
1020
1020
  function extractUrls(text: string): string[] {
1021
- const urlRegex = /https?:\/\/[^\s]+/g;
1022
- return text.match(urlRegex) || [];
1021
+ // Rileva URL con o senza protocollo (http/https)
1022
+ const urlRegex = /\b((https?:\/\/)?(www\.)?[a-z0-9.-]+\.[a-z]{2,})(\/[^\s]*)?/gi;
1023
+ const matches = text.match(urlRegex) || [];
1024
+ // Normalizza: aggiunge https:// se manca, così il parsing con new URL() funziona
1025
+ return matches.map((url) => {
1026
+ if (!/^https?:\/\//i.test(url)) {
1027
+ return 'https://' + url;
1028
+ }
1029
+ return url;
1030
+ });
1023
1031
  }