From 80bf5f4fdce2536edcdf8aeb12c12e00ebd7143f Mon Sep 17 00:00:00 2001 From: Gabriele Panico Date: Tue, 7 Nov 2023 14:25:24 +0100 Subject: [PATCH] minor logic improvement on variables --- src/app/app.module.ts | 6 +++-- .../textarea/textarea.component.ts | 4 ++-- .../cds-panel-widget.component.ts | 2 +- .../chatbot-design-studio.module.ts | 22 ++++++++++--------- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 5c141721..e9427c4a 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -28,7 +28,7 @@ import { WhatsappService } from './services/whatsapp.service'; import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { BrandService } from './services/brand.service'; import { MultichannelService } from './services/multichannel.service'; -import { MatDialogModule } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef} from '@angular/material/dialog'; import { NgSelectModule } from '@ng-select/ng-select'; import { SatPopoverModule } from '@ncstate/sat-popover'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; @@ -194,7 +194,9 @@ export function uploadFactory(http: HttpClient, appConfig: AppConfigService, app WebSocketJs, DatePipe, NotifyService, - { provide: LocationStrategy, useClass: HashLocationStrategy } + { provide: LocationStrategy, useClass: HashLocationStrategy }, + { provide: MAT_DIALOG_DATA, useValue: {} }, + { provide: MatDialogRef, useValue: {} } ] }) export class AppModule { } diff --git a/src/app/chatbot-design-studio/cds-dashboard/cds-canvas/base-elements/textarea/textarea.component.ts b/src/app/chatbot-design-studio/cds-dashboard/cds-canvas/base-elements/textarea/textarea.component.ts index 3e5f8f9b..f4a73db2 100644 --- a/src/app/chatbot-design-studio/cds-dashboard/cds-canvas/base-elements/textarea/textarea.component.ts +++ b/src/app/chatbot-design-studio/cds-dashboard/cds-canvas/base-elements/textarea/textarea.component.ts @@ -110,11 +110,11 @@ export class CDSTextareaComponent implements OnInit { if(this.elTextarea)this.elTextarea.value = ''; // console.log("SI:: readonly -- text --", this.text, " -- textTag --", this.textTag); } else { - this.text = event; + this.text = event.trim(); // console.log("NO:: readonly -- text --", this.text, " -- textTag --", this.textTag); } if(!this.isSelected || !this.readonly){ - this.changeTextarea.emit(event); + this.changeTextarea.emit(event.trim()); } } diff --git a/src/app/chatbot-design-studio/cds-dashboard/cds-canvas/cds-panel-widget/cds-panel-widget.component.ts b/src/app/chatbot-design-studio/cds-dashboard/cds-canvas/cds-panel-widget/cds-panel-widget.component.ts index d0030b99..cccb6df6 100644 --- a/src/app/chatbot-design-studio/cds-dashboard/cds-canvas/cds-panel-widget/cds-panel-widget.component.ts +++ b/src/app/chatbot-design-studio/cds-dashboard/cds-canvas/cds-panel-widget/cds-panel-widget.component.ts @@ -66,7 +66,7 @@ export class CdsPanelWidgetComponent implements OnInit, OnDestroy { this.projectID = this.dashboardService.projectID; this.selectedChatbot = this.dashboardService.selectedChatbot; - this.defaultDepartmentId = this.dashboardService.defaultDepartmentId; + this.defaultDepartmentId = this.dashboardService.defaultDepartment._id; this.setIframeUrl() } diff --git a/src/app/chatbot-design-studio/chatbot-design-studio.module.ts b/src/app/chatbot-design-studio/chatbot-design-studio.module.ts index 2175560b..046b4401 100644 --- a/src/app/chatbot-design-studio/chatbot-design-studio.module.ts +++ b/src/app/chatbot-design-studio/chatbot-design-studio.module.ts @@ -30,11 +30,10 @@ import { MatSlideToggleModule } from '@angular/material/slide-toggle'; import { MatTooltipModule } from '@angular/material/tooltip'; import { MatDialogModule } from '@angular/material/dialog'; import { MatTabsModule } from '@angular/material/tabs'; - import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; import { MatMenuModule } from '@angular/material/menu'; -import {MatButtonToggleModule} from '@angular/material/button-toggle'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; @@ -95,7 +94,6 @@ import { PanelIntentControlsComponent } from './cds-dashboard/cds-canvas/cds-int -import { CdsPublishOnCommunityModalComponent } from './cds-dashboard/utils/cds-publish-on-community-modal/cds-publish-on-community-modal.component'; import { SelectComponent } from './cds-base-element/select/select.component'; // import { VariableListComponent } from './cds-dashboard/cds-canvas/panel-intent-detail/actions/action-json-condition/variable-list/variable-list.component'; import { TextEditableDivComponent } from './cds-base-element/text-editable-div/text-editable-div.component'; @@ -109,7 +107,6 @@ import { CDSRadioButtonComponent } from './cds-base-element/radio-button/radio-b import { CDSDetailBotDetailComponent } from './cds-chatbot-details/detail/detail.component'; import { CDSDetailImportExportComponent } from './cds-chatbot-details/import-export/import-export.component'; import { WsChatbotService } from 'src/app/services/websocket/ws-chatbot.service'; -import { ChangeBotLangModalComponent } from 'src/app/modals/change-bot-lang/change-bot-lang.component'; // import { ActionWhatsappStaticComponent } from './cds-dashboard/panel-intent-detail/actions/action-whatsapp-static/action-whatsapp-static.component'; // import { ActionWhatsappAttributeComponent } from './cds-dashboard/panel-intent-detail/actions/action-whatsapp-attribute/action-whatsapp-attribute.component'; // import { ActionWhatsappSegmentComponent } from './cds-dashboard/panel-intent-detail/actions/action-whatsapp-segment/action-whatsapp-segment.component'; @@ -121,7 +118,6 @@ import { ChangeBotLangModalComponent } from 'src/app/modals/change-bot-lang/chan import { CdsPopupComponent } from './cds-dashboard/utils/cds-popup/cds-popup.component'; -import { CdsModalActivateBotComponent } from './cds-dashboard/utils/cds-modal-activate-bot/cds-modal-activate-bot.component'; import { CdsPanelElementsComponent } from './cds-dashboard/cds-canvas/cds-panel-elements/cds-panel-elements.component'; import { CdsPanelActionsComponent } from './cds-dashboard/cds-canvas/cds-panel-elements/cds-panel-actions/cds-panel-actions.component'; import { CdsPanelIntentListComponent } from './cds-dashboard/cds-canvas/cds-panel-intent-list/cds-panel-intent-list.component'; @@ -189,6 +185,11 @@ import { FormFieldComponent } from './cds-dashboard/cds-canvas/actions/list/form import { FormEditAddComponent } from './cds-dashboard/cds-canvas/actions/list/form/form-edit-add/form-edit-add.component'; import { ModalWindowComponent } from './cds-dashboard/cds-canvas/actions/list/form/modal-window/modal-window.component'; +//MODALS +import { CdsPublishOnCommunityModalComponent } from '../modals/cds-publish-on-community-modal/cds-publish-on-community-modal.component'; +import { ChangeBotLangModalComponent } from 'src/app/modals/change-bot-lang/change-bot-lang.component'; +import { CdsModalActivateBotComponent } from '../modals/cds-modal-activate-bot/cds-modal-activate-bot.component'; + import { CdsActionArrowComponent } from './cds-dashboard/cds-canvas/actions/shared/cds-action-controls/cds-action-arrow/cds-action-arrow.component'; import { CdsActionControlsComponent } from './cds-dashboard/cds-canvas/actions/shared/cds-action-controls/cds-action-controls/cds-action-controls.component'; @@ -201,6 +202,7 @@ import { CdsRuleComponent } from './cds-dashboard/cds-rule/cds-rule.component'; import { CdsOptionsComponent } from './cds-dashboard/cds-canvas/cds-options/cds-options.component'; + @NgModule({ declarations: [ CdsDashboardComponent, @@ -329,16 +331,16 @@ import { CdsOptionsComponent } from './cds-dashboard/cds-canvas/cds-options/cds- CDSDetailImportExportComponent, CDSDetailCommunityComponent, CDSDetailDeveloperComponent, - ChangeBotLangModalComponent, // ******* CDS CHATBOT DETAIL:: end ******* //UTILS CdsPopupComponent, + CdsSplashScreenComponent, + + //MODALS CdsModalActivateBotComponent, CdsPublishOnCommunityModalComponent, - CdsSplashScreenComponent, - - + ChangeBotLangModalComponent, //EVENT BASE COMPONENT CdsEventComponent, @@ -389,7 +391,7 @@ import { CdsOptionsComponent } from './cds-dashboard/cds-canvas/cds-options/cds- }) ], providers: [ - WsChatbotService + WsChatbotService, // DragDropService ], entryComponents: [