diff --git a/typescript/frontend-marios2/src/content/dashboards/Information/InformationSodistoreHome.tsx b/typescript/frontend-marios2/src/content/dashboards/Information/InformationSodistoreHome.tsx index bdc1adc37..bd308f3ea 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Information/InformationSodistoreHome.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Information/InformationSodistoreHome.tsx @@ -366,6 +366,16 @@ function InformationSodistorehome(props: InformationSodistorehomeProps) { const handleSubmit = () => { setLoading(true); setError(false); + if (canEdit && installationDateChecklistId !== null) { + axiosConfig + .put('/UpdateChecklistItem', null, { + params: { + checklistItemId: installationDateChecklistId, + doneAt: installationDate ?? '' + } + }) + .catch(() => {}); + } updateInstallation(formValues, props.type); }; @@ -405,6 +415,7 @@ function InformationSodistorehome(props: InformationSodistorehomeProps) { const [networkProviders, setNetworkProviders] = useState([]); const [loadingProviders, setLoadingProviders] = useState(false); const [installationDate, setInstallationDate] = useState(''); + const [installationDateChecklistId, setInstallationDateChecklistId] = useState(null); useEffect(() => { setLoadingProviders(true); @@ -427,9 +438,13 @@ function InformationSodistorehome(props: InformationSodistorehomeProps) { (i: { stepNumber?: number }) => i.stepNumber === 10 ); setInstallationDate(step10?.doneAt ?? ''); + setInstallationDateChecklistId(step10?.id ?? null); } }) - .catch(() => setInstallationDate('')); + .catch(() => { + setInstallationDate(''); + setInstallationDateChecklistId(null); + }); }, [props.values.id]); return ( @@ -879,10 +894,11 @@ function InformationSodistorehome(props: InformationSodistorehomeProps) { label={} type="date" value={installationDate} + onChange={(e) => setInstallationDate(e.target.value)} variant="outlined" fullWidth InputLabelProps={{ shrink: true }} - inputProps={{ readOnly: true }} + inputProps={{ readOnly: !canEdit }} /> diff --git a/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/SodistoreHomeConfigurationV2.tsx b/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/SodistoreHomeConfigurationV2.tsx index 15034c339..c66553337 100644 --- a/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/SodistoreHomeConfigurationV2.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/SodistoreHomeConfigurationV2.tsx @@ -592,6 +592,8 @@ function SodistoreHomeConfigurationV2(props: SodistoreHomeConfigurationProps) { {clusters.map((_slotCount, clIdx) => { const clKey = `Cluster${clIdx + 1}`; const cluster = formValues.devices?.[invKey]?.Clusters?.[clKey]; + // Hide clusters with no installed batteries — Information tab is source of truth. + if (cluster?.BatteryCount === 0) return null; const charge = cluster?.MaxChargingCurrent ?? ''; const discharge = cluster?.MaxDischargingCurrent ?? ''; const setClusterField = (