Skip to content

Commit

Permalink
Merge branch 'features/lazy-loading-6'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicola Lanzilotto committed Apr 23, 2024
2 parents 5a0623d + 78843e2 commit 26903ca
Show file tree
Hide file tree
Showing 60 changed files with 2,128 additions and 1,525 deletions.
61 changes: 30 additions & 31 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ import { UrlService } from './services/shared/url.service';

// BOTS & FAQ
import { FaqKbService } from './services/faq-kb.service';
import { BotListComponent } from './bots/bots-list/bots-list.component';
// import { BotListComponent } from './bots/bots-list/bots-list.component'; // // now lazy
import { BotTypeSelectComponent } from './bots/bot-create/bot-type-select/bot-type-select.component';
import { BotCreateComponent } from './bots/bot-create/bot-create.component';
import { FaqEditAddComponent } from './bots/faq-edit-add/faq-edit-add.component';
Expand Down Expand Up @@ -257,7 +257,7 @@ import { TilebotSelectTypeComponent } from './bots/tilebot-select-type/tilebot-s
import { TilebotSidebarComponent } from './bots/tilebot-sidebar/tilebot-sidebar.component';
import { TilebotComponent } from './bots/tilebot/tilebot.component';
import { RasaBotComponent } from './bots/rasa-bot/rasa-bot.component';
import { TemplatesComponent } from './bots/templates/templates.component';
// import { TemplatesComponent } from './bots/templates/templates.component'; // now lazy

// import { EmailTicketingComponent } from './email-ticketing/email-ticketing.component'; // now lazy

Expand Down Expand Up @@ -319,7 +319,7 @@ import { SidebarClaimsComponent } from './create-project-wizard/onboarding/sideb
import { NetworkOfflineComponent } from './network-offline/network-offline.component';
import { HomePromoBannerComponent } from './home-promo-banner/home-promo-banner.component';
import { TemplateDetailComponent } from './bots/templates/template-detail/template-detail.component';
import { BotsSidebarComponent } from './bots/bots-list/bots-sidebar/bots-sidebar.component';
// import { BotsSidebarComponent } from './bots/bots-list/bots-sidebar/bots-sidebar.component'; // now lazy
import { GetStartChatbotForkComponent } from './create-project-wizard/get-start-chatbot-fork/get-start-chatbot-fork.component';
import { InstallTemplateComponent } from './create-project-wizard/install-template/install-template.component';
// import { ChatbotDesignStudioModule } from './chatbot-design-studio/chatbot-design-studio.module'; // now lazy
Expand Down Expand Up @@ -350,15 +350,14 @@ import { CreateProjectGsComponent } from './create-project-wizard/create-project


