Skip to content

Commit

Permalink
Merge branch 'master' into mirco
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/app/chatbot-design-studio/services/intent.service.ts
#	src/app/chatbot-design-studio/utils.ts
  • Loading branch information
Gabriele Panico committed Dec 11, 2023
2 parents 43bc8aa + 7a4a796 commit ce25dab
Show file tree
Hide file tree
Showing 177 changed files with 4,053 additions and 1,945 deletions.
51 changes: 51 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,57 @@
*Dario De Pascalis*
### **Copyrigth**: *Tiledesk SRL*

### 1.0.7-rc.6
- added: JSONparse function into cds-action-assing-variable-v2
- added: padding to scaleAndCenter bottom-right button icon
- bug-fixed: cds-action-assign-variable-v2 operand create double value obj
- bug-fixed: cds-attributes not save changes in input component
- bug-fixed: do not permit special chars when adding new variable


### 1.0.7-rc.5
- added: cds-action-assign-variable-v2

### 1.0.7-rc.4
- added: cdkDragPreview UI while dragging an action into the same block
- added: cds-globals component to manage global attributes variables into chatbot obj
- added: global variables to variablesList utils obj
- bug-fixed: patch in action reply buttons without UUIDV4
- bug-fixed: if clear operand variable inside cds-action-assign-variable, operation obj is not updated
- bug-fixed: if 'readonly' input variable is updated in parent cds-textarea component, tag badge is not created
### 1.0.7-rc.3
- added: close behaviour on mouse-tips modal close header icon
- bug fixed: close the add-actions-menu by clicking Backspace
- bug fixed: added an action from the floating menu
- bug fixed: changed the field type in the form email field
- bug-fixed: cannot be able to restart the same intent while testing it on widget page

### 1.0.7-rc.2
- added: mouse/trackpad tips
- added: ability to add action from floating 'add action' button on each block
- changed: cds-connector color on start and isLast intent elements
- changed: aligned component to new Regex for variables with {{<\var>}}
- changed: cds-action-assign-variable enable possibility to add custom text on operand2 property
- changed: cds-intent footer 'Add action' button UI
- changed: new services for updating an intent with multimple operations
- bug-fixed: variable-list userDefined expansion panel not opened from the second time

### 1.0.7-rc.1
- added: redirect to unauthorized page if signInWithCustomtoken response with 401 error
- bug-fixed: cannot delete chatbot profile image in PROD
- bug-fixed: action-web-requestv2 headers attributes variable not saved with double curly brackets
- bug-fixed: cannot delete first button into cds-action-reply elements
- bug-fixed: cannot clear header attriibutes on cds-web-request-v2

### 1.0.6 in PROD

### 1.0.6-rc.1
- added: Export/import redirect function on header menu option
- added: extension panel on variable list
- added: baseHref into angular.json
- added: imageRepoService abstract service to recover chatbot profile image
- bug-fixed: set default value for activeDetailSection

### 1.0.5 in PROD

### 1.0.5-rc.3
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ COPY . .

## Build the angular app in production mode and store the artifacts in dist folder

RUN npm run ng build --configuration="prod" --output-path=dist --base-href="./" --output-hashing=none --build-optimizer=true --vendor-chunk
RUN npm run ng build --configuration="prod" --output-path=dist


