From 9d22ef95315e1fe7ce7fe6216b3a494855962890 Mon Sep 17 00:00:00 2001 From: "mateusz.bieniek" Date: Thu, 16 Apr 2026 08:57:40 +0200 Subject: [PATCH 1/3] Add enable ai analysis switch in consultation and webinar forms --- src/locales/pl-PL.ts | 2 ++ src/pages/Consultations/form.tsx | 10 +++++++++- src/pages/Webinars/form.tsx | 12 +++++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/locales/pl-PL.ts b/src/locales/pl-PL.ts index 29c74acd..a3e450b2 100644 --- a/src/locales/pl-PL.ts +++ b/src/locales/pl-PL.ts @@ -379,6 +379,8 @@ export default { target_group: 'Grupa docelowa', author_tutor: 'Autor / Nauczyciel', short_description: 'Krótki opis', + ai_analysis_enable_label: 'Analiza nagrania AI', + ai_analysis_enable_tooltip: 'Zaznacz tę opcję aby włączyć analizę badania atencji oraz satystakcji użytkowników na spotkaniu', summary: 'Podsumowanie', summary_tooltip: 'Dany edytor WYSIWYG zawiera narzędzia do formatowania, zachowując jednocześnie możliwość pisania Markdown z klawiatury oraz wyświetlania zwykłego Markdown.', diff --git a/src/pages/Consultations/form.tsx b/src/pages/Consultations/form.tsx index a993cdac..2d6ecc90 100644 --- a/src/pages/Consultations/form.tsx +++ b/src/pages/Consultations/form.tsx @@ -2,7 +2,7 @@ import ProCard from '@ant-design/pro-card'; import ProForm, { ProFormDatePicker, ProFormDigit, - ProFormSelect, + ProFormSelect, ProFormSwitch, ProFormText, } from '@ant-design/pro-form'; import { Alert, Button, Col, Row, Spin } from 'antd'; @@ -357,6 +357,14 @@ const ConsultationForm = () => { fieldProps={{ step: 1 }} /> + + } + tooltip={} + width="lg" + /> + { + + } + tooltip={} + width="lg" + /> + Date: Thu, 16 Apr 2026 09:53:20 +0200 Subject: [PATCH 2/3] Add translations, change rating color display method --- src/locales/en-US.ts | 2 ++ src/locales/fr-FR.ts | 2 ++ .../components/EffectivenessAnalysis.tsx | 28 +++++++++++-------- .../EffectivenessAnalysisDetails.tsx | 11 ++++++-- src/utils/utils.ts | 6 ++++ 5 files changed, 35 insertions(+), 14 deletions(-) diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index e35f7dbd..1afafe7c 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -398,6 +398,8 @@ export default { short_description: 'Short description', description_tooltip: 'The editor is WYSIWYG and includes formatting tools whilst retaining the ability to write markdown shortcuts inline and output plain Markdown.', + ai_analysis_enable_label: 'AI Recording Analysis', + ai_analysis_enable_tooltip: 'Check this option to enable AI-powered analysis of user attention and satisfaction during the meeting', attributes: 'Attributes', new_course: 'New course', new_questionnaire: 'New Questionnaire', diff --git a/src/locales/fr-FR.ts b/src/locales/fr-FR.ts index 21d38f5c..ba1430b7 100644 --- a/src/locales/fr-FR.ts +++ b/src/locales/fr-FR.ts @@ -256,6 +256,8 @@ export default { summary_tooltip: 'The editor is WYSIWYG and includes formatting tools whilst retaining the ability to write markdown shortcuts inline and output plain Markdown.', short_description: 'Short description', + ai_analysis_enable_label: 'Analyse de l’enregistrement par IA', + ai_analysis_enable_tooltip: 'Cochez cette option pour activer l’analyse de l’attention et de la satisfaction des utilisateurs pendant la réunion', description: 'Description', description_tooltip: 'The editor is WYSIWYG and includes formatting tools whilst retaining the ability to write markdown shortcuts inline and output plain Markdown.', diff --git a/src/pages/Consultations/components/EffectivenessAnalysis.tsx b/src/pages/Consultations/components/EffectivenessAnalysis.tsx index 4a3c6d12..15e5b907 100644 --- a/src/pages/Consultations/components/EffectivenessAnalysis.tsx +++ b/src/pages/Consultations/components/EffectivenessAnalysis.tsx @@ -6,7 +6,7 @@ import { createTableOrderObject, EMOTION_POOL, formatPercent, - getLabelColorByValue, + getLabelColorByValue, getRatingLabelColorByValue, } from '@/utils/utils'; import { Link } from '@@/exports'; import { @@ -79,10 +79,12 @@ const ValueTag = React.memo( value, suffix = '', isRaw = false, + rating, }: { value: string | number; suffix?: string; isRaw?: boolean; + rating?: boolean; }) => { const displayValue = useMemo(() => { if (isRaw) return formatPercent(value); @@ -90,7 +92,7 @@ const ValueTag = React.memo( return isNaN(num) ? '0.00' : num.toFixed(2); }, [value, isRaw]); - const color = useMemo(() => getLabelColorByValue(parseFloat(displayValue)), [displayValue]); + const color = useMemo(() => rating ? getRatingLabelColorByValue(parseFloat(displayValue)) : getLabelColorByValue(parseFloat(displayValue)), [displayValue]); return ( @@ -101,6 +103,15 @@ const ValueTag = React.memo( }, ); +const createEmotionColumn = (emoji: string, dataKey: string): ProColumns => ({ + title: {emoji}, + dataIndex: `avg_emotions_${dataKey}` as keyof RecommenderTerm, + hideInSearch: true, + align: 'center', + width: 45, + render: (val) => `${formatPercent(val as string)}%`, +}); + export const EffectivenessAnalysis = ({ modelType = 'consultation', }: EffectivenessAnalysisProps) => { @@ -117,14 +128,7 @@ export const EffectivenessAnalysis = ({ [modelType], ); - const createEmotionColumn = (emoji: string, dataKey: string): ProColumns => ({ - title: {emoji}, - dataIndex: `avg_emotions_${dataKey}` as keyof RecommenderTerm, - hideInSearch: true, - align: 'center', - width: 45, - render: (val) => `${formatPercent(val as string)}%`, - }); + const columns: ProColumns[] = useMemo( () => [ @@ -156,7 +160,7 @@ export const EffectivenessAnalysis = ({ title: , dataIndex: 'category_id', hideInTable: true, - renderFormItem: ({ type, ...rest }) => , + renderFormItem: ({ ...rest }) => , }, { title: , @@ -182,7 +186,7 @@ export const EffectivenessAnalysis = ({ dataIndex: 'rating', hideInSearch: true, width: 60, - render: (_, record) => , + render: (_, record) => , }, { title: , diff --git a/src/pages/Consultations/components/EffectivenessAnalysisDetails.tsx b/src/pages/Consultations/components/EffectivenessAnalysisDetails.tsx index de92ab48..7555effc 100644 --- a/src/pages/Consultations/components/EffectivenessAnalysisDetails.tsx +++ b/src/pages/Consultations/components/EffectivenessAnalysisDetails.tsx @@ -6,7 +6,10 @@ import type { ChartPoint, } from '@/pages/Consultations/components/types'; import { getAnalyticsChartFrames, getModelAnalytics } from '@/services/escola-lms/consultations'; -import {ANALYSIS_COLORS, EmotionKey, formatExpirationTime, formatRating, getLabelColorByValue} from '@/utils/utils'; +import { + ANALYSIS_COLORS, EmotionKey, formatExpirationTime, formatRating, getLabelColorByValue, + getRatingLabelColorByValue +} from '@/utils/utils'; import { PageContainer } from '@ant-design/pro-components'; import { Card, Col, Select, Space, Typography, message } from 'antd'; import React, { useEffect, useMemo, useState } from 'react'; @@ -80,6 +83,10 @@ const EffectivenessAnalysisDetails = () => { () => getLabelColorByValue(analysisMeta?.rating ? analysisMeta.rating : 0), [analysisMeta?.rating], ); + const ratingColor = useMemo( + () => getRatingLabelColorByValue(analysisMeta?.rating ? analysisMeta.rating : 0), + [analysisMeta?.rating], + ); console.log(color, 'color'); @@ -189,7 +196,7 @@ const EffectivenessAnalysisDetails = () => { - {formatRating(analysisMeta?.rating || 0)} + {formatRating(analysisMeta?.rating || 0)} { return ANALYSIS_COLORS.green; }; +export const getRatingLabelColorByValue = (val: number) => { + if (val < 3.5) return ANALYSIS_COLORS.red; + if (val < 7.0) return ANALYSIS_COLORS.orange; + return ANALYSIS_COLORS.green; +}; + export enum EmotionKey { SURPRISED = 'surprised', DISGUSTED = 'disgusted', From 62719a521810089670cb91e52ae02773cae8dd97 Mon Sep 17 00:00:00 2001 From: "mateusz.bieniek" Date: Thu, 16 Apr 2026 09:56:55 +0200 Subject: [PATCH 3/3] Lint update --- .../Consultations/components/EffectivenessAnalysisDetails.tsx | 2 +- src/pages/Webinars/form.tsx | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pages/Consultations/components/EffectivenessAnalysisDetails.tsx b/src/pages/Consultations/components/EffectivenessAnalysisDetails.tsx index 7555effc..b1817f65 100644 --- a/src/pages/Consultations/components/EffectivenessAnalysisDetails.tsx +++ b/src/pages/Consultations/components/EffectivenessAnalysisDetails.tsx @@ -7,7 +7,7 @@ import type { } from '@/pages/Consultations/components/types'; import { getAnalyticsChartFrames, getModelAnalytics } from '@/services/escola-lms/consultations'; import { - ANALYSIS_COLORS, EmotionKey, formatExpirationTime, formatRating, getLabelColorByValue, + ANALYSIS_COLORS, EmotionKey, formatRating, getLabelColorByValue, getRatingLabelColorByValue } from '@/utils/utils'; import { PageContainer } from '@ant-design/pro-components'; diff --git a/src/pages/Webinars/form.tsx b/src/pages/Webinars/form.tsx index 84066575..2d6501f2 100644 --- a/src/pages/Webinars/form.tsx +++ b/src/pages/Webinars/form.tsx @@ -11,7 +11,6 @@ import { createWebinar, getWebinar, updateWebinar } from '@/services/escola-lms/ import { splitImagePath, tagsArrToIds } from '@/utils/utils'; import ProCard from '@ant-design/pro-card'; import ProForm, { - ProFormCheckbox, ProFormDateTimePicker, ProFormSelect, ProFormSwitch, ProFormText, @@ -21,7 +20,6 @@ import { PageContainer } from '@ant-design/pro-layout'; import { Alert, Button, Col, Row, Spin, message } from 'antd'; import { useCallback, useEffect, useMemo, useState } from 'react'; import { FormattedMessage, history, useIntl, useParams } from 'umi'; -import CustomCheckbox from "@/pages/Roles/components/CustomCheckbox"; enum TabNames { ATTRIBUTES = 'attributes',