From 2783f2917e950ae0a4b124dfd178d83d2c9edcdc Mon Sep 17 00:00:00 2001 From: Nicola Lanzilotto Date: Sat, 27 Apr 2024 11:29:30 +0200 Subject: [PATCH 1/2] Improves the Community page UI --- .../bots-sidebar/bots-sidebar.component.ts | 87 +++--- .../bots/templates/templates.component.html | 32 +- .../bots/templates/templates.component.scss | 23 +- src/app/bots/templates/templates.component.ts | 5 + .../img/logos/Tiledesk_community_v2.svg | 286 ++++++++++++++++++ 5 files changed, 377 insertions(+), 56 deletions(-) create mode 100644 src/assets/img/logos/Tiledesk_community_v2.svg diff --git a/src/app/bots/bots-list/bots-sidebar/bots-sidebar.component.ts b/src/app/bots/bots-list/bots-sidebar/bots-sidebar.component.ts index edccb6f11b5b..7b2a396b2640 100644 --- a/src/app/bots/bots-list/bots-sidebar/bots-sidebar.component.ts +++ b/src/app/bots/bots-list/bots-sidebar/bots-sidebar.component.ts @@ -61,10 +61,11 @@ export class BotsSidebarComponent implements OnInit, OnChanges { ngOnInit(): void { this.getCurrentRoute() - this.getOSCODE(); + this.getCurrentProject(); this.IS_OPEN = true this.listenToKbVersion() + this.getDahordBaseUrlThenOSCODE() // this.getProjectPlan() // this.logger.log('[BOTS-SIDEBAR] - IS_OPEN ', this.IS_OPEN) } @@ -75,7 +76,7 @@ export class BotsSidebarComponent implements OnInit, OnChanges { // this.logger.log('[BOTS-SIDEBAR] - myChatbotOtherCount ', this.myChatbotOtherCount) } - getOSCODE() { + getDahordBaseUrlThenOSCODE() { const href = window.location.href; // For test in local host @@ -87,40 +88,47 @@ export class BotsSidebarComponent implements OnInit, OnChanges { const dshbrdBaseUrl = hrefArray[0] this.logger.log('[BOTS-SIDEBAR] dshbrdBaseUrl includes tiledesk.com', dshbrdBaseUrl.includes('tiledesk.com')); - this.public_Key = this.appConfigService.getConfig().t2y12PruGU9wUtEGzBJfolMIgK; - - if (this.public_Key.includes("KNB")) { - let parts = this.public_Key.split('-'); - // this.logger.log('[BOTS-SIDEBAR] getAppConfig parts ', parts); - - let kbn = parts.find((part) => part.startsWith('KNB')); - this.logger.log('[BOTS-SIDEBAR] kbn from FT', kbn); - let kbnParts = kbn.split(':'); - this.logger.log('[BOTS-SIDEBAR] kbnParts from FT', kbnParts); - let kbnValue = kbnParts[1] - this.logger.log('[BOTS-SIDEBAR] kbnValue from FT', kbnValue); - - if (kbnValue === 'T') { - if (dshbrdBaseUrl.includes('tiledesk.com')) { - this.isVisibleKNB = true; - this.logger.log('[BOTS-SIDEBAR] dshbrdBaseUrl includes tiledesk.com', dshbrdBaseUrl.includes('tiledesk.com')); - this.logger.log('[BOTS-SIDEBAR] isVisibleKNB from FT', this.isVisibleKNB); - } else if (!dshbrdBaseUrl.includes('tiledesk.com')) { - this.logger.log('[BOTS-SIDEBAR] dshbrdBaseUrl includes tiledesk.com', dshbrdBaseUrl.includes('tiledesk.com')); + if (dshbrdBaseUrl.includes('tiledesk.com')) { + this.isVisibleKNB = true; + } else if (!dshbrdBaseUrl.includes('tiledesk.com')) { + this.logger.log('[BOTS-SIDEBAR] dshbrdBaseUrl includes tiledesk.com', dshbrdBaseUrl.includes('tiledesk.com')); + this.public_Key = this.appConfigService.getConfig().t2y12PruGU9wUtEGzBJfolMIgK; + if (this.public_Key.includes("KNB")) { + let parts = this.public_Key.split('-'); + // this.logger.log('[BOTS-SIDEBAR] getAppConfig parts ', parts); + + let kbn = parts.find((part) => part.startsWith('KNB')); + this.logger.log('[BOTS-SIDEBAR] kbn from FT', kbn); + let kbnParts = kbn.split(':'); + this.logger.log('[BOTS-SIDEBAR] kbnParts from FT', kbnParts); + let kbnValue = kbnParts[1] + this.logger.log('[BOTS-SIDEBAR] kbnValue from FT', kbnValue); + + if (kbnValue === 'T') { this.getProjectPlan() + // if (dshbrdBaseUrl.includes('tiledesk.com')) { + // this.isVisibleKNB = true; + // this.logger.log('[BOTS-SIDEBAR] dshbrdBaseUrl includes tiledesk.com', dshbrdBaseUrl.includes('tiledesk.com')); + // this.logger.log('[BOTS-SIDEBAR] isVisibleKNB from FT', this.isVisibleKNB); + // } else if (!dshbrdBaseUrl.includes('tiledesk.com')) { + // this.logger.log('[BOTS-SIDEBAR] dshbrdBaseUrl includes tiledesk.com', dshbrdBaseUrl.includes('tiledesk.com')); + // this.getProjectPlan() + // } + } else if (kbnValue === 'F') { + this.isVisibleKNB = false; } - } else if (kbnValue === 'F') { + + } else { this.isVisibleKNB = false; + this.logger.log('[BOTS-SIDEBAR] this.public_Key.includes("KNB")', this.public_Key.includes("KNB")) } - - } else { - this.isVisibleKNB = false; - this.logger.log('[BOTS-SIDEBAR] this.public_Key.includes("KNB")', this.public_Key.includes("KNB")) } + } + getProjectPlan() { this.prjctPlanService.projectPlan$ .pipe( @@ -188,11 +196,12 @@ export class BotsSidebarComponent implements OnInit, OnChanges { } else if (projectProfileData['customization'] === undefined) { this.logger.log('[BOTS-SIDEBAR] manageknowledgeBasesVisibility USECASE C customization is ', projectProfileData['customization'], 'get value from FT') // if (this.public_Key.includes("KNB")) { - // this.logger.log('[BOTS-SIDEBAR] manageknowledgeBasesVisibility USECASE B (from FT) - EXIST KNB ', this.public_Key.includes("KNB")); + // this.logger.log('[BOTS-SIDEBAR] manageknowledgeBasesVisibility USECASE B (from FT) - EXIST KNB ', this.public_Key.includes("KNB")); - this.isVisibleKNB = this.getKnbValue() - this.logger.log('[BOTS-SIDEBAR] this.isVisibleKNB from FT ', this.isVisibleKNB) + this.isVisibleKNB = this.getKnbValue() + this.logger.log('[BOTS-SIDEBAR] this.isVisibleKNB from FT ', this.isVisibleKNB) + // } else if (!this.public_Key.includes("KNB")) { // this.logger.log('[BOTS-SIDEBAR] Widget unbranding USECASE B (from FT) - EXIST KNB ', this.public_Key.includes("KNB")); // this.isVisibleKNB = false; @@ -225,24 +234,10 @@ export class BotsSidebarComponent implements OnInit, OnChanges { } - // getBaseUrlAndThenProjectPlan() { - // // const href = window.location.href; - - // // For test in local host - // const href = "https://panel.tiledesk.com/v3/dashboard/#/project/63a075485f117f0013541e32/bots/templates/community" - - // this.logger.log('[BOTS-SIDEBAR] href ', href) - - // const hrefArray = href.split('/#/'); - // const dshbrdBaseUrl = hrefArray[0] - - // this.logger.log('[BOTS-SIDEBAR] dshbrdBaseUrl ', dshbrdBaseUrl) + // getOSCODE() { + // this.public_Key = this.appConfigService.getConfig().t2y12PruGU9wUtEGzBJfolMIgK; - // this.logger.log('[BOTS-SIDEBAR] dshbrdBaseUrl includes tiledesk.com', dshbrdBaseUrl.includes('tiledesk.com')); - // if (!dshbrdBaseUrl.includes('tiledesk.com')) { - // this.getProjectPlan() - // } // } listenToKbVersion() { diff --git a/src/app/bots/templates/templates.component.html b/src/app/bots/templates/templates.component.html index 4d767b17474f..488c00a21220 100644 --- a/src/app/bots/templates/templates.component.html +++ b/src/app/bots/templates/templates.component.html @@ -95,9 +95,9 @@

Solve problems

- +
Community - +
-
+ -
+ + -
-
+
+
+ +
+
+ Explore a world of possibilities in our Community, where you'll discover a vast array of ready-to-use chatbots and automation ideas. Get support directly from the creators and import your favorites with just one click! +
+ +
+ +
+ +