### STAGE 2: Setup ###
Expand Down
6 changes: 5 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
"src/favicon.ico",
"src/assets",
"src/design-studio-config-template.json",
"src/design-studio-config.json"
"src/design-studio-config.json",
"src/environments/real_data/cds-config-firebase.json",
"src/environments/real_data/cds-config-native-prod.json"
],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.css",
Expand Down Expand Up @@ -84,6 +86,7 @@
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"baseHref":"./",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
Expand All @@ -107,6 +110,7 @@
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"baseHref":"./",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
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.0.5",
"version": "1.0.7-rc.6",
"license": "MIT",
"homepage": "https://www.tiledesk.com",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const routes: Routes = [
{ path: 'project/:projectid/chatbot/:faqkbid', component: CdsDashboardComponent, canActivate:[AuthGuard, RoleGuard] },
{ path: 'project/:projectid/chatbot/:faqkbid/intent/:intent_id', component: CdsDashboardComponent, canActivate:[AuthGuard, RoleGuard] },

{ path: 'project/:projectid/unauthorized', component: UnauthorizedComponent },
{ path: 'project/unauthorized', component: UnauthorizedComponent },

// Wildcard route for a 404 page
{ path: '**', component: NotFoundComponent }
Expand Down
6 changes: 6 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { ScriptService } from 'src/chat21-core/providers/scripts/script.service'
import { NetworkService } from './services/network.service';
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
import { NetworkOfflineComponent } from './modals/network-offline/network-offline.component';
import { ImageRepoService } from 'src/chat21-core/providers/abstract/image-repo.service';

@Component({
selector: 'app-root',
Expand All @@ -37,13 +38,15 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
public translate: TranslateService,
public tiledeskAuthService: TiledeskAuthService,
public dialog: MatDialog,
private router: Router,
public appStorageService: AppStorageService,
public projectService: ProjectService,
// public uploadService: UploadService,
// public dashboardService: DashboardService,
private userService: UsersService,
private multiChannelService: MultichannelService,
private uploadService: UploadService,
private imageRepoService: ImageRepoService,
private scriptService: ScriptService,
private networkService: NetworkService,
){
Expand Down Expand Up @@ -275,6 +278,9 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
this.IS_ONLINE = true;
}).catch(error => {
this.logger.error('[APP-COMP] initAuthentication SIGNINWITHCUSTOMTOKEN error::', error)
if(error.status && error.status === 401){
this.router.navigate(['project/unauthorized'])
}
})
} else {
this.logger.warn('[APP-COMP] >>> I AM NOT LOGGED IN <<<')
Expand Down
7 changes: 6 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HomeComponent } from './components/home/home.component';
import { NotFoundComponent } from './components/not-found/not-found.component';
import { NetworkService } from './services/network.service';
import { ImageRepoService } from 'src/chat21-core/providers/abstract/image-repo.service';

// FACTORIES
export function createTranslateLoader(http: HttpClient) {
Expand Down Expand Up @@ -96,7 +97,6 @@ export function imageRepoFactory(appConfig: AppConfigService, http: HttpClient)
}

export function uploadFactory(http: HttpClient, appConfig: AppConfigService, appStorage: AppStorageService) {

const config = appConfig.getConfig()
if (config.uploadEngine === UPLOAD_ENGINE_NATIVE) {
const nativeUploadService = new NativeUploadService(http, appStorage)
Expand Down Expand Up @@ -178,6 +178,11 @@ export function uploadFactory(http: HttpClient, appConfig: AppConfigService, app
useFactory: uploadFactory,
deps: [HttpClient, AppConfigService, AppStorageService]
},
{
provide: ImageRepoService,
useFactory: imageRepoFactory,
deps: [AppConfigService, HttpClient]
},
{
provide: AppStorageService,
useClass: LocalSessionStorage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
type="text"
[placeholder]="'CDSCanvas.Key' | translate"
class="sx-input"
(blur)="onBlur($event)"
(ngModelChange)="onChangeAttributes(attribute, i)">

<cds-textarea id="value"
Expand All @@ -19,6 +20,7 @@
[minRow]="1" [maxRow]="1"
[placeholder]="'CDSCanvas.Value' | translate"
(selectedAttribute)="onSelectedAttribute($event,i, 'value')"
(blur)="onBlur($event)"
(changeTextarea)="onChangeTextarea($event, i)">
</cds-textarea>

Expand Down Expand Up @@ -64,7 +66,8 @@
class="dx-input"
[(ngModel)]="attribute.value"
placeholder="{{ 'CDSCanvas.Value' | translate }}"
(ngModelChange)="onChangeAttributes(attribute, i)">
(ngModelChange)="onChangeAttributes(attribute, i)"
(blur)="onBlur($event)">
</div>
</div>
</mat-expansion-panel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
overflow: hidden;
position: relative;
width: 150px;
height: 26px;
height: 28px;
border-radius: var(--base-radius) 0 0 var(--base-radius);
background: #f2f2f2;
font-weight: 500;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ export class AttributesComponent implements OnInit {
}
}


onBlur(event){
this.logger.log('[ATTRIBUTES] onBlur:: ', event);
this.setChangedAttributes();
}

private isValidJson(json) {
try {
JSON.parse(json);
Expand All @@ -66,10 +72,8 @@ export class AttributesComponent implements OnInit {
}

onChangeTextarea(event, index){
if(event){
this.newAttributes[index].value = event
}
this.setChangedAttributes();
this.newAttributes[index].value = event;
// this.setChangedAttributes();
}

onChangeAttributes(attribute: any, index: number){
Expand All @@ -87,7 +91,7 @@ export class AttributesComponent implements OnInit {
}
});
}
this.setChangedAttributes();
// this.setChangedAttributes();
}

private setChangedAttributes(){
Expand All @@ -97,8 +101,11 @@ export class AttributesComponent implements OnInit {
attributes[item.key] = item.value;
}
});
// console.log("------- >>>> ", this.attributes);
this.changeAttributes.emit(attributes);
if(JSON.stringify(attributes) !== JSON.stringify(this.attributes)){
console.log("[ATTRIBUTES] ------- >>>> ", this.attributes, attributes);
this.attributes = attributes;
this.changeAttributes.emit(attributes);
}
}

