Hi,
PFA patch to correct the naming convention for Check constraint module.
(only plural to singular, no change in any functionality)
Please review.
--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py
index 7908f69..f33c4e0 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py
@@ -46,7 +46,7 @@ class CheckConstraintModule(CollectionNodeModule):
- Load the module script for the Check Constraint, when any of the
Check node is initialized.
"""
- NODE_TYPE = 'check_constraints'
+ NODE_TYPE = 'check_constraint'
COLLECTION_LABEL = _("Check Constraints")
def __init__(self, *args, **kwargs):
@@ -115,7 +115,7 @@ class CheckConstraintView(PGChildNodeView):
-------
* module_js():
- - Load JS file (check-constraints.js) for this module.
+ - Load JS file (check_constraint.js) for this module.
* check_precondition(f):
- Works as a decorator.
@@ -326,10 +326,10 @@ class CheckConstraintView(PGChildNodeView):
return gone(_("""Could not find the check constraint."""))
if "convalidated" in rset['rows'][0] and
rset['rows'][0]["convalidated"]:
- icon = "icon-check_constraints_bad"
+ icon = "icon-check_constraint_bad"
valid = False
else:
- icon = "icon-check_constraints"
+ icon = "icon-check_constraint"
valid = True
res = self.blueprint.generate_browser_node(
rset['rows'][0]['oid'],
@@ -364,10 +364,10 @@ class CheckConstraintView(PGChildNodeView):
for row in rset['rows']:
if "convalidated" in row and row["convalidated"]:
- icon = "icon-check_constraints_bad"
+ icon = "icon-check_constraint_bad"
valid = False
else:
- icon = "icon-check_constraints"
+ icon = "icon-check_constraint"
valid = True
res.append(
self.blueprint.generate_browser_node(
@@ -423,10 +423,10 @@ class CheckConstraintView(PGChildNodeView):
for row in rset['rows']:
if "convalidated" in row and row["convalidated"]:
- icon = "icon-check_constraints_bad"
+ icon = "icon-check_constraint_bad"
valid = False
else:
- icon = "icon-check_constraints"
+ icon = "icon-check_constraint"
valid = True
res.append(
self.blueprint.generate_browser_node(
@@ -555,10 +555,10 @@ class CheckConstraintView(PGChildNodeView):
return internal_server_error(errormsg=res)
if "convalidated" in res['rows'][0] and
res['rows'][0]["convalidated"]:
- icon = "icon-check_constraints_bad"
+ icon = "icon-check_constraint_bad"
valid = False
else:
- icon = "icon-check_constraints"
+ icon = "icon-check_constraint"
valid = True
return jsonify(
@@ -673,10 +673,10 @@ class CheckConstraintView(PGChildNodeView):
return internal_server_error(errormsg=res)
if "convalidated" in res['rows'][0] and
res['rows'][0]["convalidated"]:
- icon = 'icon-check_constraints_bad'
+ icon = 'icon-check_constraint_bad'
valid = False
else:
- icon = 'icon-check_constraints'
+ icon = 'icon-check_constraint'
valid = True
return jsonify(
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/img/check-constraint-bad.svg
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/img/check-constraint-bad.svg
new file mode 100644
index 0000000..470163a
--- /dev/null
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/img/check-constraint-bad.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16
16"><defs><style>.cls-1,.cls-2{fill:none;stroke-linecap:round;stroke-linejoin:round;}.cls-1{stroke:#717f8e;stroke-width:2px;}.cls-2{stroke:#d0021b;stroke-width:1.5px;}</style></defs><title>check_constraints-bad</title><g
id="_3" data-name="3"><polyline class="cls-1" points="3.75 9.25 6.25 11.75
11.75 4.25"/><line class="cls-2" x1="12.25" y1="6.75" x2="9.25"
y2="9.75"/><line class="cls-2" x1="12.25" y1="9.75" x2="9.25"
y2="6.75"/></g></svg>
\ No newline at end of file
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/img/check-constraint.svg
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/img/check-constraint.svg
new file mode 100644
index 0000000..310cf7c
--- /dev/null
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/img/check-constraint.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16
16"><defs><style>.cls-1{fill:none;stroke:#2980b9;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;}</style></defs><title>check-constraints</title><g
id="_2" data-name="2"><polyline class="cls-1" points="4 9.25 6.5 11.75 12
4.25"/></g></svg>
\ No newline at end of file
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/img/check-constraints-bad.svg
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/img/check-constraints-bad.svg
deleted file mode 100644
index 470163a..0000000
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/img/check-constraints-bad.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16
16"><defs><style>.cls-1,.cls-2{fill:none;stroke-linecap:round;stroke-linejoin:round;}.cls-1{stroke:#717f8e;stroke-width:2px;}.cls-2{stroke:#d0021b;stroke-width:1.5px;}</style></defs><title>check_constraints-bad</title><g
id="_3" data-name="3"><polyline class="cls-1" points="3.75 9.25 6.25 11.75
11.75 4.25"/><line class="cls-2" x1="12.25" y1="6.75" x2="9.25"
y2="9.75"/><line class="cls-2" x1="12.25" y1="9.75" x2="9.25"
y2="6.75"/></g></svg>
\ No newline at end of file
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/img/check-constraints.svg
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/img/check-constraints.svg
deleted file mode 100644
index 310cf7c..0000000
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/img/check-constraints.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16
16"><defs><style>.cls-1{fill:none;stroke:#2980b9;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;}</style></defs><title>check-constraints</title><g
id="_2" data-name="2"><polyline class="cls-1" points="4 9.25 6.5 11.75 12
4.25"/></g></svg>
\ No newline at end of file
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 fe56aa2..3c54abf 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
@@ -6,10 +6,10 @@ define('pgadmin.node.check_constraint', [
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
// Check Constraint Node
- if (!pgBrowser.Nodes['check_constraints']) {
- pgAdmin.Browser.Nodes['check_constraints'] = pgBrowser.Node.extend({
+ if (!pgBrowser.Nodes['check_constraint']) {
+ pgAdmin.Browser.Nodes['check_constraint'] = pgBrowser.Node.extend({
getTreeNodeHierarchy: pgBrowser.tableChildTreeNodeHierarchy,
- type: 'check_constraints',
+ type: 'check_constraint',
label: gettext('Check'),
collection_type: 'coll-constraints',
sqlAlterHelp: 'ddl-alter.html',
@@ -26,13 +26,13 @@ define('pgadmin.node.check_constraint', [
this.initialized = true;
pgBrowser.add_menus([{
- name: 'create_check_constraints_on_coll', node: 'coll-constraints',
module: this,
+ name: 'create_check_constraint_on_coll', node: 'coll-constraints',
module: this,
applies: ['object', 'context'], callback: 'show_obj_properties',
category: 'create', priority: 5, label: gettext('Check...'),
- icon: 'wcTabIcon icon-check_constraints', data: {action: 'create',
check: true},
+ icon: 'wcTabIcon icon-check_constraint', data: {action: 'create',
check: true},
enable: 'canCreate'
},{
- name: 'validate_check_constraint', node: 'check_constraints',
module: this,
+ name: 'validate_check_constraint', node: 'check_constraint', module:
this,
applies: ['object', 'context'], callback:
'validate_check_constraint',
category: 'validate', priority: 4, label: gettext('Validate check
constraint'),
icon: 'fa fa-link', enable : 'is_not_valid', data: {action: 'edit',
check: true}
@@ -67,7 +67,7 @@ define('pgadmin.node.check_constraint', [
alertify.success(res.info);
t.removeIcon(i);
data.valid = true;
- data.icon = 'icon-check_constraints';
+ data.icon = 'icon-check_constraint';
t.addIcon(i, {icon: data.icon});
setTimeout(function() {t.deselect(i);}, 10);
setTimeout(function() {t.select(i);}, 100);
@@ -227,5 +227,5 @@ define('pgadmin.node.check_constraint', [
}
- return pgBrowser.Nodes['check_constraints'];
+ return pgBrowser.Nodes['check_constraint'];
});
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/templates/check_constraint/css/check_constraint.css
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/templates/check_constraint/css/check_constraint.css
index 0979ce8..6e4e7e9 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/templates/check_constraint/css/check_constraint.css
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/templates/check_constraint/css/check_constraint.css
@@ -1,5 +1,5 @@
-.icon-check_bad, .icon-check_constraints_bad {
- background-image: url('{{ url_for('NODE-%s.static' % node_type,
filename='img/check-constraints-bad.svg' )}}') !important;
+.icon-check_bad, .icon-check_constraint_bad {
+ background-image: url('{{ url_for('NODE-%s.static' % node_type,
filename='img/check-constraint-bad.svg' )}}') !important;
background-repeat: no-repeat;
background-size: 20px !important;
align-content: center;
@@ -7,8 +7,8 @@
height: 1.3em;
}
-.icon-check, .icon-check_constraints {
- background-image: url('{{ url_for('NODE-%s.static' % node_type,
filename='img/check-constraints.svg' )}}') !important;
+.icon-check, .icon-check_constraint {
+ background-image: url('{{ url_for('NODE-%s.static' % node_type,
filename='img/check-constraint.svg' )}}') !important;
background-repeat: no-repeat;
background-size: 20px !important;
align-content: center;
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js
index 602c6e3..1219822 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js
@@ -647,8 +647,8 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser,
Backform, alertify) {
}
},{
id: 'check_constraint', label: gettext('Check constraint'),
- model: pgBrowser.Nodes['check_constraints'].model,
- subnode: pgBrowser.Nodes['check_constraints'].model,
+ model: pgBrowser.Nodes['check_constraint'].model,
+ subnode: pgBrowser.Nodes['check_constraint'].model,
editable: false, type: 'collection',
group: gettext('Check'), mode: ['edit', 'create'],
canEdit: true, canDelete: true, deps:['is_partitioned'],
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js
index 8108171..ee4d55f 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js
@@ -635,8 +635,8 @@ define('pgadmin.node.table', [
}
},{
id: 'check_constraint', label: gettext('Check constraint'),
- model: pgBrowser.Nodes['check_constraints'].model,
- subnode: pgBrowser.Nodes['check_constraints'].model,
+ model: pgBrowser.Nodes['check_constraint'].model,
+ subnode: pgBrowser.Nodes['check_constraint'].model,
editable: false, type: 'collection',
group: gettext('Check'), mode: ['edit', 'create'],
canEdit: true, canDelete: true, deps:['is_partitioned'],