Skip to content

Commit 46ae027

Browse files
author
Gabriele Panico
committed
removed: 'DOMAIN_NOT_ALLOWED' in textarea footer component
1 parent ae13034 commit 46ae027

File tree

3 files changed

+6
-37
lines changed

3 files changed

+6
-37
lines changed

src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,14 @@
44
<div tabindex="-1" class="c21-powered-by" [innerHTML]="poweredBy" (click)="managePoweredBy($event)"></div>
55
</div>
66

7-
<!-- ALERT EMOJI & URLS -->
7+
<!-- ALERT EMOJI -->
88
<div id="textAlert" *ngIf="!hideTextAreaContent && showAlertEmoji" class="fade-in-bottom" [class.hideTextReply]="hideTextReply">
99
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" version="1.1" viewBox="0 0 110 135">
1010
<path d="M55,25.8c-23,0-41.7,18.7-41.7,41.7s18.7,41.7,41.7,41.7,41.7-18.7,41.7-41.7-18.7-41.7-41.7-41.7ZM55,91.5c-3.4,0-6.2-2.8-6.2-6.2s2.8-6.2,6.2-6.2,6.2,2.8,6.2,6.2-2.8,6.2-6.2,6.2ZM60.3,70.1c-.2,2.8-2.5,4.9-5.3,4.9s-5.1-2.2-5.3-4.9l-1.6-22.3c-.3-4,2.9-7.4,6.9-7.4s7.2,3.4,6.9,7.4l-1.6,22.3Z"/>
1111
</svg>
1212
<div tabindex="-1" class="alertText">{{translationMap.get('EMOJI_NOT_ELLOWED')}}</div>
1313
</div>
1414

15-
<div id="textAlert" *ngIf="!hideTextAreaContent && showAlertUrl" class="fade-in-bottom" [class.hideTextReply]="hideTextReply">
16-
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" version="1.1" viewBox="0 0 110 135">
17-
<path d="M55,25.8c-23,0-41.7,18.7-41.7,41.7s18.7,41.7,41.7,41.7,41.7-18.7,41.7-41.7-18.7-41.7-41.7-41.7ZM55,91.5c-3.4,0-6.2-2.8-6.2-6.2s2.8-6.2,6.2-6.2,6.2,2.8,6.2,6.2-2.8,6.2-6.2,6.2ZM60.3,70.1c-.2,2.8-2.5,4.9-5.3,4.9s-5.1-2.2-5.3-4.9l-1.6-22.3c-.3-4,2.9-7.4,6.9-7.4s7.2,3.4,6.9,7.4l-1.6,22.3Z"/>
18-
</svg>
19-
<div tabindex="-1" class="alertText">{{translationMap.get('DOMAIN_NOT_ALLOWED')}}</div>
20-
</div>
2115
</div>
2216

2317
<!-- TEXTAREA + ICONS: conv active-->
@@ -68,7 +62,7 @@
6862

6963

7064

71-
<div *ngIf="!isStopRec" class="visible-text-area" [class.hasError]="showAlertEmoji || showAlertUrl" [class.disabled] = "( isConversationArchived || hideTextReply)? true : null">
65+
<div *ngIf="!isStopRec" class="visible-text-area" [class.hasError]="showAlertEmoji" [class.disabled] = "( isConversationArchived || hideTextReply)? true : null">
7266
<!-- isFilePendingToUpload || -->
7367
<textarea
7468
[attr.disabled] = "(hideTextReply)? true : null"
@@ -91,7 +85,7 @@
9185
</div>
9286

