Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2017-12-11 15:29:16 -0500
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2017-12-11 15:29:16 -0500
commit4ebe81bcb6d3445d4cd9e53d8accc1ad816c002a (patch)
tree90a401c64bd756bf162b57959fcac308eeada929
parent3970659a81506a14fa33752016d8d468405500d3 (diff)
parent5e5458dd3b712d890aaac5c62a60653d8d420f87 (diff)
downloadtame-2.5.0.tar.gz
tame-2.5.0.tar.bz2
tame-2.5.0.zip
Summary page changes to aid in testingv2.5.0
-rw-r--r--src/current/include/entry-form.xsl9
-rw-r--r--src/current/scripts/entry-form.js45
-rw-r--r--src/current/summary.css12
-rw-r--r--src/current/summary.xsl2
4 files changed, 62 insertions, 6 deletions
diff --git a/src/current/include/entry-form.xsl b/src/current/include/entry-form.xsl
index 5e56110..6c27e4d 100644
--- a/src/current/include/entry-form.xsl
+++ b/src/current/include/entry-form.xsl
@@ -139,6 +139,13 @@
<dt id="param-{@name}">
<xsl:value-of select="@desc" />
+
+ <span class="param-id">
+ <xsl:text> </xsl:text>
+ <a href="#{@name}">
+ <xsl:sequence select="concat( '[', @name, ']' )" />
+ </a>
+ </span>
</dt>
<xsl:variable name="matrix">
@@ -172,6 +179,8 @@
<xsl:if test="number(@dim) gt 0">
<button class="entry-add">+</button>
</xsl:if>
+
+ <div class="entry-testcase-dfn"></div>
</dd>
</xsl:template>
diff --git a/src/current/scripts/entry-form.js b/src/current/scripts/entry-form.js
index ed8ef1e..d633b05 100644
--- a/src/current/scripts/entry-form.js
+++ b/src/current/scripts/entry-form.js
@@ -1,7 +1,7 @@
/**
* Summary page program
*
- * Copyright (C) 2016 LoVullo Associates, Inc.
+ * Copyright (C) 2016, 2017 LoVullo Associates, Inc.
*
* This file is part of the Liza Data Collection Framework
*
@@ -98,8 +98,10 @@ var client = ( function()
// if the name does not match, then we removed the square
// brackets, meaning that this is a set
bucket[ name ] = ( name === field.name )
- ? field.value
- : [ field.value ];
+ ? +field.value
+ : [ +field.value ];
+
+ updateParamTestcaseDfn( name );
}
);
}
@@ -250,13 +252,16 @@ var client = ( function()
toarr.call( row.querySelectorAll( '[name]' ) ).forEach(
function( node )
{
- ref.push( node.value.trim() );
+ ref.push( +node.value.trim() );
}
);
} );
}
bucket[ name ] = value;
+
+ // update entry dfn
+ updateParamTestcaseDfn( target.name, value );
} );
// update screen on submit
@@ -313,6 +318,26 @@ var client = ( function()
} );
+ function updateParamTestcaseDfn( field_name, value )
+ {
+ const name = field_name.replace( /\[\]$/, '' );
+ const dfn_element = getParamTestcaseDfnElement( name );
+
+ value = value || bucket[ name ];
+
+ const dfn = name + ': ' + JSON.stringify( value );
+ dfn_element.innerText = dfn;
+ }
+
+
+ function getParamTestcaseDfnElement( name )
+ {
+ return document.querySelectorAll(
+ '#param-input-' + name + ' > .entry-testcase-dfn'
+ )[ 0 ];
+ }
+
+
function showFinalComments( looksgood, callback )
{
final_comments.className += ' show';
@@ -727,7 +752,7 @@ var client = ( function()
value = vars[ name ];
if ( value
- && /^prem|^min|^surcharge|^cov(erage)?|^credit|^factor|^rate|Prem|[tT]otal/
+ && /^prem|^min|^surcharge|^cov(erage)?|^credit|^percent|^factor|^rate|Prem|[tT]otal/
.test( name )
&& !( /^_/.test( name ) )
)
@@ -985,6 +1010,12 @@ var client = ( function()
var name = queue.pop();
+ // hide internal classes ("-" prefix)
+ if ( /^-/.test( name ) )
+ {
+ return c();
+ }
+
setWorkStatus(
'Formatting class summary values (' +
Math.floor( ( ( qlen - queue.length ) / qlen ) * 100 ) +
@@ -1320,6 +1351,8 @@ var client = ( function()
}
}
}
+
+ updateParamTestcaseDfn( field );
}
form.reset();
@@ -1380,6 +1413,8 @@ var client = ( function()
elements[ total++ ].value = fdata[ i ];
}
}
+
+ updateParamTestcaseDfn( field );
}
// re-allow input
diff --git a/src/current/summary.css b/src/current/summary.css
index 2374d2f..1e87ee8 100644
--- a/src/current/summary.css
+++ b/src/current/summary.css
@@ -475,6 +475,12 @@ form.entry-form dt
clear: left;
}
+form.entry-form dt > .param-id
+{
+ font-weight: normal;
+ font-family: monospace;
+}
+
form.entry-form .matrix
{
display: inline-block;
@@ -491,6 +497,12 @@ form.entry-form .entry-add
clear: left;
}
+form.entry-form .entry-testcase-dfn
+{
+ clear: left;
+ font-family: monospace;
+}
+
form.entry-form > .foot
{
}
diff --git a/src/current/summary.xsl b/src/current/summary.xsl
index 15c8b88..ee67ea1 100644
--- a/src/current/summary.xsl
+++ b/src/current/summary.xsl
@@ -2,7 +2,7 @@
<!--
Outputs rater summary, containing details for both the rater and its packages
- Copyright (C) 2016 LoVullo Associates, Inc.
+ Copyright (C) 2016, 2017 LoVullo Associates, Inc.
This file is part of TAME.