Skip to content

Commit

Permalink
Merge branch 'master-pre'
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriele Panico committed Jul 29, 2024
2 parents e5db201 + 7291abe commit 28ba666
Show file tree
Hide file tree
Showing 17 changed files with 113 additions and 26 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@
*Giovanni Troisi*
### **Copyrigth**: *Tiledesk SRL*

### 1.18.0 in PROD
### 1.18.0-rc.5
👉 **added**: history property to cds-action-askkbv2

### 1.18.0-rc.4
👉 **added**: ani, dnis and callId voice property
👉 **added**: disabled option to select base component

### 1.18.0-rc.3
👉 **added**: description msg for ignoreOperatingHours property into cds-action-online-agents

### 1.18.0-rc.2
👉 **added**: implement time slots on cds-action-operating-hours
Expand Down
2 changes: 1 addition & 1 deletion 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.18.0",
"version": "1.18.0-rc.5",
"license": "MIT",
"homepage": "https://www.tiledesk.com",
"repository": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@
text-overflow: ellipsis;
}


&.ng-option-disabled {

pointer-events: none;
.label-select{
color: #ccc;

}
}

// &.ng-option-marked {
// // background-color: rgba(var(--blu-light-02), .23) !important;
// }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@
</cds-textarea>
</div>


<div class="field-box">
<section class="disable-input-message-section">
<mat-checkbox
[checked]="action?.history"
(change)="onChangeCheckbox('history')">
{{"CDSCanvas.UseChatHistoryInPrompt" | translate}}
</mat-checkbox>
</section>
</div>

<div style="width: 100%; display: flex; justify-content: flex-end; margin: 30px 0px 10px 0px">
<button id="cds-publish-btn" class="btn btn-primary cds-blue-button" type="button"
[disabled]="!action.question" (click)="execPreview()">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,15 @@ export class CdsActionGPTTaskComponent implements OnInit {
this.updateAndSaveAction.emit();
}

onChangeCheckbox(target){
try {
this.action[target] = !this.action[target];
this.updateAndSaveAction.emit({type: TYPE_UPDATE_ACTION.ACTION, element: this.action});
} catch (error) {
this.logger.log("Error: ", error);
}
}

