Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriele Panico committed Jan 10, 2025
1 parent 12ddc3e commit ca9f81c
Show file tree
Hide file tree
Showing 57 changed files with 128 additions and 1,124 deletions.
24 changes: 0 additions & 24 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,6 @@
### **Copyrigth**:
*Tiledesk SRL*


# 1.26.0-rc.7
- **changed**: botName with botId in action-replace-bot-v3

# 1.26.0-rc.6
- **added**: action-replace-bot-v3

# 1.26.0-rc.5
# 1.26.0-rc.4
# 1.26.0-rc.3
- **bug-fixed**: chatbot is not correctly selected in action-replace-bot-v2

# 1.26.0-rc.2
- **bug-fixed**: action-replace-bot-v2 not pass value correctly

# 1.26.0-rc.1
- **added**: slug as chatbot property and action-replace-bot-v2 option when user select a chatbot

# 1.25.0-rc.3
- **added**: intent and chatbot only agents visibility

# 1.25.0-rc.2
- **changed**: action-record translations and default values

# 1.25.1

# 1.25.0
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tiledesk/cds",
"author": "Tiledesk SRL",
"version": "1.26.0-rc.7",
"version": "1.25.1",
"license": "MIT",
"homepage": "https://www.tiledesk.com",
"repository": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
<span class="material-icons" *ngIf="item['icon']"
[class.intent-start]="item[bindLabelSelect] === 'start'"
[class.intent-defaultFallback]="item[bindLabelSelect] === 'defaultFallback'">{{item['icon']}}</span>
<span class="label-select">{{ item[bindLabelSelect] | translate }}</span>
<span class="label-select">{{item[bindLabelSelect] | translate }}</span>
<span *ngIf="optionalBindAdditionalText" class="label-select-option">{{item[optionalBindAdditionalText] | translate }}</span>
</div>
</ng-template>

<ng-template ng-option-tmp let-item="item" let-index="index">
<div class="select-item-wrp" [attr.additionalText]="optionalBindAdditionalText && !item['icon']? true: false" [disabled]="item?.disabled">
<div class="select-item-wrp" [attr.additionalText]="optionalBindAdditionalText && !item['icon']? true: false">
<div style="width: 100%; display: flex; flex-direction: column;">
<div class="select-item-wrp">
<span class="material-icons" *ngIf="item['icon']"
Expand All @@ -38,7 +38,7 @@
<span *ngIf="optionalBindAdditionalText" class="label-select-option">{{item[optionalBindAdditionalText] | translate }}</span>
</div>
<div class="select-item-wrp">
<span *ngIf="optionalBindDescription" class="label-select-option description" [class.description-margin]="item['icon']">{{item[optionalBindDescription] | translate }}</span>
<span *ngIf="optionalBindDescription" class="label-select-option description">{{item[optionalBindDescription] | translate }}</span>
</div>
</div>
<div *ngIf="deleteButton" class="icon-container" (click)="$event.stopPropagation(); onDeleteButtonClick(item[bindValueSelect])">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@
text-overflow: ellipsis;
}

span.description-margin{
margin-left: 28px
}


&.ng-option-disabled {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ export class CdsChatbotDetailsComponent extends BotsBaseComponent implements OnI
'CDSSetting.ThereHasBeenAnErrorProcessing',
'CDSSetting.FileUploadedSuccessfully',
'CDSSetting.AnErrorOccurredUpdatingProfile',
'CDSSetting.UserProfileUpdated',
'CDSSetting.SlugAlreadyExists'
'CDSSetting.UserProfileUpdated'

]

Expand All @@ -110,7 +109,6 @@ export class CdsChatbotDetailsComponent extends BotsBaseComponent implements OnI
.set('CDSSetting.FileUploadedSuccessfully', text['CDSSetting.FileUploadedSuccessfully'])
.set('CDSSetting.ThereHasBeenAnErrorProcessing', text['CDSSetting.AnErrorOccurredUpdatingProfile'])
.set('CDSSetting.ThereHasBeenAnErrorProcessing', text['CDSSetting.UserProfileUpdated'])
.set('CDSSetting.SlugAlreadyExists', text['CDSSetting.SlugAlreadyExists'])

})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,28 +125,6 @@ <h3 class="card_title__underlined">
</div> -->


<!-- SPACER -->
<div class="col-sm-12" style="height:10px"></div>


<!-- ------------------------------------------------------------------------------------------- -->
<!-- Slug -->
<!-- ------------------------------------------------------------------------------------------- -->
<div class="row" style="margin-bottom: 16px;">
<label class="col-sm-2 cds-custom-label">
{{ 'BotsAddEditPage.Slug' | translate }}
</label>
<div class="col-xs-12 col-sm-8 col-md-8 col-lg-8">
<input id="slug" name="slug" [(ngModel)]="selectedChatbot.slug" (change)="onInputChange($event,'slug')" class="input csd-chatbot-dtls-input"
type="text" placeholder="{{ 'BotsAddEditPage.AddSlagToYourChatbot' | translate }}">
<br>
<span style="color: #9aa0a6;font-size: 12px;font-weight: 400;">
{{'BotsAddEditPage.SlugAlert' | translate}}
</span>
</div>
</div>


