Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriele Panico committed Oct 10, 2023
1 parent 7b4b814 commit 70a53a5
Show file tree
Hide file tree
Showing 9 changed files with 131 additions and 105 deletions.
2 changes: 1 addition & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {


goToDashboardLogin(){
let DASHBOARD_URL = this.appConfigService.getConfig().dashboardUrl + '#/login'
let DASHBOARD_URL = this.appConfigService.getConfig().dashboardBaseUrl + '#/login'
const myWindow = window.open(DASHBOARD_URL, '_self');
myWindow.focus();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export class CdsActionAskgptComponent implements OnInit {
// }

goToKNB(){
let url = this.appConfigService.getConfig().DASHBOARD_BASE_URL + 'dashboard/#/project/' + this.project_id +'/knowledge-bases'
let url = this.appConfigService.getConfig().dashboardBaseUrl + 'dashboard/#/project/' + this.project_id +'/knowledge-bases'
window.open(url, '_blank')
}

Expand Down
87 changes: 0 additions & 87 deletions src/app/services/faq-kb.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import { AppStorageService } from 'src/chat21-core/providers/abstract/app-storag
export class FaqKbService {

SERVER_BASE_PATH: string;
TEMPLATES_URL: string;
COMMUNITY_TEMPLATES_URL: string;
FAQKB_URL: any;

private tiledeskToken: string;
Expand All @@ -39,74 +37,6 @@ export class FaqKbService {
this.tiledeskToken = this.appStorageService.getItem('tiledeskToken');
this.project_id = projectId;
this.FAQKB_URL = this.SERVER_BASE_PATH + this.project_id + '/faq_kb/'
this.TEMPLATES_URL = this.appConfigService.getConfig().templatesUrl
this.COMMUNITY_TEMPLATES_URL = this.appConfigService.getConfig().communityTemplatesUrl
}

getTemplates() {
// 'Authorization': this.TOKEN
const httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json',
})
};
// const url = "https://chatbot-templates.herokuapp.com/chatbots/public/templates/"
const url = this.TEMPLATES_URL

this.logger.log('[GET-TMPLT][FAQ-KB.SERV] - GET-TMPLT - URL ', url);
return this._httpClient.get(url, httpOptions)
}

getChatbotTemplateById(chatbotid) {
// 'Authorization': this.TOKEN
const httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json',
})
};
// const url = "https://chatbot-templates.herokuapp.com/chatbots/public/templates/"
const url = this.TEMPLATES_URL + '/windows/' + chatbotid

// console.log('[GET-TMPLT][FAQ-KB.SERV] - GET-CHATBOT-TEMPLATE-BY-ID - URL ', url);
return this._httpClient.get(url, httpOptions)
}

// const url = "https://chatbot-templates.herokuapp.com/chatbots/public/templates/"
// const url = "https://chatbot-templates.herokuapp.com/chatbots/public/community"
getCommunityTemplates() {
// 'Authorization': this.TOKEN
const httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json',
})
};

const url = this.COMMUNITY_TEMPLATES_URL

this.logger.log('[GET-TMPLT][FAQ-KB.SERV] - GET-TMPLT - URL ', url);
return this._httpClient.get(url, httpOptions)
}

getCommunityTemplateDetail(templateid) {

const url = this.TEMPLATES_URL + '/windows/' + templateid

this.logger.log('[GET-TMPLT][FAQ-KB.SERV] - GET-COMMUNITY-TMPLT-DTLS - URL ', url);
return this._httpClient.get(url)
}
// https://chatbot-templates-v3.herokuapp.com/chatbots/public/templates
// https://chatbot-templates-app-v3.herokuapp.com/chatbots/public/templates/windows/63e17ccb426521001330d8d0

getTemplateById(botid) {
// 'Authorization': this.TOKEN
const httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json',
})
};
// const url = "https://chatbot-templates.herokuapp.com/chatbots/public/templates/" + botid
const url = this.TEMPLATES_URL + botid
return this._httpClient.get(url, httpOptions)
}

installTemplate(botid: string, projectid: string, ispublic: boolean, landingprojectid) {
Expand Down Expand Up @@ -488,23 +418,6 @@ export class FaqKbService {
return this._httpClient.patch(url, body, httpOptions)
}

searchInCommunityTemplates(query) {
const httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json',
'Authorization': this.project_id
})
};
// https://chatbot-templates-app-v3.herokuapp.com/chatbots/public/community
// https://chatbot-templates-app-v3.herokuapp.com/chatbots/public/community?text=lead
let url = this.COMMUNITY_TEMPLATES_URL + '?text=' + query;
this.logger.log('[FAQ-KB.SERV] - getDialogflowBotCredetial GET URL', url);

return this._httpClient.get(url, httpOptions)
}



