зеркало из https://github.com/mozilla/pjs.git
Add tags pane for cases in a run.
This commit is contained in:
Родитель
29db602476
Коммит
92a0952def
|
@ -567,6 +567,7 @@ CaseRunGrid = function(params, run){
|
|||
Ext.getCmp('case_comps_panel').tcid = r.get('case_id');
|
||||
Ext.getCmp('attachments_panel').object = r.data;
|
||||
Ext.getCmp('case_details_panel').caserun_id = r.get('caserun_id');
|
||||
Ext.getCmp('casetagsgrid').obj_id = r.get('case_id');
|
||||
|
||||
var tab = Ext.getCmp('caserun_center_region').getActiveTab();
|
||||
Ext.getCmp(tab.id).fireEvent('activate');
|
||||
|
@ -831,6 +832,15 @@ Ext.extend(CaseRunGrid, Ext.grid.EditorGridPanel, {
|
|||
var r = grid.getSelectionModel().getSelected();
|
||||
caseClonePopup(grid.run.product_id, getSelectedObjects(grid,'case_id'));
|
||||
}
|
||||
},{
|
||||
text: 'Add Selected Test Cases to Run... ',
|
||||
handler: function(){
|
||||
Ext.Msg.prompt('Add to runs', '', function(btn, text){
|
||||
if (btn == 'ok'){
|
||||
TestopiaUpdateMultiple('case', {addruns: text, ids: getSelectedObjects(grid,'case_id')}, grid);
|
||||
}
|
||||
});
|
||||
}
|
||||
},{
|
||||
text: 'Refresh List',
|
||||
handler: function(){
|
||||
|
@ -1129,7 +1139,8 @@ CaseRun = function(){
|
|||
new CaseRunHistory(),
|
||||
new AttachGrid({id: 0, type: 'caserun'}),
|
||||
new CaseBugsGrid(),
|
||||
new CaseComponentsGrid()]
|
||||
new CaseComponentsGrid(),
|
||||
new TestopiaObjectTags('case', 0)]
|
||||
}]
|
||||
});
|
||||
};
|
||||
|
|
|
@ -20,21 +20,34 @@
|
|||
* Daniel Parker <dparker1@novell.com>
|
||||
*/
|
||||
|
||||
TestopiaObjectTags = function(obj, id){
|
||||
TestopiaObjectTags = function(obj, obj_id){
|
||||
this.orig_id = obj_id;
|
||||
this.obj_id = obj_id;
|
||||
this.remove = function(){
|
||||
var form = new Ext.form.BasicForm('testopia_helper_frm',{});
|
||||
form.submit({
|
||||
url: 'tr_tags.cgi',
|
||||
params: {action: 'removetag', type: obj, id: id, tag: getSelectedObjects(Ext.getCmp(obj + 'tagsgrid'), 'tag_name')},
|
||||
params: {action: 'removetag', type: obj, id: this.obj_id, tag: getSelectedObjects(Ext.getCmp(obj + 'tagsgrid'), 'tag_name')},
|
||||
success: function(){
|
||||
ds.load();
|
||||
ds.reload();
|
||||
},
|
||||
failure: testopiaError
|
||||
});
|
||||
};
|
||||
this.add = function(){
|
||||
var form = new Ext.form.BasicForm('testopia_helper_frm',{});
|
||||
form.submit({
|
||||
url: 'tr_tags.cgi',
|
||||
params: {action: 'addtag', type: obj, id: this.obj_id, tag: Ext.getCmp(obj + 'tag_lookup').getRawValue()},
|
||||
success: function(){
|
||||
ds.reload();
|
||||
},
|
||||
failure: testopiaError
|
||||
});
|
||||
};
|
||||
this.store = new Ext.data.JsonStore({
|
||||
url: 'tr_tags.cgi',
|
||||
baseParams: {action: 'gettags', type: obj, id: id},
|
||||
baseParams: {action: 'gettags', type: obj},
|
||||
root: 'tags',
|
||||
id: 'tag_id',
|
||||
fields: [
|
||||
|
@ -58,17 +71,7 @@ TestopiaObjectTags = function(obj, id){
|
|||
id: 'tag_add_btn',
|
||||
icon: 'testopia/img/add.png',
|
||||
iconCls: 'img_button_16x',
|
||||
handler: function(){
|
||||
var form = new Ext.form.BasicForm('testopia_helper_frm',{});
|
||||
form.submit({
|
||||
url: 'tr_tags.cgi',
|
||||
params: {action: 'addtag', type: obj, id: id, tag: Ext.getCmp('tag_lookup').getRawValue()},
|
||||
success: function(){
|
||||
ds.load();
|
||||
},
|
||||
failure: testopiaError
|
||||
});
|
||||
}
|
||||
handler: this.add.createDelegate(this)
|
||||
});
|
||||
|
||||
var deleteButton = new Ext.Button({
|
||||
|
@ -95,7 +98,7 @@ TestopiaObjectTags = function(obj, id){
|
|||
forceFit:true
|
||||
},
|
||||
tbar: [
|
||||
new TagLookup({}), addButton, deleteButton
|
||||
new TagLookup({id: obj + 'tag_lookup'}), addButton, deleteButton
|
||||
]
|
||||
});
|
||||
|
||||
|
@ -131,8 +134,8 @@ Ext.extend(TestopiaObjectTags, Ext.grid.GridPanel, {
|
|||
},
|
||||
|
||||
onActivate: function(event){
|
||||
if (!this.store.getCount()){
|
||||
this.store.load();
|
||||
if (!this.store.getCount() || this.orig_id != this.obj_id){
|
||||
this.store.load({params:{id: this.obj_id}});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -86,9 +86,6 @@ if ($action eq 'update'){
|
|||
}
|
||||
}
|
||||
|
||||
my $product = Bugzilla::Testopia::Product->new($cgi->param('product_id'));
|
||||
ThrowUserError('invalid-test-id-non-existent', {type => 'Product', id => $cgi->param('product_id')}) unless $product;
|
||||
|
||||
foreach my $p (@case_ids){
|
||||
my $case = Bugzilla::Testopia::TestCase->new($p);
|
||||
next unless $case;
|
||||
|
|
|
@ -122,7 +122,7 @@ elsif ($action eq 'gettags'){
|
|||
$obj = Bugzilla::Testopia::TestRun->new($id);
|
||||
}
|
||||
|
||||
ThowUserError("unkown-type", {type => $type}) unless ($obj);
|
||||
ThrowUserError("unkown-type", {type => $type}) unless ($obj);
|
||||
ThrowUserError("testopia-permission-denied", {'object' => $obj}) unless $obj->canview;
|
||||
|
||||
$tags = $obj->tags;
|
||||
|
|
Загрузка…
Ссылка в новой задаче