<!-- ------------------------------------------------------------------------------------------- -->
<!-- Update button -->
<!-- ------------------------------------------------------------------------------------------- -->
Expand Down Expand Up @@ -220,59 +198,16 @@ <h3 class="card_title__underlined">
</div>
</div>

<!-- <div class="row"> -->
<div class="col-xs-12 col-sm-8 col-md-8 col-lg-8">
<span style="color: #9aa0a6;font-size: 12px;font-weight: 400;">
{{'ManageTheBotIn' | translate}}
<span class="custom-link" (click)="goToRoutingAndDepts()">
{{'RoutingAndDepts' | translate}}
</span>
</span>
</div>
<!-- </div> -->

</div>



<!-- ---------------------------------------------------------- -->
<!-- Agents available -->
<!-- ---------------------------------------------------------- -->
<div *ngIf="isVisibleDEP === true" class="row" style="margin-bottom: 4px; margin-top: 30px;">

<div class="col-sm-10 col-md-10">
<h3 class="card_title__underlined">
<span class="card_title__underline">
{{ 'Agents available' | translate }}
</span>
</h3>
</div>

<div class="col-sm-10 col-md-10">
<div class="section-subtitle"></div>
</div>

<div class="col-sm-10 col-md-10 nw-onoffswitch-wrapper" style="clear: both; display: inline-block;">
<div class="nw-onoffswitch">
<input type="checkbox" name="agents_available_switch"
class="nw-onoffswitch-checkbox" id="agents_available_switch"
[(ngModel)]="selectedChatbot.agents_available"
(change)="onAgentsAvailableChange($event)">
<label class="nw-onoffswitch-label" for="agents_available_switch"></label>
</div>
<span class="checkmark" style="line-height: 25px; margin: 20px 20px 10px; float: left;">
{{ 'Available to agents' | translate }}
</span>
</div>
<div class="row">

<div class="col-xs-12 col-sm-8 col-md-8 col-lg-8">
<span style="color: #9aa0a6;font-size: 12px;font-weight: 400;">
{{'A chatbot with this option is visible to agents for the purpose to be put back in the conversation' | translate}}
{{'ManageTheBotIn' | translate}}
<span class="custom-link" (click)="goToRoutingAndDepts()">
{{'RoutingAndDepts' | translate}}
</span>
</span>
</div>

</div>



</div> <!-- ./ bot details -->
Original file line number Diff line number Diff line change
Expand Up @@ -241,64 +241,9 @@ input[type="file"] {
margin-left: 8px;
}

.custom-link {
color: #0f62ff;
cursor: pointer;
}




// --------------------
// SWITCH BTN
// --------------------
// --------- start new on-off btn logo ---------
.nw-onoffswitch {
position: relative;
width: 45px;
margin-top: 20px;
display: block;
float: left;
}
.nw-onoffswitch-checkbox {
position: absolute;
opacity: 0;
pointer-events: none;
}
.nw-onoffswitch-label {
display: block;
overflow: hidden;
.custom-link {
color: #0f62ff;
cursor: pointer;
height: 25px;
padding: 0;
line-height: 25px;
border: 2px solid #e3e3e3;
border-radius: 25px;
background-color: #ffffff;
transition: background-color 0.3s ease-in;
}
.nw-onoffswitch-label:before {
content: "";
display: block;
width: 25px;
margin: 0px;
background: #ffffff;
position: absolute;
top: 0;
bottom: 0;
right: 20px;
border: 2px solid #e3e3e3;
border-radius: 25px;
transition: all 0.3s ease-in 0s;
}
.nw-onoffswitch-checkbox:checked + .nw-onoffswitch-label {
background-color: var(--blu);
}
.nw-onoffswitch-checkbox:checked + .nw-onoffswitch-label,
.nw-onoffswitch-checkbox:checked + .nw-onoffswitch-label:before {
border-color: var(--blu);
}
.nw-onoffswitch-checkbox:checked + .nw-onoffswitch-label:before {
right: 0px;
}
// --------- ./end new on-off btn logo ---------
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { UserModel } from 'src/chat21-core/models/user';
import { UploadModel } from 'src/chat21-core/models/upload';
import { ImageRepoService } from 'src/chat21-core/providers/abstract/image-repo.service';
import { checkAcceptedFile, filterImageMimeTypesAndExtensions } from '../../utils';
import { generateSlug } from 'src/app/utils/util';
const swal = require('sweetalert');

@Component({
Expand Down Expand Up @@ -68,6 +67,7 @@ export class CDSDetailBotDetailComponent extends BotsBaseComponent implements On
dept_id: string;
selected_dept_id: string;
selected_dept_name: string;

user: UserModel
imageURL: string;

Expand All @@ -93,18 +93,9 @@ export class CDSDetailBotDetailComponent extends BotsBaseComponent implements On
ngOnChanges() {
this.logger.log('[CDS-CHATBOT-DTLS] (OnChanges) selectedChatbot ', this.selectedChatbot)
this.destructureSelectedChatbot(this.selectedChatbot)
this.patchAgensAvailable();
}


private patchAgensAvailable(){
if(this.selectedChatbot && this.selectedChatbot.agents_available != false){
this.selectedChatbot.agents_available = true;
}
}



getDeptsByProjectId() {
this.departmentService.getDeptsByProjectId().subscribe({ next: (departments: any) => {
this.logger.log('[CDS-CHATBOT-DTLS] - DEPT GET DEPTS ', departments);
Expand Down Expand Up @@ -521,20 +512,12 @@ export class CDSDetailBotDetailComponent extends BotsBaseComponent implements On
})
}

onInputChange(event, key: string){
switch(key){
case 'slug':
this.selectedChatbot.slug = generateSlug((event.target as HTMLInputElement).value);
break;
}
}


editBot() {
// RESOLVE THE BUG 'edit button remains focused after clicking'
this.elementRef.nativeElement.blur();

// this.logger.log('[CDS-CHATBOT-DTLS] FAQ KB NAME TO UPDATE ', this.faqKb_name);
this.faqKbService.updateFaqKb(this.selectedChatbot).subscribe({next:(faqKb) => {
this.faqKbService.updateFaqKb(this.selectedChatbot._id, this.selectedChatbot.name, this.selectedChatbot.url, this.selectedChatbot.type, this.selectedChatbot.description, this.selectedChatbot.webhook_enabled, this.selectedChatbot.webhook_url, this.selectedChatbot.language).subscribe({next:(faqKb) => {
this.logger.log('[CDS-CHATBOT-DTLS] EDIT BOT - FAQ KB UPDATED ', faqKb);
if (faqKb) {
this.selectedChatbot.name = faqKb['name']
Expand All @@ -543,17 +526,14 @@ export class CDSDetailBotDetailComponent extends BotsBaseComponent implements On
}, error: (error) => {
this.logger.error('[CDS-CHATBOT-DTLS] EDIT BOT - ERROR ', error);

if(error && error.error.error_code === 12001){
// =========== NOTIFY SLUG ALREADY EXISTS ERROR ===========
this.notify.showWidgetStyleUpdateNotification(this.translationsMap.get('CDSSetting.SlugAlreadyExists'), 4, 'report_problem');
return
}
// =========== NOTIFY ERROR ===========
this.notify.showWidgetStyleUpdateNotification(this.translationsMap.get('CDSSetting.UpdateBotError'), 4, 'report_problem');

}, complete: () => {
this.logger.log('[CDS-CHATBOT-DTLS] EDIT BOT - * COMPLETE *');
// =========== NOTIFY SUCCESS===========
this.notify.showWidgetStyleUpdateNotification(this.translationsMap.get('CDSSetting.UpdateBotSuccess'), 2, 'done');
this.selectedChatbot.name
}});
}

Expand All @@ -567,14 +547,4 @@ export class CDSDetailBotDetailComponent extends BotsBaseComponent implements On
window.open(redirecturl, '_blank')
}


onAgentsAvailableChange(event: Event): void {
const checkbox = event.target as HTMLInputElement;
const isAgentsAvailable = checkbox.checked;
this.logger.log('[CDS-CHATBOT-DTLS] isAgentsAvailable: ',isAgentsAvailable);
this.selectedChatbot.agents_available = isAgentsAvailable;
this.editBot();
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{{'CDSCanvas.Target' | translate }}:
</div>
<div class="action-row-right">
<div class="set-option-value">
<div class="set-attribute-value">
{{ (radioOptions | filter:{key: 'value', value: action?.target }).name | translate }}
</div>
</div>
Expand All @@ -21,8 +21,8 @@
<path d="M12.64,2.12c0-.27.21-.51.47-.49.92.05,1.68.32,2.27.81.66.56.99,1.35.99,2.34v2.8c0,.55.15.93.44,1.17.25.21.65.35,1.23.39.24.02.45.23.45.51v.63c0,.28-.21.49-.45.51-.52.03-.91.16-1.18.37h0c-.31.23-.47.62-.47,1.22v2.77c0,.98-.31,1.76-.95,2.32-.57.5-1.34.77-2.3.82-.26.02-.47-.22-.47-.49v-.62c0-.28.2-.49.44-.51.48-.04.84-.18,1.09-.39.28-.24.44-.63.44-1.22v-2.72c0-.68.16-1.24.5-1.66.27-.33.64-.57,1.1-.72-.46-.15-.83-.39-1.1-.72-.34-.42-.5-.98-.5-1.66v-2.7c0-.51-.13-.88-.37-1.15-.25-.26-.62-.43-1.16-.49-.24-.02-.44-.24-.44-.51v-.61Z"/>
</svg>
</div>
<div class="action-row-right" [ngClass]="item | variableCssClass">
{{item | getVariableName }}
<div class="action-row-right">
{{item}}
</div>
</div>

Expand Down
Loading

0 comments on commit ca9f81c

Please sign in to comment.