mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
1) Make default values column read-only for inherited columns when creating table.
2) Default values not populated for inherited columns. The existing issue, API changed. 3) Options are not populated for Name in Column > Variable tab. 4) The empty check error message is changed from Label cannot be empty to Label in Collection cannot be empty for collections. Fixes #6763
This commit is contained in:
committed by
Akshay Joshi
parent
b60bd73f88
commit
08009f8edc
@@ -379,7 +379,13 @@ export default class ColumnSchema extends BaseUISchema {
|
||||
if (isDisabled && obj.isNew(state)) {
|
||||
return {defval: undefined};
|
||||
}
|
||||
}
|
||||
}, editable: function(state) {
|
||||
// inheritedfrom has value then we should disable it
|
||||
if (!isEmptyString(state.inheritedfrom)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
},{
|
||||
id: 'attnotnull', label: gettext('Not NULL?'), cell: 'switch',
|
||||
type: 'switch', minWidth: 80,
|
||||
@@ -509,7 +515,10 @@ export default class ColumnSchema extends BaseUISchema {
|
||||
},{
|
||||
id: 'attoptions', label: gettext('Variables'), type: 'collection',
|
||||
group: gettext('Variables'),
|
||||
schema: new VariableSchema([], null, null, ['name', 'value']),
|
||||
schema: new VariableSchema([
|
||||
{label: 'n_distinct', value: 'n_distinct', vartype: 'string'},
|
||||
{label: 'n_distinct_inherited', value: 'n_distinct_inherited', vartype: 'string'}
|
||||
], null, null, ['name', 'value']),
|
||||
uniqueCol : ['name'], mode: ['edit', 'create'],
|
||||
canAdd: true, canEdit: false, canDelete: true,
|
||||
}, {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
SELECT
|
||||
a.attname AS name, pg_catalog.format_type(a.atttypid, NULL) AS cltype, a.attidentity as clidentity,
|
||||
a.attname AS name, pg_catalog.format_type(a.atttypid, NULL) AS cltype,
|
||||
pg_catalog.pg_get_expr(def.adbin, def.adrelid) AS defval, a.attidentity as clidentity,
|
||||
pg_catalog.quote_ident(n.nspname)||'.'||pg_catalog.quote_ident(c.relname) as inheritedfrom,
|
||||
c.oid as inheritedid
|
||||
FROM
|
||||
@@ -8,6 +9,8 @@ JOIN
|
||||
pg_catalog.pg_namespace n ON c.relnamespace=n.oid
|
||||
JOIN
|
||||
pg_catalog.pg_attribute a ON a.attrelid = c.oid AND NOT a.attisdropped AND a.attnum > 0
|
||||
LEFT OUTER JOIN
|
||||
pg_catalog.pg_attrdef def ON adrelid=a.attrelid AND adnum=a.attnum
|
||||
WHERE
|
||||
{% if tid %}
|
||||
c.oid = {{tid}}::OID
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
SELECT
|
||||
a.attname AS name, pg_catalog.format_type(a.atttypid, NULL) AS cltype,
|
||||
pg_catalog.pg_get_expr(def.adbin, def.adrelid) AS defval,
|
||||
pg_catalog.quote_ident(n.nspname)||'.'||pg_catalog.quote_ident(c.relname) as inheritedfrom,
|
||||
c.oid as inheritedid
|
||||
FROM
|
||||
@@ -8,6 +9,8 @@ JOIN
|
||||
pg_catalog.pg_namespace n ON c.relnamespace=n.oid
|
||||
JOIN
|
||||
pg_catalog.pg_attribute a ON a.attrelid = c.oid AND NOT a.attisdropped AND a.attnum > 0
|
||||
LEFT OUTER JOIN
|
||||
pg_catalog.pg_attrdef def ON adrelid=a.attrelid AND adnum=a.attnum
|
||||
WHERE
|
||||
{% if tid %}
|
||||
c.oid = {{tid}}::OID
|
||||
|
||||
@@ -246,7 +246,7 @@ define('pgadmin.browser', [
|
||||
isPrivate: true,
|
||||
elContainer: true,
|
||||
limit: 1,
|
||||
content: '<div class="obj_properties container-fluid"><div role="status" class="pg-panel-message">' + select_object_msg + '</div></div>',
|
||||
content: '<div class="obj_properties container-fluid h-100"><div role="status" class="pg-panel-message">' + select_object_msg + '</div></div>',
|
||||
events: panelEvents,
|
||||
onCreate: function(myPanel, $container) {
|
||||
$container.addClass('pg-no-overflow');
|
||||
|
||||
Reference in New Issue
Block a user