feat: add flow app icons in execution row
This commit is contained in:
@@ -13,7 +13,11 @@ const getExecutions = async (
|
|||||||
) => {
|
) => {
|
||||||
const executions = context.currentUser
|
const executions = context.currentUser
|
||||||
.$relatedQuery('executions')
|
.$relatedQuery('executions')
|
||||||
.withGraphFetched('flow')
|
.withGraphFetched({
|
||||||
|
flow: {
|
||||||
|
steps: true
|
||||||
|
}
|
||||||
|
})
|
||||||
.orderBy('created_at', 'desc');
|
.orderBy('created_at', 'desc');
|
||||||
|
|
||||||
return paginate(executions, params.limit, params.offset);
|
return paginate(executions, params.limit, params.offset);
|
||||||
|
@@ -9,7 +9,8 @@ import { DateTime } from 'luxon';
|
|||||||
|
|
||||||
import type { IExecution } from '@automatisch/types';
|
import type { IExecution } from '@automatisch/types';
|
||||||
import * as URLS from 'config/urls';
|
import * as URLS from 'config/urls';
|
||||||
import { CardContent, Typography } from './style';
|
import FlowAppIcons from 'components/FlowAppIcons';
|
||||||
|
import { Apps, CardContent, Typography } from './style';
|
||||||
|
|
||||||
type ExecutionRowProps = {
|
type ExecutionRowProps = {
|
||||||
execution: IExecution;
|
execution: IExecution;
|
||||||
@@ -26,6 +27,10 @@ export default function ExecutionRow(props: ExecutionRowProps): React.ReactEleme
|
|||||||
<Card sx={{ mb: 1 }}>
|
<Card sx={{ mb: 1 }}>
|
||||||
<CardActionArea>
|
<CardActionArea>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
|
<Apps direction="row" gap={1} sx={{gridArea:"apps"}}>
|
||||||
|
<FlowAppIcons steps={flow.steps} />
|
||||||
|
</Apps>
|
||||||
|
|
||||||
<Stack
|
<Stack
|
||||||
justifyContent="center"
|
justifyContent="center"
|
||||||
alignItems="flex-start"
|
alignItems="flex-start"
|
||||||
|
@@ -1,15 +1,30 @@
|
|||||||
import { styled } from '@mui/material/styles';
|
import { styled } from '@mui/material/styles';
|
||||||
import MuiCardContent from '@mui/material/CardContent';
|
import MuiCardContent from '@mui/material/CardContent';
|
||||||
|
import MuiStack from '@mui/material/Stack';
|
||||||
import MuiTypography from '@mui/material/Typography';
|
import MuiTypography from '@mui/material/Typography';
|
||||||
|
|
||||||
export const CardContent = styled(MuiCardContent)(({ theme }) => ({
|
export const CardContent = styled(MuiCardContent)(({ theme }) => ({
|
||||||
display: 'grid',
|
display: 'grid',
|
||||||
gridTemplateRows: 'auto',
|
gridTemplateRows: 'auto',
|
||||||
gridTemplateColumns: '1fr auto',
|
gridTemplateColumns: 'calc(30px * 3 + 8px * 2) minmax(0, auto) min-content',
|
||||||
gridColumnGap: theme.spacing(2),
|
gridGap: theme.spacing(2),
|
||||||
|
gridTemplateAreas: `
|
||||||
|
"apps title menu"
|
||||||
|
`,
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
|
[theme.breakpoints.down('sm')]: {
|
||||||
|
gridTemplateAreas: `
|
||||||
|
"apps menu"
|
||||||
|
"title menu"
|
||||||
|
`,
|
||||||
|
gridTemplateColumns: 'minmax(0, auto) min-content',
|
||||||
|
gridTemplateRows: 'auto auto',
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
export const Apps = styled(MuiStack)(() => ({
|
||||||
|
gridArea: 'apps',
|
||||||
|
}));
|
||||||
|
|
||||||
export const Typography = styled(MuiTypography)(() => ({
|
export const Typography = styled(MuiTypography)(() => ({
|
||||||
display: 'inline-block',
|
display: 'inline-block',
|
||||||
|
@@ -17,6 +17,9 @@ export const GET_EXECUTIONS = gql`
|
|||||||
id
|
id
|
||||||
name
|
name
|
||||||
active
|
active
|
||||||
|
steps {
|
||||||
|
iconUrl
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user