onClearSelectedAttribute(index){
Expand All @@ -122,7 +129,7 @@ export class AttributesComponent implements OnInit {
break;
}
case 'value':{
this.newAttributes[index].value += variableSelected.value;
this.newAttributes[index].value += '{{' + variableSelected.value + '}}'
if(!this.newAttributes[index].value){
this.newAttributes.push({key:"", value:""});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="tpl-info">
<i class="material-icons-outlined tpl-info-icon">help_outline</i>
<div class="tpl-info-text">
{{ 'CDSCanvas.TheAttributesNameMustBe' | translate }}
<span [innerHTML]="'CDSCanvas.TheAttributesNameMustBe' | translate"></span>
</div>
</div>
<div class="tpl-label-textarea">{{ 'CDSCanvas.AttributeName' | translate }}</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Component, OnInit, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { variableList } from '../../utils';
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';

@Component({
selector: 'cds-dialog',
Expand All @@ -10,7 +12,9 @@ import { variableList } from '../../utils';
export class DialogComponent implements OnInit {
btnDisabled: boolean = true;

userDefined = variableList.userDefined
userDefined = variableList.find(el => el.key ==='userDefined').elements

private logger: LoggerService = LoggerInstance.getInstance();

constructor(
public dialogRef: MatDialogRef<DialogComponent>,
Expand All @@ -23,20 +27,22 @@ export class DialogComponent implements OnInit {
onChangeTextInput($event):void {
const regexPattern = "/^[a-zA-Z0-9_]*$/";
let REGEX = new RegExp(regexPattern.replace(/\//gi, ''));
// this.logger.log('[TILEBOT-EDIT-ADD] checkFields nameRGEX REGEX ', REGEX)
this.logger.log('[TILEBOT-EDIT-ADD] checkFields nameRGEX REGEX ', REGEX, REGEX.test(this.data.text))

let exist = this._checkIfExist(this.data.text)
if(exist)
this.btnDisabled = true;
else
this.btnDisabled = false;

if(REGEX.test(this.data.text) && this.data.text !== ''){
this.btnDisabled = false;
} else {
this.btnDisabled = true;
}


let exist = this._checkIfExist(this.data.text)
if(exist)
this.btnDisabled = true;
else
this.btnDisabled = false;


}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
@import "./src/assets/sass/cds/_variables.scss";

$text-color: $blu;
$icon-color: $gray-light-01;
$text-hover-color: $blu;
$icon-hover-color: $blu;

:host {
--text-color: #{$blu};
--icon-color: #{$gray-light-01};
--text-hover-color: #{$blu};
--icon-hover-color: #{$blu};
}

#panel_actions_div{
padding: 6px;
Expand All @@ -29,13 +32,13 @@ $icon-hover-color: $blu;

span.material-icons-outlined,
img{
color: $text-hover-color;
color: var(--text-hover-color);
filter: brightness(0) saturate(100%) invert(35%) sepia(48%) saturate(441%) hue-rotate(183deg) brightness(97%) contrast(88%);
cursor: pointer;
}

.menu-btn-text{
color: $text-hover-color
color: var(--text-hover-color);
}
}

Expand All @@ -49,15 +52,15 @@ $icon-hover-color: $blu;
img{
width: 16px;
font-size: 16px;
color: $icon-color;
color: var(--icon-color);
filter: brightness(0) saturate(100%) invert(96%) sepia(0%) saturate(504%) hue-rotate(151deg) brightness(92%) contrast(88%);
}


}
.menu-btn-text{
display: inline-flex;
color: $text-color;
color: var(--text-color);
padding: 0;
vertical-align: middle;
font-size: 10px;
Expand All @@ -73,5 +76,5 @@ $icon-hover-color: $blu;
}

.current-user{
color: $icon-color
color: var(--icon-color);
}
Loading

0 comments on commit ce25dab

Please sign in to comment.