From fce8b507ef79d820a95460e010e8f95d9e91f452 Mon Sep 17 00:00:00 2001 From: r12a Date: Thu, 4 Jul 2024 16:44:39 +0100 Subject: [PATCH] gap-analysis-github Add ability to track language for summary --- templates/gap-analysis/gap-analysis-github.js | 137 ++++++++++++------ .../gap-analysis/gap-analysis_template.html | 1 + 2 files changed, 97 insertions(+), 41 deletions(-) diff --git a/templates/gap-analysis/gap-analysis-github.js b/templates/gap-analysis/gap-analysis-github.js index 8a07556..2710985 100644 --- a/templates/gap-analysis/gap-analysis-github.js +++ b/templates/gap-analysis/gap-analysis-github.js @@ -1,7 +1,7 @@ var owner = 'w3c' var sections = {} -var debug = true +var debug = false var issues = [] var maxpages = 6 @@ -111,15 +111,33 @@ function buildSection (theData, sectionId, doc, repo) { out += '

#'+theData[i].number+' '+theData[i].title+'

\n' out += `` + priorityValue = 0 // used to catch information by language below + + // figure out priority for this issue + var priority = '' + if (issueLabelSet.has('p:basic')) { priority = 'basic'; priorityValue = 1 } + else if (issueLabelSet.has('p:advanced')) { priority = 'advanced'; priorityValue = 2 } + else if (issueLabelSet.has('p:broken')) { priority = 'broken'; priorityValue = 0 } + else if (issueLabelSet.has('p:ok')) { priority = 'ok'; priorityValue = 3 } + out += `GitHub issue #${ theData[i].number }

` + + + // make a list of languages and scores + var languageScores = [] + labellist = [... issueLabelSet] + + for (q=0;qLanguages: ${ languageScores.join(' ').replace(/l:/g,'') } ${ priorityValue }

` out += '

' @@ -309,6 +327,42 @@ function setUpSummary () { +function getDataLine (topic, lang) { + // condenses scores for individual languages to be used by printSummary + // topic is a pointer to a section in the document + + if (typeof topic === 'undefined') return '' + + var langDatas = topic.querySelectorAll('.relevantLanguages') + if (typeof langDatas === 'undefined' || langDatas.length === 0) { + if (topic.classList.contains('na') || topic.classList.contains('ok')) return '-' + else return '' + } + var langScores = topic.querySelectorAll('.issueScore') + + //console.log('topic',topic.textContent) + //console.log('langDatas',langDatas) + //console.log('langScores',langScores) + + latest = 10 + for (i=0;i