Merge branch 'main' into feature/sodistoregrid-live-view
This commit is contained in:
commit
2e137cf550
|
|
@ -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<string[]>([]);
|
||||
const [loadingProviders, setLoadingProviders] = useState(false);
|
||||
const [installationDate, setInstallationDate] = useState<string>('');
|
||||
const [installationDateChecklistId, setInstallationDateChecklistId] = useState<number | null>(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={<FormattedMessage id="installationDate" defaultMessage="Installation Date" />}
|
||||
type="date"
|
||||
value={installationDate}
|
||||
onChange={(e) => setInstallationDate(e.target.value)}
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
InputLabelProps={{ shrink: true }}
|
||||
inputProps={{ readOnly: true }}
|
||||
inputProps={{ readOnly: !canEdit }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -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 = (
|
||||
|
|
|
|||
Loading…
Reference in New Issue