public patchAttributes(id: string, attributes: any): Observable<FaqKb> {
const httpOptions = {
headers: new HttpHeaders({
Expand Down
24 changes: 24 additions & 0 deletions src/design-studio-config-template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"t2y12PruGU9wUtEGzBJfolMIgK": "${FEATURES_TOKEN}",
"widgetBaseUrl": "${WIDGET_LOCATION}",
"apiUrl": "${SERVER_BASE_URL}",
"wsUrl": "${WS_URL}",
"wsUrlRel": "${WS_URL_RELATIVE}",
"brandSrc": "${BRAND_SRC}",
"globalRemoteJSSrc": "${REMOTE_JS_SRC}",
"dashboardBaseUrl": "${DASHBOARD_URL}",
"uploadEngine": "${UPLOAD_ENGINE}",
"baseImageUrl": "${API_BASEIMAGE_URL}",
"logLevel": "${LOG_LEVEL}",
"chatStoragePrefix": "${CHAT_STORAGE_PREFIX}",
"firebase": {
"apiKey": "${FIREBASE_APIKEY}",
"authDomain": "${FIREBASE_AUTHDOMAIN}",
"databaseURL": "${FIREBASE_DATABASEURL}",
"projectId": "${FIREBASE_PROJECT_ID}",
"storageBucket": "${FIREBASE_STORAGEBUCKET}",
"messagingSenderId": "${FIREBASE_MESSAGINGSENDERID}",
"appId": "${FIREBASE_APP_ID}",
"vapidKey": "${FIREBASE_VAPID}"
}
}
24 changes: 24 additions & 0 deletions src/design-studio-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"t2y12PruGU9wUtEGzBJfolMIgK": "${FEATURES_TOKEN}",
"widgetBaseUrl": "${WIDGET_LOCATION}",
"apiUrl": "${SERVER_BASE_URL}",
"wsUrl": "${WS_URL}",
"wsUrlRel": "${WS_URL_RELATIVE}",
"brandSrc": "${BRAND_SRC}",
"globalRemoteJSSrc": "${REMOTE_JS_SRC}",
"dashboardBaseUrl": "${DASHBOARD_URL}",
"uploadEngine": "${UPLOAD_ENGINE}",
"baseImageUrl": "${API_BASEIMAGE_URL}",
"logLevel": "${LOG_LEVEL}",
"chatStoragePrefix": "${CHAT_STORAGE_PREFIX}",
"firebase": {
"apiKey": "${FIREBASE_APIKEY}",
"authDomain": "${FIREBASE_AUTHDOMAIN}",
"databaseURL": "${FIREBASE_DATABASEURL}",
"projectId": "${FIREBASE_PROJECT_ID}",
"storageBucket": "${FIREBASE_STORAGEBUCKET}",
"messagingSenderId": "${FIREBASE_MESSAGINGSENDERID}",
"appId": "${FIREBASE_APP_ID}",
"vapidKey": "${FIREBASE_VAPID}"
}
}
34 changes: 34 additions & 0 deletions src/environments/environment.pre.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
export const environment = {
production: false,
t2y12PruGU9wUtEGzBJfolMIgK: 'CHANGEIT',
VERSION: require('../../package.json').version,
remoteConfig: false,
remoteConfigUrl: './design-studio-config.json',
apiUrl: 'CHANGEIT',
widgetBaseUrl: 'CHANGEIT',
dashboardBaseUrl: 'CHANGEIT',
wsUrl: 'ws://localhost:3000/',
uploadEngine: 'native',
baseImageUrl: 'CHANGEIT',
logLevel: 'error',
storage_prefix: "CHANGEIT",
firebaseConfig: {
apiKey: 'CHANGEIT',
authDomain: 'CHANGEIT',
databaseURL: 'CHANGEIT',
projectId: 'CHANGEIT',
storageBucket: 'CHANGEIT',
messagingSenderId: 'CHANGEIT',
appId: 'CHANGEIT',
vapidKey: 'CHANGEIT'
}
};









24 changes: 23 additions & 1 deletion src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
export const environment = {
production: true
production: true,
t2y12PruGU9wUtEGzBJfolMIgK: 'CHANGEIT',
VERSION: require('../../package.json').version,
remoteConfig: false,
remoteConfigUrl: './design-studio-config.json',
apiUrl: 'CHANGEIT',
widgetBaseUrl: 'CHANGEIT',
dashboardBaseUrl: 'CHANGEIT',
wsUrl: 'ws://localhost:3000/',
uploadEngine: 'native',
baseImageUrl: 'CHANGEIT',
logLevel: 'error',
storage_prefix: "CHANGEIT",
firebaseConfig: {
apiKey: 'CHANGEIT',
authDomain: 'CHANGEIT',
databaseURL: 'CHANGEIT',
projectId: 'CHANGEIT',
storageBucket: 'CHANGEIT',
messagingSenderId: 'CHANGEIT',
appId: 'CHANGEIT',
vapidKey: 'CHANGEIT'
}
};
39 changes: 24 additions & 15 deletions src/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
// This file can be replaced during build by using the `fileReplacements` array.
// `ng build` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.

export const environment = {
production: false
};

/*
* For easier debugging in development mode, you can import the following file
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
*
* This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown.
*/
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
production: false,
t2y12PruGU9wUtEGzBJfolMIgK: 'CHANGEIT',
VERSION: require('../../package.json').version,
remoteConfig: false,
remoteConfigUrl: './design-studio-config.json',
apiUrl: 'http://localhost:3000/',
widgetBaseUrl: 'http://localhost:4200/',
dashboardBaseUrl: 'http://localhost:4200/',
wsUrl: 'ws://localhost:3000/',
uploadEngine: 'native',
baseImageUrl: 'CHANGEIT',
logLevel: 'error',
storage_prefix: "dashboard_sv6",
firebaseConfig: {
apiKey: 'CHANGEIT',
authDomain: 'CHANGEIT',
databaseURL: 'CHANGEIT',
projectId: 'CHANGEIT',
storageBucket: 'CHANGEIT',
messagingSenderId: 'CHANGEIT',
appId: 'CHANGEIT',
vapidKey: 'CHANGEIT'
}
};
Binary file removed src/favicon.ico
Binary file not shown.

0 comments on commit 70a53a5

Please sign in to comment.