diff --git a/client/components/curves_settings_popup/curves_settings_popup.js b/client/components/curves_settings_popup/curves_settings_popup.js index bddf901..4d3e475 100644 --- a/client/components/curves_settings_popup/curves_settings_popup.js +++ b/client/components/curves_settings_popup/curves_settings_popup.js @@ -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]; }