9387
<!-- ICON SEND -->
94-
<div *ngIf="(textInputTextArea !== '' && !isStopRec) || !showAudioRecorderFooterButton" tabindex="-1" class="chat21-textarea-button" [class.disabled]="showAlertEmoji || showAlertUrl" [class.active]="textInputTextArea && !hideTextReply" id="chat21-button-send" (click)="onSendPressed($event)">
88+
<div *ngIf="(textInputTextArea !== '' && !isStopRec) || !showAudioRecorderFooterButton" tabindex="-1" class="chat21-textarea-button" [class.disabled]="showAlertEmoji" [class.active]="textInputTextArea && !hideTextReply" id="chat21-button-send" (click)="onSendPressed($event)">
9589
<span class="v-align-center">
9690
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="24" width="24" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve" fill="currentColor">
9791
<path d="M1.8,20.6V3.4l20.2,8.6L1.8,20.6ZM3.9,17.3l12.6-5.4L3.9,6.6v3.7l6.4,1.6-6.4,1.6v3.8ZM3.9,17.3V6.6v10.7Z"/>

src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
8282
}
8383

8484
showAlertEmoji: boolean = false
85-
showAlertUrl: boolean = false;
8685

8786
file_size_limit: number = 10;
8887
attachmentTooltip: string = '';
@@ -350,12 +349,6 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
350349
this.onEmojiiPickerShow.emit(false)
351350
this.logger.log('[CONV-FOOTER] SEND MESSAGE: ', msg, type, metadata, additional_attributes);
352351

353-
354-
let checkUrlDomain = this.checkForUrlDomain(this.textInputTextArea)
355-
if(!checkUrlDomain){
356-
return
357-
}
358-
359352
let check = this.checkForEmojii(this.textInputTextArea)
360353
if(!check){
361354
return;
@@ -568,22 +561,6 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
568561
this.showAlertEmoji = false;
569562
return true
570563
}
571-
572-
checkForUrlDomain(text){
573-
if(this.project && this.project.settings?.allowed_urls === true && this.project.settings?.allowed_urls_list){
574-
this.showAlertUrl = !isAllowedUrlInText(text, this.project.settings?.allowed_urls_list);
575-
if(this.showAlertUrl){
576-
return false
577-
}
578-
this.showAlertUrl = false
579-
return true
580-
}
581-
this.showAlertUrl = false
582-
return true
583-
584-
585-
}
586-
587564

588565

589566
onTextAreaChange(){
@@ -592,7 +569,6 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
592569

593570
//reset alert to defalt values before checking again
594571
this.showAlertEmoji= false;
595-
this.showAlertUrl = false;
596572
let check = this.checkForEmojii(this.textInputTextArea)
597573
if(!check){
598574
return;
@@ -601,10 +577,10 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
601577

602578
onSendPressed(event) {
603579
this.logger.log('[CONV-FOOTER] onSendPressed:event', event);
604-
if(this.showAlertEmoji || this.showAlertUrl){
580+
event.preventDefault();
581+
if(this.showAlertEmoji){
605582
return;
606583
}
607-
event.preventDefault();
608584
this.logger.log('[CONV-FOOTER] AppComponent::onSendPressed::isFilePendingToUpload:', this.isFilePendingToUpload);
609585
if (this.isFilePendingToUpload) {
610586
this.logger.log('[CONV-FOOTER] AppComponent::onSendPressed', 'is a file');
@@ -732,7 +708,7 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
732708
const keyCode = event.which || event.keyCode;
733709
this.textInputTextArea = ((document.getElementById('chat21-main-message-context') as HTMLInputElement).value);
734710
if (keyCode === 13) { // ENTER pressed
735-
if(this.showAlertEmoji || this.showAlertUrl){
711+
if(this.showAlertEmoji){
736712
return;
737713
}
738714
if (this.textInputTextArea && this.textInputTextArea.trim() !== '') {

src/app/component/conversation-detail/conversation/conversation.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
234234
'LABEL_START_NW_CONV',
235235
'CONTINUE',
236236
'EMOJI_NOT_ELLOWED',
237-
'DOMAIN_NOT_ALLOWED',
238237
'ATTACHMENT',
239238
'EMOJI'
240239
];

0 commit comments

Comments
 (0)