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

View File

@ -847,8 +847,10 @@ NewCaseForm = function(plan_ids, product_id, run_id){
layout: 'column',
title: 'Actions',
id: 'ncf_action_panel',
items: [{
columnWidth: 0.5,
columnWidth: 1.0,
id: 'ncf_action_editor_col',
items:[{
title: 'Action',
layout: 'fit',
@ -876,6 +878,10 @@ NewCaseForm = function(plan_ids, product_id, run_id){
}]
},{
columnWidth: 0.5,
id: 'ncf_effect_editor_col',
style:{
display: 'none',
},
items:[{
title: 'Expected Results',
layout: 'fit',
@ -884,6 +890,7 @@ NewCaseForm = function(plan_ids, product_id, run_id){
name: 'tceffect',
xtype:'htmleditor',
scrollable:true,
height:340,
listeners:{'initialize':function(h){
if(!h.getValue()){
var httpRequest = new Ext.data.Connection();
@ -981,6 +988,26 @@ NewCaseForm = function(plan_ids, product_id, run_id){
}
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){

View File

@ -1084,6 +1084,8 @@ CaseRun = function(){
store.on('load', function(s,r){
Ext.getCmp('action_editor').setValue(r[0].get('action'));
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('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');
@ -1220,9 +1222,10 @@ CaseRun = function(){
title: 'Action / Expected Results',
id: 'action_panel',
items: [{
columnWidth:0.5,
columnWidth:1.0,
layout:'fit',
items:{
id:'action_editor_col',
items:[{
title: 'Action',
height: Ext.state.Manager.get('bigtext_height', 230),
id: 'cr_action_panel',
@ -1234,10 +1237,14 @@ CaseRun = function(){
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', 230),
@ -1255,6 +1262,26 @@ CaseRun = function(){
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')
{
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',

View File

@ -3865,8 +3865,10 @@ NewCaseForm = function(plan_ids, product_id, run_id){
layout: 'column',
title: 'Actions',
id: 'ncf_action_panel',
items: [{
columnWidth: 0.5,
columnWidth: 1.0,
id: 'ncf_action_editor_col',
items:[{
title: 'Action',
layout: 'fit',
@ -3894,6 +3896,10 @@ NewCaseForm = function(plan_ids, product_id, run_id){
}]
},{
columnWidth: 0.5,
id: 'ncf_effect_editor_col',
style:{
display: 'none',
},
items:[{
title: 'Expected Results',
layout: 'fit',
@ -3902,6 +3908,7 @@ NewCaseForm = function(plan_ids, product_id, run_id){
name: 'tceffect',
xtype:'htmleditor',
scrollable:true,
height:340,
listeners:{'initialize':function(h){
if(!h.getValue()){
var httpRequest = new Ext.data.Connection();
@ -3999,6 +4006,26 @@ NewCaseForm = function(plan_ids, product_id, run_id){
}
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){
@ -5443,6 +5470,8 @@ CaseRun = function(){
store.on('load', function(s,r){
Ext.getCmp('action_editor').setValue(r[0].get('action'));
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('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');
@ -5579,9 +5608,10 @@ CaseRun = function(){
title: 'Action / Expected Results',
id: 'action_panel',
items: [{
columnWidth:0.5,
columnWidth:1.0,
layout:'fit',
items:{
id:'action_editor_col',
items:[{
title: 'Action',
height: Ext.state.Manager.get('bigtext_height', 230),
id: 'cr_action_panel',
@ -5593,10 +5623,14 @@ CaseRun = function(){
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', 230),
@ -5614,6 +5648,26 @@ CaseRun = function(){
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')
{
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',

File diff suppressed because one or more lines are too long