Skip to content

Commit

Permalink
Merge branch 'master_PROD' into master-pre
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriele Panico committed Oct 11, 2024
2 parents fa60e2f + 9b775f1 commit fa94230
Show file tree
Hide file tree
Showing 40 changed files with 140 additions and 41 deletions.
9 changes: 9 additions & 0 deletions src/app/chatbot-design-studio/BrandResources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ export class BrandResources {
var icon = document.querySelector("link[rel~='icon']") as HTMLElement;
icon.setAttribute('href', this.brand['FAVICON_URL'])

/** META sharing ELEMENTS */
if(this.brand['META_SHARE_INFO'] && this.brand['META_SHARE_INFO'].length > 0){
Object.keys(this.brand['META_SHARE_INFO']).forEach(key => {
var meta = document.querySelector("meta[property^='og:"+key.toLowerCase()+"']") as HTMLElement;
meta.setAttribute('content', this.brand['META_SHARE_INFO'][key])
})
}


/** CSS */
document.documentElement.style.setProperty('--base-brand-color', this.brand['BRAND_PRIMARY_COLOR']);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CommonModule } from '@angular/common';
import { MaterialModule } from 'src/app/shared/material.module';
import { HttpClient } from '@angular/common/http';
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { RouterModule, Routes } from '@angular/router';
import { Resolve, RouterModule, Routes } from '@angular/router';
import { SharedModule } from 'src/app/shared/shared.module';
import { CdsBaseElementModule } from 'src/app/shared/cds-base-element.module';
import { ChangeBotLangModalComponent } from 'src/app/modals/change-bot-lang/change-bot-lang.component';
Expand All @@ -31,12 +31,14 @@ import { PanelIntentControlsComponent } from './cds-intent/panel-intent-controls
import { PanelIntentHeaderComponent } from './cds-intent/panel-intent-header/panel-intent-header.component';
import { CdsVoiceActionsModule } from './actions/list-voice/cds-voice-actions.module';
import { PreloadBarComponent } from 'src/app/chatbot-design-studio/cds-base-element/preload-bar/preload-bar.component';
import { ImagePreloaderResolver } from 'src/app/resolver/image.resolver';


const routes: Routes = [
{
path: '',
component: CdsCanvasComponent,
resolve: { images: ImagePreloaderResolver}
}
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<div>{{'WatchVideo' | translate}}</div>
</button>
</div>
</div>
</div>
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,11 @@ $base-padding: 6px;
line-height: 18px;
list-style: none;
// overflow: hidden;
padding: 0;
padding: 0 10px;
// box-shadow: #1321440a 0 12px 24px, #1321440a 0 8px 12px, #13214405 0 4px 4px, #13214403 0 2px 2px, #13214403 0 1px 1px, #11316008 0 0, #1131600f 0 0 0 1px;
border-radius: 8px;
background: #181f29;
border-radius: 0px;
border: 0px;
background: transparent;
will-change: transform;
animation: .15s ease 0s 1 normal none running fadein, .15s ease 0s 1 normal none running movein, .1s ease 0s 1 normal none running scaleY;
margin: 0;
Expand Down Expand Up @@ -257,6 +258,9 @@ $base-padding: 6px;
gap: 8px;
flex-direction: column;

border-radius: 8px;
background: #181f29;

span{
margin: 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class CdsPanelActionsComponent implements OnInit {
indexDrag: number;

hoveredElement: any;
positionMenu: any = {'x': 190, 'y': 0 };
positionMenu: any = {'x': 200, 'y': 0 };
isOpen: boolean = false;
// dropList: CdkDropList;
// connectedLists: CdkDropList[];
Expand Down Expand Up @@ -141,7 +141,7 @@ export class CdsPanelActionsComponent implements OnInit {
// let x = e.offsetLeft;
let y = e.offsetTop;
this.isOpen = true;
this.positionMenu = {'x': 190, 'y': y }
this.positionMenu = {'x': 200, 'y': y }
}, 0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ svg {
#menuElement {
min-width: 100px;
max-width: 400px;
width: 190px;
width: 210px;
color: var(--blu);
font-size: 15px;
line-height: 18px;
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 @@ -82,7 +82,7 @@ export function getKeyByValue(value, keys) {

export const ACTIONS_LIST: {[key: string]: {name: string, category: TYPE_ACTION_CATEGORY, type: TYPE_ACTION | TYPE_ACTION_VXML, src: string, status: 'active' | 'inactive' | 'beta', plan?: PLAN_NAME, badge?: string, doc?: string, disabled?: boolean}}= {
REPLY : { name: 'CDSActionList.NAME.Reply', category: TYPE_ACTION_CATEGORY.MOST_USED, type: TYPE_ACTION.REPLY, src:"assets/images/actions/reply.svg", status: "active" , doc: "CDSActionList.DOC.Reply", },
REPLYV2 : { name: 'CDSActionList.NAME.ReplyV2', category: TYPE_ACTION_CATEGORY.MOST_USED, type: TYPE_ACTION.REPLYV2, src:"assets/images/actions/reply_v2.svg", status: "active" , badge: 'NEW', doc: "CDSActionList.DOC.ReplyV2", },
REPLYV2 : { name: 'CDSActionList.NAME.ReplyV2', category: TYPE_ACTION_CATEGORY.MOST_USED, type: TYPE_ACTION.REPLYV2, src:"assets/images/actions/reply_v2.svg", status: "active" , doc: "CDSActionList.DOC.ReplyV2", },
RANDOM_REPLY : { name: 'CDSActionList.NAME.RandomReply', category: TYPE_ACTION_CATEGORY.MOST_USED, type: TYPE_ACTION.RANDOM_REPLY, src:"assets/images/actions/random_reply.svg", status: "active", doc: "CDSActionList.DOC.RandomReply" },
AGENT : { name: 'CDSActionList.NAME.AgentHandoff', category: TYPE_ACTION_CATEGORY.MOST_USED, type: TYPE_ACTION.AGENT, src:"assets/images/actions/agent_handoff.svg", status: "active", doc: "CDSActionList.DOC.AgentHandoff" },
CLOSE : { name: 'CDSActionList.NAME.Close', category: TYPE_ACTION_CATEGORY.MOST_USED, type: TYPE_ACTION.CLOSE, src:"assets/images/actions/close.svg", status: "active", doc: "CDSActionList.DOC.Close" },
Expand Down
16 changes: 16 additions & 0 deletions src/app/resolver/image.resolver.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';

import { ImagePreloaderResolver } from './image.resolver';

describe('ImageResolver', () => {
let resolver: ImagePreloaderResolver;

beforeEach(() => {
TestBed.configureTestingModule({});
resolver = TestBed.inject(ImagePreloaderResolver);
});

it('should be created', () => {
expect(resolver).toBeTruthy();
});
});
68 changes: 68 additions & 0 deletions src/app/resolver/image.resolver.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { Injectable } from '@angular/core';
import {
Router, Resolve,
RouterStateSnapshot,
ActivatedRouteSnapshot
} from '@angular/router';
import { Observable, of } from 'rxjs';

@Injectable({
providedIn: 'root'
})
export class ImagePreloaderResolver implements Resolve<boolean> {

resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean> {

const DOC_BASE_URL = 'https://assets-tiledesk.s3.eu-west-1.amazonaws.com/images/cds-actions/'

const imageUrls = [
DOC_BASE_URL+'AGENT.png',
DOC_BASE_URL+'ASKGPT.png',
DOC_BASE_URL+'ASSIGN_VARIABLE.png',
DOC_BASE_URL+'BREVO.png',
DOC_BASE_URL+'CAPTURE_USER_REPLY.png',
DOC_BASE_URL+'CHANGE_DEPARTMENT.png',
DOC_BASE_URL+'CLOSE.png',
DOC_BASE_URL+'CODE.png',
DOC_BASE_URL+'CONDITION.png',
DOC_BASE_URL+'CUSTOMERIO.png',
DOC_BASE_URL+'DELETE_VARIABLE.png',
DOC_BASE_URL+'EMAIL.png',
DOC_BASE_URL+'GPT_ASSISTANT.png',
DOC_BASE_URL+'GPT_TASK.png',
DOC_BASE_URL+'HIDE_MESSAGE',
DOC_BASE_URL+'HUBSPOT.png',
DOC_BASE_URL+'JSON_CONDITION.png',
DOC_BASE_URL+'LEAD_UPDATE.png',
DOC_BASE_URL+'MAKE.png',
DOC_BASE_URL+'N8N.png',
DOC_BASE_URL+'ONLINE_AGENTS.png',
DOC_BASE_URL+'OPEN_HOURS.png',
DOC_BASE_URL+'QAPLA.png',
DOC_BASE_URL+'RANDOM_REPLY.png',
DOC_BASE_URL+'REPLACE_BOT.png',
DOC_BASE_URL+'REPLY.png',
DOC_BASE_URL+'WAIT.png',
DOC_BASE_URL+'WEB_REQUESTV2.png',
DOC_BASE_URL+'WHATSAPP_ATTRIBUTE.png',
DOC_BASE_URL+'WHATSAPP_STATIC.png',


];

return Promise.all(
imageUrls.map(url => this.preloadImage(url))
).then(() => { return true});
}

private preloadImage(url: string): Promise<true> {
return new Promise((resolve) => {
const img = new Image();
img.src = url;

img.onload = () => resolve(true);
img.onerror = () => resolve(true);
});
}

}
Loading

0 comments on commit fa94230

Please sign in to comment.