Skip to content

Commit

Permalink
Commented log
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicola Lanzilotto committed Dec 22, 2023
1 parent c438668 commit d2855da
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions src/app/auth/signin/signin.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class SigninComponent implements OnInit {
}

ngOnInit() {
console.log('[SIGN-IN] ON INIT !!!! ')
// console.log('[SIGN-IN] ON INIT !!!! ')
this.getOSCODE();
// this.redirectIfLogged();
// this.widgetReInit()
Expand All @@ -102,7 +102,7 @@ export class SigninComponent implements OnInit {

getStoredRoute() {
this.storedRoute = this.localDbService.getFromStorage('wannago')
console.log('[SIGN-IN] storedRoute ', this.storedRoute)
this.logger.log('[SIGN-IN] storedRoute ', this.storedRoute)
if (this.storedRoute) {
this.EXIST_STORED_ROUTE = true
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export class PanelIntentListComponent implements OnInit {
// }

onSelectIntent(intent: Intent, index: number) {
console.log('onSelectIntent:: ', intent, index);
// console.log('onSelectIntent:: ', intent, index);
this.idSelectedIntent = index;
this.selectedIntent = intent;
this.selectIntent.emit(intent);
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/auth.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ export class AuthGuard implements CanActivate {
// console.log('[AUTH-GUARD] SSO - CAN ACTIVATE queryParams HAS_JWT: NOT HAS - navigate to login ');
// console.log('[AUTH-GUARD] - CAN ACTIVATE queryParams HAS_JWT: NOT HAS - wanna go url ', url);
const storedRoute = this.localDbService.getFromStorage('wannago')
console.log('[AUTH-GUARD] - CAN ACTIVATE queryParams HAS_JWT: NOT HAS - wanna go url storedRoute', storedRoute);
// console.log('[AUTH-GUARD] - CAN ACTIVATE queryParams HAS_JWT: NOT HAS - wanna go url storedRoute', storedRoute);

if (!storedRoute) {
const URLtoStore = url;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class CreateProjectComponent extends WidgetSetUpBaseComponent implements
if (this.router.url.startsWith('/create-project-itw/')) {

this.CREATE_PRJCT_FOR_TEMPLATE_INSTALLATION = true
console.log('[WIZARD - CREATE-PRJCT] CREATE_PRJCT_FOR_TEMPLATE_INSTALLATION ', this.CREATE_PRJCT_FOR_TEMPLATE_INSTALLATION)
// console.log('[WIZARD - CREATE-PRJCT] CREATE_PRJCT_FOR_TEMPLATE_INSTALLATION ', this.CREATE_PRJCT_FOR_TEMPLATE_INSTALLATION)
this.browser_lang = this.translate.getBrowserLang();

if (tranlatedLanguage.includes(this.browser_lang)) {
Expand Down Expand Up @@ -141,7 +141,7 @@ export class CreateProjectComponent extends WidgetSetUpBaseComponent implements

this.projectService.createProject(this.project_name, 'create-project')
.subscribe((project) => {
console.log('[WIZARD - CREATE-PRJCT] POST DATA PROJECT RESPONSE ', project);
// console.log('[WIZARD - CREATE-PRJCT] POST DATA PROJECT RESPONSE ', project);
if (project) {
this.new_project = project
// WHEN THE USER SELECT A PROJECT ITS ID IS SEND IN THE PROJECT SERVICE THET PUBLISHES IT
Expand Down Expand Up @@ -340,7 +340,7 @@ export class CreateProjectComponent extends WidgetSetUpBaseComponent implements
// this.faqKbService.getTemplates().subscribe((res: any) => {
this.faqKbService.getChatbotTemplateById(botid).subscribe((res: any) => {
if (res) {
console.log('[WIZARD - CREATE-PRJCT] GET TEMPLATES - RES ', res)
// console.log('[WIZARD - CREATE-PRJCT] GET TEMPLATES - RES ', res)

this.template = res;
this.botname = res['name']
Expand All @@ -350,7 +350,7 @@ export class CreateProjectComponent extends WidgetSetUpBaseComponent implements
// }
// if ( this.templates && this.templates['name']) {
// this.botname = this.templates['name']
// // console.log('[INSTALL-TEMPLATE] GET TEMPLATES - SELECTED TEMPALTES > botname', this.botname)
// console.log('[INSTALL-TEMPLATE] GET TEMPLATES - SELECTED TEMPALTES > botname', this.botname)
// }

if (!isDevMode()) {
Expand Down Expand Up @@ -406,7 +406,7 @@ export class CreateProjectComponent extends WidgetSetUpBaseComponent implements

forkTemplate() {
this.faqKbService.installTemplate(this.template._id, this.id_project, true, this.template._id).subscribe((res: any) => {
console.log('[INSTALL-TEMPLATE] - FORK TEMPLATE RES', res);
// console.log('[INSTALL-TEMPLATE] - FORK TEMPLATE RES', res);
this.botid = res.bot_id

}, (error) => {
Expand Down Expand Up @@ -470,7 +470,7 @@ export class CreateProjectComponent extends WidgetSetUpBaseComponent implements

getFaqKbById(botid) {
this.faqKbService.getFaqKbById(botid).subscribe((faqkb: any) => {
console.log('[INSTALL-TEMPLATE] GET FAQ-KB (DETAILS) BY ID ', faqkb);
// console.log('[INSTALL-TEMPLATE] GET FAQ-KB (DETAILS) BY ID ', faqkb);

this.botLocalDbService.saveBotsInStorage(botid, faqkb);
this.goToBotDetails(faqkb)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ export class GetStartChatbotForkComponent implements OnInit {
}

getLoggedUser() {
console.log('[GET START CHATBOT FORK] getLoggedUser called')
// console.log('[GET START CHATBOT FORK] getLoggedUser called')
this.auth.user_bs
.subscribe((user) => {
if (user) {
this.user = user;
console.log('[GET START CHATBOT FORK] - user ', this.user)
// console.log('[GET START CHATBOT FORK] - user ', this.user)
}
});
}
Expand Down Expand Up @@ -104,12 +104,12 @@ export class GetStartChatbotForkComponent implements OnInit {
// console.log('[GET START CHATBOT FORK] storedRoute ', storedRoute)

const storedRoute = decodeURIComponent(this.router.url);
console.log('[GET START CHATBOT FORK] _storedRoute ', storedRoute)
// console.log('[GET START CHATBOT FORK] _storedRoute ', storedRoute)
if (storedRoute) {
// storedRoute.split('/')
let storedRouteSegments = storedRoute.split('/')

console.log('[GET START CHATBOT FORK] storedRouteSegment ', storedRouteSegments)
// console.log('[GET START CHATBOT FORK] storedRouteSegment ', storedRouteSegments)
let secondStoredRouteSegment = storedRouteSegments[2]

// this.logger.log('[GET START CHATBOT FORK] secondStoredRouteSegment ', secondStoredRouteSegment)
Expand All @@ -120,7 +120,7 @@ export class GetStartChatbotForkComponent implements OnInit {

// console.log('[GET START CHATBOT FORK] secondStoredRouteSegments ', secondStoredRouteSegments)
this.botid = secondStoredRouteSegments[0]
console.log('[GET START CHATBOT FORK] botid ', this.botid)
// console.log('[GET START CHATBOT FORK] botid ', this.botid)
const _templateNameOnSite = secondStoredRouteSegments[1];
try {
this.templateNameOnSite = decodeURI(_templateNameOnSite)
Expand All @@ -135,7 +135,7 @@ export class GetStartChatbotForkComponent implements OnInit {
// console.log('[GET START CHATBOT FORK] GET-CHATBOT-TEMPLATE-BY-ID - RES ', res)
if (res) {
this.selectedTemplate = res
console.log('[GET START CHATBOT FORK] GET-CHATBOT-TEMPLATE-BY-ID - selectedTemplate ', this.selectedTemplate)
// console.log('[GET START CHATBOT FORK] GET-CHATBOT-TEMPLATE-BY-ID - selectedTemplate ', this.selectedTemplate)
this.botname = res['name']

if (this.selectedTemplate && this.selectedTemplate['bigImage']) {
Expand All @@ -157,27 +157,27 @@ export class GetStartChatbotForkComponent implements OnInit {

getProjects(projectid?: string) {
this.projectService.getProjects().subscribe((projects: any) => {
console.log('[GET START CHATBOT FORK] - GET PROJECTS ', projects);
// console.log('[GET START CHATBOT FORK] - GET PROJECTS ', projects);
if (projects) {
this.projects = projects;
if (this.projects && this.projects.length === 1) {
console.log('[GET START CHATBOT FORK] USE-CASE PROJECTS NO = 1')
// console.log('[GET START CHATBOT FORK] USE-CASE PROJECTS NO = 1')
this.projectName = this.projects[0].id_project.name
this.selectedProjectId = this.projects[0].id_project._id
console.log('[GET START CHATBOT FORK] this.project ', this.selectedProjectId)
// console.log('[GET START CHATBOT FORK] this.project ', this.selectedProjectId)
this.project = this.projects[0].id_project;
console.log('[GET START CHATBOT FORK] this.project ', this.project)
// console.log('[GET START CHATBOT FORK] this.project ', this.project)
this.buildPlanName(this.project)
this.trackGroup(this.selectedProjectId)
}
if (projectid) {
console.log('[GET START CHATBOT FORK] USE-CASE PROJECTS NO > 1' , projectid)
// console.log('[GET START CHATBOT FORK] USE-CASE PROJECTS NO > 1' , projectid)
if (this.projects && this.projects.length > 1) {
console.log('[GET START CHATBOT FORK] USE-CASE PROJECTS NO > 1')
// console.log('[GET START CHATBOT FORK] USE-CASE PROJECTS NO > 1')
projects.forEach(project => {
if (project.id_project.id === projectid) {
this.project = project.id_project
console.log('[GET START CHATBOT FORK] this.project ', this.project)
// console.log('[GET START CHATBOT FORK] this.project ', this.project)
this.projectPlan = project.id_project.profile.name
this.projectName = project.id_project.name;
this.selectedProjectId = projectid
Expand Down Expand Up @@ -239,10 +239,10 @@ export class GetStartChatbotForkComponent implements OnInit {


forkTemplate() {
console.log('[GET START CHATBOT FORK] selectedTemplate ',this.selectedTemplate._id)
console.log('[GET START CHATBOT FORK] selectedProjectId ',this.selectedProjectId)
// console.log('[GET START CHATBOT FORK] selectedTemplate ',this.selectedTemplate._id)
// console.log('[GET START CHATBOT FORK] selectedProjectId ',this.selectedProjectId)
this.faqKbService.installTemplate(this.selectedTemplate._id, this.selectedProjectId, true, this.selectedTemplate._id).subscribe((res: any) => {
console.log('[GET START CHATBOT FORK] - FORK TEMPLATE RES', res);
// console.log('[GET START CHATBOT FORK] - FORK TEMPLATE RES', res);
this.botid = res.bot_id

}, (error) => {
Expand All @@ -262,7 +262,7 @@ export class GetStartChatbotForkComponent implements OnInit {

getFaqKbById(botid) {
this.faqKbService.getFaqKbByIdAndProjectId(this.selectedProjectId , botid).subscribe((faqkb: any) => {
console.log('[GET START CHATBOT FORK] GET FAQ-KB (DETAILS) BY ID ', faqkb);
// console.log('[GET START CHATBOT FORK] GET FAQ-KB (DETAILS) BY ID ', faqkb);

this.botLocalDbService.saveBotsInStorage(botid, faqkb);
this.goToBotDetails(faqkb)
Expand Down Expand Up @@ -292,9 +292,9 @@ export class GetStartChatbotForkComponent implements OnInit {
this.logger.error('Wizard Get start chatbot fork page error', err);
}
if (!this.user) {
console.log('[GET START CHATBOT FORK] this.user', this.user)
// console.log('[GET START CHATBOT FORK] this.user', this.user)
this.user = localStorage.getItem('user');
console.log('[GET START CHATBOT FORK] stored user', this.user)
// console.log('[GET START CHATBOT FORK] stored user', this.user)
}

let userFullname = ''
Expand Down Expand Up @@ -394,7 +394,7 @@ export class GetStartChatbotForkComponent implements OnInit {
buildPlanName(project) {
if (project.profile.extra3) {
this.appSumoProfile = APP_SUMO_PLAN_NAME[project.profile.extra3]
console.log('[GET START CHATBOT FORK] Find Current Project appSumoProfile ', this.appSumoProfile)
// console.log('[GET START CHATBOT FORK] Find Current Project appSumoProfile ', this.appSumoProfile)
}

if (project.profile.type === 'free') {
Expand Down
8 changes: 4 additions & 4 deletions src/app/services/faq-kb.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export class FaqKbService {
// / (dovrebbe funzionare anche con POST ../PROJECT_ID/bots/fork/ID_FAQ_FB/)
// const url = this.SERVER_BASE_PATH + "635b97cc7d7275001a2ab3e0/bots/fork/" + botid;
const url = this.SERVER_BASE_PATH + projectid + "/faq_kb/fork/" + botid + "?public=" + ispublic + "&projectid=" + projectid;
console.log('[BOT-CREATE][FAQ-KB.SERV] - FORK - URL ', url);
// console.log('[BOT-CREATE][FAQ-KB.SERV] - FORK - URL ', url);

return this._httpClient
.post(url, null, httpOptions)
Expand Down Expand Up @@ -272,7 +272,7 @@ export class FaqKbService {
};

let url = this.FAQKB_URL + id;
console.log('[FAQ-KB.SERV] - GET FAQ-KB BY ID - URL', url);
// console.log('[FAQ-KB.SERV] - GET FAQ-KB BY ID - URL', url);
return this._httpClient
.get<FaqKb[]>(url, httpOptions)
}
Expand All @@ -286,10 +286,10 @@ export class FaqKbService {
})
};

console.log('[FAQ-KB.SERV] - GET FAQ-KB BY ID - this.SERVER_BASE_PATH', this.SERVER_BASE_PATH);
// console.log('[FAQ-KB.SERV] - GET FAQ-KB BY ID - this.SERVER_BASE_PATH', this.SERVER_BASE_PATH);
let url = this.SERVER_BASE_PATH + projectid + '/faq_kb/' + botid
// let url = this.FAQKB_URL + botid;
console.log('[FAQ-KB.SERV] - GET FAQ-KB BY ID - URL', url);
// console.log('[FAQ-KB.SERV] - GET FAQ-KB BY ID - URL', url);
return this._httpClient
.get<FaqKb[]>(url, httpOptions)
}
Expand Down

0 comments on commit d2855da

Please sign in to comment.