mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Port columns node under the Catalog Objects in React.
This commit is contained in:
committed by
Akshay Joshi
parent
6c692df118
commit
96ce298789
@@ -6,6 +6,7 @@
|
||||
// This software is released under the PostgreSQL Licence
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
import CatalogObjectColumnSchema from './catalog_object_column.ui';
|
||||
|
||||
define('pgadmin.node.catalog_object_column', [
|
||||
'sources/gettext', 'jquery', 'underscore', 'sources/pgadmin',
|
||||
@@ -41,6 +42,9 @@ define('pgadmin.node.catalog_object_column', [
|
||||
this.initialized = true;
|
||||
|
||||
},
|
||||
getSchema: function() {
|
||||
return new CatalogObjectColumnSchema();
|
||||
},
|
||||
model: pgAdmin.Browser.Node.Model.extend({
|
||||
defaults: {
|
||||
attname: undefined,
|
||||
@@ -56,24 +60,12 @@ define('pgadmin.node.catalog_object_column', [
|
||||
schema: [{
|
||||
id: 'attname', label: gettext('Column'), cell: 'string',
|
||||
type: 'text', readonly: true,
|
||||
},{
|
||||
id: 'attowner', label: gettext('Owner'), cell: 'string',
|
||||
type: 'text', readonly: true,
|
||||
},{
|
||||
id: 'attnum', label: gettext('Position'), cell: 'string',
|
||||
type: 'text', readonly: true,
|
||||
},{
|
||||
id: 'cltype', label: gettext('Data type'), cell: 'string',
|
||||
group: gettext('Definition'), type: 'text', readonly: true,
|
||||
},{
|
||||
id: 'collspcname', label: gettext('Collation'), cell: 'string',
|
||||
group: gettext('Definition'), type: 'text', readonly: true,
|
||||
},{
|
||||
id: 'attacl', label: gettext('Privileges'), cell: 'string',
|
||||
group: gettext('Security'), type: 'text', readonly: true,
|
||||
},{
|
||||
id: 'is_sys_obj', label: gettext('System column?'),
|
||||
cell:'boolean', type: 'switch', mode: ['properties'],
|
||||
},{
|
||||
id: 'description', label: gettext('Comment'), cell: 'string',
|
||||
type: 'multiline', readonly: true,
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
/////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 CatalogObjectColumnSchema extends BaseUISchema {
|
||||
constructor(fieldOptions={}, initValues) {
|
||||
super({
|
||||
attname: undefined,
|
||||
attowner: undefined,
|
||||
attnum: undefined,
|
||||
cltype: undefined,
|
||||
collspcname: undefined,
|
||||
attacl: undefined,
|
||||
description: undefined,
|
||||
...initValues
|
||||
});
|
||||
|
||||
this.fieldOptions = {
|
||||
...fieldOptions,
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
get idAttribute() {
|
||||
return 'oid';
|
||||
}
|
||||
|
||||
get baseFields() {
|
||||
return [
|
||||
{
|
||||
id: 'attname', label: gettext('Column'), cell: 'string',
|
||||
type: 'text', readonly: true,
|
||||
},{
|
||||
id: 'attowner', label: gettext('Owner'), cell: 'string',
|
||||
type: 'text', readonly: true,
|
||||
},{
|
||||
id: 'attnum', label: gettext('Position'), cell: 'string',
|
||||
type: 'text', readonly: true,
|
||||
},{
|
||||
id: 'cltype', label: gettext('Data type'), cell: 'string',
|
||||
group: gettext('Definition'), type: 'text', readonly: true,
|
||||
},{
|
||||
id: 'collspcname', label: gettext('Collation'), cell: 'string',
|
||||
group: gettext('Definition'), type: 'text', readonly: true,
|
||||
},{
|
||||
id: 'attacl', label: gettext('Privileges'), cell: 'string',
|
||||
group: gettext('Security'), type: 'text', readonly: true,
|
||||
},{
|
||||
id: 'is_sys_obj', label: gettext('System column?'),
|
||||
cell:'boolean', type: 'switch', mode: ['properties'],
|
||||
},{
|
||||
id: 'description', label: gettext('Comment'), cell: 'string',
|
||||
type: 'multiline', readonly: true,
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user