refactor(web): remove typescript

This commit is contained in:
Ali BARIN
2024-02-27 15:23:23 +00:00
parent 636870a075
commit b3ae2d2748
337 changed files with 2067 additions and 4997 deletions

View File

@@ -5,28 +5,19 @@ import Grid from '@mui/material/Grid';
import Box from '@mui/material/Box';
import AlertTitle from '@mui/material/AlertTitle';
import Alert from '@mui/material/Alert';
import type { IExecutionStep } from 'types';
import useFormatMessage from 'hooks/useFormatMessage';
import ExecutionHeader from 'components/ExecutionHeader';
import ExecutionStep from 'components/ExecutionStep';
import Container from 'components/Container';
import { GET_EXECUTION } from 'graphql/queries/get-execution';
import { GET_EXECUTION_STEPS } from 'graphql/queries/get-execution-steps';
type ExecutionParams = {
executionId: string;
};
const EXECUTION_PER_PAGE = 100;
const getLimitAndOffset = (page: number) => ({
const getLimitAndOffset = (page) => ({
limit: EXECUTION_PER_PAGE,
offset: (page - 1) * EXECUTION_PER_PAGE,
});
export default function Execution(): React.ReactElement {
const { executionId } = useParams() as ExecutionParams;
export default function Execution() {
const { executionId } = useParams();
const formatMessage = useFormatMessage();
const { data: execution } = useQuery(GET_EXECUTION, {
variables: { executionId },
@@ -34,12 +25,8 @@ export default function Execution(): React.ReactElement {
const { data, loading } = useQuery(GET_EXECUTION_STEPS, {
variables: { executionId, ...getLimitAndOffset(1) },
});
const { edges } = data?.getExecutionSteps || {};
const executionSteps: IExecutionStep[] = edges?.map(
(edge: { node: IExecutionStep }) => edge.node
);
const executionSteps = edges?.map((edge) => edge.node);
return (
<Container sx={{ py: 3 }}>
<ExecutionHeader execution={execution?.getExecution} />