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/02 15:47:06 UTC

svn commit: r1864237 - in /comdev/reporter.apache.org/trunk/site/wizard: js/source/stepper.js js/source/unified.js js/wizard.js steps.json

Author: humbedooh
Date: Fri Aug  2 15:47:06 2019
New Revision: 1864237

URL: http://svn.apache.org/viewvc?rev=1864237&view=rev
Log:
implement a minimum characters rule for some sections

Modified:
    comdev/reporter.apache.org/trunk/site/wizard/js/source/stepper.js
    comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js
    comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js
    comdev/reporter.apache.org/trunk/site/wizard/steps.json

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/stepper.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/stepper.js?rev=1864237&r1=1864236&r2=1864237&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/stepper.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/stepper.js Fri Aug  2 15:47:06 2019
@@ -70,6 +70,21 @@ function ReportStepper(div, editor, layo
             } else if (step.help) {
                 this.helper.innerHTML += step.help + "<hr/>";
             }
+            // If minimum char size is required for a section, note it here
+            if (step.minchars)  {
+                this.editor.parse(true);
+                let chars_remain = step.minchars;
+                for (var n = 0; n < this.editor.sections.length; n++ ) {
+                    let sct = this.editor.sections[n];
+                    if (sct.title == (step.rawname||step.description) && sct.text.indexOf(PLACEHOLDER) == -1) {
+                        chars_remain = step.minchars - sct.text.length;
+                        break;
+                    }
+                }
+                if (chars_remain > 0) {
+                    this.helper.innerHTML += "<p style='color: red;'>This section needs at least %u more characters.</p>".format(chars_remain);
+                }
+            }
             // Add tips?
             if (step.tipgenerator) {
                 let f = Function('a', 'b', "return %s(a,b);".format(step.tipgenerator));

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js?rev=1864237&r1=1864236&r2=1864237&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js Fri Aug  2 15:47:06 2019
@@ -187,7 +187,10 @@ function UnifiedEditor_compile() {
                 console.log("Found placeholder text: " + PLACEHOLDER)
                 text += "<li><span style='display: inline-block; width: 20px; font-size: 18px; color: red;'>&#xF7;</span> <kbd>%s</kbd> contains placeholder text!</li>".format(this.sections[n].title);
                 this.compiles = false;
-              } else if (this.sections[n].text.length < 20) {
+              } else if (step.minchars && this.sections[n].text.length < step.minchars) {
+                text += "<li><span style='display: inline-block; width: 20px; font-size: 18px; color: red;'>&#xF7;</span> <kbd>%s</kbd> MUST contain more information!</li>".format(this.sections[n].title);
+              }
+              else if (this.sections[n].text.length < 20) {
                 text += "<li><span style='display: inline-block; width: 20px; font-size: 18px; color: pink;'>&#8253;</span> <kbd>%s</kbd> seems a tad short?</li>".format(this.sections[n].title);
               } else {
                 text += "<li><span style='display: inline-block; width: 20px; font-size: 18px; color: green;'>&#x2713;</span> <kbd>%s</kbd> seems alright</li>".format(this.sections[n].title);

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=1864237&r1=1864236&r2=1864237&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js Fri Aug  2 15:47:06 2019
@@ -1824,6 +1824,21 @@ function ReportStepper(div, editor, layo
             } else if (step.help) {
                 this.helper.innerHTML += step.help + "<hr/>";
             }
+            // If minimum char size is required for a section, note it here
+            if (step.minchars)  {
+                this.editor.parse(true);
+                let chars_remain = step.minchars;
+                for (var n = 0; n < this.editor.sections.length; n++ ) {
+                    let sct = this.editor.sections[n];
+                    if (sct.title == (step.rawname||step.description) && sct.text.indexOf(PLACEHOLDER) == -1) {
+                        chars_remain = step.minchars - sct.text.length;
+                        break;
+                    }
+                }
+                if (chars_remain > 0) {
+                    this.helper.innerHTML += "<p style='color: red;'>This section needs at least %u more characters.</p>".format(chars_remain);
+                }
+            }
             // Add tips?
             if (step.tipgenerator) {
                 let f = Function('a', 'b', "return %s(a,b);".format(step.tipgenerator));
@@ -2037,7 +2052,10 @@ function UnifiedEditor_compile() {
                 console.log("Found placeholder text: " + PLACEHOLDER)
                 text += "<li><span style='display: inline-block; width: 20px; font-size: 18px; color: red;'>&#xF7;</span> <kbd>%s</kbd> contains placeholder text!</li>".format(this.sections[n].title);
                 this.compiles = false;
-              } else if (this.sections[n].text.length < 20) {
+              } else if (step.minchars && this.sections[n].text.length < step.minchars) {
+                text += "<li><span style='display: inline-block; width: 20px; font-size: 18px; color: red;'>&#xF7;</span> <kbd>%s</kbd> MUST contain more information!</li>".format(this.sections[n].title);
+              }
+              else if (this.sections[n].text.length < 20) {
                 text += "<li><span style='display: inline-block; width: 20px; font-size: 18px; color: pink;'>&#8253;</span> <kbd>%s</kbd> seems a tad short?</li>".format(this.sections[n].title);
               } else {
                 text += "<li><span style='display: inline-block; width: 20px; font-size: 18px; color: green;'>&#x2713;</span> <kbd>%s</kbd> seems alright</li>".format(this.sections[n].title);

Modified: comdev/reporter.apache.org/trunk/site/wizard/steps.json
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/steps.json?rev=1864237&r1=1864236&r2=1864237&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/steps.json (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/steps.json Fri Aug  2 15:47:06 2019
@@ -30,7 +30,8 @@
         "description": "Project Activity",
         "help": "Please write a few lines (or more!) about the recent activity in the project and the community. This could be new software releases, new features, or community activity such as conferences and meetups.",
         "placeholder": "Example activity entries:\n\n- Apache Foo 1.2.3 Was released on 2019-04-05\n- Project members attended FooCon, it was a resounding success!\n- Added support for FooLib 2 and Async Gnoming.",
-        "tipgenerator": "activity_tips"
+        "tipgenerator": "activity_tips",
+        "minchars": 50
     },
     {
         "id": "health",
@@ -38,7 +39,8 @@
         "description": "Community Health",
         "help": "Tell us how your community is doing. Is there an influx of new contributors, is there a good flow of email on the mailing lists, or are things in decline? Are there any community metrics you'd like to showcase or make note of?",
         "placeholder": "Example health entries: \n\nWe had 25 contributors this quarter - including several new ones - in addition\nto the existing PMC and committers, and more activity on our issue tracker.\nNotably, there have been very promising contributions from some new developers\nto help with technical debt, particularly to remove uses of an internal\npackage that makes it impossible to use Apache Foo in an Splorg environment with\nnewer versions of Gson.\n\nHealth of the community remains strong with many active release lines,\nfeature development, active user and developer base including new\nparticipants and continued participants.",
-        "tipgenerator": "health_tips"
+        "tipgenerator": "health_tips",
+        "minchars": 80
     },
     {
         "id": "review",