public inbox for [email protected]
help / color / mirror / Atom feed[pgadmin4][Patch]: Fixed RM 3442, 3443, 3444 Drop options not available.
2+ messages / 2 participants
[nested] [flat]
* [pgadmin4][Patch]: Fixed RM 3442, 3443, 3444 Drop options not available.
@ 2018-06-25 14:08 Akshay Joshi <[email protected]>
2018-06-25 14:54 ` Re: [pgadmin4][Patch]: Fixed RM 3442, 3443, 3444 Drop options not available. Dave Page <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Akshay Joshi @ 2018-06-25 14:08 UTC (permalink / raw)
To: pgadmin-hackers
Hi Hackers,
Attached is the patch to RM 3442, 3443 and 3444 related to Drop options not
available for Collations, Packages, Synonyms, Rules, Check Constraint and
Domain Constraints.
This are regressions. Please review it.
--
*Akshay Joshi*
*Sr. Software Architect *
*Phone: +91 20-3058-9517Mobile: +91 976-788-8246*
Attachments:
[application/octet-stream] RM_3442_3443_3444.patch (12.1K, 3-RM_3442_3443_3444.patch)
download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/static/js/collation.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/static/js/collation.js
index 7fd28a7..acb6a4c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/static/js/collation.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/static/js/collation.js
@@ -24,7 +24,6 @@ define('pgadmin.node.collation', [
collection_type: 'coll-collation',
hasSQL: true,
hasDepends: true,
- parent_type: ['schema', 'catalog'],
Init: function() {
/* Avoid mulitple registration of menus */
if (this.initialized)
@@ -54,8 +53,6 @@ define('pgadmin.node.collation', [
]);
},
- canDrop: pgBrowser.Nodes['schema'].canChildDrop,
- canDropCascade: pgBrowser.Nodes['schema'].canChildDrop,
model: pgAdmin.Browser.Node.Model.extend({
defaults: {
name: undefined,
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/domain_constraints/static/js/domain_constraints.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/domain_constraints/static/js/domain_constraints.js
index 9b3bba1..102ec7e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/domain_constraints/static/js/domain_constraints.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/domain_constraints/static/js/domain_constraints.js
@@ -2,8 +2,8 @@
define('pgadmin.node.domain_constraints', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
- 'pgadmin.browser.collection',
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser) {
+ 'pgadmin.node.schema.dir/schema_child_tree_node', 'pgadmin.browser.collection',
+], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, schemaChildTreeNode) {
// Define Domain Constraint Collection Node
if (!pgBrowser.Nodes['coll-domain_constraints']) {
@@ -57,7 +57,7 @@ define('pgadmin.node.domain_constraints', [
]);
},
- canDrop: pgBrowser.Nodes['schema'].canChildDrop,
+ canDrop: schemaChildTreeNode.isTreeItemOfChildOfSchema,
model: pgAdmin.Browser.Node.Model.extend({
defaults: {
name: undefined,
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/procedure.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/procedure.js
index 5f8409b..0397e64 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/procedure.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/procedure.js
@@ -2,9 +2,9 @@
define('pgadmin.node.procedure', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
- 'pgadmin.node.function', 'pgadmin.browser.collection',
- 'pgadmin.browser.server.privilege',
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, Function) {
+ 'pgadmin.node.function', 'pgadmin.node.schema.dir/child',
+ 'pgadmin.browser.collection', 'pgadmin.browser.server.privilege',
+], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, Function, schemaChild) {
if (!pgBrowser.Nodes['coll-procedure']) {
pgAdmin.Browser.Nodes['coll-procedure'] =
@@ -19,7 +19,7 @@ define('pgadmin.node.procedure', [
// Inherit Functions Node
if (!pgBrowser.Nodes['procedure']) {
- pgAdmin.Browser.Nodes['procedure'] = pgBrowser.Node.extend({
+ pgAdmin.Browser.Nodes['procedure'] = schemaChild.SchemaChildNode.extend({
type: 'procedure',
sqlAlterHelp: 'sql-alterprocedure.html',
sqlCreateHelp: 'sql-createprocedure.html',
@@ -30,7 +30,6 @@ define('pgadmin.node.procedure', [
hasDepends: true,
hasStatistics: true,
hasScriptTypes: ['create', 'exec'],
- parent_type: ['schema', 'catalog'],
Init: function() {
/* Avoid mulitple registration of menus */
if (this.proc_initialized)
@@ -60,8 +59,6 @@ define('pgadmin.node.procedure', [
},
]);
},
- canDrop: true,
- canDropCascade: true,
canCreateProc: function(itemData, item) {
var node_hierarchy = this.getTreeNodeHierarchy.apply(this, [item]);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/static/js/package.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/static/js/package.js
index 282d507..50a011b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/static/js/package.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/static/js/package.js
@@ -1,8 +1,8 @@
define('pgadmin.node.package', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
- 'pgadmin.browser.collection',
-], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform) {
+ 'pgadmin.node.schema.dir/child', 'pgadmin.browser.collection',
+], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform, schemaChild) {
// Extend the browser's collection class for package collection
if (!pgBrowser.Nodes['coll-package']) {
@@ -17,14 +17,13 @@ define('pgadmin.node.package', [
// Extend the browser's node class for package node
if (!pgBrowser.Nodes['package']) {
- pgBrowser.Nodes['package'] = pgBrowser.Node.extend({
+ pgBrowser.Nodes['package'] = schemaChild.SchemaChildNode.extend({
type: 'package',
dialogHelp: url_for('help.static', {'filename': 'package_dialog.html'}),
label: gettext('Package'),
collection_type: 'coll-package',
hasSQL: true,
hasDepends: true,
- parent_type: ['schema', 'catalog'],
Init: function() {
/* Avoid mulitple registration of menus */
if (this.initialized)
@@ -54,8 +53,6 @@ define('pgadmin.node.package', [
]);
},
- canDrop: pgBrowser.Nodes['schema'].canChildDrop,
- canDropCascade: pgBrowser.Nodes['schema'].canChildDrop,
canCreate: function(itemData, item, data) {
//If check is false then , we will allow create menu
if (data && data.check == false)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/static/js/child.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/static/js/child.js
index f8e5951..4992125 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/static/js/child.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/static/js/child.js
@@ -8,15 +8,13 @@
/////////////////////////////////////////////////////////////
import * as Node from 'pgbrowser/node';
-import {
- isTreeItemOfChildOfSchema, childCreateMenuEnabled,
-} from './schema_child_tree_node';
+import * as SchemaTreeNode from './schema_child_tree_node';
let SchemaChildNode = Node.extend({
parent_type: ['schema', 'catalog'],
- canDrop: isTreeItemOfChildOfSchema,
- canDropCascade: isTreeItemOfChildOfSchema,
- canCreate: childCreateMenuEnabled,
+ canDrop: SchemaTreeNode.isTreeItemOfChildOfSchema,
+ canDropCascade: SchemaTreeNode.isTreeItemOfChildOfSchema,
+ canCreate: SchemaTreeNode.childCreateMenuEnabled,
}, false);
export {SchemaChildNode};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/static/js/synonym.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/static/js/synonym.js
index d0ecaab..25fa40f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/static/js/synonym.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/static/js/synonym.js
@@ -1,8 +1,8 @@
define('pgadmin.node.synonym', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.alertifyjs',
- 'pgadmin.browser.collection',
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+ 'pgadmin.node.schema.dir/child', 'pgadmin.browser.collection',
+], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, schemaChild) {
if (!pgBrowser.Nodes['coll-synonym']) {
pgAdmin.Browser.Nodes['coll-synonym'] =
@@ -15,7 +15,7 @@ define('pgadmin.node.synonym', [
}
if (!pgBrowser.Nodes['synonym']) {
- pgAdmin.Browser.Nodes['synonym'] = pgBrowser.Node.extend({
+ pgAdmin.Browser.Nodes['synonym'] = schemaChild.SchemaChildNode.extend({
type: 'synonym',
dialogHelp: url_for('help.static', {'filename': 'synonym_dialog.html'}),
label: gettext('Synonym'),
@@ -52,7 +52,6 @@ define('pgadmin.node.synonym', [
]);
},
- canDrop: pgBrowser.Nodes['schema'].canChildDrop,
model: pgAdmin.Browser.Node.Model.extend({
isNew: function() {
return !this.fetchFromServer;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/js/check_constraint.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/js/check_constraint.js
index ab28a86..d8dc2ae 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/js/check_constraint.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/js/check_constraint.js
@@ -2,8 +2,8 @@
define('pgadmin.node.check_constraint', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.alertifyjs',
- 'pgadmin.browser.collection',
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+ 'pgadmin.node.schema.dir/schema_child_tree_node', 'pgadmin.browser.collection',
+], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, schemaChildTreeNode) {
// Check Constraint Node
if (!pgBrowser.Nodes['check_constraint']) {
@@ -81,7 +81,7 @@ define('pgadmin.node.check_constraint', [
return false;
},
},
- canDrop: pgBrowser.Nodes['schema'].canChildDrop,
+ canDrop: schemaChildTreeNode.isTreeItemOfChildOfSchema,
model: pgAdmin.Browser.Node.Model.extend({
idAttribute: 'oid',
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/rules/static/js/rule.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/rules/static/js/rule.js
index 354909f..8add5b5 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/rules/static/js/rule.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/rules/static/js/rule.js
@@ -1,7 +1,8 @@
define('pgadmin.node.rule', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
-], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform) {
+ 'pgadmin.node.schema.dir/schema_child_tree_node',
+], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform, schemaChildTreeNode) {
/**
Create and add a rule collection into nodes
@@ -43,16 +44,16 @@ define('pgadmin.node.rule', [
collection_type: 'coll-table',
hasSQL: true,
hasDepends: true,
- canDrop: function(itemData, item, data){
- pgBrowser.Nodes['schema'].canChildDrop.apply(this, [itemData, item, data]);
+ canDrop: function(itemData, item){
+ schemaChildTreeNode.isTreeItemOfChildOfSchema.apply(this, [itemData, item]);
if(_.has(itemData, 'label') && itemData.label === '_RETURN')
return false;
else {
return true;
}
},
- canDropCascade: function(itemData, item, data){
- pgBrowser.Nodes['schema'].canChildDrop.apply(this, [itemData, item, data]);
+ canDropCascade: function(itemData, item){
+ schemaChildTreeNode.isTreeItemOfChildOfSchema.apply(this, [itemData, item]);
if(_.has(itemData, 'label') && itemData.label === '_RETURN')
return false;
else {
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [pgadmin4][Patch]: Fixed RM 3442, 3443, 3444 Drop options not available.
2018-06-25 14:08 [pgadmin4][Patch]: Fixed RM 3442, 3443, 3444 Drop options not available. Akshay Joshi <[email protected]>
@ 2018-06-25 14:54 ` Dave Page <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Dave Page @ 2018-06-25 14:54 UTC (permalink / raw)
To: Akshay Joshi <[email protected]>; +Cc: pgadmin-hackers
Thanks, applied.
On Mon, Jun 25, 2018 at 3:08 PM, Akshay Joshi <[email protected]
> wrote:
> Hi Hackers,
>
> Attached is the patch to RM 3442, 3443 and 3444 related to Drop options
> not available for Collations, Packages, Synonyms, Rules, Check Constraint
> and Domain Constraints.
>
> This are regressions. Please review it.
>
> --
> *Akshay Joshi*
>
> *Sr. Software Architect *
>
>
>
> *Phone: +91 20-3058-9517Mobile: +91 976-788-8246*
>
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2018-06-25 14:54 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-06-25 14:08 [pgadmin4][Patch]: Fixed RM 3442, 3443, 3444 Drop options not available. Akshay Joshi <[email protected]>
2018-06-25 14:54 ` Dave Page <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox