You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by hu...@apache.org on 2019/08/05 05:01:40 UTC

svn commit: r1864405 - in /comdev/reporter.apache.org/trunk/site/wizard/js: source/generators.js wizard.js

Author: humbedooh
Date: Mon Aug  5 05:01:39 2019
New Revision: 1864405

URL: http://svn.apache.org/viewvc?rev=1864405&view=rev
Log:
display busiest email/github/jira topics:
- if data exists, display link to pop up data in modal

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=1864405&r1=1864404&r2=1864405&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 Mon Aug  5 05:01:39 2019
@@ -194,6 +194,8 @@ function splash(state, json, all) {
     
 }
 
+let busiest_html = {};
+
 function health_tips(data) {
     let txt = "";    
     // Mailing list changes
@@ -361,6 +363,68 @@ function health_tips(data) {
       txt += "<li style='color: %s;'>%u issue%s closed on GitHub, past quarter (%s)</li>".format(color, data.kibble.issues.after.closed, s, ctxt);
     }
     
+    // Busiest topics
+    if (data.kibble) {
+      let showit = false;
+      let busiest = new HTML('li', {}, "Busiest topics (click to pop up): ");
+      if (data.kibble.busiest.email.length > 0) {
+        showit = true;
+        let ul = new HTML('ul');
+        let arr = data.kibble.busiest.email;
+        for (var i = 0; i < arr.length; i++) {
+          let ml = arr[i].source.split('?')[1];
+          let li = new HTML('li', {}, [
+                                       new HTML("kbd", {}, ml),
+                                       new HTML('i', {style: {display: 'inline-block', textIndent: '10px'}}, arr[i].name),
+                                       new HTML('span', { style: {display: 'inline-block', textIndent: '10px'}}, "(%u emails)".format(arr[i].count))
+                                      ]);
+          ul.inject(li);
+        }
+        busiest_html['email'] = ul.outerHTML;
+        let a = new HTML('a', {href: '#', onclick: 'show_busiest("email");', style: {marginLeft: '10px'}}, 'email');
+        busiest.inject(a);
+      }
+      
+      
+      if (data.kibble.busiest.github.length > 0) {
+        showit = true;
+        let ul = new HTML('ul');
+        let arr = data.kibble.busiest.github;
+        for (var i = 0; i < arr.length; i++) {
+          let li = new HTML('li', {}, [
+                                       new HTML("a", {href: arr[i].url}, arr[i].url.replace('https://github.com/apache/', '')),
+                                       new HTML('i', {style: {display: 'inline-block', textIndent: '10px'}}, arr[i].subject),
+                                       new HTML('span', { style: {display: 'inline-block', textIndent: '10px'}}, "(%u comments)".format(arr[i].count))
+                                      ]);
+          ul.inject(li);
+        }
+        busiest_html['github'] = ul.outerHTML;
+        let a = new HTML('a', {href: '#', onclick: 'show_busiest("github");', style: {marginLeft: '10px'}}, 'GitHub');
+        busiest.inject(a);
+      }
+      
+      if (data.kibble.busiest.jira.length > 0) {
+        showit = true;
+        let ul = new HTML('ul');
+        let arr = data.kibble.busiest.jira;
+        for (var i = 0; i < arr.length; i++) {
+          let li = new HTML('li', {}, [
+                                       new HTML("a", {href: arr[i].url}, arr[i].key),
+                                       new HTML('i', {style: {display: 'inline-block', textIndent: '10px'}}, arr[i].subject),
+                                       new HTML('span', { style: {display: 'inline-block', textIndent: '10px'}}, "(%u comments)".format(arr[i].count))
+                                      ]);
+          ul.inject(li);
+        }
+        busiest_html['jira'] = ul.outerHTML;
+        let a = new HTML('a', {href: '#', onclick: 'show_busiest("jira");', style: {marginLeft: '10px'}}, 'JIRA');
+        busiest.inject(a);
+      }
+      
+      if (showit) {
+        txt += busiest.outerHTML;
+      }
+    }
+    
     // Append header IF there is data, otherwise nah.
     if (txt.length > 0) {
       txt = "<h5>Potentially useful observations on community health:</h5><ul>" + txt + "</ul>";
@@ -369,6 +433,12 @@ function health_tips(data) {
     return txt;
 }
 
+function show_busiest(t) {
+  if (busiest_html[t]) {
+    modal(busiest_html[t], "Busiest topics:");
+  }
+}
+
 function activity_tips(data) {
     let three_months_ago = moment().subtract(3, 'months');
     let 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=1864405&r1=1864404&r2=1864405&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js Mon Aug  5 05:01:39 2019
@@ -1373,6 +1373,8 @@ function splash(state, json, all) {
     
 }
 
+let busiest_html = {};
+
 function health_tips(data) {
     let txt = "";    
     // Mailing list changes
@@ -1540,6 +1542,68 @@ function health_tips(data) {
       txt += "<li style='color: %s;'>%u issue%s closed on GitHub, past quarter (%s)</li>".format(color, data.kibble.issues.after.closed, s, ctxt);
     }
     
+    // Busiest topics
+    if (data.kibble) {
+      let showit = false;
+      let busiest = new HTML('li', {}, "Busiest topics (click to pop up): ");
+      if (data.kibble.busiest.email.length > 0) {
+        showit = true;
+        let ul = new HTML('ul');
+        let arr = data.kibble.busiest.email;
+        for (var i = 0; i < arr.length; i++) {
+          let ml = arr[i].source.split('?')[1];
+          let li = new HTML('li', {}, [
+                                       new HTML("kbd", {}, ml),
+                                       new HTML('i', {style: {display: 'inline-block', textIndent: '10px'}}, arr[i].name),
+                                       new HTML('span', { style: {display: 'inline-block', textIndent: '10px'}}, "(%u emails)".format(arr[i].count))
+                                      ]);
+          ul.inject(li);
+        }
+        busiest_html['email'] = ul.outerHTML;
+        let a = new HTML('a', {href: '#', onclick: 'show_busiest("email");', style: {marginLeft: '10px'}}, 'email');
+        busiest.inject(a);
+      }
+      
+      
+      if (data.kibble.busiest.github.length > 0) {
+        showit = true;
+        let ul = new HTML('ul');
+        let arr = data.kibble.busiest.github;
+        for (var i = 0; i < arr.length; i++) {
+          let li = new HTML('li', {}, [
+                                       new HTML("a", {href: arr[i].url}, arr[i].url.replace('https://github.com/apache/', '')),
+                                       new HTML('i', {style: {display: 'inline-block', textIndent: '10px'}}, arr[i].subject),
+                                       new HTML('span', { style: {display: 'inline-block', textIndent: '10px'}}, "(%u comments)".format(arr[i].count))
+                                      ]);
+          ul.inject(li);
+        }
+        busiest_html['github'] = ul.outerHTML;
+        let a = new HTML('a', {href: '#', onclick: 'show_busiest("github");', style: {marginLeft: '10px'}}, 'GitHub');
+        busiest.inject(a);
+      }
+      
+      if (data.kibble.busiest.jira.length > 0) {
+        showit = true;
+        let ul = new HTML('ul');
+        let arr = data.kibble.busiest.jira;
+        for (var i = 0; i < arr.length; i++) {
+          let li = new HTML('li', {}, [
+                                       new HTML("a", {href: arr[i].url}, arr[i].key),
+                                       new HTML('i', {style: {display: 'inline-block', textIndent: '10px'}}, arr[i].subject),
+                                       new HTML('span', { style: {display: 'inline-block', textIndent: '10px'}}, "(%u comments)".format(arr[i].count))
+                                      ]);
+          ul.inject(li);
+        }
+        busiest_html['jira'] = ul.outerHTML;
+        let a = new HTML('a', {href: '#', onclick: 'show_busiest("jira");', style: {marginLeft: '10px'}}, 'JIRA');
+        busiest.inject(a);
+      }
+      
+      if (showit) {
+        txt += busiest.outerHTML;
+      }
+    }
+    
     // Append header IF there is data, otherwise nah.
     if (txt.length > 0) {
       txt = "<h5>Potentially useful observations on community health:</h5><ul>" + txt + "</ul>";
@@ -1548,6 +1612,12 @@ function health_tips(data) {
     return txt;
 }
 
+function show_busiest(t) {
+  if (busiest_html[t]) {
+    modal(busiest_html[t], "Busiest topics:");
+  }
+}
+
 function activity_tips(data) {
     let three_months_ago = moment().subtract(3, 'months');
     let txt = "";