Ensure all object types have a System XXX? property. Fixes #1257

This commit is contained in:
Aditya Toshniwal
2020-04-23 17:31:40 +05:30
committed by Akshay Joshi
parent 2b5c90e379
commit dfb74904ed
64 changed files with 281 additions and 35 deletions

View File

@@ -230,6 +230,11 @@ class LanguageView(PGChildNodeView):
self.driver = get_driver(PG_DEFAULT_DRIVER)
self.manager = self.driver.connection_manager(kwargs['sid'])
self.conn = self.manager.connection(did=kwargs['did'])
self.datlastsysoid = \
self.manager.db_info[kwargs['did']]['datlastsysoid'] \
if self.manager.db_info is not None and \
kwargs['did'] in self.manager.db_info else 0
# Set the template path for the SQL scripts
self.template_path = (
"languages/sql/#gpdb#{0}#".format(self.manager.version) if
@@ -348,6 +353,9 @@ class LanguageView(PGChildNodeView):
gettext("Could not find the language information.")
)
res['rows'][0]['is_sys_obj'] = (
res['rows'][0]['oid'] <= self.datlastsysoid)
sql = render_template(
"/".join([self.template_path, 'acl.sql']),
lid=lid

View File

@@ -129,6 +129,9 @@ define('pgadmin.node.language', [
},{
id: 'acl', label: gettext('Privileges'), type: 'text',
group: gettext('Security'), mode: ['properties'],
},{
id: 'is_sys_obj', label: gettext('System language?'),
cell:'boolean', type: 'switch', mode: ['properties'],
},{
id: 'description', label: gettext('Comment'), cell: 'string',
type: 'multiline',