import { OpenaiService } from './services/openai.service';
// import { KnowledgeBasesComponent } from './knowledge-bases/knowledge-bases.component';
import { HomeKbModalComponent } from './home-components/home-kb/home-kb-modal/home-kb-modal.component';
import { HomeCreateChatbotModalComponent } from './home-components/home-create-chatbot/home-create-chatbot-modal/home-create-chatbot-modal.component';
import { HomeInviteTeammateModalComponent } from './home-components/home-create-teammate/home-invite-teammate-modal/home-invite-teammate-modal.component';
import { HomeInviteTeammateErrorModalComponent } from './home-components/home-create-teammate/home-invite-teammate-error-modal/home-invite-teammate-error-modal.component';
import { HomeGoToChatComponent } from './home-components/home-go-to-chat/home-go-to-chat.component';
import { ChatbotModalComponent } from './bots/bots-list/chatbot-modal/chatbot-modal.component';
import { ChatbotAlertComponent } from './bots/bots-list/chatbot-alert/chatbot-alert.component';
import { KnowledgeBasesComponent } from './knowledge-bases/knowledge-bases.component';
// import { KnowledgeBasesComponent } from './knowledge-bases/knowledge-bases.component'; // now lazy
import { CnpTemplatesComponent } from './create-new-project/cnp-templates/cnp-templates.component';
import { OnboardingWelcomeComponent } from './create-new-project/onboarding-welcome/onboarding-welcome.component';
import { HomeNewsFeedModalComponent } from './home-components/home-news-feed/home-news-feed-modal/home-news-feed-modal.component';
Expand All @@ -382,18 +381,18 @@ import { MatAutocompleteModule } from '@angular/material/autocomplete';
import { MatTableModule } from '@angular/material/table';
import { MatPaginatorModule } from '@angular/material/paginator';
import { MatSortModule } from '@angular/material/sort';
import { ModalPageUrlComponent } from './knowledge-bases/modals/modal-page-url/modal-page-url.component';
import { ModalSiteMapComponent } from './knowledge-bases/modals/modal-site-map/modal-site-map.component';
import { ModalTextFileComponent } from './knowledge-bases/modals/modal-text-file/modal-text-file.component';
import { ModalGptKeyComponent } from './knowledge-bases/modals/modal-gpt-key/modal-gpt-key.component';
import { ModalDeleteKnowledgeBaseComponent } from './knowledge-bases/modals/modal-delete-knowledge-base/modal-delete-knowledge-base.component';
import { ModalPreviewKnowledgeBaseComponent } from './knowledge-bases/modals/modal-preview-knowledge-base/modal-preview-knowledge-base.component';
import { ModalDetailKnowledgeBaseComponent } from './knowledge-bases/modals/modal-detail-knowledge-base/modal-detail-knowledge-base.component';
import { KnowledgeBaseTableComponent } from './knowledge-bases/modals/knowledge-base-table/knowledge-base-table.component';
import { ModalErrorComponent } from './knowledge-bases/modals/modal-error/modal-error.component';
// import { ModalPageUrlComponent } from './knowledge-bases/modals/modal-page-url/modal-page-url.component'; // now lazy
// import { ModalSiteMapComponent } from './knowledge-bases/modals/modal-site-map/modal-site-map.component'; // now lazy
// import { ModalTextFileComponent } from './knowledge-bases/modals/modal-text-file/modal-text-file.component'; // now lazy
// import { ModalGptKeyComponent } from './knowledge-bases/modals/modal-gpt-key/modal-gpt-key.component'; // now lazy
// import { ModalDeleteKnowledgeBaseComponent } from './knowledge-bases/modals/modal-delete-knowledge-base/modal-delete-knowledge-base.component'; // now lazy
// import { ModalPreviewKnowledgeBaseComponent } from './knowledge-bases/modals/modal-preview-knowledge-base/modal-preview-knowledge-base.component'; // now lazy
// import { ModalDetailKnowledgeBaseComponent } from './knowledge-bases/modals/modal-detail-knowledge-base/modal-detail-knowledge-base.component'; // now lazy
// import { KnowledgeBaseTableComponent } from './knowledge-bases/modals/knowledge-base-table/knowledge-base-table.component'; // now lazy
// import { ModalErrorComponent } from './knowledge-bases/modals/modal-error/modal-error.component'; // now lazy
// import { KnowledgeBasesPreviousComponent } from './knowledge-bases-previous/knowledge-bases-previous.component'; // now lazy
import { ModalUrlsKnowledgeBaseComponent } from './knowledge-bases/modals/modal-urls-knowledge-base/modal-urls-knowledge-base.component';
import { AddContentMenuComponent } from './knowledge-bases/menu/add-content-menu/add-content-menu.component';
// import { ModalUrlsKnowledgeBaseComponent } from './knowledge-bases/modals/modal-urls-knowledge-base/modal-urls-knowledge-base.component'; // now lazy
// import { AddContentMenuComponent } from './knowledge-bases/menu/add-content-menu/add-content-menu.component'; // now lazy
import { UserModalComponent } from './users/user-modal/user-modal.component';
import { MessagesStatsModalComponent } from './components/modals/messages-stats-modal/messages-stats-modal.component';
import { WsChatbotService } from './services/websocket/ws-chatbot.service';
Expand Down Expand Up @@ -490,7 +489,7 @@ const appInitializerFn = (appConfig: AppConfigService, brandService: BrandServic
FaqComponent,
// ProjectsComponent, // now lazy
// UsersComponent, // now lazy
BotListComponent,
// BotListComponent, // now lazy
BotCreateComponent,
FaqEditAddComponent,
// DepartmentEditAddComponent, // now lazy
Expand Down Expand Up @@ -629,9 +628,9 @@ const appInitializerFn = (appConfig: AppConfigService, brandService: BrandServic
SidebarClaimsComponent,
NetworkOfflineComponent,
HomePromoBannerComponent,
TemplatesComponent,
// TemplatesComponent, // now lazy
TemplateDetailComponent,
BotsSidebarComponent,
// BotsSidebarComponent, // now lazy
GetStartChatbotForkComponent,
InstallTemplateComponent,
CreateChatbotComponent,
Expand All @@ -656,7 +655,7 @@ const appInitializerFn = (appConfig: AppConfigService, brandService: BrandServic
ContactCustomPropertiesComponent,
// ContactInfoComponent, ContactInfoComponent
CreateProjectGsComponent, // now lazy
KnowledgeBasesComponent,
// KnowledgeBasesComponent, // now lazy
// HomeConvsGraphComponent, // now lazy
// HomeWhatsappAccountComponent, // now lazy
// HomeCreateChatbotComponent, // now lazy
Expand Down Expand Up @@ -692,18 +691,18 @@ const appInitializerFn = (appConfig: AppConfigService, brandService: BrandServic
// BrevoIntegrationComponent, // now lazy
// GsheetsIntegrationComponent, // now lazy
// IntegrationHeaderComponent, // now lazy
ModalPageUrlComponent,
ModalSiteMapComponent,
ModalTextFileComponent,
ModalGptKeyComponent,
ModalDeleteKnowledgeBaseComponent,
ModalPreviewKnowledgeBaseComponent,
ModalDetailKnowledgeBaseComponent,
KnowledgeBaseTableComponent,
ModalErrorComponent,
// ModalPageUrlComponent, // now lazy
// ModalSiteMapComponent, // now lazy
// ModalTextFileComponent, // now lazy
// ModalGptKeyComponent, // now lazy
// ModalDeleteKnowledgeBaseComponent, // now lazy
// ModalPreviewKnowledgeBaseComponent, // now lazy
// ModalDetailKnowledgeBaseComponent, // now lazy
// KnowledgeBaseTableComponent, // now lazy
// ModalErrorComponent, // now lazy
// KnowledgeBasesPreviousComponent, // now lazy
ModalUrlsKnowledgeBaseComponent,
AddContentMenuComponent,
// ModalUrlsKnowledgeBaseComponent, // now lazy
// AddContentMenuComponent, // now lazy
UserModalComponent,
MessagesStatsModalComponent,
KnowledgeBasesAlertComponent
Expand Down
93 changes: 79 additions & 14 deletions src/app/app.routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ import { EventsComponent } from './events/events.component';
// import { UsersComponent } from './users/users.component'; // now lazy

// BOTS & FAQ
import { BotListComponent } from './bots/bots-list/bots-list.component';
// import { BotListComponent } from './bots/bots-list/bots-list.component'; // now lazy
import { BotTypeSelectComponent } from './bots/bot-create/bot-type-select/bot-type-select.component';
import { BotCreateComponent } from './bots/bot-create/bot-create.component';
import { FaqComponent } from './bots/faq/faq.component';
import { FaqEditAddComponent } from './bots/faq-edit-add/faq-edit-add.component';

import { FaqTestComponent } from './bots/faq-test/faq-test.component';
import { TemplatesComponent } from './bots/templates/templates.component';
// import { TemplatesComponent } from './bots/templates/templates.component'; // now lazy

// import { ProjectEditAddComponent } from './project-edit-add/project-edit-add.component'; // now lazy
// import { RequestsListHistoryComponent } from './requests-list-history/requests-list-history.component';
Expand Down Expand Up @@ -146,7 +146,7 @@ import { CommunityTemplateDtlsComponent } from './bots/templates/community-templ
// import { EmailTicketingStaticComponent } from './static-pages/email-ticketing-static/email-ticketing-static.component'; // now lazy
import { ActivateAppsumoProductComponent } from './create-project-wizard/activate-appsumo-product/activate-appsumo-product.component';
import { CreateProjectGsComponent } from './create-project-wizard/create-project-gs/create-project-gs.component';
import { KnowledgeBasesComponent } from './knowledge-bases/knowledge-bases.component';
// import { KnowledgeBasesComponent } from './knowledge-bases/knowledge-bases.component'; // now lazy
import { CnpIsMobileComponent } from './create-new-project/cnp-is-mobile/cnp-is-mobile.component';
import { CnpTemplatesComponent } from './create-new-project/cnp-templates/cnp-templates.component';
import { OnboardingWelcomeComponent } from './create-new-project/onboarding-welcome/onboarding-welcome.component';
Expand Down Expand Up @@ -584,6 +584,12 @@ const routes: Routes = [
},
// { path: 'project/:projectid/widget/translations', component: WidgetMultilanguageComponent, canActivate: [AuthGuard] },

// Widget Multilanguage called from widget setup
{
path: 'project/:projectid/widget/translations/:calledby',
loadChildren: () => import('app/widget_components/widget-multilanguage/widget-multilanguage.module').then(m => m.WidgetMultilanguageModule),
canActivate: [AuthGuard],
},

// Widget installation
{
Expand Down Expand Up @@ -877,11 +883,78 @@ const routes: Routes = [
},
// { path: 'project/:projectid/knowledge-bases-pre/:calledby', component: KnowledgeBasesPreviousComponent, canActivate: [AuthGuard] }, // now lazy

// KNOWLEDGE BASES (new)
{
path: 'project/:projectid/knowledge-bases',
loadChildren: () => import('app/knowledge-bases/knowledge-bases.module').then(m => m.KnowledgeBasesModule),
canActivate: [AuthGuard],
},
// { path: 'project/:projectid/knowledge-bases', component: KnowledgeBasesComponent, canActivate: [AuthGuard] }, // now lazy

{
path: 'project/:projectid/knowledge-bases/:calledby',
loadChildren: () => import('app/knowledge-bases/knowledge-bases.module').then(m => m.KnowledgeBasesModule),
canActivate: [AuthGuard],
},
// { path: 'project/:projectid/knowledge-bases/:calledby', component: KnowledgeBasesComponent, canActivate: [AuthGuard] }, // now lazy // when called from home

// Chatbots
{
path: 'project/:projectid/bots',
loadChildren: () => import('app/bots/bots-list/bots-list.module').then(m => m.BotsListModule),
canActivate: [AuthGuard],
},
// { path: 'project/:projectid/bots', component: BotListComponent, canActivate: [AuthGuard] }, // now lazy

{
path: 'project/:projectid/bots/my-chatbots/all',
loadChildren: () => import('app/bots/bots-list/bots-list.module').then(m => m.BotsListModule),
canActivate: [AuthGuard],
},
// { path: 'project/:projectid/bots/my-chatbots/all', component: BotListComponent, canActivate: [AuthGuard] }, // now lazy

{
path: 'project/:projectid/bots/my-chatbots/customer-satisfaction',
loadChildren: () => import('app/bots/bots-list/bots-list.module').then(m => m.BotsListModule),
canActivate: [AuthGuard],
},
// { path: 'project/:projectid/bots/my-chatbots/customer-satisfaction', component: BotListComponent, canActivate: [AuthGuard] }, // now lazy

{
path: 'project/:projectid/bots/my-chatbots/increase-sales',
loadChildren: () => import('app/bots/bots-list/bots-list.module').then(m => m.BotsListModule),
canActivate: [AuthGuard],
},
// { path: 'project/:projectid/bots/my-chatbots/increase-sales', component: BotListComponent, canActivate: [AuthGuard] }, // now lazy

// Templates
{
path: 'project/:projectid/bots/templates/all',
loadChildren: () => import('app/bots/templates/templates.module').then(m => m.TemplatesModule),
canActivate: [AuthGuard],
},
// { path: 'project/:projectid/bots/templates/all', component: TemplatesComponent, canActivate: [AuthGuard] }, // now lazy

{
path: 'project/:projectid/bots/templates/customer-satisfaction',
loadChildren: () => import('app/bots/templates/templates.module').then(m => m.TemplatesModule),
canActivate: [AuthGuard],
},
// { path: 'project/:projectid/bots/templates/customer-satisfaction', component: TemplatesComponent, canActivate: [AuthGuard] }, // now lazy

{
path: 'project/:projectid/bots/templates/increase-sales',
loadChildren: () => import('app/bots/templates/templates.module').then(m => m.TemplatesModule),
canActivate: [AuthGuard],
},
// { path: 'project/:projectid/bots/templates/increase-sales', component: TemplatesComponent, canActivate: [AuthGuard] }, // now lazy

{
path: 'project/:projectid/bots/templates/community',
loadChildren: () => import('app/bots/templates/templates.module').then(m => m.TemplatesModule),
canActivate: [AuthGuard],
},
// { path: 'project/:projectid/bots/templates/community', component: TemplatesComponent, canActivate: [AuthGuard] }, // now lazy



Expand Down Expand Up @@ -986,20 +1059,14 @@ const routes: Routes = [
// FAQKB (i.e. BOT)
/* path /faqkb commented and duplicated RENAMED IN /bots */
// { path: 'project/:projectid/faqkb', component: FaqKbComponent, canActivate: [AuthGuard] },
{ path: 'project/:projectid/bots', component: BotListComponent, canActivate: [AuthGuard] },
{ path: 'project/:projectid/bots/my-chatbots/all', component: BotListComponent, canActivate: [AuthGuard] },
{ path: 'project/:projectid/bots/my-chatbots/customer-satisfaction', component: BotListComponent, canActivate: [AuthGuard] },
{ path: 'project/:projectid/bots/my-chatbots/increase-sales', component: BotListComponent, canActivate: [AuthGuard] },


{ path: 'project/:projectid/bots/bot-select-type', component: BotTypeSelectComponent, canActivate: [AuthGuard] },
// { path: 'project/:projectid/bots/createfaqkb', component: BotCreateComponent, canActivate: [AuthGuard] }, // replaced by the bottom path
{ path: 'project/:projectid/bots/create/:type', component: BotCreateComponent, canActivate: [AuthGuard] },
{ path: 'project/:projectid/chatbot/create', component: CreateChatbotComponent, canActivate: [AuthGuard] }, //Multilanguage bot from scratch

{ path: 'project/:projectid/bots/templates/all', component: TemplatesComponent, canActivate: [AuthGuard] },
{ path: 'project/:projectid/bots/templates/customer-satisfaction', component: TemplatesComponent, canActivate: [AuthGuard] },
{ path: 'project/:projectid/bots/templates/increase-sales', component: TemplatesComponent, canActivate: [AuthGuard] },
{ path: 'project/:projectid/bots/templates/community', component: TemplatesComponent, canActivate: [AuthGuard] },



// rasa bot
Expand Down Expand Up @@ -1101,9 +1168,7 @@ const routes: Routes = [



// KNOWLEDGE BASES
{ path: 'project/:projectid/knowledge-bases', component: KnowledgeBasesComponent, canActivate: [AuthGuard] },
{ path: 'project/:projectid/knowledge-bases/:calledby', component: KnowledgeBasesComponent, canActivate: [AuthGuard] }, // when called from home




Expand Down
6 changes: 6 additions & 0 deletions src/app/automations/automations.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@


<div class="main-content" style="padding-top:0px; padding-left: 5px;padding-right: 5px;">

<div class="page-title--sidebar-settings"
[ngClass]="{'page-title--sidebar-settings_opened':IS_OPEN_SETTINGS_SIDEBAR, 'page-title--sidebar-settings_closed':!IS_OPEN_SETTINGS_SIDEBAR }">
{{ 'AutomationsLog' | translate }}
</div>

<div class="container-fluid" style="padding-left: 5px;padding-right: 5px;">

<div class="content-wpr" style="display: flex;">
Expand Down
37 changes: 37 additions & 0 deletions src/app/bots/bots-list/bots-list.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { BotListComponent } from './bots-list.component';
import { RouterModule, Routes } from '@angular/router';
import { BotsSidebarModule } from './bots-sidebar/bots-sidebar.module';
import { SharedModule } from 'app/shared/shared.module';
import { TranslateModule } from '@ngx-translate/core';
import { MatIconModule } from '@angular/material/icon';
import { MomentModule } from 'ngx-moment';
import { MatButtonModule } from '@angular/material/button';
import { FormsModule } from '@angular/forms';
import { MatMenuModule } from '@angular/material/menu';
import { MatTooltipModule } from '@angular/material/tooltip';

const routes: Routes = [
{ path: "", component: BotListComponent},
];

@NgModule({
declarations: [
BotListComponent
],
imports: [
RouterModule.forChild(routes),
CommonModule,
BotsSidebarModule,
SharedModule,
TranslateModule,
MatIconModule,
MomentModule,
MatButtonModule,
MatMenuModule,
FormsModule,
MatTooltipModule
]
})
export class BotsListModule { }
Loading

0 comments on commit 26903ca

Please sign in to comment.