Skip to content

Commit a0cd6c6

Browse files
Allow deleting the entry while creating/adding new label to enumeration type. #8208
1 parent 776e092 commit a0cd6c6

File tree

1 file changed

+6
-7
lines changed
  • web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js

1 file changed

+6
-7
lines changed

web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class EnumerationSchema extends BaseUISchema {
209209
return [
210210
{
211211
id: 'label', label: gettext('Label'),
212-
type: 'text', cell: 'text', minWidth: 640,
212+
type: 'text', cell: 'text', minWidth: 620,
213213
editable: (state) => {
214214
return _.isUndefined(obj.isNew) ? true : obj.isNew(state);
215215
}
@@ -1301,21 +1301,20 @@ export default class TypeSchema extends BaseUISchema {
13011301
},
13021302
{
13031303
id: 'enum', label: gettext('Enumeration type'),
1304+
editable: true,
13041305
schema: new EnumerationSchema(),
13051306
type: 'collection',
13061307
group: gettext('Definition'), mode: ['edit', 'create'],
13071308
canAddRow: function(state) {
13081309
return !obj.isInvalidColumnAdded(state);
13091310
},
13101311
canEdit: false,
1311-
canDeleteRow: function(state) {
1312-
// We will disable it if it's in 'edit' mode
1313-
return obj.isNew(state);
1314-
},
1315-
canEditRow: false,
1312+
canDelete: true,
1313+
canReorder: (state)=>(this.isNew(state)),
1314+
canDeleteRow: (state)=>(_.isUndefined(state.label)),
1315+
canEditRow: true,
13161316
disabled: () => obj.inCatalog(),
13171317
deps: ['typtype'],
1318-
uniqueCol : ['label'],
13191318
visible: (state) => isVisible(state, 'e'),
13201319
}, {
13211320
type: 'nested-fieldset',

0 commit comments

Comments
 (0)