Fixed incorrect tablespace options in the drop-down for move objects dialog. Fixes #6586

This commit is contained in:
Aditya Toshniwal 2021-07-27 17:28:38 +05:30 committed by Akshay Joshi
parent 508f97b08e
commit 2452d90300
2 changed files with 8 additions and 3 deletions

View File

@ -23,4 +23,5 @@ Bug fixes
| `Issue #6448 <https://redmine.postgresql.org/issues/6448>`_ - Fixed an issue in the search object when searching in 'all types' or 'subscription' if the user doesn't have access to the subscription. | `Issue #6448 <https://redmine.postgresql.org/issues/6448>`_ - Fixed an issue in the search object when searching in 'all types' or 'subscription' if the user doesn't have access to the subscription.
| `Issue #6574 <https://redmine.postgresql.org/issues/6574>`_ - Fixed an issue where paste is not working through Right-Click option on PSQL. | `Issue #6574 <https://redmine.postgresql.org/issues/6574>`_ - Fixed an issue where paste is not working through Right-Click option on PSQL.
| `Issue #6580 <https://redmine.postgresql.org/issues/6580>`_ - Fixed TypeError 'NoneType' object is not sub scriptable. | `Issue #6580 <https://redmine.postgresql.org/issues/6580>`_ - Fixed TypeError 'NoneType' object is not sub scriptable.
| `Issue #6586 <https://redmine.postgresql.org/issues/6586>`_ - Fixed incorrect tablespace options in the drop-down for move objects dialog.
| `Issue #6619 <https://redmine.postgresql.org/issues/6619>`_ - Fixed incorrect binary path issue when the user deletes the binary path from the preferences. | `Issue #6619 <https://redmine.postgresql.org/issues/6619>`_ - Fixed incorrect binary path issue when the user deletes the binary path from the preferences.

View File

@ -114,12 +114,16 @@ define('pgadmin.node.tablespace', [
obj_type: 'all', obj_type: 'all',
user: undefined, user: undefined,
}, },
initialize: function(attrs, otherArgs) {
this.selected_ts = otherArgs.selected_ts;
Backbone.Model.prototype.initialize.apply(this, [attrs, otherArgs]);
},
schema: [{ schema: [{
id: 'tblspc', label: gettext('New tablespace'), id: 'tblspc', label: gettext('New tablespace'),
type: 'text', disabled: false, control: 'node-list-by-name', type: 'text', disabled: false, control: 'node-list-by-name',
node: 'tablespace', select2: {allowClear: false}, node: 'tablespace', select2: {allowClear: false},
filter: function(o) { filter: function(o) {
return o && (o.label != d.label); return o && (o.label != this.model.selected_ts);
}, },
},{ },{
id: 'obj_type', label: gettext('Object type'), id: 'obj_type', label: gettext('Object type'),
@ -148,7 +152,7 @@ define('pgadmin.node.tablespace', [
var self = this, var self = this,
sql_tab_args = self.model.toJSON(); sql_tab_args = self.model.toJSON();
// Add existing tablespace // Add existing tablespace
sql_tab_args.old_tblspc = d.label; sql_tab_args.old_tblspc = this.model.selected_ts;
// Fetches modified SQL // Fetches modified SQL
$.ajax({ $.ajax({
@ -236,7 +240,7 @@ define('pgadmin.node.tablespace', [
// Create treeInfo // Create treeInfo
var treeInfo = node.getTreeNodeHierarchy.apply(node, [_i]); var treeInfo = node.getTreeNodeHierarchy.apply(node, [_i]);
// Instance of backbone model // Instance of backbone model
var newModel = new objModel({}, {node_info: treeInfo}), var newModel = new objModel({}, {node_info: treeInfo, selected_ts: _d.label}),
fields = Backform.generateViewSchema( fields = Backform.generateViewSchema(
treeInfo, newModel, 'create', node, treeInfo, newModel, 'create', node,
treeInfo.server, true treeInfo.server, true