Skip to content

Commit 4aee9dc

Browse files
authored
fix(cubejs-playground): Long line ellipsis (#761)
1 parent 762c1b2 commit 4aee9dc

File tree

4 files changed

+42
-20
lines changed

4 files changed

+42
-20
lines changed

packages/cubejs-playground/src/components/Order/DraggableItem.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Button } from 'antd';
2+
import { Button, Typography } from 'antd';
33
import { Draggable } from 'react-beautiful-dnd';
44
import { DragOutlined } from '@ant-design/icons';
55

@@ -19,18 +19,27 @@ export default function DraggableItem({ id, index, order = 'none', children, onO
1919
{...draggableProps}
2020
{...dragHandleProps}
2121
style={{
22+
display: 'flex',
23+
flexWrap: 'nowrap',
24+
justifyContent: 'space-between',
25+
alignItems: 'center',
2226
marginBottom: 8,
23-
...draggableProps.style
27+
...draggableProps.style,
2428
}}
25-
>
26-
<DragOutlined style={{ marginRight: 8 }} />
27-
28-
<span>{children}</span>
29+
>
30+
<DragOutlined />
31+
32+
<Typography.Text ellipsis style={{ margin: '0 auto 0 8px' }}>
33+
{children}
34+
</Typography.Text>
2935

3036
<Button
3137
type={order !== 'none' ? 'primary' : null}
3238
size="small"
33-
style={{ width: 80, float: 'right' }}
39+
style={{
40+
minWidth: 70,
41+
marginLeft: 8,
42+
}}
3443
onClick={() => onOrderChange(id, getNextOrder())}
3544
>
3645
{order.toUpperCase()}

packages/cubejs-playground/src/components/Pivot/Item.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import { Draggable } from 'react-beautiful-dnd';
33
import { DragOutlined } from '@ant-design/icons';
4+
import { Typography } from 'antd';
45

56
export default function Item({ id, index }) {
67
return (
@@ -14,9 +15,10 @@ export default function Item({ id, index }) {
1415
...draggableProps.style,
1516
}}
1617
>
17-
<DragOutlined style={{ marginRight: 8 }} />
18-
19-
<span>{id}</span>
18+
<Typography.Text ellipsis style={{ maxWidth: '100%' }}>
19+
<DragOutlined style={{ marginRight: 8 }} />
20+
{id}
21+
</Typography.Text>
2022
</div>
2123
)}
2224
</Draggable>

packages/cubejs-server-core/dev/templates/packages/react-antd-dynamic/scaffolding/src/components/QueryBuilder/Order/DraggableItem.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Button } from 'antd';
2+
import { Button, Typography } from 'antd';
33
import { Draggable } from 'react-beautiful-dnd';
44
import { DragOutlined } from '@ant-design/icons';
55

@@ -19,18 +19,27 @@ export default function DraggableItem({ id, index, order = 'none', children, onO
1919
{...draggableProps}
2020
{...dragHandleProps}
2121
style={{
22+
display: 'flex',
23+
flexWrap: 'nowrap',
24+
justifyContent: 'space-between',
25+
alignItems: 'center',
2226
marginBottom: 8,
23-
...draggableProps.style
27+
...draggableProps.style,
2428
}}
25-
>
26-
<DragOutlined style={{ marginRight: 8 }} />
27-
28-
<span>{children}</span>
29+
>
30+
<DragOutlined />
31+
32+
<Typography.Text ellipsis style={{ margin: '0 auto 0 8px' }}>
33+
{children}
34+
</Typography.Text>
2935

3036
<Button
3137
type={order !== 'none' ? 'primary' : null}
3238
size="small"
33-
style={{ width: 80, float: 'right' }}
39+
style={{
40+
minWidth: 70,
41+
marginLeft: 8,
42+
}}
3443
onClick={() => onOrderChange(id, getNextOrder())}
3544
>
3645
{order.toUpperCase()}

packages/cubejs-server-core/dev/templates/packages/react-antd-dynamic/scaffolding/src/components/QueryBuilder/Pivot/Item.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import { Draggable } from 'react-beautiful-dnd';
33
import { DragOutlined } from '@ant-design/icons';
4+
import { Typography } from 'antd';
45

56
export default function Item({ id, index }) {
67
return (
@@ -14,9 +15,10 @@ export default function Item({ id, index }) {
1415
...draggableProps.style,
1516
}}
1617
>
17-
<DragOutlined style={{ marginRight: 8 }} />
18-
19-
<span>{id}</span>
18+
<Typography.Text ellipsis style={{ maxWidth: '100%' }}>
19+
<DragOutlined style={{ marginRight: 8 }} />
20+
{id}
21+
</Typography.Text>
2022
</div>
2123
)}
2224
</Draggable>

0 commit comments

Comments
 (0)