Bug 82807 - Optionally hide HTML editor in Testopia
git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@1353 6955db30-a419-402b-8a0d-67ecbb4d7f56master
parent
a1511c5ad0
commit
c4f3cdfa1f
|
@ -1498,6 +1498,212 @@ Ext.extend(Testopia.TestCaseRun.Grid, Ext.grid.EditorGridPanel, {
|
|||
}
|
||||
});
|
||||
|
||||
var processText;
|
||||
Testopia.TestCaseSetupBreakdownPanel = function(params)
|
||||
{
|
||||
params = params || {};
|
||||
return {
|
||||
layout: 'column',
|
||||
columnWidth: 1.0,
|
||||
title: 'Set Up / Break Down',
|
||||
items: [{
|
||||
columnWidth:0.5,
|
||||
layout:'fit',
|
||||
items:{
|
||||
title: 'Setup',
|
||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
id: 'cr_setup_panel',
|
||||
autoScroll: true,
|
||||
layout: 'fit',
|
||||
items: Testopia.TestCaseTextEditor('setup', params)
|
||||
}
|
||||
},{
|
||||
columnWidth:0.5,
|
||||
layout:'fit',
|
||||
items:{
|
||||
title: 'Breakdown',
|
||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
id: 'cr_breakdown_panel',
|
||||
autoScroll: true,
|
||||
layout: 'fit',
|
||||
items: Testopia.TestCaseTextEditor('breakdown', params)
|
||||
}
|
||||
}],
|
||||
buttons: [{
|
||||
text: 'Save',
|
||||
handler: processText
|
||||
}]
|
||||
};
|
||||
};
|
||||
|
||||
Testopia.TestCaseTextEditor = function(id, data)
|
||||
{
|
||||
if (Param_Use_HTMLEditor)
|
||||
return [{
|
||||
id: id+'_editor',
|
||||
xtype: 'htmleditor',
|
||||
value: data[id]||''
|
||||
}];
|
||||
else
|
||||
return [{
|
||||
id: id+'_editor',
|
||||
html: data[id]||'',
|
||||
height: 'auto'
|
||||
},{
|
||||
id: id+'_textarea',
|
||||
xtype: 'textarea',
|
||||
style: 'font-family: monospace',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
hidden: true,
|
||||
value: data[id]||''
|
||||
}];
|
||||
};
|
||||
|
||||
Testopia.TestCaseShowHTMLEditor = function()
|
||||
{
|
||||
var s, h;
|
||||
var editorids = { 'action': 1, 'effect': 1 };
|
||||
if (Param_Show_Setup_Breakdown)
|
||||
editorids['setup'] = editorids['breakdown'] = 1;
|
||||
var b = Ext.getCmp('edit_html_button');
|
||||
var b1 = Ext.getCmp('save_html_button');
|
||||
if (Ext.getCmp('action_editor').hidden)
|
||||
{
|
||||
b.setText('Edit HTML source');
|
||||
b1.hide();
|
||||
s = 'hide', h = 'show';
|
||||
for (var i in editorids)
|
||||
Ext.getCmp(i+'_editor').body.update(Ext.getCmp(i+'_textarea').getValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
b1.show();
|
||||
b.setText('Close editor');
|
||||
s = 'show', h = 'hide';
|
||||
}
|
||||
for (var i in editorids)
|
||||
{
|
||||
Ext.getCmp(i+'_editor')[h]();
|
||||
Ext.getCmp(i+'_textarea')[s]();
|
||||
}
|
||||
};
|
||||
|
||||
Testopia.TestCaseUpdateTextForId = function(id)
|
||||
{
|
||||
var testopia_form = new Ext.form.BasicForm('testopia_helper_frm', {});
|
||||
var params = {};
|
||||
var a = Param_Use_HTMLEditor ? '_editor' : '_textarea';
|
||||
var editorids = { 'action': 1, 'effect': 1 };
|
||||
if (Param_Show_Setup_Breakdown)
|
||||
editorids['setup'] = editorids['breakdown'] = 1;
|
||||
for (var i in editorids)
|
||||
params['tc'+i] = Ext.getCmp(i+a).getValue();
|
||||
params.case_id = id;
|
||||
params.action = 'update_doc';
|
||||
testopia_form.submit({
|
||||
url: 'tr_process_case.cgi',
|
||||
params: params,
|
||||
success: function(){
|
||||
Testopia.Util.notify.msg('Test case updated', 'Test Case {0} was updated successfully', 'Document');
|
||||
},
|
||||
failure: Testopia.Util.error
|
||||
});
|
||||
};
|
||||
|
||||
Testopia.TestCaseShowEffectEditor = function()
|
||||
{
|
||||
var d = Ext.getCmp('effect_editor_col');
|
||||
if (!d.hidden)
|
||||
{
|
||||
Ext.getCmp('action_editor_col').columnWidth = 1.0;
|
||||
Ext.getCmp('showhide_results_btn').setText('Show Results');
|
||||
d.hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
Ext.getCmp('action_editor_col').columnWidth = 0.5;
|
||||
Ext.getCmp('showhide_results_btn').setText('Hide Results');
|
||||
d.show();
|
||||
}
|
||||
Ext.getCmp('action_panel').doLayout();
|
||||
};
|
||||
|
||||
Testopia.TestCaseActionPanel = function(data)
|
||||
{
|
||||
data = data || {};
|
||||
var actionResultsButtons = [{
|
||||
text: data.effect ? 'Hide Results' : 'Show Results',
|
||||
id: 'showhide_results_btn',
|
||||
handler: Testopia.TestCaseShowEffectEditor
|
||||
}];
|
||||
if (Param_Use_HTMLEditor)
|
||||
{
|
||||
actionResultsButtons.unshift({
|
||||
text: 'Update Action/Results',
|
||||
handler: Testopia.TestCaseUpdateText
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
actionResultsButtons.unshift({
|
||||
text: 'Save',
|
||||
id: 'save_html_button',
|
||||
hidden: true,
|
||||
handler: Testopia.TestCaseUpdateText
|
||||
}, {
|
||||
text: 'Edit HTML source',
|
||||
id: 'edit_html_button',
|
||||
handler: Testopia.TestCaseShowHTMLEditor
|
||||
});
|
||||
}
|
||||
var h = Ext.state.Manager.get('bigtext_height', 500);
|
||||
if (!h || h != h)
|
||||
h = 500;
|
||||
return {
|
||||
layout: 'column',
|
||||
columnWidth: 1.0,
|
||||
title: 'Description',
|
||||
id: 'action_panel',
|
||||
items: [{
|
||||
columnWidth: data.effect ? 0.5 : 1.0,
|
||||
layout: 'fit',
|
||||
id: 'action_editor_col',
|
||||
items:[{
|
||||
title: 'Action',
|
||||
height: h,
|
||||
id: 'cr_action_panel',
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
layout: 'fit',
|
||||
autoScroll: true,
|
||||
items: Testopia.TestCaseTextEditor('action', data)
|
||||
}]
|
||||
}, {
|
||||
columnWidth: 0.5,
|
||||
id: 'effect_editor_col',
|
||||
layout: 'fit',
|
||||
forceLayout: true,
|
||||
hidden: !data.effect,
|
||||
items: {
|
||||
title: 'Expected Results',
|
||||
height: h,
|
||||
id: 'cr_results_panel',
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
layout: 'fit',
|
||||
autoScroll: true,
|
||||
items: Testopia.TestCaseTextEditor('effect', data)
|
||||
}
|
||||
}],
|
||||
buttons: actionResultsButtons
|
||||
};
|
||||
};
|
||||
|
||||
Testopia.TestCaseRun.Info = function(){
|
||||
this.caserun_id;
|
||||
this.store = new Ext.data.Store({
|
||||
|
@ -1532,16 +1738,34 @@ Testopia.TestCaseRun.Info = function(){
|
|||
}])
|
||||
});
|
||||
var store = this.store;
|
||||
store.on('load', function(s, r){
|
||||
store.on('load', function(s, r)
|
||||
{
|
||||
if (Param_Use_HTMLEditor)
|
||||
{
|
||||
Ext.getCmp('action_editor').setValue(r[0].get('action'));
|
||||
Ext.getCmp('effect_editor').setValue(r[0].get('results'));
|
||||
if (!r[0].get('results').match(/^\s*(<[^>]*>\s*)*$/))
|
||||
Ext.getCmp('showhide_results_btn').handler();
|
||||
if (Param_Show_Setup_Breakdown)
|
||||
{
|
||||
Ext.getCmp('setup_editor').setValue(r[0].get('setup'));
|
||||
Ext.getCmp('breakdown_editor').setValue(r[0].get('breakdown'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Ext.getCmp('action_editor').body.update(r[0].get('action'));
|
||||
Ext.getCmp('action_textarea').setValue(r[0].get('action'));
|
||||
Ext.getCmp('effect_editor').body.update(r[0].get('results'));
|
||||
Ext.getCmp('effect_textarea').setValue(r[0].get('results'));
|
||||
if (Param_Show_Setup_Breakdown)
|
||||
{
|
||||
Ext.getCmp('setup_editor').body.update(r[0].get('setup'));
|
||||
Ext.getCmp('effect_textarea').setValue(r[0].get('setup'));
|
||||
Ext.getCmp('breakdown_editor').body.update(r[0].get('breakdown'));
|
||||
Ext.getCmp('breakdown_textarea').setValue(r[0].get('breakdown'));
|
||||
}
|
||||
}
|
||||
if (!r[0].get('results').match(/^\s*(<[^>]*>\s*)*$/))
|
||||
Ext.getCmp('showhide_results_btn').handler();
|
||||
Ext.getCmp('caserun_tb_summary').setText('Case ' + r[0].get('case_id') + ' - ' + r[0].get('summary'));
|
||||
});
|
||||
|
||||
|
@ -1561,27 +1785,6 @@ Testopia.TestCaseRun.Info = function(){
|
|||
failure: Testopia.Util.error
|
||||
});
|
||||
};
|
||||
processText = function(){
|
||||
var testopia_form = new Ext.form.BasicForm('testopia_helper_frm', {});
|
||||
var params = {};
|
||||
if (Param_Show_Setup_Breakdown)
|
||||
{
|
||||
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(){
|
||||
Testopia.Util.notify.msg('Test case updated', 'Test Case {0} was updated successfully', 'Document');
|
||||
},
|
||||
failure: Testopia.Util.error
|
||||
});
|
||||
}
|
||||
var summary_tb = new Ext.Toolbar({
|
||||
id: 'summary_tb',
|
||||
disabled: true,
|
||||
|
@ -1689,6 +1892,9 @@ Testopia.TestCaseRun.Info = function(){
|
|||
}
|
||||
}), new Ext.Toolbar.TextItem({text:'', id:'caserun_tb_summary'})]
|
||||
});
|
||||
Testopia.TestCaseUpdateText = function() {
|
||||
Testopia.TestCaseUpdateTextForId(Ext.getCmp('caserun_grid').getSelectionModel().getSelected().get('case_id'));
|
||||
};
|
||||
Testopia.TestCaseRun.Info.superclass.constructor.call(this, {
|
||||
id: 'case_details_panel',
|
||||
layout: 'fit',
|
||||
|
@ -1706,73 +1912,9 @@ Testopia.TestCaseRun.Info = function(){
|
|||
id: 'caserun_center_region',
|
||||
title: 'Details',
|
||||
tbar: summary_tb,
|
||||
items: [{
|
||||
layout: 'column',
|
||||
title: 'Description',
|
||||
id: 'action_panel',
|
||||
items: [{
|
||||
columnWidth:1.0,
|
||||
layout:'fit',
|
||||
id:'action_editor_col',
|
||||
items:[{
|
||||
title: 'Action',
|
||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||
id: 'cr_action_panel',
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
layout: 'fit',
|
||||
autoScroll: true,
|
||||
items: [{
|
||||
id: 'action_editor',
|
||||
xtype: 'htmleditor'
|
||||
}]
|
||||
}]
|
||||
},{
|
||||
columnWidth:0.5,
|
||||
id:'effect_editor_col',
|
||||
layout:'fit',
|
||||
style:{
|
||||
display: 'none',
|
||||
},
|
||||
items:{
|
||||
title: 'Expected Results',
|
||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||
id: 'cr_results_panel',
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
autoScroll: true,
|
||||
layout: 'fit',
|
||||
items: [{
|
||||
id: 'effect_editor',
|
||||
xtype: 'htmleditor'
|
||||
}]
|
||||
}
|
||||
}],
|
||||
buttons: [{
|
||||
text: 'Update Action/Results',
|
||||
handler: processText.createDelegate(this)
|
||||
},{
|
||||
text: 'Show Results Edit',
|
||||
id: 'showhide_results_btn',
|
||||
handler: function(){
|
||||
d = document.getElementById('effect_editor_col');
|
||||
if (d.style.display != 'none')
|
||||
items: [
|
||||
Testopia.TestCaseActionPanel(),
|
||||
{
|
||||
Ext.getCmp('action_editor_col').columnWidth=1.0;
|
||||
Ext.getCmp('action_panel').doLayout();
|
||||
Ext.getCmp('showhide_results_btn').setText('Show Results Edit');
|
||||
d.style.display = 'none';
|
||||
}
|
||||
else
|
||||
{
|
||||
Ext.getCmp('action_editor_col').columnWidth=0.5;
|
||||
Ext.getCmp('action_panel').doLayout();
|
||||
Ext.getCmp('showhide_results_btn').setText('Hide Results Edit');
|
||||
d.style.display = '';
|
||||
}
|
||||
}
|
||||
}]
|
||||
}, {
|
||||
title: 'Notes',
|
||||
id: 'caserun_notes_panel',
|
||||
border: false,
|
||||
|
@ -1799,55 +1941,17 @@ Testopia.TestCaseRun.Info = function(){
|
|||
text: 'Append Note',
|
||||
handler: appendNote.createDelegate(this)
|
||||
}]
|
||||
}, new Testopia.TestCaseRun.History(), new Testopia.Attachment.Grid({
|
||||
id: 0,
|
||||
type: 'caserun'
|
||||
}), new Testopia.TestCase.Bugs.Grid(), new Testopia.TestCase.Components(), new Testopia.Tags.ObjectTags('case', 0)]
|
||||
}]
|
||||
},
|
||||
new Testopia.TestCaseRun.History(),
|
||||
new Testopia.Attachment.Grid({id: 0, type: 'caserun'}),
|
||||
new Testopia.TestCase.Bugs.Grid(),
|
||||
new Testopia.TestCase.Components(),
|
||||
new Testopia.Tags.ObjectTags('case', 0)
|
||||
]}]
|
||||
});
|
||||
if (Param_Show_Setup_Breakdown)
|
||||
{
|
||||
Ext.getCmp('caserun_center_region').add(new Ext.Panel({
|
||||
layout: 'column',
|
||||
title: 'Set Up / Break Down',
|
||||
items: [{
|
||||
columnWidth:0.5,
|
||||
layout:'fit',
|
||||
items:{
|
||||
title: 'Setup',
|
||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||
id: 'cr_setup_panel',
|
||||
bodyBorder: false,
|
||||
autoScroll: true,
|
||||
border: false,
|
||||
layout: 'fit',
|
||||
items:[{
|
||||
id: 'setup_editor',
|
||||
xtype:'htmleditor'
|
||||
}]
|
||||
}
|
||||
},{
|
||||
columnWidth:0.5,
|
||||
layout:'fit',
|
||||
items:{
|
||||
title: 'Breakdown',
|
||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||
id: 'cr_breakdown_panel',
|
||||
bodyBorder: false,
|
||||
autoScroll: true,
|
||||
border: false,
|
||||
layout: 'fit',
|
||||
items:[{
|
||||
id: 'breakdown_editor',
|
||||
xtype:'htmleditor'
|
||||
}]
|
||||
}
|
||||
}],
|
||||
buttons: [{
|
||||
text: 'Update Setup/Breakdown',
|
||||
handler: processText.createDelegate(this)
|
||||
}]
|
||||
}));
|
||||
Ext.getCmp('caserun_center_region').add(Testopia.TestCaseSetupBreakdownPanel());
|
||||
Ext.getCmp('caserun_center_region').doLayout();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -117,7 +117,7 @@ sub get_param_list {
|
|||
{
|
||||
name => 'test_case_wiki_action_iframe',
|
||||
type => 't',
|
||||
default => '<iframe src="$URL?useskin=chick" width="100%" height="100%"></iframe>',
|
||||
default => '<iframe src="$URL?useskin=ichick" width="100%" height="100%"></iframe>',
|
||||
},
|
||||
|
||||
{
|
||||
|
@ -126,6 +126,12 @@ sub get_param_list {
|
|||
default => 0,
|
||||
},
|
||||
|
||||
{
|
||||
name => 'testopia-hide-htmleditor',
|
||||
type => 'b',
|
||||
default => 0,
|
||||
},
|
||||
|
||||
# {
|
||||
# name => 'new-testrun-email-notif',
|
||||
# type => 'l',
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#%]
|
||||
|
||||
[% PROCESS global/header.html.tmpl
|
||||
|
||||
title = "Search by Test Case Number"
|
||||
%]
|
||||
|
||||
|
|
|
@ -19,11 +19,6 @@
|
|||
# Greg Hendricks <ghendricks@novell.com>
|
||||
#%]
|
||||
|
||||
[%# INTERFACE:
|
||||
# ...
|
||||
#%]
|
||||
|
||||
|
||||
[% PROCESS testopia/style.none.tmpl %]
|
||||
[% PROCESS testopia/blocks.html.tmpl %]
|
||||
|
||||
|
@ -32,6 +27,7 @@
|
|||
|
||||
<script type="text/javascript">
|
||||
var Param_Show_Setup_Breakdown = [% Param('testopia-show-setup-breakdown') ? 1 : 0 %];
|
||||
var Param_Use_HTMLEditor = [% Param('testopia-hide-htmleditor') ? 0 : 1 %];
|
||||
var tcase = [% case.TO_JSON FILTER html_light %];
|
||||
|
||||
Ext.onReady(function(){
|
||||
|
@ -107,24 +103,7 @@ Ext.onReady(function(){
|
|||
|
||||
}
|
||||
|
||||
function processText(){
|
||||
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 = tcase.case_id;
|
||||
params.action = 'update_doc';
|
||||
testopia_form.submit({
|
||||
url: 'tr_process_case.cgi',
|
||||
method: 'POST',
|
||||
params: params,
|
||||
success: function(){
|
||||
Testopia.Util.notify.msg('Test case updated', 'Test Case {0} was updated successfully', 'Document');
|
||||
},
|
||||
failure: Testopia.Util.error
|
||||
});
|
||||
}
|
||||
Testopia.TestCaseUpdateText = function(){ Testopia.TestCaseUpdateTextForId(tcase.case_id); };
|
||||
|
||||
var fileMenu = new Ext.menu.Menu({
|
||||
id: 'file-menu',
|
||||
|
@ -163,11 +142,15 @@ Ext.onReady(function(){
|
|||
}]
|
||||
});
|
||||
|
||||
var caseControls = new Ext.Toolbar();
|
||||
var casetext = {
|
||||
action: '[% case.text.action|js %]',
|
||||
effect: '[% case.text.effect|js %]',
|
||||
setup: '[% case.text.setup|js %]',
|
||||
breakdown: '[% case.text.breakdown|js %]'
|
||||
};
|
||||
var actionpanel = Testopia.TestCaseActionPanel(casetext);
|
||||
actionpanel.tbar = new DocCompareToolbar('case', tcase.case_id);
|
||||
|
||||
var cases = new Ext.grid.GridPanel({
|
||||
|
||||
});
|
||||
var casepanel = new Ext.Panel({
|
||||
layout: 'border',
|
||||
monitorResize: true,
|
||||
|
@ -209,77 +192,7 @@ Ext.onReady(function(){
|
|||
region: 'center',
|
||||
activeTab: 0,
|
||||
items: [
|
||||
{
|
||||
layout: 'column',
|
||||
columnWidth: 1.0,
|
||||
title: 'Description',
|
||||
tbar: new DocCompareToolbar('case',tcase.case_id),
|
||||
id: 'action_panel',
|
||||
[% SET case.text.effect = "" UNLESS case.text.effect.defined %]
|
||||
[% SET showeffect = !case.text.effect.match('^\s*(<[^>]*>\s*)*$') %]
|
||||
items: [{
|
||||
columnWidth: [% showeffect ? "0.5" : "1.0" %],
|
||||
layout:'fit',
|
||||
id: 'action_editor_col',
|
||||
items:[{
|
||||
title: 'Action',
|
||||
height: 420,
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
layout: 'fit',
|
||||
items:[{
|
||||
id: 'action_editor',
|
||||
xtype:'htmleditor',
|
||||
value: '[% case.text.action FILTER js %]'
|
||||
}]
|
||||
}]
|
||||
},{
|
||||
columnWidth:0.5,
|
||||
id:'effect_editor_col',
|
||||
layout:'fit',
|
||||
[% UNLESS showeffect %]
|
||||
style:{
|
||||
display: 'none',
|
||||
},
|
||||
[% END %]
|
||||
items:{
|
||||
title: 'Expected Results',
|
||||
height: 420,
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
layout: 'fit',
|
||||
items:[{
|
||||
id: 'effect_editor',
|
||||
xtype:'htmleditor',
|
||||
value: '[% case.text.effect FILTER js %]'
|
||||
}]
|
||||
}
|
||||
}],
|
||||
buttons: [{
|
||||
text: 'Update Action/Results',
|
||||
handler: processText
|
||||
},{
|
||||
text: '[% showeffect ? "Hide Results Edit" : "Show Results Edit" %]',
|
||||
id: 'showhide_results_btn',
|
||||
handler: function(){
|
||||
d = document.getElementById('effect_editor_col');
|
||||
if (d.style.display != 'none')
|
||||
{
|
||||
Ext.getCmp('action_editor_col').columnWidth=1.0;
|
||||
Ext.getCmp('action_panel').doLayout();
|
||||
Ext.getCmp('showhide_results_btn').setText('Show Results Edit');
|
||||
d.style.display = 'none';
|
||||
}
|
||||
else
|
||||
{
|
||||
Ext.getCmp('action_editor_col').columnWidth=0.5;
|
||||
Ext.getCmp('action_panel').doLayout();
|
||||
Ext.getCmp('showhide_results_btn').setText('Hide Results Edit');
|
||||
d.style.display = '';
|
||||
}
|
||||
}
|
||||
}]
|
||||
},
|
||||
actionpanel,
|
||||
new Testopia.Util.HistoryList('case', [% case.id FILTER none %]),
|
||||
new Testopia.TestCaseRun.List({case_id: tcase.case_id, viewall: 1 },{id: 'case_history_grid'}),
|
||||
new Testopia.Attachment.Grid(tcase),
|
||||
|
@ -342,7 +255,6 @@ Ext.onReady(function(){
|
|||
border: false,
|
||||
root: new Ext.tree.TreeNode({text: 'Test Case [% case.id FILTER none %]'})
|
||||
}]
|
||||
|
||||
},{
|
||||
columnWidth: 0.5,
|
||||
layout: 'fit',
|
||||
|
@ -458,45 +370,7 @@ Ext.onReady(function(){
|
|||
});
|
||||
if (Param_Show_Setup_Breakdown)
|
||||
{
|
||||
Ext.getCmp('object_panel').insert(0, new Ext.Panel({
|
||||
layout: 'column',
|
||||
title: 'Set Up / Break Down',
|
||||
items: [{
|
||||
columnWidth:0.5,
|
||||
layout:'fit',
|
||||
items:{
|
||||
title: 'Setup',
|
||||
height: 420,
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
layout: 'fit',
|
||||
items:[{
|
||||
id: 'setup_editor',
|
||||
xtype:'htmleditor',
|
||||
value: '[% case.text.setup FILTER js %]'
|
||||
}]
|
||||
}
|
||||
},{
|
||||
columnWidth:0.5,
|
||||
layout:'fit',
|
||||
items:{
|
||||
title: 'Breakdown',
|
||||
height: 420,
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
layout: 'fit',
|
||||
items:[{
|
||||
id: 'breakdown_editor',
|
||||
xtype:'htmleditor',
|
||||
value: '[% case.text.breakdown FILTER js %]'
|
||||
}]
|
||||
}
|
||||
}],
|
||||
buttons: [{
|
||||
text: 'Update Setup/Breakdown',
|
||||
handler: processText
|
||||
}]
|
||||
}));
|
||||
Ext.getCmp('object_panel').insert(0, Testopia.TestCaseSetupBreakdownPanel(casetext));
|
||||
Ext.getCmp('object_panel').doLayout();
|
||||
}
|
||||
[% IF case.canedit %]
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
<div id="mask"></div>
|
||||
<script type="text/javascript">
|
||||
var Param_Show_Setup_Breakdown = [% Param('testopia-show-setup-breakdown') ? 1 : 0 %];
|
||||
var Param_Use_HTMLEditor = [% Param('testopia-hide-htmleditor') ? 0 : 1 %];
|
||||
var run = [% run.TO_JSON FILTER html_light %];
|
||||
var user_login = '[% user.login FILTER html_light %]';
|
||||
Ext.onReady(function(){
|
||||
|
|
|
@ -4158,6 +4158,212 @@ Ext.extend(Testopia.TestCaseRun.Grid, Ext.grid.EditorGridPanel, {
|
|||
}
|
||||
});
|
||||
|
||||
var processText;
|
||||
Testopia.TestCaseSetupBreakdownPanel = function(params)
|
||||
{
|
||||
params = params || {};
|
||||
return {
|
||||
layout: 'column',
|
||||
columnWidth: 1.0,
|
||||
title: 'Set Up / Break Down',
|
||||
items: [{
|
||||
columnWidth:0.5,
|
||||
layout:'fit',
|
||||
items:{
|
||||
title: 'Setup',
|
||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
id: 'cr_setup_panel',
|
||||
autoScroll: true,
|
||||
layout: 'fit',
|
||||
items: Testopia.TestCaseTextEditor('setup', params)
|
||||
}
|
||||
},{
|
||||
columnWidth:0.5,
|
||||
layout:'fit',
|
||||
items:{
|
||||
title: 'Breakdown',
|
||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
id: 'cr_breakdown_panel',
|
||||
autoScroll: true,
|
||||
layout: 'fit',
|
||||
items: Testopia.TestCaseTextEditor('breakdown', params)
|
||||
}
|
||||
}],
|
||||
buttons: [{
|
||||
text: 'Save',
|
||||
handler: processText
|
||||
}]
|
||||
};
|
||||
};
|
||||
|
||||
Testopia.TestCaseTextEditor = function(id, data)
|
||||
{
|
||||
if (Param_Use_HTMLEditor)
|
||||
return [{
|
||||
id: id+'_editor',
|
||||
xtype: 'htmleditor',
|
||||
value: data[id]||''
|
||||
}];
|
||||
else
|
||||
return [{
|
||||
id: id+'_editor',
|
||||
html: data[id]||'',
|
||||
height: 'auto'
|
||||
},{
|
||||
id: id+'_textarea',
|
||||
xtype: 'textarea',
|
||||
style: 'font-family: monospace',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
hidden: true,
|
||||
value: data[id]||''
|
||||
}];
|
||||
};
|
||||
|
||||
Testopia.TestCaseShowHTMLEditor = function()
|
||||
{
|
||||
var s, h;
|
||||
var editorids = { 'action': 1, 'effect': 1 };
|
||||
if (Param_Show_Setup_Breakdown)
|
||||
editorids['setup'] = editorids['breakdown'] = 1;
|
||||
var b = Ext.getCmp('edit_html_button');
|
||||
var b1 = Ext.getCmp('save_html_button');
|
||||
if (Ext.getCmp('action_editor').hidden)
|
||||
{
|
||||
b.setText('Edit HTML source');
|
||||
b1.hide();
|
||||
s = 'hide', h = 'show';
|
||||
for (var i in editorids)
|
||||
Ext.getCmp(i+'_editor').body.update(Ext.getCmp(i+'_textarea').getValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
b1.show();
|
||||
b.setText('Close editor');
|
||||
s = 'show', h = 'hide';
|
||||
}
|
||||
for (var i in editorids)
|
||||
{
|
||||
Ext.getCmp(i+'_editor')[h]();
|
||||
Ext.getCmp(i+'_textarea')[s]();
|
||||
}
|
||||
};
|
||||
|
||||
Testopia.TestCaseUpdateTextForId = function(id)
|
||||
{
|
||||
var testopia_form = new Ext.form.BasicForm('testopia_helper_frm', {});
|
||||
var params = {};
|
||||
var a = Param_Use_HTMLEditor ? '_editor' : '_textarea';
|
||||
var editorids = { 'action': 1, 'effect': 1 };
|
||||
if (Param_Show_Setup_Breakdown)
|
||||
editorids['setup'] = editorids['breakdown'] = 1;
|
||||
for (var i in editorids)
|
||||
params['tc'+i] = Ext.getCmp(i+a).getValue();
|
||||
params.case_id = id;
|
||||
params.action = 'update_doc';
|
||||
testopia_form.submit({
|
||||
url: 'tr_process_case.cgi',
|
||||
params: params,
|
||||
success: function(){
|
||||
Testopia.Util.notify.msg('Test case updated', 'Test Case {0} was updated successfully', 'Document');
|
||||
},
|
||||
failure: Testopia.Util.error
|
||||
});
|
||||
};
|
||||
|
||||
Testopia.TestCaseShowEffectEditor = function()
|
||||
{
|
||||
var d = Ext.getCmp('effect_editor_col');
|
||||
if (!d.hidden)
|
||||
{
|
||||
Ext.getCmp('action_editor_col').columnWidth = 1.0;
|
||||
Ext.getCmp('showhide_results_btn').setText('Show Results');
|
||||
d.hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
Ext.getCmp('action_editor_col').columnWidth = 0.5;
|
||||
Ext.getCmp('showhide_results_btn').setText('Hide Results');
|
||||
d.show();
|
||||
}
|
||||
Ext.getCmp('action_panel').doLayout();
|
||||
};
|
||||
|
||||
Testopia.TestCaseActionPanel = function(data)
|
||||
{
|
||||
data = data || {};
|
||||
var actionResultsButtons = [{
|
||||
text: data.effect ? 'Hide Results' : 'Show Results',
|
||||
id: 'showhide_results_btn',
|
||||
handler: Testopia.TestCaseShowEffectEditor
|
||||
}];
|
||||
if (Param_Use_HTMLEditor)
|
||||
{
|
||||
actionResultsButtons.unshift({
|
||||
text: 'Update Action/Results',
|
||||
handler: Testopia.TestCaseUpdateText
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
actionResultsButtons.unshift({
|
||||
text: 'Save',
|
||||
id: 'save_html_button',
|
||||
hidden: true,
|
||||
handler: Testopia.TestCaseUpdateText
|
||||
}, {
|
||||
text: 'Edit HTML source',
|
||||
id: 'edit_html_button',
|
||||
handler: Testopia.TestCaseShowHTMLEditor
|
||||
});
|
||||
}
|
||||
var h = Ext.state.Manager.get('bigtext_height', 500);
|
||||
if (!h || h != h)
|
||||
h = 500;
|
||||
return {
|
||||
layout: 'column',
|
||||
columnWidth: 1.0,
|
||||
title: 'Description',
|
||||
id: 'action_panel',
|
||||
items: [{
|
||||
columnWidth: data.effect ? 0.5 : 1.0,
|
||||
layout: 'fit',
|
||||
id: 'action_editor_col',
|
||||
items:[{
|
||||
title: 'Action',
|
||||
height: h,
|
||||
id: 'cr_action_panel',
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
layout: 'fit',
|
||||
autoScroll: true,
|
||||
items: Testopia.TestCaseTextEditor('action', data)
|
||||
}]
|
||||
}, {
|
||||
columnWidth: 0.5,
|
||||
id: 'effect_editor_col',
|
||||
layout: 'fit',
|
||||
forceLayout: true,
|
||||
hidden: !data.effect,
|
||||
items: {
|
||||
title: 'Expected Results',
|
||||
height: h,
|
||||
id: 'cr_results_panel',
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
layout: 'fit',
|
||||
autoScroll: true,
|
||||
items: Testopia.TestCaseTextEditor('effect', data)
|
||||
}
|
||||
}],
|
||||
buttons: actionResultsButtons
|
||||
};
|
||||
};
|
||||
|
||||
Testopia.TestCaseRun.Info = function(){
|
||||
this.caserun_id;
|
||||
this.store = new Ext.data.Store({
|
||||
|
@ -4192,16 +4398,34 @@ Testopia.TestCaseRun.Info = function(){
|
|||
}])
|
||||
});
|
||||
var store = this.store;
|
||||
store.on('load', function(s, r){
|
||||
store.on('load', function(s, r)
|
||||
{
|
||||
if (Param_Use_HTMLEditor)
|
||||
{
|
||||
Ext.getCmp('action_editor').setValue(r[0].get('action'));
|
||||
Ext.getCmp('effect_editor').setValue(r[0].get('results'));
|
||||
if (!r[0].get('results').match(/^\s*(<[^>]*>\s*)*$/))
|
||||
Ext.getCmp('showhide_results_btn').handler();
|
||||
if (Param_Show_Setup_Breakdown)
|
||||
{
|
||||
Ext.getCmp('setup_editor').setValue(r[0].get('setup'));
|
||||
Ext.getCmp('breakdown_editor').setValue(r[0].get('breakdown'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Ext.getCmp('action_editor').body.update(r[0].get('action'));
|
||||
Ext.getCmp('action_textarea').setValue(r[0].get('action'));
|
||||
Ext.getCmp('effect_editor').body.update(r[0].get('results'));
|
||||
Ext.getCmp('effect_textarea').setValue(r[0].get('results'));
|
||||
if (Param_Show_Setup_Breakdown)
|
||||
{
|
||||
Ext.getCmp('setup_editor').body.update(r[0].get('setup'));
|
||||
Ext.getCmp('effect_textarea').setValue(r[0].get('setup'));
|
||||
Ext.getCmp('breakdown_editor').body.update(r[0].get('breakdown'));
|
||||
Ext.getCmp('breakdown_textarea').setValue(r[0].get('breakdown'));
|
||||
}
|
||||
}
|
||||
if (!r[0].get('results').match(/^\s*(<[^>]*>\s*)*$/))
|
||||
Ext.getCmp('showhide_results_btn').handler();
|
||||
Ext.getCmp('caserun_tb_summary').setText('Case ' + r[0].get('case_id') + ' - ' + r[0].get('summary'));
|
||||
});
|
||||
|
||||
|
@ -4221,27 +4445,6 @@ Testopia.TestCaseRun.Info = function(){
|
|||
failure: Testopia.Util.error
|
||||
});
|
||||
};
|
||||
processText = function(){
|
||||
var testopia_form = new Ext.form.BasicForm('testopia_helper_frm', {});
|
||||
var params = {};
|
||||
if (Param_Show_Setup_Breakdown)
|
||||
{
|
||||
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(){
|
||||
Testopia.Util.notify.msg('Test case updated', 'Test Case {0} was updated successfully', 'Document');
|
||||
},
|
||||
failure: Testopia.Util.error
|
||||
});
|
||||
}
|
||||
var summary_tb = new Ext.Toolbar({
|
||||
id: 'summary_tb',
|
||||
disabled: true,
|
||||
|
@ -4349,6 +4552,9 @@ Testopia.TestCaseRun.Info = function(){
|
|||
}
|
||||
}), new Ext.Toolbar.TextItem({text:'', id:'caserun_tb_summary'})]
|
||||
});
|
||||
Testopia.TestCaseUpdateText = function() {
|
||||
Testopia.TestCaseUpdateTextForId(Ext.getCmp('caserun_grid').getSelectionModel().getSelected().get('case_id'));
|
||||
};
|
||||
Testopia.TestCaseRun.Info.superclass.constructor.call(this, {
|
||||
id: 'case_details_panel',
|
||||
layout: 'fit',
|
||||
|
@ -4366,73 +4572,9 @@ Testopia.TestCaseRun.Info = function(){
|
|||
id: 'caserun_center_region',
|
||||
title: 'Details',
|
||||
tbar: summary_tb,
|
||||
items: [{
|
||||
layout: 'column',
|
||||
title: 'Description',
|
||||
id: 'action_panel',
|
||||
items: [{
|
||||
columnWidth:1.0,
|
||||
layout:'fit',
|
||||
id:'action_editor_col',
|
||||
items:[{
|
||||
title: 'Action',
|
||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||
id: 'cr_action_panel',
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
layout: 'fit',
|
||||
autoScroll: true,
|
||||
items: [{
|
||||
id: 'action_editor',
|
||||
xtype: 'htmleditor'
|
||||
}]
|
||||
}]
|
||||
},{
|
||||
columnWidth:0.5,
|
||||
id:'effect_editor_col',
|
||||
layout:'fit',
|
||||
style:{
|
||||
display: 'none',
|
||||
},
|
||||
items:{
|
||||
title: 'Expected Results',
|
||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||
id: 'cr_results_panel',
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
autoScroll: true,
|
||||
layout: 'fit',
|
||||
items: [{
|
||||
id: 'effect_editor',
|
||||
xtype: 'htmleditor'
|
||||
}]
|
||||
}
|
||||
}],
|
||||
buttons: [{
|
||||
text: 'Update Action/Results',
|
||||
handler: processText.createDelegate(this)
|
||||
},{
|
||||
text: 'Show Results Edit',
|
||||
id: 'showhide_results_btn',
|
||||
handler: function(){
|
||||
d = document.getElementById('effect_editor_col');
|
||||
if (d.style.display != 'none')
|
||||
items: [
|
||||
Testopia.TestCaseActionPanel(),
|
||||
{
|
||||
Ext.getCmp('action_editor_col').columnWidth=1.0;
|
||||
Ext.getCmp('action_panel').doLayout();
|
||||
Ext.getCmp('showhide_results_btn').setText('Show Results Edit');
|
||||
d.style.display = 'none';
|
||||
}
|
||||
else
|
||||
{
|
||||
Ext.getCmp('action_editor_col').columnWidth=0.5;
|
||||
Ext.getCmp('action_panel').doLayout();
|
||||
Ext.getCmp('showhide_results_btn').setText('Hide Results Edit');
|
||||
d.style.display = '';
|
||||
}
|
||||
}
|
||||
}]
|
||||
}, {
|
||||
title: 'Notes',
|
||||
id: 'caserun_notes_panel',
|
||||
border: false,
|
||||
|
@ -4459,55 +4601,17 @@ Testopia.TestCaseRun.Info = function(){
|
|||
text: 'Append Note',
|
||||
handler: appendNote.createDelegate(this)
|
||||
}]
|
||||
}, new Testopia.TestCaseRun.History(), new Testopia.Attachment.Grid({
|
||||
id: 0,
|
||||
type: 'caserun'
|
||||
}), new Testopia.TestCase.Bugs.Grid(), new Testopia.TestCase.Components(), new Testopia.Tags.ObjectTags('case', 0)]
|
||||
}]
|
||||
},
|
||||
new Testopia.TestCaseRun.History(),
|
||||
new Testopia.Attachment.Grid({id: 0, type: 'caserun'}),
|
||||
new Testopia.TestCase.Bugs.Grid(),
|
||||
new Testopia.TestCase.Components(),
|
||||
new Testopia.Tags.ObjectTags('case', 0)
|
||||
]}]
|
||||
});
|
||||
if (Param_Show_Setup_Breakdown)
|
||||
{
|
||||
Ext.getCmp('caserun_center_region').add(new Ext.Panel({
|
||||
layout: 'column',
|
||||
title: 'Set Up / Break Down',
|
||||
items: [{
|
||||
columnWidth:0.5,
|
||||
layout:'fit',
|
||||
items:{
|
||||
title: 'Setup',
|
||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||
id: 'cr_setup_panel',
|
||||
bodyBorder: false,
|
||||
autoScroll: true,
|
||||
border: false,
|
||||
layout: 'fit',
|
||||
items:[{
|
||||
id: 'setup_editor',
|
||||
xtype:'htmleditor'
|
||||
}]
|
||||
}
|
||||
},{
|
||||
columnWidth:0.5,
|
||||
layout:'fit',
|
||||
items:{
|
||||
title: 'Breakdown',
|
||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||
id: 'cr_breakdown_panel',
|
||||
bodyBorder: false,
|
||||
autoScroll: true,
|
||||
border: false,
|
||||
layout: 'fit',
|
||||
items:[{
|
||||
id: 'breakdown_editor',
|
||||
xtype:'htmleditor'
|
||||
}]
|
||||
}
|
||||
}],
|
||||
buttons: [{
|
||||
text: 'Update Setup/Breakdown',
|
||||
handler: processText.createDelegate(this)
|
||||
}]
|
||||
}));
|
||||
Ext.getCmp('caserun_center_region').add(Testopia.TestCaseSetupBreakdownPanel());
|
||||
Ext.getCmp('caserun_center_region').doLayout();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -3932,6 +3932,206 @@ this.store.load();
|
|||
}
|
||||
}
|
||||
});
|
||||
var processText;
|
||||
Testopia.TestCaseSetupBreakdownPanel = function(params)
|
||||
{
|
||||
params = params || {};
|
||||
return {
|
||||
layout: 'column',
|
||||
columnWidth: 1.0,
|
||||
title: 'Set Up / Break Down',
|
||||
items: [{
|
||||
columnWidth:0.5,
|
||||
layout:'fit',
|
||||
items:{
|
||||
title: 'Setup',
|
||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
id: 'cr_setup_panel',
|
||||
autoScroll: true,
|
||||
layout: 'fit',
|
||||
items: Testopia.TestCaseTextEditor('setup', params)
|
||||
}
|
||||
},{
|
||||
columnWidth:0.5,
|
||||
layout:'fit',
|
||||
items:{
|
||||
title: 'Breakdown',
|
||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
id: 'cr_breakdown_panel',
|
||||
autoScroll: true,
|
||||
layout: 'fit',
|
||||
items: Testopia.TestCaseTextEditor('breakdown', params)
|
||||
}
|
||||
}],
|
||||
buttons: [{
|
||||
text: 'Save',
|
||||
handler: processText
|
||||
}]
|
||||
};
|
||||
};
|
||||
Testopia.TestCaseTextEditor = function(id, data)
|
||||
{
|
||||
if (Param_Use_HTMLEditor)
|
||||
return [{
|
||||
id: id+'_editor',
|
||||
xtype: 'htmleditor',
|
||||
value: data[id]||''
|
||||
}];
|
||||
else
|
||||
return [{
|
||||
id: id+'_editor',
|
||||
html: data[id]||'',
|
||||
height: 'auto'
|
||||
},{
|
||||
id: id+'_textarea',
|
||||
xtype: 'textarea',
|
||||
style: 'font-family: monospace',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
hidden: true,
|
||||
value: data[id]||''
|
||||
}];
|
||||
};
|
||||
Testopia.TestCaseShowHTMLEditor = function()
|
||||
{
|
||||
var s, h;
|
||||
var editorids = { 'action': 1, 'effect': 1 };
|
||||
if (Param_Show_Setup_Breakdown)
|
||||
editorids['setup'] = editorids['breakdown'] = 1;
|
||||
var b = Ext.getCmp('edit_html_button');
|
||||
var b1 = Ext.getCmp('save_html_button');
|
||||
if (Ext.getCmp('action_editor').hidden)
|
||||
{
|
||||
b.setText('Edit HTML source');
|
||||
b1.hide();
|
||||
s = 'hide', h = 'show';
|
||||
for (var i in editorids)
|
||||
Ext.getCmp(i+'_editor').body.update(Ext.getCmp(i+'_textarea').getValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
b1.show();
|
||||
b.setText('Close editor');
|
||||
s = 'show', h = 'hide';
|
||||
}
|
||||
for (var i in editorids)
|
||||
{
|
||||
Ext.getCmp(i+'_editor')[h]();
|
||||
Ext.getCmp(i+'_textarea')[s]();
|
||||
}
|
||||
};
|
||||
Testopia.TestCaseUpdateTextForId = function(id)
|
||||
{
|
||||
var testopia_form = new Ext.form.BasicForm('testopia_helper_frm', {});
|
||||
var params = {};
|
||||
var a = Param_Use_HTMLEditor ? '_editor' : '_textarea';
|
||||
var editorids = { 'action': 1, 'effect': 1 };
|
||||
if (Param_Show_Setup_Breakdown)
|
||||
editorids['setup'] = editorids['breakdown'] = 1;
|
||||
for (var i in editorids)
|
||||
params['tc'+i] = Ext.getCmp(i+a).getValue();
|
||||
params.case_id = id;
|
||||
params.action = 'update_doc';
|
||||
testopia_form.submit({
|
||||
url: 'tr_process_case.cgi',
|
||||
params: params,
|
||||
success: function(){
|
||||
Testopia.Util.notify.msg('Test case updated', 'Test Case {0} was updated successfully', 'Document');
|
||||
},
|
||||
failure: Testopia.Util.error
|
||||
});
|
||||
};
|
||||
Testopia.TestCaseShowEffectEditor = function()
|
||||
{
|
||||
var d = Ext.getCmp('effect_editor_col');
|
||||
if (!d.hidden)
|
||||
{
|
||||
Ext.getCmp('action_editor_col').columnWidth = 1.0;
|
||||
Ext.getCmp('showhide_results_btn').setText('Show Results');
|
||||
d.hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
Ext.getCmp('action_editor_col').columnWidth = 0.5;
|
||||
Ext.getCmp('showhide_results_btn').setText('Hide Results');
|
||||
d.show();
|
||||
}
|
||||
Ext.getCmp('action_panel').doLayout();
|
||||
};
|
||||
Testopia.TestCaseActionPanel = function(data)
|
||||
{
|
||||
data = data || {};
|
||||
var actionResultsButtons = [{
|
||||
text: data.effect ? 'Hide Results' : 'Show Results',
|
||||
id: 'showhide_results_btn',
|
||||
handler: Testopia.TestCaseShowEffectEditor
|
||||
}];
|
||||
if (Param_Use_HTMLEditor)
|
||||
{
|
||||
actionResultsButtons.unshift({
|
||||
text: 'Update Action/Results',
|
||||
handler: Testopia.TestCaseUpdateText
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
actionResultsButtons.unshift({
|
||||
text: 'Save',
|
||||
id: 'save_html_button',
|
||||
hidden: true,
|
||||
handler: Testopia.TestCaseUpdateText
|
||||
}, {
|
||||
text: 'Edit HTML source',
|
||||
id: 'edit_html_button',
|
||||
handler: Testopia.TestCaseShowHTMLEditor
|
||||
});
|
||||
}
|
||||
var h = Ext.state.Manager.get('bigtext_height', 500);
|
||||
if (!h || h != h)
|
||||
h = 500;
|
||||
return {
|
||||
layout: 'column',
|
||||
columnWidth: 1.0,
|
||||
title: 'Description',
|
||||
id: 'action_panel',
|
||||
items: [{
|
||||
columnWidth: data.effect ? 0.5 : 1.0,
|
||||
layout: 'fit',
|
||||
id: 'action_editor_col',
|
||||
items:[{
|
||||
title: 'Action',
|
||||
height: h,
|
||||
id: 'cr_action_panel',
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
layout: 'fit',
|
||||
autoScroll: true,
|
||||
items: Testopia.TestCaseTextEditor('action', data)
|
||||
}]
|
||||
}, {
|
||||
columnWidth: 0.5,
|
||||
id: 'effect_editor_col',
|
||||
layout: 'fit',
|
||||
forceLayout: true,
|
||||
hidden: !data.effect,
|
||||
items: {
|
||||
title: 'Expected Results',
|
||||
height: h,
|
||||
id: 'cr_results_panel',
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
layout: 'fit',
|
||||
autoScroll: true,
|
||||
items: Testopia.TestCaseTextEditor('effect', data)
|
||||
}
|
||||
}],
|
||||
buttons: actionResultsButtons
|
||||
};
|
||||
};
|
||||
Testopia.TestCaseRun.Info = function(){
|
||||
this.caserun_id;
|
||||
this.store = new Ext.data.Store({
|
||||
|
@ -3966,16 +4166,34 @@ mapping: 'notes'
|
|||
}])
|
||||
});
|
||||
var store = this.store;
|
||||
store.on('load', function(s, r){
|
||||
store.on('load', function(s, r)
|
||||
{
|
||||
if (Param_Use_HTMLEditor)
|
||||
{
|
||||
Ext.getCmp('action_editor').setValue(r[0].get('action'));
|
||||
Ext.getCmp('effect_editor').setValue(r[0].get('results'));
|
||||
if (!r[0].get('results').match(/^\s*(<[^>]*>\s*)*$/))
|
||||
Ext.getCmp('showhide_results_btn').handler();
|
||||
if (Param_Show_Setup_Breakdown)
|
||||
{
|
||||
Ext.getCmp('setup_editor').setValue(r[0].get('setup'));
|
||||
Ext.getCmp('breakdown_editor').setValue(r[0].get('breakdown'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Ext.getCmp('action_editor').body.update(r[0].get('action'));
|
||||
Ext.getCmp('action_textarea').setValue(r[0].get('action'));
|
||||
Ext.getCmp('effect_editor').body.update(r[0].get('results'));
|
||||
Ext.getCmp('effect_textarea').setValue(r[0].get('results'));
|
||||
if (Param_Show_Setup_Breakdown)
|
||||
{
|
||||
Ext.getCmp('setup_editor').body.update(r[0].get('setup'));
|
||||
Ext.getCmp('effect_textarea').setValue(r[0].get('setup'));
|
||||
Ext.getCmp('breakdown_editor').body.update(r[0].get('breakdown'));
|
||||
Ext.getCmp('breakdown_textarea').setValue(r[0].get('breakdown'));
|
||||
}
|
||||
}
|
||||
if (!r[0].get('results').match(/^\s*(<[^>]*>\s*)*$/))
|
||||
Ext.getCmp('showhide_results_btn').handler();
|
||||
Ext.getCmp('caserun_tb_summary').setText('Case ' + r[0].get('case_id') + ' - ' + r[0].get('summary'));
|
||||
});
|
||||
appendNote = function(){
|
||||
|
@ -3994,27 +4212,6 @@ store.reload();
|
|||
failure: Testopia.Util.error
|
||||
});
|
||||
};
|
||||
processText = function(){
|
||||
var testopia_form = new Ext.form.BasicForm('testopia_helper_frm', {});
|
||||
var params = {};
|
||||
if (Param_Show_Setup_Breakdown)
|
||||
{
|
||||
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(){
|
||||
Testopia.Util.notify.msg('Test case updated', 'Test Case {0} was updated successfully', 'Document');
|
||||
},
|
||||
failure: Testopia.Util.error
|
||||
});
|
||||
}
|
||||
var summary_tb = new Ext.Toolbar({
|
||||
id: 'summary_tb',
|
||||
disabled: true,
|
||||
|
@ -4122,6 +4319,9 @@ ids: Testopia.Util.getSelectedObjects(Ext.getCmp('caserun_grid'), 'caserun_id')
|
|||
}
|
||||
}), new Ext.Toolbar.TextItem({text:'', id:'caserun_tb_summary'})]
|
||||
});
|
||||
Testopia.TestCaseUpdateText = function() {
|
||||
Testopia.TestCaseUpdateTextForId(Ext.getCmp('caserun_grid').getSelectionModel().getSelected().get('case_id'));
|
||||
};
|
||||
Testopia.TestCaseRun.Info.superclass.constructor.call(this, {
|
||||
id: 'case_details_panel',
|
||||
layout: 'fit',
|
||||
|
@ -4139,73 +4339,9 @@ activeTab: 0,
|
|||
id: 'caserun_center_region',
|
||||
title: 'Details',
|
||||
tbar: summary_tb,
|
||||
items: [{
|
||||
layout: 'column',
|
||||
title: 'Description',
|
||||
id: 'action_panel',
|
||||
items: [{
|
||||
columnWidth:1.0,
|
||||
layout:'fit',
|
||||
id:'action_editor_col',
|
||||
items:[{
|
||||
title: 'Action',
|
||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||
id: 'cr_action_panel',
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
layout: 'fit',
|
||||
autoScroll: true,
|
||||
items: [{
|
||||
id: 'action_editor',
|
||||
xtype: 'htmleditor'
|
||||
}]
|
||||
}]
|
||||
},{
|
||||
columnWidth:0.5,
|
||||
id:'effect_editor_col',
|
||||
layout:'fit',
|
||||
style:{
|
||||
display: 'none',
|
||||
},
|
||||
items:{
|
||||
title: 'Expected Results',
|
||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||
id: 'cr_results_panel',
|
||||
bodyBorder: false,
|
||||
border: false,
|
||||
autoScroll: true,
|
||||
layout: 'fit',
|
||||
items: [{
|
||||
id: 'effect_editor',
|
||||
xtype: 'htmleditor'
|
||||
}]
|
||||
}
|
||||
}],
|
||||
buttons: [{
|
||||
text: 'Update Action/Results',
|
||||
handler: processText.createDelegate(this)
|
||||
},{
|
||||
text: 'Show Results Edit',
|
||||
id: 'showhide_results_btn',
|
||||
handler: function(){
|
||||
d = document.getElementById('effect_editor_col');
|
||||
if (d.style.display != 'none')
|
||||
items: [
|
||||
Testopia.TestCaseActionPanel(),
|
||||
{
|
||||
Ext.getCmp('action_editor_col').columnWidth=1.0;
|
||||
Ext.getCmp('action_panel').doLayout();
|
||||
Ext.getCmp('showhide_results_btn').setText('Show Results Edit');
|
||||
d.style.display = 'none';
|
||||
}
|
||||
else
|
||||
{
|
||||
Ext.getCmp('action_editor_col').columnWidth=0.5;
|
||||
Ext.getCmp('action_panel').doLayout();
|
||||
Ext.getCmp('showhide_results_btn').setText('Hide Results Edit');
|
||||
d.style.display = '';
|
||||
}
|
||||
}
|
||||
}]
|
||||
}, {
|
||||
title: 'Notes',
|
||||
id: 'caserun_notes_panel',
|
||||
border: false,
|
||||
|
@ -4232,55 +4368,17 @@ xtype: 'button',
|
|||
text: 'Append Note',
|
||||
handler: appendNote.createDelegate(this)
|
||||
}]
|
||||
}, new Testopia.TestCaseRun.History(), new Testopia.Attachment.Grid({
|
||||
id: 0,
|
||||
type: 'caserun'
|
||||
}), new Testopia.TestCase.Bugs.Grid(), new Testopia.TestCase.Components(), new Testopia.Tags.ObjectTags('case', 0)]
|
||||
}]
|
||||
},
|
||||
new Testopia.TestCaseRun.History(),
|
||||
new Testopia.Attachment.Grid({id: 0, type: 'caserun'}),
|
||||
new Testopia.TestCase.Bugs.Grid(),
|
||||
new Testopia.TestCase.Components(),
|
||||
new Testopia.Tags.ObjectTags('case', 0)
|
||||
]}]
|
||||
});
|
||||
if (Param_Show_Setup_Breakdown)
|
||||
{
|
||||
Ext.getCmp('caserun_center_region').add(new Ext.Panel({
|
||||
layout: 'column',
|
||||
title: 'Set Up / Break Down',
|
||||
items: [{
|
||||
columnWidth:0.5,
|
||||
layout:'fit',
|
||||
items:{
|
||||
title: 'Setup',
|
||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||
id: 'cr_setup_panel',
|
||||
bodyBorder: false,
|
||||
autoScroll: true,
|
||||
border: false,
|
||||
layout: 'fit',
|
||||
items:[{
|
||||
id: 'setup_editor',
|
||||
xtype:'htmleditor'
|
||||
}]
|
||||
}
|
||||
},{
|
||||
columnWidth:0.5,
|
||||
layout:'fit',
|
||||
items:{
|
||||
title: 'Breakdown',
|
||||
height: Ext.state.Manager.get('bigtext_height', 500),
|
||||
id: 'cr_breakdown_panel',
|
||||
bodyBorder: false,
|
||||
autoScroll: true,
|
||||
border: false,
|
||||
layout: 'fit',
|
||||
items:[{
|
||||
id: 'breakdown_editor',
|
||||
xtype:'htmleditor'
|
||||
}]
|
||||
}
|
||||
}],
|
||||
buttons: [{
|
||||
text: 'Update Setup/Breakdown',
|
||||
handler: processText.createDelegate(this)
|
||||
}]
|
||||
}));
|
||||
Ext.getCmp('caserun_center_region').add(Testopia.TestCaseSetupBreakdownPanel());
|
||||
Ext.getCmp('caserun_center_region').doLayout();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -29,35 +29,40 @@
|
|||
|
||||
"allow-test-deletion" => "If this option is on, users can delete objects including plans and cases",
|
||||
|
||||
"testopia-allow-group-member-deletes" => "If this option is on, members of the Testers group will be
|
||||
allowed to delete test objects",
|
||||
"testopia-allow-group-member-deletes" =>
|
||||
"If this option is on, members of the Testers group will be allowed to delete test objects",
|
||||
|
||||
"testopia-default-plan-testers-regexp" => "This is the default regular expression for granting
|
||||
access to new test plans",
|
||||
"testopia-default-plan-testers-regexp" =>
|
||||
"This is the default regular expression for granting access to new test plans",
|
||||
|
||||
"print-tag-in-case-log" => 'If this option is on, the entire tag text is printed in a test case ' _
|
||||
"print-tag-in-case-log" =>
|
||||
'If this option is on, the entire tag text is printed in a test case ' _
|
||||
'log entry. Otherwise, only an href to the tag is put there.',
|
||||
|
||||
"new-case-action-template" => "This is the text to be put in a newly created test case \"action\" field",
|
||||
|
||||
"new-case-results-template" => "This is the text to be put in a newly created test case \"expected results\" field",
|
||||
|
||||
"bug-to-test-case-summary" => 'This is the default summary text used when generating a test case ' _
|
||||
"bug-to-test-case-summary" =>
|
||||
'This is the default summary text used when generating a test case ' _
|
||||
'out of a bug. The special symbol %id% is replaced with the bug id and ' _
|
||||
"%summary% is replaced with the bug's summary",
|
||||
|
||||
"bug-to-test-case-action" => 'This is the default action text used when generating a test case ' _
|
||||
"bug-to-test-case-action" =>
|
||||
'This is the default action text used when generating a test case ' _
|
||||
'out of a bug. The special symbol %id% is replaced with a ' _
|
||||
"hyperlink to the bug's page. The special symbol \%description\% is " _
|
||||
"replaced with the bug's description",
|
||||
|
||||
"bug-to-test-case-results" => 'This is the default results text used when generating a test case ' _
|
||||
"bug-to-test-case-results" =>
|
||||
'This is the default results text used when generating a test case ' _
|
||||
'out of a bug. The special symbol %id% is replaced with a ' _
|
||||
"hyperlink to the bug's page",
|
||||
|
||||
"default-test-case-status" => 'Default status for newly created test cases.',
|
||||
|
||||
"new-testrun-email-notif" => 'E-mail message sent to assigned testers when a new test run is started. ' _
|
||||
"new-testrun-email-notif" =>
|
||||
'E-mail message sent to assigned testers when a new test run is started. ' _
|
||||
'There are some special symbols replaced at run time:<br/>' _
|
||||
'%to%: list of assigned testers email addresses<br/>' _
|
||||
'%summary%: test run summary<br/>' _
|
||||
|
@ -66,7 +71,8 @@
|
|||
'%product%: product\'s name<br/>' _
|
||||
'%product_id%: product\'s id',
|
||||
|
||||
"case-failed-email-notif" => 'E-mail message sent when a test case log is marked as \'failed\'. ' _
|
||||
"case-failed-email-notif" =>
|
||||
'E-mail message sent when a test case log is marked as \'failed\'. ' _
|
||||
'There are some special symbols replaced at run time:<br/>' _
|
||||
'%id%: test case log id<br/>' _
|
||||
'%manager%: test run\'s manager<br/>' _
|
||||
|
@ -84,6 +90,5 @@
|
|||
|
||||
"testopia-show-setup-breakdown" => 'Show an individual tab with Setup/Breakdown edit fields in test case display.',
|
||||
|
||||
}
|
||||
|
||||
%]
|
||||
'testopia-hide-htmleditor' => 'Hide WISYWIG HTML editor in Action/Results/Setup/Breakdown edit fields.<br />Useful when your test cases are stored in MediaWiki.'
|
||||
} %]
|
||||
|
|
Loading…
Reference in New Issue