Skip to content

Commit

Permalink
Allow deleting the entry while creating/adding new label to enumerati…
Browse files Browse the repository at this point in the history
…on type.pgadmin-org#8208
  • Loading branch information
yogeshmahajan-1903 committed Dec 16, 2024
1 parent 6f8fb6f commit 8c3d1e4
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -1301,21 +1301,20 @@ 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'],
canAddRow: function(state) {
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',
Expand Down

0 comments on commit 8c3d1e4

Please sign in to comment.