1) Ensure the edit dialog should not allow clearing owner in the Language node. Fixes #6815

2) Fixed an issue where the Language node is disabled for the functions for
   EPAS/PG 9.6 and 10. Fixes #6823
This commit is contained in:
Pradip Parkale 2021-09-29 13:40:10 +05:30 committed by Akshay Joshi
parent 77d0409c5b
commit d753719891
2 changed files with 10 additions and 6 deletions

View File

@ -72,10 +72,12 @@ export default class LanguageSchema extends BaseUISchema {
creatable: true,
filter: (options) => {
let res = [];
if (state) {
if (state && obj.isNew()) {
options.forEach((option) => {
res.push({label: option.tmplname, value: option.tmplname});
});
}else{
res.push({label: state.name, value: state.name});
}
return res;
}
@ -91,7 +93,7 @@ export default class LanguageSchema extends BaseUISchema {
type: 'text',
},{
id: 'lanowner', label: gettext('Owner'), type: 'select',
options: this.fieldOptions.role,
options: this.fieldOptions.role, controlProps: { allowClear: false },
mode: ['edit', 'properties', 'create'],
},{
id: 'acl', label: gettext('Privileges'), type: 'text',
@ -167,7 +169,7 @@ export default class LanguageSchema extends BaseUISchema {
readonly: (state) => {return !obj.isNew(state);},
},
{
id: 'laninl', label: gettext('Handler function'),
id: 'laninl', label: gettext('Inline function'),
group: gettext('Definition'), mode: ['properties'], type: 'text',
},{
id: 'lanval', label: gettext('Validator function'), deps:['name'],
@ -201,7 +203,7 @@ export default class LanguageSchema extends BaseUISchema {
readonly: (state) => {return !obj.isNew(state);},
},
{
id: 'lanval', label: gettext('Handler function'),
id: 'lanval', label: gettext('Validator function'),
group: gettext('Definition'), mode: ['properties'], type: 'text',
},
{

View File

@ -254,11 +254,13 @@ export default class FunctionSchema extends BaseUISchema {
id: 'lanname', label: gettext('Language'), cell: 'string',
options: this.fieldOptions.getLanguage, type: 'select', group: gettext('Definition'),
disabled: function() {
if(this.type === 'procedure'){
return this.node_info['node_info'].server.version < 110000;
}
if (this.node_info && 'catalog' in this.node_info) {
return true;
}
return this.node_info['node_info'].server.version < 110000;
return false;
}
},
{