mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-07-29 23:58:09 -05:00
Fixes #1110 - Proper validation for the security labels.
This commit is contained in:
committed by
Ashesh Vashi
parent
e3ab4501d5
commit
9ed2530b1f
+6
-7
@@ -95,7 +95,8 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
}
|
||||
},{
|
||||
id: 'spcuser', label:'{{ _('Owner') }}', cell: 'string',
|
||||
type: 'text', control: 'node-list-by-name', node: 'role'
|
||||
type: 'text', control: 'node-list-by-name', node: 'role',
|
||||
select2: {allowClear: false}
|
||||
},{
|
||||
id: 'acl', label: '{{ _('Privileges') }}', type: 'text',
|
||||
group: '{{ _('Security') }}', mode: ['properties'], disabled: true
|
||||
@@ -128,14 +129,12 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
errmsg = null,
|
||||
changedAttrs = this.sessAttrs,
|
||||
msg = undefined;
|
||||
if (_.has(changedAttrs, 'name') &&
|
||||
(_.isUndefined(this.get('name'))
|
||||
|| String(this.get('name')).replace(/^\s+|\s+$/g, '') == '')) {
|
||||
if (_.isUndefined(this.get('name'))
|
||||
|| String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
msg = '{{ _('Name cannot be empty.') }}';
|
||||
this.errorModel.set('name', msg);
|
||||
} else if (_.has(changedAttrs, 'spclocation') &&
|
||||
(_.isUndefined(this.get('spclocation'))
|
||||
|| String(this.get('spclocation')).replace(/^\s+|\s+$/g, '') == '')) {
|
||||
} else if (_.isUndefined(this.get('spclocation'))
|
||||
|| String(this.get('spclocation')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
msg = '{{ _('Location cannot be empty.') }}';
|
||||
this.errorModel.set('spclocation', msg);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user