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 @@ +check_constraints-bad \ 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 @@ +check-constraints \ 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 @@ -check_constraints-bad \ 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 @@ -check-constraints \ 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'],