From c860b21695362a802a5928c83b4c929491924553 Mon Sep 17 00:00:00 2001 From: sanchis <12100597+sanchis@users.noreply.github.com> Date: Wed, 1 May 2024 15:40:33 +0200 Subject: [PATCH] chore: disable filter --- .github/workflows/schedule_deploy.yml | 4 +- components/charts/NewInfectedChart.jsx | 59 +------------------------- 2 files changed, 4 insertions(+), 59 deletions(-) diff --git a/.github/workflows/schedule_deploy.yml b/.github/workflows/schedule_deploy.yml index 991c17dbc..9a6f5f6d6 100644 --- a/.github/workflows/schedule_deploy.yml +++ b/.github/workflows/schedule_deploy.yml @@ -1,7 +1,7 @@ name: deploy-latest-log on: - schedule: - - cron: "0 */6 * * 1-5" + # schedule: desactivado ya no se actualiza mas + # - cron: "0 */6 * * 1-5" workflow_dispatch: jobs: deploy: diff --git a/components/charts/NewInfectedChart.jsx b/components/charts/NewInfectedChart.jsx index 89f9b352d..c1fcde344 100644 --- a/components/charts/NewInfectedChart.jsx +++ b/components/charts/NewInfectedChart.jsx @@ -1,70 +1,15 @@ -import { isBefore, parse, subDays, subMonths } from 'date-fns' -import React, { useState, useEffect } from 'react' +import React from 'react' import { CartesianGrid, Legend, Line, LineChart, ResponsiveContainer, Tooltip, XAxis } from 'recharts' -import Select from '../ui/select' -function dateParse (date) { - return parse(date, 'dd/MM/yy', new Date()) -} -const valuesFilter = [ - { - name: 'Últimos 6 meses', - value: '6MONTHS', - filter: (data) => data.filter(obj => isBefore(subMonths(new Date(), 6), dateParse(obj.date))) - }, - { - name: 'Últimos 3 meses', - value: '3MONTHS', - filter: (data) => data.filter(obj => isBefore(subMonths(new Date(), 3), dateParse(obj.date))) - }, - { - name: 'Últimos 30 días', - value: '1MONTHS', - filter: (data) => data.filter(obj => isBefore(subDays(new Date(), 30), dateParse(obj.date))) - }, - { - name: 'Últimos 15 días', - value: '15DAYS', - filter: (data) => data.filter(obj => isBefore(subDays(new Date(), 15), dateParse(obj.date))) - }, - { - name: 'Desde inicio hasta ahora', - value: 'FOREVERNOW', - filter: (data) => data - } -] -const DEFAULT_FILTER = valuesFilter[1] export default function NewInfectedChart ({ newInfected }) { - const [data, setData] = useState([]) - const [filter, setFilter] = useState(DEFAULT_FILTER.value) - - function onChangeFilter (event) { - const filterFn = valuesFilter.find(filter => filter.value === event.target.value).filter - setFilter(event.target.value) - setData(filterFn(newInfected)) - } - - useEffect(() => { - setData(DEFAULT_FILTER.filter(newInfected)) - }, [newInfected]) - return ( <>
Número de positivos.
-