import React, { useState, useRef, useEffect, useMemo } from "react";
|
import { Box, Card, CardContent, Grid, Typography, Tooltip } from '@mui/material';
|
import {
|
useTranslate,
|
useRecordContext,
|
} from 'react-admin';
|
import PanelTypography from "../components/PanelTypography";
|
import * as Common from '@/utils/common'
|
|
const FlowStepTemplatePanel = () => {
|
const record = useRecordContext();
|
if (!record) return null;
|
const translate = useTranslate();
|
return (
|
<>
|
<Card sx={{ width: { xs: 300, sm: 500, md: 600, lg: 800 }, margin: 'auto' }}>
|
<CardContent>
|
<Grid container spacing={2}>
|
<Grid item xs={12} sx={{ display: 'flex', justifyContent: 'space-between' }}>
|
<Typography variant="h6" gutterBottom align="left" sx={{
|
maxWidth: { xs: '100px', sm: '180px', md: '260px', lg: '360px' },
|
whiteSpace: 'nowrap',
|
overflow: 'hidden',
|
textOverflow: 'ellipsis',
|
}}>
|
{Common.camelToPascalWithSpaces(translate('table.field.flowStepTemplate.id'))}: {record.id}
|
</Typography>
|
{/* inherit, primary, secondary, textPrimary, textSecondary, error */}
|
<Typography variant="h6" gutterBottom align="right" >
|
ID: {record.id}
|
</Typography>
|
</Grid>
|
</Grid>
|
<Grid container spacing={2}>
|
<Grid item xs={12} container alignContent="flex-end">
|
<Typography variant="caption" color="textSecondary" sx={{ wordWrap: 'break-word', wordBreak: 'break-all' }}>
|
{Common.camelToPascalWithSpaces(translate('common.field.memo'))}:{record.memo}
|
</Typography>
|
</Grid>
|
</Grid>
|
<Box height={20}> </Box>
|
<Grid container spacing={2}>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.flowStepTemplate.flowId"
|
property={record.flowId}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.flowStepTemplate.flowCode"
|
property={record.flowCode}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.flowStepTemplate.stepOrder"
|
property={record.stepOrder}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.flowStepTemplate.stepCode"
|
property={record.stepCode}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.flowStepTemplate.stepName"
|
property={record.stepName}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.flowStepTemplate.stepType"
|
property={record.stepType}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.flowStepTemplate.actionType"
|
property={record.actionType}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.flowStepTemplate.actionConfig"
|
property={record.actionConfig}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.flowStepTemplate.inputMapping"
|
property={record.inputMapping}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.flowStepTemplate.outputMapping"
|
property={record.outputMapping}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.flowStepTemplate.conditionExpression"
|
property={record.conditionExpression}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.flowStepTemplate.skipOnFail"
|
property={record.skipOnFail}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.flowStepTemplate.retryEnabled"
|
property={record.retryEnabled}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.flowStepTemplate.retryConfig"
|
property={record.retryConfig}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.flowStepTemplate.timeoutSeconds"
|
property={record.timeoutSeconds}
|
/>
|
</Grid>
|
|
</Grid>
|
</CardContent>
|
</Card >
|
</>
|
);
|
};
|
|
export default FlowStepTemplatePanel;
|