diff --git a/docs/en_US/release_notes_7_2.rst b/docs/en_US/release_notes_7_2.rst index 7d0f4bc40..2975f08b8 100644 --- a/docs/en_US/release_notes_7_2.rst +++ b/docs/en_US/release_notes_7_2.rst @@ -35,6 +35,7 @@ Bug fixes | `Issue #6026 `_ - Tools menu should be toggled for "pause replay of wal" and "resume replay of wal". | `Issue #6080 `_ - pgAdmin icon not showing on taskbar on Windows 10. | `Issue #6147 `_ - Heartbeat is getting logged, though no server is connected in pgAdmin. + | `Issue #6204 `_ - Ensure that name can't be empty in edit mode for Primary Key and Index. | `Issue #6221 `_ - Fix circular reference error for the multirange data types in the query tool. | `Issue #6253 `_ - Fix an issue in the register server when setting the role, an arbitrary SQL query can be fired. | `Issue #6267 `_ - Ensure the user is able to log in if the specified OAUTH2_USERNAME_CLAIM is present in the OAuth2 profile. diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.ui.js index f01c529ef..bcaf33edd 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.ui.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.ui.js @@ -256,6 +256,13 @@ export default class PrimaryKeySchema extends BaseUISchema { } validate(state, setError) { + if (!this.isNew(state) && isEmptyString(state.name)) { + setError('name', gettext('Name cannot be empty in edit mode.')); + return true; + } else { + setError('name', null); + } + if(isEmptyString(state.index) && (_.isUndefined(state.columns) || _.isNull(state.columns) || state.columns.length < 1)) { setError('columns', gettext('Please specify columns for %s.', gettext('Primary key'))); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.ui.js index 9ff198232..7e37c5891 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.ui.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.ui.js @@ -452,6 +452,14 @@ export default class IndexSchema extends BaseUISchema { validate(state, setError) { let msg; + if (!this.isNew(state) && isEmptyString(state.name)) { + msg = gettext('Name cannot be empty in edit mode.'); + setError('name', msg); + return true; + } else { + setError('name', null); + } + // Checks if columns is empty let cols = state.columns; if(_.isArray(cols) && cols.length == 0){