Fixing couple issues with some of the nodes.

* Added 'catalog' as parent type for the domain, procedure nodes.
* Proper initialization of the FTS Configuration, FTS Parser, FTS
  Dictionary, FTS Template Nodes.
* Proper Indentation in collection.js
pull/3/head
Surinder Kumar 2016-05-26 11:11:14 +05:30 committed by Ashesh Vashi
parent 95fe98600f
commit 6f2c8cfb31
7 changed files with 31 additions and 29 deletions

View File

@ -115,7 +115,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
collection_type: 'coll-domain',
hasSQL: true,
hasDepends: true,
parent_type: ['schema'],
parent_type: ['schema', 'catalog'],
Init: function() {
// Avoid mulitple registration of menus
if (this.initialized)

View File

@ -459,16 +459,16 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
copy_config: undefined, // FTS configuration list to copy from
tokens: undefined // token/dictionary pair list for node
},
initialize: function(attrs, args) {
initialize: function(attrs, opts) {
var isNew = (_.size(attrs) === 0);
pgAdmin.Browser.Node.Model.prototype.initialize.apply(this, arguments);
if (isNew) {
var userInfo = pgBrowser.serverInfo[args.node_info.server._id].user;
this.set({'owner': userInfo.name}, {silent: true});
}
pgAdmin.Browser.Node.Model.prototype.initialize.apply(this, arguments);
if (_.isUndefined(this.get('schema'))) {
this.set('schema', this.node_info.schema._id);
var user = pgBrowser.serverInfo[opts.node_info.server._id].user;
this.set({
'owner': user.name,
'schema': opts.node_info.schema._id
}, {silent: true});
}
},
// Defining schema for FTS Configuration

View File

@ -102,14 +102,14 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
},
initialize: function(attrs, args) {
var isNew = (_.size(attrs) === 0);
pgAdmin.Browser.Node.Model.prototype.initialize.apply(this, arguments);
if (isNew) {
var userInfo = pgBrowser.serverInfo[args.node_info.server._id].user;
this.set({'owner': userInfo.name}, {silent: true});
}
pgAdmin.Browser.Node.Model.prototype.initialize.apply(this, arguments);
if (_.isUndefined(this.get('schema'))) {
this.set('schema', this.node_info.schema._id);
var user = pgBrowser.serverInfo[args.node_info.server._id].user;
this.set({
'owner': user.name,
'schema': args.node_info.schema._id
}, {silent: true});
}
},
// Defining schema for fts dictionary

View File

@ -68,12 +68,13 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
prslextype: undefined, // Lextype function for fts parser
prsheadline: undefined // Headline function for fts parse
},
initialize: function() {
pgAdmin.Browser.Node.Model.prototype.initialize.apply(this,
arguments
initialize: function(attrs, args) {
var isNew = (_.size(attrs) === 0);
pgAdmin.Browser.Node.Model.prototype.initialize.apply(
this, arguments
);
if (_.isUndefined(this.get('schema'))) {
this.set('schema', this.node_info.schema._id);
if (isNew) {
this.set('schema', args.node_info.schema._id);
}
},
// Defining schema for fts parser

View File

@ -63,10 +63,11 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
tmplinit: undefined, // Init function for fts template
tmpllexize: undefined // Lexize function for fts template
},
initialize: function() {
initialize: function(attrs, args) {
var isNew = (_.size(attrs) === 0);
pgAdmin.Browser.Node.Model.prototype.initialize.apply(this, arguments);
if (_.isUndefined(this.get('schema'))) {
this.set('schema', this.node_info.schema._id);
if (isNew) {
this.set('schema', args.node_info.schema._id);
}
},
// Defining schema for fts template

View File

@ -30,7 +30,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify, Function) {
hasSQL: true,
hasDepends: true,
hasScriptTypes: ['create', 'exec'],
parent_type: ['schema'],
parent_type: ['schema', 'catalog'],
Init: function() {
/* Avoid mulitple registration of menus */
if (this.proc_initialized)