Merge pull request #1991 from automatisch/AUT-1064
fix: introduce fix for overflowing inputs with long parameters names
This commit is contained in:
@@ -3,7 +3,6 @@ import * as React from 'react';
|
|||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
import { useFormContext, useWatch } from 'react-hook-form';
|
import { useFormContext, useWatch } from 'react-hook-form';
|
||||||
import Stack from '@mui/material/Stack';
|
import Stack from '@mui/material/Stack';
|
||||||
import Box from '@mui/material/Box';
|
|
||||||
import Typography from '@mui/material/Typography';
|
import Typography from '@mui/material/Typography';
|
||||||
import Divider from '@mui/material/Divider';
|
import Divider from '@mui/material/Divider';
|
||||||
import IconButton from '@mui/material/IconButton';
|
import IconButton from '@mui/material/IconButton';
|
||||||
@@ -12,6 +11,7 @@ import AddIcon from '@mui/icons-material/Add';
|
|||||||
import useFormatMessage from 'hooks/useFormatMessage';
|
import useFormatMessage from 'hooks/useFormatMessage';
|
||||||
import InputCreator from 'components/InputCreator';
|
import InputCreator from 'components/InputCreator';
|
||||||
import { EditorContext } from 'contexts/Editor';
|
import { EditorContext } from 'contexts/Editor';
|
||||||
|
import { Grid } from '@mui/material';
|
||||||
|
|
||||||
const createGroupItem = () => ({
|
const createGroupItem = () => ({
|
||||||
key: '',
|
key: '',
|
||||||
@@ -133,19 +133,16 @@ function FilterConditions(props) {
|
|||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
{group?.and?.map((groupItem, groupItemIndex) => (
|
{group?.and?.map((groupItem, groupItemIndex) => (
|
||||||
<Stack direction="row" spacing={2} key={`item-${groupItem.id}`}>
|
<Grid container key={`item-${groupItem.id}`}>
|
||||||
<Stack
|
<Grid
|
||||||
direction={{ xs: 'column', sm: 'row' }}
|
container
|
||||||
spacing={{ xs: 2 }}
|
spacing={2}
|
||||||
sx={{ display: 'flex', flex: 1 }}
|
item
|
||||||
>
|
xs={12}
|
||||||
<Box
|
sm={11}
|
||||||
sx={{
|
sx={{ order: { xs: 2, sm: 1 } }}
|
||||||
display: 'flex',
|
|
||||||
flex: '1 0 0px',
|
|
||||||
maxWidth: ['100%', '33%'],
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
|
<Grid item xs={12} md={4}>
|
||||||
<InputCreator
|
<InputCreator
|
||||||
schema={createStringArgument({
|
schema={createStringArgument({
|
||||||
key: `or.${groupIndex}.and.${groupItemIndex}.key`,
|
key: `or.${groupIndex}.and.${groupItemIndex}.key`,
|
||||||
@@ -155,15 +152,8 @@ function FilterConditions(props) {
|
|||||||
stepId={stepId}
|
stepId={stepId}
|
||||||
disabled={editorContext.readOnly}
|
disabled={editorContext.readOnly}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Grid>
|
||||||
|
<Grid item xs={12} md={4}>
|
||||||
<Box
|
|
||||||
sx={{
|
|
||||||
display: 'flex',
|
|
||||||
flex: '1 0 0px',
|
|
||||||
maxWidth: ['100%', '33%'],
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<InputCreator
|
<InputCreator
|
||||||
schema={createDropdownArgument({
|
schema={createDropdownArgument({
|
||||||
key: `or.${groupIndex}.and.${groupItemIndex}.operator`,
|
key: `or.${groupIndex}.and.${groupItemIndex}.operator`,
|
||||||
@@ -174,15 +164,8 @@ function FilterConditions(props) {
|
|||||||
stepId={stepId}
|
stepId={stepId}
|
||||||
disabled={editorContext.readOnly}
|
disabled={editorContext.readOnly}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Grid>
|
||||||
|
<Grid item xs={12} md={4}>
|
||||||
<Box
|
|
||||||
sx={{
|
|
||||||
display: 'flex',
|
|
||||||
flex: '1 0 0px',
|
|
||||||
maxWidth: ['100%', '33%'],
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<InputCreator
|
<InputCreator
|
||||||
schema={createStringArgument({
|
schema={createStringArgument({
|
||||||
key: `or.${groupIndex}.and.${groupItemIndex}.value`,
|
key: `or.${groupIndex}.and.${groupItemIndex}.value`,
|
||||||
@@ -192,19 +175,28 @@ function FilterConditions(props) {
|
|||||||
stepId={stepId}
|
stepId={stepId}
|
||||||
disabled={editorContext.readOnly}
|
disabled={editorContext.readOnly}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Grid>
|
||||||
</Stack>
|
</Grid>
|
||||||
|
<Grid item xs={12} sm={1} sx={{ order: { xs: 1, sm: 2 } }}>
|
||||||
|
<Stack justifyContent="center" alignItems="flex-end">
|
||||||
<IconButton
|
<IconButton
|
||||||
size="small"
|
size="small"
|
||||||
edge="start"
|
edge="start"
|
||||||
onClick={() => removeGroupItem(groupIndex, groupItemIndex)}
|
onClick={() =>
|
||||||
sx={{ width: 61, height: 61 }}
|
removeGroupItem(groupIndex, groupItemIndex)
|
||||||
|
}
|
||||||
|
sx={{
|
||||||
|
width: 40,
|
||||||
|
height: 40,
|
||||||
|
mb: { xs: 2, sm: 0 },
|
||||||
|
}}
|
||||||
disabled={groups.length === 1 && group.and.length === 1}
|
disabled={groups.length === 1 && group.and.length === 1}
|
||||||
>
|
>
|
||||||
<RemoveIcon />
|
<RemoveIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
<Stack spacing={1} direction="row">
|
<Stack spacing={1} direction="row">
|
||||||
|
Reference in New Issue
Block a user