Fix name of 'check-constraints' to follow the usual singular convention.

This commit is contained in:
Murtuza Zabuawala 2017-10-16 15:40:15 +01:00 committed by Dave Page
parent 0cb57848f8
commit 784f3f59d8
7 changed files with 28 additions and 28 deletions

View File

@ -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(

View File

@ -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'];
});

View File

@ -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;

View File

@ -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'],

View File

@ -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'],