partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit cf925c42d706b646fac5607bd8c933c13925cb99
parent 34c581610d8cd2a2eca4f53b182661b4d8daa97d
Author: Felicitus <felicitus@felicitus.org>
Date:   Tue, 13 Mar 2012 03:06:35 +0100

Added support for warnings during setup

Diffstat:
Msrc/setup/js/SetupTests/AbstractTest.js | 9+++++++++
Msrc/setup/js/TestResultPanel.js | 10++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/setup/js/SetupTests/AbstractTest.js b/src/setup/js/SetupTests/AbstractTest.js @@ -27,6 +27,11 @@ Ext.define('PartKeeprSetup.AbstractTest', { name: null, /** + * Defines any warnings for the test. + */ + warnings: null, + + /** * Defines additional parameters which are to be sent with the request. The format is an object, * e.g. * { @@ -87,6 +92,10 @@ Ext.define('PartKeeprSetup.AbstractTest', { this.errorMessage = obj.message; } + if (obj.warnings) { + this.warnings = obj.warnings; + } + if (this.callback) { this.callback.appendTestResult(this); } diff --git a/src/setup/js/TestResultPanel.js b/src/setup/js/TestResultPanel.js @@ -43,6 +43,16 @@ Ext.define('PartKeeprSetup.TestResultPanel', { this.fireEvent("test-error"); } + if (test.warnings instanceof Array && test.warnings.length > 0) { + response += '<br/><div style="margin-left: 10px;">'; + + for (var i=0;i<test.warnings.length;i++) { + response += "<i>"+test.warnings[i]+"</i><br/>"; + } + + response += "</div><br/>"; + } + test.outputCmp.body.replaceWith({ border: false, html: test.message +"..."+response