mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
1) Make default values column read-only for inherited columns when creating table.
2) Default values not populated for inherited columns. The existing issue, API changed. 3) Options are not populated for Name in Column > Variable tab. 4) The empty check error message is changed from Label cannot be empty to Label in Collection cannot be empty for collections. Fixes #6763
This commit is contained in:
committed by
Akshay Joshi
parent
b60bd73f88
commit
08009f8edc
@@ -233,7 +233,7 @@ function getChangedData(topSchema, viewHelperProps, sessData, stringify=false) {
|
||||
return changedData;
|
||||
}
|
||||
|
||||
function validateSchema(schema, sessData, setError, accessPath=[]) {
|
||||
function validateSchema(schema, sessData, setError, accessPath=[], collLabel=null) {
|
||||
sessData = sessData || {};
|
||||
for(let field of schema.fields) {
|
||||
/* Skip id validation */
|
||||
@@ -261,7 +261,7 @@ function validateSchema(schema, sessData, setError, accessPath=[]) {
|
||||
}
|
||||
/* Loop through data */
|
||||
for(const [rownum, row] of rows.entries()) {
|
||||
if(validateSchema(field.schema, row, setError, currPath.concat(rownum))) {
|
||||
if(validateSchema(field.schema, row, setError, currPath.concat(rownum), field.label)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -276,7 +276,14 @@ function validateSchema(schema, sessData, setError, accessPath=[]) {
|
||||
let value = sessData[field.id];
|
||||
let message = null;
|
||||
if(field.noEmpty) {
|
||||
message = emptyValidator(field.label, value);
|
||||
let label = field.label;
|
||||
if(collLabel) {
|
||||
label = gettext('%s in %s', field.label, collLabel);
|
||||
}
|
||||
if(field.noEmptyLabel) {
|
||||
label = field.noEmptyLabel;
|
||||
}
|
||||
message = emptyValidator(label, value);
|
||||
}
|
||||
if(!message && (field.type == 'int' || field.type == 'numeric')) {
|
||||
message = minMaxValidator(field.label, value, field.min, field.max);
|
||||
|
||||
Reference in New Issue
Block a user