Summary page changes to aid in testing

master v2.5.0
Mike Gerwitz 2017-12-11 15:29:16 -05:00
commit 4ebe81bcb6
4 changed files with 62 additions and 6 deletions

View File

@ -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>

View File

@ -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

View File

@ -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
{
}

View File

@ -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.