Author: humbedooh Date: Sat Aug 3 07:46:18 2019 New Revision: 1864318 URL: http://svn.apache.org/viewvc?rev=1864318&view=rev Log: If kibble data exists, put it into the health help panel. Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js?rev=1864318&r1=1864317&r2=1864318&view=diff ============================================================================== --- comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js (original) +++ comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js Sat Aug 3 07:46:18 2019 @@ -222,6 +222,64 @@ function health_tips(data) { let jira = data.jira[project]; if (jira[0] || jira[1]) txt += "
  • %u JIRA tickets opened and %u closed in the past quarter.
  • ".format(jira[0], jira[1]); + // Commits and contributors + if (data.kibble) { + let color = 'black'; + let ctxt = data.kibble.commits.change.commits + let pct = parseInt(ctxt); + if (pct > 0) { + if (pct > 10) color = 'green'; + ctxt += ' increase'; + } else if (pct < 0) { + if (pct < -10) color = 'maroon'; + ctxt += ' decrease'; + } + txt += "
  • %u commits in the past quarter (%s)
  • ".format(color, data.kibble.commits.after.commits, ctxt); + } + + if (data.kibble) { + let color = 'black'; + let ctxt = data.kibble.commits.change.authors + let pct = parseInt(ctxt); + if (pct > 0) { + if (pct > 10) color = 'green'; + ctxt += ' increase'; + } else if (pct < 0) { + if (pct < -10) color = 'maroon'; + ctxt += ' decrease'; + } + txt += "
  • %u code contributors in the past quarter (%s)
  • ".format(color, data.kibble.commits.after.authors, ctxt); + } + + // GitHub: PRs + if (data.kibble) { + let color = 'black'; + let ctxt = data.kibble.prs.change.opened + let pct = parseInt(ctxt); + if (pct > 0) { + if (pct > 10) color = 'green'; + ctxt += ' increase'; + } else if (pct < 0) { + if (pct < -10) color = 'maroon'; + ctxt += ' decrease'; + } + txt += "
  • %u PRs opened on GitHub (%s)
  • ".format(color, data.kibble.prs.after.opened, ctxt); + } + + if (data.kibble) { + let color = 'black'; + let ctxt = data.kibble.prs.change.closed + let pct = parseInt(ctxt); + if (pct > 0) { + if (pct > 10) color = 'green'; + ctxt += ' increase'; + } else if (pct < 0) { + if (pct < -10) color = 'maroon'; + ctxt += ' decrease'; + } + txt += "
  • %u PRs closed on GitHub (%s)
  • ".format(color, data.kibble.prs.after.closed, ctxt); + } + // Append header IF there is data, otherwise nah. if (txt.length > 0) txt = "
    Potentially useful observations on community health:
    "; return txt; Modified: comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js?rev=1864318&r1=1864317&r2=1864318&view=diff ============================================================================== --- comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js (original) +++ comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js Sat Aug 3 07:46:18 2019 @@ -1391,6 +1391,64 @@ function health_tips(data) { let jira = data.jira[project]; if (jira[0] || jira[1]) txt += "
  • %u JIRA tickets opened and %u closed in the past quarter.
  • ".format(jira[0], jira[1]); + // Commits and contributors + if (data.kibble) { + let color = 'black'; + let ctxt = data.kibble.commits.change.commits + let pct = parseInt(ctxt); + if (pct > 0) { + if (pct > 10) color = 'green'; + ctxt += ' increase'; + } else if (pct < 0) { + if (pct < -10) color = 'maroon'; + ctxt += ' decrease'; + } + txt += "
  • %u commits in the past quarter (%s)
  • ".format(color, data.kibble.commits.after.commits, ctxt); + } + + if (data.kibble) { + let color = 'black'; + let ctxt = data.kibble.commits.change.authors + let pct = parseInt(ctxt); + if (pct > 0) { + if (pct > 10) color = 'green'; + ctxt += ' increase'; + } else if (pct < 0) { + if (pct < -10) color = 'maroon'; + ctxt += ' decrease'; + } + txt += "
  • %u code contributors in the past quarter (%s)
  • ".format(color, data.kibble.commits.after.authors, ctxt); + } + + // GitHub: PRs + if (data.kibble) { + let color = 'black'; + let ctxt = data.kibble.prs.change.opened + let pct = parseInt(ctxt); + if (pct > 0) { + if (pct > 10) color = 'green'; + ctxt += ' increase'; + } else if (pct < 0) { + if (pct < -10) color = 'maroon'; + ctxt += ' decrease'; + } + txt += "
  • %u PRs opened on GitHub (%s)
  • ".format(color, data.kibble.prs.after.opened, ctxt); + } + + if (data.kibble) { + let color = 'black'; + let ctxt = data.kibble.prs.change.closed + let pct = parseInt(ctxt); + if (pct > 0) { + if (pct > 10) color = 'green'; + ctxt += ' increase'; + } else if (pct < 0) { + if (pct < -10) color = 'maroon'; + ctxt += ' decrease'; + } + txt += "
  • %u PRs closed on GitHub (%s)
  • ".format(color, data.kibble.prs.after.closed, ctxt); + } + // Append header IF there is data, otherwise nah. if (txt.length > 0) txt = "
    Potentially useful observations on community health:
    "; return txt;