mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-10 23:45:58 -06:00
Fixed an issue where Tablespace location shows error "Location cannot be empty".
This commit is contained in:
parent
1d4e7e2642
commit
ffcf7ccbf9
@ -10,6 +10,7 @@
|
|||||||
import gettext from 'sources/gettext';
|
import gettext from 'sources/gettext';
|
||||||
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
||||||
import SecLabelSchema from '../../../static/js/sec_label.ui';
|
import SecLabelSchema from '../../../static/js/sec_label.ui';
|
||||||
|
import { isEmptyString } from '../../../../../../static/js/validators';
|
||||||
|
|
||||||
export default class TablespaceSchema extends BaseUISchema {
|
export default class TablespaceSchema extends BaseUISchema {
|
||||||
constructor(getVariableSchema, getPrivilegeRoleSchema, fieldOptions={}, initValues={}) {
|
constructor(getVariableSchema, getPrivilegeRoleSchema, fieldOptions={}, initValues={}) {
|
||||||
@ -61,7 +62,6 @@ export default class TablespaceSchema extends BaseUISchema {
|
|||||||
group: gettext('Definition'), type: 'text',
|
group: gettext('Definition'), type: 'text',
|
||||||
mode: ['properties', 'edit','create'],
|
mode: ['properties', 'edit','create'],
|
||||||
readonly: function(state) {return !obj.isNew(state); },
|
readonly: function(state) {return !obj.isNew(state); },
|
||||||
noEmpty: true,
|
|
||||||
}, {
|
}, {
|
||||||
id: 'acl', label: gettext('Privileges'), type: 'text',
|
id: 'acl', label: gettext('Privileges'), type: 'text',
|
||||||
group: gettext('Security'), mode: ['properties'],
|
group: gettext('Security'), mode: ['properties'],
|
||||||
@ -88,4 +88,15 @@ export default class TablespaceSchema extends BaseUISchema {
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
validate(state, setError) {
|
||||||
|
let errmsg = null;
|
||||||
|
|
||||||
|
if (this.isNew() && isEmptyString(state.spclocation)) {
|
||||||
|
errmsg = gettext('\'Location\' cannot be empty.');
|
||||||
|
setError('spclocation', errmsg);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user