Skip to content

Commit

Permalink
Merge branch 'features/lazy-loading-7'
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
Nicola Lanzilotto committed Apr 27, 2024
2 parents ab431fa + c81f9ce commit 699bee8
Show file tree
Hide file tree
Showing 8 changed files with 383 additions and 58 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# tiledesk-dashboard

### 2.6.19
- Deploys in production
- Improves the Community page UI

### 2.6.18
- Deploys in production
- Hides the External chatbot learn more button if the DOCS key is set to false
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,6 +1,6 @@
{
"name": "@tiledesk/tiledesk-dashboard",
"version": "2.6.18",
"version": "2.6.19",
"scripts": {
"ng": "ng",
"start": "ng serve --aot",
Expand Down
87 changes: 41 additions & 46 deletions src/app/bots/bots-list/bots-sidebar/bots-sidebar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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
Expand All @@ -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(
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down
32 changes: 23 additions & 9 deletions src/app/bots/templates/templates.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ <h2 weight="500" class="css-5htwin eimqq0f0">Solve problems</h2><span size="8"

<div class="page-content--wpr">
<div class="template-page-title">
<span *ngIf="COMMUNITY_TEMPLATE">
<div *ngIf="COMMUNITY_TEMPLATE" style="text-align: center;">
Community
</span>
</div>
<!-- <div class="t--btn-wpr" *ngIf="!COMMUNITY_TEMPLATE">
<button type="button" class="btn btn-new btn-size-m btn--primary"
(click)="createBlankTilebot()">
Expand Down Expand Up @@ -258,7 +258,7 @@ <h2 weight="normal" class="template-name template-card-title">
<!-- @ Community tempates -->
<!-- ------------------------------------------------------------ -->
<!-- Search bar -->
<div *ngIf="COMMUNITY_TEMPLATE" class="css-1m7jc8x cmnty-tmplt-search-bar-container">
<!-- <div *ngIf="COMMUNITY_TEMPLATE" class="css-1m7jc8x cmnty-tmplt-search-bar-container">
<div class="css-t94b1v cmnty-tmplt-search-bar-wpr">
<div class="css-vm1iz7 cmnty-tmplt-search-bar">
<div class="css-1wp4ooc cmnty-tmplt-search-bar-input-and-icon-wpr">
Expand Down Expand Up @@ -296,9 +296,9 @@ <h2 weight="normal" class="template-name template-card-title">
</div>
</div>
</div>
</div> -->

<div *ngIf="COMMUNITY_TEMPLATE">
<!-- <div *ngIf="COMMUNITY_TEMPLATE">
<div class="css-ph3dp7 no-search-result-main" *ngIf="THERE_ARE_RESULTS === false">
<div class="css-18ajwok no-search-result-content-wpr">
<div class="css-ph3dp7 no-search-result-content">
Expand All @@ -313,12 +313,26 @@ <h2 weight="normal" class="template-name template-card-title">
</div>
</div>
</div>
</div>

</div> -->


<!-- Community tempaltes -->
<div *ngIf="COMMUNITY_TEMPLATE" class="css-ph3dp7 cmnty-tmplt-list--wpr">
<div class="css-18ajwok cmnty-tmplt-list">
<div *ngIf="COMMUNITY_TEMPLATE" class="css-ph3dp7 cmnty-tmplt-list--wpr">
<div class="cmnty-img-wpr">
<img class="cmnty-img" src="assets/img/logos/Tiledesk_community_v2.svg" />
</div>
<div class="cmnty-text">
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!
</div>

<div class="cmnty-btn">
<button type="button" class="btn btn-new btn-size-xl btn--primary"
(click)="goToExternalCommunity()">
<span>Chatbots Community</span>
</button>
</div>

<div style="display: none;" class="css-18ajwok cmnty-tmplt-list">
<div class="css-ph3dp7 cmnty-tmplt-list--wpr">
<div class="css-18ajwok cmnty-tmplt-list">
<div class="css-nghpcj cmnty-tmplt" *ngFor="let template of templates"
Expand Down
23 changes: 22 additions & 1 deletion src/app/bots/templates/templates.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
font-size: 32px;
font-weight: 500;
margin-bottom: 26px;
padding-left: 19px;
// padding-left: 19px;

}

Expand Down Expand Up @@ -1712,4 +1712,25 @@
font-family: "Poppins", "Roboto", "Arial", sans-serif !important;
padding-top: 8px !important;
padding-bottom: 8px !important;
}

.cmnty-tmplt-list--wpr {
display: flex;
flex-direction: column;
align-items: center;
gap: 18px;
}

.cmnty-img-wpr > img {
width: 340px;
height: auto;
}

.cmnty-text {
max-width: 800px;
text-align: center;
font-family: "Poppins", "Roboto", "Arial", sans-serif;
font-size: 16px;
line-height: normal;
font-weight: 400;
}
5 changes: 5 additions & 0 deletions src/app/bots/templates/templates.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,11 @@ export class TemplatesComponent extends PricingBaseComponent implements OnInit {
this.router.navigate(['project/' + this.project._id + '/template-details/' + templateid]);
}

goToExternalCommunity() {
const url = "https://tiledesk.com/community/"
window.open(url, '_blank');
}



searchInCommunityTemplates() {
Expand Down
Loading

0 comments on commit 699bee8

Please sign in to comment.