updateRuleParamsSection function

Last updated: 2026-03-04T23:21:38.433Z

Metrics

LOC: 32 Complexity: 10 Params: 1

Signature

updateRuleParamsSection(existingParams?: GeneratorParams): : void

Source Code

function updateRuleParamsSection(existingParams?: GeneratorParams): void {
  const container = document.getElementById("rule-params-container");
  const fieldsDiv = document.getElementById("rule-params-fields");
  if (!container || !fieldsDiv) return;

  const generatorValue = ruleGeneratorSelect?.getValue() ?? "";

  if (
    !generatorValue ||
    generatorValue === "auto" ||
    generatorValue === "ai" ||
    generatorValue === "tensorflow"
  ) {
    container.style.display = "none";
    fieldsDiv.innerHTML = "";
    return;
  }

  const generatorKey = getGeneratorKey(generatorValue as FieldType);
  const paramDefs = generatorKey ? getGeneratorParamDefs(generatorKey) : [];

  if (paramDefs.length === 0) {
    container.style.display = "none";
    fieldsDiv.innerHTML = "";
    return;
  }

  fieldsDiv.innerHTML = paramDefs
    .map((def) => renderOptionParamField(def, existingParams))
    .join("");
  container.style.display = "block";
}

Dependencies (Outgoing)

graph LR updateRuleParamsSection["updateRuleParamsSection"] renderOptionParamField["renderOptionParamField"] updateRuleParamsSection -->|calls| renderOptionParamField style updateRuleParamsSection fill:#dbeafe,stroke:#2563eb,stroke-width:2px click updateRuleParamsSection "40c364fb8f9a0ec0.html" click renderOptionParamField "ddea4212bc84e23a.html"
TargetType
renderOptionParamField calls

Impact (Incoming)

graph LR updateRuleParamsSection["updateRuleParamsSection"] editRule["editRule"] cancelEditRule["cancelEditRule"] bindRulesEvents["bindRulesEvents"] editRule -->|calls| updateRuleParamsSection cancelEditRule -->|calls| updateRuleParamsSection bindRulesEvents -->|calls| updateRuleParamsSection style updateRuleParamsSection fill:#dbeafe,stroke:#2563eb,stroke-width:2px click updateRuleParamsSection "40c364fb8f9a0ec0.html" click editRule "238046fb2c80772c.html" click cancelEditRule "fd39c6ea074f2721.html" click bindRulesEvents "3107cd11f10b1501.html"
SourceType
editRule calls
cancelEditRule calls
bindRulesEvents calls