From 7e7c6627819e44d906dadfec06d477e0ff2892fe Mon Sep 17 00:00:00 2001 From: Gabriele Panico Date: Tue, 7 Nov 2023 17:19:05 +0100 Subject: [PATCH] added: new cds-modal-activate-bot while publishing a chatbot --- .../cds-modal-activate-bot.component.html | 14 +++++----- .../cds-modal-activate-bot.component.ts | 27 +++++++------------ src/assets/i18n/pt.json | 2 ++ src/assets/i18n/ru.json | 2 ++ src/assets/i18n/sr.json | 4 ++- src/assets/i18n/sv.json | 2 ++ src/assets/i18n/tr.json | 2 ++ src/assets/i18n/uk.json | 2 ++ src/assets/i18n/uz.json | 2 ++ src/assets/sass/cds/_variables.scss | 3 ++- 10 files changed, 34 insertions(+), 26 deletions(-) diff --git a/src/app/modals/cds-modal-activate-bot/cds-modal-activate-bot.component.html b/src/app/modals/cds-modal-activate-bot/cds-modal-activate-bot.component.html index e33d1b5b..a5214363 100644 --- a/src/app/modals/cds-modal-activate-bot/cds-modal-activate-bot.component.html +++ b/src/app/modals/cds-modal-activate-bot/cds-modal-activate-bot.component.html @@ -90,16 +90,16 @@
{{'AnErroOccurredWhileActivatingTheBot' | translate {{ "Install" | translate }} - - diff --git a/src/app/modals/cds-modal-activate-bot/cds-modal-activate-bot.component.ts b/src/app/modals/cds-modal-activate-bot/cds-modal-activate-bot.component.ts index e5d75f11..3c764562 100644 --- a/src/app/modals/cds-modal-activate-bot/cds-modal-activate-bot.component.ts +++ b/src/app/modals/cds-modal-activate-bot/cds-modal-activate-bot.component.ts @@ -29,8 +29,9 @@ export class CdsModalActivateBotComponent implements OnInit { // PRESENTS_MODAL_ATTACH_BOT_TO_DEPT: boolean = false; depts_without_bot_array = []; - selected_bot_name: string; - dept_id: string; + selected_dept_name: string; + // dept_id: string; + deptSelected: { id: string, name: string} HAS_CLICKED_HOOK_BOOT_TO_DEPT: boolean = false; HAS_COMPLETED_HOOK_BOOT_TO_DEPT: boolean = false; HAS_COMPLETED_HOOK_BOOT_TO_DEPT_SUCCESS: boolean = false; @@ -70,7 +71,7 @@ export class CdsModalActivateBotComponent implements OnInit { checkDepartmentsForProjectIdHasBot(){ if(this.departments){ - this.departments.forEach((dept: any) => { + this.departments.forEach((dept: Department) => { // this.logger.log('[CDS DSBRD] - DEPT', dept); if (dept.default === true) { this.defaultDepartmentId = dept._id; @@ -82,7 +83,7 @@ export class CdsModalActivateBotComponent implements OnInit { if (depts_length === 1) { this.DISPLAY_SELECT_DEPTS_WITHOUT_BOT = false; - this.dept_id = this.departments[0]['_id'] + this.deptSelected = {id: this.departments[0]._id, name: this.departments[0].name} this.logger.log('[ACTIVATE-BOT-MODAL-COMPONENT] ---> DEFAULT DEPT HAS BOT ', this.departments[0].hasBot); if (this.departments[0].hasBot === true) { @@ -114,20 +115,13 @@ export class CdsModalActivateBotComponent implements OnInit { } onSelectDept(event: {id: string, name: string}){ - this.logger.log('[ACTIVATE-BOT-MODAL-COMPONENT] ---> onSelectBotId ', event); - this.dept_id = event.id - const hasFound = this.depts_without_bot_array.filter((obj: any) => { - return obj.id === this.dept_id; - }); - this.logger.log('[CDS DSBRD] onSelectBotId found', hasFound); - if (hasFound.length > 0) { - this.selected_bot_name = hasFound[0]['name'] - } + this.logger.log('[ACTIVATE-BOT-MODAL-COMPONENT] ---> onSelectDept ', event); + this.deptSelected = event } hookBotToDept() { this.HAS_CLICKED_HOOK_BOOT_TO_DEPT = true; - this.departmentService.updateExistingDeptWithSelectedBot(this.dept_id, this.selectedChatbot._id).subscribe((res) => { + this.departmentService.updateExistingDeptWithSelectedBot(this.deptSelected.id, this.selectedChatbot._id).subscribe((res) => { this.logger.log('[BOT-CREATE] Bot Create - UPDATE EXISTING DEPT WITH SELECED BOT - RES ', res); }, (error) => { this.logger.error('[BOT-CREATE] Bot Create - UPDATE EXISTING DEPT WITH SELECED BOT - ERROR ', error); @@ -149,13 +143,12 @@ export class CdsModalActivateBotComponent implements OnInit { this.faqKbService.publish(this.selectedChatbot).subscribe((data) => { this.logger.log('[CDS DSBRD] publish - RES ', data) }, (error) => { - this.HAS_COMPLETED_HOOK_BOOT_TO_DEPT = true + this.HAS_COMPLETED_PUBLISH = true this.HAS_COMPLETED_PUBLISH_ERROR = true this.logger.error('[CDS DSBRD] publish ERROR ', error); }, () => { - this.HAS_COMPLETED_HOOK_BOOT_TO_DEPT = true + this.HAS_COMPLETED_PUBLISH = true this.HAS_COMPLETED_PUBLISH_SUCCESS = true - this.logger.log('[CDS DSBRD] publish * COMPLETE *'); }); } diff --git a/src/assets/i18n/pt.json b/src/assets/i18n/pt.json index 763e7b8c..e5609cb2 100644 --- a/src/assets/i18n/pt.json +++ b/src/assets/i18n/pt.json @@ -1924,7 +1924,9 @@ "DoYouWantToActivateBotForOneOfTheFollowingDepts": "Deseja ativar o bot {{bot_name}} para um dos seguintes departamentos?", "ActivateBot": "Ativar bot", "BotSuccessfullyActivated": "Bot ativado com sucesso", + "BotSuccessFullyPublished": "Bot publicado com sucesso", "AnErroOccurredWhileActivatingTheBot": "Ocorreu um erro ao ativar o bot", + "AnErroOccurredWhilePublishingTheBot": "Ocorreu um erro ao publicar o bot", "SelectDepartment": "Selecionar departamento", "Ignore": "Ignorar", "ActivateFor": "Ativar para", diff --git a/src/assets/i18n/ru.json b/src/assets/i18n/ru.json index 4c97ca21..79d2c4e4 100644 --- a/src/assets/i18n/ru.json +++ b/src/assets/i18n/ru.json @@ -1924,7 +1924,9 @@ "DoYouWantToActivateBotForOneOfTheFollowingDepts": "Вы хотите активировать бота {{bot_name}} для одного из следующих отделов?", "ActivateBot": "Активировать бота", "BotSuccessfullyActivated": "Бот успешно активирован", + "BotSuccessFullyPublished": "Бот успешно опубликован", "AnErroOccurredWhileActivatingTheBot": "Произошла ошибка при активации бота", + "AnErroOccurredWhilePublishingTheBot": "Произошла ошибка при публикации бота.", "SelectDepartment": "Выберите отдел", "Ignore": "Игнорировать", "ActivateFor": "Активировать для", diff --git a/src/assets/i18n/sr.json b/src/assets/i18n/sr.json index f1ed1a4e..d5b0efe7 100644 --- a/src/assets/i18n/sr.json +++ b/src/assets/i18n/sr.json @@ -1924,7 +1924,9 @@ "DoYouWantToActivateBotForOneOfTheFollowingDepts": "Да ли желите да активирате бот {{bot_name}} за једно од следећих одељења?", "ActivateBot": "Активирајте бот", "BotSuccessfullyActivated": "Бот је успешно активиран", - "AnErroOccurredWhileActivatingTheBot": "Дошло је до грешке при активирању бота", + "BotSuccessFullyPublished": "Бот је успешно објављен", + "AnErroOccurredWhileActivatingTheBot": "Дошло је до грешке приликом активирања бота", + "AnErroOccurredWhilePublishingTheBot": "Дошло је до грешке при објављивању бота", "SelectDepartment": "Изаберите одељење", "Ignore": "Игнорирај", "ActivateFor": "Активирајте за", diff --git a/src/assets/i18n/sv.json b/src/assets/i18n/sv.json index 9ef4b987..ed4e4ae3 100644 --- a/src/assets/i18n/sv.json +++ b/src/assets/i18n/sv.json @@ -1924,7 +1924,9 @@ "DoYouWantToActivateBotForOneOfTheFollowingDepts": "Vill du aktivera bot {{bot_name}} för någon av följande avdelningar?", "ActivateBot": "Aktivera bot", "BotSuccessfullyActivated": "Boten har aktiverats", + "BotSuccessFullyPublished": "Boten har publicerats", "AnErroOccurredWhileActivatingTheBot": "Ett fel uppstod när boten aktiverades", + "AnErroOccurredWhilePublishingTheBot": "Ett fel uppstod när boten skulle publiceras", "SelectDepartment": "Välj avdelning", "Ignore": "Strunta i", "ActivateFor": "Aktivera för", diff --git a/src/assets/i18n/tr.json b/src/assets/i18n/tr.json index dc6140e2..5472c30d 100644 --- a/src/assets/i18n/tr.json +++ b/src/assets/i18n/tr.json @@ -1924,7 +1924,9 @@ "DoYouWantToActivateBotForOneOfTheFollowingDepts": "Aşağıdaki bölümlerden biri için {{bot_name}} etkinleştirmek istiyor musunuz?", "ActivateBot": "Botu etkinleştir", "BotSuccessfullyActivated": "Bot başarıyla etkinleştirildi", + "BotSuccessFullyPublished": "Bot başarıyla yayınlandı", "AnErroOccurredWhileActivatingTheBot": "Bot etkinleştirilirken bir hata oluştu", + "AnErroOccurredWhilePublishingTheBot": "Bot yayınlanırken bir hata oluştu", "SelectDepartment": "Departman seçin", "Ignore": "Göz ardı etmek", "ActivateFor": "Için etkinleştir", diff --git a/src/assets/i18n/uk.json b/src/assets/i18n/uk.json index 1ba806bf..67813601 100644 --- a/src/assets/i18n/uk.json +++ b/src/assets/i18n/uk.json @@ -1924,7 +1924,9 @@ "DoYouWantToActivateBotForOneOfTheFollowingDepts": "Бажаєте активувати бота < проміжок class= бот_ім'я }} для одного з наступних відділів?", "ActivateBot": "Активувати бота", "BotSuccessfullyActivated": "Бот успішно активований", + "BotSuccessFullyPublished": "Бот успішно опубліковано", "AnErroOccurredWhileActivatingTheBot": "Під час активації бота сталася помилка", + "AnErroOccurredWhilePublishingTheBot": "Під час публікації бота сталася помилка", "SelectDepartment": "Виберіть відділ", "Ignore": "Ігнорувати", "ActivateFor": "Активувати для", diff --git a/src/assets/i18n/uz.json b/src/assets/i18n/uz.json index b5588bd5..c7018be2 100644 --- a/src/assets/i18n/uz.json +++ b/src/assets/i18n/uz.json @@ -1923,7 +1923,9 @@ "DoYouWantToActivateBotForOneOfTheFollowingDepts": "Quyidagi bo'limlardan biri uchun {{bot_name}} botni faollashtirmoqchimisiz?", "ActivateBot": "Botni faollashtirish", "BotSuccessfullyActivated": "Bot muvaffaqiyatli faollashtirildi", + "BotSuccessFullyPublished": "Bot muvaffaqiyatli chop etildi", "AnErroOccurredWhileActivatingTheBot": "Botni faollashtirishda xatolik yuz berdi", + "AnErroOccurredWhilePublishingTheBot": "Botni nashr qilishda xatolik yuz berdi", "SelectDepartment": "Bo'limni tanlang", "Ignore": "E'tibor bermaslik", "ActivateFor": "uchun faollashtirish", diff --git a/src/assets/sass/cds/_variables.scss b/src/assets/sass/cds/_variables.scss index 6603c4a2..8594a67c 100644 --- a/src/assets/sass/cds/_variables.scss +++ b/src/assets/sass/cds/_variables.scss @@ -134,10 +134,11 @@ $mdb-font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif !default; $blu: #506493; $blu-02: rgb(91, 114, 167); +$blu-03: rgb(61,64,68); $blu-light-01: rgb(244, 246, 251); $blu-light-02: #b6c2df; $blu-light-03: rgb(224, 227, 241); -$blu-light-04: rgb(237, 239, 248); +$blu-light-04: rgb(229, 234, 245); $gray: rgb(112, 112, 112); $gray-02: rgb(239,241,245); $gray-light-01: rgb(214, 214, 214);