mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Allow deleting the entry while creating/adding new label to enumeration type. #8208
This commit is contained in:
parent
776e092a89
commit
a0cd6c6a88
@ -209,7 +209,7 @@ class EnumerationSchema extends BaseUISchema {
|
||||
return [
|
||||
{
|
||||
id: 'label', label: gettext('Label'),
|
||||
type: 'text', cell: 'text', minWidth: 640,
|
||||
type: 'text', cell: 'text', minWidth: 620,
|
||||
editable: (state) => {
|
||||
return _.isUndefined(obj.isNew) ? true : obj.isNew(state);
|
||||
}
|
||||
@ -1301,6 +1301,7 @@ export default class TypeSchema extends BaseUISchema {
|
||||
},
|
||||
{
|
||||
id: 'enum', label: gettext('Enumeration type'),
|
||||
editable: true,
|
||||
schema: new EnumerationSchema(),
|
||||
type: 'collection',
|
||||
group: gettext('Definition'), mode: ['edit', 'create'],
|
||||
@ -1308,14 +1309,12 @@ export default class TypeSchema extends BaseUISchema {
|
||||
return !obj.isInvalidColumnAdded(state);
|
||||
},
|
||||
canEdit: false,
|
||||
canDeleteRow: function(state) {
|
||||
// We will disable it if it's in 'edit' mode
|
||||
return obj.isNew(state);
|
||||
},
|
||||
canEditRow: false,
|
||||
canDelete: true,
|
||||
canReorder: (state)=>(this.isNew(state)),
|
||||
canDeleteRow: (state)=>(_.isUndefined(state.label)),
|
||||
canEditRow: true,
|
||||
disabled: () => obj.inCatalog(),
|
||||
deps: ['typtype'],
|
||||
uniqueCol : ['label'],
|
||||
visible: (state) => isVisible(state, 'e'),
|
||||
}, {
|
||||
type: 'nested-fieldset',
|
||||
|
Loading…
Reference in New Issue
Block a user