From 40bb4929dcdb7e086efe9e49029e75e2293f0c79 Mon Sep 17 00:00:00 2001 From: Nicola Lanzilotto Date: Tue, 31 Dec 2024 19:24:42 +0100 Subject: [PATCH 01/10] Adds trenslations --- src/assets/i18n/ar.json | 7 +++++-- src/assets/i18n/az.json | 7 +++++-- src/assets/i18n/de.json | 7 +++++-- src/assets/i18n/en.json | 7 +++++-- src/assets/i18n/es.json | 7 +++++-- src/assets/i18n/fr.json | 7 +++++-- src/assets/i18n/it.json | 7 +++++-- src/assets/i18n/kk.json | 7 +++++-- src/assets/i18n/pt.json | 7 +++++-- src/assets/i18n/ru.json | 7 +++++-- src/assets/i18n/sr.json | 7 +++++-- src/assets/i18n/sv.json | 7 +++++-- src/assets/i18n/tr.json | 7 +++++-- src/assets/i18n/uk.json | 7 +++++-- src/assets/i18n/uz.json | 7 +++++-- 15 files changed, 75 insertions(+), 30 deletions(-) diff --git a/src/assets/i18n/ar.json b/src/assets/i18n/ar.json index 1d6e25105ed1..9549cc4ae6d8 100644 --- a/src/assets/i18n/ar.json +++ b/src/assets/i18n/ar.json @@ -612,6 +612,8 @@ "HideChatbotAttributesWidget":"إخفاء سمات Chatbot", "EnablingThisOptionHidesChatbotAttributes": "يؤدي تمكين هذا الخيار إلى إخفاء سمات روبوت المحادثة من الشريط الجانبي لتفاصيل المحادثة", "ContactUsToIncreaseYourMonthlyResourcesQuotas":"اتصل بنا لزيادة حصص الموارد الشهرية الخاصة بك", + "ConversationsInTheLastDays": "المحادثات في آخر {{range_count}} يومًا", + "ConversationsInTheLastMonths": "المحادثات في آخر {{range_count}} شهرًا", "TYPE_GPT_MODEL": { "text-davinci-003": { "description": ""}, "gpt-3.5-turbo": { "description": ""}, @@ -2249,8 +2251,9 @@ "GroupWithThisNameAlreadyExists": "توجد بالفعل مجموعة بهذا الاسم", "EnterTheGroupName": "أدخل اسم المجموعة (عادةً ما يكون هو نفسه اسم القسم)", "TheNewGroupCreatedCanAlso": "يمكن أيضًا تعيين المجموعة الجديدة التي تم إنشاؤها إلى أي قسم آخر", - "PercentageHandledByBots": "النسبة المئوية التي تم التعامل معها بواسطة برامج الروبوت", - "HandledByBots": "يتم التعامل معها بواسطة برامج الروبوت", + "PercentageHandledByBots": "النسبة المئوية التي تم التعامل معها بواسطة الروبوتات", + "HandledByBots": "تم التعامل معه بواسطة الروبوتات", + "HandledByHuman":"يعالجها الإنسان", "ConversationsInLast30Days": "المحادثات في آخر 30 يومًا", "TotalConversations": "مجموع المحادثات", "FilterConversations": "تصفية المحادثات", diff --git a/src/assets/i18n/az.json b/src/assets/i18n/az.json index ab9eea9c1026..19b73bc0fed8 100644 --- a/src/assets/i18n/az.json +++ b/src/assets/i18n/az.json @@ -613,6 +613,8 @@ "HideChatbotAttributesWidget":"Chatbot Atributları vidcetini gizlədin", "EnablingThisOptionHidesChatbotAttributes": "Bu seçimin aktivləşdirilməsi chatbotun atributlarını söhbət detalları yan panelindən gizlədir", "ContactUsToIncreaseYourMonthlyResourcesQuotas":"Aylıq resurs kvotalarınızı artırmaq üçün bizimlə əlaqə saxlayın", + "ConversationsInTheLastDays": "Son {{range_count}} gündə söhbətlər", + "ConversationsInTheLastMonths": "Son {{range_count}} ayda söhbətlər", "TYPE_GPT_MODEL": { "text-davinci-003": { "description": ""}, "gpt-3.5-turbo": { "description": ""}, @@ -2249,8 +2251,9 @@ "GroupWithThisNameAlreadyExists": "Bu adda qrup artıq mövcuddur", "EnterTheGroupName": "Qrup adını daxil edin (adətən şöbənin adı ilə eynidir)", "TheNewGroupCreatedCanAlso": "Yaradılan yeni qrup istənilən başqa şöbəyə də təyin edilə bilər", - "PercentageHandledByBots": "botlar tərəfindən idarə olunan faiz", - "HandledByBots": "botlar tərəfindən idarə olunur", + "PercentageHandledByBots": "Botlar tərəfindən idarə olunan faiz", + "HandledByBots": "Botlar tərəfindən idarə olunur", + "HandledByHuman":"İnsan tərəfindən idarə olunur", "ConversationsInLast30Days": "Son 30 gündəki söhbətlər", "TotalConversations": "Ümumi söhbətlər", "FilterConversations": "Söhbətləri süzün", diff --git a/src/assets/i18n/de.json b/src/assets/i18n/de.json index 0c09fdaca404..dbf83e0ade45 100644 --- a/src/assets/i18n/de.json +++ b/src/assets/i18n/de.json @@ -612,6 +612,8 @@ "HideChatbotAttributesWidget":"Wenn Sie diese Option aktivieren, werden die Attribute des Chatbots aus der Seitenleiste mit den Konversationsdetails ausgeblendet", "EnablingThisOptionHidesChatbotAttributes": "Bu seçimin aktivləşdirilməsi chatbotun atributlarını söhbət detalları yan panelindən gizlədir", "ContactUsToIncreaseYourMonthlyResourcesQuotas":"Kontaktieren Sie uns, um Ihr monatliches Ressourcenkontingent zu erhöhen", + "ConversationsInTheLastDays": "Unterhaltungen in den letzten {{range_count}} Tagen", + "ConversationsInTheLastMonths": "Gespräche in den letzten {{range_count}} Monaten", "TYPE_GPT_MODEL": { "text-davinci-003": { "description": ""}, "gpt-3.5-turbo": { "description": ""}, @@ -2247,8 +2249,9 @@ "GroupWithThisNameAlreadyExists": "Eine Gruppe mit diesem Namen existiert bereits", "EnterTheGroupName": "Geben Sie den Gruppennamen ein (normalerweise derselbe wie der Abteilungsname)", "TheNewGroupCreatedCanAlso": "Die neu erstellte Gruppe kann auch jeder anderen Abteilung zugeordnet werden", - "PercentageHandledByBots": "prozentsatz von Bots behandelt", - "HandledByBots": "von Bots gehandhabt", + "PercentageHandledByBots": "Von Bots verarbeiteter Prozentsatz", + "HandledByBots": "Von Bots verwaltet", + "HandledByHuman":"Von Menschen gehandhabt", "ConversationsInLast30Days": "Gespräche in den letzten 30 Tagen", "TotalConversations": "Total Gespräche", "FilterConversations": "Konversationen filtern", diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index a78cca620b68..198677469f8e 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -612,6 +612,8 @@ "HideChatbotAttributesWidget":"Hide Chatbot Attributes widget", "EnablingThisOptionHidesChatbotAttributes": "Enabling this option hides the chatbot's attributes", "ContactUsToIncreaseYourMonthlyResourcesQuotas":"Contact us to increase your monthly resources quotas", + "ConversationsInTheLastDays": "Conversations in the last {{range_count}} days", + "ConversationsInTheLastMonths": "Conversations in the last {{range_count}} months", "TYPE_GPT_MODEL": { "text-davinci-003": { "description": ""}, "gpt-3.5-turbo": { "description": ""}, @@ -2260,8 +2262,9 @@ "GroupWithThisNameAlreadyExists": "A group with this name already exists", "EnterTheGroupName": "Enter the group name (usually the same as the department name)", "TheNewGroupCreatedCanAlso": "The new group created can also be assigned to any other department", - "PercentageHandledByBots": "percentage handled by bots", - "HandledByBots": "handled by bots", + "PercentageHandledByBots": "Percentage handled by bots", + "HandledByBots": "Handled by bots", + "HandledByHuman":"Handled by human", "ConversationsInLast30Days": "Conversations in last 30 days", "TotalConversations": "Total conversations", "FilterConversations": "Filter conversations", diff --git a/src/assets/i18n/es.json b/src/assets/i18n/es.json index 3b2b9ad1f13a..6f708e143992 100644 --- a/src/assets/i18n/es.json +++ b/src/assets/i18n/es.json @@ -612,6 +612,8 @@ "HideChatbotAttributesWidget":"Ocultar el widget Atributos del Chatbot", "EnablingThisOptionHidesChatbotAttributes": "Al habilitar esta opción se ocultan los atributos del chatbot de la barra lateral de detalles de la conversación.", "ContactUsToIncreaseYourMonthlyResourcesQuotas":"Contáctanos para aumentar tus cuotas mensuales de recursos", + "ConversationsInTheLastDays": "Conversaciones en los últimos {{range_count}} días", + "ConversationsInTheLastMonths": "Conversaciones en los últimos {{range_count}} meses", "TYPE_GPT_MODEL": { "text-davinci-003": { "description": ""}, "gpt-3.5-turbo": { "description": ""}, @@ -2248,8 +2250,9 @@ "GroupWithThisNameAlreadyExists": "Ya existe un grupo con este nombre", "EnterTheGroupName": "Introduzca el nombre del grupo (normalmente el mismo que el nombre del departamento)", "TheNewGroupCreatedCanAlso": "El nuevo grupo creado también puede ser asignado a cualquier otro departamento", - "PercentageHandledByBots": "porcentaje manejado por bots", - "HandledByBots": "manejado por bots", + "PercentageHandledByBots": "Porcentaje manejado por bots", + "HandledByBots": "Manejado por bots", + "HandledByHuman":"Manejado por humanos", "ConversationsInLast30Days": "Conversaciones en los últimos 30 días", "TotalConversations": "Total de conversaciones", "FilterConversations": "Filtrar conversaciones", diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index 4914c0aab56e..3608580794f1 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -612,6 +612,8 @@ "HideChatbotAttributesWidget":"Masquer le widget des attributs du chatbot", "EnablingThisOptionHidesChatbotAttributes": "L'activation de cette option masque les attributs du chatbot dans la barre latérale des détails de la conversation", "ContactUsToIncreaseYourMonthlyResourcesQuotas":"Contactez-nous pour augmenter vos quotas de ressources mensuels", + "ConversationsInTheLastDays": "Conversations au cours des {{range_count}} derniers jours", + "ConversationsInTheLastMonths": "Conversations au cours des {{range_count}} derniers mois", "TYPE_GPT_MODEL": { "text-davinci-003": { "description": ""}, "gpt-3.5-turbo": { "description": ""}, @@ -2248,8 +2250,9 @@ "GroupWithThisNameAlreadyExists": "Un groupe portant ce nom existe déjà", "EnterTheGroupName": "Entrez le nom du groupe (généralement le même que le nom du département)", "TheNewGroupCreatedCanAlso": "Le nouveau groupe créé peut également être affecté à tout autre service", - "PercentageHandledByBots": "pourcentage géré par les bots", - "HandledByBots": "géré par des bots", + "PercentageHandledByBots": "Pourcentage géré par les bots", + "HandledByBots": "Géré par des bots", + "HandledByHuman":"Géré par l'humain", "ConversationsInLast30Days": "Conversations au cours des 30 derniers jours", "TotalConversations": "Conversations totales", "FilterConversations": "Filtrer les conversations", diff --git a/src/assets/i18n/it.json b/src/assets/i18n/it.json index 91ee9226e9b7..cc49f86d4f98 100644 --- a/src/assets/i18n/it.json +++ b/src/assets/i18n/it.json @@ -612,6 +612,8 @@ "HideChatbotAttributesWidget":"Nascondi widget Attributi Chatbot", "EnablingThisOptionHidesChatbotAttributes": "Abilitando questa opzione si nascondono gli attributi del chatbot dalla barra laterale dei dettagli della conversazione", "ContactUsToIncreaseYourMonthlyResourcesQuotas":"Contattaci per aumentare le tue quote di risorse mensili", + "ConversationsInTheLastDays": "Conversazioni negli ultimi {{range_count}} giorni", + "ConversationsInTheLastMonths": "Conversazioni negli ultimi {{range_count}} mesi", "TYPE_GPT_MODEL": { "text-davinci-003": { "description": ""}, "gpt-3.5-turbo": { "description": ""}, @@ -2258,8 +2260,9 @@ "GroupWithThisNameAlreadyExists": "Esiste già un gruppo con questo nome", "EnterTheGroupName": "Immettere il nome del gruppo (di solito lo stesso del nome del reparto)", "TheNewGroupCreatedCanAlso": "Il nuovo gruppo creato potrà essere assegnato anche a qualsiasi altro dipartimento", - "PercentageHandledByBots": "percentuale gestita dai bot", - "HandledByBots": "gestite dai bot", + "PercentageHandledByBots": "Percentuale gestita dai bot", + "HandledByBots": "Gestite dai bot", + "HandledByHuman":"Gestito dagli umani", "ConversationsInLast30Days": "Conversazioni negli ultimi 30 giorni", "TotalConversations": "Conversazioni totali", "FilterConversations": "Filtra le conversazioni", diff --git a/src/assets/i18n/kk.json b/src/assets/i18n/kk.json index 0315d758851e..615c17f62dbf 100644 --- a/src/assets/i18n/kk.json +++ b/src/assets/i18n/kk.json @@ -612,6 +612,8 @@ "HideChatbotAttributesWidget":"Chatbot атрибуттары виджетін жасыру", "EnablingThisOptionHidesChatbotAttributes": "Бұл опцияны қосу сөйлесу мәліметтерінің бүйірлік тақтасынан чатбот атрибуттарын жасырады", "ContactUsToIncreaseYourMonthlyResourcesQuotas":"Ай сайынғы ресурстар квотасын ұлғайту үшін бізге хабарласыңыз", + "ConversationsInTheLastDays": "Соңғы {{range_count}} күндегі сөйлесулер", + "ConversationsInTheLastMonths": "Соңғы {{range_count}} айдағы әңгімелер", "TYPE_GPT_MODEL": { "text-davinci-003": { "description": ""}, "gpt-3.5-turbo": { "description": ""}, @@ -2248,8 +2250,9 @@ "GroupWithThisNameAlreadyExists": "Мұндай атаумен топ бұрыннан бар", "EnterTheGroupName": "Топ атын енгізіңіз (әдетте бөлім атауымен бірдей)", "TheNewGroupCreatedCanAlso": "Жаңадан құрылған топты кез келген басқа бөлімге де тағайындауға болады", - "PercentageHandledByBots": "пайызы боттармен өңделеді", - "HandledByBots": "боттармен өңделеді", + "PercentageHandledByBots": "Боттармен өңделген пайыз", + "HandledByBots": "Боттармен басқарылады", + "HandledByHuman":"Адаммен өңделеді", "ConversationsInLast30Days": "Соңғы 30 күндегі сөйлесулер", "TotalConversations": "Жалпы сөйлесулер", "FilterConversations": "Сөйлесулерді сүзгілеу", diff --git a/src/assets/i18n/pt.json b/src/assets/i18n/pt.json index c0a9e8e599e4..a81c4bac06d3 100644 --- a/src/assets/i18n/pt.json +++ b/src/assets/i18n/pt.json @@ -612,6 +612,8 @@ "HideChatbotAttributesWidget":"Ocultar atributos do chatbot", "EnablingThisOptionHidesChatbotAttributes": "Ativar esta opção oculta os atributos do chatbot da barra lateral de detalhes da conversa", "ContactUsToIncreaseYourMonthlyResourcesQuotas":"Contacte-nos para aumentar as suas quotas mensais de recursos", + "ConversationsInTheLastDays": "Conversas nos últimos {{range_count}} dias", + "ConversationsInTheLastMonths": "Conversas nos últimos {{range_count}} meses", "TYPE_GPT_MODEL": { "text-davinci-003": { "description": ""}, "gpt-3.5-turbo": { "description": ""}, @@ -2248,8 +2250,9 @@ "GroupWithThisNameAlreadyExists": "Já existe um grupo com este nome", "EnterTheGroupName": "Digite o nome do grupo (geralmente o mesmo que o nome do departamento)", "TheNewGroupCreatedCanAlso": "O novo grupo criado também pode ser atribuído a qualquer outro departamento", - "PercentageHandledByBots": "porcentagem tratada por bots", - "HandledByBots": "tratado por bots", + "PercentageHandledByBots": "Percentagem manipulada por bots", + "HandledByBots": "Manuseado por bots", + "HandledByHuman":"Manipulado por humanos", "ConversationsInLast30Days": "Conversas nos últimos 30 dias", "TotalConversations": "Total de conversas", "FilterConversations": "Filtrar conversas", diff --git a/src/assets/i18n/ru.json b/src/assets/i18n/ru.json index 30bd51cbd683..72d50645421e 100644 --- a/src/assets/i18n/ru.json +++ b/src/assets/i18n/ru.json @@ -613,6 +613,8 @@ "HideChatbotAttributesWidget":"Скрыть виджет «Атрибуты чат-бота»", "EnablingThisOptionHidesChatbotAttributes": "Включение этой опции скрывает атрибуты чат-бота на боковой панели сведений о разговоре.", "ContactUsToIncreaseYourMonthlyResourcesQuotas":"Свяжитесь с нами, чтобы увеличить ежемесячные квоты ресурсов", + "ConversationsInTheLastDays": "Разговоры за последние {{range_count}} дней", + "ConversationsInTheLastMonths": "Разговоры за последние {{range_count}} месяцев", "TYPE_GPT_MODEL": { "text-davinci-003": { "description": ""}, "gpt-3.5-turbo": { "description": ""}, @@ -2248,8 +2250,9 @@ "GroupWithThisNameAlreadyExists": "Группа с таким названием уже существует", "EnterTheGroupName": "Введите название группы (обычно совпадает с названием отдела)", "TheNewGroupCreatedCanAlso": "Созданная новая группа также может быть назначена любому другому отделу", - "PercentageHandledByBots": "процент, обработанный ботами", - "HandledByBots": "обрабатывается ботами", + "PercentageHandledByBots": "Процент обработанных ботами", + "HandledByBots": "Обрабатывается ботами", + "HandledByHuman":"Управляется человеком", "ConversationsInLast30Days": "Беседы за последние 30 дней", "TotalConversations": "Всего разговоров", "FilterConversations": "Фильтровать разговоры", diff --git a/src/assets/i18n/sr.json b/src/assets/i18n/sr.json index e33a6c1dc346..db61850dbfe6 100644 --- a/src/assets/i18n/sr.json +++ b/src/assets/i18n/sr.json @@ -614,6 +614,8 @@ "HideChatbotAttributesWidget":"Сакриј виџет Атрибути четбота", "EnablingThisOptionHidesChatbotAttributes": "Омогућавањем ове опције сакривају се атрибути робота за ћаскање са бочне траке са детаљима разговора", "ContactUsToIncreaseYourMonthlyResourcesQuotas":"Контактирајте нас да повећате своје месечне квоте ресурса", + "ConversationsInTheLastDays": "Конверзације у последњих {{range_count}} дана", + "ConversationsInTheLastMonths": "Конверзације у последњих {{range_count}} месеци", "TYPE_GPT_MODEL": { "text-davinci-003": { "description": ""}, "gpt-3.5-turbo": { "description": ""}, @@ -2250,8 +2252,9 @@ "GroupWithThisNameAlreadyExists": "Група са овим именом већ постоји", "EnterTheGroupName": "Унесите име групе (обично исто као и назив одељења)", "TheNewGroupCreatedCanAlso": "Нова група која је креирана може бити додељена било ком другом одељењу", - "PercentageHandledByBots": "проценат којим рукују ботови", - "HandledByBots": "рукују ботови", + "PercentageHandledByBots": "Проценат којим руководе ботови", + "HandledByBots": "Руковано од стране ботова", + "HandledByHuman":"Руковано од стране људи", "ConversationsInLast30Days": "Разговори у последњих 30 дана", "TotalConversations": "Укупно разговора", "FilterConversations": "Филтрирајте разговоре", diff --git a/src/assets/i18n/sv.json b/src/assets/i18n/sv.json index 054fcc5fc1d9..738c16e98c91 100644 --- a/src/assets/i18n/sv.json +++ b/src/assets/i18n/sv.json @@ -614,6 +614,8 @@ "HideChatbotAttributesWidget":"Dölj widgeten Chatbot-attribut", "EnablingThisOptionHidesChatbotAttributes": "Om du aktiverar det här alternativet döljs chatbotens attribut från sidofältet för konversationsinformation", "ContactUsToIncreaseYourMonthlyResourcesQuotas":"Kontakta oss för att öka dina månatliga resurskvoter", + "ConversationsInTheLastDays": "Konversationer under de senaste {{range_count}} dagarna", + "ConversationsInTheLastMonths": "Konversationer under de senaste {{range_count}} månaderna", "TYPE_GPT_MODEL": { "text-davinci-003": { "description": ""}, "gpt-3.5-turbo": { "description": ""}, @@ -2250,8 +2252,9 @@ "GroupWithThisNameAlreadyExists": "En grupp med detta namn finns redan", "EnterTheGroupName": "Ange gruppnamnet (vanligtvis samma som avdelningsnamnet)", "TheNewGroupCreatedCanAlso": "Den nya gruppen som skapas kan också tilldelas vilken annan avdelning som helst", - "PercentageHandledByBots": "procent som hanteras av bots", - "HandledByBots": "hanteras av bots", + "PercentageHandledByBots": "Procent hanteras av bots", + "HandledByBots": "Hanteras av bots", + "HandledByHuman":"Hanteras av människan", "ConversationsInLast30Days": "Konversationer under de senaste 30 dagarna", "TotalConversations": "Totala samtal", "FilterConversations": "Filtrera konversationer", diff --git a/src/assets/i18n/tr.json b/src/assets/i18n/tr.json index 27074fdcbe94..18eb31903e87 100644 --- a/src/assets/i18n/tr.json +++ b/src/assets/i18n/tr.json @@ -615,6 +615,8 @@ "HideChatbotAttributesWidget":"Chatbot Nitelikleri widget'ını gizle", "EnablingThisOptionHidesChatbotAttributes": "Bu seçeneği etkinleştirmek, sohbet robotunun niteliklerini konuşma ayrıntıları kenar çubuğundan gizler", "ContactUsToIncreaseYourMonthlyResourcesQuotas":"Aylık kaynak kotanızı artırmak için bizimle iletişime geçin", + "ConversationsInTheLastDays": "Son {{range_count}} gündeki konuşmalar", + "ConversationsInTheLastMonths": "Son {{range_count}} aydaki konuşmalar", "TYPE_GPT_MODEL": { "text-davinci-003": { "description": ""}, "gpt-3.5-turbo": { "description": ""}, @@ -2250,8 +2252,9 @@ "GroupWithThisNameAlreadyExists": "Bu ada sahip bir grup zaten var", "EnterTheGroupName": "Grup adını girin (genellikle departman adıyla aynıdır)", "TheNewGroupCreatedCanAlso": "Oluşturulan yeni grup başka herhangi bir departmana da atanabilir", - "PercentageHandledByBots": "botlar tarafından işlenen yüzde", - "HandledByBots": "botlar tarafından yönetiliyor", + "PercentageHandledByBots": "Botlar tarafından işlenen yüzde", + "HandledByBots": "Botlar tarafından idare ediliyor", + "HandledByHuman":"İnsan tarafından işlenir", "ConversationsInLast30Days": "Son 30 gündeki görüşmeler", "TotalConversations": "Toplam konuşma", "FilterConversations": "Görüşmeleri filtrele", diff --git a/src/assets/i18n/uk.json b/src/assets/i18n/uk.json index f1689c45cfcd..7f246f37da8e 100644 --- a/src/assets/i18n/uk.json +++ b/src/assets/i18n/uk.json @@ -615,6 +615,8 @@ "HideChatbotAttributesWidget":"Chatbot atributlari vidjetini yashirish", "EnablingThisOptionHidesChatbotAttributes": "Увімкнення цієї опції приховує атрибути чат-бота на бічній панелі деталей розмови", "ContactUsToIncreaseYourMonthlyResourcesQuotas":"Зв’яжіться з нами, щоб збільшити місячні квоти ресурсів", + "ConversationsInTheLastDays": "Розмови за останні {{range_count}} днів", + "ConversationsInTheLastMonths": "Розмови за останні {{range_count}} місяців", "TYPE_GPT_MODEL": { "text-davinci-003": { "description": ""}, "gpt-3.5-turbo": { "description": ""}, @@ -2251,8 +2253,9 @@ "GroupWithThisNameAlreadyExists": "Група з такою назвою вже існує", "EnterTheGroupName": "Введіть назву групи (зазвичай таке ж, як назва відділу)", "TheNewGroupCreatedCanAlso": "Створену групу також можна призначити до будь-якого іншого відділу", - "PercentageHandledByBots": "відсоток, оброблений ботами", - "HandledByBots": "обробляються ботами", + "PercentageHandledByBots": "Відсоток, оброблений ботами", + "HandledByBots": "Обробляється ботами", + "HandledByHuman":"Оброблено людиною", "ConversationsInLast30Days": "Розмови за останні 30 днів", "TotalConversations": "Всього розмов", "FilterConversations": "Відфільтруйте бесіди", diff --git a/src/assets/i18n/uz.json b/src/assets/i18n/uz.json index 8d8984ee0ece..f5bf5ba4c947 100644 --- a/src/assets/i18n/uz.json +++ b/src/assets/i18n/uz.json @@ -613,6 +613,8 @@ "HideChatbotAttributesWidget":"Chatbot atributlari vidjetini yashirish", "EnablingThisOptionHidesChatbotAttributes": "Ushbu parametr yoqilsa, chatbotning atributlari suhbat tafsilotlari yon panelidan yashiriladi", "ContactUsToIncreaseYourMonthlyResourcesQuotas":"Oylik resurslar kvotalarini oshirish uchun biz bilan bog'laning", + "ConversationsInTheLastDays": "Oxirgi {{range_count}} kundagi suhbatlar", + "ConversationsInTheLastMonths": "Oxirgi {{range_count}} oydagi suhbatlar", "TYPE_GPT_MODEL": { "text-davinci-003": { "description": ""}, "gpt-3.5-turbo": { "description": ""}, @@ -2248,8 +2250,9 @@ "GroupWithThisNameAlreadyExists": "Bunday nomli guruh allaqachon mavjud", "EnterTheGroupName": "Guruh nomini kiriting (odatda bo'lim nomi bilan bir xil)", "TheNewGroupCreatedCanAlso": "Yaratilgan yangi guruh boshqa har qanday bo'limga ham tayinlanishi mumkin", - "PercentageHandledByBots": "foizlar botlar tomonidan boshqariladi", - "HandledByBots": "botlar tomonidan boshqariladi", + "PercentageHandledByBots": "Botlar tomonidan boshqariladigan foiz", + "HandledByBots": "Botlar tomonidan boshqariladi", + "HandledByHuman":"Inson tomonidan boshqariladi", "ConversationsInLast30Days": "Oxirgi 30 kundagi suhbatlar", "TotalConversations": "Jami suhbatlar", "FilterConversations": "Suhbatlarni filtrlash", From 760c1ef35f45bf7c09db1468a40428c09f2d7bbe Mon Sep 17 00:00:00 2001 From: Nicola Lanzilotto Date: Tue, 31 Dec 2024 19:28:00 +0100 Subject: [PATCH 02/10] Improves the conversations report in Analytics > Metrics > Conversations --- .../metrics/requests/requests.component.html | 189 ++++++++++++++---- .../metrics/requests/requests.component.scss | 112 ++++++++--- .../metrics/requests/requests.component.ts | 85 ++++++-- 3 files changed, 289 insertions(+), 97 deletions(-) diff --git a/src/app/analytics/metrics/requests/requests.component.html b/src/app/analytics/metrics/requests/requests.component.html index 4483d6a0d8ce..866c104e9c40 100755 --- a/src/app/analytics/metrics/requests/requests.component.html +++ b/src/app/analytics/metrics/requests/requests.component.html @@ -9,27 +9,131 @@

-
-
+ +
--> + +
+ + + +
+ + {{'ConversationsInTheLastDays' | translate: {range_count: 7} }} +
+
+ {{'ConversationsInTheLastDays' | translate: {range_count: 15} }} +
+
+ {{'ConversationsInTheLastDays' | translate: {range_count: 30} }} +
+
+ {{'ConversationsInTheLastMonths' | translate: {range_count: 3} }} +
+
+ {{'ConversationsInTheLastMonths' | translate: {range_count: 6} }} +
+
+ {{'ConversationsInTheLastDays' | translate: {range_count: 365} }} +
- + +
+
+

+ {{'TotalConversations' | translate}} +

+
+ + +
+

+ {{totalHuman + totalBot | number:'1.0-0'}} +

+
+ +
+ + +
+
+

+ {{'HandledByHuman' | translate}} +

+
+ + +
+

+ {{totalHuman | number:'1.0-0'}} +

+
+ +
+ + +
+
+

+ {{'HandledByBots' | translate}} +

+
+ + +
+

+ {{totalBot | number:'1.0-0'}} +

+
+ +
+ + +
+
+

+ {{'PercentageHandledByBots' | translate}} +

+
+ + +
+

+ {{percentageOfRequestsHandledByBots}} % +

+
+ +
@@ -38,14 +142,14 @@

- {{ 'Analytics.RequestChartTitle' | translate }} {{lastdays}} - {{ 'Analytics.Days' | translate }} - {{ 'Analytics.Months' | translate }} - {{ 'Analytics.Year' | translate }} - {{initDay}} - arrow_forward {{endDay}} - + style="padding-bottom: 12px; padding-top:30px; font-size: 18px; font-family: 'Poppins', 'Roboto', 'Arial', sans-serif"> + {{ 'Analytics.RequestChartTitle' | translate }} {{lastdays}} + {{ 'Analytics.Days' | translate }} + {{ 'Analytics.Months' | translate }} + {{ 'Analytics.Year' | translate }} + {{initDay}} + arrow_forward {{endDay}} +
@@ -59,17 +163,20 @@

- - {{ 'Analytics.Last' | translate}} 7 {{ 'Analytics.Days' | translate}} - {{ 'Analytics.Last' | translate}} 15 {{ 'Analytics.Days' | translate}} - {{ 'Analytics.Last' | translate}} 30 {{ 'Analytics.Days' | translate}} - {{ 'Analytics.Last' | translate}} 3 {{ 'Analytics.Months' | translate}} - {{ 'Analytics.Last' | translate}} 6 {{ 'Analytics.Months' | translate}} - {{ 'Analytics.Last' | translate}} 1 {{ 'Analytics.Year' | translate}} + {{ 'Analytics.Last' | translate}} 7 {{ 'Analytics.Days' | + translate}} + {{ 'Analytics.Last' | translate}} 15 {{ 'Analytics.Days' | + translate}} + {{ 'Analytics.Last' | translate}} 30 {{ 'Analytics.Days' | + translate}} + {{ 'Analytics.Last' | translate}} 3 {{ 'Analytics.Months' | + translate}} + {{ 'Analytics.Last' | translate}} 6 {{ 'Analytics.Months' | + translate}} + {{ 'Analytics.Last' | translate}} 1 {{ 'Analytics.Year' | + translate}}

@@ -101,10 +208,7 @@

- {{ 'HistoryPage.AllDepts' | translate }} {{dept.name}} @@ -122,13 +226,11 @@

{{ "Agent" | translate }}
- {{'AllAgents' | translate}} - {{ agent.name}} + {{ + agent.name}} allow content vertical align vertical-align: middle; padding-top: 5px; - .arrow_forward-custom{ + .arrow_forward-custom { position: relative; top: 5px; font-size: 22px; - + } } -.chart-wrapper-richieste{ +.chart-wrapper-richieste { //background-color: rgb(30, 136, 229)!important; -->blue color //background-color: #ffffff; padding-top: 15px; @@ -29,37 +27,38 @@ min-height: 345px; } -.btn{ +.btn { background-color: rgb(255, 255, 255); margin-bottom: 1px; margin-top: 1px; height: 36px; - color:black; + color: black; text-transform: none !important; padding: inherit; width: 60px; } -.li-active{ +.li-active { border-top: 3px solid rgba(30, 136, 229, 1) !important; border-bottom: 3px solid rgba(30, 136, 229, 1) !important; - color:black !important; + color: black !important; } + .chart-title-richieste { - + padding: 12px 0px; font-size: 18px; //color: #fff; display: inline-block; //-->allow content vertical align vertical-align: middle; - font-family: 'Poppins', 'Roboto', 'Arial', sans-serif; + font-family: 'Poppins', 'Roboto', 'Arial', sans-serif; //text-align: center; } -.chart-container{ +.chart-container { //background-color: #1e88e5; - font-family: 'Poppins', 'Roboto', 'Arial', sans-serif; + font-family: 'Poppins', 'Roboto', 'Arial', sans-serif; } .number-analytics { @@ -72,11 +71,11 @@ // display: block; // margin-bottom: 7px; - font-size:50px; + font-size: 50px; line-height: 0; padding-top: 94px; color: #073f74; - font-family: 'Poppins', 'Roboto', 'Arial', sans-serif; + font-family: 'Poppins', 'Roboto', 'Arial', sans-serif; } @media screen and (min-width: 768px) { @@ -90,21 +89,70 @@ } } -@media screen and (max-width: 767px) { +@media screen and (max-width: 767px) { .advancedOptionForm { - padding-right: 25px; - padding-left: 25px; + padding-right: 25px; + padding-left: 25px; } } -// .card_richieste { -// display: inline-block; -// position: relative; -// //width: 100%; -// //margin: 25px 0; -// box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.14); -// border-radius: 3px; -// color: rgba(0,0,0, 0.87); -// background: #fff; -// } +.conv-analytics-left-card-title { + padding: 27px 10px 10px 10px; + font-size: 18px; + font-family: var(--header-font-family); +} + +.conv-analytics-indicator-container { + display: flex; + flex-direction: column; + -webkit-box-pack: start; + justify-content: flex-start; + align-items: normal; + padding: 20px; + +} + +.conv-analytics-indicator-title-wpr { + display: flex; + flex-direction: row; + -webkit-box-pack: start; + justify-content: flex-start; + -webkit-box-align: center; + align-items: center; +} + +.conv-analytics-indicator-title { + margin-top: 0px; + margin-bottom: 0px; + font-weight: 400; + font-size: 16px; + line-height: 20px; + letter-spacing: -0.01em; + font-family: var(--header-font-family); +} + +.conv-analytics-indicator-value-wpr { + display: flex; + flex-direction: row; + -webkit-box-pack: start; + justify-content: flex-start; + -webkit-box-align: center; + align-items: center; + min-height: 39px; +} + +.conv-analytics-indicator-value { + margin-top: 6px; + margin-bottom: 0px; + font-weight: 600; + font-size: 40px; + line-height: 33px; + letter-spacing: -0.01em; + color: rgb(172, 184, 203); + font-family: Lato, Roboto, Helvetica, Arial, sans-serif;; +} + +.percentage-symbol { + font-size: 31px; +} \ No newline at end of file diff --git a/src/app/analytics/metrics/requests/requests.component.ts b/src/app/analytics/metrics/requests/requests.component.ts index a9282a2c9570..ee2efcb0f809 100755 --- a/src/app/analytics/metrics/requests/requests.component.ts +++ b/src/app/analytics/metrics/requests/requests.component.ts @@ -48,6 +48,10 @@ export class RequestsComponent implements OnInit { ... CHANNELS ]; + percentageOfRequestsHandledByBots: any; + totalHuman: number; + totalBot: number; + constructor( private analyticsService: AnalyticsService, private translate: TranslateService, @@ -120,7 +124,7 @@ export class RequestsComponent implements OnInit { this.lastdays = value; } else if ((value === 90) || (value === 180)) { this.lastdays = value / 30; - } else if (value === 360) { + } else if (value === 365) { this.lastdays = 1; } this.lineChart.destroy(); @@ -168,10 +172,10 @@ export class RequestsComponent implements OnInit { this.subscription.unsubscribe(); if (!this.selectedAgentId) { this.getRequestByLastNDayMerge(this.selectedDaysId, this.selectedDeptId, selectedChannelId) - this.logger.log('[ANALYTICS - CONVS] agentSelected getRequestByLastNDayMerge REQUEST:', this.selectedDaysId, this.selectedDeptId) + console.log('[ANALYTICS - CONVS] agentSelected getRequestByLastNDayMerge REQUEST:', this.selectedDaysId, this.selectedDeptId) } else { this.getRequestByLastNDay(this.selectedDaysId, this.selectedDeptId, this.selectedAgentId, selectedChannelId) - this.logger.log('[ANALYTICS - CONVS] agentSelected getRequestByLastNDay REQUEST:', this.selectedDaysId, this.selectedDeptId, this.selectedAgentId, selectedChannelId) + console.log('[ANALYTICS - CONVS] agentSelected getRequestByLastNDay REQUEST:', this.selectedDaysId, this.selectedDeptId, this.selectedAgentId, selectedChannelId) } } @@ -282,12 +286,12 @@ export class RequestsComponent implements OnInit { getAggregateValue() { this.analyticsService.getLastMountConversationsCount().subscribe((res: any) => { - this.logger.log("[ANALYTICS - CONVS] LAST MONTH CONVERSATIONS COUNT: ", res); + console.log("[ANALYTICS - CONVS] LAST MONTH CONVERSATIONS COUNT: ", res); if (res && res[0]) { this.conversationsCountLastMonth = res[0].totalCount; - this.logger.log("[ANALYTICS - CONVS] Conversations Count: ", this.conversationsCountLastMonth); + console.log("[ANALYTICS - CONVS] --> Conversations Last Month Count: ", this.conversationsCountLastMonth); } else { - this.logger.log("[ANALYTICS - CONVS] Conversations Count - THERE ARE NOT CONVS IN THE LAST MONTH"); + console.log("[ANALYTICS - CONVS] --> Conversations Last Month Count - THERE ARE NOT CONVS IN THE LAST MONTH"); this.conversationsCountLastMonth = 0; } }, (error) => { @@ -297,10 +301,12 @@ export class RequestsComponent implements OnInit { } getRequestByLastNDay(lastdays, depID, participantID, channelID) { - + console.log("[ANALYTICS - CONVS] user has filter participantID"); + let agentIsAChatbot = false if (participantID.includes("bot")) { - this.logger.log("[ANALYTICS - CONVS] Selected Agent is a BOT"); + console.log("[ANALYTICS - CONVS] Selected Agent is a BOT"); // try to change chart's colors + agentIsAChatbot = true } this.logger.log("[ANALYTICS - CONVS] GET REQUEST TYPE: For Agent/Bot") this.subscription = this.analyticsService.requestsByDay(lastdays, depID, participantID, channelID).subscribe((requestsByDay: any) => { @@ -357,7 +363,21 @@ export class RequestsComponent implements OnInit { _requestsByDay_labels_array.push(splitted_date[0] + ' ' + this.monthNames[splitted_date[1]]) }); + if (agentIsAChatbot) { + this.totalBot = _requestsByDay_series_array.reduce((sum, val) => sum + val, 0); + this.totalHuman = 0 + this.percentageOfRequestsHandledByBots = 100 + } else { + this.totalHuman = _requestsByDay_series_array.reduce((sum, val) => sum + val, 0); + this.totalBot = 0 + this.percentageOfRequestsHandledByBots = 0 + } + + console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - _requestsByDay_series_array', _requestsByDay_series_array); + console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - this.totalBot', this.totalBot); + console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - this.totalBot', this.totalHuman); + this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - SERIES (ARRAY OF COUNT - to use for debug)', requestsByDay_series_array); this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - SERIES (+ NEW + ARRAY OF COUNT)', _requestsByDay_series_array); this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - LABELS (ARRAY OF DAY - to use for debug)', requestsByDay_labels_array); @@ -365,7 +385,8 @@ export class RequestsComponent implements OnInit { //get higher value of xvalue array const higherCount = this.getMaxOfArray(_requestsByDay_series_array); - this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - HIGHTER COUNT ', higherCount); + console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - -> HIGHTER COUNT ', higherCount); + console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - ->_requestsByDay_series_array ', _requestsByDay_series_array); //set the stepsize var stepsize; @@ -453,7 +474,7 @@ export class RequestsComponent implements OnInit { }, display: true, fontColor: 'black', - suggestedMax: higherCount + 2, + suggestedMax: higherCount + 1, // callback: function (value, index, values) { @@ -521,17 +542,21 @@ export class RequestsComponent implements OnInit { this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY * COMPLETE *'); }) } - + getMaxValueFromArrays(array1: number[], array2: number[]): number { + const mergedArray = [...array1, ...array2]; + console.log('mergedArray', mergedArray) + return Math.max(...mergedArray); + } //-----------LAST n DAYS GRAPH----------------------- getRequestByLastNDayMerge(lastdays, depID, channelID) { - this.logger.log("[ANALYTICS - CONVS] GET REQUEST TYPE: Merged") + console.log("[ANALYTICS - CONVS] GET REQUEST TYPE: Merged lastdays" , lastdays) this.subscription = this.analyticsService.requestsByDay(lastdays, depID, '', channelID).subscribe((requestsByDay: any) => { - this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY N-DAY ', requestsByDay); + console.log('[ANALYTICS - CONVS] - REQUESTS BY N-DAY ', requestsByDay); this.analyticsService.requestsByDayBotServed(lastdays, depID, '', channelID).subscribe((requestsByDayBotServed: any) => { - this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY N-DAY BOT SERVED ', requestsByDayBotServed); + console.log('[ANALYTICS - CONVS] - REQUESTS BY N-DAY BOT SERVED ', requestsByDayBotServed); // CREATES THE INITIAL ARRAY WITH THE LAST SEVEN DAYS (calculated with moment) AND REQUESTS COUNT = O const last7days_initarray = [] @@ -565,8 +590,8 @@ export class RequestsComponent implements OnInit { } } - this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY FORMATTED ', requestsByDay_array); - this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY BOT SERVED FORMATTED ', requestByDayBotServed_array); + console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY FORMATTED ', requestsByDay_array); + console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY BOT SERVED FORMATTED ', requestByDayBotServed_array); /** * MERGE THE ARRAY last7days_initarray WITH requestsByDay_array */ @@ -575,10 +600,10 @@ export class RequestsComponent implements OnInit { // If not, then the same element in last7days i.e. obj is returned. // human const requestByDays_final_array = last7days_initarray.map(obj => requestsByDay_array.find(o => o.day === obj.day) || obj); - this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - FINAL ARRAY ', requestByDays_final_array); + console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - FINAL ARRAY ', requestByDays_final_array); // bot const requestByDaysBotServed_final_array = last7days_initarray.map(obj => requestByDayBotServed_array.find(o => o.day === obj.day) || obj); - this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY BOT SERVED - FINAL ARRAY ', requestByDaysBotServed_final_array); + console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY BOT SERVED - FINAL ARRAY ', requestByDaysBotServed_final_array); // human const _requestsByDay_series_array = []; @@ -607,15 +632,33 @@ export class RequestsComponent implements OnInit { }) + + const humanCounts = requestByDays_final_array.map(req => req.count); + const botCounts = requestByDaysBotServed_final_array.map(req => req.count); + + console.log('[ANALYTICS - CONVS] - humanCounts ', humanCounts); + console.log('[ANALYTICS - CONVS] - botCounts ', botCounts); + + this.totalHuman = humanCounts.reduce((sum, val) => sum + val, 0); + this.totalBot = botCounts.reduce((sum, val) => sum + val, 0); + this.percentageOfRequestsHandledByBots = this.totalBot > 0 ? ((this.totalBot / (this.totalHuman + this.totalBot)) * 100).toFixed(1).replace('.', ',') : '0'; + + console.log('[ANALYTICS - CONVS] - totalHuman ', this.totalHuman); + console.log('[ANALYTICS - CONVS] - totalBot ', this.totalBot); + console.log('[ANALYTICS - CONVS] - percentageOfRequestsHandledByBots ', this.percentageOfRequestsHandledByBots); + this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - SERIES (ARRAY OF COUNT - to use for debug)', requestsByDay_series_array); this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - SERIES (+ NEW + ARRAY OF COUNT)', _requestsByDay_series_array); this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - SERIES (+ NEW + ARRAY OF COUNT)', _requestsByDayBotServed_series_array); this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - LABELS (ARRAY OF DAY - to use for debug)', requestsByDay_labels_array); this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - LABELS (+ NEW + ARRAY OF DAY)', _requestsByDay_labels_array); + //get higher value of xvalue array - const higherCount = this.getMaxOfArray(_requestsByDay_series_array); - this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - HIGHTER COUNT ', higherCount); + // const higherCount = this.getMaxOfArray(_requestsByDay_series_array); + const higherCount = this.getMaxValueFromArrays(humanCounts, botCounts); + console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY -> HIGHTER COUNT ', higherCount); + console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY -> _requestsByDay_series_array ', _requestsByDay_series_array); //set the stepsize var stepsize; @@ -716,7 +759,7 @@ export class RequestsComponent implements OnInit { }, display: true, fontColor: 'black', - suggestedMax: higherCount + 2, + suggestedMax: higherCount + 1, // callback: function (value, index, values) { From a81ddc77bbc6e9c8bf1c79a9eb141b6ab93cb148 Mon Sep 17 00:00:00 2001 From: Nicola Lanzilotto Date: Tue, 31 Dec 2024 19:28:27 +0100 Subject: [PATCH 03/10] Minor improvements --- .../home-convs-graph.component.html | 4 ++-- .../home-convs-graph.component.scss | 6 +++++- .../home-convs-graph.component.ts | 16 ++++++++++------ src/app/services/role.service.ts | 2 +- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/app/home-components/home-convs-graph/home-convs-graph.component.html b/src/app/home-components/home-convs-graph/home-convs-graph.component.html index 1f374ac65820..55a7fc8af60c 100644 --- a/src/app/home-components/home-convs-graph/home-convs-graph.component.html +++ b/src/app/home-components/home-convs-graph/home-convs-graph.component.html @@ -95,11 +95,11 @@
- {{percentageOfRequestsHandledByBots}}% + {{percentageOfRequestsHandledByBots}}% - percentage handled by bots + Percentage handled by bots
diff --git a/src/app/home-components/home-convs-graph/home-convs-graph.component.scss b/src/app/home-components/home-convs-graph/home-convs-graph.component.scss index 69820a10a44d..fdcf1c79c4c5 100644 --- a/src/app/home-components/home-convs-graph/home-convs-graph.component.scss +++ b/src/app/home-components/home-convs-graph/home-convs-graph.component.scss @@ -30,7 +30,7 @@ } .gap-3 { - gap: 3px!important; + gap: 3px !important; } .flex-auto { @@ -160,6 +160,10 @@ font-weight: 400; } +.home-percentage-symbol { + font-size: 21px; +} + // @media (min-width: 600px) { // .sm\:grid-cols-2 { // grid-template-columns: repeat(2, minmax(0, 1fr)) !important; diff --git a/src/app/home-components/home-convs-graph/home-convs-graph.component.ts b/src/app/home-components/home-convs-graph/home-convs-graph.component.ts index 59628262ead1..e23006033e5d 100644 --- a/src/app/home-components/home-convs-graph/home-convs-graph.component.ts +++ b/src/app/home-components/home-convs-graph/home-convs-graph.component.ts @@ -331,6 +331,11 @@ export class HomeConvsGraphComponent implements OnInit, OnChanges { } + getMaxValueFromArrays(array1: number[], array2: number[]): number { + const mergedArray = [...array1, ...array2]; + console.log('mergedArray', mergedArray) + return Math.max(...mergedArray); + } getRequestByLastNDayMerge(lastdays) { this.logger.log('[HOME-CONVS-GRAPH] - -> NEW METHOD lastdays ', lastdays); @@ -376,10 +381,9 @@ export class HomeConvsGraphComponent implements OnInit, OnChanges { this.totalHuman = humanCounts.reduce((sum, val) => sum + val, 0); this.totalBot = botCounts.reduce((sum, val) => sum + val, 0); - // const higherCount = this.getMaxOfArray(this.totalHuman + this.totalBot); + const higherCount = this.getMaxValueFromArrays(humanCounts, botCounts); - this.percentageOfRequestsHandledByBots = - this.totalBot > 0 ? ((this.totalBot / (this.totalHuman + this.totalBot)) * 100).toFixed(1).replace('.', ',') : '0'; + this.percentageOfRequestsHandledByBots = this.totalBot > 0 ? ((this.totalBot / (this.totalHuman + this.totalBot)) * 100).toFixed(1).replace('.', ',') : '0'; this.logger.log('[HOME-CONVS-GRAPH] - -> NEW METHOD Human Total:', this.totalHuman); @@ -388,13 +392,13 @@ export class HomeConvsGraphComponent implements OnInit, OnChanges { this.logger.log('[HOME-CONVS-GRAPH] - -> NEW METHOD labels:', labels); // Step 6: Render the chart - this.renderChart(labels, humanCounts, botCounts); + this.renderChart(labels, humanCounts, botCounts,higherCount); }, (error) => { this.logger.error('[HOME-CONVS-GRAPH] - -> NEW METHOD ERROR:', error); }); } - renderChart(labels, humanCounts, botCounts) { + renderChart(labels, humanCounts, botCounts, higherCount) { this.lineChart = new Chart('lastNdayChart', { type: 'line', @@ -478,7 +482,7 @@ export class HomeConvsGraphComponent implements OnInit, OnChanges { }, display: true, fontColor: 'white', - // suggestedMax: this.higherCount + 1, + suggestedMax: higherCount + 1, } }] }, diff --git a/src/app/services/role.service.ts b/src/app/services/role.service.ts index 5f79a946d783..45ce7bc0fc17 100644 --- a/src/app/services/role.service.ts +++ b/src/app/services/role.service.ts @@ -50,7 +50,7 @@ export class RoleService { this.logger.log('[ROLE-SERV] - checkRoleForCurrentProject projectUserRole', projectUserRole) } } else { - this.logger.error('[ROLE-SERV] - checkRoleForCurrentProject projectUserRole * Error *', projectUserRole) + this.logger.log('[ROLE-SERV] - checkRoleForCurrentProject projectUserRole * Error *', projectUserRole) const _projectUserRole = await this.getProjectUser(userId, projectId) this.logger.log('[ROLE-SERV] - checkRoleForCurrentProject _projectUserRole GET from remote', _projectUserRole) if (_projectUserRole === 'agent') { From d8390876c9bdfce555bc6224abe489125cff4a1c Mon Sep 17 00:00:00 2001 From: Nicola Lanzilotto Date: Wed, 1 Jan 2025 12:10:52 +0100 Subject: [PATCH 04/10] Adjust the height of the cards in Analytics > Metrics > Satisfaction --- .../satisfaction/satisfaction.component.html | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/app/analytics/metrics/satisfaction/satisfaction.component.html b/src/app/analytics/metrics/satisfaction/satisfaction.component.html index 8939a0b76ab8..67047ac34a10 100755 --- a/src/app/analytics/metrics/satisfaction/satisfaction.component.html +++ b/src/app/analytics/metrics/satisfaction/satisfaction.component.html @@ -10,20 +10,28 @@

-
+
{{ "Analytics.Satisfaction.SatisfactionStar" | translate }}
-

{{ avgSatisfaction | number : '1.2-2'}}

+

+ + {{ avgSatisfaction }} +

-
+
diff --git a/src/app/analytics/metrics/requests/requests.component.ts b/src/app/analytics/metrics/requests/requests.component.ts index ee2efcb0f809..e08158f3b462 100755 --- a/src/app/analytics/metrics/requests/requests.component.ts +++ b/src/app/analytics/metrics/requests/requests.component.ts @@ -45,7 +45,7 @@ export class RequestsComponent implements OnInit { conversationsCountLastMonth: any; conversationType = [ { id: '', name: 'All' }, - ... CHANNELS + ...CHANNELS ]; percentageOfRequestsHandledByBots: any; @@ -166,16 +166,16 @@ export class RequestsComponent implements OnInit { } } - conversationTypeSelected(selectedChannelId){ + conversationTypeSelected(selectedChannelId) { this.logger.log("[ANALYTICS - CONVS] Selected channel: ", selectedChannelId); this.lineChart.destroy(); this.subscription.unsubscribe(); if (!this.selectedAgentId) { this.getRequestByLastNDayMerge(this.selectedDaysId, this.selectedDeptId, selectedChannelId) - console.log('[ANALYTICS - CONVS] agentSelected getRequestByLastNDayMerge REQUEST:', this.selectedDaysId, this.selectedDeptId) + this.logger.log('[ANALYTICS - CONVS] agentSelected getRequestByLastNDayMerge REQUEST:', this.selectedDaysId, this.selectedDeptId) } else { this.getRequestByLastNDay(this.selectedDaysId, this.selectedDeptId, this.selectedAgentId, selectedChannelId) - console.log('[ANALYTICS - CONVS] agentSelected getRequestByLastNDay REQUEST:', this.selectedDaysId, this.selectedDeptId, this.selectedAgentId, selectedChannelId) + this.logger.log('[ANALYTICS - CONVS] agentSelected getRequestByLastNDay REQUEST:', this.selectedDaysId, this.selectedDeptId, this.selectedAgentId, selectedChannelId) } } @@ -209,8 +209,8 @@ export class RequestsComponent implements OnInit { const projectUsers = this.usersService.getProjectUsersByProjectId(); const bots = this.faqKbService.getAllBotByProjectId(); - - zip(projectUsers, bots, (_projectUsers: any, _bots: any) => ({ _projectUsers, _bots })) + + zip(projectUsers, bots, (_projectUsers: any, _bots: any) => ({ _projectUsers, _bots })) .subscribe(pair => { this.logger.log('[ANALYTICS - CONVS] - GET P-USERS-&-BOTS - PROJECT USERS : ', pair._projectUsers); this.logger.log('[ANALYTICS - CONVS] - GET P-USERS-&-BOTS - BOTS: ', pair._bots); @@ -286,12 +286,12 @@ export class RequestsComponent implements OnInit { getAggregateValue() { this.analyticsService.getLastMountConversationsCount().subscribe((res: any) => { - console.log("[ANALYTICS - CONVS] LAST MONTH CONVERSATIONS COUNT: ", res); + this.logger.log("[ANALYTICS - CONVS] LAST MONTH CONVERSATIONS COUNT: ", res); if (res && res[0]) { this.conversationsCountLastMonth = res[0].totalCount; - console.log("[ANALYTICS - CONVS] --> Conversations Last Month Count: ", this.conversationsCountLastMonth); + this.logger.log("[ANALYTICS - CONVS] --> Conversations Last Month Count: ", this.conversationsCountLastMonth); } else { - console.log("[ANALYTICS - CONVS] --> Conversations Last Month Count - THERE ARE NOT CONVS IN THE LAST MONTH"); + this.logger.log("[ANALYTICS - CONVS] --> Conversations Last Month Count - THERE ARE NOT CONVS IN THE LAST MONTH"); this.conversationsCountLastMonth = 0; } }, (error) => { @@ -301,10 +301,10 @@ export class RequestsComponent implements OnInit { } getRequestByLastNDay(lastdays, depID, participantID, channelID) { - console.log("[ANALYTICS - CONVS] user has filter participantID"); - let agentIsAChatbot = false + this.logger.log("[ANALYTICS - CONVS] user has filter participantID"); + let agentIsAChatbot = false if (participantID.includes("bot")) { - console.log("[ANALYTICS - CONVS] Selected Agent is a BOT"); + this.logger.log("[ANALYTICS - CONVS] Selected Agent is a BOT"); // try to change chart's colors agentIsAChatbot = true } @@ -372,12 +372,12 @@ export class RequestsComponent implements OnInit { this.totalBot = 0 this.percentageOfRequestsHandledByBots = 0 } - - console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - _requestsByDay_series_array', _requestsByDay_series_array); - console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - this.totalBot', this.totalBot); - console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - this.totalBot', this.totalHuman); - + + this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - _requestsByDay_series_array', _requestsByDay_series_array); + this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - this.totalBot', this.totalBot); + this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - this.totalBot', this.totalHuman); + this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - SERIES (ARRAY OF COUNT - to use for debug)', requestsByDay_series_array); this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - SERIES (+ NEW + ARRAY OF COUNT)', _requestsByDay_series_array); this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - LABELS (ARRAY OF DAY - to use for debug)', requestsByDay_labels_array); @@ -385,8 +385,8 @@ export class RequestsComponent implements OnInit { //get higher value of xvalue array const higherCount = this.getMaxOfArray(_requestsByDay_series_array); - console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - -> HIGHTER COUNT ', higherCount); - console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - ->_requestsByDay_series_array ', _requestsByDay_series_array); + this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - -> HIGHTER COUNT ', higherCount); + this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - ->_requestsByDay_series_array ', _requestsByDay_series_array); //set the stepsize var stepsize; @@ -544,19 +544,19 @@ export class RequestsComponent implements OnInit { } getMaxValueFromArrays(array1: number[], array2: number[]): number { const mergedArray = [...array1, ...array2]; - console.log('mergedArray', mergedArray) + this.logger.log('mergedArray', mergedArray) return Math.max(...mergedArray); } //-----------LAST n DAYS GRAPH----------------------- getRequestByLastNDayMerge(lastdays, depID, channelID) { - console.log("[ANALYTICS - CONVS] GET REQUEST TYPE: Merged lastdays" , lastdays) + this.logger.log("[ANALYTICS - CONVS] GET REQUEST TYPE: Merged lastdays", lastdays) this.subscription = this.analyticsService.requestsByDay(lastdays, depID, '', channelID).subscribe((requestsByDay: any) => { - console.log('[ANALYTICS - CONVS] - REQUESTS BY N-DAY ', requestsByDay); + this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY N-DAY ', requestsByDay); this.analyticsService.requestsByDayBotServed(lastdays, depID, '', channelID).subscribe((requestsByDayBotServed: any) => { - console.log('[ANALYTICS - CONVS] - REQUESTS BY N-DAY BOT SERVED ', requestsByDayBotServed); + this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY N-DAY BOT SERVED ', requestsByDayBotServed); // CREATES THE INITIAL ARRAY WITH THE LAST SEVEN DAYS (calculated with moment) AND REQUESTS COUNT = O const last7days_initarray = [] @@ -590,8 +590,8 @@ export class RequestsComponent implements OnInit { } } - console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY FORMATTED ', requestsByDay_array); - console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY BOT SERVED FORMATTED ', requestByDayBotServed_array); + this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY FORMATTED ', requestsByDay_array); + this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY BOT SERVED FORMATTED ', requestByDayBotServed_array); /** * MERGE THE ARRAY last7days_initarray WITH requestsByDay_array */ @@ -600,10 +600,10 @@ export class RequestsComponent implements OnInit { // If not, then the same element in last7days i.e. obj is returned. // human const requestByDays_final_array = last7days_initarray.map(obj => requestsByDay_array.find(o => o.day === obj.day) || obj); - console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - FINAL ARRAY ', requestByDays_final_array); + this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - FINAL ARRAY ', requestByDays_final_array); // bot const requestByDaysBotServed_final_array = last7days_initarray.map(obj => requestByDayBotServed_array.find(o => o.day === obj.day) || obj); - console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY BOT SERVED - FINAL ARRAY ', requestByDaysBotServed_final_array); + this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY BOT SERVED - FINAL ARRAY ', requestByDaysBotServed_final_array); // human const _requestsByDay_series_array = []; @@ -632,20 +632,20 @@ export class RequestsComponent implements OnInit { }) - + const humanCounts = requestByDays_final_array.map(req => req.count); const botCounts = requestByDaysBotServed_final_array.map(req => req.count); - console.log('[ANALYTICS - CONVS] - humanCounts ', humanCounts); - console.log('[ANALYTICS - CONVS] - botCounts ', botCounts); + this.logger.log('[ANALYTICS - CONVS] - humanCounts ', humanCounts); + this.logger.log('[ANALYTICS - CONVS] - botCounts ', botCounts); - this.totalHuman = humanCounts.reduce((sum, val) => sum + val, 0); - this.totalBot = botCounts.reduce((sum, val) => sum + val, 0); - this.percentageOfRequestsHandledByBots = this.totalBot > 0 ? ((this.totalBot / (this.totalHuman + this.totalBot)) * 100).toFixed(1).replace('.', ',') : '0'; + this.totalHuman = humanCounts.reduce((sum, val) => sum + val, 0); + this.totalBot = botCounts.reduce((sum, val) => sum + val, 0); + this.percentageOfRequestsHandledByBots = this.totalBot > 0 ? ((this.totalBot / (this.totalHuman + this.totalBot)) * 100).toFixed(1).replace('.', ',') : '0'; - console.log('[ANALYTICS - CONVS] - totalHuman ', this.totalHuman); - console.log('[ANALYTICS - CONVS] - totalBot ', this.totalBot); - console.log('[ANALYTICS - CONVS] - percentageOfRequestsHandledByBots ', this.percentageOfRequestsHandledByBots); + this.logger.log('[ANALYTICS - CONVS] - totalHuman ', this.totalHuman); + this.logger.log('[ANALYTICS - CONVS] - totalBot ', this.totalBot); + this.logger.log('[ANALYTICS - CONVS] - percentageOfRequestsHandledByBots ', this.percentageOfRequestsHandledByBots); this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - SERIES (ARRAY OF COUNT - to use for debug)', requestsByDay_series_array); this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - SERIES (+ NEW + ARRAY OF COUNT)', _requestsByDay_series_array); @@ -653,12 +653,12 @@ export class RequestsComponent implements OnInit { this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - LABELS (ARRAY OF DAY - to use for debug)', requestsByDay_labels_array); this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - LABELS (+ NEW + ARRAY OF DAY)', _requestsByDay_labels_array); - + //get higher value of xvalue array // const higherCount = this.getMaxOfArray(_requestsByDay_series_array); const higherCount = this.getMaxValueFromArrays(humanCounts, botCounts); - console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY -> HIGHTER COUNT ', higherCount); - console.log('[ANALYTICS - CONVS] - REQUESTS BY DAY -> _requestsByDay_series_array ', _requestsByDay_series_array); + this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY -> HIGHTER COUNT ', higherCount); + this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY -> _requestsByDay_series_array ', _requestsByDay_series_array); //set the stepsize var stepsize; @@ -689,7 +689,8 @@ export class RequestsComponent implements OnInit { pointBorderColor: '#b00e0e' }, { - label: this.translate.instant('ServedByHumans'), // 'Served by humans',//active labet setting to true the legend value + // label: this.translate.instant('ServedByHumans'), // 'Served by humans',//active labet setting to true the legend value + label: this.translate.instant('TotalConversations'), // 'Served by humans',//active labet setting to true the legend value data: _requestsByDay_series_array, fill: true, //riempie zona sottostante dati lineTension: 0.0, @@ -782,7 +783,9 @@ export class RequestsComponent implements OnInit { // } // label += Math.round(tooltipItem.yLabel * 100) / 100; // return label + ''; - //this.logger.log("data",data) + // this.logger.log("------ > data", data) + // this.logger.log("------ > tooltipItem", tooltipItem) + const currentItemValue = tooltipItem.yLabel // let langService = new HumanizeDurationLanguage(); // let humanizer = new HumanizeDuration(langService); diff --git a/src/app/home-components/home-convs-graph/home-convs-graph.component.html b/src/app/home-components/home-convs-graph/home-convs-graph.component.html index 55a7fc8af60c..1dd0f771da2d 100644 --- a/src/app/home-components/home-convs-graph/home-convs-graph.component.html +++ b/src/app/home-components/home-convs-graph/home-convs-graph.component.html @@ -75,7 +75,8 @@
- {{totalHuman + totalBot | number:'1.0-0'}} + + {{totalHuman | number:'1.0-0'}} diff --git a/src/app/home-components/home-convs-graph/home-convs-graph.component.ts b/src/app/home-components/home-convs-graph/home-convs-graph.component.ts index e23006033e5d..7d07bd24adb0 100644 --- a/src/app/home-components/home-convs-graph/home-convs-graph.component.ts +++ b/src/app/home-components/home-convs-graph/home-convs-graph.component.ts @@ -333,7 +333,7 @@ export class HomeConvsGraphComponent implements OnInit, OnChanges { getMaxValueFromArrays(array1: number[], array2: number[]): number { const mergedArray = [...array1, ...array2]; - console.log('mergedArray', mergedArray) + this.logger.log('mergedArray', mergedArray) return Math.max(...mergedArray); } @@ -419,7 +419,8 @@ export class HomeConvsGraphComponent implements OnInit, OnChanges { lineTension: 0.4, }, { - label: this.servedByHumans, + // label: this.servedByHumans, + label: this.translate.instant('TotalConversations'), data: humanCounts, fill: true, backgroundColor: 'rgba(30, 136, 229, 0.6)', From 3f753d33f0355cdb7c3e66e166408dcdcb688ad8 Mon Sep 17 00:00:00 2001 From: Nicola Lanzilotto Date: Mon, 13 Jan 2025 18:53:32 +0100 Subject: [PATCH 08/10] Fixes the XSS attack patterns regular expression --- src/app/utils/util.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/utils/util.ts b/src/app/utils/util.ts index 8fdfd21681f4..bd7a1115b266 100755 --- a/src/app/utils/util.ts +++ b/src/app/utils/util.ts @@ -839,7 +839,7 @@ export function containsXSS(jsonData) { const xssPatterns = [ /.*?<\/script.*?>/gi, // script tags // /on\w+\s*=\s*['"]?.*?['"]?/gi, // event handlers like onload, onclick - /on[a-z]+=/gi, + // /on[a-z]+=/gi, /eval\s*\(.*?\)/gi, // eval calls /javascript\s*:\s*.*/gi, // javascript protocol /document\.cookie/gi, // access to cookies @@ -860,7 +860,7 @@ export function isMaliciousHTML(input) { // List of common XSS attack patterns const xssPatterns = [ /)<[^<]*)*<\/script>/gi, // Script tags - /on\w+="[^"]*"/gi, // Event handlers + // /on\w+="[^"]*"/gi, // Event handlers /javascript:[^'"]*/gi, // JavaScript URLs /)<[^<]*)*<\/iframe>/gi, // Iframe tags /data:text\/html;base64,[A-Za-z0-9+/=]+/gi // Base64 encoded scripts From 8f49f9bd718173de833c043b6bb475098d778746 Mon Sep 17 00:00:00 2001 From: Nicola Lanzilotto Date: Mon, 13 Jan 2025 18:53:53 +0100 Subject: [PATCH 09/10] Updates version --- CHANGELOG.md | 3 +++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e26fe6eb85d..57f9fe0a98f5 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # tiledesk-dashboard +### 2.7.59 +- Improves and fixes the conversations report in Analytics > Metrics > Conversations + ### 2.7.58 - Minor improvements and bug fixing diff --git a/package-lock.json b/package-lock.json index ec55fb20cf1a..5a7e84e20360 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-dashboard", - "version": "2.7.58", + "version": "2.7.59", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 57b65df03ae3..65709a6d3d06 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-dashboard", - "version": "2.7.58", + "version": "2.7.59", "scripts": { "ng": "ng", "start": "ng serve --aot", From 7ed24b08e406efc1d40376885521043e0a25d24f Mon Sep 17 00:00:00 2001 From: Nicola Lanzilotto Date: Tue, 14 Jan 2025 10:06:20 +0100 Subject: [PATCH 10/10] Improves and fixes the conversations report in Analytics > Metrics > Conversations and in the home page --- .../metrics/requests/requests.component.html | 8 ++++- .../metrics/requests/requests.component.ts | 31 +++++++++++++++---- .../home-convs-graph.component.ts | 6 ++-- 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/src/app/analytics/metrics/requests/requests.component.html b/src/app/analytics/metrics/requests/requests.component.html index 7e564073e6e3..b10c77dfb983 100755 --- a/src/app/analytics/metrics/requests/requests.component.html +++ b/src/app/analytics/metrics/requests/requests.component.html @@ -79,7 +79,13 @@

- {{totalHuman | number:'1.0-0'}} + + {{totalHuman | number:'1.0-0'}} + + + {{totalBot | number:'1.0-0'}} + +

diff --git a/src/app/analytics/metrics/requests/requests.component.ts b/src/app/analytics/metrics/requests/requests.component.ts index e08158f3b462..44a8a86cafd6 100755 --- a/src/app/analytics/metrics/requests/requests.component.ts +++ b/src/app/analytics/metrics/requests/requests.component.ts @@ -51,7 +51,7 @@ export class RequestsComponent implements OnInit { percentageOfRequestsHandledByBots: any; totalHuman: number; totalBot: number; - + agentIsAChatbot: boolean = false; constructor( private analyticsService: AnalyticsService, private translate: TranslateService, @@ -302,11 +302,14 @@ export class RequestsComponent implements OnInit { getRequestByLastNDay(lastdays, depID, participantID, channelID) { this.logger.log("[ANALYTICS - CONVS] user has filter participantID"); - let agentIsAChatbot = false + this.totalBot = 0; + this.totalHuman = 0; + this.agentIsAChatbot = false + if (participantID.includes("bot")) { this.logger.log("[ANALYTICS - CONVS] Selected Agent is a BOT"); // try to change chart's colors - agentIsAChatbot = true + this.agentIsAChatbot = true } this.logger.log("[ANALYTICS - CONVS] GET REQUEST TYPE: For Agent/Bot") this.subscription = this.analyticsService.requestsByDay(lastdays, depID, participantID, channelID).subscribe((requestsByDay: any) => { @@ -363,16 +366,25 @@ export class RequestsComponent implements OnInit { _requestsByDay_labels_array.push(splitted_date[0] + ' ' + this.monthNames[splitted_date[1]]) }); - if (agentIsAChatbot) { + if (this.agentIsAChatbot) { this.totalBot = _requestsByDay_series_array.reduce((sum, val) => sum + val, 0); + this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - totalBot 1', this.totalBot); this.totalHuman = 0 - this.percentageOfRequestsHandledByBots = 100 + if (this.totalBot > 0) { + this.percentageOfRequestsHandledByBots = 100 + } else { + this.percentageOfRequestsHandledByBots = 0 + } + } else { this.totalHuman = _requestsByDay_series_array.reduce((sum, val) => sum + val, 0); + this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - totalHuman 1', this.totalBot); this.totalBot = 0 this.percentageOfRequestsHandledByBots = 0 } + // this.percentageOfRequestsHandledByBots = this.totalBot > 0 ? ((this.totalBot / (this.totalHuman)) * 100).toFixed(1).replace('.', ',') : '0'; + this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - _requestsByDay_series_array', _requestsByDay_series_array); this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY DAY - this.totalBot', this.totalBot); @@ -551,6 +563,11 @@ export class RequestsComponent implements OnInit { //-----------LAST n DAYS GRAPH----------------------- getRequestByLastNDayMerge(lastdays, depID, channelID) { + this.logger.log("[ANALYTICS - CONVS] user NOT has filter participantID"); + this.totalBot = 0; + this.totalHuman = 0; + this.agentIsAChatbot = false + this.logger.log("[ANALYTICS - CONVS] GET REQUEST TYPE: Merged lastdays", lastdays) this.subscription = this.analyticsService.requestsByDay(lastdays, depID, '', channelID).subscribe((requestsByDay: any) => { this.logger.log('[ANALYTICS - CONVS] - REQUESTS BY N-DAY ', requestsByDay); @@ -641,7 +658,9 @@ export class RequestsComponent implements OnInit { this.totalHuman = humanCounts.reduce((sum, val) => sum + val, 0); this.totalBot = botCounts.reduce((sum, val) => sum + val, 0); - this.percentageOfRequestsHandledByBots = this.totalBot > 0 ? ((this.totalBot / (this.totalHuman + this.totalBot)) * 100).toFixed(1).replace('.', ',') : '0'; + // + this.totalBot + this.percentageOfRequestsHandledByBots = this.totalBot > 0 ? ((this.totalBot / (this.totalHuman )) * 100).toFixed(2).replace('.', ',') : '0'; + this.logger.log('[ANALYTICS - CONVS] - totalHuman ', this.totalHuman); this.logger.log('[ANALYTICS - CONVS] - totalBot ', this.totalBot); diff --git a/src/app/home-components/home-convs-graph/home-convs-graph.component.ts b/src/app/home-components/home-convs-graph/home-convs-graph.component.ts index 7d07bd24adb0..0de0af3adc3a 100644 --- a/src/app/home-components/home-convs-graph/home-convs-graph.component.ts +++ b/src/app/home-components/home-convs-graph/home-convs-graph.component.ts @@ -382,9 +382,9 @@ export class HomeConvsGraphComponent implements OnInit, OnChanges { this.totalBot = botCounts.reduce((sum, val) => sum + val, 0); const higherCount = this.getMaxValueFromArrays(humanCounts, botCounts); - - this.percentageOfRequestsHandledByBots = this.totalBot > 0 ? ((this.totalBot / (this.totalHuman + this.totalBot)) * 100).toFixed(1).replace('.', ',') : '0'; - + // + this.totalBot + this.percentageOfRequestsHandledByBots = this.totalBot > 0 ? ((this.totalBot / (this.totalHuman )) * 100).toFixed(2).replace('.', ',') : '0'; + this.logger.log('[HOME-CONVS-GRAPH] - -> NEW METHOD Human Total:', this.totalHuman); this.logger.log('[HOME-CONVS-GRAPH] - -> NEW METHOD Bot Total:', this.totalBot);