Prevent attempts to bulk-drop schema objects. Fixes #3797

This commit is contained in:
Khushboo Vashi 2018-12-13 11:03:30 +00:00 committed by Dave Page
parent 52fb8e197f
commit dfbb2212c0
25 changed files with 118 additions and 47 deletions

View File

@ -22,5 +22,6 @@ Bug fixes
| `Bug #3619 <https://redmine.postgresql.org/issues/3619>`_ - Add titles to the code areas of the Query Tool and Debugger to ensure that panels can be re-docked within them.
| `Bug #3711 <https://redmine.postgresql.org/issues/3711>`_ - Fix an encoding issue in the query tool.
| `Bug #3757 <https://redmine.postgresql.org/issues/3757>`_ - Hide Radio buttons that should not be shown on the maintenance dialogue.
| `Bug #3805 <https://redmine.postgresql.org/issues/3805>`_ - Prevent attempts to bulk-drop schema objects.
| `Bug #3798 <https://redmine.postgresql.org/issues/3798>`_ - Ensure the browser toolbar buttons work in languages other than English.
| `Bug #3805 <https://redmine.postgresql.org/issues/3805>`_ - Allow horizontal sizing of the edit grid text pop-out.

View File

@ -1,8 +1,10 @@
define('pgadmin.node.collation', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
'pgadmin.node.schema.dir/child', 'pgadmin.browser.collection',
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, schemaChild) {
'pgadmin.node.schema.dir/child', 'pgadmin.node.schema.dir/schema_child_tree_node',
'pgadmin.browser.collection',
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, schemaChild,
schemaChildTreeNode) {
if (!pgBrowser.Nodes['coll-collation']) {
pgAdmin.Browser.Nodes['coll-collation'] =
@ -11,6 +13,8 @@ define('pgadmin.node.collation', [
label: gettext('Collations'),
type: 'coll-collation',
columns: ['name', 'owner', 'description'],
canDrop: schemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: schemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}

View File

@ -13,7 +13,7 @@ define('pgadmin.node.domain_constraints', [
label: gettext('Domain Constraints'),
type: 'coll-domain_constraints',
columns: ['name', 'description'],
canDrop: true,
canDrop: schemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: false,
});
}

View File

@ -2,10 +2,11 @@
define('pgadmin.node.domain', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'backbone',
'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform', 'pgadmin.backgrid',
'pgadmin.node.schema.dir/child', 'pgadmin.browser.collection',
'pgadmin.node.schema.dir/child', 'pgadmin.node.schema.dir/schema_child_tree_node',
'pgadmin.browser.collection',
], function(
gettext, url_for, $, _, Backbone, pgAdmin, pgBrowser, Backform, Backgrid,
schemaChild
schemaChild, schemaChildTreeNode
) {
// Define Domain Collection Node
@ -16,6 +17,8 @@ define('pgadmin.node.domain', [
label: gettext('Domains'),
type: 'coll-domain',
columns: ['name', 'owner', 'description'],
canDrop: schemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: schemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}

View File

@ -2,10 +2,11 @@
define('pgadmin.node.foreign_table', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'backbone',
'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform', 'pgadmin.backgrid',
'pgadmin.node.schema.dir/child', 'pgadmin.browser.collection',
'pgadmin.node.schema.dir/child', 'pgadmin.node.schema.dir/schema_child_tree_node',
'pgadmin.browser.collection',
], function(
gettext, url_for, $, _, Backbone, pgAdmin, pgBrowser, Backform, Backgrid,
schemaChild
schemaChild, schemaChildTreeNode
) {
if (!pgBrowser.Nodes['coll-foreign_table']) {
@ -15,6 +16,8 @@ define('pgadmin.node.foreign_table', [
label: gettext('Foreign Tables'),
type: 'coll-foreign_table',
columns: ['name', 'owner', 'description'],
canDrop: schemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: schemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}

View File

@ -1,10 +1,11 @@
define('pgadmin.node.fts_configuration', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'backbone',
'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform', 'pgadmin.backgrid',
'pgadmin.node.schema.dir/child', 'pgadmin.browser.collection',
'pgadmin.node.schema.dir/child', 'pgadmin.node.schema.dir/schema_child_tree_node',
'pgadmin.browser.collection',
], function(
gettext, url_for, $, _, Backbone, pgAdmin, pgBrowser, Backform, Backgrid,
schemaChild
schemaChild, schemaChildTreeNode
) {
// Model for tokens control
@ -406,6 +407,8 @@ define('pgadmin.node.fts_configuration', [
label: gettext('FTS Configurations'),
type: 'coll-fts_configuration',
columns: ['name', 'description'],
canDrop: schemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: schemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}

View File

@ -1,9 +1,11 @@
define('pgadmin.node.fts_dictionary', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
'pgadmin.node.schema.dir/child', 'pgadmin.browser.collection',
'pgadmin.node.schema.dir/child', 'pgadmin.node.schema.dir/schema_child_tree_node',
'pgadmin.browser.collection',
], function(
gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, schemaChild
gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, schemaChild,
schemaChildTreeNode
) {
// Extend the browser's node model class to create a option/value pair
@ -52,6 +54,8 @@ define('pgadmin.node.fts_dictionary', [
label: gettext('FTS Dictionaries'),
type: 'coll-fts_dictionary',
columns: ['name', 'description'],
canDrop: schemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: schemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}

View File

@ -1,8 +1,8 @@
define('pgadmin.node.fts_parser', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
'sources/pgadmin', 'pgadmin.browser', 'pgadmin.node.schema.dir/child',
'pgadmin.browser.collection',
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, schemaChild) {
'pgadmin.node.schema.dir/schema_child_tree_node', 'pgadmin.browser.collection',
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, schemaChild, schemaChildTreeNode) {
// Extend the collection class for fts parser
if (!pgBrowser.Nodes['coll-fts_parser']) {
@ -12,6 +12,8 @@ define('pgadmin.node.fts_parser', [
label: gettext('FTS Parsers'),
type: 'coll-fts_parser',
columns: ['name', 'description'],
canDrop: schemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: schemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}

View File

@ -1,8 +1,8 @@
define('pgadmin.node.fts_template', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
'sources/pgadmin', 'pgadmin.browser', 'pgadmin.node.schema.dir/child',
'pgadmin.browser.collection',
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, schemaChild) {
'pgadmin.node.schema.dir/schema_child_tree_node', 'pgadmin.browser.collection',
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, schemaChild, schemaChildTreeNode) {
// Extend the collection class for fts template
if (!pgBrowser.Nodes['coll-fts_template']) {
@ -12,6 +12,8 @@ define('pgadmin.node.fts_template', [
label: gettext('FTS Templates'),
type: 'coll-fts_template',
columns: ['name', 'description'],
canDrop: schemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: schemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}

View File

@ -2,10 +2,11 @@
define('pgadmin.node.function', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'backbone',
'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
'pgadmin.node.schema.dir/child', 'pgadmin.browser.collection',
'pgadmin.browser.server.privilege',
'pgadmin.node.schema.dir/child', 'pgadmin.node.schema.dir/schema_child_tree_node',
'pgadmin.browser.collection', 'pgadmin.browser.server.privilege',
], function(
gettext, url_for, $, _, Backbone, pgAdmin, pgBrowser, Backform, schemaChild
gettext, url_for, $, _, Backbone, pgAdmin, pgBrowser, Backform, schemaChild,
schemaChildTreeNode
) {
if (!pgBrowser.Nodes['coll-function']) {
@ -16,6 +17,8 @@ define('pgadmin.node.function', [
type: 'coll-function',
columns: ['name', 'funcowner', 'description'],
hasStatistics: true,
canDrop: schemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: schemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}

View File

@ -3,8 +3,10 @@ define('pgadmin.node.procedure', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
'pgadmin.node.function', 'pgadmin.node.schema.dir/child',
'pgadmin.node.schema.dir/schema_child_tree_node',
'pgadmin.browser.collection', 'pgadmin.browser.server.privilege',
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, Function, schemaChild) {
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, Function,
schemaChild, schemaChildTreeNode) {
if (!pgBrowser.Nodes['coll-procedure']) {
pgAdmin.Browser.Nodes['coll-procedure'] =
@ -14,6 +16,8 @@ define('pgadmin.node.procedure', [
type: 'coll-procedure',
columns: ['name', 'funcowner', 'description'],
hasStatistics: true,
canDrop: schemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: schemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}

View File

@ -2,10 +2,10 @@
define('pgadmin.node.trigger_function', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
'pgadmin.node.schema.dir/child', 'pgadmin.browser.collection',
'pgadmin.browser.server.privilege',
'pgadmin.node.schema.dir/child', 'pgadmin.node.schema.dir/schema_child_tree_node',
'pgadmin.browser.collection', 'pgadmin.browser.server.privilege',
], function(
gettext, url_for, $, _, pgAdmin, pgBrowser, Backform, schemaChild
gettext, url_for, $, _, pgAdmin, pgBrowser, Backform, schemaChild, schemaChildTreeNode
) {
if (!pgBrowser.Nodes['coll-trigger_function']) {
@ -16,6 +16,8 @@ define('pgadmin.node.trigger_function', [
type: 'coll-trigger_function',
columns: ['name', 'funcowner', 'description'],
hasStatistics: true,
canDrop: schemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: schemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}

View File

@ -1,8 +1,10 @@
define('pgadmin.node.package', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
'pgadmin.node.schema.dir/child', 'pgadmin.browser.collection',
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform, schemaChild) {
'pgadmin.node.schema.dir/child', 'pgadmin.node.schema.dir/schema_child_tree_node',
'pgadmin.browser.collection',
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform, schemaChild,
schemaChildTreeNode) {
// Extend the browser's collection class for package collection
if (!pgBrowser.Nodes['coll-package']) {
@ -12,6 +14,8 @@ define('pgadmin.node.package', [
label: gettext('Packages'),
type: 'coll-package',
columns: ['name' ,'owner', 'description'],
canDrop: schemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: schemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}

View File

@ -1,9 +1,11 @@
define('pgadmin.node.sequence', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
'pgadmin.node.schema.dir/child', 'pgadmin.browser.collection',
'pgadmin.node.schema.dir/child', 'pgadmin.node.schema.dir/schema_child_tree_node',
'pgadmin.browser.collection',
], function(
gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, schemaChild
gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, schemaChild,
schemaChildTreeNode
) {
// Extend the browser's collection class for sequence collection
@ -15,6 +17,8 @@ define('pgadmin.node.sequence', [
type: 'coll-sequence',
columns: ['name', 'seqowner', 'comment'],
hasStatistics: true,
canDrop: schemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: schemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}

View File

@ -1,8 +1,10 @@
define('pgadmin.node.synonym', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.alertifyjs',
'pgadmin.node.schema.dir/child', 'pgadmin.browser.collection',
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, schemaChild) {
'pgadmin.node.schema.dir/child', 'pgadmin.node.schema.dir/schema_child_tree_node',
'pgadmin.browser.collection',
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify,
schemaChild, schemaChildTreeNode) {
if (!pgBrowser.Nodes['coll-synonym']) {
pgAdmin.Browser.Nodes['coll-synonym'] =
@ -11,6 +13,8 @@ define('pgadmin.node.synonym', [
label: gettext('Synonyms'),
type: 'coll-synonym',
columns: ['name', 'owner','is_public_synonym'],
canDrop: schemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: schemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}

View File

@ -1,9 +1,10 @@
define('pgadmin.node.column', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'backbone',
'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform', 'pgadmin.backgrid',
'pgadmin.browser.collection',
'pgadmin.node.schema.dir/schema_child_tree_node', 'pgadmin.browser.collection',
], function(
gettext, url_for, $, _, Backbone, pgAdmin, pgBrowser, Backform, Backgrid
gettext, url_for, $, _, Backbone, pgAdmin, pgBrowser, Backform, Backgrid,
SchemaChildTreeNode
) {
if (!pgBrowser.Nodes['coll-column']) {
@ -13,6 +14,8 @@ define('pgadmin.node.column', [
label: gettext('Columns'),
type: 'coll-column',
columns: ['name', 'atttypid', 'description'],
canDrop: SchemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: SchemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}

View File

@ -21,6 +21,8 @@ define('pgadmin.node.index', [
columns: ['name', 'description'],
hasStatistics: true,
statsPrettifyFields: ['Size', 'Index size'],
canDrop: SchemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: SchemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}

View File

@ -19,6 +19,8 @@ function(
columns: [
'name', 'schema', 'partition_value', 'is_partitioned', 'description',
],
canDrop: SchemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: SchemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}

View File

@ -2,7 +2,7 @@ define('pgadmin.node.rule', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
'pgadmin.node.schema.dir/schema_child_tree_node',
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform, schemaChildTreeNode) {
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform, SchemaChildTreeNode) {
/**
Create and add a rule collection into nodes
@ -18,6 +18,8 @@ define('pgadmin.node.rule', [
label: gettext('Rules'),
type: 'coll-rule',
columns: ['name', 'owner', 'comment'],
canDrop: SchemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: SchemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}
@ -45,7 +47,7 @@ define('pgadmin.node.rule', [
hasSQL: true,
hasDepends: true,
canDrop: function(itemData, item){
schemaChildTreeNode.isTreeItemOfChildOfSchema.apply(this, [itemData, item]);
SchemaChildTreeNode.isTreeItemOfChildOfSchema.apply(this, [itemData, item]);
if(_.has(itemData, 'label') && itemData.label === '_RETURN')
return false;
else {
@ -53,7 +55,7 @@ define('pgadmin.node.rule', [
}
},
canDropCascade: function(itemData, item){
schemaChildTreeNode.isTreeItemOfChildOfSchema.apply(this, [itemData, item]);
SchemaChildTreeNode.isTreeItemOfChildOfSchema.apply(this, [itemData, item]);
if(_.has(itemData, 'label') && itemData.label === '_RETURN')
return false;
else {

View File

@ -4,13 +4,13 @@ define('pgadmin.node.table', [
'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
'pgadmin.alertifyjs', 'pgadmin.backform', 'pgadmin.backgrid',
'pgadmin.tables.js/show_advanced_tab',
'pgadmin.node.schema.dir/child', 'pgadmin.browser.collection',
'pgadmin.node.column', 'pgadmin.node.constraints',
'pgadmin.browser.table.partition.utils',
'pgadmin.node.schema.dir/child','pgadmin.node.schema.dir/schema_child_tree_node',
'pgadmin.browser.collection', 'pgadmin.node.column',
'pgadmin.node.constraints', 'pgadmin.browser.table.partition.utils',
], function(
tableFunctions,
gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify, Backform, Backgrid,
ShowAdvancedTab, SchemaChild
ShowAdvancedTab, SchemaChild, SchemaChildTreeNode
) {
if (!pgBrowser.Nodes['coll-table']) {
@ -24,6 +24,8 @@ define('pgadmin.node.table', [
statsPrettifyFields: ['Size', 'Indexes size', 'Table size',
'Toast table size', 'Tuple length',
'Dead tuple length', 'Free space'],
canDrop: SchemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: SchemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}

View File

@ -35,6 +35,8 @@ define('pgadmin.node.trigger', [
label: gettext('Triggers'),
type: 'coll-trigger',
columns: ['name', 'description'],
canDrop: SchemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: SchemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}

View File

@ -2,10 +2,10 @@ define('pgadmin.node.type', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
'pgadmin.backgrid', 'pgadmin.node.schema.dir/child',
'pgadmin.browser.collection',
'pgadmin.node.schema.dir/schema_child_tree_node', 'pgadmin.browser.collection',
], function(
gettext, url_for, $, _, pgAdmin, pgBrowser, Backform, Backgrid,
schemaChild
schemaChild, schemaChildTreeNode
) {
if (!pgBrowser.Nodes['coll-type']) {
@ -15,6 +15,8 @@ define('pgadmin.node.type', [
label: gettext('Types'),
type: 'coll-type',
columns: ['name', 'typeowner', 'description'],
canDrop: schemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: schemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}

View File

@ -2,10 +2,10 @@ define('pgadmin.node.mview', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
'sources/pgadmin', 'pgadmin.alertifyjs', 'pgadmin.browser',
'pgadmin.backform', 'pgadmin.node.schema.dir/child',
'pgadmin.browser.server.privilege',
'pgadmin.node.schema.dir/schema_child_tree_node', 'pgadmin.browser.server.privilege',
], function(
gettext, url_for, $, _, pgAdmin, Alertify, pgBrowser, Backform,
schemaChild
schemaChild, schemaChildTreeNode
) {
/**
@ -22,6 +22,8 @@ define('pgadmin.node.mview', [
label: gettext('Materialized Views'),
type: 'coll-mview',
columns: ['name', 'owner'],
canDrop: schemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: schemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}

View File

@ -1,10 +1,10 @@
define('pgadmin.node.view', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
'pgadmin.node.schema.dir/child', 'pgadmin.browser.server.privilege',
'pgadmin.node.rule',
'pgadmin.node.schema.dir/child', 'pgadmin.node.schema.dir/schema_child_tree_node',
'pgadmin.browser.server.privilege', 'pgadmin.node.rule',
], function(
gettext, url_for, $, _, pgAdmin, pgBrowser, Backform, schemaChild
gettext, url_for, $, _, pgAdmin, pgBrowser, Backform, schemaChild, schemaChildTreeNode
) {
@ -22,6 +22,8 @@ define('pgadmin.node.view', [
label: gettext('Views'),
type: 'coll-view',
columns: ['name', 'owner'],
canDrop: schemaChildTreeNode.isTreeItemOfChildOfSchema,
canDropCascade: schemaChildTreeNode.isTreeItemOfChildOfSchema,
});
}

View File

@ -124,7 +124,10 @@ define([
}.bind(panel);
// Add the new column for the multi-select menus
if (that.canDrop || that.canDropCascade) {
if((_.isFunction(that.canDrop) ?
that.canDrop.apply(that, [data, item]) : that.canDrop) ||
(_.isFunction(that.canDropCascade) ?
that.canDropCascade.apply(that, [data, item]) : that.canDropCascade)) {
gridSchema.columns.unshift({
name: 'oid',
cell: Backgrid.Extension.SelectRowCell.extend({
@ -215,7 +218,10 @@ define([
tooltip: gettext('Delete/Drop'),
extraClasses: ['btn-default', 'delete_multiple'],
icon: 'fa fa-lg fa-trash-o',
disabled: !that.canDrop,
disabled: _.isFunction(that.canDrop) ?
function() {
return !(that.canDrop.apply(self, arguments));
} : (!that.canDrop),
register: function(btn) {
btn.on('click',() => {
onDrop('drop');
@ -229,7 +235,10 @@ define([
tooltip: gettext('Drop Cascade'),
extraClasses: ['btn-default', 'delete_multiple_cascade'],
icon: '',
disabled: !that.canDropCascade,
disabled: _.isFunction(that.canDropCascade) ?
function() {
return !(that.canDropCascade.apply(self, arguments));
} : (!that.canDropCascade),
register: function(btn) {
btn.on('click',() => {
onDrop('dropCascade');