mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fix name of 'check-constraints' to follow the usual singular convention.
This commit is contained in:
parent
0cb57848f8
commit
784f3f59d8
@ -46,7 +46,7 @@ class CheckConstraintModule(CollectionNodeModule):
|
|||||||
- Load the module script for the Check Constraint, when any of the
|
- Load the module script for the Check Constraint, when any of the
|
||||||
Check node is initialized.
|
Check node is initialized.
|
||||||
"""
|
"""
|
||||||
NODE_TYPE = 'check_constraints'
|
NODE_TYPE = 'check_constraint'
|
||||||
COLLECTION_LABEL = _("Check Constraints")
|
COLLECTION_LABEL = _("Check Constraints")
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
@ -115,7 +115,7 @@ class CheckConstraintView(PGChildNodeView):
|
|||||||
-------
|
-------
|
||||||
|
|
||||||
* module_js():
|
* module_js():
|
||||||
- Load JS file (check-constraints.js) for this module.
|
- Load JS file (check_constraint.js) for this module.
|
||||||
|
|
||||||
* check_precondition(f):
|
* check_precondition(f):
|
||||||
- Works as a decorator.
|
- Works as a decorator.
|
||||||
@ -326,10 +326,10 @@ class CheckConstraintView(PGChildNodeView):
|
|||||||
return gone(_("""Could not find the check constraint."""))
|
return gone(_("""Could not find the check constraint."""))
|
||||||
|
|
||||||
if "convalidated" in rset['rows'][0] and rset['rows'][0]["convalidated"]:
|
if "convalidated" in rset['rows'][0] and rset['rows'][0]["convalidated"]:
|
||||||
icon = "icon-check_constraints_bad"
|
icon = "icon-check_constraint_bad"
|
||||||
valid = False
|
valid = False
|
||||||
else:
|
else:
|
||||||
icon = "icon-check_constraints"
|
icon = "icon-check_constraint"
|
||||||
valid = True
|
valid = True
|
||||||
res = self.blueprint.generate_browser_node(
|
res = self.blueprint.generate_browser_node(
|
||||||
rset['rows'][0]['oid'],
|
rset['rows'][0]['oid'],
|
||||||
@ -364,10 +364,10 @@ class CheckConstraintView(PGChildNodeView):
|
|||||||
|
|
||||||
for row in rset['rows']:
|
for row in rset['rows']:
|
||||||
if "convalidated" in row and row["convalidated"]:
|
if "convalidated" in row and row["convalidated"]:
|
||||||
icon = "icon-check_constraints_bad"
|
icon = "icon-check_constraint_bad"
|
||||||
valid = False
|
valid = False
|
||||||
else:
|
else:
|
||||||
icon = "icon-check_constraints"
|
icon = "icon-check_constraint"
|
||||||
valid = True
|
valid = True
|
||||||
res.append(
|
res.append(
|
||||||
self.blueprint.generate_browser_node(
|
self.blueprint.generate_browser_node(
|
||||||
@ -423,10 +423,10 @@ class CheckConstraintView(PGChildNodeView):
|
|||||||
|
|
||||||
for row in rset['rows']:
|
for row in rset['rows']:
|
||||||
if "convalidated" in row and row["convalidated"]:
|
if "convalidated" in row and row["convalidated"]:
|
||||||
icon = "icon-check_constraints_bad"
|
icon = "icon-check_constraint_bad"
|
||||||
valid = False
|
valid = False
|
||||||
else:
|
else:
|
||||||
icon = "icon-check_constraints"
|
icon = "icon-check_constraint"
|
||||||
valid = True
|
valid = True
|
||||||
res.append(
|
res.append(
|
||||||
self.blueprint.generate_browser_node(
|
self.blueprint.generate_browser_node(
|
||||||
@ -555,10 +555,10 @@ class CheckConstraintView(PGChildNodeView):
|
|||||||
return internal_server_error(errormsg=res)
|
return internal_server_error(errormsg=res)
|
||||||
|
|
||||||
if "convalidated" in res['rows'][0] and res['rows'][0]["convalidated"]:
|
if "convalidated" in res['rows'][0] and res['rows'][0]["convalidated"]:
|
||||||
icon = "icon-check_constraints_bad"
|
icon = "icon-check_constraint_bad"
|
||||||
valid = False
|
valid = False
|
||||||
else:
|
else:
|
||||||
icon = "icon-check_constraints"
|
icon = "icon-check_constraint"
|
||||||
valid = True
|
valid = True
|
||||||
|
|
||||||
return jsonify(
|
return jsonify(
|
||||||
@ -673,10 +673,10 @@ class CheckConstraintView(PGChildNodeView):
|
|||||||
return internal_server_error(errormsg=res)
|
return internal_server_error(errormsg=res)
|
||||||
|
|
||||||
if "convalidated" in res['rows'][0] and res['rows'][0]["convalidated"]:
|
if "convalidated" in res['rows'][0] and res['rows'][0]["convalidated"]:
|
||||||
icon = 'icon-check_constraints_bad'
|
icon = 'icon-check_constraint_bad'
|
||||||
valid = False
|
valid = False
|
||||||
else:
|
else:
|
||||||
icon = 'icon-check_constraints'
|
icon = 'icon-check_constraint'
|
||||||
valid = True
|
valid = True
|
||||||
|
|
||||||
return jsonify(
|
return jsonify(
|
||||||
|
Before Width: | Height: | Size: 499 B After Width: | Height: | Size: 499 B |
Before Width: | Height: | Size: 307 B After Width: | Height: | Size: 307 B |
@ -6,10 +6,10 @@ define('pgadmin.node.check_constraint', [
|
|||||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
|
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
|
||||||
|
|
||||||
// Check Constraint Node
|
// Check Constraint Node
|
||||||
if (!pgBrowser.Nodes['check_constraints']) {
|
if (!pgBrowser.Nodes['check_constraint']) {
|
||||||
pgAdmin.Browser.Nodes['check_constraints'] = pgBrowser.Node.extend({
|
pgAdmin.Browser.Nodes['check_constraint'] = pgBrowser.Node.extend({
|
||||||
getTreeNodeHierarchy: pgBrowser.tableChildTreeNodeHierarchy,
|
getTreeNodeHierarchy: pgBrowser.tableChildTreeNodeHierarchy,
|
||||||
type: 'check_constraints',
|
type: 'check_constraint',
|
||||||
label: gettext('Check'),
|
label: gettext('Check'),
|
||||||
collection_type: 'coll-constraints',
|
collection_type: 'coll-constraints',
|
||||||
sqlAlterHelp: 'ddl-alter.html',
|
sqlAlterHelp: 'ddl-alter.html',
|
||||||
@ -26,13 +26,13 @@ define('pgadmin.node.check_constraint', [
|
|||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
|
|
||||||
pgBrowser.add_menus([{
|
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',
|
applies: ['object', 'context'], callback: 'show_obj_properties',
|
||||||
category: 'create', priority: 5, label: gettext('Check...'),
|
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'
|
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',
|
applies: ['object', 'context'], callback: 'validate_check_constraint',
|
||||||
category: 'validate', priority: 4, label: gettext('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}
|
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);
|
alertify.success(res.info);
|
||||||
t.removeIcon(i);
|
t.removeIcon(i);
|
||||||
data.valid = true;
|
data.valid = true;
|
||||||
data.icon = 'icon-check_constraints';
|
data.icon = 'icon-check_constraint';
|
||||||
t.addIcon(i, {icon: data.icon});
|
t.addIcon(i, {icon: data.icon});
|
||||||
setTimeout(function() {t.deselect(i);}, 10);
|
setTimeout(function() {t.deselect(i);}, 10);
|
||||||
setTimeout(function() {t.select(i);}, 100);
|
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'];
|
||||||
});
|
});
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.icon-check_bad, .icon-check_constraints_bad {
|
.icon-check_bad, .icon-check_constraint_bad {
|
||||||
background-image: url('{{ url_for('NODE-%s.static' % node_type, filename='img/check-constraints-bad.svg' )}}') !important;
|
background-image: url('{{ url_for('NODE-%s.static' % node_type, filename='img/check-constraint-bad.svg' )}}') !important;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 20px !important;
|
background-size: 20px !important;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
@ -7,8 +7,8 @@
|
|||||||
height: 1.3em;
|
height: 1.3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-check, .icon-check_constraints {
|
.icon-check, .icon-check_constraint {
|
||||||
background-image: url('{{ url_for('NODE-%s.static' % node_type, filename='img/check-constraints.svg' )}}') !important;
|
background-image: url('{{ url_for('NODE-%s.static' % node_type, filename='img/check-constraint.svg' )}}') !important;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 20px !important;
|
background-size: 20px !important;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
|
@ -647,8 +647,8 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
|
|||||||
}
|
}
|
||||||
},{
|
},{
|
||||||
id: 'check_constraint', label: gettext('Check constraint'),
|
id: 'check_constraint', label: gettext('Check constraint'),
|
||||||
model: pgBrowser.Nodes['check_constraints'].model,
|
model: pgBrowser.Nodes['check_constraint'].model,
|
||||||
subnode: pgBrowser.Nodes['check_constraints'].model,
|
subnode: pgBrowser.Nodes['check_constraint'].model,
|
||||||
editable: false, type: 'collection',
|
editable: false, type: 'collection',
|
||||||
group: gettext('Check'), mode: ['edit', 'create'],
|
group: gettext('Check'), mode: ['edit', 'create'],
|
||||||
canEdit: true, canDelete: true, deps:['is_partitioned'],
|
canEdit: true, canDelete: true, deps:['is_partitioned'],
|
||||||
|
@ -635,8 +635,8 @@ define('pgadmin.node.table', [
|
|||||||
}
|
}
|
||||||
},{
|
},{
|
||||||
id: 'check_constraint', label: gettext('Check constraint'),
|
id: 'check_constraint', label: gettext('Check constraint'),
|
||||||
model: pgBrowser.Nodes['check_constraints'].model,
|
model: pgBrowser.Nodes['check_constraint'].model,
|
||||||
subnode: pgBrowser.Nodes['check_constraints'].model,
|
subnode: pgBrowser.Nodes['check_constraint'].model,
|
||||||
editable: false, type: 'collection',
|
editable: false, type: 'collection',
|
||||||
group: gettext('Check'), mode: ['edit', 'create'],
|
group: gettext('Check'), mode: ['edit', 'create'],
|
||||||
canEdit: true, canDelete: true, deps:['is_partitioned'],
|
canEdit: true, canDelete: true, deps:['is_partitioned'],
|
||||||
|
Loading…
Reference in New Issue
Block a user