From f14aad3e5ecb828dc7d86378f958cc834f1f9237 Mon Sep 17 00:00:00 2001 From: Edoardo Sabadelli Date: Thu, 21 Nov 2019 11:31:56 +0100 Subject: [PATCH] chore: squash merge master into epic branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 7fa8693832b2eb8ece02adce885170a5ecbc011e Author: @dhis2-bot Date: Tue Nov 19 09:31:29 2019 +0100 chore(translations): sync Arabic translations from transifex (master) Automatically merged to resolve the avalance commit c3c5753869c06d4de155f2aaab543428f5a87e77 Author: @dhis2-bot Date: Tue Nov 19 09:31:27 2019 +0100 chore(translations): sync Spanish translations from transifex (master) Automatically merged to resolve the avalance commit 84e30cfa98c4867599c5a7e58e76bd2b6eb1de60 Author: @dhis2-bot Date: Tue Nov 19 09:31:25 2019 +0100 chore(translations): sync PersianAfghanistan translations from transifex (master) Automatically merged to resolve the avalance commit 613e8186952d86ff056376014659cf89abb47dfa Author: @dhis2-bot Date: Tue Nov 19 09:31:22 2019 +0100 chore(translations): sync French translations from transifex (master) Automatically merged to resolve the avalance commit f0a73e761fa9516c0c73b0fa55e7762a44af4a2f Author: @dhis2-bot Date: Tue Nov 19 09:31:19 2019 +0100 chore(translations): sync Lao translations from transifex (master) Automatically merged to resolve the avalance commit a251cc024a22be13fdd31dc8e3e3b7fdb1c5b28b Author: @dhis2-bot Date: Tue Nov 19 09:31:16 2019 +0100 chore(translations): sync Burmese translations from transifex (master) Automatically merged to resolve the avalance commit a9d70ddf19104437787396d043d530aa20fe1d50 Author: @dhis2-bot Date: Tue Nov 19 09:31:13 2019 +0100 chore(translations): sync Pushto translations from transifex (master) Automatically merged to resolve the avalance commit bf94c6dc50079c726e6fc1599044e9c59555ebe0 Author: @dhis2-bot Date: Tue Nov 19 09:31:11 2019 +0100 chore(translations): sync Portuguese translations from transifex (master) Automatically merged to resolve the avalance commit 41c2f38954ed28aa1f03dfa60b7f63b027607b20 Author: @dhis2-bot Date: Tue Nov 19 09:31:09 2019 +0100 chore(translations): sync PortugueseBrazil translations from transifex (master) Automatically merged to resolve the avalance commit 782e55aa0368c629547b00ca346d94a95120ba82 Author: @dhis2-bot Date: Tue Nov 19 09:31:06 2019 +0100 chore(translations): sync Russian translations from transifex (master) Automatically merged to resolve the avalance commit c6d5f76d4224f6bdbe883b6e630ee439ed6a9c4f Author: @dhis2-bot Date: Tue Nov 19 09:31:03 2019 +0100 chore(translations): sync Swedish translations from transifex (master) Automatically merged to resolve the avalance commit 3ed9dcb25ca907c8bedcd1d9d50f16bd1bb2d746 Author: @dhis2-bot Date: Tue Nov 19 09:31:00 2019 +0100 chore(translations): sync TetumTetun translations from transifex (master) Automatically merged to resolve the avalance commit 6b76689fcb65ee2a0f1a7122e366a0a04381f3d5 Author: @dhis2-bot Date: Tue Nov 19 09:30:56 2019 +0100 chore(translations): sync Tajik translations from transifex (master) Automatically merged to resolve the avalance commit f95ef04b8f5992696330b41777178d71d36a32f0 Author: @dhis2-bot Date: Tue Nov 19 09:30:54 2019 +0100 chore(translations): sync Ukrainian translations from transifex (master) Automatically merged to resolve the avalance commit ecbf2686681893c53c896dabbebf854463ea61ab Author: @dhis2-bot Date: Tue Nov 19 09:30:51 2019 +0100 chore(translations): sync Vietnamese translations from transifex (master) Automatically merged to resolve the avalance commit e6c7fa6bfacfad2b510ff8d8ba77e90b15020680 Author: @dhis2-bot Date: Tue Nov 19 09:13:48 2019 +0100 chore(translations): sync Chinese translations from transifex (master) Automatically merged to resolve the avalance commit c96ac099af5854a1e8dd4c194a5c1c8be78b87cb Author: Martin Date: Fri Nov 15 14:11:55 2019 +0100 fix: changed incorrect prop types and tests (#372) * fix: changed incorrect prop types and tests * fix: upgraded to Analytics v2.6.2 commit 22c36e27bc963ea13b6cc2af9765806ff14b339f Author: Martin Date: Fri Nov 15 13:06:07 2019 +0100 fix: map is not vis type (#371) * fix: extracted map from vis type to a static item * fix: renamed chart to vis * refactor: removed legacy native type to use only vis type instead * fix: issue with 'selected' prop * fix: added missing comment from Analytics * fix: added prop types * fix: added more prop types * fix: removed unnecessary prop type commit 91847d22ebec27e5863a76f57cd8be1f72a7ded7 Author: Martin Date: Thu Nov 14 15:57:02 2019 +0100 Fix: Implement disallowed dims from Analytics UI rules (#370) * fix: using Analytics to calculate disallowed dimensions * fix: Analytics v2.6.0 commit 26d12c61d35feb148c65cc67b4bb3250d35b3c79 Author: Martin Date: Thu Nov 14 11:30:20 2019 +0100 fix: use shared vis types (#368) * use vis types from analytics * upgrades to and depends on @dhis2/analytics to v2.5.2 * implemented layout rules for the "add to layout" button commit a3dbb9fb20356b3aa303155de98e16795dcffaf6 Author: Jan Henrik Øverland Date: Mon Nov 11 14:46:30 2019 +0100 feat: use layout rules for add-to-layout ui (#362) * feat: generate add to layout button/menu based on rules * feat: refactor logic to use rules * upgrade @dhis2/analytics dep * tmp fix add to button tests * TODO fix tests * remove comment * replace local fn with analytics fn * todo: tmp commented out tests * remove folder commit d6ba4a3ca25004e0ef5c0d3e09e659cfa4dd95a4 Author: Jan Henrik Øverland Date: Mon Nov 11 14:09:50 2019 +0100 refactor: use dimension menu from @dhis2/analytics (#364) * refactor: Use DimensionMenu and rules logic from @dhis2/analytics for all occurrences of such duplicated menus * refactor: upgraded @dhis2/analytics to v2.5.1 commit 204fe7abc0b505ff0ff5a3de1368744cbecaf8f6 Author: Jan Henrik Overland Date: Tue Nov 5 14:02:06 2019 +0100 fix: use axisName instead of axisKey commit dd8b5635649f2f0f2506e1ea147c5ccfed98a745 Author: Martin Date: Tue Nov 5 11:22:22 2019 +0100 updated analytics repo (#363) commit 8c0ed1324275082b7c171104196524f236bf5696 Author: Martin Date: Tue Nov 5 11:20:18 2019 +0100 fix: changed height to min-height for the axes area (#361) commit 74edb3cc15017d60ce22497e213f1d5940ed3d21 Author: Viktor Varland Date: Thu Oct 24 19:39:35 2019 +0200 chore(deps): upgrade d2-i18n(-generate) deps (master) (#359) * chore(deps): upgrade d2-i18n(-generate) deps (master) * chore(deps): update i18n for packages commit 4bcb913a763066f0fe7541c5b2645c04ce471844 Author: @dhis2-bot Date: Thu Oct 24 12:22:35 2019 +0200 chore(translations): sync Russian translations from transifex (master) Automatically merged to resolve the avalance commit 2941ee9f5da3e304b0036bbeae0faefe3a677afe Author: @dhis2-bot Date: Wed Oct 23 15:02:24 2019 +0200 chore(translations): sync Arabic translations from transifex (master) Automatically merged to resolve the avalance commit 6067063d87390d709bd2052a074df80ab9692426 Author: @dhis2-bot Date: Wed Oct 23 15:02:21 2019 +0200 chore(translations): sync Danish translations from transifex (master) Automatically merged to resolve the avalance commit 5f8ec50d3221e39d717896aff921838e50fda7c6 Author: @dhis2-bot Date: Wed Oct 23 15:02:19 2019 +0200 chore(translations): sync Spanish translations from transifex (master) Automatically merged to resolve the avalance commit ee07b7b935a4f10f3e35152bf5d2b003cbb23104 Author: @dhis2-bot Date: Wed Oct 23 15:02:16 2019 +0200 chore(translations): sync PersianAfghanistan translations from transifex (master) Automatically merged to resolve the avalance commit 3e5ab95a55f064af138e2a2a542d488ea8aa3171 Author: @dhis2-bot Date: Wed Oct 23 15:02:14 2019 +0200 chore(translations): sync French translations from transifex (master) Automatically merged to resolve the avalance commit 754984ee04f11a34bd516ea2569e41b7e4e0c6b3 Author: @dhis2-bot Date: Wed Oct 23 15:02:11 2019 +0200 chore(translations): sync Indonesian translations from transifex (master) Automatically merged to resolve the avalance commit b0c23c85cbc884ac7ed78a30fe161c8a4dcefd65 Author: @dhis2-bot Date: Wed Oct 23 15:02:07 2019 +0200 chore(translations): sync Lao translations from transifex (master) Automatically merged to resolve the avalance commit e1531d052056654006f56696b6ca2435df9f3ec8 Author: @dhis2-bot Date: Wed Oct 23 15:02:01 2019 +0200 chore(translations): sync Burmese translations from transifex (master) Automatically merged to resolve the avalance commit 9af084b0d95b41866c6c2f5e3f69de3b748f2ca5 Author: @dhis2-bot Date: Wed Oct 23 15:01:58 2019 +0200 chore(translations): sync Pushto translations from transifex (master) Automatically merged to resolve the avalance commit 21f72cb6b60cb73e43d803ec923d549439d8204b Author: @dhis2-bot Date: Wed Oct 23 15:01:56 2019 +0200 chore(translations): sync Portuguese translations from transifex (master) Automatically merged to resolve the avalance commit e0d1207390e3389e551969f552adfb6c4898dcba Author: @dhis2-bot Date: Wed Oct 23 15:01:53 2019 +0200 chore(translations): sync PortugueseBrazil translations from transifex (master) Automatically merged to resolve the avalance commit a9c2acefafb34359c446b1aff1970031461d4996 Author: @dhis2-bot Date: Wed Oct 23 15:01:51 2019 +0200 chore(translations): sync Swedish translations from transifex (master) Automatically merged to resolve the avalance commit 8e8e4671c48a58c2157b2e5df1b6de4a36966b12 Author: @dhis2-bot Date: Wed Oct 23 15:01:49 2019 +0200 chore(translations): sync TetumTetun translations from transifex (master) Automatically merged to resolve the avalance commit cdce03bb116d242d0cbfb247c4bd0f8c47844902 Author: @dhis2-bot Date: Wed Oct 23 15:01:46 2019 +0200 chore(translations): sync Tajik translations from transifex (master) Automatically merged to resolve the avalance commit a63b9ecf5fc7159be052dc8c899447827f84c35b Author: @dhis2-bot Date: Wed Oct 23 15:01:44 2019 +0200 chore(translations): sync Ukrainian translations from transifex (master) Automatically merged to resolve the avalance commit c37f5a2b2dc7804a5216498d38185353da511409 Author: @dhis2-bot Date: Wed Oct 23 15:01:42 2019 +0200 chore(translations): sync Urdu translations from transifex (master) Automatically merged to resolve the avalance commit bbc8ebfb2d9c5e9d14ee5a7607c3b564a7e002b6 Author: @dhis2-bot Date: Wed Oct 23 15:01:39 2019 +0200 chore(translations): sync Vietnamese translations from transifex (master) Automatically merged to resolve the avalance commit 8c5b0c780ac35efb83ef5abc041a747bb5991460 Author: @dhis2-bot Date: Wed Oct 23 15:01:36 2019 +0200 chore(translations): sync Chinese translations from transifex (master) Automatically merged to resolve the avalance --- packages/app/i18n/ar.po | 7 +- packages/app/i18n/en.pot | 46 ++---------- packages/app/i18n/es.po | 14 ++-- packages/app/i18n/fr.po | 10 +-- packages/app/i18n/lo.po | 46 ++++++------ packages/app/i18n/my.po | 58 +++++++-------- packages/app/i18n/prs.po | 54 +++++++------- packages/app/i18n/ps.po | 32 ++++----- packages/app/i18n/pt.po | 10 +-- packages/app/i18n/pt_BR.po | 6 +- packages/app/i18n/ru.po | 2 +- packages/app/i18n/sv.po | 6 +- packages/app/i18n/tet.po | 10 +-- packages/app/i18n/tg.po | 6 +- packages/app/i18n/uk.po | 23 +++--- packages/app/i18n/vi.po | 24 +++---- packages/app/i18n/zh.po | 6 +- packages/app/package.json | 2 +- packages/app/src/actions/current.js | 5 ++ .../AddToLayoutButton/AddToLayoutButton.js | 24 ++++--- .../DimensionsPanel/Dialogs/DialogManager.js | 2 +- .../Dialogs/__tests__/DialogManager.spec.js | 1 + .../DimensionsPanel/DimensionsPanel.js | 20 +++--- .../__tests__/DimensionsPanel.spec.js | 4 ++ packages/app/src/components/Layout/Chip.js | 9 ++- .../Layout/DefaultLayout/DefaultAxis.js | 3 +- packages/app/src/components/Layout/Layout.js | 56 +++++++-------- ...sualizationTypeIcon.js => MenuItemIcon.js} | 72 +++++++++---------- .../VisualizationTypeMenuItem.js | 22 +++--- .../VisualizationTypeSelector.js | 66 ++++++----------- .../VisualizationTypeMenuItem.spec.js | 13 ++-- packages/app/src/modules/chartTypes.js | 46 ------------ packages/app/src/modules/layoutValidation.js | 22 +++--- packages/app/src/modules/ui.js | 28 ++++---- .../src/reducers/__tests__/current.spec.js | 7 +- .../app/src/reducers/__tests__/ui.spec.js | 4 +- packages/app/src/reducers/current.js | 35 ++++----- packages/app/src/reducers/ui.js | 4 +- packages/plugin/package.json | 2 +- packages/plugin/src/ChartPlugin.js | 9 ++- .../plugin/src/__tests__/ChartPlugin.spec.js | 34 ++++++--- yarn.lock | 8 +-- 42 files changed, 394 insertions(+), 464 deletions(-) rename packages/app/src/components/VisualizationTypeSelector/{VisualizationTypeIcon.js => MenuItemIcon.js} (62%) delete mode 100644 packages/app/src/modules/chartTypes.js diff --git a/packages/app/i18n/ar.po b/packages/app/i18n/ar.po index 5a84a941bd..1ade4f55bb 100644 --- a/packages/app/i18n/ar.po +++ b/packages/app/i18n/ar.po @@ -1,12 +1,13 @@ # Translators: # Viktor Varland , 2019 +# phil_dhis2, 2019 # msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" "POT-Creation-Date: 2019-08-08T13:09:25.099Z\n" "PO-Revision-Date: 2019-06-25 18:46+0000\n" -"Last-Translator: Viktor Varland , 2019\n" +"Last-Translator: phil_dhis2, 2019\n" "Language-Team: Arabic (https://www.transifex.com/hisp-uio/teams/100509/ar/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -21,7 +22,7 @@ msgid "\"{{what}}\" successfully deleted." msgstr "" msgid "Data Visualizer" -msgstr "" +msgstr "البيانات المرئية" msgid "Axis 1" msgstr "" @@ -256,7 +257,7 @@ msgid "Polynomial" msgstr "متعدد الحدود" msgid "Loess" -msgstr "Loess" +msgstr "" msgid "Show values" msgstr "إظهار القيم" diff --git a/packages/app/i18n/en.pot b/packages/app/i18n/en.pot index 6828d1e202..3f6130a27b 100644 --- a/packages/app/i18n/en.pot +++ b/packages/app/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2019-11-11T13:15:11.091Z\n" -"PO-Revision-Date: 2019-11-11T13:15:11.091Z\n" +"POT-Creation-Date: 2019-11-15T12:12:19.215Z\n" +"PO-Revision-Date: 2019-11-15T12:12:19.215Z\n" msgid "Rename successful" msgstr "" @@ -45,9 +45,6 @@ msgstr "" msgid "Hide" msgstr "" -msgid "Remove" -msgstr "" - msgid "Download" msgstr "" @@ -114,6 +111,9 @@ msgstr "" msgid "Move to" msgstr "" +msgid "Remove" +msgstr "" + msgid "None selected" msgstr "" @@ -300,42 +300,6 @@ msgstr "" msgid "Pivot table" msgstr "" -msgid "Column" -msgstr "" - -msgid "Stacked column" -msgstr "" - -msgid "Bar" -msgstr "" - -msgid "Stacked bar" -msgstr "" - -msgid "Line" -msgstr "" - -msgid "Area" -msgstr "" - -msgid "Pie" -msgstr "" - -msgid "Radar" -msgstr "" - -msgid "Gauge" -msgstr "" - -msgid "Year over year (line)" -msgstr "" - -msgid "Year over year (column)" -msgstr "" - -msgid "Single value" -msgstr "" - msgid "Open as Map" msgstr "" diff --git a/packages/app/i18n/es.po b/packages/app/i18n/es.po index e6a55cab6a..4afe2fa165 100644 --- a/packages/app/i18n/es.po +++ b/packages/app/i18n/es.po @@ -1,13 +1,13 @@ # Translators: -# phil_dhis2, 2019 # Viktor Varland , 2019 +# phil_dhis2, 2019 # msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" "POT-Creation-Date: 2019-08-08T13:09:25.099Z\n" "PO-Revision-Date: 2019-06-25 18:46+0000\n" -"Last-Translator: Viktor Varland , 2019\n" +"Last-Translator: phil_dhis2, 2019\n" "Language-Team: Spanish (https://www.transifex.com/hisp-uio/teams/100509/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -22,7 +22,7 @@ msgid "\"{{what}}\" successfully deleted." msgstr "" msgid "Data Visualizer" -msgstr "" +msgstr "Visualizador de Datos" msgid "Axis 1" msgstr "" @@ -80,7 +80,7 @@ msgid "Data value set" msgstr "Valor de los datos" msgid "Other formats" -msgstr "Other formats" +msgstr "" msgid "An error occurred in the DHIS2 Data Visualizer application." msgstr "" @@ -110,10 +110,10 @@ msgid "{{total}} selected" msgstr "" msgid "Series" -msgstr "Series" +msgstr "" msgid "Category" -msgstr "Category" +msgstr "Categoría" msgid "Filter" msgstr "filtro" @@ -356,7 +356,7 @@ msgid "Expected reports" msgstr "" msgid "Program" -msgstr "Program" +msgstr "Programa" msgid "Select a program" msgstr "" diff --git a/packages/app/i18n/fr.po b/packages/app/i18n/fr.po index 7493631e9c..4bc7727967 100644 --- a/packages/app/i18n/fr.po +++ b/packages/app/i18n/fr.po @@ -1,15 +1,15 @@ # Translators: -# Austin McGee , 2019 # mrwine , 2019 # Viktor Varland , 2019 # Bram Piot , 2019 +# phil_dhis2, 2019 # msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" "POT-Creation-Date: 2019-08-08T13:09:25.099Z\n" "PO-Revision-Date: 2019-06-25 18:46+0000\n" -"Last-Translator: Bram Piot , 2019\n" +"Last-Translator: phil_dhis2, 2019\n" "Language-Team: French (https://www.transifex.com/hisp-uio/teams/100509/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -24,7 +24,7 @@ msgid "\"{{what}}\" successfully deleted." msgstr "" msgid "Data Visualizer" -msgstr "" +msgstr "Visualiseur de données" msgid "Axis 1" msgstr "" @@ -181,7 +181,7 @@ msgid "Standard deviation" msgstr "Écart type" msgid "Variance" -msgstr "Variance" +msgstr "" msgid "Base line" msgstr "" @@ -400,7 +400,7 @@ msgid "Event data items" msgstr "Eléments de données évènement" msgid "Program indicators" -msgstr "Program indicators" +msgstr "Indicateurs de programme" msgid "Add to series" msgstr "" diff --git a/packages/app/i18n/lo.po b/packages/app/i18n/lo.po index 1de39de879..03a592828b 100644 --- a/packages/app/i18n/lo.po +++ b/packages/app/i18n/lo.po @@ -1,13 +1,13 @@ # Translators: -# phil_dhis2, 2019 # Viktor Varland , 2019 +# phil_dhis2, 2019 # msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" "POT-Creation-Date: 2019-08-08T13:09:25.099Z\n" "PO-Revision-Date: 2019-06-25 18:46+0000\n" -"Last-Translator: Viktor Varland , 2019\n" +"Last-Translator: phil_dhis2, 2019\n" "Language-Team: Lao (https://www.transifex.com/hisp-uio/teams/100509/lo/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -22,7 +22,7 @@ msgid "\"{{what}}\" successfully deleted." msgstr "" msgid "Data Visualizer" -msgstr "" +msgstr "ການສ້າງຮູບພາບຈາກຂໍ້ມູນ" msgid "Axis 1" msgstr "" @@ -39,10 +39,10 @@ msgid "" msgstr "" msgid "Cancel" -msgstr "Cancel" +msgstr "ຍົກເລີກ" msgid "Update" -msgstr "Update" +msgstr "ປັບປຸງ" msgid "" "'Single Value' is intended to show a single data item. Only the first item " @@ -113,10 +113,10 @@ msgid "Series" msgstr "ແທ່ງ" msgid "Category" -msgstr "Category" +msgstr "ລວງນອນ" msgid "Filter" -msgstr "Filter" +msgstr "ກັ່ນຕອງ" msgid "Move to" msgstr "" @@ -176,10 +176,10 @@ msgid "Max" msgstr "ຄ່າໃຫ່ຍສຸດ" msgid "Standard deviation" -msgstr "Standard deviation" +msgstr "" msgid "Variance" -msgstr "Variance" +msgstr "ຄວາມແຕກຕ່າງ" msgid "Base line" msgstr "" @@ -212,7 +212,7 @@ msgid "Before first and after last" msgstr "ກ່ອນໜ້າທໍາອິດ ແລະ ຫຼັງຈາກສຸດທ້າຍ" msgid "All" -msgstr "All" +msgstr "ທັງໝົດ" msgid "Hide chart legend" msgstr "ເຊື່ອງຄວາມຫມາຍຂອງເສັ້ນສະແດງ" @@ -224,7 +224,7 @@ msgid "Hide title" msgstr "" msgid "No space between columns/bars" -msgstr "No space between columns/bars" +msgstr "" msgid "Use 100% stacked values" msgstr "ໃຊ້ຄ່າທີ່ຊ້ອນກັນ 100%" @@ -356,13 +356,13 @@ msgid "Expected reports" msgstr "" msgid "Program" -msgstr "Program" +msgstr "ສາຍງານ" msgid "Select a program" msgstr "" msgid "Indicators" -msgstr "Indicators" +msgstr "ຕົວຊີ້ວັດ" msgid "Select indicator group" msgstr "ເລືອກກຸ່ມຕົວຊີ້ວັດ" @@ -456,16 +456,16 @@ msgid "Today" msgstr "ມື້ນີ້" msgid "Yesterday" -msgstr "Yesterday" +msgstr "ມື້ວານນີ" msgid "Last 3 days" -msgstr "Last 3 days" +msgstr "3 ມື້ກ່ອນ" msgid "Last 7 days" -msgstr "Last 7 days" +msgstr "7 ມື້ກ່ອນ" msgid "Last 14 days" -msgstr "Last 14 days" +msgstr "14 ມື້ກ່ອນ" msgid "This week" msgstr "ທິດນີ້" @@ -480,22 +480,22 @@ msgid "Last 12 weeks" msgstr "12 ອາທິດຍ້ອນຫຼັງ" msgid "Last 52 weeks" -msgstr "Last 52 weeks" +msgstr "52 ອາທິດຜ່ານມາ" msgid "Weeks this year" -msgstr "Weeks this year" +msgstr "ອາທິດ ຂອງປີນີ້" msgid "This month" msgstr "ເດືອນນີ້" msgid "Last month" -msgstr "Last month" +msgstr "ເດືອນຜ່ານມາ" msgid "Last 3 months" msgstr "3 ເດືອນຍ້ອນຫຼັງ" msgid "Last 6 months" -msgstr "Last 6 months" +msgstr "6 ເດືອນຜ່ານມາ" msgid "Last 12 months" msgstr "12 ເດືອນຍ້ອນຫຼັງ" @@ -519,7 +519,7 @@ msgid "This quarter" msgstr "ໄຕມານີ້" msgid "Last quarter" -msgstr "Last quarter" +msgstr "ໄຕມາດຜ່ານມາ" msgid "Last 4 quarters" msgstr "4 ໄຕມາດຍ້ອນຫຼັງ" @@ -531,7 +531,7 @@ msgid "This six-month" msgstr "6 ເດືອນນີ້" msgid "Last six-month" -msgstr "Last six-month" +msgstr "6 ເດືອນຜ່ານມາ" msgid "Last 2 six-months" msgstr "ລວມ 6 ເດືອນ 2 ຄັ້ງທີ່ຜ່ານມາ" diff --git a/packages/app/i18n/my.po b/packages/app/i18n/my.po index a38821fd31..8ed9026678 100644 --- a/packages/app/i18n/my.po +++ b/packages/app/i18n/my.po @@ -1,13 +1,13 @@ # Translators: -# phil_dhis2, 2019 # Viktor Varland , 2019 +# phil_dhis2, 2019 # msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" "POT-Creation-Date: 2019-08-08T13:09:25.099Z\n" "PO-Revision-Date: 2019-06-25 18:46+0000\n" -"Last-Translator: Viktor Varland , 2019\n" +"Last-Translator: phil_dhis2, 2019\n" "Language-Team: Burmese (https://www.transifex.com/hisp-uio/teams/100509/my/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -22,7 +22,7 @@ msgid "\"{{what}}\" successfully deleted." msgstr "" msgid "Data Visualizer" -msgstr "" +msgstr "ဂရပ် ပုံစံများ" msgid "Axis 1" msgstr "" @@ -170,16 +170,16 @@ msgid "Last value (average in org unit hierarchy)" msgstr "" msgid "Min" -msgstr "Min" +msgstr "အနည်းဆုံး" msgid "Max" -msgstr "Max" +msgstr "အများဆုံး" msgid "Standard deviation" -msgstr "Standard deviation" +msgstr "" msgid "Variance" -msgstr "Variance" +msgstr "" msgid "Base line" msgstr "" @@ -287,7 +287,7 @@ msgid "Chart title" msgstr "" msgid "Data" -msgstr "Data" +msgstr "အချက်အလက်" msgid "Axis & legend" msgstr "" @@ -362,7 +362,7 @@ msgid "Select a program" msgstr "" msgid "Indicators" -msgstr "Indicators" +msgstr "အညွှန်းများ" msgid "Select indicator group" msgstr "" @@ -371,7 +371,7 @@ msgid "[ All groups ]" msgstr "" msgid "Data elements" -msgstr "Data elements" +msgstr "အချက်အလတ်အစိတ်အပိုင်းများ" msgid "Select data element group" msgstr "" @@ -471,16 +471,16 @@ msgid "This week" msgstr "" msgid "Last week" -msgstr "Last week" +msgstr "" msgid "Last 4 weeks" -msgstr "Last 4 weeks" +msgstr "" msgid "Last 12 weeks" -msgstr "Last 12 weeks" +msgstr "" msgid "Last 52 weeks" -msgstr "Last 52 weeks" +msgstr "" msgid "Weeks this year" msgstr "" @@ -489,19 +489,19 @@ msgid "This month" msgstr "" msgid "Last month" -msgstr "Last month" +msgstr "ယခင်လ" msgid "Last 3 months" -msgstr "Last 3 months" +msgstr "လွန်ခဲ့သော ၁၂လ" msgid "Last 6 months" -msgstr "Last 6 months" +msgstr "" msgid "Last 12 months" -msgstr "Last 12 months" +msgstr "လွန်ခဲ့သော ၁၂လ" msgid "Months this year" -msgstr "Months this year" +msgstr "" msgid "This bimonth" msgstr "" @@ -519,10 +519,10 @@ msgid "This quarter" msgstr "" msgid "Last quarter" -msgstr "Last quarter" +msgstr "လွန်ခဲ့သော ၃လက" msgid "Last 4 quarters" -msgstr "Last 4 quarters" +msgstr "လွန်ခဲ့သော ၁၂လက" msgid "Quarters this year" msgstr "Quarters this year" @@ -531,28 +531,28 @@ msgid "This six-month" msgstr "" msgid "Last six-month" -msgstr "Last six-month" +msgstr "လွန်ခဲ့သော ၆လက" msgid "Last 2 six-months" -msgstr "Last 2 six-months" +msgstr "လွန်ခဲ့သော ၆လ(၂ကြိမ်)" msgid "This financial year" -msgstr "This financial year" +msgstr "" msgid "Last financial year" -msgstr "Last financial year" +msgstr "" msgid "Last 5 financial years" -msgstr "Last 5 financial years" +msgstr "" msgid "This year" -msgstr "This year" +msgstr "ဒီနှစ်" msgid "Last year" -msgstr "Last year" +msgstr "ယခင်နှစ်" msgid "Last 5 years" -msgstr "Last 5 years" +msgstr "လွန်ခဲ့သော ၅ နှစ်" msgid "User org unit" msgstr "" diff --git a/packages/app/i18n/prs.po b/packages/app/i18n/prs.po index 34e48eda5b..7aae86efef 100644 --- a/packages/app/i18n/prs.po +++ b/packages/app/i18n/prs.po @@ -21,7 +21,7 @@ msgid "\"{{what}}\" successfully deleted." msgstr "" msgid "Data Visualizer" -msgstr "" +msgstr "نمایش معلومات" msgid "Axis 1" msgstr "" @@ -109,7 +109,7 @@ msgid "{{total}} selected" msgstr "" msgid "Series" -msgstr "" +msgstr "سلسله (لړۍ)" msgid "Category" msgstr "دسته بندی" @@ -157,7 +157,7 @@ msgid "Average" msgstr "اوسط" msgid "Average (sum in org unit hierarchy)" -msgstr "" +msgstr "اوسط ( مجموع در ساختار واحد سازمان)" msgid "Sum" msgstr "جمع" @@ -175,7 +175,7 @@ msgid "Max" msgstr "بزرگتر" msgid "Standard deviation" -msgstr "" +msgstr "معیاري انحراف" msgid "Variance" msgstr "مغییرات" @@ -187,34 +187,34 @@ msgid "Base line title" msgstr "" msgid "Base line value" -msgstr "" +msgstr "د اساسي کرښې رقم" msgid "Use cumulative values" -msgstr "" +msgstr "د اساسي کرښې رقم" msgid "Domain axis title" -msgstr "" +msgstr "د ډومېن محوري عنوان" msgid "Hide empty categories" -msgstr "" +msgstr "د تشو موضوعاتو د کټګوریو پټول" msgid "None" msgstr "هیچ‌کدام" msgid "Before first" -msgstr "" +msgstr "پیش از اول" msgid "After last" -msgstr "" +msgstr "بعد از آخر" msgid "Before first and after last" -msgstr "" +msgstr "پیش از اول و بعد از آخر" msgid "All" -msgstr "" +msgstr "همه" msgid "Hide chart legend" -msgstr "" +msgstr "د چارټ لېجنډ پټ کړئ" msgid "Hide subtitle" msgstr "" @@ -226,13 +226,13 @@ msgid "No space between columns/bars" msgstr "" msgid "Use 100% stacked values" -msgstr "" +msgstr "استفاده 100% آرزش" msgid "Range axis decimals" msgstr "" msgid "Range axis title" -msgstr "" +msgstr "د تسلسل محوري عنوان" msgid "Range axis max" msgstr "" @@ -247,10 +247,10 @@ msgid "Tick steps may extend the chart beyond 'Range axis max'" msgstr "" msgid "Trend line" -msgstr "" +msgstr "د محاسبې کرښې ښکاره کړئ" msgid "Linear" -msgstr "" +msgstr "د کرښې چارټ" msgid "Polynomial" msgstr "" @@ -259,7 +259,7 @@ msgid "Loess" msgstr "" msgid "Show values" -msgstr "" +msgstr "ارقام ښکاره کړئ" msgid "Sort order" msgstr "مرتب سازی" @@ -271,7 +271,7 @@ msgid "High to low" msgstr "بالا تا پاین" msgid "Chart subtitle" -msgstr "" +msgstr "د چارټ عنوان" msgid "Target line" msgstr "" @@ -280,10 +280,10 @@ msgid "Target line title" msgstr "" msgid "Target line value" -msgstr "" +msgstr "د موخې د کرښې رقم" msgid "Chart title" -msgstr "" +msgstr "د چارټ عنوان" msgid "Data" msgstr "دیتا" @@ -298,10 +298,10 @@ msgid "Options" msgstr "گزینه‌ها" msgid "Chart options" -msgstr "" +msgstr "د چارټ انتخابونه" msgid "Column" -msgstr "" +msgstr "ستون" msgid "Stacked column" msgstr "" @@ -394,10 +394,10 @@ msgid "[ All metrics ]" msgstr "" msgid "Event data items" -msgstr "" +msgstr "د پېښې د مالوماتو (ډاټا) موضوعات" msgid "Program indicators" -msgstr "" +msgstr "د پروګرام شاخصونه" msgid "Add to series" msgstr "" @@ -500,7 +500,7 @@ msgid "Last 12 months" msgstr "12 ماهه گذشته" msgid "Months this year" -msgstr "" +msgstr "ماه های سال هذا" msgid "This bimonth" msgstr "" @@ -524,7 +524,7 @@ msgid "Last 4 quarters" msgstr "4 سه ماهه آخیر" msgid "Quarters this year" -msgstr "" +msgstr "ربع های سال هذا" msgid "This six-month" msgstr "شش-ماه جاری" diff --git a/packages/app/i18n/ps.po b/packages/app/i18n/ps.po index 41d866bf0e..ac73edde16 100644 --- a/packages/app/i18n/ps.po +++ b/packages/app/i18n/ps.po @@ -1,13 +1,13 @@ # Translators: -# phil_dhis2, 2019 # Viktor Varland , 2019 +# phil_dhis2, 2019 # msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" "POT-Creation-Date: 2019-08-08T13:09:25.099Z\n" "PO-Revision-Date: 2019-06-25 18:46+0000\n" -"Last-Translator: Viktor Varland , 2019\n" +"Last-Translator: phil_dhis2, 2019\n" "Language-Team: Pushto (https://www.transifex.com/hisp-uio/teams/100509/ps/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -22,7 +22,7 @@ msgid "\"{{what}}\" successfully deleted." msgstr "" msgid "Data Visualizer" -msgstr "" +msgstr "د مالوماتو (ډاټا) ښکاره کوونکی" msgid "Axis 1" msgstr "" @@ -254,10 +254,10 @@ msgid "Linear" msgstr "د کرښې چارټ" msgid "Polynomial" -msgstr "Polynomial" +msgstr "" msgid "Loess" -msgstr "Loess" +msgstr "" msgid "Show values" msgstr "ارقام ښکاره کړئ" @@ -456,16 +456,16 @@ msgid "Today" msgstr "نن ورځ" msgid "Yesterday" -msgstr "Yesterday" +msgstr "پرونۍ ورځ" msgid "Last 3 days" -msgstr "Last 3 days" +msgstr "تېرې درې ورځې" msgid "Last 7 days" -msgstr "Last 7 days" +msgstr "تېرې اوه ورځې" msgid "Last 14 days" -msgstr "Last 14 days" +msgstr "تېرې څورلس ورځې" msgid "This week" msgstr "هفته هذا" @@ -480,22 +480,22 @@ msgid "Last 12 weeks" msgstr "تېرې 12 اونۍ" msgid "Last 52 weeks" -msgstr "Last 52 weeks" +msgstr "تېرې دوه پنځوس اونۍ" msgid "Weeks this year" -msgstr "Weeks this year" +msgstr "په روان کال کې اونۍ" msgid "This month" msgstr "ماه هذا" msgid "Last month" -msgstr "Last month" +msgstr "تېره میاشت" msgid "Last 3 months" msgstr "تېرې 3 میاشتې" msgid "Last 6 months" -msgstr "Last 6 months" +msgstr "تېرې شپږ میاشتې" msgid "Last 12 months" msgstr "تېرې 12 میاشتې" @@ -519,7 +519,7 @@ msgid "This quarter" msgstr "ربع هذا" msgid "Last quarter" -msgstr "Last quarter" +msgstr "تېره ربعه" msgid "Last 4 quarters" msgstr "تېرې 4ربعې" @@ -531,10 +531,10 @@ msgid "This six-month" msgstr "شش ماه هذا" msgid "Last six-month" -msgstr "Last six-month" +msgstr "تېرې شپږ میاشتې [ تېرې ـ شپږ ـ میاشتې ]" msgid "Last 2 six-months" -msgstr "Last 2 six-months" +msgstr "تېرې دوه شپږ میاشتې" msgid "This financial year" msgstr "سږنۍ مالي کال" diff --git a/packages/app/i18n/pt.po b/packages/app/i18n/pt.po index 590694fbcf..1031cd1b08 100644 --- a/packages/app/i18n/pt.po +++ b/packages/app/i18n/pt.po @@ -1,13 +1,13 @@ # Translators: -# phil_dhis2, 2019 # Viktor Varland , 2019 +# phil_dhis2, 2019 # msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" "POT-Creation-Date: 2019-08-08T13:09:25.099Z\n" "PO-Revision-Date: 2019-06-25 18:46+0000\n" -"Last-Translator: Viktor Varland , 2019\n" +"Last-Translator: phil_dhis2, 2019\n" "Language-Team: Portuguese (https://www.transifex.com/hisp-uio/teams/100509/pt/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -22,7 +22,7 @@ msgid "\"{{what}}\" successfully deleted." msgstr "" msgid "Data Visualizer" -msgstr "" +msgstr "Visualização de Dados" msgid "Axis 1" msgstr "" @@ -170,7 +170,7 @@ msgid "Last value (average in org unit hierarchy)" msgstr "" msgid "Min" -msgstr "Min" +msgstr "Mínimo" msgid "Max" msgstr "Máx" @@ -251,7 +251,7 @@ msgid "Trend line" msgstr "Linha de tendência" msgid "Linear" -msgstr "Linear" +msgstr "" msgid "Polynomial" msgstr "" diff --git a/packages/app/i18n/pt_BR.po b/packages/app/i18n/pt_BR.po index a985b99f49..cf04554b95 100644 --- a/packages/app/i18n/pt_BR.po +++ b/packages/app/i18n/pt_BR.po @@ -1,13 +1,13 @@ # Translators: -# phil_dhis2, 2019 # Viktor Varland , 2019 +# phil_dhis2, 2019 # msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" "POT-Creation-Date: 2019-08-08T13:09:25.099Z\n" "PO-Revision-Date: 2019-06-25 18:46+0000\n" -"Last-Translator: Viktor Varland , 2019\n" +"Last-Translator: phil_dhis2, 2019\n" "Language-Team: Portuguese (Brazil) (https://www.transifex.com/hisp-uio/teams/100509/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -22,7 +22,7 @@ msgid "\"{{what}}\" successfully deleted." msgstr "" msgid "Data Visualizer" -msgstr "" +msgstr "Visualização de Dados" msgid "Axis 1" msgstr "" diff --git a/packages/app/i18n/ru.po b/packages/app/i18n/ru.po index 67e123de5d..bb1454178d 100644 --- a/packages/app/i18n/ru.po +++ b/packages/app/i18n/ru.po @@ -65,7 +65,7 @@ msgid "Image (.png)" msgstr "Изображение (.png)" msgid "PDF (.pdf)" -msgstr "PDF (.pdf)" +msgstr "" msgid "Plain data source" msgstr "Источник данных" diff --git a/packages/app/i18n/sv.po b/packages/app/i18n/sv.po index 852974be84..1594d7410f 100644 --- a/packages/app/i18n/sv.po +++ b/packages/app/i18n/sv.po @@ -1,13 +1,13 @@ # Translators: -# phil_dhis2, 2019 # Viktor Varland , 2019 +# phil_dhis2, 2019 # msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" "POT-Creation-Date: 2019-08-08T13:09:25.099Z\n" "PO-Revision-Date: 2019-06-25 18:46+0000\n" -"Last-Translator: Viktor Varland , 2019\n" +"Last-Translator: phil_dhis2, 2019\n" "Language-Team: Swedish (https://www.transifex.com/hisp-uio/teams/100509/sv/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -287,7 +287,7 @@ msgid "Chart title" msgstr "" msgid "Data" -msgstr "Data" +msgstr "" msgid "Axis & legend" msgstr "" diff --git a/packages/app/i18n/tet.po b/packages/app/i18n/tet.po index 632cc6beca..f8a6813a6c 100644 --- a/packages/app/i18n/tet.po +++ b/packages/app/i18n/tet.po @@ -1,13 +1,13 @@ # Translators: -# phil_dhis2, 2019 # Viktor Varland , 2019 +# phil_dhis2, 2019 # msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" "POT-Creation-Date: 2019-08-08T13:09:25.099Z\n" "PO-Revision-Date: 2019-06-25 18:46+0000\n" -"Last-Translator: Viktor Varland , 2019\n" +"Last-Translator: phil_dhis2, 2019\n" "Language-Team: Tetum (Tetun) (https://www.transifex.com/hisp-uio/teams/100509/tet/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -22,7 +22,7 @@ msgid "\"{{what}}\" successfully deleted." msgstr "" msgid "Data Visualizer" -msgstr "" +msgstr "Vizualizador Dadus" msgid "Axis 1" msgstr "" @@ -170,10 +170,10 @@ msgid "Last value (average in org unit hierarchy)" msgstr "" msgid "Min" -msgstr "Min" +msgstr "" msgid "Max" -msgstr "Max" +msgstr "" msgid "Standard deviation" msgstr "Dezviu padraun" diff --git a/packages/app/i18n/tg.po b/packages/app/i18n/tg.po index 8a4c6cc9b5..59937bc77f 100644 --- a/packages/app/i18n/tg.po +++ b/packages/app/i18n/tg.po @@ -1,13 +1,13 @@ # Translators: -# phil_dhis2, 2019 # Viktor Varland , 2019 +# phil_dhis2, 2019 # msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" "POT-Creation-Date: 2019-08-08T13:09:25.099Z\n" "PO-Revision-Date: 2019-06-25 18:46+0000\n" -"Last-Translator: Viktor Varland , 2019\n" +"Last-Translator: phil_dhis2, 2019\n" "Language-Team: Tajik (https://www.transifex.com/hisp-uio/teams/100509/tg/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -22,7 +22,7 @@ msgid "\"{{what}}\" successfully deleted." msgstr "" msgid "Data Visualizer" -msgstr "" +msgstr "Намоишгари иттилоот" msgid "Axis 1" msgstr "" diff --git a/packages/app/i18n/uk.po b/packages/app/i18n/uk.po index b1b079b573..a42579f196 100644 --- a/packages/app/i18n/uk.po +++ b/packages/app/i18n/uk.po @@ -1,12 +1,13 @@ # Translators: # Viktor Varland , 2019 +# phil_dhis2, 2019 # msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" "POT-Creation-Date: 2019-08-08T13:09:25.099Z\n" "PO-Revision-Date: 2019-06-25 18:46+0000\n" -"Last-Translator: Viktor Varland , 2019\n" +"Last-Translator: phil_dhis2, 2019\n" "Language-Team: Ukrainian (https://www.transifex.com/hisp-uio/teams/100509/uk/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -21,7 +22,7 @@ msgid "\"{{what}}\" successfully deleted." msgstr "" msgid "Data Visualizer" -msgstr "Data Visualizer" +msgstr "Візуалізатор даних" msgid "Axis 1" msgstr "" @@ -452,22 +453,22 @@ msgid "Please add at least one period as {{filter}}" msgstr "" msgid "Today" -msgstr "Today" +msgstr "Сьогодні" msgid "Yesterday" msgstr "Вчора" msgid "Last 3 days" -msgstr "Last 3 days" +msgstr "Минулі 3 дні" msgid "Last 7 days" -msgstr "Last 7 days" +msgstr "Минулі 7 днів" msgid "Last 14 days" -msgstr "Last 14 days" +msgstr "Минулі 14 днів" msgid "This week" -msgstr "This week" +msgstr "Поточний тиждень" msgid "Last week" msgstr "Минулий тиждень" @@ -482,10 +483,10 @@ msgid "Last 52 weeks" msgstr "Останні 52 тижні" msgid "Weeks this year" -msgstr "Weeks this year" +msgstr "Тижні поточного року" msgid "This month" -msgstr "This month" +msgstr "Поточний місяць" msgid "Last month" msgstr "Останній місяць" @@ -515,7 +516,7 @@ msgid "Bimonths this year" msgstr "" msgid "This quarter" -msgstr "This quarter" +msgstr "Поточний квартал" msgid "Last quarter" msgstr "Минулий квартал" @@ -527,7 +528,7 @@ msgid "Quarters this year" msgstr "Квартали поточного року" msgid "This six-month" -msgstr "This six-month" +msgstr "Поточне півріччя" msgid "Last six-month" msgstr "Останнє півріччя" diff --git a/packages/app/i18n/vi.po b/packages/app/i18n/vi.po index 50cb777520..34ac75a20f 100644 --- a/packages/app/i18n/vi.po +++ b/packages/app/i18n/vi.po @@ -1,13 +1,13 @@ # Translators: -# phil_dhis2, 2019 # Viktor Varland , 2019 +# phil_dhis2, 2019 # msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" "POT-Creation-Date: 2019-08-08T13:09:25.099Z\n" "PO-Revision-Date: 2019-06-25 18:46+0000\n" -"Last-Translator: Viktor Varland , 2019\n" +"Last-Translator: phil_dhis2, 2019\n" "Language-Team: Vietnamese (https://www.transifex.com/hisp-uio/teams/100509/vi/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -22,7 +22,7 @@ msgid "\"{{what}}\" successfully deleted." msgstr "" msgid "Data Visualizer" -msgstr "" +msgstr "Biểu đồ" msgid "Axis 1" msgstr "" @@ -158,16 +158,16 @@ msgid "Average" msgstr "Trung bình" msgid "Average (sum in org unit hierarchy)" -msgstr "Average (sum in org unit hierarchy)" +msgstr "Trung bình (tổng số theo cây đơn vị)" msgid "Sum" msgstr "Tổng" msgid "Last value" -msgstr "Last value" +msgstr "" msgid "Last value (average in org unit hierarchy)" -msgstr "Last value (average in org unit hierarchy)" +msgstr "" msgid "Min" msgstr "Nhỏ nhất" @@ -197,7 +197,7 @@ msgid "Domain axis title" msgstr "Tiêu đề trục tung" msgid "Hide empty categories" -msgstr "Hide empty categories" +msgstr "Ẩn phần không có số liệu" msgid "None" msgstr "Không" @@ -224,7 +224,7 @@ msgid "Hide title" msgstr "" msgid "No space between columns/bars" -msgstr "No space between columns/bars" +msgstr "" msgid "Use 100% stacked values" msgstr "Dùng 100% giá trị chồng" @@ -471,13 +471,13 @@ msgid "This week" msgstr "Tuần này" msgid "Last week" -msgstr "Last week" +msgstr "Tuần trước" msgid "Last 4 weeks" -msgstr "Last 4 weeks" +msgstr "4 tuần trước" msgid "Last 12 weeks" -msgstr "Last 12 weeks" +msgstr "12 tuần trước" msgid "Last 52 weeks" msgstr "52 tuần trước" @@ -534,7 +534,7 @@ msgid "Last six-month" msgstr "6 tháng trước" msgid "Last 2 six-months" -msgstr "Last 2 six-months" +msgstr "2 sáu-tháng trước" msgid "This financial year" msgstr "Năm tài chính này" diff --git a/packages/app/i18n/zh.po b/packages/app/i18n/zh.po index 6a77290ce1..ebadcdb663 100644 --- a/packages/app/i18n/zh.po +++ b/packages/app/i18n/zh.po @@ -1,13 +1,13 @@ # Translators: -# phil_dhis2, 2019 # Viktor Varland , 2019 +# phil_dhis2, 2019 # msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" "POT-Creation-Date: 2019-08-08T13:09:25.099Z\n" "PO-Revision-Date: 2019-06-25 18:46+0000\n" -"Last-Translator: Viktor Varland , 2019\n" +"Last-Translator: phil_dhis2, 2019\n" "Language-Team: Chinese (https://www.transifex.com/hisp-uio/teams/100509/zh/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -22,7 +22,7 @@ msgid "\"{{what}}\" successfully deleted." msgstr "" msgid "Data Visualizer" -msgstr "" +msgstr "数据可视化图表工具" msgid "Axis 1" msgstr "" diff --git a/packages/app/package.json b/packages/app/package.json index c4eb892717..e0fda6b67e 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -25,7 +25,7 @@ "webpack-bundle-analyzer": "^3.0.3" }, "dependencies": { - "@dhis2/analytics": "^2.5.1", + "@dhis2/analytics": "^2.6.2", "@dhis2/d2-i18n": "^1.0.6", "@dhis2/d2-ui-core": "^6.2.1", "@dhis2/d2-ui-file-menu": "^6.2.1", diff --git a/packages/app/src/actions/current.js b/packages/app/src/actions/current.js index 4c510071c9..6321951131 100644 --- a/packages/app/src/actions/current.js +++ b/packages/app/src/actions/current.js @@ -3,6 +3,7 @@ import { SET_CURRENT_FROM_UI, CLEAR_CURRENT, } from '../reducers/current'; +import { sGetUi } from '../reducers/ui'; export const acSetCurrent = value => ({ type: SET_CURRENT, @@ -17,3 +18,7 @@ export const acSetCurrentFromUi = value => ({ type: SET_CURRENT_FROM_UI, value, }); + +export const tSetCurrentFromUi = () => async (dispatch, getState) => { + dispatch(acSetCurrentFromUi(sGetUi(getState()))); +}; diff --git a/packages/app/src/components/DimensionsPanel/Dialogs/AddToLayoutButton/AddToLayoutButton.js b/packages/app/src/components/DimensionsPanel/Dialogs/AddToLayoutButton/AddToLayoutButton.js index bf13ae2cd9..3c53cfdc5d 100644 --- a/packages/app/src/components/DimensionsPanel/Dialogs/AddToLayoutButton/AddToLayoutButton.js +++ b/packages/app/src/components/DimensionsPanel/Dialogs/AddToLayoutButton/AddToLayoutButton.js @@ -9,15 +9,15 @@ import { getAvailableAxes } from '@dhis2/analytics'; import UpdateButton from '../../../UpdateButton/UpdateButton'; import Menu from './Menu'; import { - sGetUi, sGetUiActiveModalDialog, sGetDimensionIdsFromLayout, + sGetUiType, } from '../../../../reducers/ui'; import { acSetUiActiveModalDialog, acAddUiLayoutDimensions, } from '../../../../actions/ui'; -import { acSetCurrentFromUi } from '../../../../actions/current'; +import { tSetCurrentFromUi } from '../../../../actions/current'; import { ADD_TO_LAYOUT_OPTIONS } from '../../../../modules/layout'; import styles from './styles/AddToLayoutButton.style'; @@ -41,7 +41,9 @@ export class AddToLayoutButton extends Component { this.props.onAddDimension({ [this.props.dialogId]: axisName, }); - this.props.onUpdate(this.props.ui); + + this.props.onUpdate(); + this.props.closeDialog(null); }; @@ -53,7 +55,7 @@ export class AddToLayoutButton extends Component { ); renderMenuItems = () => - this.getAxisMeta(getAvailableAxes(this.props.ui.type)) + this.getAxisMeta(getAvailableAxes(this.props.visType)) .slice(1) .map(axisMetaObj => ( { const availableAxisMeta = this.getAxisMeta( - getAvailableAxes(this.props.ui.type) + getAvailableAxes(this.props.visType) ); return ( @@ -79,7 +81,7 @@ export class AddToLayoutButton extends Component { color="primary" disableRipple disableFocusRipple - onClick={() => this.onUpdate(availableAxisMeta[0].name)} + onClick={() => this.onUpdate(availableAxisMeta[0].axisName)} > {availableAxisMeta[0].name} @@ -117,14 +119,16 @@ export class AddToLayoutButton extends Component { AddToLayoutButton.propTypes = { classes: PropTypes.object.isRequired, + visType: PropTypes.string.isRequired, dialogId: PropTypes.string.isRequired, dimensionIdsInLayout: PropTypes.array.isRequired, - closeDialog: PropTypes.func.isRequired, onAddDimension: PropTypes.func.isRequired, + onUpdate: PropTypes.func.isRequired, + closeDialog: PropTypes.func.isRequired, }; const mapStateToProps = state => ({ - ui: sGetUi(state), + visType: sGetUiType(state), dialogId: sGetUiActiveModalDialog(state), dimensionIdsInLayout: sGetDimensionIdsFromLayout(state), }); @@ -132,8 +136,8 @@ const mapStateToProps = state => ({ export default connect( mapStateToProps, { - closeDialog: acSetUiActiveModalDialog, onAddDimension: acAddUiLayoutDimensions, - onUpdate: acSetCurrentFromUi, + onUpdate: tSetCurrentFromUi, + closeDialog: acSetUiActiveModalDialog, } )(withStyles(styles)(AddToLayoutButton)); diff --git a/packages/app/src/components/DimensionsPanel/Dialogs/DialogManager.js b/packages/app/src/components/DimensionsPanel/Dialogs/DialogManager.js index efb8773302..58b1fc39bd 100644 --- a/packages/app/src/components/DimensionsPanel/Dialogs/DialogManager.js +++ b/packages/app/src/components/DimensionsPanel/Dialogs/DialogManager.js @@ -18,6 +18,7 @@ import { DIMENSION_ID_PERIOD, DIMENSION_ID_ORGUNIT, FIXED_DIMENSIONS, + isSingleValue, } from '@dhis2/analytics'; import HideButton from './HideButton'; @@ -45,7 +46,6 @@ import { sGetMetadata } from '../../../reducers/metadata'; import { sGetSettingsDisplayNameProperty } from '../../../reducers/settings'; import { apiFetchRecommendedIds } from '../../../api/dimensions'; import { removeLastPathSegment, getOuPath } from '../../../modules/orgUnit'; -import { isSingleValue } from '../../../modules/chartTypes'; export class DialogManager extends Component { state = { diff --git a/packages/app/src/components/DimensionsPanel/Dialogs/__tests__/DialogManager.spec.js b/packages/app/src/components/DimensionsPanel/Dialogs/__tests__/DialogManager.spec.js index 2b8ba252a6..4f5a76368c 100644 --- a/packages/app/src/components/DimensionsPanel/Dialogs/__tests__/DialogManager.spec.js +++ b/packages/app/src/components/DimensionsPanel/Dialogs/__tests__/DialogManager.spec.js @@ -28,6 +28,7 @@ jest.mock('@dhis2/analytics', () => { DynamicDimension: () =>
, PeriodDimension: () =>
, OrgUnitDimension: () =>
, + isSingleValue: () => true, DIMENSION_ID_DATA: dataId, DIMENSION_ID_PERIOD: periodId, DIMENSION_ID_ORGUNIT: ouId, diff --git a/packages/app/src/components/DimensionsPanel/DimensionsPanel.js b/packages/app/src/components/DimensionsPanel/DimensionsPanel.js index 059e4f5ac8..7c9d104629 100644 --- a/packages/app/src/components/DimensionsPanel/DimensionsPanel.js +++ b/packages/app/src/components/DimensionsPanel/DimensionsPanel.js @@ -1,15 +1,14 @@ import React, { Component } from 'react'; import { connect } from 'react-redux'; import { - DIMENSION_ID_PERIOD, DimensionsPanel, DimensionMenu, + getDisallowedDims, } from '@dhis2/analytics'; import DialogManager from './Dialogs/DialogManager'; import { SOURCE_DIMENSIONS, getInverseLayout } from '../../modules/layout'; import { setDataTransfer } from '../../modules/dnd'; -import { isYearOverYear } from '../../modules/chartTypes'; import * as fromReducers from '../../reducers'; import * as fromActions from '../../actions'; @@ -21,6 +20,8 @@ import { acAddUiLayoutDimensions, acRemoveUiLayoutDimensions, } from '../../actions/ui'; +import { sGetUiType } from '../../reducers/ui'; +import { createSelector } from 'reselect'; export class Dimensions extends Component { state = { @@ -49,12 +50,8 @@ export class Dimensions extends Component { setDataTransfer(e, SOURCE_DIMENSIONS); }; - disabledDimension = dimension => { - return ( - dimension.id === DIMENSION_ID_PERIOD && - isYearOverYear(this.props.ui.type) - ); - }; + disabledDimension = dimension => + this.props.disallowedDimensions.includes(dimension.id); getUiAxisName = () => { const adaptedUi = getAdaptedUiByType(this.props.ui); @@ -98,6 +95,12 @@ export class Dimensions extends Component { ); } } + +const getDisallowedDimensions = createSelector( + [sGetUiType], + type => getDisallowedDims(type) +); + const mapStateToProps = state => { return { ui: fromReducers.fromUi.sGetUi(state), @@ -108,6 +111,7 @@ const mapStateToProps = state => { ), layout: fromReducers.fromUi.sGetUiLayout(state), itemsByDimension: fromReducers.fromUi.sGetUiItems(state), + disallowedDimensions: getDisallowedDimensions(state), }; }; diff --git a/packages/app/src/components/DimensionsPanel/__tests__/DimensionsPanel.spec.js b/packages/app/src/components/DimensionsPanel/__tests__/DimensionsPanel.spec.js index 0ce8fb9411..c7c69171d7 100644 --- a/packages/app/src/components/DimensionsPanel/__tests__/DimensionsPanel.spec.js +++ b/packages/app/src/components/DimensionsPanel/__tests__/DimensionsPanel.spec.js @@ -20,8 +20,12 @@ describe('The Dimensions component ', () => { dimensions: {}, ui: { layout: {}, + type: '', }, itemsByDimension: {}, + dualAxisItemHandler: () => {}, + axisItemHandler: () => {}, + removeItemHandler: () => {}, }; }); diff --git a/packages/app/src/components/Layout/Chip.js b/packages/app/src/components/Layout/Chip.js index 8d3dbd0ada..ac26edf099 100644 --- a/packages/app/src/components/Layout/Chip.js +++ b/packages/app/src/components/Layout/Chip.js @@ -1,8 +1,12 @@ import React from 'react'; import { connect } from 'react-redux'; -import i18n from '@dhis2/d2-i18n'; -import { FIXED_DIMENSIONS, DIMENSION_ID_DATA } from '@dhis2/analytics'; import WarningIcon from '@material-ui/icons/Warning'; +import i18n from '@dhis2/d2-i18n'; +import { + FIXED_DIMENSIONS, + DIMENSION_ID_DATA, + isSingleValue, +} from '@dhis2/analytics'; import Menu from './Menu'; import Tooltip from './Tooltip'; @@ -12,7 +16,6 @@ import { sGetUiItemsByDimension, sGetUiType } from '../../reducers/ui'; import DynamicDimensionIcon from '../../assets/DynamicDimensionIcon'; import { sGetMetadata } from '../../reducers/metadata'; import { styles } from './styles/Chip.style'; -import { isSingleValue } from '../../modules/chartTypes'; const TOOLTIP_ENTER_DELAY = 500; diff --git a/packages/app/src/components/Layout/DefaultLayout/DefaultAxis.js b/packages/app/src/components/Layout/DefaultLayout/DefaultAxis.js index ce53b8ee7e..987ebfa9cb 100644 --- a/packages/app/src/components/Layout/DefaultLayout/DefaultAxis.js +++ b/packages/app/src/components/Layout/DefaultLayout/DefaultAxis.js @@ -7,6 +7,8 @@ import { AXIS_NAME_COLUMNS, AXIS_NAMES, DIMENSION_ID_DATA, + isYearOverYear, + isDualAxisType, } from '@dhis2/analytics'; import Chip from '../Chip'; @@ -18,7 +20,6 @@ import { } from '../../../actions/ui'; import { SOURCE_DIMENSIONS, menuLabels } from '../../../modules/layout'; import { getAdaptedUiByType } from '../../../modules/ui'; -import { isYearOverYear, isDualAxisType } from '../../../modules/chartTypes'; import styles from './styles/DefaultAxis.style'; diff --git a/packages/app/src/components/Layout/Layout.js b/packages/app/src/components/Layout/Layout.js index c3805d98eb..5ddc17e459 100644 --- a/packages/app/src/components/Layout/Layout.js +++ b/packages/app/src/components/Layout/Layout.js @@ -1,40 +1,40 @@ import React from 'react'; import { connect } from 'react-redux'; +import { + VIS_TYPE_COLUMN, + VIS_TYPE_STACKED_COLUMN, + VIS_TYPE_BAR, + VIS_TYPE_STACKED_BAR, + VIS_TYPE_LINE, + VIS_TYPE_AREA, + VIS_TYPE_PIE, + VIS_TYPE_RADAR, + VIS_TYPE_GAUGE, + VIS_TYPE_YEAR_OVER_YEAR_LINE, + VIS_TYPE_YEAR_OVER_YEAR_COLUMN, + VIS_TYPE_SINGLE_VALUE, + VIS_TYPE_PIVOT_TABLE, +} from '@dhis2/analytics'; import DefaultLayout from './DefaultLayout/DefaultLayout'; import YearOverYearLayout from './YearOverYearLayout/YearOverYearLayout'; import PieLayout from './PieLayout/PieLayout'; -import { - COLUMN, - STACKED_COLUMN, - BAR, - STACKED_BAR, - LINE, - AREA, - PIE, - RADAR, - GAUGE, - YEAR_OVER_YEAR_LINE, - YEAR_OVER_YEAR_COLUMN, - SINGLE_VALUE, - PIVOT_TABLE, -} from '../../modules/chartTypes'; import { sGetUiType } from '../../reducers/ui'; const layoutMap = { - [COLUMN]: DefaultLayout, - [STACKED_COLUMN]: DefaultLayout, - [BAR]: DefaultLayout, - [STACKED_BAR]: DefaultLayout, - [LINE]: DefaultLayout, - [AREA]: DefaultLayout, - [PIE]: PieLayout, - [RADAR]: DefaultLayout, - [GAUGE]: PieLayout, - [YEAR_OVER_YEAR_LINE]: YearOverYearLayout, - [YEAR_OVER_YEAR_COLUMN]: YearOverYearLayout, - [SINGLE_VALUE]: PieLayout, - [PIVOT_TABLE]: DefaultLayout, + [VIS_TYPE_COLUMN]: DefaultLayout, + [VIS_TYPE_STACKED_COLUMN]: DefaultLayout, + [VIS_TYPE_BAR]: DefaultLayout, + [VIS_TYPE_STACKED_BAR]: DefaultLayout, + [VIS_TYPE_LINE]: DefaultLayout, + [VIS_TYPE_AREA]: DefaultLayout, + [VIS_TYPE_PIE]: PieLayout, + [VIS_TYPE_RADAR]: DefaultLayout, + [VIS_TYPE_GAUGE]: PieLayout, + [VIS_TYPE_YEAR_OVER_YEAR_LINE]: YearOverYearLayout, + [VIS_TYPE_YEAR_OVER_YEAR_COLUMN]: YearOverYearLayout, + [VIS_TYPE_SINGLE_VALUE]: PieLayout, + [VIS_TYPE_PIVOT_TABLE]: DefaultLayout, }; const getLayoutByType = (type, props) => { diff --git a/packages/app/src/components/VisualizationTypeSelector/VisualizationTypeIcon.js b/packages/app/src/components/VisualizationTypeSelector/MenuItemIcon.js similarity index 62% rename from packages/app/src/components/VisualizationTypeSelector/VisualizationTypeIcon.js rename to packages/app/src/components/VisualizationTypeSelector/MenuItemIcon.js index bb5487c31f..50fc5c7284 100644 --- a/packages/app/src/components/VisualizationTypeSelector/VisualizationTypeIcon.js +++ b/packages/app/src/components/VisualizationTypeSelector/MenuItemIcon.js @@ -1,5 +1,20 @@ import React from 'react'; import PropTypes from 'prop-types'; +import { + VIS_TYPE_COLUMN, + VIS_TYPE_STACKED_COLUMN, + VIS_TYPE_BAR, + VIS_TYPE_STACKED_BAR, + VIS_TYPE_LINE, + VIS_TYPE_AREA, + VIS_TYPE_PIE, + VIS_TYPE_RADAR, + VIS_TYPE_GAUGE, + VIS_TYPE_YEAR_OVER_YEAR_LINE, + VIS_TYPE_YEAR_OVER_YEAR_COLUMN, + VIS_TYPE_SINGLE_VALUE, + VIS_TYPE_PIVOT_TABLE, +} from '@dhis2/analytics'; import ColumnIcon from '../../assets/ColumnIcon'; import StackedColumnIcon from '../../assets/StackedColumnIcon'; @@ -16,62 +31,43 @@ import SingleValueIcon from '../../assets/SingleValueIcon'; import GlobeIcon from '../../assets/GlobeIcon'; import PivotTableIcon from '../../assets/PivotTableIcon'; -import { - PIVOT_TABLE, - COLUMN, - STACKED_COLUMN, - BAR, - STACKED_BAR, - LINE, - AREA, - PIE, - RADAR, - GAUGE, - YEAR_OVER_YEAR_LINE, - YEAR_OVER_YEAR_COLUMN, - SINGLE_VALUE, - OPEN_AS_MAP, - chartTypeDisplayNames, -} from '../../modules/chartTypes'; - -const VisualizationTypeIcon = ({ type = PIVOT_TABLE, style }) => { - switch (type) { - case COLUMN: - return ; - case STACKED_COLUMN: +const MenuItemIcon = ({ iconType, style }) => { + switch (iconType) { + case VIS_TYPE_STACKED_COLUMN: return ; - case BAR: + case VIS_TYPE_BAR: return ; - case STACKED_BAR: + case VIS_TYPE_STACKED_BAR: return ; - case PIE: + case VIS_TYPE_PIE: return ; - case GAUGE: + case VIS_TYPE_GAUGE: return ; - case LINE: + case VIS_TYPE_LINE: return ; - case AREA: + case VIS_TYPE_AREA: return ; - case RADAR: + case VIS_TYPE_RADAR: return ; - case YEAR_OVER_YEAR_LINE: + case VIS_TYPE_YEAR_OVER_YEAR_LINE: return ; - case YEAR_OVER_YEAR_COLUMN: + case VIS_TYPE_YEAR_OVER_YEAR_COLUMN: return ; - case SINGLE_VALUE: + case VIS_TYPE_SINGLE_VALUE: return ; - case OPEN_AS_MAP: + case 'MAP': return ; - case PIVOT_TABLE: + case VIS_TYPE_PIVOT_TABLE: return ; + case VIS_TYPE_COLUMN: default: return ; } }; -VisualizationTypeIcon.propTypes = { - type: PropTypes.oneOf(Object.keys(chartTypeDisplayNames)), +MenuItemIcon.propTypes = { + iconType: PropTypes.string, style: PropTypes.object, }; -export default VisualizationTypeIcon; +export default MenuItemIcon; diff --git a/packages/app/src/components/VisualizationTypeSelector/VisualizationTypeMenuItem.js b/packages/app/src/components/VisualizationTypeSelector/VisualizationTypeMenuItem.js index 211aa8d5b5..b04c4eba00 100644 --- a/packages/app/src/components/VisualizationTypeSelector/VisualizationTypeMenuItem.js +++ b/packages/app/src/components/VisualizationTypeSelector/VisualizationTypeMenuItem.js @@ -1,30 +1,29 @@ import React from 'react'; import PropTypes from 'prop-types'; - import MenuItem from '@material-ui/core/MenuItem/MenuItem'; + import ListItemIcon from '@material-ui/core/ListItemIcon/ListItemIcon'; import ListItemText from '@material-ui/core/ListItemText/ListItemText'; - -import { chartTypeDisplayNames } from '../../modules/chartTypes'; -import VisualizationTypeIcon from './VisualizationTypeIcon'; +import MenuItemIcon from './MenuItemIcon'; const VisualizationTypeMenuItem = ({ - type, - visualizationType, + iconType, styles, + label, + isSelected, ...props }) => ( - + @@ -32,9 +31,10 @@ const VisualizationTypeMenuItem = ({ ); VisualizationTypeMenuItem.propTypes = { - type: PropTypes.oneOf(Object.keys(chartTypeDisplayNames)), - visualizationType: PropTypes.oneOf(Object.keys(chartTypeDisplayNames)), + iconType: PropTypes.string, styles: PropTypes.object, + label: PropTypes.string, + isSelected: PropTypes.bool, }; export default VisualizationTypeMenuItem; diff --git a/packages/app/src/components/VisualizationTypeSelector/VisualizationTypeSelector.js b/packages/app/src/components/VisualizationTypeSelector/VisualizationTypeSelector.js index 4ffad570ce..ac03902284 100644 --- a/packages/app/src/components/VisualizationTypeSelector/VisualizationTypeSelector.js +++ b/packages/app/src/components/VisualizationTypeSelector/VisualizationTypeSelector.js @@ -1,16 +1,12 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; - import ArrowDropDownIcon from '@material-ui/icons/ArrowDropDown'; import Button from '@material-ui/core/Button'; import Menu from '@material-ui/core/Menu'; +import { visTypeDisplayNames } from '@dhis2/analytics'; +import i18n from '@dhis2/d2-i18n'; -import { - chartTypeDisplayNames, - isOpenAsType, - OPEN_AS_MAP, -} from '../../modules/chartTypes'; import { prepareCurrentAnalyticalObject } from '../../modules/currentAnalyticalObject'; import { sGetUi, sGetUiType } from '../../reducers/ui'; import { sGetCurrent } from '../../reducers/current'; @@ -22,7 +18,7 @@ import { } from '../../api/userDataStore'; import VisualizationTypeMenuItem from './VisualizationTypeMenuItem'; -import VisualizationTypeIcon from './VisualizationTypeIcon'; +import MenuItemIcon from './MenuItemIcon'; import styles from './styles/VisualizationTypeSelector.style'; export const MAPS_APP_URL = 'dhis-web-maps'; @@ -37,7 +33,6 @@ export class VisualizationTypeSelector extends Component { this.state = defaultState; this.baseUrl = context.baseUrl; - this.chartTypes = this.getChartTypes(); } handleButtonClick = event => { @@ -49,13 +44,7 @@ export class VisualizationTypeSelector extends Component { this.handleClose(); }; - handleOpenAsMenuItemClick = type => () => { - if (type === OPEN_AS_MAP) { - this.handleOpenChartAsMapClick(); - } - }; - - handleOpenChartAsMapClick = async () => { + handleOpenAsMapClick = async () => { const currentAnalyticalObject = prepareCurrentAnalyticalObject( this.props.current, this.props.metadata, @@ -71,25 +60,11 @@ export class VisualizationTypeSelector extends Component { this.setState({ anchorEl: null }); }; - getChartTypes = () => { - return Object.keys(chartTypeDisplayNames).reduce( - (result, type) => { - const chartType = isOpenAsType(type) - ? 'openAsTypes' - : 'nativeTypes'; - - result[chartType].push(type); - - return result; - }, - { nativeTypes: [], openAsTypes: [] } - ); - }; + getVisTypes = () => Object.keys(visTypeDisplayNames); render() { const { anchorEl } = this.state; const { visualizationType } = this.props; - const { nativeTypes, openAsTypes } = this.chartTypes; return ( @@ -101,8 +76,8 @@ export class VisualizationTypeSelector extends Component { size="small" style={styles.button} > - - {chartTypeDisplayNames[visualizationType]} + + {visTypeDisplayNames[visualizationType]} - {nativeTypes.map(type => ( + {this.getVisTypes().map(type => ( ))}

- {openAsTypes.map(type => ( - - ))} +
); @@ -143,7 +117,7 @@ export class VisualizationTypeSelector extends Component { } VisualizationTypeSelector.propTypes = { - visualizationType: PropTypes.oneOf(Object.keys(chartTypeDisplayNames)), + visualizationType: PropTypes.oneOf(Object.keys(visTypeDisplayNames)), current: PropTypes.object, metadata: PropTypes.object, ui: PropTypes.object, diff --git a/packages/app/src/components/VisualizationTypeSelector/__tests__/VisualizationTypeMenuItem.spec.js b/packages/app/src/components/VisualizationTypeSelector/__tests__/VisualizationTypeMenuItem.spec.js index 64650d0168..65fe72fb9b 100644 --- a/packages/app/src/components/VisualizationTypeSelector/__tests__/VisualizationTypeMenuItem.spec.js +++ b/packages/app/src/components/VisualizationTypeSelector/__tests__/VisualizationTypeMenuItem.spec.js @@ -1,9 +1,10 @@ import React from 'react'; import { shallow } from 'enzyme'; +import { VIS_TYPE_COLUMN } from '@dhis2/analytics'; + import VisualizationTypeMenuItem from '../VisualizationTypeMenuItem'; import MenuItem from '@material-ui/core/MenuItem'; -import VisualizationTypeIcon from '../VisualizationTypeIcon'; -import { COLUMN } from '../../../modules/chartTypes'; +import MenuItemIcon from '../MenuItemIcon'; describe('VisualizationTypeMenuItem component ', () => { let props; @@ -18,8 +19,8 @@ describe('VisualizationTypeMenuItem component ', () => { beforeEach(() => { props = { - type: COLUMN, - visualizationType: COLUMN, + type: VIS_TYPE_COLUMN, + visualizationType: VIS_TYPE_COLUMN, styles: {}, }; shallowElement = undefined; @@ -33,10 +34,10 @@ describe('VisualizationTypeMenuItem component ', () => { ).toEqual(1); }); - it('renders VisualizationTypeIcon', () => { + it('renders MenuItemIcon', () => { expect( element() - .find(VisualizationTypeIcon) + .find(MenuItemIcon) .first().length ).toEqual(1); }); diff --git a/packages/app/src/modules/chartTypes.js b/packages/app/src/modules/chartTypes.js deleted file mode 100644 index d010961e1b..0000000000 --- a/packages/app/src/modules/chartTypes.js +++ /dev/null @@ -1,46 +0,0 @@ -import i18n from '@dhis2/d2-i18n'; - -export const COLUMN = 'COLUMN'; -export const STACKED_COLUMN = 'STACKED_COLUMN'; -export const BAR = 'BAR'; -export const STACKED_BAR = 'STACKED_BAR'; -export const LINE = 'LINE'; -export const AREA = 'AREA'; -export const PIE = 'PIE'; -export const RADAR = 'RADAR'; -export const GAUGE = 'GAUGE'; -export const BUBBLE = 'BUBBLE'; -export const YEAR_OVER_YEAR_LINE = 'YEAR_OVER_YEAR_LINE'; -export const YEAR_OVER_YEAR_COLUMN = 'YEAR_OVER_YEAR_COLUMN'; -export const SINGLE_VALUE = 'SINGLE_VALUE'; -export const PIVOT_TABLE = 'PIVOT_TABLE'; -export const OPEN_AS_MAP = 'OPEN_AS_MAP'; - -export const chartTypeDisplayNames = { - [PIVOT_TABLE]: i18n.t('Pivot table'), - [COLUMN]: i18n.t('Column'), - [STACKED_COLUMN]: i18n.t('Stacked column'), - [BAR]: i18n.t('Bar'), - [STACKED_BAR]: i18n.t('Stacked bar'), - [LINE]: i18n.t('Line'), - [AREA]: i18n.t('Area'), - [PIE]: i18n.t('Pie'), - [RADAR]: i18n.t('Radar'), - [GAUGE]: i18n.t('Gauge'), - [YEAR_OVER_YEAR_LINE]: i18n.t('Year over year (line)'), - [YEAR_OVER_YEAR_COLUMN]: i18n.t('Year over year (column)'), - [SINGLE_VALUE]: i18n.t('Single value'), - [OPEN_AS_MAP]: i18n.t('Open as Map'), // TODO Open as: Map when i18next nsSeparator fixed -}; - -const stackedTypes = [STACKED_COLUMN, STACKED_BAR, AREA]; -const yearOverYearTypes = [YEAR_OVER_YEAR_LINE, YEAR_OVER_YEAR_COLUMN]; -const openAsTypes = [OPEN_AS_MAP]; -const dualAxisTypes = [COLUMN, BAR, LINE, AREA]; - -export const defaultChartType = PIVOT_TABLE; -export const isStacked = type => stackedTypes.includes(type); -export const isYearOverYear = type => yearOverYearTypes.includes(type); -export const isOpenAsType = type => openAsTypes.includes(type); -export const isDualAxisType = type => dualAxisTypes.includes(type); -export const isSingleValue = type => type === SINGLE_VALUE; diff --git a/packages/app/src/modules/layoutValidation.js b/packages/app/src/modules/layoutValidation.js index e09053b2e4..c2c160913f 100644 --- a/packages/app/src/modules/layoutValidation.js +++ b/packages/app/src/modules/layoutValidation.js @@ -4,18 +4,16 @@ import { DIMENSION_ID_DATA, DIMENSION_ID_PERIOD, FIXED_DIMENSIONS, + VIS_TYPE_YEAR_OVER_YEAR_LINE, + VIS_TYPE_YEAR_OVER_YEAR_COLUMN, + VIS_TYPE_PIE, + VIS_TYPE_GAUGE, + VIS_TYPE_SINGLE_VALUE, dimensionIsValid, layoutGetDimension, axisLabels, } from '@dhis2/analytics'; -import { - YEAR_OVER_YEAR_LINE, - YEAR_OVER_YEAR_COLUMN, - PIE, - GAUGE, - SINGLE_VALUE, -} from './chartTypes'; import { BASE_FIELD_YEARLY_SERIES } from './fields/baseFields'; const dxName = FIXED_DIMENSIONS[DIMENSION_ID_DATA].name; @@ -139,13 +137,13 @@ const validateSingleValueLayout = layout => { export const validateLayout = layout => { switch (layout.type) { - case PIE: - case GAUGE: + case VIS_TYPE_PIE: + case VIS_TYPE_GAUGE: return validatePieLayout(layout); - case YEAR_OVER_YEAR_COLUMN: - case YEAR_OVER_YEAR_LINE: + case VIS_TYPE_YEAR_OVER_YEAR_COLUMN: + case VIS_TYPE_YEAR_OVER_YEAR_LINE: return validateYearOverYearLayout(layout); - case SINGLE_VALUE: + case VIS_TYPE_SINGLE_VALUE: return validateSingleValueLayout(layout); default: return validateDefaultLayout(layout); diff --git a/packages/app/src/modules/ui.js b/packages/app/src/modules/ui.js index b631e50785..891b2731eb 100644 --- a/packages/app/src/modules/ui.js +++ b/packages/app/src/modules/ui.js @@ -3,18 +3,16 @@ import { DIMENSION_ID_ORGUNIT, layoutGetAxisNameDimensionIdsObject, layoutGetDimensionIdItemIdsObject, + VIS_TYPE_YEAR_OVER_YEAR_LINE, + VIS_TYPE_YEAR_OVER_YEAR_COLUMN, + VIS_TYPE_PIE, + VIS_TYPE_GAUGE, + VIS_TYPE_SINGLE_VALUE, + defaultVisType, + isYearOverYear, } from '@dhis2/analytics'; -import { - YEAR_OVER_YEAR_LINE, - YEAR_OVER_YEAR_COLUMN, - PIE, - GAUGE, - SINGLE_VALUE, - defaultChartType, -} from './chartTypes'; import { getInverseLayout } from './layout'; -import { isYearOverYear } from './chartTypes'; import { getOptionsFromVisualization } from './options'; import { BASE_FIELD_YEARLY_SERIES } from './fields/baseFields'; import { @@ -28,7 +26,7 @@ import { getAxesFromSeriesItems } from './seriesItems'; // Transform from backend model to store.ui format export const getUiFromVisualization = (vis, currentState = {}) => ({ ...currentState, - type: vis.type || defaultChartType, + type: vis.type || defaultVisType, options: getOptionsFromVisualization(vis), layout: layoutGetAxisNameDimensionIdsObject(vis), itemsByDimension: layoutGetDimensionIdItemIdsObject(vis), @@ -73,15 +71,15 @@ export const singleValueUiAdapter = ui => ({ export const getAdaptedUiByType = ui => { switch (ui.type) { - case YEAR_OVER_YEAR_LINE: - case YEAR_OVER_YEAR_COLUMN: { + case VIS_TYPE_YEAR_OVER_YEAR_LINE: + case VIS_TYPE_YEAR_OVER_YEAR_COLUMN: { return yearOverYearUiAdapter(ui); } - case PIE: - case GAUGE: { + case VIS_TYPE_PIE: + case VIS_TYPE_GAUGE: { return pieUiAdapter(ui); } - case SINGLE_VALUE: { + case VIS_TYPE_SINGLE_VALUE: { return singleValueUiAdapter(ui); } default: diff --git a/packages/app/src/reducers/__tests__/current.spec.js b/packages/app/src/reducers/__tests__/current.spec.js index 88369dd988..a8dd1e9d64 100644 --- a/packages/app/src/reducers/__tests__/current.spec.js +++ b/packages/app/src/reducers/__tests__/current.spec.js @@ -2,6 +2,8 @@ import { DIMENSION_ID_DATA, DIMENSION_ID_PERIOD, DIMENSION_ID_ORGUNIT, + VIS_TYPE_YEAR_OVER_YEAR_LINE, + VIS_TYPE_COLUMN, } from '@dhis2/analytics'; import options from '../../modules/options'; @@ -11,7 +13,6 @@ import reducer, { SET_CURRENT_FROM_UI, CLEAR_CURRENT, } from '../current'; -import { COLUMN, YEAR_OVER_YEAR_LINE } from '../../modules/chartTypes'; describe('reducer: current', () => { it('should return the default state', () => { @@ -41,7 +42,7 @@ describe('reducer: current', () => { it('SET_CURRENT_FROM_UI: should set the current from the ui state section', () => { const ui = { - type: COLUMN, + type: VIS_TYPE_COLUMN, layout: { columns: [DIMENSION_ID_DATA], rows: [DIMENSION_ID_ORGUNIT], @@ -89,7 +90,7 @@ describe('reducer: current', () => { it('SET_CURRENT_FROM_UI: should set current on a year on year format from the ui state section', () => { const ui = { - type: YEAR_OVER_YEAR_LINE, + type: VIS_TYPE_YEAR_OVER_YEAR_LINE, options, layout: { columns: [], diff --git a/packages/app/src/reducers/__tests__/ui.spec.js b/packages/app/src/reducers/__tests__/ui.spec.js index f34bcab069..4c4629fb6a 100644 --- a/packages/app/src/reducers/__tests__/ui.spec.js +++ b/packages/app/src/reducers/__tests__/ui.spec.js @@ -5,10 +5,10 @@ import { AXIS_NAME_COLUMNS, AXIS_NAME_ROWS, AXIS_NAME_FILTERS, + VIS_TYPE_BAR, } from '@dhis2/analytics'; import * as ui from '../ui'; -import { BAR } from '../../modules/chartTypes'; const reducer = ui.default; @@ -32,7 +32,7 @@ const ou = { items: [{ id: ouItem1Id }], }; -const type = BAR; +const type = VIS_TYPE_BAR; const aggregationType = 'SUM'; const visualization = { diff --git a/packages/app/src/reducers/current.js b/packages/app/src/reducers/current.js index 92283d9faf..ce3db3be9c 100644 --- a/packages/app/src/reducers/current.js +++ b/packages/app/src/reducers/current.js @@ -1,3 +1,11 @@ +import { + VIS_TYPE_YEAR_OVER_YEAR_LINE, + VIS_TYPE_YEAR_OVER_YEAR_COLUMN, + VIS_TYPE_PIE, + VIS_TYPE_GAUGE, + VIS_TYPE_SINGLE_VALUE, +} from '@dhis2/analytics'; + import { getAxesFromUi, getOptionsFromUi, @@ -6,13 +14,6 @@ import { getSingleValueCurrentFromUi, getSeriesItemsFromUi, } from '../modules/current'; -import { - YEAR_OVER_YEAR_LINE, - YEAR_OVER_YEAR_COLUMN, - PIE, - GAUGE, - SINGLE_VALUE, -} from '../modules/chartTypes'; import { BASE_FIELD_TYPE } from '../modules/fields/baseFields'; export const SET_CURRENT = 'SET_CURRENT'; @@ -42,13 +43,13 @@ export default (state = DEFAULT_CURRENT, action) => { } case SET_CURRENT_FROM_UI: { switch (action.value.type) { - case PIE: - case GAUGE: + case VIS_TYPE_PIE: + case VIS_TYPE_GAUGE: return getPieCurrentFromUi(state, action); - case SINGLE_VALUE: + case VIS_TYPE_SINGLE_VALUE: return getSingleValueCurrentFromUi(state, action); - case YEAR_OVER_YEAR_LINE: - case YEAR_OVER_YEAR_COLUMN: + case VIS_TYPE_YEAR_OVER_YEAR_LINE: + case VIS_TYPE_YEAR_OVER_YEAR_COLUMN: return getYearOverYearCurrentFromUi(state, action); default: { return getDefaultFromUi(state, action); @@ -69,13 +70,13 @@ export const sGetCurrentFromUi = state => { const ui = state.ui; switch (ui.type) { - case PIE: - case GAUGE: + case VIS_TYPE_PIE: + case VIS_TYPE_GAUGE: return getPieCurrentFromUi(state, { value: ui }); - case SINGLE_VALUE: + case VIS_TYPE_SINGLE_VALUE: return getSingleValueCurrentFromUi(state, { value: ui }); - case YEAR_OVER_YEAR_LINE: - case YEAR_OVER_YEAR_COLUMN: + case VIS_TYPE_YEAR_OVER_YEAR_LINE: + case VIS_TYPE_YEAR_OVER_YEAR_COLUMN: return getYearOverYearCurrentFromUi(state, { value: ui }); default: { return getDefaultFromUi(state, { value: ui }); diff --git a/packages/app/src/reducers/ui.js b/packages/app/src/reducers/ui.js index ddd34e00b0..b956131d91 100644 --- a/packages/app/src/reducers/ui.js +++ b/packages/app/src/reducers/ui.js @@ -5,11 +5,11 @@ import { DIMENSION_ID_ORGUNIT, AXIS_NAME_COLUMNS, AXIS_NAME_ROWS, + VIS_TYPE_COLUMN, } from '@dhis2/analytics'; import { getFilteredLayout, getSwapModObj } from '../modules/layout'; import { getOptionsForUi } from '../modules/options'; -import { PIVOT_TABLE } from '../modules/chartTypes'; import { getUiFromVisualization } from '../modules/ui'; export const SET_UI = 'SET_UI'; @@ -35,7 +35,7 @@ export const CLEAR_UI_INTERPRETATION = 'CLEAR_UI_INTERPRETATION'; export const SET_AXES = 'SET_AXES'; export const DEFAULT_UI = { - type: PIVOT_TABLE, + type: VIS_TYPE_COLUMN, options: getOptionsForUi(), layout: { columns: [DIMENSION_ID_DATA], diff --git a/packages/plugin/package.json b/packages/plugin/package.json index 2f7e8e7236..c4a0dc701e 100644 --- a/packages/plugin/package.json +++ b/packages/plugin/package.json @@ -5,7 +5,7 @@ "main": "./build/index.js", "license": "BSD-3-Clause", "dependencies": { - "@dhis2/analytics": "^2.5.1", + "@dhis2/analytics": "^2.6.2", "@material-ui/core": "^3.1.2", "lodash-es": "^4.17.11", "react": "^16.6.0", diff --git a/packages/plugin/src/ChartPlugin.js b/packages/plugin/src/ChartPlugin.js index 3f07e23a4a..777d8b0383 100644 --- a/packages/plugin/src/ChartPlugin.js +++ b/packages/plugin/src/ChartPlugin.js @@ -2,14 +2,17 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; import isEqual from 'lodash-es/isEqual'; import i18n from '@dhis2/d2-i18n'; -import { createVisualization } from '@dhis2/analytics'; +import { + isYearOverYear, + isSingleValue, + createVisualization, +} from '@dhis2/analytics'; import { apiFetchVisualization } from './api/visualization'; import { apiFetchAnalytics, apiFetchAnalyticsForYearOverYear, } from './api/analytics'; -import { isYearOverYear, isSingleValue } from './modules/chartTypes'; import { getOptionsForRequest } from './modules/options'; import { computeGenericPeriodNames } from './modules/analytics'; import { BASE_FIELD_YEARLY_SERIES } from './modules/fields/baseFields'; @@ -111,7 +114,7 @@ class ChartPlugin extends Component { const extraOptions = { dashboard: forDashboard, - noData: { text: i18n.t('No data') } + noData: { text: i18n.t('No data') }, }; let responses = []; diff --git a/packages/plugin/src/__tests__/ChartPlugin.spec.js b/packages/plugin/src/__tests__/ChartPlugin.spec.js index 348e87d092..961089f3a1 100644 --- a/packages/plugin/src/__tests__/ChartPlugin.spec.js +++ b/packages/plugin/src/__tests__/ChartPlugin.spec.js @@ -1,16 +1,12 @@ import React from 'react'; import { shallow } from 'enzyme'; +import * as analytics from '@dhis2/analytics'; + import LoadingMask from '../widgets/LoadingMask'; import ChartPlugin from '../ChartPlugin'; -import * as analytics from '@dhis2/analytics'; import * as api from '../api/analytics'; import * as apiViz from '../api/visualization'; import * as options from '../modules/options'; -import { - YEAR_OVER_YEAR_LINE, - COLUMN, - SINGLE_VALUE, -} from '../modules/chartTypes'; jest.mock('@dhis2/analytics'); @@ -42,21 +38,21 @@ const ouMock = { }; const defaultCurrentMock = { - type: COLUMN, + type: analytics.VIS_TYPE_COLUMN, columns: [dxMock], rows: [peMock], filters: [ouMock], }; const yearOverYearCurrentMock = { - type: YEAR_OVER_YEAR_LINE, + type: analytics.VIS_TYPE_YEAR_OVER_YEAR_LINE, columns: [dxMock], rows: [peMock], yearlySeries: ['LAST_YEAR'], }; const singleValueCurrentMock = { - type: SINGLE_VALUE, + type: analytics.VIS_TYPE_SINGLE_VALUE, columns: [dxMock], rows: [], filters: [ouMock, peMock], @@ -100,6 +96,14 @@ const createVisualizationMock = { }, }; +const isYearOverYearMockResponse = visType => { + return visType === analytics.VIS_TYPE_YEAR_OVER_YEAR_LINE; +}; + +const isSingleValueMockResponse = visType => { + return visType === analytics.VIS_TYPE_SINGLE_VALUE; +}; + describe('ChartPlugin', () => { options.getOptionsForRequest = () => [ ['option1', { defaultValue: 'abc' }], @@ -277,6 +281,12 @@ describe('ChartPlugin', () => { api.apiFetchAnalyticsForYearOverYear = jest .fn() .mockResolvedValue(new MockYoYAnalyticsResponse()); + + analytics.isYearOverYear = jest + .fn() + .mockReturnValue( + isYearOverYearMockResponse(props.config.type) + ); }); it('makes year-on-year analytics request', done => { @@ -327,6 +337,12 @@ describe('ChartPlugin', () => { props.config = { ...singleValueCurrentMock, }; + + analytics.isSingleValue = jest + .fn() + .mockReturnValue( + isSingleValueMockResponse(props.config.type) + ); }); it('provides dhis as output format to createChart', done => { diff --git a/yarn.lock b/yarn.lock index cbedb51574..96fb9b7113 100644 --- a/yarn.lock +++ b/yarn.lock @@ -183,10 +183,10 @@ react-beautiful-dnd "^10.1.1" styled-jsx "^3.2.1" -"@dhis2/analytics@^2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@dhis2/analytics/-/analytics-2.5.1.tgz#02c2d27b35e67c3a8f9753f704b70423d97ab02d" - integrity sha512-Ifqz8NXUAaeZTDJMdfpbIEYKX8EjxCxZDY6VPGsM7RJaAqYB/y/HpcFaQHJ1gunKZ9a5CtRLSDL2EDFXNabx7A== +"@dhis2/analytics@^2.6.2": + version "2.6.2" + resolved "https://registry.yarnpkg.com/@dhis2/analytics/-/analytics-2.6.2.tgz#10223103dbad456507cdc676184000c8b96b2375" + integrity sha512-9i0yXVeLeHF/p4M5giw+cL2q+tJHYSuXaIeTUWPUcDEe0/vTou3BWOqOMlLNWU+5EXoE1XnGu+1R9GI+pbpV4g== dependencies: "@dhis2/d2-i18n" "^1.0.4" "@dhis2/d2-ui-org-unit-dialog" "^6.3.0"