From cbf6adacbf73cd64eedde33abf8d8b459b98df9f Mon Sep 17 00:00:00 2001 From: Eddasol Date: Tue, 12 Nov 2024 09:47:10 +0100 Subject: [PATCH] Remove unnecessary exports --- frontend/src/api/ApiError.tsx | 2 +- frontend/src/components/Contexts/AlertContext.tsx | 2 +- frontend/src/components/Contexts/LanguageContext.tsx | 2 +- frontend/src/components/Contexts/MediaStreamContext.tsx | 2 +- frontend/src/components/Contexts/MissionControlContext.tsx | 4 ++-- .../src/components/Contexts/MissionDefinitionsContext.tsx | 4 ++-- frontend/src/components/Contexts/MissionFilterContext.tsx | 2 +- frontend/src/components/Contexts/MissionRunsContext.tsx | 4 ++-- frontend/src/components/Contexts/RobotContext.tsx | 4 ++-- frontend/src/components/Contexts/SignalRContext.tsx | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/frontend/src/api/ApiError.tsx b/frontend/src/api/ApiError.tsx index 4cb02a39..d78e52ad 100644 --- a/frontend/src/api/ApiError.tsx +++ b/frontend/src/api/ApiError.tsx @@ -1,6 +1,6 @@ import { CustomError } from 'ts-custom-error' -export const StatusTexts: { [key: number]: string } = { +const StatusTexts: { [key: number]: string } = { 400: 'Bad Request', 401: 'Unauthorized', // RFC 7235 402: 'Payment Required', diff --git a/frontend/src/components/Contexts/AlertContext.tsx b/frontend/src/components/Contexts/AlertContext.tsx index 579fabff..bf813f5d 100644 --- a/frontend/src/components/Contexts/AlertContext.tsx +++ b/frontend/src/components/Contexts/AlertContext.tsx @@ -62,7 +62,7 @@ const defaultAlertInterface = { clearListAlert: (source: AlertType) => {}, } -export const AlertContext = createContext(defaultAlertInterface) +const AlertContext = createContext(defaultAlertInterface) export const AlertProvider: FC = ({ children }) => { const [alerts, setAlerts] = useState(defaultAlertInterface.alerts) diff --git a/frontend/src/components/Contexts/LanguageContext.tsx b/frontend/src/components/Contexts/LanguageContext.tsx index a9a12f65..df11230c 100644 --- a/frontend/src/components/Contexts/LanguageContext.tsx +++ b/frontend/src/components/Contexts/LanguageContext.tsx @@ -19,7 +19,7 @@ const defaultLanguageInterface = { TranslateText: (str: string) => '', } -export const LanguageContext = createContext(defaultLanguageInterface) +const LanguageContext = createContext(defaultLanguageInterface) export const LanguageProvider: FC = ({ children }) => { const prevLanguage = window.localStorage.getItem('flotilla-language') diff --git a/frontend/src/components/Contexts/MediaStreamContext.tsx b/frontend/src/components/Contexts/MediaStreamContext.tsx index a7d31ce0..118893e8 100644 --- a/frontend/src/components/Contexts/MediaStreamContext.tsx +++ b/frontend/src/components/Contexts/MediaStreamContext.tsx @@ -27,7 +27,7 @@ const defaultMediaStreamInterface = { mediaStreams: {}, } -export const MediaStreamContext = createContext(defaultMediaStreamInterface) +const MediaStreamContext = createContext(defaultMediaStreamInterface) export const MediaStreamProvider: FC = ({ children }) => { const [mediaStreams, setMediaStreams] = useState( diff --git a/frontend/src/components/Contexts/MissionControlContext.tsx b/frontend/src/components/Contexts/MissionControlContext.tsx index 929c7a55..037105ca 100644 --- a/frontend/src/components/Contexts/MissionControlContext.tsx +++ b/frontend/src/components/Contexts/MissionControlContext.tsx @@ -15,7 +15,7 @@ interface Props { children: React.ReactNode } -export interface IMissionControlContext { +interface IMissionControlContext { missionControlState: IMissionControlState updateRobotMissionState: (newState: MissionStatusRequest, robotId: string) => void } @@ -25,7 +25,7 @@ const defaultMissionControlInterface = { updateRobotMissionState: (newState: MissionStatusRequest, robotId: string) => {}, } -export const MissionControlContext = createContext(defaultMissionControlInterface) +const MissionControlContext = createContext(defaultMissionControlInterface) const defaultManagementState: IMissionControlState = { isRobotMissionWaitingForResponseDict: {}, } diff --git a/frontend/src/components/Contexts/MissionDefinitionsContext.tsx b/frontend/src/components/Contexts/MissionDefinitionsContext.tsx index b9ab78c4..431722d1 100644 --- a/frontend/src/components/Contexts/MissionDefinitionsContext.tsx +++ b/frontend/src/components/Contexts/MissionDefinitionsContext.tsx @@ -20,7 +20,7 @@ const defaultMissionDefinitionsContext: IMissionDefinitionsContext = { missionDefinitions: [], } -export const MissionDefinitionsContext = createContext(defaultMissionDefinitionsContext) +const MissionDefinitionsContext = createContext(defaultMissionDefinitionsContext) const upsertMissionDefinition = (oldQueue: MissionDefinition[], updatedMission: MissionDefinition) => { const oldQueueCopy = [...oldQueue] @@ -39,7 +39,7 @@ const fetchMissionDefinitions = (params: { orderBy: string }): Promise => BackendAPICaller.getMissionDefinitions(params).then((response) => response.content) -export const useMissionDefinitions = (): IMissionDefinitionsContext => { +const useMissionDefinitions = (): IMissionDefinitionsContext => { const [missionDefinitions, setMissionDefinitions] = useState([]) const { registerEvent, connectionReady } = useSignalRContext() const { installationCode } = useInstallationContext() diff --git a/frontend/src/components/Contexts/MissionFilterContext.tsx b/frontend/src/components/Contexts/MissionFilterContext.tsx index 3a0b9249..9ff731c3 100644 --- a/frontend/src/components/Contexts/MissionFilterContext.tsx +++ b/frontend/src/components/Contexts/MissionFilterContext.tsx @@ -92,7 +92,7 @@ const defaultMissionFilterInterface: IMissionFilterContext = { }, } -export const MissionFilterContext = createContext(defaultMissionFilterInterface) +const MissionFilterContext = createContext(defaultMissionFilterInterface) export const MissionFilterProvider: FC = ({ children }) => { const { TranslateText } = useLanguageContext() diff --git a/frontend/src/components/Contexts/MissionRunsContext.tsx b/frontend/src/components/Contexts/MissionRunsContext.tsx index 4be3a4f6..9c42e0a7 100644 --- a/frontend/src/components/Contexts/MissionRunsContext.tsx +++ b/frontend/src/components/Contexts/MissionRunsContext.tsx @@ -34,7 +34,7 @@ const defaultMissionRunsContext: IMissionRunsContext = { setLoadingMissionSet: (newLoadingMissionSet: Set | ((mission: Set) => Set)) => {}, } -export const MissionRunsContext = createContext(defaultMissionRunsContext) +const MissionRunsContext = createContext(defaultMissionRunsContext) const updateQueueIfMissionAlreadyQueued = (oldQueue: Mission[], updatedMission: Mission) => { const existingMissionIndex = oldQueue.findIndex((m) => m.id === updatedMission.id) @@ -76,7 +76,7 @@ const fetchMissionRuns = (params: { orderBy: string }): Promise => BackendAPICaller.getMissionRuns(params).then((response) => response.content) -export const useMissionRuns = (): IMissionRunsContext => { +const useMissionRuns = (): IMissionRunsContext => { const [ongoingMissions, setOngoingMissions] = useState([]) const [missionQueue, setMissionQueue] = useState([]) const [loadingMissionSet, setLoadingMissionSet] = useState>(new Set()) diff --git a/frontend/src/components/Contexts/RobotContext.tsx b/frontend/src/components/Contexts/RobotContext.tsx index 6c3c6da0..0f7869d0 100644 --- a/frontend/src/components/Contexts/RobotContext.tsx +++ b/frontend/src/components/Contexts/RobotContext.tsx @@ -20,7 +20,7 @@ interface Props { children: React.ReactNode } -export interface IRobotContext { +interface IRobotContext { enabledRobots: Robot[] } @@ -28,7 +28,7 @@ const defaultRobotState = { enabledRobots: [], } -export const RobotContext = createContext(defaultRobotState) +const RobotContext = createContext(defaultRobotState) export const RobotProvider: FC = ({ children }) => { const [enabledRobots, setEnabledRobots] = useState(defaultRobotState.enabledRobots) diff --git a/frontend/src/components/Contexts/SignalRContext.tsx b/frontend/src/components/Contexts/SignalRContext.tsx index f2859576..6e9a8095 100644 --- a/frontend/src/components/Contexts/SignalRContext.tsx +++ b/frontend/src/components/Contexts/SignalRContext.tsx @@ -51,7 +51,7 @@ const defaultSignalRInterface = { const URL = config.BACKEND_API_SIGNALR_URL -export const SignalRContext = createContext(defaultSignalRInterface) +const SignalRContext = createContext(defaultSignalRInterface) export const SignalRProvider: FC = ({ children }) => { const [connection, setConnection] = useState(defaultSignalRInterface.connection)