diff --git a/src/components/IOC/IOCDeployDialog/IOCDeployDialog.tsx b/src/components/IOC/IOCDeployDialog/IOCDeployDialog.tsx index ef55d312799eb1acdbd79a5cc75dc324c56d6941..3e01e168559b2dc2c699a0e617f2057bb1696490 100644 --- a/src/components/IOC/IOCDeployDialog/IOCDeployDialog.tsx +++ b/src/components/IOC/IOCDeployDialog/IOCDeployDialog.tsx @@ -1,4 +1,11 @@ -import { useCallback, useEffect, useState, useMemo } from "react"; +import { + useCallback, + useEffect, + useState, + useMemo, + FormEvent, + SyntheticEvent +} from "react"; import { Button, TextField, @@ -115,7 +122,7 @@ export function IOCDeployDialog({ getTagOrCommitIds(gitProjectId, "", "CONTAINS"); }, [gitProjectId, getTagOrCommitIds]); - const onSubmit = (event: React.FormEvent<HTMLFormElement>) => { + const onSubmit = (event: FormEvent<HTMLFormElement>) => { event.preventDefault(); setButtonDisabled(true); const { git: gitText } = event.currentTarget @@ -183,7 +190,7 @@ export function IOCDeployDialog({ ) }} onGitQueryValueSelect={( - _: React.SyntheticEvent<Element, Event>, + _: SyntheticEvent<Element, Event>, value: GitReference ) => { setRevision(value?.reference); diff --git a/src/components/Job/JobData.ts b/src/components/Job/JobData.ts index 0a2dc39a4a5e398bf6f6fdb6ef5fc10e8a6b34d0..8b77ed29dfe214b0b798a12bccc5cb70743e1756 100644 --- a/src/components/Job/JobData.ts +++ b/src/components/Job/JobData.ts @@ -1,12 +1,3 @@ -import { - DeployIcon, - UndeployIcon, - BatchDeployIcon, - BatchUndeployIcon, - StartIcon, - StopIcon -} from "./JobIcons"; - export const ACTION_TYPES = { DEPLOY: "DEPLOY", UNDEPLOY: "UNDEPLOY", @@ -15,30 +6,3 @@ export const ACTION_TYPES = { START: "START", STOP: "STOP" }; - -export const ActionTypesComponent = { - DEPLOY: { - label: "Deployment", - icon: DeployIcon - }, - UNDEPLOY: { - label: "Undeployment", - icon: UndeployIcon - }, - BATCH_DEPLOY: { - label: "Batch deployment", - icon: BatchDeployIcon - }, - BATCH_UNDEPLOY: { - label: "Batch undeployment", - icon: BatchUndeployIcon - }, - START: { - label: "Set active", - icon: StartIcon - }, - STOP: { - label: "Set inactive", - icon: StopIcon - } -}; diff --git a/src/components/Job/JobIcons.tsx b/src/components/Job/JobIcons.tsx index 0f9e0fcb0a4c64e6872dcaaf212da5d91c6015e2..6b09c427fa67c4873a3e9767a50ab03364e54fb5 100644 --- a/src/components/Job/JobIcons.tsx +++ b/src/components/Job/JobIcons.tsx @@ -7,7 +7,6 @@ import { } from "@mui/icons-material"; import { BatchDeploySymbol } from "../../icons/BatchDeploySymbol"; import { BatchUndeploySymbol } from "../../icons/BatchUndeploySymbol"; -import { ActionTypesComponent } from "./JobData"; const batchIconDefaultProps = { width: "25px", height: "25px" }; @@ -43,6 +42,33 @@ export interface ActionType { STOP: string; } +const ActionTypesComponent = { + DEPLOY: { + label: "Deployment", + icon: DeployIcon + }, + UNDEPLOY: { + label: "Undeployment", + icon: UndeployIcon + }, + BATCH_DEPLOY: { + label: "Batch deployment", + icon: BatchDeployIcon + }, + BATCH_UNDEPLOY: { + label: "Batch undeployment", + icon: BatchUndeployIcon + }, + START: { + label: "Set active", + icon: StartIcon + }, + STOP: { + label: "Set inactive", + icon: StopIcon + } +}; + export const ActionTypeIconText = ({ action }: ActionTypeIconTextProps) => { const Icon = ActionTypesComponent[action as keyof ActionType].icon; diff --git a/src/components/host/index.js b/src/components/host/index.js index a86de3b90c119a7ce8f6e079e8ff89c2e8f9df76..30cfa0eb3958f5c3cfa4a5751a684465a4c1c1dc 100644 --- a/src/components/host/index.js +++ b/src/components/host/index.js @@ -1,3 +1,3 @@ -import { HostTable, rowDescription, createRow } from "./HostTable"; +import { HostTable } from "./HostTable"; -export { HostTable, rowDescription, createRow }; +export { HostTable }; diff --git a/src/index.jsx b/src/index.jsx index 8c20f94e6d0b819432ba091336cc9c8b829c25a0..5768ea6fbdb7ce948910f2037baf4d827326ea37 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -1,4 +1,4 @@ -import React from "react"; +import { StrictMode } from "react"; import { createRoot } from "react-dom/client"; import App from "./App"; import { LicenseInfo } from "@mui/x-license-pro"; @@ -10,7 +10,7 @@ const container = document.getElementById("root"); const root = createRoot(container); root.render( - <React.StrictMode> + <StrictMode> <App /> - </React.StrictMode> + </StrictMode> ); diff --git a/src/store/ReduxProvider.tsx b/src/store/ReduxProvider.tsx index e6be89a0a517748088c8b7c49d7a310f4983ad9b..80e11b43f60d7f489565daa0449739c268d402e9 100644 --- a/src/store/ReduxProvider.tsx +++ b/src/store/ReduxProvider.tsx @@ -1,8 +1,9 @@ +import { ReactNode } from "react"; import { Provider } from "react-redux"; import { store } from "./store"; interface ReduxProviderProps { - children: React.ReactNode; + children: ReactNode; } export const ReduxProvider = ({ children }: ReduxProviderProps) => { diff --git a/src/typings.d.ts b/src/typings.d.ts index ba496eba23bd0d83b0884a65328a07dbe8da317d..054cc31cba38b72545e22f6628b0760db89e5965 100644 --- a/src/typings.d.ts +++ b/src/typings.d.ts @@ -1,9 +1,9 @@ declare module "@ess-ics/ce-ui-common"; declare module "*.svg" { - import * as React from "react"; + import { FunctionComponent, SVGProps, SVGSVGElement } from "react"; - export const ReactComponent: React.FunctionComponent< - React.SVGProps<SVGSVGElement> & { title?: string } + export const ReactComponent: FunctionComponent< + SVGProps<SVGSVGElement> & { title?: string } >; const content: string; export default content;