Skip to content
Snippets Groups Projects
Commit 66c6bf6e authored by Sky Brewer's avatar Sky Brewer
Browse files

Fix React and other imports

parent 7010de03
No related branches found
No related tags found
2 merge requests!612Release 5.0.0,!562CE-3339: Add vite
import { useCallback, useEffect, useState, useMemo } from "react"; import {
useCallback,
useEffect,
useState,
useMemo,
FormEvent,
SyntheticEvent
} from "react";
import { import {
Button, Button,
TextField, TextField,
...@@ -115,7 +122,7 @@ export function IOCDeployDialog({ ...@@ -115,7 +122,7 @@ export function IOCDeployDialog({
getTagOrCommitIds(gitProjectId, "", "CONTAINS"); getTagOrCommitIds(gitProjectId, "", "CONTAINS");
}, [gitProjectId, getTagOrCommitIds]); }, [gitProjectId, getTagOrCommitIds]);
const onSubmit = (event: React.FormEvent<HTMLFormElement>) => { const onSubmit = (event: FormEvent<HTMLFormElement>) => {
event.preventDefault(); event.preventDefault();
setButtonDisabled(true); setButtonDisabled(true);
const { git: gitText } = event.currentTarget const { git: gitText } = event.currentTarget
...@@ -183,7 +190,7 @@ export function IOCDeployDialog({ ...@@ -183,7 +190,7 @@ export function IOCDeployDialog({
) )
}} }}
onGitQueryValueSelect={( onGitQueryValueSelect={(
_: React.SyntheticEvent<Element, Event>, _: SyntheticEvent<Element, Event>,
value: GitReference value: GitReference
) => { ) => {
setRevision(value?.reference); setRevision(value?.reference);
......
import {
DeployIcon,
UndeployIcon,
BatchDeployIcon,
BatchUndeployIcon,
StartIcon,
StopIcon
} from "./JobIcons";
export const ACTION_TYPES = { export const ACTION_TYPES = {
DEPLOY: "DEPLOY", DEPLOY: "DEPLOY",
UNDEPLOY: "UNDEPLOY", UNDEPLOY: "UNDEPLOY",
...@@ -15,30 +6,3 @@ export const ACTION_TYPES = { ...@@ -15,30 +6,3 @@ export const ACTION_TYPES = {
START: "START", START: "START",
STOP: "STOP" 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
}
};
...@@ -7,7 +7,6 @@ import { ...@@ -7,7 +7,6 @@ import {
} from "@mui/icons-material"; } from "@mui/icons-material";
import { BatchDeploySymbol } from "../../icons/BatchDeploySymbol"; import { BatchDeploySymbol } from "../../icons/BatchDeploySymbol";
import { BatchUndeploySymbol } from "../../icons/BatchUndeploySymbol"; import { BatchUndeploySymbol } from "../../icons/BatchUndeploySymbol";
import { ActionTypesComponent } from "./JobData";
const batchIconDefaultProps = { width: "25px", height: "25px" }; const batchIconDefaultProps = { width: "25px", height: "25px" };
...@@ -43,6 +42,33 @@ export interface ActionType { ...@@ -43,6 +42,33 @@ export interface ActionType {
STOP: string; 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) => { export const ActionTypeIconText = ({ action }: ActionTypeIconTextProps) => {
const Icon = ActionTypesComponent[action as keyof ActionType].icon; const Icon = ActionTypesComponent[action as keyof ActionType].icon;
......
import { HostTable, rowDescription, createRow } from "./HostTable"; import { HostTable } from "./HostTable";
export { HostTable, rowDescription, createRow }; export { HostTable };
import React from "react"; import { StrictMode } from "react";
import { createRoot } from "react-dom/client"; import { createRoot } from "react-dom/client";
import App from "./App"; import App from "./App";
import { LicenseInfo } from "@mui/x-license-pro"; import { LicenseInfo } from "@mui/x-license-pro";
...@@ -10,7 +10,7 @@ const container = document.getElementById("root"); ...@@ -10,7 +10,7 @@ const container = document.getElementById("root");
const root = createRoot(container); const root = createRoot(container);
root.render( root.render(
<React.StrictMode> <StrictMode>
<App /> <App />
</React.StrictMode> </StrictMode>
); );
import { ReactNode } from "react";
import { Provider } from "react-redux"; import { Provider } from "react-redux";
import { store } from "./store"; import { store } from "./store";
interface ReduxProviderProps { interface ReduxProviderProps {
children: React.ReactNode; children: ReactNode;
} }
export const ReduxProvider = ({ children }: ReduxProviderProps) => { export const ReduxProvider = ({ children }: ReduxProviderProps) => {
......
declare module "@ess-ics/ce-ui-common"; declare module "@ess-ics/ce-ui-common";
declare module "*.svg" { declare module "*.svg" {
import * as React from "react"; import { FunctionComponent, SVGProps, SVGSVGElement } from "react";
export const ReactComponent: React.FunctionComponent< export const ReactComponent: FunctionComponent<
React.SVGProps<SVGSVGElement> & { title?: string } SVGProps<SVGSVGElement> & { title?: string }
>; >;
const content: string; const content: string;
export default content; export default content;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment