From d33eee11275208ff3a2b4053459646e51406e4b4 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Wed, 3 Mar 2021 16:55:41 +0100 Subject: [PATCH] hebdo opened report --- routes/index.js | 45 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/routes/index.js b/routes/index.js index 117b849..5274fb7 100644 --- a/routes/index.js +++ b/routes/index.js @@ -5,6 +5,7 @@ var _ = require('lodash'); var parseString = require("xml2js").parseString; var router = express.Router(); +let searchTagsForHebdoReport = /\b(dev|sysadmin|écriture|edu|fediverse|april|chapril)\b/g; let convertFiles = true; // let convertFiles = false; let computeDataOnExtract = true; @@ -92,6 +93,7 @@ function computeData(jsonAllData) { listClosed : [], listClosedWeekly : [], listDevWeeklyClosed : [], + listDevWeeklyOpen : [], listClosedMonthly : [], } let now = new Date(); @@ -110,6 +112,12 @@ function computeData(jsonAllData) { if (daysDiff <= 7) { jsonAllData.stats.listOpenWeekly.push(t) + // listDevWeeklyOpen + // tâches uniquement de dev + if((searchTagsForHebdoReport).test(t['$'].tags) + ){ + jsonAllData.stats.listDevWeeklyOpen.push(t) + } } else if (daysDiff >= 7 & daysDiff <= 31) { jsonAllData.stats.listOpenMonthly.push(t) } @@ -123,7 +131,7 @@ function computeData(jsonAllData) { jsonAllData.stats.listClosedWeekly.push(t) // tâches uniquement de dev - if((/\b(dev|sysadmin|écriture|edu|fediverse)\b/g).test(t['$'].tags) + if((searchTagsForHebdoReport).test(t['$'].tags) ){ jsonAllData.stats.listDevWeeklyClosed.push(t) } @@ -230,11 +238,40 @@ function exportToMarkdown(res) { markdownExportData = `# Export de Tâches GTG \n date: ` + datenow.toLocaleString() // fichier de rapport des tâches fermées durant les 7 derniers jours - weeklyDevReport += `\n# Rapport hebdomadaire de dev `; - weeklyDevReport += `\r\n## ${jsonAllData.stats.listDevWeeklyClosed.length} ont été fermées `; + weeklyDevReport = `\n# Rapport hebdomadaire de dev `; + weeklyDevReport += `\n## 1/ Actions passées ou en cours +\n ` + weeklyDevReport += `\r\n## ${jsonAllData.stats.listDevWeeklyClosed.length} ont été fermées + \n___`; jsonAllData.stats.listDevWeeklyClosed.map(elem => { - weeklyDevReport += `\n* ${elem.title}`; + weeklyDevReport += `\n| ${elem['$'].tags} | ${elem.title}|`; }) +weeklyDevReport += ` +\n___ +\n +\n## 2/ Actions à venir +\n ` + weeklyDevReport += `\r\n## ${jsonAllData.stats.listDevWeeklyOpen.length} ont été ouvertes + \n___`; + jsonAllData.stats.listDevWeeklyOpen.map(elem => { + // weeklyDevReport += `\n| ${elem['$'].tags} | ${elem.title}|`; + weeklyDevReport += `\n| ${elem.title}|`; + }) +weeklyDevReport += ` +\n___ +\n +\n## 3/ Points de blocage / points en retard corrigés cette semaine +\n +\n## 4/ Points de blocage existants / points en retard à traiter +\n +\n## 5/ Points forts de la semaine +\n +\n## 6/ Points de vigilance de la semaine +\n +\n## 7/ Points forts de la réunion +\n +\n## 8/ Points de vigilance de la réunion `; + markdownExportData += `\n ${weeklyDevReport}`; markdownExportData += `\n---`; markdownExportData += `\n `;