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 = () => {
|
const handleSubmit = () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
setError(false);
|
setError(false);
|
||||||
|
if (canEdit && installationDateChecklistId !== null) {
|
||||||
|
axiosConfig
|
||||||
|
.put('/UpdateChecklistItem', null, {
|
||||||
|
params: {
|
||||||
|
checklistItemId: installationDateChecklistId,
|
||||||
|
doneAt: installationDate ?? ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
}
|
||||||
updateInstallation(formValues, props.type);
|
updateInstallation(formValues, props.type);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -405,6 +415,7 @@ function InformationSodistorehome(props: InformationSodistorehomeProps) {
|
||||||
const [networkProviders, setNetworkProviders] = useState<string[]>([]);
|
const [networkProviders, setNetworkProviders] = useState<string[]>([]);
|
||||||
const [loadingProviders, setLoadingProviders] = useState(false);
|
const [loadingProviders, setLoadingProviders] = useState(false);
|
||||||
const [installationDate, setInstallationDate] = useState<string>('');
|
const [installationDate, setInstallationDate] = useState<string>('');
|
||||||
|
const [installationDateChecklistId, setInstallationDateChecklistId] = useState<number | null>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setLoadingProviders(true);
|
setLoadingProviders(true);
|
||||||
|
|
@ -427,9 +438,13 @@ function InformationSodistorehome(props: InformationSodistorehomeProps) {
|
||||||
(i: { stepNumber?: number }) => i.stepNumber === 10
|
(i: { stepNumber?: number }) => i.stepNumber === 10
|
||||||
);
|
);
|
||||||
setInstallationDate(step10?.doneAt ?? '');
|
setInstallationDate(step10?.doneAt ?? '');
|
||||||
|
setInstallationDateChecklistId(step10?.id ?? null);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => setInstallationDate(''));
|
.catch(() => {
|
||||||
|
setInstallationDate('');
|
||||||
|
setInstallationDateChecklistId(null);
|
||||||
|
});
|
||||||
}, [props.values.id]);
|
}, [props.values.id]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -879,10 +894,11 @@ function InformationSodistorehome(props: InformationSodistorehomeProps) {
|
||||||
label={<FormattedMessage id="installationDate" defaultMessage="Installation Date" />}
|
label={<FormattedMessage id="installationDate" defaultMessage="Installation Date" />}
|
||||||
type="date"
|
type="date"
|
||||||
value={installationDate}
|
value={installationDate}
|
||||||
|
onChange={(e) => setInstallationDate(e.target.value)}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
fullWidth
|
fullWidth
|
||||||
InputLabelProps={{ shrink: true }}
|
InputLabelProps={{ shrink: true }}
|
||||||
inputProps={{ readOnly: true }}
|
inputProps={{ readOnly: !canEdit }}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -592,6 +592,8 @@ function SodistoreHomeConfigurationV2(props: SodistoreHomeConfigurationProps) {
|
||||||
{clusters.map((_slotCount, clIdx) => {
|
{clusters.map((_slotCount, clIdx) => {
|
||||||
const clKey = `Cluster${clIdx + 1}`;
|
const clKey = `Cluster${clIdx + 1}`;
|
||||||
const cluster = formValues.devices?.[invKey]?.Clusters?.[clKey];
|
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 charge = cluster?.MaxChargingCurrent ?? '';
|
||||||
const discharge = cluster?.MaxDischargingCurrent ?? '';
|
const discharge = cluster?.MaxDischargingCurrent ?? '';
|
||||||
const setClusterField = (
|
const setClusterField = (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue