Commit f42fb410 authored by Jorge Moratinos's avatar Jorge Moratinos
Browse files

fixed some linter errors

parent 0809943a
Loading
Loading
Loading
Loading
(6 KiB)

File changed.

No diff preview for this file type.

+13 −6
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ const ConfigCapif = () => {
        current = current[keys[i]];
      }
      current[keys[keys.length - 1]] = value;

      return { ...newConfig };
    });
  };
@@ -119,6 +120,7 @@ const ConfigCapif = () => {
  const handleJsonSubmit = () => {
    if (jsonError) {
      alert(`Invalid JSON: ${jsonError}`);

      return;
    }
  
@@ -164,6 +166,7 @@ const ConfigCapif = () => {
          if (nestedError) return nestedError;
        }
      }

      return null;
    };
  
@@ -174,10 +177,6 @@ const ConfigCapif = () => {
    return null; //  No hay errores
  };


  if (isLoading) return <Typography>Loading...</Typography>;
  if (isError) return <Typography>Error loading configuration</Typography>;

  const formatTitle = (text) => {
    return text
      .split(" ")
@@ -213,6 +212,7 @@ const ConfigCapif = () => {
  const handleAddConfig = () => {
    if (!newParamName || newParamValue === undefined) {
      alert("Debe ingresar un nombre y un valor para la configuración.");

      return;
    }

@@ -222,6 +222,7 @@ const ConfigCapif = () => {


  const handleOpenSectionDialog = () => setOpenSectionDialog(true);

  const handleCloseSectionDialog = () => {
    setOpenSectionDialog(false);
    setNewSectionName('');
@@ -231,11 +232,13 @@ const ConfigCapif = () => {
  const handleAddSection = () => {
    if (!newSectionName.trim() || newSectionParams.some(p => !p.key.trim())) {
      alert("Debes ingresar un nombre para la sección y al menos un parámetro.");

      return;
    }

    const categoryValues = newSectionParams.reduce((acc, param) => {
      acc[param.key] = param.value;

      return acc;
    }, {});

@@ -246,6 +249,7 @@ const ConfigCapif = () => {
    setNewSectionParams(prevParams => {
      const updatedParams = [...prevParams];
      updatedParams[index][field] = value;

      return updatedParams;
    });
  };
@@ -269,12 +273,14 @@ const ConfigCapif = () => {
    if (words.length === 0) return text;
    
    words[0] = words[0].charAt(0).toUpperCase() + words[0].slice(1).toLowerCase();

    return words.join(" ");
  };

  const handleDownloadJson = () => {
    if (!editableConfig) {
      alert("There is no configuration available for download.");

      return;
    }
  
@@ -346,7 +352,8 @@ const ConfigCapif = () => {
    reader.readAsText(file);
  };

  
  if (isLoading) return <Typography>Loading...</Typography>;
  if (isError) return <Typography>Error loading configuration</Typography>;

  return (
    <Grid container spacing={3} marginTop={2}>
+12 −3
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ const ConfigRegister = () => {
        current = current[keys[i]];
      }
      current[keys[keys.length - 1]] = value;

      return { ...newConfig };
    });
  };
@@ -112,6 +113,7 @@ const ConfigRegister = () => {
  const handleJsonSubmit = () => {
    if (jsonError) {
      alert(`Invalid JSON: ${jsonError}`);

      return;
    }
  
@@ -157,6 +159,7 @@ const ConfigRegister = () => {
          if (nestedError) return nestedError;
        }
      }

      return null;
    };
  
@@ -167,9 +170,6 @@ const ConfigRegister = () => {
    return null; //  No hay errores
  };

  if (isLoading) return <Typography>Loading...</Typography>;
  if (isError) return <Typography>Error loading configuration</Typography>;

  const formatTitle = (text) => {
    return text
      .split(" ")
@@ -205,6 +205,7 @@ const ConfigRegister = () => {
  const handleAddConfig = () => {
    if (!newParamName || newParamValue === undefined) {
      alert("Debe ingresar un nombre y un valor para la configuración.");

      return;
    }

@@ -214,6 +215,7 @@ const ConfigRegister = () => {


  const handleOpenSectionDialog = () => setOpenSectionDialog(true);

  const handleCloseSectionDialog = () => {
    setOpenSectionDialog(false);
    setNewSectionName('');
@@ -223,11 +225,13 @@ const ConfigRegister = () => {
  const handleAddSection = () => {
    if (!newSectionName.trim() || newSectionParams.some(p => !p.key.trim())) {
      alert("Debes ingresar un nombre para la sección y al menos un parámetro.");

      return;
    }

    const categoryValues = newSectionParams.reduce((acc, param) => {
      acc[param.key] = param.value;

      return acc;
    }, {});

@@ -238,6 +242,7 @@ const ConfigRegister = () => {
    setNewSectionParams(prevParams => {
      const updatedParams = [...prevParams];
      updatedParams[index][field] = value;

      return updatedParams;
    });
  };
@@ -261,12 +266,14 @@ const ConfigRegister = () => {
    if (words.length === 0) return text;
    
    words[0] = words[0].charAt(0).toUpperCase() + words[0].slice(1).toLowerCase();

    return words.join(" ");
  };

  const handleDownloadJson = () => {
    if (!editableConfig) {
      alert("There is no configuration available for download.");

      return;
    }
  
@@ -340,6 +347,8 @@ const ConfigRegister = () => {
    reader.readAsText(file);
  };
  
  if (isLoading) return <Typography>Loading...</Typography>;
  if (isError) return <Typography>Error loading configuration</Typography>;

  return (
    <Grid container spacing={3} marginTop={2}>
+5 −0
Original line number Diff line number Diff line
const ConfigurationById = () => {
  return <div>Configuration Detail</div>
}

export default ConfigurationById
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ const Configuration = () => {
        current = current[keys[i]];
      }
      current[keys[keys.length - 1]] = value;
      
      return { ...newConfig };
    });
  };
Loading