From 25c306100cd1e3b8545f01ac71d025e874421cca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Andrei?= Date: Mon, 11 Nov 2024 19:14:54 -0300 Subject: [PATCH] Corrige i18n e linters --- .../en/LC_MESSAGES/plonegovbr.intranet.po | 2 +- .../intranet/locales/plonegovbr.intranet.pot | 2 +- .../pt_BR/LC_MESSAGES/plonegovbr.intranet.po | 2 +- .../locales/de/LC_MESSAGES/volto.po | 10 ++++++ .../locales/en/LC_MESSAGES/volto.po | 10 ++++++ .../locales/es/LC_MESSAGES/volto.po | 10 ++++++ .../locales/pt_BR/LC_MESSAGES/volto.po | 10 ++++++ .../portalbrasil-intranet/locales/volto.pot | 12 ++++++- .../src/components/Blocks/Calendario/View.jsx | 34 +++++++++++-------- 9 files changed, 73 insertions(+), 19 deletions(-) diff --git a/backend/src/plonegovbr/intranet/locales/en/LC_MESSAGES/plonegovbr.intranet.po b/backend/src/plonegovbr/intranet/locales/en/LC_MESSAGES/plonegovbr.intranet.po index fa6beef..c1382be 100644 --- a/backend/src/plonegovbr/intranet/locales/en/LC_MESSAGES/plonegovbr.intranet.po +++ b/backend/src/plonegovbr/intranet/locales/en/LC_MESSAGES/plonegovbr.intranet.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2024-10-23 23:06+0000\n" +"POT-Creation-Date: 2024-11-11 22:12+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/backend/src/plonegovbr/intranet/locales/plonegovbr.intranet.pot b/backend/src/plonegovbr/intranet/locales/plonegovbr.intranet.pot index dd11da3..473f2c7 100644 --- a/backend/src/plonegovbr/intranet/locales/plonegovbr.intranet.pot +++ b/backend/src/plonegovbr/intranet/locales/plonegovbr.intranet.pot @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2024-10-23 23:06+0000\n" +"POT-Creation-Date: 2024-11-11 22:12+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/backend/src/plonegovbr/intranet/locales/pt_BR/LC_MESSAGES/plonegovbr.intranet.po b/backend/src/plonegovbr/intranet/locales/pt_BR/LC_MESSAGES/plonegovbr.intranet.po index b886419..8933870 100644 --- a/backend/src/plonegovbr/intranet/locales/pt_BR/LC_MESSAGES/plonegovbr.intranet.po +++ b/backend/src/plonegovbr/intranet/locales/pt_BR/LC_MESSAGES/plonegovbr.intranet.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2024-10-23 23:06+0000\n" +"POT-Creation-Date: 2024-11-11 22:12+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/frontend/packages/portalbrasil-intranet/locales/de/LC_MESSAGES/volto.po b/frontend/packages/portalbrasil-intranet/locales/de/LC_MESSAGES/volto.po index 50c66ad..c619a24 100644 --- a/frontend/packages/portalbrasil-intranet/locales/de/LC_MESSAGES/volto.po +++ b/frontend/packages/portalbrasil-intranet/locales/de/LC_MESSAGES/volto.po @@ -26,6 +26,11 @@ msgstr "" msgid "Colaboradores" msgstr "" +#. Default: "Adicionar descrição dos eventos?" +#: components/Blocks/Calendario/schema +msgid "Descrição" +msgstr "" + #. Default: "Gestor" #: components/Blocks/Gestor/schema msgid "Gestor" @@ -46,6 +51,11 @@ msgstr "" msgid "Powered by Portal Brasil: Intranet, Plone & Python" msgstr "" +#. Default: "Query" +#: components/Blocks/Calendario/schema +msgid "Query" +msgstr "" + #. Default: "Título" #: components/Blocks/Areas/schema #: components/Blocks/Calendario/schema diff --git a/frontend/packages/portalbrasil-intranet/locales/en/LC_MESSAGES/volto.po b/frontend/packages/portalbrasil-intranet/locales/en/LC_MESSAGES/volto.po index 6765343..fd73564 100644 --- a/frontend/packages/portalbrasil-intranet/locales/en/LC_MESSAGES/volto.po +++ b/frontend/packages/portalbrasil-intranet/locales/en/LC_MESSAGES/volto.po @@ -26,6 +26,11 @@ msgstr "" msgid "Colaboradores" msgstr "" +#. Default: "Adicionar descrição dos eventos?" +#: components/Blocks/Calendario/schema +msgid "Descrição" +msgstr "" + #. Default: "Gestor" #: components/Blocks/Gestor/schema msgid "Gestor" @@ -46,6 +51,11 @@ msgstr "" msgid "Powered by Portal Brasil: Intranet, Plone & Python" msgstr "" +#. Default: "Query" +#: components/Blocks/Calendario/schema +msgid "Query" +msgstr "" + #. Default: "Título" #: components/Blocks/Areas/schema #: components/Blocks/Calendario/schema diff --git a/frontend/packages/portalbrasil-intranet/locales/es/LC_MESSAGES/volto.po b/frontend/packages/portalbrasil-intranet/locales/es/LC_MESSAGES/volto.po index 50c66ad..c619a24 100644 --- a/frontend/packages/portalbrasil-intranet/locales/es/LC_MESSAGES/volto.po +++ b/frontend/packages/portalbrasil-intranet/locales/es/LC_MESSAGES/volto.po @@ -26,6 +26,11 @@ msgstr "" msgid "Colaboradores" msgstr "" +#. Default: "Adicionar descrição dos eventos?" +#: components/Blocks/Calendario/schema +msgid "Descrição" +msgstr "" + #. Default: "Gestor" #: components/Blocks/Gestor/schema msgid "Gestor" @@ -46,6 +51,11 @@ msgstr "" msgid "Powered by Portal Brasil: Intranet, Plone & Python" msgstr "" +#. Default: "Query" +#: components/Blocks/Calendario/schema +msgid "Query" +msgstr "" + #. Default: "Título" #: components/Blocks/Areas/schema #: components/Blocks/Calendario/schema diff --git a/frontend/packages/portalbrasil-intranet/locales/pt_BR/LC_MESSAGES/volto.po b/frontend/packages/portalbrasil-intranet/locales/pt_BR/LC_MESSAGES/volto.po index 50c66ad..c619a24 100644 --- a/frontend/packages/portalbrasil-intranet/locales/pt_BR/LC_MESSAGES/volto.po +++ b/frontend/packages/portalbrasil-intranet/locales/pt_BR/LC_MESSAGES/volto.po @@ -26,6 +26,11 @@ msgstr "" msgid "Colaboradores" msgstr "" +#. Default: "Adicionar descrição dos eventos?" +#: components/Blocks/Calendario/schema +msgid "Descrição" +msgstr "" + #. Default: "Gestor" #: components/Blocks/Gestor/schema msgid "Gestor" @@ -46,6 +51,11 @@ msgstr "" msgid "Powered by Portal Brasil: Intranet, Plone & Python" msgstr "" +#. Default: "Query" +#: components/Blocks/Calendario/schema +msgid "Query" +msgstr "" + #. Default: "Título" #: components/Blocks/Areas/schema #: components/Blocks/Calendario/schema diff --git a/frontend/packages/portalbrasil-intranet/locales/volto.pot b/frontend/packages/portalbrasil-intranet/locales/volto.pot index 3866bd3..abe0afd 100644 --- a/frontend/packages/portalbrasil-intranet/locales/volto.pot +++ b/frontend/packages/portalbrasil-intranet/locales/volto.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plone\n" -"POT-Creation-Date: 2024-10-23T23:05:42.097Z\n" +"POT-Creation-Date: 2024-11-11T22:12:20.630Z\n" "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" "Content-Type: text/plain; charset=utf-8\n" @@ -28,6 +28,11 @@ msgstr "" msgid "Colaboradores" msgstr "" +#. Default: "Adicionar descrição dos eventos?" +#: components/Blocks/Calendario/schema +msgid "Descrição" +msgstr "" + #. Default: "Gestor" #: components/Blocks/Gestor/schema msgid "Gestor" @@ -48,6 +53,11 @@ msgstr "" msgid "Powered by Portal Brasil: Intranet, Plone & Python" msgstr "" +#. Default: "Query" +#: components/Blocks/Calendario/schema +msgid "Query" +msgstr "" + #. Default: "Título" #: components/Blocks/Areas/schema #: components/Blocks/Calendario/schema diff --git a/frontend/packages/portalbrasil-intranet/src/components/Blocks/Calendario/View.jsx b/frontend/packages/portalbrasil-intranet/src/components/Blocks/Calendario/View.jsx index 7fc4277..0a9a81e 100644 --- a/frontend/packages/portalbrasil-intranet/src/components/Blocks/Calendario/View.jsx +++ b/frontend/packages/portalbrasil-intranet/src/components/Blocks/Calendario/View.jsx @@ -5,26 +5,30 @@ import { parseDate } from '@internationalized/date'; import withQuerystringResults from './withQuerystringResults'; const groupByDate = (items) => { - return items.reduce((map, obj) => { - if (!obj.start) return; + return items + .reduce((map, obj) => { + if (!obj.start) { + return null; + } - let start = obj.start ? parseDate(obj.start.slice(0, 10)) : null; - const end = obj.end ? parseDate(obj.end.slice(0, 10)) : start; + let start = obj.start ? parseDate(obj.start.slice(0, 10)) : null; + const end = obj.end ? parseDate(obj.end.slice(0, 10)) : start; - while (start < end) { - const key = start.toString(); + while (start < end) { + const key = start.toString(); - if (key) { - if (map[key] === undefined) { - map[key] = []; + if (key) { + if (map[key] === undefined) { + map[key] = []; + } + map[key].push(obj); } - map[key].push(obj); - } - start = start.add({ days: 1 }); - } - return map; - }, {}); + start = start.add({ days: 1 }); + } + return map; + }, {}) + .filter((item) => item !== null); }; const CalendarioBlockView = withQuerystringResults((props) => {