From a8364da1da69bc910862ddda62ec66619f64c694 Mon Sep 17 00:00:00 2001 From: "ghendricks%novell.com" Date: Mon, 24 Mar 2008 21:27:03 +0000 Subject: [PATCH] Our actions no longer have numbers next to them in our testcases git-svn-id: svn://10.0.0.236/trunk@248496 18797224-902f-48f8-a5cc-f745e15eee43 --- .../en/default/testopia/case/show.html.tmpl | 4 +- .../webtools/testopia/testopia/js/caserun.js | 156 +++++++++++------- 2 files changed, 100 insertions(+), 60 deletions(-) diff --git a/mozilla/webtools/testopia/template/en/default/testopia/case/show.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/case/show.html.tmpl index b48b3a8bf64..dad83572d1f 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/case/show.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/case/show.html.tmpl @@ -253,7 +253,7 @@ Ext.onReady(function(){ } }], buttons: [{ - text: 'Submit', + text: 'Update Action/Results', handler: processText }] },{ @@ -291,7 +291,7 @@ Ext.onReady(function(){ } }], buttons: [{ - text: 'Submit', + text: 'Update Setup/Breakdown', handler: processText }] }, diff --git a/mozilla/webtools/testopia/testopia/js/caserun.js b/mozilla/webtools/testopia/testopia/js/caserun.js index d27f7b31a31..b10ef571429 100755 --- a/mozilla/webtools/testopia/testopia/js/caserun.js +++ b/mozilla/webtools/testopia/testopia/js/caserun.js @@ -907,6 +907,13 @@ CaseRun = function(){ ]) }); var store = this.store; + store.on('load', function(s,r){ + Ext.getCmp('action_editor').setValue(r[0].get('action')); + Ext.getCmp('effect_editor').setValue(r[0].get('results')); + Ext.getCmp('setup_editor').setValue(r[0].get('setup')); + Ext.getCmp('breakdown_editor').setValue(r[0].get('breakdown')); + }); + appendNote = function(){ var form = new Ext.form.BasicForm('testopia_helper_frm',{}); form.submit({ @@ -918,6 +925,24 @@ CaseRun = function(){ failure: testopiaError }); }; + processText = function(){ + var testopia_form = new Ext.form.BasicForm('testopia_helper_frm',{}); + var params = {}; + params.tcsetup = Ext.getCmp('setup_editor').getValue(); + params.tcbreakdown = Ext.getCmp('breakdown_editor').getValue(); + params.tcaction = Ext.getCmp('action_editor').getValue(); + params.tceffect = Ext.getCmp('effect_editor').getValue(); + params.case_id = Ext.getCmp('caserun_grid').getSelectionModel().getSelected().get('case_id'); + params.action = 'update_doc'; + testopia_form.submit({ + url: 'tr_process_case.cgi', + params: params, + success: function(){ + TestopiaUtil.notify.msg('Test case updated', 'Test Case {0} was updated successfully', 'Document'); + }, + failure: testopiaError + }); + } CaseRun.superclass.constructor.call(this,{ id: 'case_details_panel', layout: 'fit', @@ -935,66 +960,81 @@ CaseRun = function(){ title:'Details', width: 200, items: [{ - title:'Action & Expected Results', - id: 'caserun_action_panel', - border:false, - bodyBorder: false, - layout: 'fit', - autoScroll: true, - items:[{ - xtype: 'dataview', - bodyBorder: false, - store: store, - itemSelector: 'div.actiondiv', - loadingText: 'Loading...', - tpl: new Ext.XTemplate( - '', - '', - '', - '', - '
', - '
', - 'Action:
{action}', - '
', - '
', - '
', - 'Expected Results:
{results}', - '
', - '
', - '
', - '
' - ) + layout: 'column', + title: 'Action / Expected Results', + id: 'action_panel', + items: [{ + columnWidth:0.5, + layout:'fit', + items:{ + title: 'Action', + height: 230, + bodyBorder: false, + border: false, + layout: 'fit', + autoScroll: true, + items:[{ + id: 'action_editor', + xtype:'htmleditor' + }] + } + },{ + columnWidth:0.5, + layout:'fit', + items:{ + title: 'Expected Results', + height: 230, + bodyBorder: false, + border: false, + autoScroll: true, + layout: 'fit', + items:[{ + id: 'effect_editor', + xtype:'htmleditor' + }] + } + }], + buttons: [{ + text: 'Update Action/Results', + handler: processText.createDelegate(this) }] },{ - title:'Setup & Breakdown', - id: 'caserun_setup_panel', - border:false, - bodyBorder: false, - layout: 'fit', - autoScroll: true, - items:[{ - xtype: 'dataview', - bodyBorder: false, - store: store, - itemSelector: 'div.actiondiv', - loadingText: 'Loading...', - tpl: new Ext.XTemplate( - '', - '', - '', - '', - '
', - '
', - 'Setup:
{setup}', - '
', - '
', - '
', - 'Breakdown:
{breakdown}', - '
', - '
', - '
', - '
' - ) + layout: 'column', + title: 'Set Up / Break Down', + items: [{ + columnWidth:0.5, + layout:'fit', + items:{ + title: 'Setup', + height: 230, + bodyBorder: false, + autoScroll: true, + border: false, + layout: 'fit', + items:[{ + id: 'setup_editor', + xtype:'htmleditor' + }] + } + },{ + columnWidth:0.5, + layout:'fit', + items:{ + title: 'Breakdown', + height: 230, + bodyBorder: false, + autoScroll: true, + border: false, + layout: 'fit', + items:[{ + id: 'breakdown_editor', + xtype:'htmleditor' + }] + } + }], + buttons: [{ + text: 'Update Setup/Breakdown', + handler: processText.createDelegate(this) }] },{ title:'Notes',