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/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/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..b1817f65 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, 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)} { fieldProps={{ step: 1 }} /> + + } + tooltip={} + width="lg" + /> + { + + } + tooltip={} + width="lg" + /> + { 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',