mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Port Catalog Object node to react. Fixes #6569
This commit is contained in:
committed by
Akshay Joshi
parent
5a27961102
commit
78ac1ee69c
@@ -7,6 +7,8 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
import CatalogObjectSchema from './catalog_object.ui';
|
||||
|
||||
define('pgadmin.node.catalog_object', [
|
||||
'sources/gettext', 'jquery', 'underscore', 'sources/pgadmin',
|
||||
'pgadmin.browser', 'pgadmin.browser.collection',
|
||||
@@ -40,12 +42,15 @@ define('pgadmin.node.catalog_object', [
|
||||
this.initialized = true;
|
||||
|
||||
},
|
||||
getSchema: ()=>new CatalogObjectSchema(),
|
||||
/* Few fields are kept since the properties tab for collection is not
|
||||
yet migrated to new react schema. Once the properties for collection
|
||||
is removed, remove this model */
|
||||
model: pgAdmin.Browser.Node.Model.extend({
|
||||
defaults: {
|
||||
name: undefined,
|
||||
namespaceowner: undefined,
|
||||
nspacl: undefined,
|
||||
is_sys_obj: undefined,
|
||||
description: undefined,
|
||||
},
|
||||
schema: [{
|
||||
@@ -57,15 +62,13 @@ define('pgadmin.node.catalog_object', [
|
||||
},{
|
||||
id: 'owner', label: gettext('Owner'), cell: 'string',
|
||||
type: 'text', readonly: true,
|
||||
},{
|
||||
id: 'is_sys_obj', label: gettext('System catalog object?'),
|
||||
cell:'boolean', type: 'switch', mode: ['properties'],
|
||||
},{
|
||||
id: 'description', label: gettext('Comment'), cell: 'string',
|
||||
type: 'multiline' , readonly: true,
|
||||
},
|
||||
],
|
||||
}),
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
/////////////////////////////////////////////////////////////
|
||||
//
|
||||
// pgAdmin 4 - PostgreSQL Tools
|
||||
//
|
||||
// Copyright (C) 2013 - 2021, The pgAdmin Development Team
|
||||
// This software is released under the PostgreSQL Licence
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
import gettext from 'sources/gettext';
|
||||
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
||||
|
||||
export default class CatalogObjectSchema extends BaseUISchema {
|
||||
constructor() {
|
||||
super({
|
||||
name: undefined,
|
||||
is_sys_obj: undefined,
|
||||
description: undefined
|
||||
});
|
||||
}
|
||||
|
||||
get baseFields() {
|
||||
return [
|
||||
{
|
||||
id: 'name', label: gettext('Name'), cell: 'text',
|
||||
editable: false, type: 'text', mode: ['properties', 'edit']
|
||||
},
|
||||
{
|
||||
id: 'oid', label: gettext('OID'), cell: 'text',
|
||||
editable: false, type: 'text', mode: ['properties', 'edit']
|
||||
},
|
||||
{
|
||||
id: 'owner', label: gettext('Owner'),
|
||||
editable: false, type: 'text', mode: ['properties', 'edit']
|
||||
},{
|
||||
id: 'is_sys_obj', label: gettext('System database?'),
|
||||
cell: 'switch', type: 'switch', mode: ['properties'],
|
||||
},{
|
||||
id: 'description', label: gettext('Comment'),
|
||||
editable: false, type: 'multiline', mode: ['properties', 'edit']
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user