Fix various cosmetic issues with preference dialog

1. Foreign keys listed twice
The label for Exclusion constraint was set to 'Foreign keys'. fixed it.
2. Trigger function, Unique constraint, Primary key should be in title case
3. if user click outside of Preferences window it disappear (it should not disappear)
set preference alertify dialog option closableByDimmer to false.
4. Columns node settings listed twice
Override the register_preferences method in Columns CatalogObjectColumnsModule class
because there are two types of columns node, catalogs columns and tables columns.
so the settings for table columns should also work for catalog columns. Thats why we are not showing preference option for catalogs column node.
Ashesh fixed this issue.
This commit is contained in:
Surinder Kumar 2016-06-08 13:29:49 +01:00 committed by Dave Page
parent 17fa6dcc40
commit 802840fd7f
6 changed files with 19 additions and 6 deletions

View File

@ -20,6 +20,7 @@ from pgadmin.utils.ajax import precondition_required
from pgadmin.utils.driver import get_driver
from config import PG_DEFAULT_DRIVER
from functools import wraps
from pgadmin.utils.preferences import Preferences
class CatalogObjectColumnsModule(CollectionNodeModule):
@ -80,6 +81,17 @@ class CatalogObjectColumnsModule(CollectionNodeModule):
"""
return False
def register_preferences(self):
"""
Register preferences for this module.
"""
# Add the node informaton for browser, not in respective
# node preferences
self.browser_preference = Preferences.module('browser')
self.pref_show_system_objects = self.browser_preference.preference(
'show_system_objects'
)
blueprint = CatalogObjectColumnsModule(__name__)

View File

@ -1463,7 +1463,7 @@ class TriggerFunctionModule(SchemaChildModule):
"""
NODE_TYPE = 'trigger_function'
COLLECTION_LABEL = gettext("Trigger function")
COLLECTION_LABEL = gettext("Trigger Function")
def __init__(self, *args, **kwargs):
"""

View File

@ -47,7 +47,7 @@ class ExclusionConstraintModule(ConstraintTypeModule):
"""
NODE_TYPE = 'exclusion_constraint'
COLLECTION_LABEL = _("Foreign Keys")
COLLECTION_LABEL = _("Exclusion Constraints")
def __init__(self, *args, **kwargs):
"""

View File

@ -98,7 +98,7 @@ class PrimaryKeyConstraintModule(IndexConstraintModule):
"""
NODE_TYPE = 'primary_key'
COLLECTION_LABEL = _("Primary key")
COLLECTION_LABEL = _("Primary Key")
primary_key_blueprint = PrimaryKeyConstraintModule(__name__)
@ -112,7 +112,7 @@ class UniqueConstraintModule(IndexConstraintModule):
"""
NODE_TYPE = 'unique_constraint'
COLLECTION_LABEL = _("Unique constraint")
COLLECTION_LABEL = _("Unique Constraint")
unique_constraint_blueprint = UniqueConstraintModule(__name__)

View File

@ -561,7 +561,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
canAdd: true,
columns : ['name', 'consrc']
},{
id: 'unique_constraint', label: '{{ _('Unique constraint') }}',
id: 'unique_constraint', label: '{{ _('Unique Constraint') }}',
model: pgBrowser.Nodes['unique_constraint'].model,
subnode: pgBrowser.Nodes['unique_constraint'].model,
editable: false, type: 'collection',

View File

@ -364,7 +364,8 @@ define(
options: {
padding: !1,
overflow: !1,
title: '{{ _('Preferences')|safe }}'
title: '{{ _('Preferences')|safe }}',
closableByDimmer: false
}
};
},