Compare commits
2 Commits
7fb7a22f82
...
f4ac8fcd22
Author | SHA1 | Date | |
---|---|---|---|
f4ac8fcd22 | |||
8c180f2e47 |
@ -1,9 +1,9 @@
|
||||
|
||||
html, body {
|
||||
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
|
||||
background: #111;
|
||||
color: #fff;
|
||||
height: 100vh;
|
||||
background: #dddddd;
|
||||
color: #111;
|
||||
min-height: 100vh;
|
||||
}
|
||||
body {
|
||||
padding: 50px;
|
||||
|
296
routes/index.js
296
routes/index.js
@ -17,6 +17,7 @@ let jsonAllData = {
|
||||
stats: {},
|
||||
projects: {},
|
||||
tags: {},
|
||||
weeklyDevReport: ''
|
||||
}
|
||||
/* GET home page. */
|
||||
/**
|
||||
@ -70,7 +71,6 @@ router.get('/', async function (req, res, next) {
|
||||
title: "Conversion de GTG tâches",
|
||||
json: jsonAllData,
|
||||
markdown: markdownExportData,
|
||||
weeklyDevReport,
|
||||
getPercent,
|
||||
computeBgColorOnProportionOfOpenTasks,
|
||||
getPercentOfOpenTasks
|
||||
@ -95,14 +95,15 @@ function computeData(jsonConvertedData) {
|
||||
// trouver le nombre de tâches ayant un tag en particulier
|
||||
// et rajouter ce nombre à chaque tag, dans countTasks : N
|
||||
|
||||
// let counterOfTasks = jsonConvertedData.tasklist
|
||||
let counterOfTasks = gtgData.tasklist[0].task
|
||||
// compter les tâches
|
||||
// console.log('counterOfTasks',counterOfTasks);
|
||||
|
||||
jsonAllData.all = gtgData
|
||||
|
||||
jsonAllData.stats = {
|
||||
// tasksCount : counterOfTasks.length,
|
||||
tasksCount: 0,
|
||||
tasksCount : counterOfTasks.length,
|
||||
// tasksCount: 0,
|
||||
tasksClosed: 0,
|
||||
tasksOpen: 0,
|
||||
maxTasksCountPerTag: 0,
|
||||
@ -112,6 +113,7 @@ function computeData(jsonConvertedData) {
|
||||
listOpenMonthly: [],
|
||||
listClosed: [],
|
||||
listClosedWeekly: [],
|
||||
tasksListIsDismissByTitle: [],
|
||||
listDevWeeklyClosed: [],
|
||||
listDevWeeklyOpen: [],
|
||||
listClosedMonthly: [],
|
||||
@ -164,46 +166,48 @@ function computeData(jsonConvertedData) {
|
||||
|
||||
for (let tag of jsonAllData.stats.listTags) {
|
||||
// console.log('tag', tag)
|
||||
// jsonAllData.tags.tagstore.tag.map(elem => {
|
||||
// // console.log('elem', elem)
|
||||
// if (elem['$'].name == tag) {
|
||||
// if (!elem.tasks) {
|
||||
// elem.tasks = 0
|
||||
// }
|
||||
// if (!elem.tasksListById) {
|
||||
// elem.tasksListById = []
|
||||
// }
|
||||
// if (!elem.tasksListByTitle) {
|
||||
// elem.tasksListByTitle = []
|
||||
// }
|
||||
// if (!elem.tasksListIsActiveByTitle) {
|
||||
// elem.tasksListIsActiveByTitle = []
|
||||
// }
|
||||
// if (!elem.tasksListIsDoneByTitle) {
|
||||
// elem.tasksListIsDoneByTitle = []
|
||||
// }
|
||||
// elem.tasks++
|
||||
// elem.tasksListById.push(taskItem['$'].id)
|
||||
// elem.tasksListByTitle.push(taskItem.title)
|
||||
// if (taskItem['$'].status == "Active") {
|
||||
// elem.tasksListIsActiveByTitle.push(taskItem.title)
|
||||
//
|
||||
// }
|
||||
// if (taskItem['$'].status == "Done") {
|
||||
// elem.tasksListIsDoneByTitle.push(taskItem.title)
|
||||
// }
|
||||
// }
|
||||
// if (elem.tasks > gtgData.stats.maxTasksCountPerTag) {
|
||||
// jsonAllData.stats.maxTasksCountPerTag = elem.tasks
|
||||
// }
|
||||
// })
|
||||
jsonAllData.stats.listTags.map(elem => {
|
||||
// console.log('elem', elem)
|
||||
if (elem['$'].name == tag) {
|
||||
if (!elem.tasks) {
|
||||
elem.tasks = 0
|
||||
}
|
||||
if (!elem.tasksListById) {
|
||||
elem.tasksListById = []
|
||||
}
|
||||
if (!elem.tasksListByTitle) {
|
||||
elem.tasksListByTitle = []
|
||||
}
|
||||
if (!elem.tasksListIsActiveByTitle) {
|
||||
elem.tasksListIsActiveByTitle = []
|
||||
}
|
||||
if (!elem.tasksListIsDoneByTitle) {
|
||||
elem.tasksListIsDoneByTitle = []
|
||||
}
|
||||
elem.tasks++
|
||||
elem.tasksListById.push(taskItem['$'].id)
|
||||
elem.tasksListByTitle.push(taskItem.title)
|
||||
if (taskItem['$'].status == "Active") {
|
||||
elem.tasksListIsActiveByTitle.push(taskItem.title)
|
||||
}
|
||||
if (taskItem['$'].status == "Done") {
|
||||
elem.tasksListIsDoneByTitle.push(taskItem.title)
|
||||
}
|
||||
if (taskItem['$'].status == "Dismiss") {
|
||||
elem.tasksListIsDismissByTitle.push(taskItem.title)
|
||||
}
|
||||
}
|
||||
if (elem.tasks > jsonAllData.stats.maxTasksCountPerTag) {
|
||||
jsonAllData.stats.maxTasksCountPerTag = elem.tasks
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
// sort tags by name
|
||||
|
||||
console.log('stats', jsonAllData.stats);
|
||||
return jsonAllData.stats
|
||||
console.log('stats', jsonAllData);
|
||||
return jsonAllData
|
||||
|
||||
}
|
||||
|
||||
@ -255,119 +259,123 @@ function computeBgColorOnProportionOfOpenTasks(someProportionNumber) {
|
||||
|
||||
let datenow = new Date();
|
||||
let markdownExportData = ''
|
||||
let weeklyDevReport = ''
|
||||
let dataTagsMd = ''
|
||||
|
||||
|
||||
function exportToMarkdown(res) {
|
||||
|
||||
let weeklyDevReport = ''
|
||||
console.log('jsonAllData.stats', jsonAllData.stats);
|
||||
|
||||
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 += `\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['$'].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 `;
|
||||
// markdownExportData += `\n# Rapport des tâches durant les 7 derniers jours `;
|
||||
// markdownExportData += `\n `;
|
||||
// markdownExportData += `\n## ${jsonAllData.stats.listClosedWeekly.length} ont été fermées `;
|
||||
// markdownExportData += `\n `;
|
||||
// jsonAllData.stats.listClosedWeekly.map(elem => {
|
||||
// markdownExportData += `\n * ${elem.title}`;
|
||||
// })
|
||||
// markdownExportData += `\n## ${jsonAllData.stats.listOpenWeekly.length} ont été ouvertes `;
|
||||
// markdownExportData += `\n `;
|
||||
// jsonAllData.stats.listOpenWeekly.map(elem => {
|
||||
// markdownExportData += `\n * ${elem.title}`;
|
||||
// })
|
||||
// markdownExportData += `\n--- `;
|
||||
// // fichier de rapport des tâches fermées durant les 31 derniers jours
|
||||
// markdownExportData += `\n# Rapport des autres tâches durant le mois `;
|
||||
// markdownExportData += `\n `;
|
||||
// markdownExportData += `\n## ${jsonAllData.stats.listClosedMonthly.length} ont été fermées `;
|
||||
// markdownExportData += `\n `;
|
||||
// jsonAllData.stats.listClosedMonthly.map(elem => {
|
||||
// markdownExportData += `\n * ${elem.title}`;
|
||||
// })
|
||||
// markdownExportData += `\n## ${jsonAllData.stats.listOpenMonthly.length} ont été ouvertes `;
|
||||
// markdownExportData += `\n `;
|
||||
// jsonAllData.stats.listOpenMonthly.map(elem => {
|
||||
// markdownExportData += `\n * ${elem.title}`;
|
||||
// })
|
||||
//
|
||||
// markdownExportData += `\n--- `;
|
||||
// // stats de fermeture des tâches
|
||||
// markdownExportData += `\n# Stats de fermeture des tâches `;
|
||||
// markdownExportData += `\n `;
|
||||
// markdownExportData += `\n--- `;
|
||||
// markdownExportData += `\n `;
|
||||
// markdownExportData += `\n# Export de toutes les ${jsonAllData.stats.listOpen.length} tâches ouvertes GTG \n `;
|
||||
// markdownExportData += `\n `;
|
||||
// fichier de rapport des tâches fermées durant les 7 derniers jours
|
||||
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['$'].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 `;
|
||||
|
||||
// jsonAllData.stats.listOpen.map(elem => {
|
||||
// dataTagsMd += `\n## ${elem.title} `;
|
||||
// dataTagsMd += `\n statut : ${elem['$'].status} `;
|
||||
// dataTagsMd += `\n créé le : ${elem.addeddate} `;
|
||||
// dataTagsMd += `\n modifié le : ${elem.modified} `;
|
||||
// dataTagsMd += `\n prévu pour : ${elem.duedate | ''} `;
|
||||
// dataTagsMd += `\n ${elem.content} `;
|
||||
// })
|
||||
// markdownExportData += `\n--- `;
|
||||
// markdownExportData += `\n `;
|
||||
// markdownExportData += `\n# Export de toutes les ${jsonAllData.stats.listClosed.length} tâches fermées GTG \n `;
|
||||
// markdownExportData += `\n `;
|
||||
//
|
||||
// jsonAllData.stats.listClosed.map(elem=>{
|
||||
// dataTagsMd += `\n * ${elem.title} `;
|
||||
// })
|
||||
markdownExportData += `\n ${weeklyDevReport}`;
|
||||
markdownExportData += `\n---`;
|
||||
markdownExportData += `\n `;
|
||||
markdownExportData += `\n# Rapport des tâches durant les 7 derniers jours `;
|
||||
markdownExportData += `\n `;
|
||||
markdownExportData += `\n## ${jsonAllData.stats.listClosedWeekly.length} ont été fermées `;
|
||||
markdownExportData += `\n `;
|
||||
jsonAllData.stats.listClosedWeekly.map(elem => {
|
||||
markdownExportData += `\n * ${elem.title}`;
|
||||
})
|
||||
markdownExportData += `\n## ${jsonAllData.stats.listOpenWeekly.length} ont été ouvertes `;
|
||||
markdownExportData += `\n `;
|
||||
jsonAllData.stats.listOpenWeekly.map(elem => {
|
||||
markdownExportData += `\n * ${elem.title}`;
|
||||
})
|
||||
markdownExportData += `\n--- `;
|
||||
// fichier de rapport des tâches fermées durant les 31 derniers jours
|
||||
markdownExportData += `\n# Rapport des autres tâches durant le mois `;
|
||||
markdownExportData += `\n `;
|
||||
markdownExportData += `\n## ${jsonAllData.stats.listClosedMonthly.length} ont été fermées `;
|
||||
markdownExportData += `\n `;
|
||||
jsonAllData.stats.listClosedMonthly.map(elem => {
|
||||
markdownExportData += `\n * ${elem.title}`;
|
||||
})
|
||||
markdownExportData += `\n## ${jsonAllData.stats.listOpenMonthly.length} ont été ouvertes `;
|
||||
markdownExportData += `\n `;
|
||||
jsonAllData.stats.listOpenMonthly.map(elem => {
|
||||
markdownExportData += `\n * ${elem.title}`;
|
||||
})
|
||||
|
||||
// markdownExportData += `\n `;
|
||||
// markdownExportData += `\n# Export de Tags GTG \n `;
|
||||
// markdownExportData += `\n `;
|
||||
// markdownExportData += `\n `;
|
||||
markdownExportData += `\n--- `;
|
||||
// stats de fermeture des tâches
|
||||
markdownExportData += `\n# Stats de fermeture des tâches `;
|
||||
markdownExportData += `\n `;
|
||||
markdownExportData += `\n--- `;
|
||||
markdownExportData += `\n `;
|
||||
markdownExportData += `\n# Export de toutes les ${jsonAllData.stats.listOpen.length} tâches ouvertes GTG \n `;
|
||||
markdownExportData += `\n `;
|
||||
|
||||
jsonAllData.stats.listOpen.map(elem => {
|
||||
dataTagsMd += `\n## ${elem.title} `;
|
||||
dataTagsMd += `\n statut : ${elem['$'].status} `;
|
||||
dataTagsMd += `\n créé le : ${elem.addeddate} `;
|
||||
dataTagsMd += `\n modifié le : ${elem.modified} `;
|
||||
dataTagsMd += `\n prévu pour : ${elem.duedate | ''} `;
|
||||
dataTagsMd += `\n ${elem.content} `;
|
||||
})
|
||||
markdownExportData += `\n--- `;
|
||||
markdownExportData += `\n `;
|
||||
markdownExportData += `\n# Export de toutes les ${jsonAllData.stats.listClosed.length} tâches fermées GTG \n `;
|
||||
markdownExportData += `\n `;
|
||||
|
||||
jsonAllData.stats.listClosed.map(elem=>{
|
||||
dataTagsMd += `\n * ${elem.title} `;
|
||||
})
|
||||
|
||||
markdownExportData += `\n `;
|
||||
markdownExportData += `\n# Export de Tags GTG \n `;
|
||||
markdownExportData += `\n `;
|
||||
markdownExportData += `\n `;
|
||||
|
||||
let sortedTagsByTitle = _.sortBy(jsonAllData.stats.listTags, [(o) => {
|
||||
o["$"].name
|
||||
}])
|
||||
|
||||
sortedTagsByTitle.map(elem => {
|
||||
markdownExportData += `\n * ${elem['$'].name} , ${elem.tasks | 0}`;
|
||||
})
|
||||
|
||||
markdownExportData += `\n `;
|
||||
markdownExportData += `\n rapport généré avec gtg2nodejs par tykayn - contact@cipherbliss.com `;
|
||||
|
||||
jsonAllData.weeklyDevReport = weeklyDevReport;
|
||||
|
||||
// let sortedTagsByTitle = _.sortBy(jsonAllData.tags.tagstore.tag, [(o) => {
|
||||
// o["$"].name
|
||||
// }])
|
||||
//
|
||||
// sortedTagsByTitle.map(elem => {
|
||||
// markdownExportData += `\n * ${elem['$'].name} , ${elem.tasks | 0}`;
|
||||
// })
|
||||
//
|
||||
// markdownExportData += `\n `;
|
||||
// markdownExportData += `\n rapport généré avec gtg2nodejs par tykayn - contact@cipherbliss.com `;
|
||||
// write file to disk
|
||||
fs.writeFile(`output/export_hebdo.md`, markdownExportData, `utf8`, (err) => {
|
||||
|
||||
|
@ -4,20 +4,24 @@ block content
|
||||
h1= title
|
||||
p Welcome to #{title}
|
||||
section.tasks
|
||||
h2 #{json.tasks.project.task.length} Tâches
|
||||
h2 #{json.stats.tasksCount} Tâches
|
||||
ul.stats
|
||||
li #{json.stats.listOpen.length} ouvertes
|
||||
li #{json.stats.listOpenWeekly.length} ouvertes cette semaine
|
||||
li #{json.stats.listOpenMonthly.length} ouvertes ce mois-ci
|
||||
li #{json.stats.listClosed.length} fermées
|
||||
li #{json.stats.tasksListIsDismissByTitle.length} dismissed
|
||||
li #{json.stats.listClosedWeekly.length} fermées cette semaine
|
||||
li #{json.stats.listClosedMonthly.length} fermées ce mois-ci
|
||||
section.markdown
|
||||
h2 Rapport de dev de la semaine
|
||||
article(language="md")= weeklyDevReport
|
||||
section.tags
|
||||
h2 #{json.tags.tagstore.tag.length} Tags
|
||||
h2 #{json.stats.listTags.length} Tags
|
||||
p maximum de #{json.stats.maxTasksCountPerTag} tâches pour un tag.
|
||||
h2 Liste de rapport hebdo
|
||||
.report= json.weeklyDevReport
|
||||
h2 Tags
|
||||
ul.tags
|
||||
li.head
|
||||
span.name nom
|
||||
@ -27,20 +31,20 @@ block content
|
||||
span.tasks finies
|
||||
span.tasks actives
|
||||
span.tasks actives %
|
||||
each t in json.tags.tagstore.tag
|
||||
each tagItem in json.stats.listTags
|
||||
li
|
||||
span.name(class= {emphasis: t.tasks == json.stats.maxTasksCountPerTag})= t['$'].name
|
||||
span.color= t['$'].color
|
||||
span.parent= t['$'].parent
|
||||
if t.tasksListIsDoneByTitle
|
||||
span.text-right(class=computeBgColorOnProportionOfOpenTasks(getPercent(t.tasks, json.stats.maxTasksCountPerTag)))= t.tasks
|
||||
if t.tasksListIsDoneByTitle
|
||||
span.text-right.tasks= t.tasksListIsDoneByTitle.length
|
||||
if t.tasksListIsActiveByTitle
|
||||
span.text-right.tasks #{t.tasksListIsActiveByTitle.length}
|
||||
span.text-right.tasks(class=computeBgColorOnProportionOfOpenTasks(getPercent(t.tasksListIsActiveByTitle.length, t.tasks))) #{getPercent(t.tasksListIsActiveByTitle.length, t.tasks)} %
|
||||
span.text-right.tasks #{getPercent(t.tasksListIsActiveByTitle.length,json.stats.listOpen.length )} %
|
||||
button.text-right.toggle voir
|
||||
ul
|
||||
each activetask in t.tasksListIsActiveByTitle
|
||||
li.task_item= activetask
|
||||
span.name(class= {emphasis: tagItem.subtasks == json.stats.maxTasksCountPerTag})= tagItem['$'].name
|
||||
span.color= tagItem['$'].color
|
||||
span.parent= tagItem['$'].parent
|
||||
//- if t.tasksListIsDoneByTitle
|
||||
//- span.text-right(class=computeBgColorOnProportionOfOpenTasks(getPercent(t.tasks, json.stats.maxTasksCountPerTag)))= t.tasks
|
||||
//- if t.tasksListIsDoneByTitle
|
||||
//- span.text-right.tasks= t.tasksListIsDoneByTitle.length
|
||||
//- if t.tasksListIsActiveByTitle
|
||||
//- span.text-right.tasks #{t.tasksListIsActiveByTitle.length}
|
||||
//- span.text-right.tasks(class=computeBgColorOnProportionOfOpenTasks(getPercent(t.tasksListIsActiveByTitle.length, t.tasks))) #{getPercent(t.tasksListIsActiveByTitle.length, t.tasks)} %
|
||||
//- span.text-right.tasks #{getPercent(t.tasksListIsActiveByTitle.length,json.stats.listOpen.length )} %
|
||||
//- button.text-right.toggle voir
|
||||
//- ul
|
||||
//- each activetask in t.tasksListIsActiveByTitle
|
||||
//- li.task_item= activetask
|
||||
|
Loading…
Reference in New Issue
Block a user