diff --git a/%ProgramData%/Microsoft/Windows/UUS/State/_active.uusver b/%ProgramData%/Microsoft/Windows/UUS/State/_active.uusver index 81f26ae..2776606 100644 --- a/%ProgramData%/Microsoft/Windows/UUS/State/_active.uusver +++ b/%ProgramData%/Microsoft/Windows/UUS/State/_active.uusver @@ -1 +1 @@ -1307.2407.15032.0 \ No newline at end of file +1308.2407.15042.0 \ No newline at end of file diff --git a/src/components/BarChart/index.tsx b/src/components/BarChart/index.tsx index 928cb84..92ab23d 100644 --- a/src/components/BarChart/index.tsx +++ b/src/components/BarChart/index.tsx @@ -1,6 +1,6 @@ import React from 'react'; import * as S from './styles'; -import { Dimensions } from 'react-native'; +import { Dimensions, Text } from 'react-native'; import { BarChart } from 'react-native-chart-kit'; import ScatterPlotComponent, { ScatterPlotProps } from '@components/Scratter'; @@ -16,26 +16,30 @@ export interface BarChartProps { const BarChartComponent: React.FC = ({ type, - questionsBar, + questionsBar = [], moduleAverages, }) => { const chartWidth = Dimensions.get('window').width - 50; const chartHeight = 200; - const barChartData = { - labels: questionsBar?.map((_item, index) => `${index + 1}`), - datasets: [ - { - data: questionsBar?.map((item) => - Math.min(Math.max(item.averageGrade, 0), 5) - ), - colors: questionsBar?.map( - () => - (_opacity = 1) => - '#3E63DD' - ), - }, - ], - }; + const hasBarChartData = questionsBar && questionsBar.length > 0; + + const barChartData = hasBarChartData + ? { + labels: questionsBar.map((_item, index) => `${index + 1}`), + datasets: [ + { + data: questionsBar.map((item) => + Math.min(Math.max(item.averageGrade, 0), 5) + ), + colors: questionsBar.map( + () => + (_opacity = 1) => + '#3E63DD' + ), + }, + ], + } + : null; const barChartConfig = { backgroundGradientFrom: '#F8F9FA', @@ -56,21 +60,23 @@ const BarChartComponent: React.FC = ({ {type === 'modulo' && ( <> Médias por módulo - + {hasBarChartData && barChartData && ( + + )} )} {type === 'matriz' && ( diff --git a/src/services/ModuleGradeService.ts b/src/services/ModuleGradeService.ts index b843f7c..6a42e58 100644 --- a/src/services/ModuleGradeService.ts +++ b/src/services/ModuleGradeService.ts @@ -65,7 +65,6 @@ export default class ModuleGradeServices { ): Promise { const moduleGradeSellerResponse: AxiosResponse = await api.get(`/module/getAllModuleInfo/${supervisorID}`); - console.log(moduleGradeSellerResponse.data); return moduleGradeSellerResponse.data; }