diff --git a/src/client/src/pages/detail/form/stratigraphy/hierarchicalDataEditProfile.jsx b/src/client/src/pages/detail/form/stratigraphy/hierarchicalDataEditProfile.jsx index 17c0a669b..7e405da1a 100644 --- a/src/client/src/pages/detail/form/stratigraphy/hierarchicalDataEditProfile.jsx +++ b/src/client/src/pages/detail/form/stratigraphy/hierarchicalDataEditProfile.jsx @@ -58,7 +58,7 @@ const HierarchicalDataEditProfile = ({ (accu[level] = accu[level] || []).push({ label: d[i18n.language], id: d.id, - color: JSON.parse(d.conf ?? null)?.color, + color: (d.conf ?? null)?.color, path: path, }); return accu; diff --git a/src/client/src/pages/detail/form/stratigraphy/lithology/lithologyLayers/lithologyLayersList/lithologyLayersList.jsx b/src/client/src/pages/detail/form/stratigraphy/lithology/lithologyLayers/lithologyLayersList/lithologyLayersList.jsx index b0c46dcbc..01975cf11 100644 --- a/src/client/src/pages/detail/form/stratigraphy/lithology/lithologyLayers/lithologyLayersList/lithologyLayersList.jsx +++ b/src/client/src/pages/detail/form/stratigraphy/lithology/lithologyLayers/lithologyLayersList/lithologyLayersList.jsx @@ -26,9 +26,7 @@ const LithologyLayersList = props => { const middle = (item?.fromDepth + item?.toDepth) / 2; return x.fromDepth <= middle && middle <= x.toDepth; }); - setLithostratiColor( - JSON.parse(correspondingLithostrati?.lithostratigraphy?.conf ?? null)?.color ?? [255, 255, 255], - ); + setLithostratiColor((correspondingLithostrati?.lithostratigraphy?.conf ?? null)?.color ?? [255, 255, 255]); } else { setLithostratiColor([255, 255, 255]); } diff --git a/src/client/src/pages/detail/form/stratigraphy/lithologyViewProfile.jsx b/src/client/src/pages/detail/form/stratigraphy/lithologyViewProfile.jsx index fa1ff03d7..67ab155a0 100644 --- a/src/client/src/pages/detail/form/stratigraphy/lithologyViewProfile.jsx +++ b/src/client/src/pages/detail/form/stratigraphy/lithologyViewProfile.jsx @@ -4,7 +4,7 @@ import { Box, LinearProgress } from "@mui/material"; import { useLayers } from "../../../../api/fetchApiV2.js"; import { theme } from "../../../../AppTheme.ts"; -const handlePattern = layer => `url(/img/lit/${JSON.parse(layer?.lithology?.conf ?? null)?.image})`; +const handlePattern = layer => `url(/img/lit/${(layer?.lithology?.conf ?? null)?.image})`; /** * Displays the lithology layers. diff --git a/src/client/src/pages/detail/form/stratigraphy/lithostratigraphy/lithostratigraphyViewProfile.jsx b/src/client/src/pages/detail/form/stratigraphy/lithostratigraphy/lithostratigraphyViewProfile.jsx index edf46aa5d..a5ebffca6 100644 --- a/src/client/src/pages/detail/form/stratigraphy/lithostratigraphy/lithostratigraphyViewProfile.jsx +++ b/src/client/src/pages/detail/form/stratigraphy/lithostratigraphy/lithostratigraphyViewProfile.jsx @@ -2,8 +2,7 @@ import { useEffect } from "react"; import { Box, LinearProgress } from "@mui/material"; import { useLithostratigraphies } from "../../../../../api/fetchApiV2.js"; -const handleColor = layer => - `rgb(${(JSON.parse(layer?.lithostratigraphy?.conf ?? null)?.color ?? [255, 255, 255]).join()})`; +const handleColor = layer => `rgb(${((layer?.lithostratigraphy?.conf ?? null)?.color ?? [255, 255, 255]).join()})`; /** * Displays the lithostratigraphy layers. diff --git a/src/client/src/pages/settings/components/editorSettingList/editorSettingList.jsx b/src/client/src/pages/settings/components/editorSettingList/editorSettingList.jsx index 639a2228f..aa78171ff 100644 --- a/src/client/src/pages/settings/components/editorSettingList/editorSettingList.jsx +++ b/src/client/src/pages/settings/components/editorSettingList/editorSettingList.jsx @@ -15,7 +15,7 @@ const EditorSettingList = props => { const isVisible = field => { const layerKindConfigEntry = codes?.find(c => c.schema === "layer_kind"); - const conf = layerKindConfigEntry?.conf ? JSON.parse(layerKindConfigEntry?.conf) : ""; + const conf = layerKindConfigEntry?.conf ? layerKindConfigEntry?.conf : ""; return conf?.fields?.[field] ?? false; }; return listName === "lithologyfields"