diff --git a/csharp/App/Backend/DataTypes/Installation.cs b/csharp/App/Backend/DataTypes/Installation.cs index a5af9b9e0..19e174222 100644 --- a/csharp/App/Backend/DataTypes/Installation.cs +++ b/csharp/App/Backend/DataTypes/Installation.cs @@ -41,6 +41,7 @@ public class Installation : TreeNode public int Status { get; set; } = -1; public int Product { get; set; } = (int)ProductType.Salimax; public int Device { get; set; } = 0; + public string SerialNumber { get; set; } = ""; [Ignore] public String OrderNumbers { get; set; } diff --git a/typescript/frontend-marios2/src/content/dashboards/SalidomoInstallations/FlatInstallationView.tsx b/typescript/frontend-marios2/src/content/dashboards/SalidomoInstallations/FlatInstallationView.tsx index cf43e6912..84ac01509 100644 --- a/typescript/frontend-marios2/src/content/dashboards/SalidomoInstallations/FlatInstallationView.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/SalidomoInstallations/FlatInstallationView.tsx @@ -130,11 +130,11 @@ const FlatInstallationView = (props: FlatInstallationViewProps) => { {sortedInstallations - .filter( - (installation) => - installation.status === -1 && - installation.testingMode == false - ) + // .filter( + // (installation) => + // installation.status === -1 && + // installation.testingMode == false + // ) .map((installation) => { const isInstallationSelected = installation.s3BucketId === selectedInstallation; diff --git a/typescript/frontend-marios2/src/content/dashboards/Tree/Information.tsx b/typescript/frontend-marios2/src/content/dashboards/Tree/Information.tsx index c33c456b2..5252c147e 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Tree/Information.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Tree/Information.tsx @@ -122,11 +122,13 @@ function TreeInformation(props: TreeInformationProps) { const handleFolderFormSubmit = () => { setOpenModalFolder(false); setOpenModalInstallation(false); + setLoading(false); }; const handleInstallationFormSubmit = () => { setOpenModalFolder(false); setOpenModalInstallation(false); + setLoading(false); }; const handleFormCancel = () => { diff --git a/typescript/frontend-marios2/src/contexts/InstallationsContextProvider.tsx b/typescript/frontend-marios2/src/contexts/InstallationsContextProvider.tsx index 331454664..e52bae21d 100644 --- a/typescript/frontend-marios2/src/contexts/InstallationsContextProvider.tsx +++ b/typescript/frontend-marios2/src/contexts/InstallationsContextProvider.tsx @@ -82,10 +82,10 @@ const InstallationsContextProvider = ({ const update = pendingUpdates.current[installation.id]; return update ? { - ...installation, - status: update.status, - testingMode: update.testingMode - } + ...installation, + status: update.status, + testingMode: update.testingMode + } : installation; }); @@ -95,7 +95,7 @@ const InstallationsContextProvider = ({ // Clear the pending updates after applying pendingUpdates.current = {}; - }, [salidomoInstallations, salimaxInstallations,sodiohomeInstallations]); + }, [salidomoInstallations, salimaxInstallations, sodiohomeInstallations]); useEffect(() => { const timer = setInterval(() => { @@ -109,7 +109,7 @@ const InstallationsContextProvider = ({ setcurrentProduct(product); const tokenString = localStorage.getItem('token'); const token = tokenString !== null ? tokenString : ''; - const urlWithToken = `wss://monitor.innov.energy/api/CreateWebSocket?authToken=${token}`; + const urlWithToken = `wss://stage.innov.energy/api/CreateWebSocket?authToken=${token}`; const socket = new WebSocket(urlWithToken); @@ -126,7 +126,9 @@ const InstallationsContextProvider = ({ // Send the corresponding installation IDs socket.send( - JSON.stringify(installationsToSend.map((installation) => installation.id)) + JSON.stringify( + installationsToSend.map((installation) => installation.id) + ) ); }); @@ -199,7 +201,7 @@ const InstallationsContextProvider = ({ const fetchAllSodiohomeInstallations = useCallback(async () => { axiosConfig - .get('/GetAllSodiohomeInstallations') + .get('/GetAllSodioHomeInstallations') .then((res: AxiosResponse) => setSodiohomeInstallations(res.data) ) @@ -230,7 +232,10 @@ const InstallationsContextProvider = ({ async (formValues: Partial) => { axiosConfig .post('/CreateInstallation', formValues) - .then(() => fetchAllFoldersAndInstallations(formValues.product)) + .then(() => { + setLoading(false); + fetchAllFoldersAndInstallations(formValues.product); + }) .catch((error) => { setError(true); if (error.response?.status === 401) { @@ -330,8 +335,10 @@ const InstallationsContextProvider = ({ .put('/UpdateFolder', formValues) .then(() => { setUpdated(true); + fetchAllFoldersAndInstallations(product); setTimeout(() => setUpdated(false), 3000); + setLoading(false); }) .catch((error) => { setError(true);