onChangeBlockSelect(event:{name: string, value: string}, type: 'trueIntent' | 'falseIntent') {
if(event){
this.action[type]=event.value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export class CdsActionLeadUpdateComponent implements OnInit {

private initialize() {
this.leadPropertyFormGroup = this.buildForm();
this.leadPropertyListFiltered.forEach(el => Object.keys(this.action.update).includes(el.name)? el.disabled= true: el.disabled = false)
}

buildForm(): FormGroup{
Expand All @@ -74,19 +75,22 @@ export class CdsActionLeadUpdateComponent implements OnInit {
this.action.update[form.key] = form.value;
this.showPlaceholder = false;
this.showCards = true;
this.leadPropertyListFiltered.forEach(el => Object.keys(this.action.update).includes(el.name)? el.disabled= true: el.disabled = false)
this.leadPropertyFormGroup.reset();
this.updateAndSaveAction.emit();
}
}

onAddNewProperty(){
this.logger.log("[ACTION-LEAD-UPDATE] onAddNewProperty ADD : ", this.showPlaceholder)
this.leadPropertyListFiltered.forEach(el => Object.keys(this.action.update).includes(el.name)? el.disabled= true: el.disabled = false)
this.showPlaceholder = true;
}

onDeleteProperty(index: number, key: string){
this.logger.log("[ACTION-LEAD-UPDATE] onDeleteProperty index : ", index)
delete this.action.update[key];
this.leadPropertyListFiltered.forEach(el => Object.keys(this.action.update).includes(el.name)? el.disabled= true: el.disabled = false)
if(this.action && Object.keys(this.action.update).length === 0){
this.showCards = false;
this.showPlaceholder = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
<div class="panel-intent-detail">
<div class="panel-intent-detail" [class.minimize]="!maximize" [class.maximize]="maximize">
<div class="header-panel">
<cds-action-description
[actionSelected]="elementIntentSelectedType === typeIntentElement.ACTION? elementSelected : null"
[elementType]="elementIntentSelectedType"
[showTip]="elementIntentSelectedType === typeIntentElement.ACTION? true : false"
[previewMode]="false">
</cds-action-description>

<div class="header-options-wrp icon-action" (click)="maximize = !maximize">
<img src="assets/images/icons/fold.svg" class="active-icon" [title]="'Maximize' | translate" *ngIf="!maximize">
<img src="assets/images/icons/unfold.svg" class="active-icon" [title]="'Minimize' | translate" *ngIf="maximize">
</div>
</div>

<div id="content-panel" class="content-panel">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
$margin-left: 10px;
$padding: 10px;
:host{
$margin-left: 10px;
$padding: 10px;
--panel-width: 480px;
}

.panel-intent-detail {
// position: relative;
display: block;
width: 480px;
width: var(--panel-width);
min-width: 400px;
height: 100%; //auto
max-height: 100%;
Expand All @@ -15,6 +18,14 @@ $padding: 10px;
border-left: 1px solid var(--gray-light-02);
// margin: 0 auto 0 auto; // nk
inset: 0 0 0 200px;

&.minimize {
--panel-width: 480px;
}

&.maximize {
--panel-width: 680px;
}
}

.header-panel {
Expand All @@ -24,7 +35,22 @@ $padding: 10px;
right: 0;
background-color: var(--blu-light-03);
z-index: 2;

display: flex;
align-items: center;
cds-action-description{
width: 100%;
}
}

.header-options-wrp{
display: flex;
padding: 10px;
&:hover{
cursor: pointer;
}
}

.content-panel{
// height: calc(100% - 73px); // nk
// height: calc(100% - 100px); // nk
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit, Input, Output, EventEmitter, OnChanges, SimpleChanges, ChangeDetectorRef, TemplateRef, ViewContainerRef, HostListener } from '@angular/core';
import { Component, OnInit, Input, Output, EventEmitter, OnChanges, SimpleChanges, ChangeDetectorRef, TemplateRef, ViewContainerRef, HostListener, ElementRef } from '@angular/core';
import { Subject, Subscription } from 'rxjs';
import { ConnectorService } from '../../../services/connector.service';
import { IntentService } from '../../../services/intent.service';
Expand Down Expand Up @@ -40,9 +40,10 @@ export class CdsActionDetailPanelComponent implements OnInit, OnChanges {
elementIntentSelectedType: string;
openCardButton = false;

maximize: boolean = false;

/** panel reply button configuaration */
private subscriptionIntent: Subscription;
/** panel reply button configuaration */
private subscriptionIntent: Subscription;


canShowActionByPlan: { plan: PLAN_NAME, enabled: boolean}= { plan: PLAN_NAME.A, enabled: true}
Expand Down
2 changes: 1 addition & 1 deletion src/app/chatbot-design-studio/utils-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const ACTIONS_LIST: {[key: string]: {name: string, category: TYPE_ACTION_
REPLACE_BOTV2: { name: 'CDSActionList.NAME.ReplaceBot', category: TYPE_ACTION_CATEGORY.FLOW, type: TYPE_ACTION.REPLACE_BOTV2, src: "assets/images/actions/replace_bot.svg", status: "active", description: "CDSActionList.DESCRIPTION.ReplaceBot" },
WAIT : { name: 'CDSActionList.NAME.Wait', category: TYPE_ACTION_CATEGORY.FLOW, type: TYPE_ACTION.WAIT, src:"assets/images/actions/wait.svg", status: "active", description: "CDSActionList.DESCRIPTION.Wait" },
CAPTURE_USER_REPLY: { name: 'CDSActionList.NAME.CaptureUserReply', category: TYPE_ACTION_CATEGORY.FLOW, type: TYPE_ACTION.CAPTURE_USER_REPLY, src: "assets/images/actions/capture_user_reply.svg", status: "active", description: "CDSActionList.DESCRIPTION.CaptureUserReply" },
LEAD_UPDATE : { name: 'CDSActionList.NAME.LeadUpdate', category: TYPE_ACTION_CATEGORY.FLOW, type: TYPE_ACTION.LEAD_UPDATE, src:"assets/images/actions/lead_update.svg", status: "inactive", description: "CDSActionList.DESCRIPTION.LeadUpdate" },
LEAD_UPDATE : { name: 'CDSActionList.NAME.LeadUpdate', category: TYPE_ACTION_CATEGORY.FLOW, type: TYPE_ACTION.LEAD_UPDATE, src:"assets/images/actions/lead_update.svg", status: "active", description: "CDSActionList.DESCRIPTION.LeadUpdate" },
// WEB_REQUEST : { name: 'CDSActionList.NAME.WebRequest',category: TYPE_ACTION_CATEGORY.INTEGRATIONS, type: TYPE_ACTION.WEB_REQUEST, src:"assets/images/actions/web_request.svg", status: "active", description: ''},
ASKGPT: { name: 'CDSActionList.NAME.AskTheKnowledgeBase', category: TYPE_ACTION_CATEGORY.AI, type: TYPE_ACTION.ASKGPT, src: "assets/images/actions/ask_to_kb.svg", status: "inactive", description: "CDSActionList.DESCRIPTION.AskTheKnowledgeBase" },
ASKGPTV2: { name: 'CDSActionList.NAME.AskTheKnowledgeBase', category: TYPE_ACTION_CATEGORY.AI, type: TYPE_ACTION.ASKGPTV2, src: "assets/images/actions/ask_to_kb.svg", status: "active", description: "CDSActionList.DESCRIPTION.AskTheKnowledgeBase" },
Expand Down
23 changes: 13 additions & 10 deletions src/app/chatbot-design-studio/utils-variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,22 @@ export var variableList: Array<{key: string, elements: Array<any>}> = [
{ name: 'voice Name', value: 'voiceName', description: 'CDSvariablesList.voiceFlowElements.voiceName.description', src: '', icon:'person'},
{ name: 'event', value: 'event', description: 'CDSvariablesList.voiceFlowElements.event.description', src: '', icon:'perm_phone_msg'},
{ name: 'last block', value: 'lastBlock', description: 'CDSvariablesList.voiceFlowElements.lastBlock.description', src: '', icon:'perm_phone_msg'},
{ name: 'callId', value: 'callId', description: 'CDSvariablesList.voiceFlowElements.callId.description', src: '', icon:'perm_phone_msg'},
{ name: 'dnis', value: 'dnis', description: 'CDSvariablesList.voiceFlowElements.dnis.description', src: '', icon:'perm_phone_msg'},
{ name: 'ani', value: 'ani', description: 'CDSvariablesList.voiceFlowElements.ani.description', src: '', icon:'perm_phone_msg'},
]
}
]


export const leadPropertyList: Array<{ name: string, value: string, description?: string, src?: string, icon?: string}> = [
{ name: 'email', value: 'email' },
{ name: 'fullname', value: 'fullname' },
{ name: 'phone', value: 'phone' },
{ name: 'company', value: 'company' },
{ name: 'streetAddress', value: 'streetAddress' },
{ name: 'city', value: 'city' },
{ name: 'region', value: 'region' },
{ name: 'zipcode', value: 'zipcode' },
{ name: 'country', value: 'country' }
export const leadPropertyList: Array<{ name: string, value: string, disabled: boolean, description?: string, src?: string, icon?: string}> = [
{ name: 'email', value: 'email', disabled: false },
{ name: 'fullname', value: 'fullname', disabled: false },
{ name: 'phone', value: 'phone', disabled: false },
{ name: 'company', value: 'company', disabled: false },
{ name: 'streetAddress', value: 'streetAddress', disabled: false },
{ name: 'city', value: 'city', disabled: false },
{ name: 'region', value: 'region', disabled: false },
{ name: 'zipcode', value: 'zipcode', disabled: false },
{ name: 'country', value: 'country', disabled: false }
]
1 change: 1 addition & 0 deletions src/app/models/action-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ export class ActionGPTTask extends Action {
question: string;
assignReplyTo: string;
context: string;
history: boolean;
max_tokens: number;
temperature: number;
model: string;
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
"SelectDepartment": "Select department",
"RelatedKnowledgeBase": "Related Knowledge Base",
"ChooseALanguage": "Choose a language",
"Maximize":"Maximize",
"Minimize":"Minimize",
"BotsAddEditPage": {
"AddBot": "Add Bot",
"EditBot": "Edit Bot",
Expand Down
5 changes: 0 additions & 5 deletions src/assets/images/hours.svg

This file was deleted.

6 changes: 6 additions & 0 deletions src/assets/images/icons/fold.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/assets/images/icons/unfold.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 28ba666

Please sign in to comment.