From 107028cc0dbb6785ac4604dd3130bbb276b4901c Mon Sep 17 00:00:00 2001 From: Nicholas Dalhaug Date: Tue, 28 Jul 2026 08:34:52 +0200 Subject: [PATCH 1/4] Change asset selection to show when loading --- frontend/src/pages/AssetSelectionPage.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/AssetSelectionPage.tsx b/frontend/src/pages/AssetSelectionPage.tsx index b1e548c54..70a75e746 100644 --- a/frontend/src/pages/AssetSelectionPage.tsx +++ b/frontend/src/pages/AssetSelectionPage.tsx @@ -1,5 +1,5 @@ import { useEffect, useState } from 'react' -import { Autocomplete, Button, CircularProgress } from '@equinor/eds-core-react' +import { Autocomplete, Button, CircularProgress, Typography } from '@equinor/eds-core-react' import styled from 'styled-components' import { useLanguageContext } from 'components/Contexts/LanguageContext' import { Header } from 'components/Header/Header' @@ -51,15 +51,18 @@ const InstallationPicker = () => { const [selectedInstallation, setSelectedInstallation] = useState(undefined) const [installations, setInstallations] = useState(undefined) + const [isLoadingInstallations, setIsLoadingInstallations] = useState(true) useEffect(() => { backendApi .getInstallations() .then((installations) => { setInstallations(installations) + setIsLoadingInstallations(false) }) .catch(() => { console.error(`Failed to retrieve list of installations`) + setIsLoadingInstallations(false) }) }, []) @@ -67,12 +70,18 @@ const InstallationPicker = () => { navigate(selectedInstallation!.installationCode) } - if (installations === undefined) { + if (isLoadingInstallations) { return ( <> ) + } else if (!installations) { + return ( + <> + Not able to load installations. + + ) } return ( From 297ba4e9a1d6d1c7548b163ed0d650478c732dca Mon Sep 17 00:00:00 2001 From: Nicholas Dalhaug Date: Tue, 28 Jul 2026 08:38:01 +0200 Subject: [PATCH 2/4] Add variable to dependency array --- frontend/src/pages/AssetSelectionPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/AssetSelectionPage.tsx b/frontend/src/pages/AssetSelectionPage.tsx index 70a75e746..61136d85d 100644 --- a/frontend/src/pages/AssetSelectionPage.tsx +++ b/frontend/src/pages/AssetSelectionPage.tsx @@ -64,7 +64,7 @@ const InstallationPicker = () => { console.error(`Failed to retrieve list of installations`) setIsLoadingInstallations(false) }) - }, []) + }, [backendApi]) const handleClick = () => { navigate(selectedInstallation!.installationCode) From 2e0938e6916ec845187e767f170af6fb110a98ee Mon Sep 17 00:00:00 2001 From: Nicholas Dalhaug Date: Thu, 30 Jul 2026 15:05:38 +0200 Subject: [PATCH 3/4] Make SignalR only log critical errors --- frontend/src/components/Contexts/SignalRContext.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/Contexts/SignalRContext.tsx b/frontend/src/components/Contexts/SignalRContext.tsx index 3e432f750..98a16f3d6 100644 --- a/frontend/src/components/Contexts/SignalRContext.tsx +++ b/frontend/src/components/Contexts/SignalRContext.tsx @@ -77,7 +77,7 @@ export const SignalRProvider: FC = ({ children }) => { signalR.HttpTransportType.LongPolling, }) .withAutomaticReconnect() - .configureLogging(signalR.LogLevel.Error) + .configureLogging(signalR.LogLevel.Critical) .build() newConnection.onclose((error) => { @@ -113,15 +113,19 @@ export const SignalRProvider: FC = ({ children }) => { setConnectionReady(true) }) .catch((error) => { - console.error('SignalR connection failed:', error) - setConnectionReady(false) + if (error instanceof Error && error.constructor?.name === 'AbortError') { + // Aborting a connection is expected when the user navigates away or the react dev remounts. + setConnectionReady(false) + } else { + console.error('SignalR connection failed:', error) + setConnectionReady(false) + } }) return newConnection } useEffect(() => { if (!accounts[0] || inProgress !== 'none') return - const newConnection = resetConnection() return () => { From f5aeedd7f6dc82357df9b2aecaadd2eb839990be Mon Sep 17 00:00:00 2001 From: Nicholas Dalhaug Date: Thu, 30 Jul 2026 16:15:00 +0200 Subject: [PATCH 4/4] Remove warning of averageDurationPerTag not on robot --- backend/api/Controllers/Models/RobotResponse.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/api/Controllers/Models/RobotResponse.cs b/backend/api/Controllers/Models/RobotResponse.cs index 2b055c967..50a4d2575 100644 --- a/backend/api/Controllers/Models/RobotResponse.cs +++ b/backend/api/Controllers/Models/RobotResponse.cs @@ -33,6 +33,8 @@ public class RobotResponse public RobotType Type { get; set; } + public float? AverageDurationPerTag { get; set; } + public IList? RobotCapabilities { get; set; } [JsonConstructor] @@ -58,6 +60,7 @@ public RobotResponse(Robot robot) IsarUri = robot.IsarUri; RobotCapabilities = robot.RobotCapabilities; Type = robot.Type; + AverageDurationPerTag = robot.AverageDurationPerTag; } } }