mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure that name can't be empty in edit mode for Primary Key and Index. #6204
This commit is contained in:
parent
6949b41fb9
commit
4baae7512b
@ -35,6 +35,7 @@ Bug fixes
|
|||||||
| `Issue #6026 <https://github.com/pgadmin-org/pgadmin4/issues/6026>`_ - Tools menu should be toggled for "pause replay of wal" and "resume replay of wal".
|
| `Issue #6026 <https://github.com/pgadmin-org/pgadmin4/issues/6026>`_ - Tools menu should be toggled for "pause replay of wal" and "resume replay of wal".
|
||||||
| `Issue #6080 <https://github.com/pgadmin-org/pgadmin4/issues/6080>`_ - pgAdmin icon not showing on taskbar on Windows 10.
|
| `Issue #6080 <https://github.com/pgadmin-org/pgadmin4/issues/6080>`_ - pgAdmin icon not showing on taskbar on Windows 10.
|
||||||
| `Issue #6147 <https://github.com/pgadmin-org/pgadmin4/issues/6147>`_ - Heartbeat is getting logged, though no server is connected in pgAdmin.
|
| `Issue #6147 <https://github.com/pgadmin-org/pgadmin4/issues/6147>`_ - Heartbeat is getting logged, though no server is connected in pgAdmin.
|
||||||
|
| `Issue #6204 <https://github.com/pgadmin-org/pgadmin4/issues/6204>`_ - Ensure that name can't be empty in edit mode for Primary Key and Index.
|
||||||
| `Issue #6221 <https://github.com/pgadmin-org/pgadmin4/issues/6221>`_ - Fix circular reference error for the multirange data types in the query tool.
|
| `Issue #6221 <https://github.com/pgadmin-org/pgadmin4/issues/6221>`_ - Fix circular reference error for the multirange data types in the query tool.
|
||||||
| `Issue #6253 <https://github.com/pgadmin-org/pgadmin4/issues/6253>`_ - Fix an issue in the register server when setting the role, an arbitrary SQL query can be fired.
|
| `Issue #6253 <https://github.com/pgadmin-org/pgadmin4/issues/6253>`_ - Fix an issue in the register server when setting the role, an arbitrary SQL query can be fired.
|
||||||
| `Issue #6267 <https://github.com/pgadmin-org/pgadmin4/issues/6267>`_ - Ensure the user is able to log in if the specified OAUTH2_USERNAME_CLAIM is present in the OAuth2 profile.
|
| `Issue #6267 <https://github.com/pgadmin-org/pgadmin4/issues/6267>`_ - Ensure the user is able to log in if the specified OAUTH2_USERNAME_CLAIM is present in the OAuth2 profile.
|
||||||
|
@ -256,6 +256,13 @@ export default class PrimaryKeySchema extends BaseUISchema {
|
|||||||
}
|
}
|
||||||
|
|
||||||
validate(state, setError) {
|
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)
|
if(isEmptyString(state.index)
|
||||||
&& (_.isUndefined(state.columns) || _.isNull(state.columns) || state.columns.length < 1)) {
|
&& (_.isUndefined(state.columns) || _.isNull(state.columns) || state.columns.length < 1)) {
|
||||||
setError('columns', gettext('Please specify columns for %s.', gettext('Primary key')));
|
setError('columns', gettext('Please specify columns for %s.', gettext('Primary key')));
|
||||||
|
@ -452,6 +452,14 @@ export default class IndexSchema extends BaseUISchema {
|
|||||||
validate(state, setError) {
|
validate(state, setError) {
|
||||||
let msg;
|
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
|
// Checks if columns is empty
|
||||||
let cols = state.columns;
|
let cols = state.columns;
|
||||||
if(_.isArray(cols) && cols.length == 0){
|
if(_.isArray(cols) && cols.length == 0){
|
||||||
|
Loading…
Reference in New Issue
Block a user