Added * category by default curves settings

This commit is contained in:
l_samenv
2024-09-05 13:30:14 +02:00
parent fba16774e4
commit 96818324e8

View File

@ -48,9 +48,24 @@ class CurvesSettingsPopup extends HTMLElement{
let configurationLineObject = this.getRowValues(row);
let formmatedLineConfiguration = {...configurationLineObject};
if(!formmatedLineConfiguration.hasOwnProperty("variable") && Object.keys(formmatedLineConfiguration).length > 0){
alertify.error("Variable not defined for some row(s).");
throw Error;
if(!formmatedLineConfiguration.hasOwnProperty("variable")){
let definedFields = Object.keys(formmatedLineConfiguration).length;
if(formmatedLineConfiguration.hasOwnProperty("cat")){
if(formmatedLineConfiguration["cat"] === "*"){
if (definedFields >= 2){
alertify.error("Variable not defined for some row(s).");
throw Error;
}
}else{
alertify.error("Variable not defined for some row(s).");
throw Error;
}
}else{
if (definedFields > 0){
alertify.error("Variable not defined for some row(s).");
throw Error;
}
}
}else{
let key = formmatedLineConfiguration["variable"];
delete formmatedLineConfiguration["variable"];
@ -200,6 +215,9 @@ class CurvesSettingsPopup extends HTMLElement{
input.name = type;
input.classList.add("text-input");
input.value = "";
if (type == "cat"){
input.value = "*";
}
if(lineConfiguration != null && lineConfiguration.hasOwnProperty(type)){
input.value = lineConfiguration[type];
}