Bug 16361

Bug 40933
Hide "Expected Results" field in Testopia by default


git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@240 6955db30-a419-402b-8a0d-67ecbb4d7f56
master
vfilippov 2009-08-10 17:53:46 +00:00
parent f7ebcf9093
commit a00da1d42a
5 changed files with 8939 additions and 12 deletions

View File

@ -213,13 +213,16 @@ Ext.onReady(function(){
items: [ items: [
{ {
layout: 'column', layout: 'column',
columnWidth: 1.0,
title: 'Action / Expected Results', title: 'Action / Expected Results',
tbar: new DocCompareToolbar('case',tcase.case_id), tbar: new DocCompareToolbar('case',tcase.case_id),
id: 'action_panel', id: 'action_panel',
[% SET showeffect = !case.text.effect.match('^\s*(<[^>]*>\s*)*$') %]
items: [{ items: [{
columnWidth:0.5, columnWidth: [% showeffect ? "0.5" : "1.0" %],
layout:'fit', layout:'fit',
items:{ id: 'action_editor_col',
items:[{
title: 'Action', title: 'Action',
height: 420, height: 420,
bodyBorder: false, bodyBorder: false,
@ -230,10 +233,16 @@ Ext.onReady(function(){
xtype:'htmleditor', xtype:'htmleditor',
value: '[% case.text.action FILTER js %]' value: '[% case.text.action FILTER js %]'
}] }]
} }]
},{ },{
columnWidth:0.5, columnWidth:0.5,
id:'effect_editor_col',
layout:'fit', layout:'fit',
[% UNLESS showeffect %]
style:{
display: 'none',
},
[% END %]
items:{ items:{
title: 'Expected Results', title: 'Expected Results',
height: 420, height: 420,
@ -250,6 +259,26 @@ Ext.onReady(function(){
buttons: [{ buttons: [{
text: 'Update Action/Results', text: 'Update Action/Results',
handler: processText 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 = '';
}
}
}] }]
},{ },{
layout: 'column', layout: 'column',

View File

@ -847,8 +847,10 @@ NewCaseForm = function(plan_ids, product_id, run_id){
layout: 'column', layout: 'column',
title: 'Actions', title: 'Actions',
id: 'ncf_action_panel',
items: [{ items: [{
columnWidth: 0.5, columnWidth: 1.0,
id: 'ncf_action_editor_col',
items:[{ items:[{
title: 'Action', title: 'Action',
layout: 'fit', layout: 'fit',
@ -876,6 +878,10 @@ NewCaseForm = function(plan_ids, product_id, run_id){
}] }]
},{ },{
columnWidth: 0.5, columnWidth: 0.5,
id: 'ncf_effect_editor_col',
style:{
display: 'none',
},
items:[{ items:[{
title: 'Expected Results', title: 'Expected Results',
layout: 'fit', layout: 'fit',
@ -884,6 +890,7 @@ NewCaseForm = function(plan_ids, product_id, run_id){
name: 'tceffect', name: 'tceffect',
xtype:'htmleditor', xtype:'htmleditor',
scrollable:true, scrollable:true,
height:340,
listeners:{'initialize':function(h){ listeners:{'initialize':function(h){
if(!h.getValue()){ if(!h.getValue()){
var httpRequest = new Ext.data.Connection(); var httpRequest = new Ext.data.Connection();
@ -981,6 +988,26 @@ NewCaseForm = function(plan_ids, product_id, run_id){
} }
catch (err){} catch (err){}
} }
},{
text: 'Show Results Edit',
id: 'ncf_showhide_results_btn',
handler: function(){
d = document.getElementById('ncf_effect_editor_col');
if (d.style.display != 'none')
{
Ext.getCmp('ncf_action_editor_col').columnWidth=1.0;
Ext.getCmp('ncf_action_panel').doLayout();
Ext.getCmp('ncf_showhide_results_btn').setText('Show Results Edit');
d.style.display = 'none';
}
else
{
Ext.getCmp('ncf_action_editor_col').columnWidth=0.5;
Ext.getCmp('ncf_action_panel').doLayout();
Ext.getCmp('ncf_showhide_results_btn').setText('Hide Results Edit');
d.style.display = '';
}
}
}] }]
}); });
Ext.getCmp('comp_product_combo').on('select', function(c,r,i){ Ext.getCmp('comp_product_combo').on('select', function(c,r,i){

View File

@ -1084,6 +1084,8 @@ CaseRun = function(){
store.on('load', function(s,r){ store.on('load', function(s,r){
Ext.getCmp('action_editor').setValue(r[0].get('action')); Ext.getCmp('action_editor').setValue(r[0].get('action'));
Ext.getCmp('effect_editor').setValue(r[0].get('results')); Ext.getCmp('effect_editor').setValue(r[0].get('results'));
if (!/^\s*(<[^>]*>\s*)*$/.match(r[0].get('results')))
Ext.getCmp('showhide_results_btn').handler();
Ext.getCmp('setup_editor').setValue(r[0].get('setup')); Ext.getCmp('setup_editor').setValue(r[0].get('setup'));
Ext.getCmp('breakdown_editor').setValue(r[0].get('breakdown')); Ext.getCmp('breakdown_editor').setValue(r[0].get('breakdown'));
Ext.getCmp('summary_tb').items.items[7].td.innerHTML = '<span class="ytb-text">' +'Case ' + r[0].get('case_id') + ' - ' + r[0].get('summary'); Ext.getCmp('summary_tb').items.items[7].td.innerHTML = '<span class="ytb-text">' +'Case ' + r[0].get('case_id') + ' - ' + r[0].get('summary');
@ -1220,9 +1222,10 @@ CaseRun = function(){
title: 'Action / Expected Results', title: 'Action / Expected Results',
id: 'action_panel', id: 'action_panel',
items: [{ items: [{
columnWidth:0.5, columnWidth:1.0,
layout:'fit', layout:'fit',
items:{ id:'action_editor_col',
items:[{
title: 'Action', title: 'Action',
height: Ext.state.Manager.get('bigtext_height', 230), height: Ext.state.Manager.get('bigtext_height', 230),
id: 'cr_action_panel', id: 'cr_action_panel',
@ -1234,10 +1237,14 @@ CaseRun = function(){
id: 'action_editor', id: 'action_editor',
xtype:'htmleditor' xtype:'htmleditor'
}] }]
} }]
},{ },{
columnWidth:0.5, columnWidth:0.5,
id:'effect_editor_col',
layout:'fit', layout:'fit',
style:{
display: 'none',
},
items:{ items:{
title: 'Expected Results', title: 'Expected Results',
height: Ext.state.Manager.get('bigtext_height', 230), height: Ext.state.Manager.get('bigtext_height', 230),
@ -1255,6 +1262,26 @@ CaseRun = function(){
buttons: [{ buttons: [{
text: 'Update Action/Results', text: 'Update Action/Results',
handler: processText.createDelegate(this) 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')
{
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 = '';
}
}
}] }]
},{ },{
layout: 'column', layout: 'column',

View File

@ -3865,8 +3865,10 @@ NewCaseForm = function(plan_ids, product_id, run_id){
layout: 'column', layout: 'column',
title: 'Actions', title: 'Actions',
id: 'ncf_action_panel',
items: [{ items: [{
columnWidth: 0.5, columnWidth: 1.0,
id: 'ncf_action_editor_col',
items:[{ items:[{
title: 'Action', title: 'Action',
layout: 'fit', layout: 'fit',
@ -3894,6 +3896,10 @@ NewCaseForm = function(plan_ids, product_id, run_id){
}] }]
},{ },{
columnWidth: 0.5, columnWidth: 0.5,
id: 'ncf_effect_editor_col',
style:{
display: 'none',
},
items:[{ items:[{
title: 'Expected Results', title: 'Expected Results',
layout: 'fit', layout: 'fit',
@ -3902,6 +3908,7 @@ NewCaseForm = function(plan_ids, product_id, run_id){
name: 'tceffect', name: 'tceffect',
xtype:'htmleditor', xtype:'htmleditor',
scrollable:true, scrollable:true,
height:340,
listeners:{'initialize':function(h){ listeners:{'initialize':function(h){
if(!h.getValue()){ if(!h.getValue()){
var httpRequest = new Ext.data.Connection(); var httpRequest = new Ext.data.Connection();
@ -3999,6 +4006,26 @@ NewCaseForm = function(plan_ids, product_id, run_id){
} }
catch (err){} catch (err){}
} }
},{
text: 'Show Results Edit',
id: 'ncf_showhide_results_btn',
handler: function(){
d = document.getElementById('ncf_effect_editor_col');
if (d.style.display != 'none')
{
Ext.getCmp('ncf_action_editor_col').columnWidth=1.0;
Ext.getCmp('ncf_action_panel').doLayout();
Ext.getCmp('ncf_showhide_results_btn').setText('Show Results Edit');
d.style.display = 'none';
}
else
{
Ext.getCmp('ncf_action_editor_col').columnWidth=0.5;
Ext.getCmp('ncf_action_panel').doLayout();
Ext.getCmp('ncf_showhide_results_btn').setText('Hide Results Edit');
d.style.display = '';
}
}
}] }]
}); });
Ext.getCmp('comp_product_combo').on('select', function(c,r,i){ Ext.getCmp('comp_product_combo').on('select', function(c,r,i){
@ -5443,6 +5470,8 @@ CaseRun = function(){
store.on('load', function(s,r){ store.on('load', function(s,r){
Ext.getCmp('action_editor').setValue(r[0].get('action')); Ext.getCmp('action_editor').setValue(r[0].get('action'));
Ext.getCmp('effect_editor').setValue(r[0].get('results')); Ext.getCmp('effect_editor').setValue(r[0].get('results'));
if (!/^\s*(<[^>]*>\s*)*$/.match(r[0].get('results')))
Ext.getCmp('showhide_results_btn').handler();
Ext.getCmp('setup_editor').setValue(r[0].get('setup')); Ext.getCmp('setup_editor').setValue(r[0].get('setup'));
Ext.getCmp('breakdown_editor').setValue(r[0].get('breakdown')); Ext.getCmp('breakdown_editor').setValue(r[0].get('breakdown'));
Ext.getCmp('summary_tb').items.items[7].td.innerHTML = '<span class="ytb-text">' +'Case ' + r[0].get('case_id') + ' - ' + r[0].get('summary'); Ext.getCmp('summary_tb').items.items[7].td.innerHTML = '<span class="ytb-text">' +'Case ' + r[0].get('case_id') + ' - ' + r[0].get('summary');
@ -5579,9 +5608,10 @@ CaseRun = function(){
title: 'Action / Expected Results', title: 'Action / Expected Results',
id: 'action_panel', id: 'action_panel',
items: [{ items: [{
columnWidth:0.5, columnWidth:1.0,
layout:'fit', layout:'fit',
items:{ id:'action_editor_col',
items:[{
title: 'Action', title: 'Action',
height: Ext.state.Manager.get('bigtext_height', 230), height: Ext.state.Manager.get('bigtext_height', 230),
id: 'cr_action_panel', id: 'cr_action_panel',
@ -5593,10 +5623,14 @@ CaseRun = function(){
id: 'action_editor', id: 'action_editor',
xtype:'htmleditor' xtype:'htmleditor'
}] }]
} }]
},{ },{
columnWidth:0.5, columnWidth:0.5,
id:'effect_editor_col',
layout:'fit', layout:'fit',
style:{
display: 'none',
},
items:{ items:{
title: 'Expected Results', title: 'Expected Results',
height: Ext.state.Manager.get('bigtext_height', 230), height: Ext.state.Manager.get('bigtext_height', 230),
@ -5614,6 +5648,26 @@ CaseRun = function(){
buttons: [{ buttons: [{
text: 'Update Action/Results', text: 'Update Action/Results',
handler: processText.createDelegate(this) 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')
{
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 = '';
}
}
}] }]
},{ },{
layout: 'column', layout: 'column',

File diff suppressed because one or more lines are too long